Rename LOOKUP_NAME_EXPLICIT to LOOKUP_NAME_NO_NSS
authorVolker Lendecke <vl@samba.org>
Fri, 31 Jul 2009 21:17:54 +0000 (23:17 +0200)
committerVolker Lendecke <vl@samba.org>
Fri, 31 Jul 2009 21:19:05 +0000 (23:19 +0200)
It took me a bit to understand what this flag does. I hope this is
a bit clearer, at least it is to me.

source3/include/smb.h
source3/passdb/lookup_sid.c
source3/winbindd/winbindd_passdb.c

index 819d3a8c4f5b5fbb9ecfb675f3c6a489332c2c38..e2d670fa04a96c35325f1fa6e3c643e43c98332d 100644 (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 */
index 112225d5049de49d74cb2ff5383f5048cc58bbda..4f8d6a4759dc193a7ba4d14987160c93228f8119 100644 (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;
index 89eda3c820c74b0ae41f39843f7e58b18a543b1c..b959bfc9ad0d8cb6da308bec9525f8d534592988 100644 (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;
        }