198 lines
		
	
	
	
		
			5.4 KiB
		
	
	
	
		
			Groff
		
	
	
	
	
	
			
		
		
	
	
			198 lines
		
	
	
	
		
			5.4 KiB
		
	
	
	
		
			Groff
		
	
	
	
	
	
| .\" Copyright (c) 1989, 1991, 1993
 | ||
| .\"	The Regents of the University of California.  All rights reserved.
 | ||
| .\"
 | ||
| .\" Redistribution and use in source and binary forms, with or without
 | ||
| .\" modification, are permitted provided that the following conditions
 | ||
| .\" are met:
 | ||
| .\" 1. Redistributions of source code must retain the above copyright
 | ||
| .\"    notice, this list of conditions and the following disclaimer.
 | ||
| .\" 2. Redistributions in binary form must reproduce the above copyright
 | ||
| .\"    notice, this list of conditions and the following disclaimer in the
 | ||
| .\"    documentation and/or other materials provided with the distribution.
 | ||
| .\" 3. All advertising materials mentioning features or use of this software
 | ||
| .\"    must display the following acknowledgement:
 | ||
| .\"	This product includes software developed by the University of
 | ||
| .\"	California, Berkeley and its contributors.
 | ||
| .\" 4. Neither the name of the University nor the names of its contributors
 | ||
| .\"    may be used to endorse or promote products derived from this software
 | ||
| .\"    without specific prior written permission.
 | ||
| .\"
 | ||
| .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 | ||
| .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | ||
| .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | ||
| .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 | ||
| .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | ||
| .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | ||
| .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | ||
| .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | ||
| .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | ||
| .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | ||
| .\" SUCH DAMAGE.
 | ||
| .\"
 | ||
| .\"     From: @(#)getgrent.3	8.2 (Berkeley) 4/19/94
 | ||
| .\"	$Id: getgrent.3,v 1.4 2002-05-18 07:12:54 horikawa Exp $
 | ||
| .\"
 | ||
| .\" $FreeBSD$
 | ||
| .Dd September 29, 1994
 | ||
| .Dt GETGRENT 3
 | ||
| .Os
 | ||
| .Sh ̾¾Î
 | ||
| .Nm getgrent ,
 | ||
| .Nm getgrnam ,
 | ||
| .Nm getgrgid ,
 | ||
| .Nm setgroupent ,
 | ||
| .\" .Nm setgrfile ,
 | ||
| .Nm setgrent ,
 | ||
| .Nm endgrent
 | ||
| .Nd ¥°¥ë¡¼¥×¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÁàºî
 | ||
| .Sh ½ñ¼°
 | ||
| .Fd #include <sys/types.h>
 | ||
| .Fd #include <grp.h>
 | ||
| .Ft struct group *
 | ||
| .Fn getgrent void
 | ||
| .Ft struct group *
 | ||
| .Fn getgrnam "const char *name"
 | ||
| .Ft struct group *
 | ||
| .Fn getgrgid "gid_t gid"
 | ||
| .Ft int
 | ||
| .Fn setgroupent "int stayopen"
 | ||
| .\" .Ft void
 | ||
| .\" .Fn setgrfile "const char *name"
 | ||
| .Ft int
 | ||
| .Fn setgrent void
 | ||
| .Ft void
 | ||
| .Fn endgrent void
 | ||
| .Sh ²òÀâ
 | ||
| ¤³¤ì¤é¤Î´Ø¿ô¤Ï¤¤¤º¤ì¤â¡¢
 | ||
| .Xr group 5
 | ||
| ¤Ëµ½Ò¤µ¤ì¤¿¥°¥ë¡¼¥×¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë
 | ||
| .Pa /etc/group
 | ||
| ¤òÁàºî¤·¤Þ¤¹¡£¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î³Æ¹Ô¤Ï¡¢¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë
 | ||
| .Aq Pa grp.h
 | ||
| ¤Ë¤¢¤ë¹½Â¤ÂÎ
 | ||
| .Ar group
 | ||
| ¤Ë¤è¤Ã¤ÆÄêµÁ¤µ¤ì¤Þ¤¹¡£¼¡¤Î¤È¤ª¤ê¤Ç¤¹¡£
 | ||
| .Bd -literal -offset indent
 | ||
| struct group {
 | ||
| 	char	*gr_name;	/* ¥°¥ë¡¼¥×̾ */
 | ||
| 	char	*gr_passwd;	/* ¥°¥ë¡¼¥×¥Ñ¥¹¥ï¡¼¥É */
 | ||
| 	int	gr_gid;		/* ¥°¥ë¡¼¥× id */
 | ||
| 	char	**gr_mem;	/* ¥°¥ë¡¼¥×¥á¥ó¥Ð */
 | ||
| };
 | ||
| .Ed
 | ||
| .Pp
 | ||
| ´Ø¿ô
 | ||
| .Fn getgrnam
 | ||
| ¤ª¤è¤Ó
 | ||
| .Fn getgrgid
 | ||
| ¤Ï¡¢
 | ||
| .Ar name
 | ||
| ¤Ë¼¨¤¹Í¿¤¨¤é¤ì¤¿¥°¥ë¡¼¥×̾¤Þ¤¿¤Ï
 | ||
| .Ar gid
 | ||
| ¤Ë¼¨¤¹¥°¥ë¡¼¥× id ¤ò¡¢¥°¥ë¡¼¥×¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ç¸¡º÷¤·¤Æ¡¢¤½¤ì¤¾¤ì¤ËºÇ½é¤Î
 | ||
| Ŭ¹ç¥¨¥ó¥È¥ê¤òÊÖ¤·¤Þ¤¹¡£°Û¤Ê¤ë¥¨¥ó¥È¥ê¤ËƱ°ì¥°¥ë¡¼¥×̾¤Þ¤¿¤Ï¡¢Æ±°ì¥°¥ë¡¼¥× id
 | ||
| ¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤ë¤È¡¢Ì¤ÄêµÁ¤ÊÉÔ¬¤Îµóư¤ò¤â¤¿¤é¤¹¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£
 | ||
| .Pp
 | ||
| .Fn getgrent
 | ||
| ´Ø¿ô¤Ï¡¢¥°¥ë¡¼¥×¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò½ç¼¡ÆÉ¤ß¹þ¤ß¤Þ¤¹¡£´°Á´¤Ê
 | ||
| ¥°¥ë¡¼¥×¥ê¥¹¥È¤òÃå¼Â¤ËÀ¸À®¤¹¤ë¥×¥í¥°¥é¥à¸þ¤¤Ç¤¹¡£
 | ||
| .Pp
 | ||
| 3 ¤Ä¤Î¥ë¡¼¥Á¥ó¤Ï¤¤¤º¤ì¤â¡¢ÆÉ¤ß¹þ¤ß¤ËɬÍפʤé¤ÐÌÜŪ¤Î¥°¥ë¡¼¥×¥Õ¥¡¥¤¥ë¤ò
 | ||
| ¥ª¡¼¥×¥ó¤·¤Þ¤¹¡£
 | ||
| .Pp
 | ||
| .Fn setgroupent
 | ||
| ´Ø¿ô¤ÏÌÜŪ¤Î¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¡¢¤Þ¤¿¤Ï¤¹¤Ç¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë
 | ||
| ¾ì¹ç¤Ï¥ê¥ï¥¤¥ó¥É¤·¤Þ¤¹¡£
 | ||
| .Fa stayopen
 | ||
| ¤¬ 0 ¤Ç¤Ê¤±¤ì¤Ð¡¢¥Õ¥¡¥¤¥ëµ½Ò»Ò¤Ï¥ª¡¼¥×¥ó
 | ||
| ¤Î¤Þ¤Þ¤Ë¤µ¤ì¡¢°Ê¸å¤Î´Ø¿ô¸Æ¤Ó½Ð¤·¤¬¤¤ï¤á¤Æ¹â®²½¤µ¤ì¤Þ¤¹¡£¤¿¤À¤·
 | ||
| .Fn getgrent
 | ||
| ¤Î¾ì¹ç¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¥Õ¥¡¥¤¥ëµ½Ò»Ò¤ò¥¯¥í¡¼¥º¤·¤Ê¤¤¤Î¤Ç¡¢¤³¤Î
 | ||
| µ¡Ç½¤ÏÉÔÍפǤ¹¡£¤Þ¤¿¡¢¥°¥ë¡¼¥×¥Õ¥¡¥¤¥ë¤¬¹¹¿·¤µ¤ì¤ë²ÄǽÀ¤¬¤¢¤ë¤Î¤Ç¡¢
 | ||
| Ĺ´ü´Ö¼Â¹Ô¤¹¤ë¥×¥í¥°¥é¥à¤Ç¤³¤Îµ¡Ç½¤ò»ÈÍѤ¹¤ë¤Î¤Ï´í¸±¤Ç¤¹¡£Ãí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
 | ||
| .Pp
 | ||
| .Fn setgrent
 | ||
| ´Ø¿ô¤Ï¡¢0 ¤Î°ú¿ô¤ò»ý¤Ä
 | ||
| .Fn setgroupent
 | ||
| ¤ÈƱ¤¸¤Ç¤¹¡£
 | ||
| .Pp
 | ||
| .Fn endgrent
 | ||
| ´Ø¿ô¤Ï¡¢¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤ò¥¯¥í¡¼¥º¤·¤Þ¤¹¡£
 | ||
| .Sh YP/NIS ¤ÎÁê¸ßºîÍÑ
 | ||
| .Xr yp 4
 | ||
| ¥°¥ë¡¼¥×¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬»ÈÍѲÄǽ¤Ê¾ì¹ç¡¢Í׵ᤵ¤ì¤¿¥°¥ë¡¼¥×¤¬¥í¡¼¥«¥ë¤Î
 | ||
| .Pa /etc/groupfile
 | ||
| ¤Ë¸«ÉÕ¤«¤é¤Ê¤¤¤È¡¢
 | ||
| .Fn getgrnam
 | ||
| ¤ª¤è¤Ó
 | ||
| .Fn getgrgid
 | ||
| ´Ø¿ô¤Ï¡¢
 | ||
| YP ¥Þ¥Ã¥×
 | ||
| .Dq group.byname
 | ||
| ¤ª¤è¤Ó
 | ||
| .Dq group.bygid
 | ||
| ¤ò¤½¤ì¤¾¤ì»ÈÍѤ·¤Þ¤¹¡£
 | ||
| .Xr group 5
 | ||
| ¤Çµ½Ò¤µ¤ì¤¿¤È¤ª¤ê¤ËÁ´ÂΥޥåפ¬»ÈÍѲÄǽ¤Ê¤é¤Ð¡¢
 | ||
| .Fn getgrent
 | ||
| ´Ø¿ô¤Ï YP ¥Þ¥Ã¥×
 | ||
| .Dq group.byname
 | ||
| ¤òÄ̤ê¤Þ¤¹¡£
 | ||
| .Sh Ìá¤êÃÍ
 | ||
| ´Ø¿ô
 | ||
| .Fn getgrent ,
 | ||
| .Fn getgrnam ,
 | ||
| .Fn getgrgid
 | ||
| ¤Ï¡¢¤¤¤º¤ì¤âÀ®¸ù¤¹¤ë¤È
 | ||
| ¥°¥ë¡¼¥×¥¨¥ó¥È¥ê¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤·¤Þ¤¹¡£¥¨¥ó¥É¥ª¥Ö¥Õ¥¡¥¤¥ë¤ËÅþ㤹¤ë¤«¥¨¥é¡¼
 | ||
| ¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï¡¢¥Ì¥ë¥Ý¥¤¥ó¥¿¤¬ÊÖ¤ê¤Þ¤¹¡£´Ø¿ô
 | ||
| .Fn setgroupent
 | ||
| ¤ª¤è¤Ó
 | ||
| .Fn setgrent
 | ||
| ¤Ï¡¢½èÍý¤¬Ìµ»ö¤Ë´°Î»¤·¤¿¾ì¹ç¤ÏÃÍ 1 ¤òÊÖ¤·¤Þ¤¹¡£
 | ||
| ¤½¤Î¾¤Î¾ì¹ç¤ÏÃÍ 0 ¤¬ÊÖ¤ê¤Þ¤¹¡£
 | ||
| ´Ø¿ô
 | ||
| .Fn endgrent
 | ||
| ¤ª¤è¤Ó
 | ||
| .Fn setgrfile
 | ||
| ¤ÎÌá¤êÃͤϤ¢¤ê¤Þ¤»¤ó¡£
 | ||
| .Pp
 | ||
| .Sh ´ØÏ¢¥Õ¥¡¥¤¥ë
 | ||
| .Bl -tag -width /etc/group -compact
 | ||
| .It Pa /etc/group
 | ||
| ¥°¥ë¡¼¥×¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë
 | ||
| .El
 | ||
| .Sh ´ØÏ¢¹àÌÜ
 | ||
| .Xr getpwent 3 ,
 | ||
| .Xr yp 4 ,
 | ||
| .Xr group 5
 | ||
| .Sh Îò»Ë
 | ||
| ´Ø¿ô
 | ||
| .Fn endgrent ,
 | ||
| .Fn getgrent ,
 | ||
| .Fn getgrnam ,
 | ||
| .Fn getgrgid ,
 | ||
| .Fn setgrent
 | ||
| ¤Ï¡¢
 | ||
| .At v7
 | ||
| ¤ÇºÇ½é¤Ë¼è¤êÆþ¤ì¤é¤ì¤Þ¤·¤¿¡£´Ø¿ô
 | ||
| .Fn setgrfile
 | ||
| ¤ª¤è¤Ó
 | ||
| .Fn setgroupent
 | ||
| ¤Ï¡¢
 | ||
| .Bx 4.3 Reno
 | ||
| ¤ÇºÇ½é¤Ë¼è¤êÆþ¤ì¤é¤ì¤Þ¤·¤¿¡£
 | ||
| .Sh ¸ß´¹À
 | ||
| ÂåÂØ¥Ñ¥¹¥ï¡¼¥É¥Ç¡¼¥¿¥Ù¡¼¥¹¤Îµ¬³Ê¤òµö¤·¤¿Îò»ËŪ¤Ê´Ø¿ô
 | ||
| .Fn setgrfile
 | ||
| ¤Ï¡¢¤³¤ì¤Þ¤ÇÈóÆñ¤µ¤ì¤Æ¤¤Þ¤·¤¿¤¬¡¢¤â¤Ï¤ä»ÈÍѤǤ¤Þ¤»¤ó¡£
 | ||
| .Sh ¥Ð¥°
 | ||
| ´Ø¿ô
 | ||
| .Fn getgrent ,
 | ||
| .Fn getgrnam ,
 | ||
| .Fn getgrgid ,
 | ||
| .Fn setgroupent ,
 | ||
| .Fn setgrent
 | ||
| ¤Ï¡¢¤½¤ì¤¾¤ì¤Î·ë²Ì¤òÆâÉô¤ÎÀÅŪ¥ª¥Ö¥¸¥§¥¯¥È¤Ë»Ä¤·¡¢¤½¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Î
 | ||
| ¥Ý¥¤¥ó¥¿¤òÊÖ¤·¤Þ¤¹¡£¸å¤Ë³¤¯Æ±¤¸´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¤Ï¡¢¤½¤ÎƱ¤¸¥ª¥Ö¥¸¥§¥¯¥È¤ò
 | ||
| ²þÊѤ·¤Þ¤¹¡£
 |