1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-07-29 11:59:36 +02:00
Commit Graph

18662 Commits

Author SHA1 Message Date
Jim Meyering ae2fbd3ee7 *** empty log message *** 2004-06-12 08:07:41 +00:00
Jim Meyering 33c1c51c49 (extract_trimmed_name): Don't apply strchr to a
non-string; this leads to undefined behavior.
2004-06-12 08:07:30 +00:00
Jim Meyering b5e189c8ef *** empty log message *** 2004-06-12 08:06:12 +00:00
Jim Meyering 69cf3d4811 (list_entries_who): Don't output a trailing space. 2004-06-12 08:05:59 +00:00
Jim Meyering 7b4fe61887 *** empty log message *** 2004-06-09 15:13:33 +00:00
Jim Meyering 315eae50a5 (AC_FUNC_CALLOC): Remove use of AN_FUNCTION. 2004-06-09 15:13:27 +00:00
Jim Meyering 24c8603356 *** empty log message *** 2004-06-09 14:47:36 +00:00
Jim Meyering d25e88d25a (usage): Improve wording in description of the --time=WORD option. 2004-06-09 14:47:29 +00:00
Jim Meyering 0774a224fe Adjust to accommodate Paul Eggert's changes of 2004-06-08. 2004-06-09 14:45:38 +00:00
Jim Meyering fc61fc852f *** empty log message *** 2004-06-09 13:54:21 +00:00
Jim Meyering d46131360a (change_file_owner): Change names of parameters
old_uid and old_gid to required_uid and required_gid respectively.
2004-06-09 13:54:11 +00:00
Jim Meyering ce487455bd *** empty log message *** 2004-06-09 13:37:58 +00:00
Jim Meyering e4ccef8ddc Adjust chmod and chown to be similar if -c or -v are given. In
particular, a no-op chown is no longer reported as a change; this
reverts to previous behavior.  Also, fix both commands so that -v
report failures even if the failure is not due to the chmod or
chown syscalls.

* src/chown-core.c (change_file_owner): Return -1 on error, not
1 sometimes and -1 on others.  Our caller ORs together our results,
and (-1 | 1) == 0 on ones-complement hosts.
With -v report all errors verbosely, not just some.
Fix bug when chopt->root_dev_ino && !chopt->affect_symlink_referent:
file_stats wasn't set properly in that case.
2004-06-09 13:37:52 +00:00
Jim Meyering 7c6999b6f8 (mode_changed): Return false, not 0, now that the function returns `bool'. 2004-06-09 09:06:34 +00:00
Jim Meyering bc580f6a56 Adjust chmod and chown to be similar if -c or -v are given. In
particular, a no-op chown is no longer reported as a change; this
reverts to previous behavior.  Also, fix both commands so that -v
report failures even if the failure is not due to the chmod or
chown syscalls.

* src/chmod.c (CH_NOT_APPLIED): New constant.
(describe_change): Handle it.
(process_file): Use it, if a symlink wasn't changed.
(mode_changed): Return bool, not int.  Accept new argument
NEW_MODE; all callers changed.  This lets us avoid statting the
file unless the new mode has unusual bits.
(process_file): Return -1 on error.  With -v, report all errors
verbosely, not just some.
2004-06-09 09:05:02 +00:00
Jim Meyering 91476b4612 . 2004-06-08 17:07:19 +00:00
Jim Meyering 095b41255b *** empty log message *** 2004-06-08 16:58:37 +00:00
Jim Meyering e76b4fe2e3 *** empty log message *** 2004-06-08 16:58:32 +00:00
Jim Meyering 57a06c9366 Test that chgrp -h does not fail on
symlinks, even on hosts where that's not supported.
Test that if -R is specified without -H or L, -h is assumed.
Test that chown() is not optimized away.
2004-06-08 16:58:28 +00:00
Jim Meyering 4925135810 s/FTS_STAT/FTS_NOSTAT/ 2004-06-08 16:32:14 +00:00
Jim Meyering 5fe68c2d94 Adjust error-diagnostic spelling to match new behavior. 2004-06-08 15:26:45 +00:00
Jim Meyering f41716a4ef Do not attempt to combine -h and -H; these
options are incompatible, and their behavior is undefined with POSIX.
(changed, not_changed): Adjust to match the fact that -h is no longer
specified.  Sort names.
2004-06-08 15:25:59 +00:00
Jim Meyering 8dbd36d925 Use chown --from to discover whether the
group changed, since chgrp now changes unconditionally.  This
complicates the sed script a bit.  Do not specify --dereference,
since it's the default (and we want to test this).  Adjust output
to match the fact that chgrp no longer optimizes the case of
changing a file's group to the same value as before.
2004-06-08 15:25:45 +00:00
Jim Meyering b50934d2a9 . 2004-06-08 14:58:57 +00:00
Jim Meyering 17ca1ef014 . 2004-06-08 14:58:21 +00:00
Jim Meyering 7e29ef8b88 (change_file_owner): Use ent->fts_statp only if
needed.  Chown a directory only after chowning its children; this
avoids problems if the new directory ownership doesn't permit
access to the children.  Dereference symlinks before doing
ROOT_DEV_INO_CHECK, not after, so that we catch symlinks to /.
Do not optimize away the chown() system call when the file's owner
and group already have the desired value.  POSIX does not permit
this optimization.  Rely on chown and lchown to do the right
thing with symlinks and/or -1 arguments, now that we have wrappers
to do this.  Use ENOTSUPP not ENOSYS, and ignore all ENOTSUPP
errors, not just command-line errors.
(chown_files): Pass FTS_STAT to xfts_open if we don't need file status.
2004-06-08 14:57:57 +00:00
Jim Meyering 5e1dd2ecb5 (main): Check for incompatible options. -R --dereference
requires either -H or -L, and -R -h requires -P.  If -H, specify
FTS_PHYSICAL as well as FTS_COMFOLLOW; this is faster.  Make this
file as much like chown.c as possible.
2004-06-08 13:40:00 +00:00
Jim Meyering 5d13dbcb1e (main): Check for incompatible options. -R --dereference
requires either -H or -L, and -R -h requires -P.  If -H, specify
FTS_PHYSICAL as well as FTS_COMFOLLOW; this is faster.  Make this
file as much like chgrp.c as possible.
2004-06-08 13:37:40 +00:00
Jim Meyering d5c9458702 *** empty log message *** 2004-06-08 13:31:49 +00:00
Jim Meyering 12357df452 (fts_stat, fts_alloc): Always allocate and use a struct
stat, even if the user isn't interested in the results.
This prevents a core dump in cycle_check when FTS_NOSTAT is set.
2004-06-08 13:31:43 +00:00
Jim Meyering 2eba29a312 (ENOTSUP): Remove. 2004-06-08 13:24:09 +00:00
Jim Meyering 05638ca424 fix typo 2004-06-08 13:23:42 +00:00
Jim Meyering b66ead2e0c *** empty log message *** 2004-06-08 13:23:17 +00:00
Jim Meyering eb4aaec1a5 (EOPNOTSUPP): Define if not defined.
(ENOSYS): Remove.
2004-06-08 12:02:00 +00:00
Jim Meyering 0746994e48 (lchown): Return EOPNOTSUPP if not supported; this
is what POSIX-2004 specifies.
2004-06-08 12:01:38 +00:00
Jim Meyering 54ac424e7d *** empty log message *** 2004-06-08 07:13:18 +00:00
Jim Meyering 24df65c287 (main): Fix typo introduced on 2003-05-10 that
prevented a diagnostic of any operands.
2004-06-08 07:13:10 +00:00
Jim Meyering 069bf2f43c *** empty log message *** 2004-06-08 06:56:08 +00:00
Jim Meyering 58a9bc79b5 . 2004-06-08 06:54:04 +00:00
Jim Meyering 62d6b980b2 (direct_mode): Turn it on/off with directio, too. 2004-06-08 06:47:43 +00:00
Jim Meyering 8cb9d48559 *** empty log message *** 2004-06-07 15:27:47 +00:00
Jim Meyering 16155336a0 Enable direct-mode I/O (bypassing the buffer cache), if possible.
Prompted by a suggestion from Kalle Olavi Niemitalo
in http://bugs.debian.org/207035.

(direct_mode): New function.
(do_wipefd): Turn on direct-mode I/O.
(dopass): If a file's first write fails with EINVAL,
turn off direct-mode I/O and retry the write.
2004-06-07 15:27:42 +00:00
Jim Meyering 8f3e7ea813 *** empty log message *** 2004-06-07 15:26:52 +00:00
Jim Meyering c410e41685 (gl_MACROS): Check for the directio function. 2004-06-07 15:26:49 +00:00
Jim Meyering 0ce5f6610f *** empty log message *** 2004-06-07 08:21:10 +00:00
Jim Meyering 34b2d4920f Remove menu references to just-removed subsection. 2004-06-07 08:21:07 +00:00
Jim Meyering d14676e7fc *** empty log message *** 2004-06-06 19:31:46 +00:00
Jim Meyering 032b5b3bcf (tr invocation): Remove the section describing
how POSIXLY_CORRECT changes tr's behavior.
2004-06-06 19:31:43 +00:00
Jim Meyering 9011b52917 fix typo in comment 2004-06-06 19:18:49 +00:00
Jim Meyering 62d61c7c12 *** empty log message *** 2004-06-06 19:03:05 +00:00