r17406: We need to do a translation of winbind separator -> '\\' in
authorVolker Lendecke <vlendec@samba.org>
Fri, 4 Aug 2006 21:07:32 +0000 (21:07 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:38:32 +0000 (11:38 -0500)
lookup_name_smbconf, otherwise

force user = domain+administrator

can not work. Also attempt to fix the 'valid users = domain+group' bug at the
same time.

Volker
(This used to be commit 255475901c13fde29b1b476560d969cc99712767)

source3/passdb/lookup_sid.c
source3/smbd/share_access.c

index 567ddac3db0295d438612ee6a5e66df4d3821be6..d4c1ff205950e352b13380f26b115e2d422dc110 100644 (file)
@@ -395,8 +395,25 @@ BOOL lookup_name_smbconf(TALLOC_CTX *mem_ctx,
        char *qualified_name;
 
        /* NB. No winbindd_separator here as lookup_name needs \\' */
-       if (strchr_m(full_name, '\\')) {
+       if (strchr_m(full_name, *lp_winbind_separator())) {
+
                /* The name is already qualified with a domain. */
+
+               if (*lp_winbind_separator() != '\\') {
+                       char *p, *tmp;
+
+                       /* lookup_name() needs '\\' as a separator */
+
+                       tmp = talloc_strdup(mem_ctx, full_name);
+                       if (!tmp) {
+                               return False;
+                       }
+                       p = strchr_m(tmp, *lp_winbind_separator());
+                       SMB_ASSERT(p != NULL);
+                       *p = '\\';
+                       full_name = tmp;
+               }
+
                return lookup_name(mem_ctx, full_name, flags,
                                ret_domain, ret_name,
                                ret_sid, ret_type);
index 5334976d8dc7d903e43fb23241bd57f495db1d74..09b56c3522b95f770d9f48a8c31b68cd5ade7629 100644 (file)
@@ -97,7 +97,7 @@ static BOOL token_contains_name(TALLOC_CTX *mem_ctx,
        }
 
        if (!do_group_checks(&name, &prefix)) {
-               if (!lookup_name(mem_ctx, name, LOOKUP_NAME_ALL,
+               if (!lookup_name_smbconf(mem_ctx, name, LOOKUP_NAME_ALL,
                                 NULL, NULL, &sid, &type)) {
                        DEBUG(5, ("lookup_name %s failed\n", name));
                        return False;
@@ -112,7 +112,7 @@ static BOOL token_contains_name(TALLOC_CTX *mem_ctx,
 
        for (/* initialized above */ ; *prefix != '\0'; prefix++) {
                if (*prefix == '+') {
-                       if (!lookup_name(mem_ctx, name,
+                       if (!lookup_name_smbconf(mem_ctx, name,
                                         LOOKUP_NAME_ALL|LOOKUP_NAME_GROUP,
                                         NULL, NULL, &sid, &type)) {
                                DEBUG(5, ("lookup_name %s failed\n", name));