diff options
author | Eric Andersen <andersen@codepoet.org> | 1999-10-20 23:18:15 +0400 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 1999-10-20 23:18:15 +0400 |
commit | d23f9ba0f6d82e6bab8a3ec1b804865f4b22cfb7 (patch) | |
tree | 0ab285d58cd8cf530ad8acac823545df892c90e9 /chmod_chown_chgrp.c | |
parent | ef8b6c757de9684f5d88eff4b014527e87121137 (diff) |
Made ps work. Fixed some stuff.
Diffstat (limited to 'chmod_chown_chgrp.c')
-rw-r--r-- | chmod_chown_chgrp.c | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/chmod_chown_chgrp.c b/chmod_chown_chgrp.c index faebbbe10..85ba247b8 100644 --- a/chmod_chown_chgrp.c +++ b/chmod_chown_chgrp.c @@ -48,56 +48,6 @@ static const char chmod_usage[] = "[-R] MODE[,MODE]... FILE...\n" "\t-R\tchange files and directories recursively.\n"; -uid_t my_getid(const char *filename, const char *name) -{ - FILE *stream; - char *rname, *start, *end, buf[128]; - uid_t rid; - - stream=fopen(filename,"r"); - - while (fgets (buf, 128, stream) != NULL) { - if (buf[0] == '#') - continue; - - start = buf; - end = strchr (start, ':'); - if (end == NULL) - continue; - *end = '\0'; - rname = start; - - start = end + 1; - end = strchr (start, ':'); - if (end == NULL) - continue; - - start = end + 1; - rid = (uid_t) strtol (start, &end, 10); - if (end == start) - continue; - - if (name) { - if (0 == strcmp(rname, name)) - return( rid); - } - } - fclose(stream); - return (-1); -} - -uid_t -my_getpwnam(char *name) -{ - return my_getid("/etc/passwd", name); -} - -gid_t -my_getgrnam(char *name) -{ - return my_getid("/etc/group", name); -} - static int fileAction(const char *fileName, struct stat* statbuf) { switch (whichApp) { |