1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-06-08 02:36:40 +02:00
Commit Graph

18675 Commits

Author SHA1 Message Date
Jim Meyering 5afcf8697f (print_esc): Support \x, \u, \U even if POSIXLY_CORRECT,
since POSIX says the behavior is unspecified here.
(main): Recognize --help, --version even if
POSIXLY_CORRECT.  POSIX does not specify any options, but it
does not prohibit options either, so "printf" is like "expr" here.
2004-06-15 18:00:35 +00:00
Jim Meyering db2fa4fdcd Include "hard-locale.h".
(main): When in a non-POSIX locale, ignore POSIXLY_CORRECT, since
POSIX specifies the behavior only in the POSIX locale.
2004-06-15 18:00:20 +00:00
Jim Meyering 1391da81e0 (decode_switches): Pay attention to TABSIZE even if POSIXLY_CORRECT
is set.  POSIX reserves upper-case environment variables to the
implementation, so it's OK for ls to depend on TABSIZE.
2004-06-15 18:00:03 +00:00
Jim Meyering 5034e6bdb2 *** empty log message *** 2004-06-14 18:12:44 +00:00
Jim Meyering 78fcbf003a . 2004-06-14 17:21:55 +00:00
Jim Meyering 72d3fd67af *** empty log message *** 2004-06-14 17:20:29 +00:00
Jim Meyering 5956d74d8b (TESTS): Add pwd.
(BUILD_SRC_DIR): Define BUILD_SRC_DIR.
2004-06-14 17:20:19 +00:00
Jim Meyering 8b7c9bce6f *** empty log message *** 2004-06-14 17:19:52 +00:00
Jim Meyering 8812a1f12a New test, for fix of 2004-04-19. 2004-06-14 17:19:46 +00:00
Jim Meyering 4983ce64d8 *** empty log message *** 2004-06-14 14:40:21 +00:00
Jim Meyering b276da216d Remove declaration of euidaccess.
Instead, include "euidaccess.h".
2004-06-14 14:40:12 +00:00
Jim Meyering 773c6cc76b *** empty log message *** 2004-06-13 22:03:11 +00:00
Jim Meyering 5bca9fb5f3 (PIDSTR_DECL_AND_INIT): Don't assume pid_t fits in int.
(UT_ID) [!HAVE_STRUCT_XTMP_UT_ID]: Remove bogus comment,
as (sizeof "??") reliably returns 3.
(print_line): Guard against idle and pid being too long
(which is possible when printing headers).
(print_user): Allocate enough bytes for idlestr.  Use IDLESTR_LEN.
Avoid unnecessary cast of sizeof to int.
(make_id_equals_comment): Do not assume that UT_ID returns
a string; it might return a non-null-terminated array.
Use strncat instead.  It's not very often where strncat is
exactly what you want, but this is one of those rare cases.
2004-06-13 22:03:07 +00:00
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