summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Ambach <ambi@samba.org>2016-01-27 22:00:31 +0100
committerAndreas Schneider <asn@cryptomilk.org>2016-01-28 09:58:26 +0100
commitcac1086ae12d10a6c424f947045d26badc96d751 (patch)
tree6fde0816da63d3b60ca2b88f667b9682d30f1b41
parentbf1c1ad068a763108f9b8f79431de522783a4302 (diff)
downloadsamba-cac1086ae12d10a6c424f947045d26badc96d751.tar.gz
s3-utils/smbget: Fix user-/name password reading from rcfile
As the password option is gone, code needs to be able to read password from user parameter when user%password syntax is used. Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
-rw-r--r--source3/utils/smbget.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source3/utils/smbget.c b/source3/utils/smbget.c
index e332b2d99b4..1dd8d775747 100644
--- a/source3/utils/smbget.c
+++ b/source3/utils/smbget.c
@@ -738,6 +738,16 @@ static int readrcfile(const char *name, const struct poptOption long_options[])
case POPT_ARG_STRING:
stringdata = (char **)long_options[i].arg;
*stringdata = SMB_STRDUP(val);
+ if (long_options[i].shortName == 'U') {
+ char *p;
+ opt.username_specified = true;
+ p = strchr(*stringdata, '%');
+ if (p != NULL) {
+ *p = '\0';
+ opt.password = p + 1;
+ opt.password_specified = true;
+ }
+ }
break;
default:
fprintf(stderr, "Invalid variable %s at "