]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/samba/samba-3.6.99-fix_map_to_guest_bad_uid.patch
Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into next-suricata
[ipfire-2.x.git] / src / patches / samba / samba-3.6.99-fix_map_to_guest_bad_uid.patch
CommitLineData
1d13e637
AF
1From c370237f44f91f98e4e5cce81fafeea442573bad Mon Sep 17 00:00:00 2001
2From: Andreas Schneider <asn@samba.org>
3Date: Wed, 19 Aug 2015 16:24:08 +0200
4Subject: [PATCH 1/2] PATCHSET32: s3-auth: Pass nt_username to check_account()
5
6We set nt_username above but do not use it in this function.
7
8BUG: https://bugzilla.samba.org/show_bug.cgi?id=9862
9
10Signed-off-by: Andreas Schneider <asn@samba.org>
11Reviewed-by: Guenther Deschner <gd@samba.org>
12(cherry picked from commit e8c76932e4ac192a00afa3b9731f5921c4b37da6)
13---
14 source3/auth/auth_util.c | 9 ++++++---
15 1 file changed, 6 insertions(+), 3 deletions(-)
16
17diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
18index a548b7b..aa269d6 100644
19--- a/source3/auth/auth_util.c
20+++ b/source3/auth/auth_util.c
21@@ -1251,9 +1251,12 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
22
23 /* this call will try to create the user if necessary */
24
25- nt_status = check_account(mem_ctx, nt_domain, sent_nt_username,
26- &found_username, &pwd,
27- &username_was_mapped);
28+ nt_status = check_account(mem_ctx,
29+ nt_domain,
30+ nt_username,
31+ &found_username,
32+ &pwd,
33+ &username_was_mapped);
34
35 if (!NT_STATUS_IS_OK(nt_status)) {
36 return nt_status;
37--
382.5.0
39
40
41From 1ab3cd252942b4fa5637d3f98b48ac3ba098de30 Mon Sep 17 00:00:00 2001
42From: Andreas Schneider <asn@samba.org>
43Date: Wed, 19 Aug 2015 16:11:47 +0200
44Subject: [PATCH 2/2] PATCHSET32: s3-auth: Fix 'map to guest = Bad Uid' support
45
46BUG: https://bugzilla.samba.org/show_bug.cgi?id=9862
47
48Signed-off-by: Andreas Schneider <asn@samba.org>
49Reviewed-by: Guenther Deschner <gd@samba.org>
50(cherry picked from commit 34965d4d98d172e848e2b96fad8a9e0b99288ba7)
51---
52 source3/auth/auth_util.c | 8 ++++++++
53 1 file changed, 8 insertions(+)
54
55diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
56index aa269d6..cfda8b7 100644
57--- a/source3/auth/auth_util.c
58+++ b/source3/auth/auth_util.c
59@@ -1259,6 +1259,14 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
60 &username_was_mapped);
61
62 if (!NT_STATUS_IS_OK(nt_status)) {
63+ /* Handle 'map to guest = Bad Uid */
64+ if (NT_STATUS_EQUAL(nt_status, NT_STATUS_NO_SUCH_USER) &&
65+ (lp_security() == SEC_ADS || lp_security() == SEC_DOMAIN) &&
66+ lp_map_to_guest() == MAP_TO_GUEST_ON_BAD_UID) {
67+ DEBUG(2, ("Try to map %s to guest account\n",
68+ nt_username));
69+ return make_server_info_guest(mem_ctx, server_info);
70+ }
71 return nt_status;
72 }
73
74--
752.5.0
76