diff options
author | Mystery Man <unknown@mandriva.org> | 2002-07-18 10:15:29 +0000 |
---|---|---|
committer | Mystery Man <unknown@mandriva.org> | 2002-07-18 10:15:29 +0000 |
commit | 700529a81000e551676a591369fc7c9ea13a1a33 (patch) | |
tree | cf19449afbd0ef4f2b12faffa7657a38ab578b99 /mdk-stage1/dietlibc/libcruft/grent.c | |
parent | 1f295b1f8bfe64f293a79900161b085a37009dee (diff) | |
download | drakx-backup-do-not-use-1_1_8_6mdk.tar drakx-backup-do-not-use-1_1_8_6mdk.tar.gz drakx-backup-do-not-use-1_1_8_6mdk.tar.bz2 drakx-backup-do-not-use-1_1_8_6mdk.tar.xz drakx-backup-do-not-use-1_1_8_6mdk.zip |
This commit was manufactured by cvs2svn to create tag 'V1_1_8_6mdk'.V1_1_8_6mdk
Diffstat (limited to 'mdk-stage1/dietlibc/libcruft/grent.c')
-rw-r--r-- | mdk-stage1/dietlibc/libcruft/grent.c | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/mdk-stage1/dietlibc/libcruft/grent.c b/mdk-stage1/dietlibc/libcruft/grent.c deleted file mode 100644 index 0357657de..000000000 --- a/mdk-stage1/dietlibc/libcruft/grent.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * dietlibc/lib/grent.c - getgrent(3)/setgrent(3)/endgrent(3) implementation - * - * Copyright 2001 Jeff Garzik <jgarzik@mandrakesoft.com> - * - * This is a brand new implementation, based on the interface - * described in man-pages-1.34-1mdk man pages package. - */ - - -#include "entlib.h" /* this is our only include */ - -#define MAX_GROUP_MEMBERS 16 /* matches Linux kernel task struct */ - -static struct __ent_state *st = NULL; /* state held across calls */ -static char *gr_mem[MAX_GROUP_MEMBERS+1]; -static struct group gr; - -struct group *getgrent(void) -{ - char *parts[4], *grouplist; - unsigned int bufptr; - - if (__ent_start(_PATH_GROUP, &st)) - return NULL; - if (__ent_get_line(st)) - goto err_out; - if (__ent_split(st, parts, 4, ':', 1) < 0) - goto err_out; - - gr.gr_name = parts[0]; - gr.gr_passwd = parts[1]; - gr.gr_gid = (gid_t) atoi(parts[2]); - grouplist = parts[3]; - - memset(&gr_mem, 0, sizeof(gr_mem)); - gr.gr_mem = gr_mem; - - /* rewind bufptr to beginning of group list */ - bufptr = st->bufptr; - st->bufptr = (int) (grouplist - st->ent_buf); - - __ent_split(st, gr_mem, MAX_GROUP_MEMBERS, ',', 0); - st->bufptr = bufptr; - - return &gr; - -err_out: - st->buflen = st->bufptr = 0; /* invalidate file data buffer */ - return NULL; -} - -void setgrent(void) { __ent_set(st); } -void endgrent(void) { __ent_end(st); st=NULL; } |