History log of /freebsd-10.0-release/bin/chmod/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


221845 13-May-2011 pluknet

Update sticky(7) cross references.

PR: docs/124468
X-MFC with: r218998


196753 02-Sep-2009 trasz

- Don't include both <sys/types.h> and <sys/param.h>

- Keep variables sorted

- Fix logic error with -f and -v options - don't print
the usual -v output if there was an error, whether or not
we were passed -f

- Don't call free(3) just before exit(2)

- Whitespace fixes

Submitted by: bde


196711 31-Aug-2009 trasz

Make the code more readable and fix chmod(1) on symlinks with
NFSv4 enabled.


195243 01-Jul-2009 trasz

With NFSv4 ACLs, it is possible that applying a mode to an ACL which
is identical to the mode computed from that ACL will modify the ACL.
For example, mode computed from the following ACL is 0600:

user:kamila:rwx--------C--:------:allow
owner@:--x-----------:------:deny
owner@:rw-p---A-W-Co-:------:allow
group@:rwxp----------:------:deny
group@:--------------:------:allow
everyone@:rwxp---A-W-Co-:------:deny
everyone@:------a-R-c--s:------:allow

However, applying that mode (chmod 0600) changes the ACL into this:

user:kamila:rwx-----------:------:deny
user:kamila:rwx--------C--:------:allow
owner@:--x-----------:------:deny
owner@:rw-p---A-W-Co-:------:allow
group@:rwxp----------:------:deny
group@:--------------:------:allow
everyone@:rwxp---A-W-Co-:------:deny
everyone@:------a-R-c--s:------:allow

In chmod(1) utility, there is an optimisation, which makes it not
call chmod(2) if the mode of the file is the same as the new mode.
Disable that optimisation for files which may have NFSv4 ACLs.

Reviewed by: rwatson
Approved by: re (kib)


194795 23-Jun-2009 delphij

Staticify internal routines.


187734 26-Jan-2009 trhodes

Make the Monty Python quote more google friendly instead of
hacking it apart.

Discussed with: Christoph Mallon <christoph.mallon@gmx.de>


187627 23-Jan-2009 trhodes

Note the implication of setting the 'w' permission on directories,
while here, expand the 'naughty bits' comment in BUGS.

PR: 84265 and 84268
Reviewed by: keramida
Obtained from: hints from ceri, keramida


165463 22-Dec-2006 ru

- Mention umask(2) when first referring to it.
- Add missing markup.

Submitted by: Eugene Grosbein <eugen@grosbein.pp.ru>


141851 13-Feb-2005 ru

Expand contractions.


140353 16-Jan-2005 ru

Add the new standard EXIT STATUS section where appropriate.
Sort standard sections in the (documented) preferred order.


139969 10-Jan-2005 imp

/*- or .\"- or #- to begin license clauses.


127958 06-Apr-2004 markm

Remove clause 3 from the UCB licenses.

OK'ed by: imp, core


123565 16-Dec-2003 ru

Print unambiguous paths with -R -v.


121794 31-Oct-2003 tobez

Remove the code for parsing octal modes, since setmode(3) already
handles them.

Reviewed by: audit
MFC after: 2 weeks


114433 01-May-2003 obrien

Quiet warnings about copyright[].


110057 29-Jan-2003 mux

Remove now unnecessary main() prototype.


107230 25-Nov-2002 ru

mdoc(7) police: In DESCRIPTION, list the options in pure alphabetical
order, as required by style(9). Document the effect of the -f option
on exit status. Fixed some spacing.

Submitted by: bde
Approved by: re


106399 04-Nov-2002 tjr

Cross-reference setfacl(1).


104318 01-Oct-2002 trhodes

Return the ``u''


104119 28-Sep-2002 trhodes

s/behaviour/behavior/ in the chmod(1) manual


101569 09-Aug-2002 ru

mdoc(7) police: kill hard sentence breaks and one double space.


101297 04-Aug-2002 obrien

Allow "-v -v" to mean very verbose.

Reviewed by: freebsd-standards
PR: 40709
Submitted by: Edward Brocklesby <nighthawk@unrealircd.com>, johan


100069 15-Jul-2002 sheldonh

Revert previous delta, which is not required with rev 1.5 of
src/contrib/gcc/c-format.c .


99847 12-Jul-2002 keramida

Don't duplicate the description of the sticky bit that is already
part of chmod(2) and sticky(8), but refer to those manpages instead.

PR: docs/35605
Submitted by: Gary W. Swearingen <swear@blarg.net>


99767 11-Jul-2002 sheldonh

Set WFORMAT=0, because our compiler currently complains about NULL
arg 2 to err() and friends, and warnings are promoted to errors.

This allows the following revisions to be reverted:

rev 1.39 src/bin/cp/cp.c
rev 1.26 src/bin/chmod/chmod.c
rev 1.40 src/bin/rm/rm.c

The following revisions can already be reverted, because they were
already covered by WFORMAT=0:

rev 1.8 src/bin/ls/lomac.c
rev 1.63 src/bin/ls/ls.c
rev 1.8 src/bin/ps/lomac.c
rev 1.34 src/bin/rcp/rcp.c


99743 10-Jul-2002 dillon

err() is documented as allowing NULL for the format string but GCC isn't
happy about it any more so change the useage so buildworld works again.


99109 30-Jun-2002 obrien

Consistently use __FBSDID


91078 22-Feb-2002 markm

Fix warnings inspired by lint, a commercial lint and WARNS=4


90107 02-Feb-2002 imp

Modernization effort for bin/c*:

o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
they already are.

Approved by: arch@, new style(9)


90059 01-Feb-2002 sheldonh

Refer to the original mode of the file, not the mode of the original
file.

PR: docs/34224
Submitted by: "Gary W. Swearingen" <swear@blarg.net>


87323 04-Dec-2001 obrien

Default to WARNS=2. Binary builds that cannot handle this must explicitly
set WARNS=0.

Reviewed by: mike


81687 15-Aug-2001 ru

mdoc(7) police: utilize the new .Ex macro.


79754 15-Jul-2001 dd

Remove whitespace at EOL.


78624 22-Jun-2001 dd

WARNS= -> WARNS?=

Submitted by: Mike Barcroft <mike@q9media.com>


77522 31-May-2001 ru

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).


77342 28-May-2001 ru

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)


77333 28-May-2001 ru

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


77160 25-May-2001 ru

Make it clear that -P is the default.

PR: docs/27629


76871 20-May-2001 kris

Make this compile with WARNS=2


73281 01-Mar-2001 ben

The 'X' permission symbol is specified by POSIX.2, so don't say that it
isn't.

Obtained from: NetBSD
Confirmed by: ru, wollman


72432 13-Feb-2001 ru

mdoc(7) police: use the default ``file ...'' feature of the .Ar macro.


71097 16-Jan-2001 ru

Prepare for mdoc(7)NG.


68935 20-Nov-2000 ru

mdoc(7) police: use the new features of the Nm macro.


68716 14-Nov-2000 ru

Use Fx macro wherever possible.


68575 10-Nov-2000 ru

Avoid use of direct troff requests in mdoc(7) manual pages.


64013 29-Jul-2000 peter

Optimize out no-op chmod() syscalls.


62887 10-Jul-2000 kris

Don't call warn() with no format string. This is potentially exploitable, although it
would be difficult both technically and in practise.


57274 17-Feb-2000 unfurl

From the PR:

Three minor changes to the manpage of chmod(1).

1. At the description of -H option, I added that symlinks are
not followed _by default_ to show that links can be followed,
but the default chmod behavior is not to do so.

2. Moved a misplaced .Va file command up to the place it belongs.

3. Simplified the grammar that describes symbolic modes.

PR: 16749
Submitted by: Giorgos Keramidas <keramida@ceid.upatras.gr>


53824 28-Nov-1999 obrien

Default to not -v.
Fix usage() style bug spotted by BDE.


53780 27-Nov-1999 obrien

Add "-v".


50471 27-Aug-1999 peter

$Id$ -> $FreeBSD$


50341 25-Aug-1999 chris

Sort cross-references. Move mount(8) down the list where it belongs, in
particular.


49721 14-Aug-1999 chris

Bad reference of mount(1) changed to mount(8).


49544 08-Aug-1999 chris

Document -f flag:

-f Do not display a diagnostic message if chmod could not modify the
mode for file.


46684 08-May-1999 kris

Various spelling/formatting changes.

Submitted by: Philippe Charnier <charnier@xp11.frmug.org>


41842 16-Dec-1998 imp

Free memory obtained from setmode.

Obtained from: OpenBSD


36175 19-May-1998 jkoshy

Improve description of absolute modes.

Submitted by: Josh Gilliam <josh@quick.net>
PR: 6634


36002 13-May-1998 charnier

Restore original Lite-2 sccsid. Restore include of sys/types.h.


35773 06-May-1998 charnier

Correct use of .Nm and other cosmetics. Add rcsid. Remove unused #inc.


31144 13-Nov-1997 julian

Reviewed by: hackers@freebsd.org in general
Obtained from: Whistle Communications tree

Add an option to the way UFS works dependent on the SUID bit of directories
This changes makes things a whole lot simpler on systems running as
fileservers for PCs and MACS. to enable the new code you must
1/ enable option SUIDDIR on the kernel.
2/ mount the filesystem with option suiddir.
hopefully this makes it difficult enough for people to
do this accidentally.
see the new chmod(2) man page for detailed info.


24348 28-Mar-1997 imp

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


22988 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


21673 14-Jan-1997 jkh

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.


20411 14-Dec-1996 steve

Cleanup man page and -Wall cleaning.


17891 29-Aug-1996 wosch

[HISTORY] command appeared in Version 1 AT&T UNIX
Obtained from: A Quarter Century of UNIX, Peter H. Salus, page 41


17496 10-Aug-1996 adam

chmod(2) directories once only (was twice)


14105 16-Feb-1996 joerg

Add an .Xr for chflags(1) into the SEE ALSO sectoin.

Submitted by: jhs


7165 19-Mar-1995 joerg

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)


6170 03-Feb-1995 bde

Include <limits.h> to get the definition of INT_MAX - don't depend on
namespace pollution in <time.h>.


3044 24-Sep-1994 dg

Added $Id$


1557 26-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1556,
which included commits to RCS files with non-trunk default branches.