summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2015-08-19 16:11:47 +0200
committerStefan Metzmacher <metze@samba.org>2015-08-31 10:18:15 +0200
commit3271b5b14033896bf0d750965236de72e5a8b6d6 (patch)
tree4c7dc4fc7dbf50a8c909b1815968ba850ea8c115 /source3
parentf55942d24a310867858f4c80bbb6c35df59c6a6e (diff)
downloadsamba-3271b5b14033896bf0d750965236de72e5a8b6d6.tar.gz
s3-auth: Fix 'map to guest = Bad Uid' support
BUG: https://bugzilla.samba.org/show_bug.cgi?id=9862 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> (cherry picked from commit 34965d4d98d172e848e2b96fad8a9e0b99288ba7)
Diffstat (limited to 'source3')
-rw-r--r--source3/auth/auth_util.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
index 69e150fc972..593ecfb5bbe 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) {
+ DBG_NOTICE("Try to map %s to guest account",
+ nt_username);
+ return make_server_info_guest(mem_ctx, server_info);
+ }
return nt_status;
}