From 2192f3d86084c47efd452ae3960c5814b18201e8 Mon Sep 17 00:00:00 2001 From: deraadt Date: Mon, 28 Jul 2008 16:27:39 +0000 Subject: [PATCH] document which functions use which YP maps; Ingo Schwarze --- lib/libc/gen/getgrent.3 | 21 ++++++++++++++++++--- lib/libc/gen/getgrouplist.3 | 12 +++++++++--- share/man/man5/group.5 | 16 ++++++++++++++-- 3 files changed, 41 insertions(+), 8 deletions(-) diff --git a/lib/libc/gen/getgrent.3 b/lib/libc/gen/getgrent.3 index e6dda40b854..f89a89b0d57 100644 --- a/lib/libc/gen/getgrent.3 +++ b/lib/libc/gen/getgrent.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getgrent.3,v 1.14 2007/05/31 19:19:28 jmc Exp $ +.\" $OpenBSD: getgrent.3,v 1.15 2008/07/28 16:27:39 deraadt Exp $ .\" .\" Copyright (c) 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd $Mdocdate: May 31 2007 $ +.Dd $Mdocdate: July 28 2008 $ .Dt GETGRENT 3 .Os .Sh NAME @@ -144,6 +144,19 @@ characters in size. .\" .Dv _SC_GETGR_R_SIZE_MAX .\" .Xr sysconf 2 .\" parameter. +.Sh YP SUPPORT +If YP is active, the functions +.Fn getgrent +and +.Fn getgrnam +also use the +.Pa group.byname +YP map and the function +.Fn getgrgid +also uses the +.Pa group.bygid +YP map in addition to the group file, +respecting the order of normal and YP entries in the group file. .Sh RETURN VALUES The functions .Fn getgrent , @@ -175,7 +188,9 @@ group database file .El .Sh SEE ALSO .Xr getpwent 3 , -.Xr group 5 +.Xr group 5 , +.Xr yp 8 , +.Xr ypclnt 3 .Sh HISTORY The functions .Fn endgrent , diff --git a/lib/libc/gen/getgrouplist.3 b/lib/libc/gen/getgrouplist.3 index 5a8b2f922fd..df5d82b090d 100644 --- a/lib/libc/gen/getgrouplist.3 +++ b/lib/libc/gen/getgrouplist.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getgrouplist.3,v 1.10 2007/05/31 19:19:28 jmc Exp $ +.\" $OpenBSD: getgrouplist.3,v 1.11 2008/07/28 16:27:39 deraadt Exp $ .\" .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd $Mdocdate: May 31 2007 $ +.Dd $Mdocdate: July 28 2008 $ .Dt GETGROUPLIST 3 .Os .Sh NAME @@ -48,6 +48,9 @@ The is automatically included in the groups list. Typically this value is given as the group number from the password file. +If YP is active, the +.Pa netid.byname +YP map will be used in addition to the group file. .Pp The resulting group list is returned in the integer array pointed to by .Fa groups . @@ -69,8 +72,11 @@ Here, the group array will be filled with as many groups as will fit. group database file .El .Sh SEE ALSO +.Xr group 5 , .Xr setgroups 2 , -.Xr initgroups 3 +.Xr initgroups 3 , +.Xr yp 8 , +.Xr yp_match 5 .Sh HISTORY The .Fn getgrouplist diff --git a/share/man/man5/group.5 b/share/man/man5/group.5 index 5a7d3545597..b828451b74e 100644 --- a/share/man/man5/group.5 +++ b/share/man/man5/group.5 @@ -1,4 +1,4 @@ -.\" $OpenBSD: group.5,v 1.11 2007/05/31 19:19:58 jmc Exp $ +.\" $OpenBSD: group.5,v 1.12 2008/07/28 16:27:39 deraadt Exp $ .\" $NetBSD: group.5,v 1.4 1995/07/28 06:41:39 phil Exp $ .\" .\" Copyright (c) 1980, 1991, 1993 @@ -31,7 +31,7 @@ .\" .\" @(#)group.5 8.3 (Berkeley) 4/19/94 .\" -.Dd $Mdocdate: May 31 2007 $ +.Dd $Mdocdate: July 28 2008 $ .Dt GROUP 5 .Os .Sh NAME @@ -118,6 +118,18 @@ form should be on the last line, for historical reasons. Only the first group with a specific name encountered, whether in the .Nm file itself, or included via YP, will be used. +.Pp +Proper YP group support requires consistent +.Pa group.byname , +.Pa group.bygid +and +.Pa netid.byname +YP maps. +See +.Xr getgrent 3 +and +.Xr getgrouplist 3 +for details. .Sh FILES .Bl -tag -width /etc/group -compact .It Pa /etc/group -- 2.20.1