summaryrefslogtreecommitdiffstats
path: root/usr.sbin/chown/chown.c
Commit message (Collapse)AuthorAgeFilesLines
* Use basename(3).obrien2002-12-301-3/+2
|
* Fix a spelling mistake.dwmalone2002-07-171-1/+1
| | | | | | PR: 40695 Submitted by: Maxim Maximov <mcsi@agava.com> MFC after: 1 week
* Kill __P(), use ANSI C function declarations, remove local prototype for main,jmallett2002-06-301-21/+14
| | | | and add a __FBSDID() while I'm here.
* In the SUPPORT_DOT case, warn that seperation with a period is deprecated.jmallett2002-06-271-0/+1
| | | | | | | | | | | 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
* Don't exit immediately if an error occurs, continue but exit non-zero.tjr2002-06-021-5/+9
|
* Add prototypes for main() so that these programs compile with -Werrorluigi2001-12-141-0/+1
| | | | | | | | | | | | (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.
* Clean up, WARNSify, unbreak -v option handling.ru2001-09-131-52/+51
|
* 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).
* 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
* Initialize vflag like the rest (not necessary, but this keeps it together)peter2000-07-291-1/+4
| | | | Optimize out chown(2) syscalls if there is no change in uid or gid.
* Somehow I didn't get all the "-v" code commited.obrien2000-03-081-1/+4
| | | | | | | Submitted by: Arindum Mukerji <rmukerji@execpc.com> Approved by: JKH Make the manpage more style(9) complient.
* Add "-v".obrien1999-11-271-4/+10
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Backed out previous commit. chown(8) doesn't follow symlinks bybde1998-05-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Don't ignore symbolic links in the absence of -h, -H or -L options.helbig1998-05-021-2/+1
| | | | Instead change the user ID/group ID of the file that the link points to.
* Allow -R and -h to be combined as long as no symlink-following flagsjkh1998-03-091-2/+2
| | | | | are also requested. Submitted by: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
* Chown(8) compiled with -DSUPPORT_DOT (backward compatibility) doeswosch1997-09-211-6/+6
| | | | | | | | | | 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 `.'
* Cosmetic in man page. Sync usage() with man page.charnier1997-09-041-6/+6
|
* Correct error message when the superuser tries to changesteve1997-08-241-13/+11
| | | | | | | the group of immutable files. PR: bin/3445 Submitted by: Pius Fischer <pius@ienet.com>
* Activate the -h flag which tells chown/chgrp to work on the symlink itselfpeter1997-03-311-13/+16
| | | | | using lchown(). Most of the code was already here, the option was recognised but ignored for SYSV/POSIX.2(?) compatability.
* compare return value from getopt against -1 rather than EOF, per the finalimp1997-03-311-1/+1
| | | | posix standard on the topic.
* chown(8) and chgrp(1) directories once onlyadam1996-08-141-5/+4
|
* Remove trailing whitespace.rgrimes1995-05-301-5/+5
|
* groups[] is of type gid_t.dg1994-09-231-1/+1
|
* BSD 4.4 Lite usr.sbin Sourcesrgrimes1994-05-261-0/+273
OpenPOWER on IntegriCloud