Fix bug found by Herb. The vuid entry in the cli_state structure gets
authorjra <jra@0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Wed, 8 Aug 2007 23:56:55 +0000 (23:56 +0000)
committerjra <jra@0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Wed, 8 Aug 2007 23:56:55 +0000 (23:56 +0000)
left as nonzero as returned by the failed cli_session_setup_spnego. When we then try
to authenticate as the user in cli_session_setup this returns an
error "Bad userid" (as seen in wireshark).
"We should only leave cli->vuid != 0 on success. Looks like it's
getting set in the cli_session_setup_blob_receive() call and not
cleared again on error."
Jeremy.

git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_3_2@24281 0c0555d6-39d7-0310-84fc-f1cc0bd64818

source/libsmb/cliconnect.c

index 58f893b0600d7c6e7729937678f5fb451733b63a..c03097acc3f064df31fcaef3dbf87964afea1699 100644 (file)
@@ -583,6 +583,7 @@ static BOOL cli_session_setup_blob(struct cli_state *cli, DATA_BLOB blob, DATA_B
                                        NT_STATUS_MORE_PROCESSING_REQUIRED)) {
                        DEBUG(0, ("cli_session_setup_blob: recieve failed (%s)\n",
                                nt_errstr(cli_get_nt_error(cli)) ));
+                       cli->vuid = 0;
                        return False;
                }
        }
@@ -769,6 +770,9 @@ static NTSTATUS cli_session_setup_ntlmssp(struct cli_state *cli, const char *use
 
        ntlmssp_end(&ntlmssp_state);
 
+       if (!NT_STATUS_IS_OK(nt_status)) {
+               cli->vuid = 0;
+       }
        return nt_status;
 }