summaryrefslogtreecommitdiffstats
path: root/source/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
commit4c32a22ac50ada3275d2ffba3c1aa08bee7d1549 (patch)
tree455cc3cf009e05c964254a782bdde8fd85249cf8 /source/libsmb/libsmbclient.c
parent86700b7e2e79e634b41c272632e42b2e64f58ba3 (diff)
downloadsamba-4c32a22ac50ada3275d2ffba3c1aa08bee7d1549.tar.gz
samba-4c32a22ac50ada3275d2ffba3c1aa08bee7d1549.tar.xz
samba-4c32a22ac50ada3275d2ffba3c1aa08bee7d1549.zip
Don't build rpctorture anymore - not maintained. Just remove.
Remove all vestiges of pstring (except for smbctool as noted in previous commit). Jeremy
Diffstat (limited to 'source/libsmb/libsmbclient.c')
-rw-r--r--source/libsmb/libsmbclient.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/source/libsmb/libsmbclient.c b/source/libsmb/libsmbclient.c
index b654ea07f0f..de2eaa7cfaf 100644
--- a/source/libsmb/libsmbclient.c
+++ b/source/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 */