s4-smb_server: check for return code of cli_credentials_set_machine_account().
authorGünther Deschner <gd@samba.org>
Sat, 26 Sep 2015 00:18:44 +0000 (02:18 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 17 Mar 2016 16:17:16 +0000 (17:17 +0100)
We keep anonymous server_credentials structure in order to let
the rpc.spoolss.notify start it's test server.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Günther Deschner <gd@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
source4/smb_server/smb/negprot.c
source4/smb_server/smb2/negprot.c

index cdfa2b4046f7c0596e1131037ae65fdc30482e9d..dfcc1a29bf28f0ad9594093c989f9a3490b8dca0 100644 (file)
@@ -387,8 +387,10 @@ static void reply_nt1(struct smbsrv_request *req, uint16_t choice)
                nt_status = cli_credentials_set_machine_account(server_credentials, req->smb_conn->lp_ctx);
                if (!NT_STATUS_IS_OK(nt_status)) {
                        DEBUG(10, ("Failed to obtain server credentials, perhaps a standalone server?: %s\n", nt_errstr(nt_status)));
-                       talloc_free(server_credentials);
-                       server_credentials = NULL;
+                       /*
+                        * We keep the server_credentials as anonymous
+                        * this is required for the spoolss.notify test
+                        */
                }
 
                nt_status = samba_server_gensec_start(req,
index b48b1700bf04bcd9dd9ff9f37641471a235e35db..e654392ccbf503478edd8270db0de0a14ee1c651 100644 (file)
@@ -49,8 +49,10 @@ static NTSTATUS smb2srv_negprot_secblob(struct smb2srv_request *req, DATA_BLOB *
        nt_status = cli_credentials_set_machine_account(server_credentials, req->smb_conn->lp_ctx);
        if (!NT_STATUS_IS_OK(nt_status)) {
                DEBUG(10, ("Failed to obtain server credentials, perhaps a standalone server?: %s\n", nt_errstr(nt_status)));
-               talloc_free(server_credentials);
-               server_credentials = NULL;
+               /*
+                * We keep the server_credentials as anonymous
+                * this is required for the spoolss.notify test
+                */
        }
 
        req->smb_conn->negotiate.server_credentials = talloc_steal(req->smb_conn, server_credentials);