From: Andreas Schneider Date: Wed, 19 Aug 2015 14:11:47 +0000 (+0200) Subject: s3-auth: Fix 'map to guest = Bad Uid' support X-Git-Tag: samba-4.2.4~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=281bd2fb84fed3965d1201050d7b6cc7338c5fdb;p=thirdparty%2Fsamba.git s3-auth: Fix 'map to guest = Bad Uid' support BUG: https://bugzilla.samba.org/show_bug.cgi?id=9862 Signed-off-by: Andreas Schneider Reviewed-by: Guenther Deschner (cherry picked from commit 34965d4d98d172e848e2b96fad8a9e0b99288ba7) --- diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c index 1c2cf80ed8b..dcf173d74e7 100644 --- a/source3/auth/auth_util.c +++ b/source3/auth/auth_util.c @@ -1397,6 +1397,14 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx, &username_was_mapped); if (!NT_STATUS_IS_OK(nt_status)) { + /* Handle 'map to guest = Bad Uid */ + if (NT_STATUS_EQUAL(nt_status, NT_STATUS_NO_SUCH_USER) && + (lp_security() == SEC_ADS || lp_security() == SEC_DOMAIN) && + lp_map_to_guest() == MAP_TO_GUEST_ON_BAD_UID) { + DEBUG(2, ("Try to map %s to guest account", + nt_username)); + return make_server_info_guest(mem_ctx, server_info); + } return nt_status; }