s3:libsmb: remove target_principal argument from cli_session_setup_gensec_send()
authorStefan Metzmacher <metze@samba.org>
Thu, 27 Oct 2016 13:03:07 +0000 (15:03 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 15 Nov 2016 10:00:27 +0000 (11:00 +0100)
It's enough to pass down target_service and target_hostname, that's all we
have at the smb layer. The kerberos layer should figure out what
the final target_principals is based on the users realm.

The gse_krb5 backend doesn't use it currently, so it's also unused.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/libsmb/cliconnect.c

index 0b5c5a67ac49f514e88d79b5c60552b28a09f70d..706439a8638047060d2488d96c9c1e3b01555b4b 100644 (file)
@@ -558,8 +558,7 @@ static struct tevent_req *cli_session_setup_gensec_send(
        const char *user, const char *pass, const char *domain,
        enum credentials_use_kerberos krb5_state,
        const char *target_service,
-       const char *target_hostname,
-       const char *target_principal)
+       const char *target_hostname)
 {
        struct tevent_req *req;
        struct cli_session_setup_gensec_state *state;
@@ -671,15 +670,6 @@ static struct tevent_req *cli_session_setup_gensec_send(
                }
        }
 
-       if (target_principal != NULL) {
-               status = gensec_set_target_principal(
-                               state->auth_generic->gensec_security,
-                               target_principal);
-               if (tevent_req_nterror(req, status)) {
-                       return tevent_req_post(req, ev);
-               }
-       }
-
        b = smbXcli_conn_server_gss_blob(cli->conn);
        if (b != NULL) {
                state->blob_in = *b;
@@ -1147,7 +1137,7 @@ static struct tevent_req *cli_session_setup_spnego_send(
                                state, ev, cli,
                                state->account, pass, user_domain,
                                CRED_MUST_USE_KERBEROS,
-                               "cifs", state->target_hostname, principal);
+                               "cifs", state->target_hostname);
                        if (tevent_req_nomem(subreq, req)) {
                                return tevent_req_post(req, ev);
                        }
@@ -1164,7 +1154,7 @@ ntlmssp:
                state, state->ev, state->cli,
                state->account, state->pass, state->user_domain,
                CRED_DONT_USE_KERBEROS,
-               "cifs", state->target_hostname, NULL);
+               "cifs", state->target_hostname);
        if (tevent_req_nomem(subreq, req)) {
                return tevent_req_post(req, ev);
        }
@@ -1196,7 +1186,7 @@ static void cli_session_setup_spnego_done_krb(struct tevent_req *subreq)
                state, state->ev, state->cli,
                state->account, state->pass, state->user_domain,
                CRED_DONT_USE_KERBEROS,
-               "cifs", state->target_hostname, NULL);
+               "cifs", state->target_hostname);
        if (tevent_req_nomem(subreq, req)) {
                return;
        }