mirror of
https://github.com/samba-team/samba.git
synced 2025-02-25 17:57:42 +03:00
trying to track down issues in get_home_dir().
(This used to be commit 2cce78aa00f31b79d51aaf46da72019b926e8226)
This commit is contained in:
parent
41daca8ceb
commit
d4385df3e8
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user