summaryrefslogtreecommitdiff
path: root/source3/lib/username.c
diff options
context:
space:
mode:
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. */