summaryrefslogtreecommitdiff
path: root/utility.c
diff options
context:
space:
mode:
Diffstat (limited to 'utility.c')
-rw-r--r--utility.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/utility.c b/utility.c
index bf4284c..568b5f2 100644
--- a/utility.c
+++ b/utility.c
@@ -871,7 +871,7 @@ long my_getpwnam(char *name)
myuser = getpwnam(name);
if (myuser==NULL)
- error_msg_and_die( "unknown username: %s\n", name);
+ return(-1);
return myuser->pw_uid;
}
@@ -883,7 +883,7 @@ long my_getgrnam(char *name)
mygroup = getgrnam(name);
if (mygroup==NULL)
- error_msg_and_die( "unknown group: %s\n", name);
+ return(-1);
return (mygroup->gr_gid);
}
@@ -895,9 +895,9 @@ void my_getpwuid(char *name, long uid)
myuser = getpwuid(uid);
if (myuser==NULL)
- error_msg_and_die( "unknown uid %ld\n", (long)uid);
-
- strcpy(name, myuser->pw_name);
+ sprintf(name, "%-8ld ", (long)uid);
+ else
+ strcpy(name, myuser->pw_name);
}
/* gets a groupname given a gid */
@@ -907,9 +907,9 @@ void my_getgrgid(char *group, long gid)
mygroup = getgrgid(gid);
if (mygroup==NULL)
- error_msg_and_die( "unknown gid %ld\n", (long)gid);
-
- strcpy(group, mygroup->gr_name);
+ sprintf(group, "%-8ld ", (long)gid);
+ else
+ strcpy(group, mygroup->gr_name);
}
#if defined BB_ID