r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need
[vlendec/samba-autobuild/.git] / source3 / nsswitch / winbindd_user.c
index a73b5c394cd4524340bae37a9871d97b07c22fde..8a0ebbafa50ee414def303f804b6f92e8e767e98 100644 (file)
@@ -28,8 +28,6 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_WINBIND
 
-extern userdom_struct current_user_info;
-
 static BOOL fillup_pw_field(const char *lp_template, 
                            const char *username, 
                            const char *domname,
@@ -53,15 +51,16 @@ static BOOL fillup_pw_field(const char *lp_template,
           shell. */
        
        /* The substitution of %U and %D in the 'template homedir' is done
-          by alloc_sub_specified() below. */
+          by talloc_sub_specified() below. */
 
-       templ = alloc_sub_specified(lp_template, username, domname, uid, gid);
+       templ = talloc_sub_specified(NULL, lp_template, username, domname,
+                                    uid, gid);
                
        if (!templ)
                return False;
 
        safe_strcpy(out, templ, sizeof(fstring) - 1);
-       SAFE_FREE(templ);
+       TALLOC_FREE(templ);
                
        return True;
        
@@ -109,11 +108,6 @@ static BOOL winbindd_fill_pwent(char *dom_name, char *user_name,
           defaults are /tmp for the home directory and /bin/false for
           shell. */
        
-       /* The substitution of %U and %D in the 'template homedir' is done
-          by alloc_sub_specified() below. */
-
-       fstrcpy(current_user_info.domain, dom_name);
-
        if (!fillup_pw_field(lp_template_homedir(), user_name, dom_name, 
                             pw->pw_uid, pw->pw_gid, homedir, pw->pw_dir))
                return False;
@@ -293,8 +287,6 @@ static void getpwsid_sid2gid_recv(void *private_data, BOOL success, gid_t gid)
        safe_strcpy(pw->pw_name, output_username, sizeof(pw->pw_name) - 1);
        safe_strcpy(pw->pw_gecos, s->fullname, sizeof(pw->pw_gecos) - 1);
 
-       fstrcpy(current_user_info.domain, s->domain->name);
-
        if (!fillup_pw_field(lp_template_homedir(), s->username, s->domain->name, 
                             pw->pw_uid, pw->pw_gid, s->homedir, pw->pw_dir)) {
                DEBUG(5, ("Could not compose homedir\n"));
@@ -407,7 +399,7 @@ void winbindd_getpwuid(struct winbindd_cli_state *state)
                  (unsigned long)state->request.data.uid));
 
        status = idmap_uid_to_sid(&user_sid, state->request.data.uid,
-                                 ID_QUERY_ONLY | ID_CACHE_ONLY);
+                                 IDMAP_FLAG_QUERY_ONLY | IDMAP_FLAG_CACHE_ONLY);
 
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(5, ("Could not find SID for uid %lu\n",