Commit Graph

49 Commits

Author SHA1 Message Date
Giorgos Keramidas
0f2e01e04d Reword the description of -R a bit and add a note about being careful
when -R is combined with patterns that might match ".." (like ".*").

PR:		46415
Submitted by:	Gary W. Swearingen <swear@attbi.com>
2003-01-26 02:40:23 +00:00
David E. O'Brien
987d3799f3 Use basename(3). 2002-12-30 10:16:56 +00:00
David Malone
999feccf15 Fix a spelling mistake.
PR:		40695
Submitted by:	Maxim Maximov <mcsi@agava.com>
MFC after:	1 week
2002-07-17 16:22:24 +00:00
Philippe Charnier
490d5836b5 The .Nm utility 2002-07-14 14:47:15 +00:00
Juli Mallett
7aed2b41a4 Kill __P(), use ANSI C function declarations, remove local prototype for main,
and add a __FBSDID() while I'm here.
2002-06-30 15:30:14 +00:00
Juli Mallett
ec6c14f6eb In the SUPPORT_DOT case, warn that seperation with a period is deprecated.
In -STABLE, this is default, in -CURRENT it is not, which leads to many a
headache for a user coming to -CURRENT without remembering this fact.  It
is one of the POLA violations we have not avoided by preparing the users
for it appopriately.  Therefore, a warnx(3) is added here, explicitly to
be MFC'd shortly to start the re-education process rolling.

Reviewed by:	General murmurs of approval in that IRC channel.
MFC after:	3 days
2002-06-27 21:23:16 +00:00
Tim J. Robbins
dcafd7c96a Don't exit immediately if an error occurs, continue but exit non-zero. 2002-06-02 09:32:39 +00:00
Ruslan Ermilov
a37bec1d74 mdoc(7) police: removed an extra .Op call. 2002-05-30 07:48:01 +00:00
Tom Rhodes
4ace33924b chown(8) was not describing symlinks correctly, fixed.
PR:	36447
No objections from: ru
MFC after:	3 days
2002-04-09 20:24:23 +00:00
Luigi Rizzo
69393d0646 Add prototypes for main() so that these programs compile with -Werror
(which somehow now seems to be the default for compiling -current).
This error popped up while doing a PicoBSD cross-compile on a 4.3-ish system,
it may well be that there are other apps which have similar problems,
but I did not spot them as they are not included in my picobsd config.

Whether adding prototypes for main() is the correct solution or not
I have no idea, a request to -current on the matter went basically
unanswered. Those who have better ideas are welcome to back this out
and replace it with the correct fix.
2001-12-14 16:22:41 +00:00
Ruslan Ermilov
8f9dacc2e6 Clean up, WARNSify, unbreak -v option handling. 2001-09-13 14:55:59 +00:00
Dima Dorfman
5fa09bc197 If a sentence starts inside parenthesis, it should end inside
parenthesis.
2001-09-11 13:07:03 +00:00
Ruslan Ermilov
d628d776c4 mdoc(7) police: utilize the new .Ex macro. 2001-08-15 09:09:47 +00:00
David E. O'Brien
90e655ea4e Perform a major cleanup of the usr.sbin Makefiles.
These are not perfectly in agreement with each other style-wise, but they
are orders of orders of magnitude more consistent style-wise than before.
2001-07-20 06:20:32 +00:00
Ruslan Ermilov
a4c37c816b mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 15:12:08 +00:00
David E. O'Brien
b368031d99 Starting with 5.0-R, do not support `.' as a owner / group delimiter. 2001-05-31 19:30:19 +00:00
Ruslan Ermilov
01b4e93eff Fixed the bug from the previous revision.
``chown -h owner symlink'' did not set the symlink's owner
if the file the symlink points to already had that owner:

# ls -l alink afile
-rw-r--r--  1 nobody  ru  0 May 31 14:14 afile
lrwxr-xr-x  1 root    ru  5 May 31 14:14 alink -> afile
# ./chown -h -v nobody alink
# ls -l alink afile
-rw-r--r--  1 nobody  ru  0 May 31 14:14 afile
lrwxr-xr-x  1 root    ru  5 May 31 14:14 alink -> afile

Similarly for chgrp(1) and chmod(1).
2001-05-31 11:47:20 +00:00
Ruslan Ermilov
8e46d9c279 Follow symbolic links named as command line arguments if run without -R.
This is required by symlink(7), ``Commands not traversing a file tree''
subsection, third paragraph:

: It is important to realize that this rule includes commands which may
: optionally traverse file trees, e.g. the command ``chown file'' is
: included in this rule, while the command ``chown -R file'' is not.

For chown(8) and chgrp(1), this is also is compliance with the latest
POSIX 1003.1-200x draft.

MFC after:	1 week
2001-05-28 12:58:10 +00:00
Ruslan Ermilov
95a09b0557 Make it clear that -P is the default.
PR:		docs/27629
2001-05-25 07:32:58 +00:00
Ruslan Ermilov
345e52e742 - Backout botched attempt to introduce MANSECT feature.
- MAN[1-9] -> MAN.
2001-03-26 14:42:20 +00:00
Ruslan Ermilov
47dec78170 mdoc(7) police: use the default ``file ...'' feature of the .Ar macro. 2001-02-13 09:56:35 +00:00
Ruslan Ermilov
610a5778c5 mdoc(7) police: split punctuation characters + misc fixes. 2001-02-01 16:44:04 +00:00
Ruslan Ermilov
e97407b4f2 mdoc(7) police: use the new features of the Nm macro. 2000-11-20 20:10:44 +00:00
Peter Wemm
cc8660c75b Initialize vflag like the rest (not necessary, but this keeps it together)
Optimize out chown(2) syscalls if there is no change in uid or gid.
2000-07-29 22:22:11 +00:00
David E. O'Brien
0be12df092 Somehow I didn't get all the "-v" code commited.
Submitted by:	Arindum Mukerji <rmukerji@execpc.com>
Approved by:	JKH

Make the manpage more style(9) complient.
2000-03-08 16:31:42 +00:00
David E. O'Brien
01f1e15e44 Revert rev 1.3. chown(8)-like functionality has been added to mknod(8)
and MAKEDEV(8) will be changed to not use chown(8), thus removing the
depdendance on a having /usr mounted.
2000-01-06 05:30:38 +00:00
David E. O'Brien
9d6b377b08 Install chown' into /sbin rather than /usr/sbin as chown' is needed by
`MAKEDEV'.  And one might need to `MAKEDEV' inorder to get a device node
in order to mount /usr from.
1999-12-14 04:48:17 +00:00
David E. O'Brien
5bb83b98db Add "-v". 1999-11-27 19:25:08 +00:00
Philippe Charnier
70423e21c8 add .Sh DIAGNOSTICS 1999-10-17 15:50:19 +00:00
Philippe Charnier
ee774a4d62 space is not allowed between owner and :group. 1999-10-08 21:38:08 +00:00
Peter Wemm
97d92980a9 $Id$ -> $FreeBSD$ 1999-08-28 01:35:59 +00:00
Nik Clayton
414a35e60a Add $Id$, to make it simpler for members of the translation teams to
track.

The Id line is normally at the bottom of the main comment block in the
man page, separated from the rest of the manpage by an empty comment,
like so;

     .\"    $Id$
     .\"

If the immediately preceding comment is a @(#) format ID marker than the
the $Id$ will line up underneath it with no intervening blank lines.
Otherwise, an additional blank line is inserted.

Approved by:            bde
1999-07-12 20:12:29 +00:00
Bruce Evans
ccee498fca Backed out previous commit. chown(8) doesn't follow symlinks by
default, at least in BSD.  This used to be automatic, because chown(2)
didn't follow symlinks.  When chown(2) was changed to follow symlinks
in BSD4.4, chown(8) was changed to not follow symlinks by default.
The previous commit broke this.  The first victim was bsd.prog.mk,
which uses a plain chown in an attempt to change the ownership of the
symlinks to `dm' in /usr/games.  This fails when it is done before
dm is installed, or messes up the ownership of dm if dm is installed.

Unfixed problems:
1. When lchown(2) was implemented, chown(8) wasn't changed to implement
   the historical behaviour of changing ownership of symlinks.  I'm not
   sure if it should have been.  The -HLP options give more complete
   control, but they unfortunately don't apply unless the -R option is
   specified (a problem shared with other commands, e.g., cp; I guess
   we're supposed to use -R even for non-recursive traversals).
2. If we implement the historical behaviour, then -h would become a no-op
   and should be left undocumented.
3. The man page suggests that without option -h, all symlinks (to files
   specified in the command line?) are followed.  It's not clear what
   "the file" is.  These bugs were introduced when -h was documented.
4. The correct interaction of -h with the other flags is not clear.
1998-05-03 04:17:48 +00:00
Wolfgang Helbig
3dd0615ba4 Don't ignore symbolic links in the absence of -h, -H or -L options.
Instead change the user ID/group ID of the file that the link points to.
1998-05-02 12:57:57 +00:00
Jordan K. Hubbard
6408ef3c4a Allow -R and -h to be combined as long as no symlink-following flags
are also requested.
Submitted by:	Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
1998-03-09 08:54:31 +00:00
Wolfram Schneider
d95fc683ed Chown(8) compiled with -DSUPPORT_DOT (backward compatibility) does
first check for a `.' and then for `:' as a delimiter.
Usernames with a dot will fail.

# chown r.r:bin /tmp/bla
chown: r:bin: illegal group name

Fix: first check for a `:' and then for a `.'
1997-09-21 09:13:57 +00:00
Philippe Charnier
cc09f59a1e Cosmetic in man page. Sync usage() with man page. 1997-09-04 11:55:45 +00:00
Steve Price
573414e0c1 Correct error message when the superuser tries to change
the group of immutable files.

PR:		bin/3445
Submitted by:	Pius Fischer <pius@ienet.com>
1997-08-24 02:10:29 +00:00
Peter Wemm
2e08522b02 Activate the -h flag which tells chown/chgrp to work on the symlink itself
using lchown().  Most of the code was already here, the option was
recognised but ignored for SYSV/POSIX.2(?) compatability.
1997-03-31 13:03:49 +00:00
Warner Losh
6c3f552a31 compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-31 05:11:47 +00:00
Peter Wemm
476602a9d0 Revert $FreeBSD$ to $Id$ 1997-02-22 16:15:28 +00:00
Wolfram Schneider
bfd34a4a60 Sort cross references. 1997-01-20 00:03:00 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Wolfram Schneider
b8923d4cc0 [HISTORY] command appeared in Version 1 AT&T UNIX
Obtained from: A Quarter Century of UNIX, Peter H. Salus, page 41
1996-08-29 18:06:19 +00:00
Adam David
7ba57172c1 chown(8) and chgrp(1) directories once only 1996-08-14 18:13:58 +00:00
Rodney W. Grimes
709e8f9ae1 Remove trailing whitespace. 1995-05-30 03:57:47 +00:00
David Greenman
25738fbcc5 groups[] is of type gid_t. 1994-09-23 10:02:21 +00:00
Garrett Wollman
84e59eb50d Get rid of update. Make man page installation work with our scheme
(and rename a few in the process).
1994-08-05 16:31:05 +00:00
Rodney W. Grimes
dea673e932 BSD 4.4 Lite usr.sbin Sources 1994-05-26 05:23:31 +00:00