1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

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.
This commit is contained in:
Volker Lendecke 2009-07-31 23:17:54 +02:00
parent 42becbc7a8
commit a488334bf1
3 changed files with 11 additions and 8 deletions

View File

@ -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 */

View File

@ -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;

View File

@ -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;
}