1 .\" Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de)
2 .\" Distributed under GPL
3 .\" based on glibc infopages
6 .\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI
7 .\" all rights reserved.
8 .\" Translated 2005-02-20, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
10 .TH SETNETGRENT 3 2007-07-26 "GNU" "Linux Programmer's Manual"
13 .\"O setnetgrent, endnetgrent, getnetgrent, getnetgrent_r, innetgr \-
14 .\"O handle network group entries
15 setnetgrent, endnetgrent, getnetgrent, getnetgrent_r, innetgr \-
16 ¥Í¥Ã¥È¥ï¡¼¥¯¡¦¥°¥ë¡¼¥×¤Î¥¨¥ó¥È¥ê¤òÁàºî¤¹¤ë
22 .BI "int setnetgrent(const char *" netgroup );
24 .B "void endnetgrent(void);"
26 .BI "int getnetgrent(char **" host ", char **" user ", char **" domain );
28 .BI "int getnetgrent_r(char **" host ", char **" user ","
29 .BI " char **" domain ", char *" buf ", int " buflen );
31 .BI "int innetgr(const char *" netgroup ", const char *" host ","
32 .BI " const char *" user ", const char *" domain );
36 .\"O Feature Test Macro Requirements for glibc (see
37 .\"O .BR feature_test_macros (7)):
38 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
39 .RB ( feature_test_macros (7)
49 _BSD_SOURCE || _SVID_SOURCE
55 .\"O is a SunOS invention.
56 .\"O A netgroup database is a list of string triples
57 .\"O .RI ( hostname ", " username ", " domainname )
58 .\"O or other netgroup names.
59 .\"O Any of the elements in a triple can be empty,
60 .\"O which means that anything matches.
61 .\"O The functions described here allow access to the netgroup databases.
63 .\"O .I /etc/nsswitch.conf
64 .\"O defines what database is searched.
66 ¤Ï SunOS ¤Ç¹Í°Æ¤µ¤ì¤¿¤â¤Î¤Ç¤¢¤ë¡£¥Í¥Ã¥È¥°¥ë¡¼¥×¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î
67 ¥¨¥ó¥È¥ê¤Ï¡¢ 3 ¤Ä¤Îʸ»úÎó¤Î¥ê¥¹¥È
68 .RI ( hostname ", " username ", " domainname )
69 ¤â¤·¤¯¤Ï¥Í¥Ã¥È¥°¥ë¡¼¥×̾¤Ç¤¢¤ë¡£
70 Á°µ¤Î¥ê¥¹¥È¤Î³ÆÍ×ÁǤ϶õ¤Ç¤¢¤Ã¤Æ¤â¤è¤¤¡£
71 ¶õ¤Ï²¿¤È¤Ç¤â°ìÃפ¹¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£
72 ËÜ¥Ú¡¼¥¸¤ÇÀâÌÀ¤¹¤ë´Ø¿ô¤ò»È¤¦¤³¤È¤Ç¡¢¥Í¥Ã¥È¥°¥ë¡¼¥×¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë
73 ¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£¤É¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬¸¡º÷¤µ¤ì¤ë¤«¤Ï
75 ¥Õ¥¡¥¤¥ë¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
78 .\"O .BR setnetgrent ()
79 .\"O call defines the netgroup that will be searched by subsequent
80 .\"O .BR getnetgrent ()
83 .\"O .BR getnetgrent ()
84 .\"O function retrieves the next netgroup entry, and returns pointers in
89 ¥³¡¼¥ë¤Ï¡¢¤³¤Î¸å¤Ç¸Æ¤Ð¤ì¤ë
91 ¥³¡¼¥ë¤¬¸¡º÷¤¹¤ë¥Í¥Ã¥È¥°¥ë¡¼¥×¤òÄê¤á¤ë¡£
93 ´Ø¿ô¤Ï¥Í¥Ã¥È¥°¥ë¡¼¥×¤Î¼¡¤Î¥¨¥ó¥È¥ê¤ò¼èÆÀ¤·¡¢
97 ¤Ë¥Ý¥¤¥ó¥¿¤òÆþ¤ì¤ÆÊ֤롣
98 .\"O A NULL pointer means that the corresponding entry matches any string.
99 .\"O The pointers are valid only as long as there is no call to other
100 .\"O netgroup-related functions.
101 .\"O To avoid this problem you can use the GNU function
102 .\"O .BR getnetgrent_r ()
103 .\"O that stores the strings in the supplied buffer.
104 .\"O To free all allocated buffers use
105 .\"O .BR endnetgrent ().
106 NULL ¥Ý¥¤¥ó¥¿¤Ï¡¢Âбþ¤¹¤ë¥¨¥ó¥È¥ê¤¬¤É¤ó¤Êʸ»úÎó¤È¤â°ìÃפ¹¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£
107 ÆÀ¤é¤ì¤¿¥Ý¥¤¥ó¥¿¤Ï¡¢¥Í¥Ã¥È¥°¥ë¡¼¥×´Ø·¸¤Î´Ø¿ô¤Î¤¤¤º¤ì¤«¤¬¸Æ¤Ð¤ì¤ë¤Þ¤Ç¤Î
108 ´Ö¤À¤±Í¸ú¤Ç¤¢¤ë¡£¤³¤ÎÌäÂê¤òÈò¤±¤ë¤¿¤á¤Ë¤Ï GNU ³ÈÄ¥¤Î´Ø¿ô
110 ¤ò»È¤¦¤È¤è¤¤¡£¤³¤Î´Ø¿ô¤Ï¸Æ¤Ó½Ð¤·Â¦¤¬ÍÑ°Õ¤·¤¿¥Ð¥Ã¥Õ¥¡¤Ë
111 ʸ»úÎó¤ò³ÊǼ¤¹¤ë¡£³ä¤êÅö¤ÆºÑ¤Î¥Ð¥Ã¥Õ¥¡¤òÁ´¤Æ²òÊü¤¹¤ë¤Ë¤Ï
115 .\"O In most cases you only want to check if the triplet
116 .\"O .RI ( hostname ", " username ", " domainname )
117 .\"O is a member of a netgroup.
120 .\"O can be used for this without calling the above three functions.
121 .\"O Again, a NULL pointer is a wildcard and matches any string.
122 .\"O The function is thread-safe.
124 .RI ( hostname ", " username ", " domainname )
125 ¤Î3Í×ÁǤÎÁȤ¬¥Í¥Ã¥È¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð¡¼¤«¤É¤¦¤«¤ò³Îǧ¤·¤¿¤¤¤À¤±¤Ç¤¢¤í¤¦¡£
127 ´Ø¿ô¤ò»È¤¦¤È¡¢¾åµ¤Î3¤Ä¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤µ¤º¤Ë¤³¤ÎÌÜŪ¤òãÀ®¤Ç¤¤ë¡£
128 ¤â¤¦°ìÅÙ½ñ¤¤¤Æ¤ª¤¯¤¬¡¢NULL ¥Ý¥¤¥ó¥¿¤Ï¥ï¥¤¥ë¥É¥«¡¼¥É¤Ç¤¢¤ê¡¢
129 ¤¢¤é¤æ¤ëʸ»úÎó¤È°ìÃפ¹¤ë¡£¤³¤Î´Ø¿ô¤Ï¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¤¢¤ë¡£
130 .\"O .SH "RETURN VALUE"
132 .\"O These functions return 1 on success and 0 for failure.
133 ¤³¤ì¤é¤Î´Ø¿ô¤ÏÀ®¸ù¤¹¤ë¤È 1 ¤ò¡¢¼ºÇÔ¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£
138 .I /etc/nsswitch.conf
139 .\"O .SH CONFORMING TO
141 .\"O These functions are not in POSIX.1-2001, but
142 .\"O .BR setnetgrent (),
143 .\"O .BR endnetgrent (),
144 .\"O .BR getnetgrent (),
147 .\"O are available on most Unix systems.
148 .\"O .BR getnetgrent_r ()
149 .\"O is not widely available on other systems.
150 ¤³¤ì¤é¤Î´Ø¿ô¤Ï POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¤¬¡¢
155 ¤Ï¤Û¤È¤ó¤É¤Î Unix ¥·¥¹¥Æ¥à¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£
157 ¤Ï¹¤¯Â¾¤Î¥·¥¹¥Æ¥à¤ÇÍøÍѤǤ¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£
158 .\" getnetgrent_r() is on Solaris 8 and AIX 5.1, but not the BSDs.
161 .\"O In the BSD implementation,
162 .\"O .BR setnetgrent ()