aboutsummaryrefslogtreecommitdiff
path: root/utility.c
diff options
context:
space:
mode:
Diffstat (limited to 'utility.c')
-rw-r--r--utility.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/utility.c b/utility.c
index 2b2156624..d39e9a1c1 100644
--- a/utility.c
+++ b/utility.c
@@ -820,12 +820,12 @@ extern int parse_mode(const char *s, mode_t * theMode)
820 * This uses buf as storage to hold things. 820 * This uses buf as storage to hold things.
821 * 821 *
822 */ 822 */
823unsigned long my_getid(const char *filename, char *name, unsigned long id, unsigned long *gid) 823unsigned long my_getid(const char *filename, char *name, long id, long *gid)
824{ 824{
825 FILE *file; 825 FILE *file;
826 char *rname, *start, *end, buf[128]; 826 char *rname, *start, *end, buf[128];
827 unsigned long rid; 827 long rid;
828 unsigned long rgid = 0; 828 long rgid = 0;
829 829
830 file = fopen(filename, "r"); 830 file = fopen(filename, "r");
831 if (file == NULL) { 831 if (file == NULL) {
@@ -881,33 +881,33 @@ unsigned long my_getid(const char *filename, char *name, unsigned long id, unsig
881} 881}
882 882
883/* returns a uid given a username */ 883/* returns a uid given a username */
884unsigned long my_getpwnam(char *name) 884long my_getpwnam(char *name)
885{ 885{
886 return my_getid("/etc/passwd", name, -1, NULL); 886 return my_getid("/etc/passwd", name, -1, NULL);
887} 887}
888 888
889/* returns a gid given a group name */ 889/* returns a gid given a group name */
890unsigned long my_getgrnam(char *name) 890long my_getgrnam(char *name)
891{ 891{
892 return my_getid("/etc/group", name, -1, NULL); 892 return my_getid("/etc/group", name, -1, NULL);
893} 893}
894 894
895/* gets a username given a uid */ 895/* gets a username given a uid */
896void my_getpwuid(char *name, unsigned long uid) 896void my_getpwuid(char *name, long uid)
897{ 897{
898 my_getid("/etc/passwd", name, uid, NULL); 898 my_getid("/etc/passwd", name, uid, NULL);
899} 899}
900 900
901/* gets a groupname given a gid */ 901/* gets a groupname given a gid */
902void my_getgrgid(char *group, unsigned long gid) 902void my_getgrgid(char *group, long gid)
903{ 903{
904 my_getid("/etc/group", group, gid, NULL); 904 my_getid("/etc/group", group, gid, NULL);
905} 905}
906 906
907/* gets a gid given a user name */ 907/* gets a gid given a user name */
908unsigned long my_getpwnamegid(char *name) 908long my_getpwnamegid(char *name)
909{ 909{
910 unsigned long gid; 910 long gid;
911 my_getid("/etc/passwd", name, -1, &gid); 911 my_getid("/etc/passwd", name, -1, &gid);
912 return gid; 912 return gid;
913} 913}