s3: Fix the code order in append_auth_data
authorVolker Lendecke <vl@samba.org>
Sun, 25 Apr 2010 13:36:02 +0000 (15:36 +0200)
committerVolker Lendecke <vl@samba.org>
Sun, 2 May 2010 13:15:56 +0000 (15:15 +0200)
This is to comply with the comment

"currently, anything from here on potentially overwrites extra_data."

Günther, please check!

source3/winbindd/winbindd_pam.c

index aea2a2a34f3cb2a9fdfac2ec9676b66126a1e017..b062fd1d77c682c10b88a9276d4a2324f91f35db 100644 (file)
@@ -757,10 +757,11 @@ static NTSTATUS append_auth_data(struct winbindd_cli_state *state,
                       /* 8 */);
        }
 
-       if (flags & WBFLAG_PAM_INFO3_TEXT) {
-               result = append_info3_as_txt(state->mem_ctx, state, info3);
+       if (flags & WBFLAG_PAM_UNIX_NAME) {
+               result = append_unix_username(state->mem_ctx, state, info3,
+                                             name_domain, name_user);
                if (!NT_STATUS_IS_OK(result)) {
-                       DEBUG(10,("Failed to append INFO3 (TXT): %s\n",
+                       DEBUG(10,("Failed to append Unix Username: %s\n",
                                nt_errstr(result)));
                        return result;
                }
@@ -777,11 +778,10 @@ static NTSTATUS append_auth_data(struct winbindd_cli_state *state,
                }
        }
 
-       if (flags & WBFLAG_PAM_UNIX_NAME) {
-               result = append_unix_username(state->mem_ctx, state, info3,
-                                             name_domain, name_user);
+       if (flags & WBFLAG_PAM_INFO3_TEXT) {
+               result = append_info3_as_txt(state->mem_ctx, state, info3);
                if (!NT_STATUS_IS_OK(result)) {
-                       DEBUG(10,("Failed to append Unix Username: %s\n",
+                       DEBUG(10,("Failed to append INFO3 (TXT): %s\n",
                                nt_errstr(result)));
                        return result;
                }