~zulcss/ubuntu/lucid/likewise-open/likewise-open-sru

« back to all changes in this revision

Viewing changes to samba/source/winbindd/winbindd_user.c

  • Committer: Bazaar Package Importer
  • Author(s): Rick Clark
  • Date: 2008-08-27 08:56:20 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080827085620-5q0f58b9qtog9myq
Tags: 4.1.0.2956-0ubuntu1
* missing-likewise-logo.diff: removed
* fixed copyright notice
* updated Standards-Version to 3.8.0
* removed path from command in prerm
* removed stop in S runlevel

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
}
73
73
/* Fill a pwent structure with information we have obtained */
74
74
 
75
 
static bool winbindd_fill_pwent(char *dom_name, char *user_name, 
 
75
static bool winbindd_fill_pwent(TALLOC_CTX *ctx, char *dom_name, char *user_name, 
76
76
                                DOM_SID *user_sid, DOM_SID *group_sid,
77
77
                                char *full_name, char *homedir, char *shell,
78
78
                                struct winbindd_pw *pw)
79
79
{
80
80
        fstring output_username;
81
 
        
 
81
        char *mapped_name = NULL;
 
82
        struct winbindd_domain *domain = NULL;  
 
83
 
82
84
        if (!pw || !dom_name || !user_name)
83
85
                return False;
84
86
        
102
104
 
103
105
        /* Username */
104
106
 
105
 
        fill_domain_username(output_username, dom_name, user_name, True); 
 
107
        domain = find_domain_from_name_noinit(dom_name);
 
108
        if (domain) {           
 
109
                mapped_name = ws_name_replace(ctx, domain, user_name,
 
110
                                              *lp_winbind_replacement_char());
 
111
        } else {
 
112
                DEBUG(5,("winbindd_fill_pwent: Failed to find domain for %s.  "
 
113
                         "Disabling name alias support\n", dom_name));
 
114
                mapped_name = user_name;                
 
115
        }       
106
116
 
 
117
        if (mapped_name != user_name) {
 
118
                fstrcpy(output_username, mapped_name);
 
119
        } else {
 
120
                fill_domain_username(output_username, dom_name, user_name, True); 
 
121
        }
 
122
        
107
123
        safe_strcpy(pw->pw_name, output_username, sizeof(pw->pw_name) - 1);
108
124
        
109
125
        /* Full name (gecos) */
767
783
                /* Lookup user info */
768
784
                
769
785
                result = winbindd_fill_pwent(
 
786
                        state->mem_ctx,
770
787
                        ent->domain_name, 
771
788
                        name_list[ent->sam_entry_index].name,
772
789
                        &name_list[ent->sam_entry_index].user_sid,