s3: Remove a nesting level in winbindd_dual_pam_chauthtok
authorVolker Lendecke <vl@samba.org>
Sat, 11 Sep 2010 16:24:54 +0000 (18:24 +0200)
committerVolker Lendecke <vl@samba.org>
Sun, 12 Sep 2010 16:30:38 +0000 (18:30 +0200)
source3/winbindd/winbindd_pam.c

index 53eda47d2ec86b52d444fda03e4ae6350f99c6f9..968ffcd9ca39a366b62561593b30d3b2fc4a7c62 100644 (file)
@@ -1896,25 +1896,26 @@ enum winbindd_result winbindd_dual_pam_chauthtok(struct winbindd_domain *contact
 
 done:
 
-       if (NT_STATUS_IS_OK(result) && (state->request->flags & WBFLAG_PAM_CACHED_LOGIN)) {
-               if (lp_winbind_offline_logon()) {
-                       result = winbindd_update_creds_by_name(contact_domain,
-                                                              user, newpass);
-                       /* Again, this happens when we login from gdm or xdm
-                        * and the password expires, *BUT* cached crendentials
-                        * doesn't exist. winbindd_update_creds_by_name()
-                        * returns NT_STATUS_NO_SUCH_USER.
-                        * This is not a failure.
-                        * --- BoYang
-                        * */
-                       if (NT_STATUS_EQUAL(result, NT_STATUS_NO_SUCH_USER)) {
-                               result = NT_STATUS_OK;
-                       }
+       if (NT_STATUS_IS_OK(result)
+           && (state->request->flags & WBFLAG_PAM_CACHED_LOGIN)
+           && lp_winbind_offline_logon()) {
+               result = winbindd_update_creds_by_name(contact_domain, user,
+                                                      newpass);
+               /* Again, this happens when we login from gdm or xdm
+                * and the password expires, *BUT* cached crendentials
+                * doesn't exist. winbindd_update_creds_by_name()
+                * returns NT_STATUS_NO_SUCH_USER.
+                * This is not a failure.
+                * --- BoYang
+                * */
+               if (NT_STATUS_EQUAL(result, NT_STATUS_NO_SUCH_USER)) {
+                       result = NT_STATUS_OK;
+               }
 
-                       if (!NT_STATUS_IS_OK(result)) {
-                               DEBUG(10,("Failed to store creds: %s\n", nt_errstr(result)));
-                               goto process_result;
-                       }
+               if (!NT_STATUS_IS_OK(result)) {
+                       DEBUG(10, ("Failed to store creds: %s\n",
+                                  nt_errstr(result)));
+                       goto process_result;
                }
        }