summaryrefslogtreecommitdiff
path: root/source3/libsmb/libsmbclient.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-12-07 12:26:32 -0800
committerJeremy Allison <jra@samba.org>2007-12-07 12:26:32 -0800
commitacf15ae730c95443681404c76b67ccfca0253d8b (patch)
treea5db2ab6e2848548b4dd218daab1bc32f93b9cac /source3/libsmb/libsmbclient.c
parent590da03ba342ea51561822512322d846bc4faade (diff)
downloadsamba-acf15ae730c95443681404c76b67ccfca0253d8b.tar.gz
samba-acf15ae730c95443681404c76b67ccfca0253d8b.tar.bz2
samba-acf15ae730c95443681404c76b67ccfca0253d8b.zip
Don't build rpctorture anymore - not maintained. Just remove.
Remove all vestiges of pstring (except for smbctool as noted in previous commit). Jeremy (This used to be commit 4c32a22ac50ada3275d2ffba3c1aa08bee7d1549)
Diffstat (limited to 'source3/libsmb/libsmbclient.c')
-rw-r--r--source3/libsmb/libsmbclient.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/source3/libsmb/libsmbclient.c b/source3/libsmb/libsmbclient.c
index b654ea07f0..de2eaa7cfa 100644
--- a/source3/libsmb/libsmbclient.c
+++ b/source3/libsmb/libsmbclient.c
@@ -2794,8 +2794,17 @@ smbc_opendir_ctx(SMBCCTX *context,
? INT_MAX
: context->options.browse_max_lmb_count);
- pstrcpy(u_info.username, user);
- pstrcpy(u_info.password, password);
+ memset(&u_info, '\0', sizeof(u_info));
+ u_info.username = talloc_strdup(frame,user);
+ u_info.password = talloc_strdup(frame,password);
+ if (!u_info.username || !u_info.password) {
+ if (dir) {
+ SAFE_FREE(dir->fname);
+ SAFE_FREE(dir);
+ }
+ TALLOC_FREE(frame);
+ return NULL;
+ }
/*
* We have server and share and path empty but options
@@ -2912,7 +2921,7 @@ smbc_opendir_ctx(SMBCCTX *context,
}
TALLOC_FREE(frame);
return NULL;
-
+
}
/*
@@ -3181,19 +3190,15 @@ smbc_closedir_ctx(SMBCCTX *context,
if (!context || !context->internal ||
!context->internal->_initialized) {
-
errno = EINVAL;
TALLOC_FREE(frame);
return -1;
-
}
if (!dir || !DLIST_CONTAINS(context->internal->_files, dir)) {
-
errno = EBADF;
TALLOC_FREE(frame);
return -1;
-
}
smbc_remove_dir(dir); /* Clean it up */