1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-17 02:05:21 +03:00

r6483: fix anonymous connections, '-U %' or '-U ""%""' can be used for this

metze
This commit is contained in:
Stefan Metzmacher 2005-04-26 07:10:43 +00:00 committed by Gerald (Jerry) Carter
parent ebe7071b2e
commit d31b4d7df3
2 changed files with 6 additions and 1 deletions

View File

@ -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));
}
}

View File

@ -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;