summaryrefslogtreecommitdiff
path: root/source3/lib/username.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-01-16 23:53:10 +0000
committerJeremy Allison <jra@samba.org>2002-01-16 23:53:10 +0000
commit08019e8a337c5e378ec9dfc70698adb73b9b7676 (patch)
tree7dc5845c37246cb0c255b474734bd5997508dbb0 /source3/lib/username.c
parent5cf6457bcc1182eac99f5618b647153707fa41ab (diff)
downloadsamba-08019e8a337c5e378ec9dfc70698adb73b9b7676.tar.gz
samba-08019e8a337c5e378ec9dfc70698adb73b9b7676.tar.bz2
samba-08019e8a337c5e378ec9dfc70698adb73b9b7676.zip
Separate out get_user_home_dir() from get_user_home_service_dir().
Jeremy. (This used to be commit c1b97226db63daf64359e79083a4754e7c7f8054)
Diffstat (limited to 'source3/lib/username.c')
-rw-r--r--source3/lib/username.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/source3/lib/username.c b/source3/lib/username.c
index c7e25b7cd1..81408f4569 100644
--- a/source3/lib/username.c
+++ b/source3/lib/username.c
@@ -43,6 +43,25 @@ BOOL name_is_local(const char *name)
char *get_user_home_dir(const char *user)
{
static struct passwd *pass;
+
+ /* Ensure the user exists. */
+
+ pass = Get_Pwnam(user);
+
+ if (!pass)
+ return(NULL);
+ /* Return home directory from struct passwd. */
+
+ return(pass->pw_dir);
+}
+
+/****************************************************************************
+ Get a users service home directory.
+****************************************************************************/
+
+char *get_user_service_home_dir(const char *user)
+{
+ static struct passwd *pass;
int snum;
/* Ensure the user exists. */