diff options
author | Jeremy Allison <jra@samba.org> | 2001-09-20 21:06:02 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-09-20 21:06:02 +0000 |
commit | b54692bea7b6c75d38505ce2995c7f4472a4f4fb (patch) | |
tree | 6745703617b0f056b651f6e66dcebf1431169106 /source3/client | |
parent | fa6713bf8b121a45e59235786eec3cee29e92e67 (diff) | |
download | samba-b54692bea7b6c75d38505ce2995c7f4472a4f4fb.tar.gz samba-b54692bea7b6c75d38505ce2995c7f4472a4f4fb.tar.bz2 samba-b54692bea7b6c75d38505ce2995c7f4472a4f4fb.zip |
smbmount fixes from Urban.
Jeremy.
(This used to be commit 73ec9392396af6183bdf43b9f8ac0a6a0359a074)
Diffstat (limited to 'source3/client')
-rw-r--r-- | source3/client/smbmount.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/source3/client/smbmount.c b/source3/client/smbmount.c index 8650152faf..56a1443722 100644 --- a/source3/client/smbmount.c +++ b/source3/client/smbmount.c @@ -195,11 +195,17 @@ static struct cli_state *do_connection(char *service) password, strlen(password), password, strlen(password), workgroup)) { - DEBUG(0,("%d: session setup failed: %s\n", - getpid(), cli_errstr(c))); - cli_shutdown(c); - SAFE_FREE(c); - return NULL; + /* if a password was not supplied then try again with a + null username */ + if (password[0] || !username[0] || + !cli_session_setup(c, "", "", 0, "", 0, workgroup)) { + DEBUG(0,("%d: session setup failed: %s\n", + getpid(), cli_errstr(c))); + cli_shutdown(c); + SAFE_FREE(c); + return NULL; + } + DEBUG(0,("Anonymous login successful\n")); } DEBUG(4,("%d: session setup ok\n", getpid())); @@ -776,6 +782,7 @@ static void parse_mount_smb(int argc, char **argv) fprintf(stderr, "Unhandled option: %s\n", opteq+1); exit(1); } else if(!strcmp(opts, "guest")) { + *password = '\0'; got_pass = True; } else if(!strcmp(opts, "rw")) { mount_ro = 0; @@ -816,6 +823,15 @@ static void parse_mount_smb(int argc, char **argv) /* here we are interactive, even if run from autofs */ setup_logging("mount.smbfs",True); + /* CLI_FORCE_ASCII=false makes smbmount negotiate unicode. The default + is to not announce any unicode capabilities as current smbfs does + not support it. */ + p = getenv("CLI_FORCE_ASCII"); + if (p && !strcmp(p, "false")) + unsetenv("CLI_FORCE_ASCII"); + else + setenv("CLI_FORCE_ASCII", "true", 1); + TimeInit(); in_client = True; /* Make sure that we tell lp_load we are */ |