summaryrefslogtreecommitdiffstats
path: root/bin/chmod/chmod.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Use uid_from_user(3) and gid_from_group(3) in utilities thatmillert2018-09-161-7/+5
| | | | do repeated lookups. OK tb@
* chown: Remove SUPPORT_DOT ifdef - it's on by default for 22 yearsawolk2017-05-281-4/+6
| | | | | | | | | | The old syntax was deprecated 25 years ago when the utility was first standardised in IEEE Std 1003.2-1992 ("POSIX.2"). There was no POSIX version of chown with the dot separator. Let's stop pretending that it will ever go away. OK jung@, deraadt@, jmc@
* In chmod's symbolic mode without -h and -R flags, a missing FTS_COMFOLLOWtb2017-02-171-2/+4
| | | | | | | | | flag to fts_open led to the following behavior: the symlink's permissions were read, changed according to the command line, and transferred to the target file. chflags had a similar problem while chmod was unaffected. Regression introduced in r1.33. Reported by Christopher Wellons, thanks! ok guenther
* Delete useless setlocale(3) in src/bin/.schwarze2016-10-191-7/+4
| | | | | | Minor cleanup while here: return from main, static void __dead usage, etc. Based on a patch from Jan Stary <hans at stare dot cz>. Feedback and OK tb@, OK millert@.
* Document the -h option for chmod and chflags, rewording the chgrp(1) andguenther2015-12-311-9/+5
| | | | chown(8) manpages to be consistent and clearer about it as well.
* Change all tame callers to namechange to pledge(2).deraadt2015-10-091-3/+3
|
* oops! cannot tame the chmod case, because the kernel drops thederaadt2015-10-031-4/+1
| | | | setuid/setgid bits.
* the chmod & chflags codepaths can use tame "stdio rpath fattr". thederaadt2015-10-031-1/+7
| | | | | | chown codepath obviously cannot use tame -- once tame is activated the kernel prohibits changing uid/gid on a fd/file. ok guenther
* KNFderaadt2015-10-031-3/+2
|
* Put fts_close() where missing.uebayasi2015-06-251-1/+2
| | | | | | | | | | Not bugs in short-lived commands that call exit() -> _exit() immediately, but for idempotency. Originally found in ls(1) by Valgrind. Changes for other commands are from deraadt@. Reviewed by me, tested in snapshots. OK deraadt@
* Correct the handling of symbolic links by chmod/chgrp/chown/chflags,guenther2014-12-131-34/+43
| | | | | | making them more resistant to TOCTOU race conditions too. ok tobias@
* Properly validate ranges:tobias2014-12-131-8/+10
| | | | | | | - avoid out of boundary access on very short program names - fix compiler warning when converting values between 0 and INT_MAX ok deraadt, millert
* In case of invalid syntax like "chmod -Pr -w tf" (trailing mode letterschwarze2014-10-061-9/+13
| | | | | | | | in a group of option letters), do not silently ignore the syntax error and do something undefined, but instead error out properly. Found because miod@ said "read the code" (not to me, though). ok doug@
* Use errc/warnc to simplify code.guenther2014-05-211-3/+3
| | | | ok jca@ krw@
* lint is dead (long live the lint!), so stop using it as a cpp conditionalguenther2014-03-161-5/+1
| | | | | | (namespace pollution!) or talking about its opinion on code. ok krw@
* remove some unnecessary sys/param.h inclusionsderaadt2012-12-041-2/+2
|
* zap from usage() as well; reminded by jmc@okan2011-03-091-3/+3
|
* sync comment with reality, -f won't be documented.jasper2010-01-121-2/+2
| | | | | as discussed with jmc@, otto@ and millert@ ok otto@ millert@
* rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt2009-10-271-15/+1
| | | | | | | unmaintainable). these days, people use source. these id's do not provide any benefit, and do hurt the small install media (the 33,000 line diff is essentially mechanical) ok with the idea millert, ok dms
* fix the synopsis for chown(8)sobrado2009-01-211-3/+7
|
* various small lint cleanups; ok ottoderaadt2006-04-251-5/+7
|
* some warning reductiontedu2006-01-251-15/+16
|
* an old diff from tech to convert to using strtonum and some other misctedu2006-01-251-36/+45
| | | | cleanup. from ray at cyth net
* kill unused var found by lint. ok deraadt@otto2005-11-291-7/+6
|
* sync usage();jmc2005-10-151-3/+3
|
* setmode(3) returns void *, not mode_t *. ok millert@otto2004-07-011-3/+3
|
* If the user does "chown foo.bar" check to see if foo.bar is a usernamemillert2004-02-161-8/+16
| | | | before picking it apart into a username.group pair. OK deraadt@
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-7/+3
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* Undo a misguided attempt to fix speling errors from long ago. UCBmillert2003-06-011-3/+3
| | | | | copyrights say "acknowledgement", not "acknowledgment". You cannot just go changing the text of a license willy-nilly.
* ansideraadt2002-07-041-11/+8
|
* Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.millert2002-02-161-5/+5
|
* make -h option work again, it was left out on the getopt stringericj2000-07-311-3/+3
|
* merge chflags(1) into chmod.mickey2000-07-191-11/+44
| | | | | also, use new strtofflags, avoid ls/stat_flags.c usage. millert@ ok
* warnx?/errx? paranoia (use "%s" not a bare string unless it is amillert2000-06-301-3/+3
| | | | | | | | | constant). These are not security holes but it is worth fixing them anyway both for robustness and so folks looking for examples in the tree are not misled into doing something potentially dangerous. Furthermore, it is a bad idea to assume that pathnames will not include '%' in them and that error routines don't return strings with '%' in them (especially in light of the possibility of locales).
* oopsmickey2000-06-091-3/+3
|
* merge chown/chgrp into chmod.mickey2000-06-091-28/+123
| | | | provide symlinks from old location for the time being.
* spellingtodd1997-11-081-3/+3
|
* somebody added setlocale() w/o locale.hgrr1997-06-281-2/+3
|
* setlocale; kleinkderaadt1997-06-271-2/+5
|
* -Wall'ing.mickey1996-12-141-3/+6
|
* zap getopt() case of -?, come on, it is the default!deraadt1996-08-021-3/+2
|
* update rcsidderaadt1996-06-231-1/+2
|
* initial import of NetBSD treederaadt1995-10-181-0/+209