diff options
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/clidfs.c | 9 | ||||
-rw-r--r-- | source3/libsmb/libsmb_server.c | 11 |
2 files changed, 20 insertions, 0 deletions
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c index 5e944f1aaa..53dc6d7984 100644 --- a/source3/libsmb/clidfs.c +++ b/source3/libsmb/clidfs.c @@ -216,6 +216,15 @@ static struct cli_state *do_connect(TALLOC_CTX *ctx, return NULL; } d_printf("Anonymous login successful\n"); + status = cli_init_creds(c, "", lp_workgroup(), ""); + } else { + status = cli_init_creds(c, username, lp_workgroup(), password); + } + + if (!NT_STATUS_IS_OK(status)) { + DEBUG(10,("cli_init_creds() failed: %s\n", nt_errstr(status))); + cli_shutdown(c); + return NULL; } if ( show_sessetup ) { diff --git a/source3/libsmb/libsmb_server.c b/source3/libsmb/libsmb_server.c index 60849c812f..18b12a1a9b 100644 --- a/source3/libsmb/libsmb_server.c +++ b/source3/libsmb/libsmb_server.c @@ -498,6 +498,17 @@ again: errno = EPERM; return NULL; } + status = cli_init_creds(c, username_used, + *pp_workgroup, *pp_password); + } else { + status = cli_init_creds(c, username_used, + *pp_workgroup, *pp_password); + } + + if (!NT_STATUS_IS_OK(status)) { + errno = map_errno_from_nt_status(status); + cli_shutdown(c); + return NULL; } DEBUG(4,(" session setup ok\n")); |