diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-05-06 02:43:04 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-05-06 02:43:04 +0000 |
commit | 4e506c9aefe5b89970ae6894d05ad53c81af0d83 (patch) | |
tree | 2fac98df209e72eaba773cad2d7b90c99d9d9249 /mdk-stage1/dietlibc/libcruft/getgrent_r.c | |
parent | 793707b39bf2e9df40a6d2d60b83b3061088ae9e (diff) | |
download | drakx-backup-do-not-use-4e506c9aefe5b89970ae6894d05ad53c81af0d83.tar drakx-backup-do-not-use-4e506c9aefe5b89970ae6894d05ad53c81af0d83.tar.gz drakx-backup-do-not-use-4e506c9aefe5b89970ae6894d05ad53c81af0d83.tar.bz2 drakx-backup-do-not-use-4e506c9aefe5b89970ae6894d05ad53c81af0d83.tar.xz drakx-backup-do-not-use-4e506c9aefe5b89970ae6894d05ad53c81af0d83.zip |
use installed dietlibc, not our forked cvs version
Diffstat (limited to 'mdk-stage1/dietlibc/libcruft/getgrent_r.c')
-rw-r--r-- | mdk-stage1/dietlibc/libcruft/getgrent_r.c | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/mdk-stage1/dietlibc/libcruft/getgrent_r.c b/mdk-stage1/dietlibc/libcruft/getgrent_r.c deleted file mode 100644 index 34ec1e957..000000000 --- a/mdk-stage1/dietlibc/libcruft/getgrent_r.c +++ /dev/null @@ -1,78 +0,0 @@ -#include <grp.h> -#include <sys/types.h> -#include <sys/mman.h> -#include <paths.h> -#include <string.h> -#include "parselib.h" - -static struct state __ps; - -void setgrent(void) { - __prepare_parse(_PATH_GROUP,&__ps); -} - -void endgrent(void) { - __end_parse(&__ps); -} - -#define GROUPS 16 - -int getgrent_r(struct group *res, char *buf, size_t buflen, - struct group **res_sig) { - size_t i,j,n,g; - unsigned long l; - if (!__ps.buffirst) setgrent(); - if (!__ps.buffirst) goto error; - if (__ps.cur>=__ps.buflen) goto error; - res->gr_mem=(char**)buf; -again: - n=GROUPS*sizeof(char*); g=0; - for (i=0; i<4; ++i) { - char sep=i<3?':':','; - char found; - j=__parse_1(&__ps,sep); - if ((found=__ps.buffirst[__ps.cur+j])!=sep) { - if (found!='\n' || i!=3) { -parseerror: - while (__ps.cur+j<__ps.buflen) { - if (__ps.buffirst[__ps.cur+j]=='\n') { - __ps.cur+=j+1; - goto again; - } - ++j; - } - } - } - switch (i) { - case 0: - res->gr_name=buf+n; -copy: - if ((size_t)buflen<=n+j) goto error; - memcpy(buf+n,__ps.buffirst+__ps.cur,j); - buf[n+j]=0; - n+=j+1; - if (found=='\n' && i==2) i=3; - break; - case 1: res->gr_passwd=buf+n; goto copy; - case 2: - if (scan_ulong(__ps.buffirst+__ps.cur,&l)!=j) goto parseerror; - res->gr_gid=l; - break; - case 3: - res->gr_mem[g]=buf+n; - ++g; - if (g==(GROUPS-1)) break; - --i; /* again */ - goto copy; - } - __ps.cur+=j+1; - } - res->gr_mem[g]=0; - *res_sig=res; - return 0; -error: - *res_sig=0;/* the glibc people should be taken behind the barn and shot */ - return -1; -} - -/* uucp:x:14:uucp,root */ |