diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/lib/username.c | 12 | ||||
-rw-r--r-- | source3/passdb/sampassdb.c | 4 | ||||
-rw-r--r-- | source3/smbd/reply.c | 6 | ||||
-rw-r--r-- | source3/smbd/service.c | 6 |
4 files changed, 21 insertions, 7 deletions
diff --git a/source3/lib/username.c b/source3/lib/username.c index f04314ab36..8ae55fcc89 100644 --- a/source3/lib/username.c +++ b/source3/lib/username.c @@ -31,12 +31,16 @@ get a users home directory. ****************************************************************************/ char *get_home_dir(char *user) { - static struct passwd *pass; + struct passwd *pass; + static pstring home_dir; - pass = Get_Pwnam(user, False); + pass = Get_Pwnam(user, False); - if (!pass) return(NULL); - return(pass->pw_dir); + if (pass == NULL || pass->pw_dir == NULL) return(NULL); + + pstrcpy(home_dir, pass->pw_dir); + DEBUG(10,("get_home_dir: returning %s for user %s\n", home_dir, user)); + return home_dir; } diff --git a/source3/passdb/sampassdb.c b/source3/passdb/sampassdb.c index bcd2764abc..13b1279b2b 100644 --- a/source3/passdb/sampassdb.c +++ b/source3/passdb/sampassdb.c @@ -511,6 +511,10 @@ you will get this warning only once (for all trust accounts)\n", unix_name)); if (!sid_front_equal(&global_sam_sid, &gmep.sid)) { + fstring sid_str; + sid_to_string(sid_str, &gmep.sid); + DEBUG(0,("UNIX User %s Primary Group is in the wrong domain! %s\n", + sam->unix_name, sid_str)); return NULL; } diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index d706976714..694cf3cdd5 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -750,7 +750,11 @@ int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf,int int homes = lp_servicenumber(HOMES_NAME); char *home = get_home_dir(user); if (homes >= 0 && home) - lp_add_home(user,homes,home); + { + pstring home_dir; + fstrcpy(home_dir, home); + lp_add_home(user,homes,home_dir); + } } diff --git a/source3/smbd/service.c b/source3/smbd/service.c index bc7fb88387..4dd3cb4d97 100644 --- a/source3/smbd/service.c +++ b/source3/smbd/service.c @@ -92,8 +92,9 @@ int find_service(char *service) if (iService < 0) { char *phome_dir = get_home_dir(service); + pstring home_dir; - if(!phome_dir) + if(phome_dir == NULL) { /* * Try mapping the servicename, it may @@ -109,9 +110,10 @@ int find_service(char *service) if (phome_dir) { int iHomeService; + pstrcpy(home_dir, phome_dir); if ((iHomeService = lp_servicenumber(HOMES_NAME)) >= 0) { - lp_add_home(service,iHomeService,phome_dir); + lp_add_home(service,iHomeService,home_dir); iService = lp_servicenumber(service); } } |