The Samba-Bugzilla – Attachment 11753 Details for
Bug 6482
smbget does not accept -u/p/w options with -R
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
possible patch
6482.patch (text/plain), 1.79 KB, created by
Christian Ambach
on 2015-12-30 22:29:20 UTC
(
hide
)
Description:
possible patch
Filename:
MIME Type:
Creator:
Christian Ambach
Created:
2015-12-30 22:29:20 UTC
Size:
1.79 KB
patch
obsolete
>From ff5b90e252bcffeef677e8a598e256f877957ed3 Mon Sep 17 00:00:00 2001 >From: Christian Ambach <ambi@samba.org> >Date: Wed, 30 Dec 2015 21:25:13 +0100 >Subject: [PATCH] smbget: fix recursive download > >get_auth_data is called multiple times (once for the directory listing and then >for every file to be downloaded). Save the obtained values across multiple calls >to make smbclient use the correct username for each download. > >Bug: https://bugzilla.samba.org/show_bug.cgi?id=6482 >Signed-off-by: Christian Ambach <ambi@samba.org> >--- > source3/utils/smbget.c | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > >diff --git a/source3/utils/smbget.c b/source3/utils/smbget.c >index b3ce743..7302507 100644 >--- a/source3/utils/smbget.c >+++ b/source3/utils/smbget.c >@@ -91,10 +91,18 @@ static void human_readable(off_t s, char *buffer, int l) > static void get_auth_data(const char *srv, const char *shr, char *wg, int wglen, char *un, int unlen, char *pw, int pwlen) > { > static char hasasked = 0; >+ static fstring savedwg; >+ static fstring savedun; >+ static fstring savedpw; > char *wgtmp, *usertmp; > char tmp[128]; > >- if(hasasked) return; >+ if (hasasked) { >+ strncpy(wg, savedwg, wglen-1); >+ strncpy(un, savedun, unlen-1); >+ strncpy(pw, savedpw, pwlen-1); >+ return; >+ } > hasasked = 1; > > if(!nonprompt && !username) { >@@ -119,6 +127,11 @@ static void get_auth_data(const char *srv, const char *shr, char *wg, int wglen, > > if(workgroup)strncpy(wg, workgroup, wglen-1); > >+ // save the values found for later >+ strncpy(savedwg, wg, sizeof(savedwg)-1); >+ strncpy(savedun, un, sizeof(savedun)-1); >+ strncpy(savedpw, pw, sizeof(savedpw)-1); >+ > wgtmp = SMB_STRNDUP(wg, wglen); > usertmp = SMB_STRNDUP(un, unlen); > if(!quiet)printf("Using workgroup %s, %s%s\n", wgtmp, *usertmp?"user ":"guest user", usertmp); >-- >1.9.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 6482
:
11753
|
11798