This commit is contained in:
lukem 1997-10-18 04:08:16 +00:00
parent 2c30449e9c
commit 98ec13d8d9
2 changed files with 19 additions and 15 deletions

View File

@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)chown.8 8.3 (Berkeley) 3/31/94
.\" $NetBSD: chown.8,v 1.7 1997/10/17 08:10:10 enami Exp $
.\" $NetBSD: chown.8,v 1.8 1997/10/18 04:08:16 lukem Exp $
.\"
.Dd March 31, 1994
.Dt CHOWN 8
@ -39,7 +39,7 @@
.Nm chown
.Nd change file owner and group
.Sh SYNOPSIS
.Nm chown
.Nm
.Oo
.Fl R
.Op Fl H | Fl L | Fl P
@ -47,7 +47,7 @@
.Op Fl fh
.Ar owner Op Ar :group
.Ar file ...
.Nm chown
.Nm ""
.Oo
.Fl R
.Op Fl H | Fl L | Fl P
@ -56,7 +56,7 @@
.Ar :group
.Ar file ...
.Sh DESCRIPTION
.Nm Chown
.Nm
sets the user ID and/or the group ID of the specified files.
.Pp
The options are as follows:
@ -93,7 +93,7 @@ is not given, unless the
or
.Fl L
option is set,
.Nm chown
.Nm
on a symbolic link always succeeds and has no effect.
The
.Fl H ,
@ -130,17 +130,17 @@ The ownership of a file may only be altered by a super-user for
obvious security reasons.
.Pp
The
.Nm chown
.Nm
utility exits 0 on success, and >0 if an error occurs.
.Sh COMPATIBILITY
Previous versions of the
.Nm chown
.Nm
utility used the dot (``.'') character to distinguish the group name.
This has been changed to be a colon (``:'') character so that user and
group names may contain the dot character.
.Pp
Previous versions of the
.Nm chown
.Nm
utility changed the owner of symbolic links specified on the command
line.
In this system, symbolic links do not have owners.
@ -152,5 +152,5 @@ In this system, symbolic links do not have owners.
.Xr symlink 7
.Sh STANDARDS
The
.Nm chown
.Nm
command is expected to be POSIX 1003.2 compliant.

View File

@ -31,15 +31,18 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
static char copyright[] =
"@(#) Copyright (c) 1988, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
__COPYRIGHT("@(#) Copyright (c) 1988, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n");
#endif /* not lint */
#ifndef lint
/* from: static char sccsid[] = "@(#)chown.c 8.8 (Berkeley) 4/4/94"; */
static char *rcsid = "$NetBSD: chown.c,v 1.12 1997/10/11 03:14:12 enami Exp $";
#if 0
static char sccsid[] = "@(#)chown.c 8.8 (Berkeley) 4/4/94";
#else
__RCSID("$NetBSD: chown.c,v 1.13 1997/10/18 04:08:19 lukem Exp $");
#endif
#endif /* not lint */
#include <sys/param.h>
@ -62,6 +65,7 @@ void a_gid __P((char *));
void a_uid __P((char *));
void chownerr __P((char *));
u_long id __P((char *, char *));
int main __P((int, char **));
void usage __P((void));
uid_t uid;
@ -160,7 +164,7 @@ main(argc, argv)
a_gid(*argv);
if ((ftsp = fts_open(++argv, fts_options, 0)) == NULL)
err(1, NULL);
err(1, "%s", "");
for (rval = 0; (p = fts_read(ftsp)) != NULL;) {
switch (p->fts_info) {