summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 313021abb8..ccbaebf4ea 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -4044,7 +4044,6 @@ BOOL process_exists(int pid)
/*******************************************************************
turn a uid into a user name
********************************************************************/
-
char *uidtoname(uid_t uid)
{
static char name[40];
@@ -4054,6 +4053,7 @@ char *uidtoname(uid_t uid)
return(name);
}
+
/*******************************************************************
turn a gid into a group name
********************************************************************/
@@ -4068,6 +4068,16 @@ char *gidtoname(gid_t gid)
}
/*******************************************************************
+turn a user name into a uid
+********************************************************************/
+uid_t nametouid(const char *name)
+{
+ struct passwd *pass = getpwnam(name);
+ if (pass) return(pass->pw_uid);
+ return (uid_t)-1;
+}
+
+/*******************************************************************
something really nasty happened - panic!
********************************************************************/
void smb_panic(char *why)