File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
sudo /
plugins /
sudoers /
tsgetgrpw.h
Revision
1.1.1.1 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Mon Jul 22 10:46:12 2013 UTC (11 years, 3 months ago) by
misho
Branches:
sudo,
MAIN
CVS tags:
v1_8_8p0,
v1_8_8,
v1_8_7p0,
v1_8_7,
v1_8_5p1,
v1_8_3p2,
v1_8_10p3_0,
v1_8_10p3,
HEAD
1.8.7
1: /*
2: * Copyright (c) 2010 Todd C. Miller <Todd.Miller@courtesan.com>
3: *
4: * Permission to use, copy, modify, and distribute this software for any
5: * purpose with or without fee is hereby granted, provided that the above
6: * copyright notice and this permission notice appear in all copies.
7: *
8: * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9: * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10: * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11: * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12: * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13: * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14: * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15: */
16:
17: /*
18: * Trivial replacements for the libc get{gr,pw}{uid,nam}() routines
19: * for use by testsudoers in the sudo test harness.
20: * We need our own since many platforms don't provide set{pw,gr}file().
21: */
22:
23: #include <config.h>
24:
25: /*
26: * Define away the system prototypes so we don't have any conflicts.
27: */
28:
29: #define setgrfile sys_setgrfile
30: #define setgrent sys_setgrent
31: #define endgrent sys_endgrent
32: #define getgrent sys_getgrent
33: #define getgrnam sys_getgrnam
34: #define getgrgid sys_getgrgid
35:
36: #define setpwfile sys_setpwfile
37: #define setpwent sys_setpwent
38: #define endpwent sys_endpwent
39: #define getpwent sys_getpwent
40: #define getpwnam sys_getpwnam
41: #define getpwuid sys_getpwuid
42:
43: #include <pwd.h>
44: #include <grp.h>
45:
46: #undef setgrfile
47: #undef setgrent
48: #undef endgrent
49: #undef getgrent
50: #undef getgrnam
51: #undef getgrgid
52:
53: void setgrfile(const char *);
54: void setgrent(void);
55: void endgrent(void);
56: struct group *getgrent(void);
57: struct group *getgrnam(const char *);
58: struct group *getgrgid(gid_t);
59:
60: #undef setpwfile
61: #undef setpwent
62: #undef endpwent
63: #undef getpwent
64: #undef getpwnam
65: #undef getpwuid
66:
67: void setpwfile(const char *);
68: void setpwent(void);
69: void endpwent(void);
70: struct passwd *getpwent(void);
71: struct passwd *getpwnam(const char *);
72: struct passwd *getpwuid(uid_t);
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>