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 2014-05-28 "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)):
42 _BSD_SOURCE || _SVID_SOURCE
48 A netgroup database is a list of string triples
49 .RI ( hostname ", " username ", " domainname )
50 or other netgroup names.
51 Any of the elements in a triple can be empty,
52 which means that anything matches.
53 The functions described here allow access to the netgroup databases.
56 defines what database is searched.
60 call defines the netgroup that will be searched by subsequent
65 function retrieves the next netgroup entry, and returns pointers in
69 A null pointer means that the corresponding entry matches any string.
70 The pointers are valid only as long as there is no call to other
71 netgroup-related functions.
72 To avoid this problem you can use the GNU function
74 that stores the strings in the supplied buffer.
75 To free all allocated buffers use
78 In most cases you want to check only if the triplet
79 .RI ( hostname ", " username ", " domainname )
80 is a member of a netgroup.
83 can be used for this without calling the above three functions.
84 Again, a null pointer is a wildcard and matches any string.
85 The function is thread-safe.
87 These functions return 1 on success and 0 for failure.
93 These functions are not in POSIX.1-2001, but
99 are available on most UNIX systems.
101 is not widely available on other systems.
102 .\" getnetgrent_r() is on Solaris 8 and AIX 5.1, but not the BSDs.
104 In the BSD implementation,
112 This page is part of release 3.79 of the Linux
115 A description of the project,
116 information about reporting bugs,
117 and the latest version of this page,
119 \%http://www.kernel.org/doc/man\-pages/.