1 |
vip-ire |
1.1 |
From ee554fe5bd412d1faa6f59bdf8e8662ce6fb9b1a Mon Sep 17 00:00:00 2001 |
2 |
|
|
From: Justin Maggard <jmaggard@netgear.com> |
3 |
|
|
Date: Tue, 21 Jul 2015 15:17:30 -0700 |
4 |
|
|
Subject: [PATCH] s3-passdb: Respect LOOKUP_NAME_GROUP flag in sid lookup. |
5 |
|
|
|
6 |
|
|
Somewhere along the line, a config line like "valid users = @foo" |
7 |
|
|
broke when "foo" also exists as a user. |
8 |
|
|
|
9 |
|
|
user_ok_token() already does the right thing by adding the LOOKUP_NAME_GROUP |
10 |
|
|
flag; but lookup_name() was not respecting that flag, and went ahead and looked |
11 |
|
|
for users anyway. |
12 |
|
|
|
13 |
|
|
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11320 |
14 |
|
|
|
15 |
|
|
Signed-off-by: Justin Maggard <jmaggard@netgear.com> |
16 |
|
|
Reviewed-by: Jeremy Allison <jra@samba.org> |
17 |
|
|
Reviewed-by: Marc Muehlfeld <mmuehlfeld@samba.org> |
18 |
|
|
|
19 |
|
|
Autobuild-User(master): Jeremy Allison <jra@samba.org> |
20 |
|
|
Autobuild-Date(master): Tue Jul 28 21:35:58 CEST 2015 on sn-devel-104 |
21 |
|
|
|
22 |
|
|
(cherry picked from commit dc99d451bf23668d73878847219682fced547622) |
23 |
|
|
--- |
24 |
|
|
source3/passdb/lookup_sid.c | 4 ++-- |
25 |
|
|
source3/passdb/lookup_sid.h | 2 +- |
26 |
|
|
2 files changed, 3 insertions(+), 3 deletions(-) |
27 |
|
|
|
28 |
|
|
diff --git a/source3/passdb/lookup_sid.c b/source3/passdb/lookup_sid.c |
29 |
|
|
index fe07bea..714061e 100644 |
30 |
|
|
--- a/source3/passdb/lookup_sid.c |
31 |
|
|
+++ b/source3/passdb/lookup_sid.c |
32 |
|
|
@@ -120,7 +120,7 @@ bool lookup_name(TALLOC_CTX *mem_ctx, |
33 |
|
|
goto ok; |
34 |
|
|
} |
35 |
|
|
|
36 |
|
|
- if (((flags & LOOKUP_NAME_NO_NSS) == 0) |
37 |
|
|
+ if (((flags & (LOOKUP_NAME_NO_NSS|LOOKUP_NAME_GROUP)) == 0) |
38 |
|
|
&& strequal(domain, unix_users_domain_name())) { |
39 |
|
|
if (lookup_unix_user_name(name, &sid)) { |
40 |
|
|
type = SID_NAME_USER; |
41 |
|
|
@@ -293,7 +293,7 @@ bool lookup_name(TALLOC_CTX *mem_ctx, |
42 |
|
|
/* 11. Ok, windows would end here. Samba has two more options: |
43 |
|
|
Unmapped users and unmapped groups */ |
44 |
|
|
|
45 |
|
|
- if (((flags & LOOKUP_NAME_NO_NSS) == 0) |
46 |
|
|
+ if (((flags & (LOOKUP_NAME_NO_NSS|LOOKUP_NAME_GROUP)) == 0) |
47 |
|
|
&& lookup_unix_user_name(name, &sid)) { |
48 |
|
|
domain = talloc_strdup(tmp_ctx, unix_users_domain_name()); |
49 |
|
|
type = SID_NAME_USER; |
50 |
|
|
diff --git a/source3/passdb/lookup_sid.h b/source3/passdb/lookup_sid.h |
51 |
|
|
index 872f4ef..8b5edf6 100644 |
52 |
|
|
--- a/source3/passdb/lookup_sid.h |
53 |
|
|
+++ b/source3/passdb/lookup_sid.h |
54 |
|
|
@@ -31,7 +31,7 @@ struct unixid; |
55 |
|
|
#define LOOKUP_NAME_NONE 0x00000000 |
56 |
|
|
#define LOOKUP_NAME_ISOLATED 0x00000001 /* Look up unqualified names */ |
57 |
|
|
#define LOOKUP_NAME_REMOTE 0x00000002 /* Ask others */ |
58 |
|
|
-#define LOOKUP_NAME_GROUP 0x00000004 /* (unused) This is a NASTY hack for |
59 |
|
|
+#define LOOKUP_NAME_GROUP 0x00000004 /* This is a NASTY hack for |
60 |
|
|
valid users = @foo where foo also |
61 |
|
|
exists in as user. */ |
62 |
|
|
#define LOOKUP_NAME_NO_NSS 0x00000008 /* no NSS calls to avoid |
63 |
|
|
-- |
64 |
|
|
2.5.0.rc2.392.g76e840b |
65 |
|
|
|