summaryrefslogtreecommitdiffstats
path: root/bin/chmod/chmod.c
Commit message (Collapse)AuthorAgeFilesLines
* - Don't include both <sys/types.h> and <sys/param.h>trasz2009-09-021-9/+6
| | | | | | | | | | | | | | - 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
* Make the code more readable and fix chmod(1) on symlinks withtrasz2009-08-311-13/+15
| | | | NFSv4 enabled.
* With NFSv4 ACLs, it is possible that applying a mode to an ACL whichtrasz2009-07-011-2/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* Staticify internal routines.delphij2009-06-231-2/+2
|
* /*- or .\"- or #- to begin license clauses.imp2005-01-101-1/+1
|
* Remove clause 3 from the UCB licenses.markm2004-04-061-4/+0
| | | | OK'ed by: imp, core
* Print unambiguous paths with -R -v.ru2003-12-161-1/+1
|
* Remove the code for parsing octal modes, since setmode(3) alreadytobez2003-10-311-22/+5
| | | | | | | handles them. Reviewed by: audit MFC after: 2 weeks
* Quiet warnings about copyright[].obrien2003-05-011-2/+2
|
* Remove now unnecessary main() prototype.mux2003-01-291-1/+0
|
* Allow "-v -v" to mean very verbose.obrien2002-08-041-3/+19
| | | | | | Reviewed by: freebsd-standards PR: 40709 Submitted by: Edward Brocklesby <nighthawk@unrealircd.com>, johan
* err() is documented as allowing NULL for the format string but GCC isn'tdillon2002-07-101-1/+1
| | | | happy about it any more so change the useage so buildworld works again.
* Consistently use __FBSDIDobrien2002-06-301-2/+2
|
* Fix warnings inspired by lint, a commercial lint and WARNS=4markm2002-02-221-9/+8
|
* Modernization effort for bin/c*:imp2002-02-021-7/+5
| | | | | | | | | | | | 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)
* Fixed the bug from the previous revision.ru2001-05-311-1/+1
| | | | | | | | | | | | | | | ``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).
* Change noop option -h to do the real work. Now mode of symbolic linkru2001-05-281-7/+17
| | | | | | | is changed if -h option is given. Requested by: bde Obtained from: NetBSD (code part)
* Follow symbolic links named as command line arguments if run without -R.ru2001-05-281-2/+3
| | | | | | | | | | | | | | 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
* Make this compile with WARNS=2kris2001-05-201-0/+1
|
* Optimize out no-op chmod() syscalls.peter2000-07-291-2/+5
|
* Don't call warn() with no format string. This is potentially exploitable, ↵kris2000-07-101-1/+1
| | | | | | although it would be difficult both technically and in practise.
* Default to not -v.obrien1999-11-281-2/+2
| | | | Fix usage() style bug spotted by BDE.
* Add "-v".obrien1999-11-271-2/+9
|
* $Id$ -> $FreeBSD$peter1999-08-271-1/+1
|
* Document -f flag:chris1999-08-081-3/+3
| | | | | -f Do not display a diagnostic message if chmod could not modify the mode for file.
* Free memory obtained from setmode.imp1998-12-161-1/+2
| | | | Obtained from: OpenBSD
* Restore original Lite-2 sccsid. Restore include of sys/types.h.charnier1998-05-131-2/+3
|
* Correct use of .Nm and other cosmetics. Add rcsid. Remove unused #inc.charnier1998-05-061-3/+4
|
* compare return value from getopt against -1 rather than EOF, per the finalimp1997-03-281-2/+2
| | | | posix standard on the topic.
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | 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.
* Cleanup man page and -Wall cleaning.steve1996-12-141-3/+3
|
* chmod(2) directories once only (was twice)adam1996-08-101-6/+5
|
* You will find enclosed some changes to make gcc -Wall more happy injoerg1995-03-191-1/+3
| | | | | | | | | /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)
* Include <limits.h> to get the definition of INT_MAX - don't depend onbde1995-02-031-1/+2
| | | | namespace pollution in <time.h>.
* Added $Id$dg1994-09-241-0/+2
|
* BSD 4.4 Lite bin Sourcesrgrimes1994-05-261-0/+201
OpenPOWER on IntegriCloud