summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/lib/cmdline/popt_common.c2
-rw-r--r--source4/lib/credentials.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/source4/lib/cmdline/popt_common.c b/source4/lib/cmdline/popt_common.c
index 68f491a188..94b72c520d 100644
--- a/source4/lib/cmdline/popt_common.c
+++ b/source4/lib/cmdline/popt_common.c
@@ -197,7 +197,7 @@ static void popt_common_credentials_callback(poptContext con,
cli_credentials_parse_string(cmdline_credentials, arg, CRED_SPECIFIED);
- if ((lp=strchr_m(arg,'%'))) {
+ if (cmdline_credentials->password && (lp=strchr_m(arg,'%'))) {
memset(lp,0,strlen(cmdline_credentials->password));
}
}
diff --git a/source4/lib/credentials.c b/source4/lib/credentials.c
index f5ce886ed0..db796cde35 100644
--- a/source4/lib/credentials.c
+++ b/source4/lib/credentials.c
@@ -363,6 +363,11 @@ void cli_credentials_parse_string(struct cli_credentials *credentials, const cha
{
char *uname, *p;
+ if (strcmp("%",data) == 0) {
+ cli_credentials_set_anonymous(credentials);
+ return;
+ }
+
uname = talloc_strdup(credentials, data);
if ((p = strchr_m(uname,'%'))) {
*p = 0;