]>
Commit | Line | Data |
---|---|---|
1d13e637 AF |
1 | From 4d187b353d77761d40b04b8451f7ebe11fc8fab8 Mon Sep 17 00:00:00 2001 |
2 | From: Andreas Schneider <asn@samba.org> | |
3 | Date: Tue, 31 Mar 2015 18:15:51 +0200 | |
4 | Subject: [PATCH] PATCHSET24: s3-passdb: Fix 'force user' with winbind default | |
5 | domain | |
6 | ||
7 | If we set 'winbind use default domain' and specify 'force user = user' | |
8 | without a domain name we fail to log in. In this case we need to try a | |
9 | lookup with the domain name. | |
10 | ||
11 | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11185 | |
12 | ||
13 | Signed-off-by: Andreas Schneider <asn@samba.org> | |
14 | Reviewed-by: Jeremy Allison <jra@samba.org> | |
15 | ||
16 | (cherry picked from commit cd4442c7ac93e165862c9195a7c345472646aa59) | |
17 | --- | |
18 | source3/passdb/lookup_sid.c | 24 ++++++++++++++++++++++++ | |
19 | 1 file changed, 24 insertions(+) | |
20 | ||
21 | diff --git a/source3/passdb/lookup_sid.c b/source3/passdb/lookup_sid.c | |
22 | index 64a181e..dcc2911 100644 | |
23 | --- a/source3/passdb/lookup_sid.c | |
24 | +++ b/source3/passdb/lookup_sid.c | |
25 | @@ -391,6 +391,30 @@ bool lookup_name_smbconf(TALLOC_CTX *mem_ctx, | |
26 | ret_sid, ret_type); | |
27 | } | |
28 | ||
29 | + /* Try with winbind default domain name. */ | |
30 | + if (lp_winbind_use_default_domain()) { | |
31 | + bool ok; | |
32 | + | |
33 | + qualified_name = talloc_asprintf(mem_ctx, | |
34 | + "%s\\%s", | |
35 | + lp_workgroup(), | |
36 | + full_name); | |
37 | + if (qualified_name == NULL) { | |
38 | + return false; | |
39 | + } | |
40 | + | |
41 | + ok = lookup_name(mem_ctx, | |
42 | + qualified_name, | |
43 | + flags, | |
44 | + ret_domain, | |
45 | + ret_name, | |
46 | + ret_sid, | |
47 | + ret_type); | |
48 | + if (ok) { | |
49 | + return true; | |
50 | + } | |
51 | + } | |
52 | + | |
53 | /* Try with our own SAM name. */ | |
54 | qualified_name = talloc_asprintf(mem_ctx, "%s\\%s", | |
55 | get_global_sam_name(), | |
56 | -- | |
57 | 2.1.0 | |
58 |