diff options
-rw-r--r-- | usr.sbin/user/groupinfo.8 | 46 | ||||
-rw-r--r-- | usr.sbin/user/user.c | 6 | ||||
-rw-r--r-- | usr.sbin/user/userinfo.8 | 37 |
3 files changed, 50 insertions, 39 deletions
diff --git a/usr.sbin/user/groupinfo.8 b/usr.sbin/user/groupinfo.8 index 6568d3d7072..cd66729243b 100644 --- a/usr.sbin/user/groupinfo.8 +++ b/usr.sbin/user/groupinfo.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: groupinfo.8,v 1.11 2007/05/31 19:20:30 jmc Exp $ +.\" $OpenBSD: groupinfo.8,v 1.12 2008/12/20 09:40:47 jmc Exp $ .\" $NetBSD: groupinfo.8,v 1.3 2000/10/03 19:32:23 bjh21 Exp $ .\" .\" Copyright (c) 1999 Alistair G. Crooks. All rights reserved. @@ -31,48 +31,46 @@ .\" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" -.Dd $Mdocdate: May 31 2007 $ +.Dd $Mdocdate: December 20 2008 $ .Dt GROUPINFO 8 .Os .Sh NAME .Nm groupinfo -.Nd displays group information +.Nd display group information .Sh SYNOPSIS .Nm groupinfo -.Op Fl ev +.Op Fl e .Ar group .Sh DESCRIPTION The .Nm -utility retrieves the group information from the system. +utility displays the name, group ID (GID), +and members of the specified +.Ar group . .Pp -The following command line options are recognised: +The options are as follows: .Bl -tag -width Ds .It Fl e -return 0 if the group exists, and non-zero if the -group does not exist, on the system. -No information is displayed. +Do not display anything (quiet mode). This form of the command is useful for scripts which need to check whether a particular group name or GID is already in use on the system. -.It Fl v -perform any actions in a verbose manner. .El .Pp The .Ar group -argument may either be a group's name, or a GID. +argument may be either a group name or a GID. .Pp The .Nm -utility exits 0 if the group name or GID exists, and non-zero if it does not. -.Sh FILES -.Bl -tag -width /etc/usermgmt.conf -compact -.It Pa /etc/usermgmt.conf -.El +utility exits 0 if +.Ar group +exists, and non-zero if it does not. .Sh SEE ALSO +.Xr group 5 , .Xr passwd 5 , -.Xr usermgmt.conf 5 +.Xr group 8 , +.Xr userinfo 8 .Sh HISTORY The .Nm @@ -83,3 +81,15 @@ The .Nm utility was written by .An Alistair G. Crooks Aq agc@NetBSD.org . +.Sh CAVEATS +If the specified +.Ar group +is the primary group of a user, but that user is not listed as a +member of the +.Ar group +in the +.Xr group 5 +file, the +.Nm +utility fails to list that user as a member of the +.Ar group . diff --git a/usr.sbin/user/user.c b/usr.sbin/user/user.c index 712e6c2c28a..c0748ef7bba 100644 --- a/usr.sbin/user/user.c +++ b/usr.sbin/user/user.c @@ -1,4 +1,4 @@ -/* $OpenBSD: user.c,v 1.74 2008/12/16 05:25:55 guenther Exp $ */ +/* $OpenBSD: user.c,v 1.75 2008/12/20 09:40:47 jmc Exp $ */ /* $NetBSD: user.c,v 1.69 2003/04/14 17:40:07 agc Exp $ */ /* @@ -1618,7 +1618,7 @@ usermgmt_usage(const char *prog) (void) fprintf(stderr, "usage: %s [-prv] user\n", prog); #ifdef EXTENSIONS } else if (strcmp(prog, "userinfo") == 0) { - (void) fprintf(stderr, "usage: %s [-ev] user\n", prog); + (void) fprintf(stderr, "usage: %s [-e] user\n", prog); #endif } else if (strcmp(prog, "groupadd") == 0) { (void) fprintf(stderr, "usage: %s [-ov] [-g gid] group\n", @@ -1637,7 +1637,7 @@ usermgmt_usage(const char *prog) prog); #ifdef EXTENSIONS } else if (strcmp(prog, "groupinfo") == 0) { - (void) fprintf(stderr, "usage: %s [-ev] group\n", prog); + (void) fprintf(stderr, "usage: %s [-e] group\n", prog); #endif } else { (void) fprintf(stderr, "This program must be called as {user,group}{add,del,mod,info},\n%s is not an understood name.\n", prog); diff --git a/usr.sbin/user/userinfo.8 b/usr.sbin/user/userinfo.8 index 19f966a0a2f..172af7b9837 100644 --- a/usr.sbin/user/userinfo.8 +++ b/usr.sbin/user/userinfo.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: userinfo.8,v 1.11 2007/05/31 19:20:30 jmc Exp $ +.\" $OpenBSD: userinfo.8,v 1.12 2008/12/20 09:40:47 jmc Exp $ .\" $NetBSD: userinfo.8,v 1.8 2003/02/14 16:11:37 grant Exp $ .\" .\" Copyright (c) 1999 Alistair G. Crooks. All rights reserved. @@ -31,48 +31,49 @@ .\" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" -.Dd $Mdocdate: May 31 2007 $ +.Dd $Mdocdate: December 20 2008 $ .Dt USERINFO 8 .Os .Sh NAME .Nm userinfo -.Nd displays user information +.Nd display user information .Sh SYNOPSIS .Nm userinfo -.Op Fl ev +.Op Fl e .Ar user .Sh DESCRIPTION The .Nm -utility retrieves the user information from the system. +utility displays information about the specified +.Ar user . +The fields shown are defined in +.Xr master.passwd 5 . +The encrypted password is only displayed if the calling user is the +superuser. .Pp -The following command line options are recognised: +The options are as follows: .Bl -tag -width Ds .It Fl e -return 0 if the user exists, and non-zero if the -user does not exist, on the system. -No information is displayed. +Do not display anything (quiet mode). This form of the command is useful for scripts which need to check whether a particular user name or UID is already in use on the system. -.It Fl v -perform any actions in a verbose manner. .El .Pp The .Ar user -argument may either be a user's name, or a UID. +argument may be either a user name or a user ID (UID). .Pp The .Nm -utility exits 0 if the user name or UID exists, and non-zero if it does not. -.Sh FILES -.Bl -tag -width /etc/usermgmt.conf -compact -.It Pa /etc/usermgmt.conf -.El +utility exits 0 if +.Ar user +exists, and non-zero if it does not. .Sh SEE ALSO +.Xr id 1 , .Xr passwd 5 , -.Xr usermgmt.conf 5 +.Xr groupinfo 8 , +.Xr user 8 .Sh HISTORY The .Nm |