1 .\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de)
3 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
4 .\" Distributed under GPL
7 .\" based on glibc infopages
10 .TH SETNETGRENT 3 2016-10-08 "GNU" "Linux Programmer's Manual"
12 setnetgrent, endnetgrent, getnetgrent, getnetgrent_r, innetgr \-
13 handle network group entries
18 .BI "int setnetgrent(const char *" netgroup );
20 .B "void endnetgrent(void);"
22 .BI "int getnetgrent(char **" host ", char **" user ", char **" domain );
24 .BI "int getnetgrent_r(char **" host ", char **" user ","
25 .BI " char **" domain ", char *" buf ", size_t " buflen );
27 .BI "int innetgr(const char *" netgroup ", const char *" host ","
28 .BI " const char *" user ", const char *" domain );
32 Feature Test Macro Requirements for glibc (see
33 .BR feature_test_macros (7)):
44 Glibc 2.19 and earlier:
45 _BSD_SOURCE || _SVID_SOURCE
51 A netgroup database is a list of string triples
52 .RI ( hostname ", " username ", " domainname )
53 or other netgroup names.
54 Any of the elements in a triple can be empty,
55 which means that anything matches.
56 The functions described here allow access to the netgroup databases.
59 defines what database is searched.
63 call defines the netgroup that will be searched by subsequent
68 function retrieves the next netgroup entry, and returns pointers in
72 A null pointer means that the corresponding entry matches any string.
73 The pointers are valid only as long as there is no call to other
74 netgroup-related functions.
75 To avoid this problem you can use the GNU function
77 that stores the strings in the supplied buffer.
78 To free all allocated buffers use
81 In most cases you want to check only if the triplet
82 .RI ( hostname ", " username ", " domainname )
83 is a member of a netgroup.
86 can be used for this without calling the above three functions.
87 Again, a null pointer is a wildcard and matches any string.
88 The function is thread-safe.
90 These functions return 1 on success and 0 for failure.
96 For an explanation of the terms used in this section, see
102 Interface Attribute Value
106 .BR getnetgrent_r (),
110 MT-Unsafe race:netgrent
116 T} Thread safety MT-Unsafe race:netgrent
120 MT-Unsafe race:netgrent
122 race:netgrentbuf locale
130 signifies that if any of the functions
132 .BR getnetgrent_r (),
137 are used in parallel in different threads of a program,
138 then data races could occur.
140 These functions are not in POSIX.1, but
146 are available on most UNIX systems.
148 is not widely available on other systems.
149 .\" getnetgrent_r() is on Solaris 8 and AIX 5.1, but not the BSDs.
151 In the BSD implementation,