summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1998-12-14 20:21:39 +0000
committerLuke Leighton <lkcl@samba.org>1998-12-14 20:21:39 +0000
commitd4385df3e80d63dbc7a1c90cc903d8343dfba652 (patch)
treeb4aef7c2430f1e362d6896f61760678a3510f4d4 /source3/lib
parent41daca8ceb7e7597ae9804c1b7f07fb95debb51c (diff)
downloadsamba-d4385df3e80d63dbc7a1c90cc903d8343dfba652.tar.gz
samba-d4385df3e80d63dbc7a1c90cc903d8343dfba652.tar.bz2
samba-d4385df3e80d63dbc7a1c90cc903d8343dfba652.zip
trying to track down issues in get_home_dir().
(This used to be commit 2cce78aa00f31b79d51aaf46da72019b926e8226)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/username.c12
1 files changed, 8 insertions, 4 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;
}