auth_winbind3: Correctly handle !authoritative
authorVolker Lendecke <vl@samba.org>
Sat, 11 Feb 2017 09:25:44 +0000 (10:25 +0100)
committerJeremy Allison <jra@samba.org>
Fri, 10 Mar 2017 02:28:26 +0000 (03:28 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/auth/auth_winbind.c

index 2b5c84d2760e1a0205b04da1a8117abc808c4fec..e6a629658c01aa164253313d85e61005d1ecdd7a 100644 (file)
@@ -121,6 +121,15 @@ static NTSTATUS check_winbind_security(const struct auth_context *auth_context,
 
        if (wbc_status == WBC_ERR_AUTH_ERROR) {
                nt_status = NT_STATUS(err->nt_status);
+
+               if (NT_STATUS_EQUAL(nt_status, NT_STATUS_NO_SUCH_USER) &&
+                   (err->authoritative == 0)) {
+                       /*
+                        * Trigger a fallback to local SAM
+                        */
+                       nt_status = NT_STATUS_NOT_IMPLEMENTED;
+               }
+
                wbcFreeMemory(err);
                return nt_status;
        }