use "winbind separator" in tng as well
authorAndrew Tridgell <tridge@samba.org>
Fri, 12 May 2000 06:27:34 +0000 (06:27 +0000)
committerAndrew Tridgell <tridge@samba.org>
Fri, 12 May 2000 06:27:34 +0000 (06:27 +0000)
(This used to be commit 0189af544244d7d20e4042cd1238f370968cb7a9)

source3/nsswitch/winbindd_cache.c
source3/nsswitch/winbindd_group.c
source3/nsswitch/winbindd_pam.c
source3/nsswitch/winbindd_user.c
source3/nsswitch/winbindd_util.c

index b999e8d9ce0d86b04fee66a61cb72622a3afd528..b6b753bae0c7f1a1378e7fcd251b6555c6560d92 100644 (file)
@@ -303,7 +303,7 @@ static BOOL fetch_cache_entry(char *domain, char *cache_type, char *name, void *
        data = tdb_fetch_by_string(cache_tdb, keystr);
        if (!data.dptr) return False;
         
-        DEBUG(4, ("returning cached entry for %s/%s\n", domain, name));
+        DEBUG(4, ("returning cached entry for %s\\%s\n", domain, name));
 
         /* Copy found entry into buffer */        
         memcpy((char *)buf, data.dptr, len < data.dsize ? len : data.dsize);
index db94bab836926721177eee7ae751ac0e8aadff0c..e96947b7e6517130ad02964044314c0138050633 100644 (file)
@@ -271,7 +271,7 @@ static BOOL winbindd_fill_grent_mem(struct winbindd_domain *domain,
 
                         /* Create name */
                        slprintf(entry->name, sizeof(entry->name),
-                                "%s/%s", name_dom, name_user);
+                                "%s%s%s", name_dom, lp_winbind_separator(), name_user);
                         
                         /* Add to list */
 
@@ -562,7 +562,9 @@ enum winbindd_result winbindd_getgrnam_from_gid(struct winbindd_cli_state
         return WINBINDD_ERROR;
     }
 
-    string_sub(group_name, "\\", "/", sizeof(fstring));
+    if (strcmp(lp_winbind_separator(),"\\")) {
+           string_sub(group_name, "\\", lp_winbind_separator(), sizeof(fstring));
+    }
 
     if (!((name_type == SID_NAME_ALIAS) || (name_type == SID_NAME_DOM_GRP))) {
         DEBUG(1, ("from_gid: name '%s' is not a local or domain group: %d\n", 
@@ -716,7 +718,7 @@ enum winbindd_result winbindd_getgrent(struct winbindd_cli_state *state)
             /* Prepend domain to name */
 
            slprintf(domain_group_name, sizeof(domain_group_name),
-                    "%s/%s", ent->domain->name, group_name);
+                    "%s%s%s", ent->domain->name, lp_winbind_separator(), group_name);
    
             /* Get group entry from group name */
 
index 011fbedb97e530da7a69815e6ed773db680631f6..656fb749644fe4ed7a6762ee4998a2329ca90ef6 100644 (file)
@@ -76,7 +76,7 @@ enum winbindd_result winbindd_pam_auth(struct winbindd_cli_state *state)
 
        ZERO_STRUCT(info3);
 
-       if (!_get_trust_account_password(name_domain, trust_passwd, NULL)) return WINBINDD_ERROR;
+       if (!_get_trust_account_password(lp_workgroup(), trust_passwd, NULL)) return WINBINDD_ERROR;
 
        nt_lm_owf_gen(state->request.data.auth.pass, ntpw, lmpw);
 
index 3e7cba0118c10b2a6ea32c49b142efcf37454e88..9a73b0107b0a48a74c0c0f8b0cac36b135653cdd 100644 (file)
@@ -207,7 +207,9 @@ enum winbindd_result winbindd_getpwnam_from_uid(struct winbindd_cli_state
         return WINBINDD_ERROR;
     }
 
-    string_sub(user_name, "\\", "/", sizeof(fstring));
+    if (strcmp("\\", lp_winbind_separator())) {
+           string_sub(user_name, "\\", lp_winbind_separator(), sizeof(fstring));
+    }
 
     /* Get some user info */
     
@@ -363,7 +365,7 @@ enum winbindd_result winbindd_getpwent(struct winbindd_cli_state *state)
             /* Prepend domain to name */
 
            slprintf(domain_user_name, sizeof(domain_user_name),
-                    "%s/%s", ent->domain->name, user_name);
+                    "%s%s%s", ent->domain->name, lp_winbind_separator(), user_name);
                 
             /* Get passwd entry from user name */
                 
index daffb1ef8c78c654f27ca214b28b8241e3561be1..1eea8f8fc72f23fe028d25d019a78d531430edaf 100644 (file)
@@ -619,7 +619,9 @@ char *winbindd_cmd_to_string(enum winbindd_cmd cmd)
 void parse_domain_user(char *domuser, fstring domain, fstring user)
 {
        char *p;
-       p = strchr(domuser,'/');
+       char *sep = lp_winbind_separator();
+       if (!sep) sep = "\\";
+       p = strchr(domuser,*sep);
        if (!p) p = strchr(domuser,'\\');
        if (!p) {
                fstrcpy(domain,"");