summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2016-04-19 07:31:50 +0200
committerKarolin Seeger <kseeger@samba.org>2016-04-29 12:06:25 +0200
commit8c6865da5a96327737d219b11363a9db217909c2 (patch)
tree8a5d6e73ecbdf4d990119e078c1339e7d74c3798
parentabbb1ab296b6f891bd73ea95ddab02da0b7ec79b (diff)
downloadsamba-8c6865da5a96327737d219b11363a9db217909c2.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> (cherry picked from commit 53be47410236ef7c90fe895f49f300e3fe47a8bf)
-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 039fba2c71b..b518ab888f0 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -1343,6 +1343,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);