1 .\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de)
2 .\" Distributed under GPL
3 .\" based on glibc infopages
5 .TH SETNETGRENT 3 2007-07-26 "GNU" "Linux Programmer's Manual"
7 setnetgrent, endnetgrent, getnetgrent, getnetgrent_r, innetgr \-
8 handle network group entries
13 .BI "int setnetgrent(const char *" netgroup );
15 .B "void endnetgrent(void);"
17 .BI "int getnetgrent(char **" host ", char **" user ", char **" domain );
19 .BI "int getnetgrent_r(char **" host ", char **" user ","
20 .BI " char **" domain ", char *" buf ", int " buflen );
22 .BI "int innetgr(const char *" netgroup ", const char *" host ","
23 .BI " const char *" user ", const char *" domain );
27 Feature Test Macro Requirements for glibc (see
28 .BR feature_test_macros (7)):
37 _BSD_SOURCE || _SVID_SOURCE
43 A netgroup database is a list of string triples
44 .RI ( hostname ", " username ", " domainname )
45 or other netgroup names.
46 Any of the elements in a triple can be empty,
47 which means that anything matches.
48 The functions described here allow access to the netgroup databases.
51 defines what database is searched.
55 call defines the netgroup that will be searched by subsequent
60 function retrieves the next netgroup entry, and returns pointers in
64 A NULL pointer means that the corresponding entry matches any string.
65 The pointers are valid only as long as there is no call to other
66 netgroup-related functions.
67 To avoid this problem you can use the GNU function
69 that stores the strings in the supplied buffer.
70 To free all allocated buffers use
73 In most cases you only want to check if the triplet
74 .RI ( hostname ", " username ", " domainname )
75 is a member of a netgroup.
78 can be used for this without calling the above three functions.
79 Again, a NULL pointer is a wildcard and matches any string.
80 The function is thread-safe.
82 These functions return 1 on success and 0 for failure.
88 These functions are not in POSIX.1-2001, but
94 are available on most UNIX systems.
96 is not widely available on other systems.
97 .\" getnetgrent_r() is on Solaris 8 and AIX 5.1, but not the BSDs.
99 In the BSD implementation,