Rename server_info->was_mapped to server_info->nss_token
authorVolker Lendecke <vl@samba.org>
Tue, 6 May 2008 15:37:00 +0000 (17:37 +0200)
committerVolker Lendecke <vl@samba.org>
Wed, 7 May 2008 12:47:29 +0000 (14:47 +0200)
"nss_token" from my point of view much better reflects what this flag actually
represents
(This used to be commit b121a5acb2ef0bb3067d953b028696175432f10d)

source3/auth/auth_domain.c
source3/auth/auth_ntlmssp.c
source3/auth/auth_sam.c
source3/auth/auth_util.c
source3/auth/auth_winbind.c
source3/include/auth.h
source3/smbd/sesssetup.c

index f526677eca6848d9ad2c15ccc9a8542379b2cfb5..f483718552b9d07c8198a87858d4772efbe2e62f 100644 (file)
@@ -270,9 +270,7 @@ static NTSTATUS domain_client_validate(TALLOC_CTX *mem_ctx,
                                                info3);
 
                if (NT_STATUS_IS_OK(nt_status)) {
-                       if (user_info->was_mapped) {
-                               (*server_info)->was_mapped = user_info->was_mapped;
-                       }
+                       (*server_info)->nss_token |= user_info->was_mapped;
 
                        if ( ! (*server_info)->guest) {
                                /* if a real user check pam account restrictions */
index b6c26a1fc8bce424ea7b58ca9b832b69a28bfbdd..0d46b14f97e54f1e560c7f2216d45c13905fc5e6 100644 (file)
@@ -122,7 +122,7 @@ static NTSTATUS auth_ntlmssp_check_password(struct ntlmssp_state *ntlmssp_state,
                return nt_status;
        }
 
-       auth_ntlmssp_state->server_info->was_mapped |= username_was_mapped;
+       auth_ntlmssp_state->server_info->nss_token |= username_was_mapped;
 
        nt_status = create_local_token(auth_ntlmssp_state->server_info);
 
index 4d25d31b565d1386c63d1873c725d142ac76887a..5e393f722075a55788ee8c0e5b5fef54b23ae882 100644 (file)
@@ -367,7 +367,7 @@ static NTSTATUS check_sam_security(const struct auth_context *auth_context,
                                 lm_sess_key.length);
        data_blob_free(&lm_sess_key);
 
-       (*server_info)->was_mapped |= user_info->was_mapped;
+       (*server_info)->nss_token |= user_info->was_mapped;
 
        return nt_status;
 }
index 511642560654a80c6756e6b35451160e0bb7dfbb..5e9da4eaff348ba4c511a7c2cc5476629261bd0f 100644 (file)
@@ -634,7 +634,7 @@ NTSTATUS create_local_token(auth_serversupplied_info *server_info)
         */
 
        if (((lp_server_role() == ROLE_DOMAIN_MEMBER) && !winbind_ping()) ||
-           (server_info->was_mapped)) {
+           (server_info->nss_token)) {
                status = create_token_from_username(server_info,
                                                    server_info->unix_name,
                                                    server_info->guest,
@@ -1626,7 +1626,7 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
                        sizeof(info3->base.LMSessKey.key));
        }
 
-       result->was_mapped = username_was_mapped;
+       result->nss_token |= username_was_mapped;
 
        *server_info = result;
 
@@ -1859,7 +1859,7 @@ NTSTATUS make_server_info_wbcAuthUserInfo(TALLOC_CTX *mem_ctx,
                        sizeof(info->lm_session_key));
        }
 
-       result->was_mapped = username_was_mapped;
+       result->nss_token |= username_was_mapped;
 
        *server_info = result;
 
index 20faa95b01d45f3642020b590027aac7baf0624f..d1b00a32686495447c5fa0bb635ea15d32a886d8 100644 (file)
@@ -120,9 +120,7 @@ static NTSTATUS check_winbind_security(const struct auth_context *auth_context,
                return nt_status;
        }
 
-       if (user_info->was_mapped) {
-               (*server_info)->was_mapped = user_info->was_mapped;
-       }
+       (*server_info)->nss_token |= user_info->was_mapped;
 
         return nt_status;
 }
index df2bed8756d9861a25b19f30bd03a55a3a7bbb41..56b8144a24699a99fc529f24c17c7ad0b83b0e23 100644 (file)
@@ -67,7 +67,11 @@ typedef struct auth_serversupplied_info {
        
        void *pam_handle;
 
-       bool was_mapped;        /* Did the username map match? */
+       /*
+        * This is a token from /etc/passwd and /etc/group
+        */
+       bool nss_token;
+
        char *unix_name;
 
        /*
index b9219ab302a9ef8d0ab969c6dc57f4d8d5739ba7..9076949a8138319bb1044754552e19b7bce1fa2f 100644 (file)
@@ -530,9 +530,7 @@ static void reply_spnego_kerberos(struct smb_request *req,
                }
        }
 
-       if (username_was_mapped) {
-               server_info->was_mapped = username_was_mapped;
-       }
+       server_info->nss_token |= username_was_mapped;
 
        /* we need to build the token for the user. make_server_info_guest()
           already does this */