From acf15ae730c95443681404c76b67ccfca0253d8b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 7 Dec 2007 12:26:32 -0800 Subject: 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) --- source3/libsmb/libsmbclient.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'source3/libsmb/libsmbclient.c') 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 */ -- cgit