diff options
| author | Eric Andersen <andersen@codepoet.org> | 2001-01-27 06:01:43 +0000 |
|---|---|---|
| committer | Eric Andersen <andersen@codepoet.org> | 2001-01-27 06:01:43 +0000 |
| commit | ab050f5522e843bf08994685134adaaac7ffd392 (patch) | |
| tree | e3f2fbeb43186bbe44fb58ba5a7f6a3c4843c1a5 /include/grp.h | |
| parent | 3654ca56fae6e3bdcb7369bc21d2b41d460ef732 (diff) | |
| download | busybox-w32-ab050f5522e843bf08994685134adaaac7ffd392.tar.gz busybox-w32-ab050f5522e843bf08994685134adaaac7ffd392.tar.bz2 busybox-w32-ab050f5522e843bf08994685134adaaac7ffd392.zip | |
Add in a patch to make busybox use the normal pwd.h and grp.h
functions. Add in simple implementations of these functions,
which can, optionally, be used instead of the system versions.
-Erik
Diffstat (limited to 'include/grp.h')
| -rw-r--r-- | include/grp.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/include/grp.h b/include/grp.h new file mode 100644 index 000000000..f27c466fd --- /dev/null +++ b/include/grp.h | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | #ifndef __BB_GRP_H | ||
| 2 | #define __BB_GRP_H | ||
| 3 | |||
| 4 | #if defined USE_SYSTEM_PWD_GRP | ||
| 5 | #include <grp.h> | ||
| 6 | #else | ||
| 7 | |||
| 8 | #define bb_setgrent setgrent | ||
| 9 | #define bb_endgrent endgrent | ||
| 10 | #define bb_getgrent getgrent | ||
| 11 | #define bb_getgrgid getgrgid | ||
| 12 | #define bb_getgrnam getgrnam | ||
| 13 | #define bb_fgetgrent fgetgrent | ||
| 14 | #define bb_setgroups setgroups | ||
| 15 | #define bb_initgroups initgroups | ||
| 16 | #define __bb_getgrent __getgrent | ||
| 17 | |||
| 18 | #include <sys/types.h> | ||
| 19 | #include <features.h> | ||
| 20 | #include <stdio.h> | ||
| 21 | |||
| 22 | /* The group structure */ | ||
| 23 | struct group | ||
| 24 | { | ||
| 25 | char *gr_name; /* Group name. */ | ||
| 26 | char *gr_passwd; /* Password. */ | ||
| 27 | gid_t gr_gid; /* Group ID. */ | ||
| 28 | char **gr_mem; /* Member list. */ | ||
| 29 | }; | ||
| 30 | |||
| 31 | extern void bb_setgrent __P ((void)); | ||
| 32 | extern void bb_endgrent __P ((void)); | ||
| 33 | extern struct group * bb_getgrent __P ((void)); | ||
| 34 | |||
| 35 | extern struct group * bb_getgrgid __P ((__const gid_t gid)); | ||
| 36 | extern struct group * bb_getgrnam __P ((__const char * name)); | ||
| 37 | |||
| 38 | extern struct group * bb_fgetgrent __P ((FILE * file)); | ||
| 39 | |||
| 40 | extern int bb_setgroups __P ((size_t n, __const gid_t * groups)); | ||
| 41 | extern int bb_initgroups __P ((__const char * user, gid_t gid)); | ||
| 42 | |||
| 43 | extern struct group * __bb_getgrent __P ((int grp_fd)); | ||
| 44 | |||
| 45 | #endif /* USE_SYSTEM_PWD_GRP */ | ||
| 46 | #endif /* __BB_GRP_H */ | ||
| 47 | |||
