auth3: only use "[samba4:]sam" in make_auth3_context_for_winbind()
authorStefan Metzmacher <metze@samba.org>
Fri, 17 Mar 2017 15:46:38 +0000 (16:46 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 24 Mar 2017 10:57:10 +0000 (11:57 +0100)
This makes the USER_INFO_LOCAL_SAM_ONLY and AUTH_METHOD_LOCAL_SAM
interaction obsolete.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=2976

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/auth/auth.c

index 11a777a404f70b4b677dd1daf6f2f2e2bdd4fd49..31313c76f77383daf260a39ed184ef2146f59d83 100644 (file)
@@ -544,7 +544,24 @@ NTSTATUS make_auth3_context_for_netlogon(TALLOC_CTX *mem_ctx,
 NTSTATUS make_auth3_context_for_winbind(TALLOC_CTX *mem_ctx,
                                        struct auth_context **auth_context)
 {
-       return make_auth_context_subsystem(mem_ctx, auth_context);
+       const char *methods = NULL;
+
+       switch (lp_server_role()) {
+       case ROLE_STANDALONE:
+       case ROLE_DOMAIN_MEMBER:
+       case ROLE_DOMAIN_BDC:
+       case ROLE_DOMAIN_PDC:
+               methods = "sam";
+               break;
+       case ROLE_ACTIVE_DIRECTORY_DC:
+               methods = "samba4:sam";
+               break;
+       default:
+               DEBUG(5,("Unknown auth method!\n"));
+               return NT_STATUS_UNSUCCESSFUL;
+       }
+
+       return make_auth_context_specific(mem_ctx, auth_context, methods);
 }
 
 bool auth3_context_set_challenge(struct auth_context *ctx, uint8_t chal[8],