Commit Graph

22 Commits

Author SHA1 Message Date
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
abb1dad139 Change noop option -h to do the real work. Now mode of symbolic link
is changed if -h option is given.

Requested by:	bde
Obtained from:	NetBSD (code part)
2001-05-28 15:31:11 +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
Kris Kennaway
925d09e9ab Make this compile with WARNS=2 2001-05-20 03:24:24 +00:00
Peter Wemm
1510e9e7c6 Optimize out no-op chmod() syscalls. 2000-07-29 22:16:55 +00:00
Kris Kennaway
daad7b8c8e Don't call warn() with no format string. This is potentially exploitable, although it
would be difficult both technically and in practise.
2000-07-10 08:31:35 +00:00
David E. O'Brien
a082153a1f Default to not -v.
Fix usage() style bug spotted by BDE.
1999-11-28 12:24:16 +00:00
David E. O'Brien
5bb83b98db Add "-v". 1999-11-27 19:25:08 +00:00
Peter Wemm
2a4562393f $Id$ -> $FreeBSD$ 1999-08-27 23:15:48 +00:00
Chris Costello
7007d55cc0 Document -f flag:
-f      Do not display a diagnostic message if chmod could not modify the
             mode for file.
1999-08-08 21:08:05 +00:00
Warner Losh
a4324714a9 Free memory obtained from setmode.
Obtained from: OpenBSD
1998-12-16 04:42:33 +00:00
Philippe Charnier
d4e2eddf9d Restore original Lite-2 sccsid. Restore include of sys/types.h. 1998-05-13 07:22:11 +00:00
Philippe Charnier
cbf6f7d358 Correct use of .Nm and other cosmetics. Add rcsid. Remove unused #inc. 1998-05-06 06:51:42 +00:00
Warner Losh
93ef08af3e compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-28 15:24:41 +00:00
Peter Wemm
b97fa2ef50 Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +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
Steve Price
1686b60268 Cleanup man page and -Wall cleaning. 1996-12-14 05:51:20 +00:00
Adam David
f3ad46f409 chmod(2) directories once only (was twice) 1996-08-10 15:05:26 +00:00
Joerg Wunsch
0fd510b71a You will find enclosed some changes to make gcc -Wall more happy in
/usr/src/bin. Note that some patches are still needed in that directory.

I (Joerg) finished most of Philippe's cleanup.  /bin/sh will still
need *allot* of work, however.

Submitted by:	charnier@lirmm.fr (Philippe Charnier)
1995-03-19 13:29:28 +00:00
Bruce Evans
50c1f8972c Include <limits.h> to get the definition of INT_MAX - don't depend on
namespace pollution in <time.h>.
1995-02-03 22:21:09 +00:00
David Greenman
89730b290a Added $Id$ 1994-09-24 02:59:15 +00:00
Rodney W. Grimes
4b88c807ea BSD 4.4 Lite bin Sources 1994-05-26 06:18:55 +00:00