Summary: | [patch] New option -r for chown(8) and chgrp(1) | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Oliver Fromme <olli> | ||||||
Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> | ||||||
Status: | Open --- | ||||||||
Severity: | Affects Only Me | CC: | olli | ||||||
Priority: | Normal | Keywords: | patch | ||||||
Version: | Unspecified | ||||||||
Hardware: | Any | ||||||||
OS: | Any | ||||||||
Attachments: |
|
Description
Oliver Fromme
2002-11-16 11:00:04 UTC
Small addendum: Thanks to David Wolfskill who tested the patch under -current, two minor problems have been found (only style / cosmetic, and only in the patch set for -current): - In line 151 of the patched chown.c, there are spaces instead of tabs, leading to a mis-aligned "if". Should be converted to tabs. - In line 305 of the same file, the second usage line for chgrp repeats the word "usage:". Should be replaced by spaces. Thanks again, David! Regards Oliver On Sat, Nov 16, 2002 at 11:56:37AM +0100, Oliver Fromme wrote: > > >Number: 45333 > >Category: bin > >Synopsis: [PATCH] New option -r for chown and chgrp > >Originator: Oliver Fromme > >Release: FreeBSD -stable and -current > >Organization: > secnetix GmbH & Co KG, Munich, http://www.secnetix.de/ > >Environment: > > The patch presented applies both to -stable and -current > as of the date of submission (2002-11-16). > > >Description: > > The existing utilities touch(1) and truncate(1) support > an -r option to specify a reference file from which > information is to be taken (the time stamp in the case > of touch(1) and the file size in the case of truncate(1)). > > However, the utilities chown and chgrp (actually hardlinks > to the same binary) do not support such an option yet. > In shell scripts it is sometimes useful to copy ownership > and/or group membership from another file. Ordinarily, > you would have to use ls -l and parse the owner/group > columns, which is awkward, error-prone and inefficient. For the record, a cleaner way to do this would be to use the stat(1) utility, which is only available in -current for the present. [roam@ref5 ~]$ stat -f '%Su:%Sg' /etc/passwd root:wheel [roam@ref5 ~]$ Thus, something like "chown `stat -f '%Su:%Sg' $reffile` $file" would probably do what you need. Of course, a command-line option might be a bit easier to use :) G'luck, Peter -- Peter Pentchev roam@ringlet.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 This sentence contains exactly threee erors. Don't think these sets of patches should be considered as using -r would break compatibility with -R use in GNU-land =\... Besides, Peter came up with a decent workaround [use stat(1)], which has been in -STABLE for quite some time. -Garrett For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped Keyword: patch or patch-ready – in lieu of summary line prefix: [patch] * bulk change for the keyword * summary lines may be edited manually (not in bulk). Keyword descriptions and search interface: <https://bugs.freebsd.org/bugzilla/describekeywords.cgi> |