summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2016-04-19 07:31:50 +0200
committerStefan Metzmacher <metze@samba.org>2016-04-28 16:51:16 +0200
commit53be47410236ef7c90fe895f49f300e3fe47a8bf (patch)
treeb4820442d6c8036e6978b49239df0b5cfbaf0711 /source3
parentd97b347d041f9b5c0aa71f35526cbefd56f3500b (diff)
downloadsamba-53be47410236ef7c90fe895f49f300e3fe47a8bf.tar.gz
s3:libsmb: use password = NULL for anonymous connections
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11858 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/cliconnect.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 2c351dda9c5..b8a8c7a0839 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -1325,6 +1325,17 @@ static struct tevent_req *cli_session_setup_gensec_send(
talloc_set_destructor(
state, cli_session_setup_gensec_state_destructor);
+ if (user == NULL || strlen(user) == 0) {
+ if (pass != NULL && strlen(pass) == 0) {
+ /*
+ * some callers pass "" as no password
+ *
+ * gensec only handles NULL as no password.
+ */
+ pass = NULL;
+ }
+ }
+
status = auth_generic_client_prepare(state, &state->auth_generic);
if (tevent_req_nterror(req, status)) {
return tevent_req_post(req, ev);