diff options
author | Christian Ambach <ambi@samba.org> | 2016-01-27 22:00:31 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2016-01-28 09:58:26 +0100 |
commit | cac1086ae12d10a6c424f947045d26badc96d751 (patch) | |
tree | 6fde0816da63d3b60ca2b88f667b9682d30f1b41 | |
parent | bf1c1ad068a763108f9b8f79431de522783a4302 (diff) | |
download | samba-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.c | 10 |
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 " |