summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-07-31 23:17:54 +0200
committerVolker Lendecke <vl@samba.org>2009-07-31 23:19:05 +0200
commita488334bf1d2c76ebad123df4fc970d617dee126 (patch)
tree4a12b1543106913f335ec249bf72249333bbc84b /source3
parent42becbc7a810e1d521f5aee6bcbbb5c1ad3ab7bf (diff)
downloadsamba-a488334bf1d2c76ebad123df4fc970d617dee126.tar.gz
samba-a488334bf1d2c76ebad123df4fc970d617dee126.tar.bz2
samba-a488334bf1d2c76ebad123df4fc970d617dee126.zip
Rename LOOKUP_NAME_EXPLICIT to LOOKUP_NAME_NO_NSS
It took me a bit to understand what this flag does. I hope this is a bit clearer, at least it is to me.
Diffstat (limited to 'source3')
-rw-r--r--source3/include/smb.h5
-rw-r--r--source3/passdb/lookup_sid.c12
-rw-r--r--source3/winbindd/winbindd_passdb.c2
3 files changed, 11 insertions, 8 deletions
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 819d3a8c4f..e2d670fa04 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -182,9 +182,8 @@ typedef union unid_t {
#define LOOKUP_NAME_GROUP 0x00000004 /* (unused) This is a NASTY hack for
valid users = @foo where foo also
exists in as user. */
-#define LOOKUP_NAME_EXPLICIT 0x00000008 /* Only include
- explicitly mapped names and not
- the Unix {User,Group} domain */
+#define LOOKUP_NAME_NO_NSS 0x00000008 /* no NSS calls to avoid
+ winbind recursions */
#define LOOKUP_NAME_BUILTIN 0x00000010 /* builtin names */
#define LOOKUP_NAME_WKN 0x00000020 /* well known names */
#define LOOKUP_NAME_DOMAIN 0x00000040 /* only lookup own domain */
diff --git a/source3/passdb/lookup_sid.c b/source3/passdb/lookup_sid.c
index 112225d504..4f8d6a4759 100644
--- a/source3/passdb/lookup_sid.c
+++ b/source3/passdb/lookup_sid.c
@@ -106,7 +106,8 @@ bool lookup_name(TALLOC_CTX *mem_ctx,
goto ok;
}
- if (!(flags & LOOKUP_NAME_EXPLICIT) && strequal(domain, unix_users_domain_name())) {
+ if (((flags & LOOKUP_NAME_NO_NSS) == 0)
+ && strequal(domain, unix_users_domain_name())) {
if (lookup_unix_user_name(name, &sid)) {
type = SID_NAME_USER;
goto ok;
@@ -115,7 +116,8 @@ bool lookup_name(TALLOC_CTX *mem_ctx,
return false;
}
- if (!(flags & LOOKUP_NAME_EXPLICIT) && strequal(domain, unix_groups_domain_name())) {
+ if (((flags & LOOKUP_NAME_NO_NSS) == 0)
+ && strequal(domain, unix_groups_domain_name())) {
if (lookup_unix_group_name(name, &sid)) {
type = SID_NAME_DOM_GRP;
goto ok;
@@ -280,13 +282,15 @@ bool lookup_name(TALLOC_CTX *mem_ctx,
/* 11. Ok, windows would end here. Samba has two more options:
Unmapped users and unmapped groups */
- if (!(flags & LOOKUP_NAME_EXPLICIT) && lookup_unix_user_name(name, &sid)) {
+ if (((flags & LOOKUP_NAME_NO_NSS) == 0)
+ && lookup_unix_user_name(name, &sid)) {
domain = talloc_strdup(tmp_ctx, unix_users_domain_name());
type = SID_NAME_USER;
goto ok;
}
- if (!(flags & LOOKUP_NAME_EXPLICIT) && lookup_unix_group_name(name, &sid)) {
+ if (((flags & LOOKUP_NAME_NO_NSS) == 0)
+ && lookup_unix_group_name(name, &sid)) {
domain = talloc_strdup(tmp_ctx, unix_groups_domain_name());
type = SID_NAME_DOM_GRP;
goto ok;
diff --git a/source3/winbindd/winbindd_passdb.c b/source3/winbindd/winbindd_passdb.c
index 89eda3c820..b959bfc9ad 100644
--- a/source3/winbindd/winbindd_passdb.c
+++ b/source3/winbindd/winbindd_passdb.c
@@ -103,7 +103,7 @@ static NTSTATUS name_to_sid(struct winbindd_domain *domain,
break;
default:
/* Avoid any NSS calls in the lookup_name by default */
- flags |= LOOKUP_NAME_EXPLICIT;
+ flags |= LOOKUP_NAME_NO_NSS;
DEBUG(10,("winbindd_passdb: limiting name_to_sid() to explicit mappings\n"));
break;
}