Commit Graph

2998 Commits

Author SHA1 Message Date
Jim Meyering
c6357f0cab * tests/misc/test-diag: Work also when libc's error function
reports the entire program name ("../../src/test"), rather than
just the final component.
2007-01-11 18:59:24 +01:00
Jim Meyering
dad7d86d57 * tests/sample-test: Update copyright date to 2007.
* Makefile.maint (copyright-check): Also check the copyright date
in tests/sample-test.
2007-01-07 18:38:56 +01:00
Jim Meyering
bce110cdd5 * tests/fmt/basic (pfx-only, pfx-of-pfx): New tests,
based on examples from G.P. Halkes in
<http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/9388>.
2007-01-06 10:42:17 +01:00
G.P. Halkes
37bcc27707 * src/fmt.c (copy_rest): Correct prefix handling.
Don't elide a line with the prefix followed by only white space.
(get_line): Move EOF-check to loop-termination condition.
* tests/fmt/basic (pfx-1): Adjust test to expect desired result.
(pfx-2): Remove test; its premise was contrary to the documentation.
2007-01-06 09:49:47 +01:00
Jim Meyering
3b933f1e33 [ChangeLog]
When decoding, always allow newlines in input, with almost no
performance impact.
* src/base64.c (do_decode): Initialize decode context.
Call base64_decode one more time, after all input is processed.
(usage): When decoding, newlines are always accepted.

* tests/misc/base64: Add a bunch of tests, for the above.
* gl/lib/base64.c: Include <string.h>.
(base64_decode_ctx_init, get_4, decode_4): New functions.
(base64_decode): Efficiently handle interspersed newlines.
(base64_decode_alloc): Update signature.
* gl/lib/base64.h (struct base64_decode_context): Define.
(base64_decode_ctx_init): Add prototype.
(base64_decode, base64_decode_alloc): Update prototypes.
[doc/ChangeLog]
* coreutils.texi (base64 invocation): When decoding, newlines
are always accepted.
2007-01-04 11:52:52 +01:00
Bruno Haible
f28e07f81d Avoid spurious test failures on MacOS X 10.3.9, in a German locale.
* tests/chown/deref: Apply lang-default.
* tests/misc/split-a: Likewise.
* tests/mv/reply-no: Likewise.

Signed-off-by: Jim Meyering <jim@meyering.net>
2007-01-03 10:51:37 +01:00
Paul Eggert
f0b5e513d9 Now, "ls -FRL" always follows symbolic links on Linux.
* NEWS: Mention this bug fix.
* src/ls.c (gobble_file): Fix bug reported by
Nobuyuki Tsuchimura in
http://lists.gnu.org/archive/html/bug-coreutils/2006-12/msg00152.html
where "ls -FRL" didn't follow a symbolic link in some cases on Linux.
* tests/ls/follow-slink: Add a test for this case.

Signed-off-by: Jim Meyering <jim@meyering.net>
2007-01-02 07:27:22 +01:00
Jim Meyering
3b8560a637 * tests/rm/fail-eperm: Instead, simply transform the actual output diagnostic.
Test failure reported by Bob Proulx.
2007-01-01 10:56:01 +01:00
Jim Meyering
b5ef9617c4 * tests/rm/fail-eperm: Revert last change. The PATH=... setting
is not honored at least on HP-UX 11.23 systems.
2007-01-01 09:51:43 +01:00
Jim Meyering
d2ec687c1c * tests/misc/base64: Factor a long, repetitive string. 2006-12-30 17:46:09 +01:00
Jim Meyering
5017d1b4e1 * tests/rm/fail-eperm: Avoid spurious differences (the error function
from latest glibc no longer prints the full program_name): so don't
invoke rm via ../../src/rm.  Instead, invoke it via "PATH=../../src rm".
2006-12-30 12:50:43 +01:00
Jim Meyering
841d9a7d5d * tests/mv/acl (skip): Skip this test also if the destination
directory, which is on a different file system, lacks ACL support.
2006-12-30 11:49:04 +01:00
Paul Eggert
f24ff8f42b * NEWS: dd bs= operands now silently override later ibs= and obs=,
as POSIX requires.
* src/dd.c (scanargs): Implement it.
* tests/dd/misc (outbytes): Test it.
* doc/coreutils.texi (dd invocation): Specify that bs=N
overrides later ibs and obs, undoing part of the
previous change.  (The behavior was wrong.)
2006-12-22 10:09:37 +01:00
Jim Meyering
c8ef95eaed "rm -rf /etc/motd" (run by non-root) now prints a diagnostic.
* src/remove.c (remove_entry): Handle EACCES for a non-directory, too.
Karl Berry reported that a cross-partition "mv /etc/issue ~"
failed with the um,... suboptimal diagnostic,
"mv: cannot remove `/etc/issue': Not a directory".
* tests/rm/Makefile.am (TESTS): Add fail-eacces.
* tests/rm/fail-eacces: New file.
* NEWS: Mention that both mv and rm are affected.
2006-12-21 08:58:11 +01:00
Jim Meyering
d69fc66d81 "cut -f 2- A B" no longer triggers a double-free bug
* src/cut.c (cut_fields): Set file-scoped global to NULL after
freeing it.  This avoids a double-free (and core dump on some systems)
for this usage: "echo 1>a; echo 2>b; cut -f2- a b".  Reported by
James Hunt in <http://bugzilla.redhat.com/220312>.
* NEWS: List this bug fix.
* THANKS: Mention him.
* tests/misc/cut: New file.
* tests/misc/Makefile.am (TESTS): Add cut.
2006-12-20 14:25:55 +01:00
Jim Meyering
4e48b4ce33 * tests/cp/open-perm-race: Correct the gdb-existence check.
Don't run either subsequent gdb command in a sub-shell.
Reported by Thomas Schwinge.
* THANKS: bring up to date.
2006-12-15 10:43:20 +01:00
Paul Eggert
6f005c8491 Make sure cp -p isn't too generous with file permissions.
* tests/cp/Makefile.am (TESTS): Add file-perm-race.
* tests/cp/file-perm-race: New file.
Signed-off-by: Jim Meyering <jim@meyering.net>
2006-12-15 09:50:40 +01:00
Paul Eggert
6f3efa15eb Ensure cp -pR --parents isn't too generous with parent permissions.
* tests/cp/Makefile.am (TESTS): Add parent-perm-race.
* tests/cp/parent-perm-race: New file.
Signed-off-by: Jim Meyering <jim@meyering.net>
2006-12-15 09:44:58 +01:00
Jim Meyering
33de42f2a8 * tests/chgrp/default-no-deref: Don't assume that files are created
with the primary group by default.  That's not true in a directory
with the set-GID bit set.
2006-12-14 21:07:49 +01:00
Jim Meyering
c97742932a Don't hang when there's no input tty.
* tests/cp/open-perm-race: Skip this test if there is no
controlling input `terminal'.
2006-12-14 19:32:10 +01:00
Jim Meyering
a6a1e73c0a Test for a hard-to-detect race fix, using gdb.
* tests/cp/open-perm-race: New file, to test for the
cp --preserve=ownership fix of 2006-12-06.
* tests/cp/Makefile.am (TESTS_ENVIRONMENT): Define abs_top_builddir.
(TESTS): Add open-perm-race.
2006-12-14 17:17:31 +01:00
Jim Meyering
c3154b2947 chgrp, chown: Don't prohibit -RLh, aka -RL with --no-dereference.
* src/chgrp.c (main): Don't prohibit -RLh, aka -RL with --no-dereference.
* src/chown.c (main): Likewise.
* src/chown-core.c (change_file_owner): Add to a comment.
* tests/chown/preserve-root: Add tests.
* doc/coreutils.texi (Treating / specially): With --preserve-root,
chgrp and chown will not modify "/", even through a symlink.
2006-12-14 15:41:50 +01:00
Jim Meyering
24852bf5b5 * NEWS: --preserve-root now works with chgrp, chmod, and chown.
* src/chmod.c (process_file): Do honor the --preserve-root option.
* src/chown-core.c (change_file_owner): Likewise, but here, also
handle the case in which a traversal would go "through" a symlink
to root.  Reported by Matthew M. Boedicker
* tests/chown/preserve-root: Test for the above.
* tests/chown/Makefile.am (TESTS): Add preserve-root.
2006-12-14 11:14:25 +01:00
Andreas Schwab
ae3f43d3eb Don't fail if mv/acl test succeeds.
* tests/mv/acl (skip): Check for acl support in the file system.
* tests/mv/Makefile.am (XFAIL_TESTS): Remove.
(TESTS_ENVIRONMENT): Pass CONFIG_HEADER.
Signed-off-by: Jim Meyering <jim@meyering.net>
2006-12-13 22:26:23 +01:00
Paul Eggert
ec95137cc3 Remove some arbitrary restrictions on size fields,
so that commands like "sort -k 18446744073709551616" no longer fail merely
because 18446744073709551616 doesn't fit in uintmax_t.  The trick is that
these fields can all be treated as effectively infinity;  their exact
values don't matter, since no internal buffer can be that long.
* src/join.c (string_to_join_field): Verify that SIZE_MAX <= ULONG_MAX
if the code assumes this.  Silently truncate too-large values to SIZE_MAX,
as the remaining code will do the right thing in this case.
* src/sort.c (parse_field_count): Likewise.
* src/uniq.c (size_opt, main): Likewise.
* tests/join/Test.pm (bigfield): New test.
* tests/sort/Test.pm (bigfield): New test.
* tests/uniq/Test.pm (121): New test.
Signed-off-by: Jim Meyering <jim@meyering.net>
2006-12-13 22:03:54 +01:00
Jim Meyering
ae3ee95eb8 * tests/chgrp/default-no-deref: New test.
* tests/chgrp/Makefile.am (TESTS): Add default-no-deref.
2006-12-13 13:28:17 +01:00
Jim Meyering
dab023dec1 * tests/uniq/Test.pm (test_vector): Skip the pipe-reading test
whenever uniq is expected to fail.  This should catch the other case
[test #112] in which uniq emits "cat: write error: Broken pipe" on
some systems.
2006-12-09 14:17:00 +01:00
Jim Meyering
565b165115 * tests/touch/empty-file: Use envvar-check, so "make check" doesn't
evoke diagnostics like this when COLUMNS=0 in the environment:
ls: ignoring invalid width in environment variable COLUMNS: 0
* tests/touch/no-rights: Likewise.
* tests/help-version: Likewise.
2006-12-07 10:11:40 +01:00
Jim Meyering
9f1b96313e Make the output of "make check" more reproducible.
* tests/uniq/Test.pm: Don't perform the pipe-reading version of test
118, since it emits "cat: write error: Broken pipe" on some systems.
2006-12-07 10:04:04 +01:00
Paul Eggert
fc92148eac cp -p now clears special bits if it fails to preserve owner or group
* NEWS: Document the cp -p fix for special bits.
* src/copy.c (set_owner): Now returns a three-way result, so
that the caller can clear the special bits.  All callers changed.
(copy_reg): Don't set the special bits if chown failed.
(copy_internal): Likewise.
* tests/cp/special-bits: Test this fix.
Signed-off-by: Jim Meyering <jim@meyering.net>
2006-12-07 08:10:35 +01:00
Jim Meyering
e7f7dcb9d1 Make the output of "make check" more reproducible.
* tests/misc/date-sec: Don't emit any diagnostic about sleeping.
2006-12-06 16:36:29 +01:00
Jim Meyering
5e585ffe84 * tests/misc/date-sec: Output a fixed string. 2006-12-03 16:01:41 +01:00
Jim Meyering
ba45154d8e * NEWS: du --one-file-system (-x) would skip subdirectories of any
directory listed as second or subsequent command line argument.
* tests/du/one-file-system: New file.  Test for today's fts.c fix.
* tests/du/Makefile.am (TESTS): Add one-file-system.
2006-12-03 11:17:35 +01:00
Jim Meyering
6e7e2709c8 * tests/du/basic: Generate 4KB file simply using printf, rather than
seq+head.  This avoids a spurious "Broken pipe" diagnostic from seq.
2006-12-02 22:04:13 +01:00
Jim Meyering
1ddf7faf11 * tests/mv/no-target-dir: Detect a buggy rename syscall. If found,
skip this test.  This happens at least on ia64 linux-2.4.19 w/ext3.
Reported by Matthew Woehlke.
2006-11-28 13:36:37 +01:00
Jim Meyering
db7092bed3 * tests/mv/dir2dir: Also accept EBUSY.
Reported by Matthew Woehlke.
2006-11-28 09:21:00 +01:00
Theodoros V. Kalamatianos
c8092e5db0 * tests/du/inacc-dest: Skip this test when running as root. 2006-11-24 22:08:33 +01:00
Jim Meyering
37012effc9 * tests/du/deref-args: Use "printf %65536s x" to create a 64KB file,
rather than a pipeline that would sometimes evoke a diagnostic
like "seq: write error: Broken pipe".
2006-11-23 09:09:53 +01:00
Jim Meyering
a409011bba * tests/help-version: Suppress dd transfer rate output. 2006-11-23 09:02:36 +01:00
Jim Meyering
d66091126a * tests/rm/one-file-system: Upon setup failure (e.g., mount failure),
skip the test rather than failing.  Reported by Michael Deutschmann.
2006-11-21 09:32:55 +01:00
Jim Meyering
41b5fe3246 * tests/rm/fail-eperm: Use the "(exit N); exit N" idiom,
rather than just "exit N".
2006-11-21 09:03:27 +01:00
Jim Meyering
e9a8c140da Arrange for "make check-root" to run the new root-only test.
* tests/Makefile.am (t7): New target, to run tests/ls/nameless-uid.
(all_t): Add t7.
2006-11-21 00:37:03 +01:00
Jim Meyering
279c41d79c Add a root-only test for today's lib/idcache.c fix.
* tests/ls/nameless-uid: New file.
* tests/ls/Makefile.am (TESTS): Add nameless-uid.
(TESTS_ENVIRONMENT): Add PERL to the list.
2006-11-20 11:31:05 +01:00
Jim Meyering
81ebd46046 * tests/tail-2/assert-2: Mark as a very-expensive test, because I
find the 7-second sleep annoyingly long.  Besides, this test is
probably far too specific and timing sensitive ever to trigger again.
* tests/tail-2/assert: Likewise.
2006-11-19 23:19:06 +01:00
Jim Meyering
0cafba44bb "ln --backup f f" produces a misleading diagnostic:
ln: creating hard link `f' => `f': No such file or directory
* src/ln.c (do_link): Give a better diagnostic in this unusual case.
(do_link): Rename local: s/lstat_ok/dest_lstat_ok/.
* tests/ln/Makefile.am (TESTS): Add hard-backup.
* tests/ln/hard-backup: New test for the above.
2006-11-18 20:00:39 +01:00
Jim Meyering
a73fdeb2ce * tests/tail-2/append-only: If chattr +a fails, exit 77 (to tell
automake we're skipping this test), and give a diagnostic to tell
the user the same thing.  Reported by Mike Grayson.
2006-11-16 10:05:36 +01:00
Jim Meyering
78a1d22aa0 * tests/du/Makefile.am (TESTS): Add inacc-dest. 2006-11-12 19:58:58 +01:00
Jim Meyering
c24e93d926 du would exit early, when encountering an inaccessible directory
Reported by Mike Frysinger, in
http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/8831
* tests/du/inacc-dest: New test, based on an example from Mike Frysinger.
* tests/chgrp/no-x: Remove the "fts_read failed: ..."
diagnostic from the expected output when using native fdopendir.
* tests/chmod/no-x: Likewise.
* tests/du/no-x: Likewise.
2006-11-12 18:42:24 +01:00
Jim Meyering
28c7ef509e Avoid false-positive when testing via valgrind.
* tests/mv/atomic: Grep strace output for a more specific pattern
than just "unlink", since that got a false positive when testing
under valgrind: unlink("/tmp/valgrind_proc_9657_cmdline_A51E9991") = 0
* tests/mv/Makefile.am (TESTS_ENVIRONMENT): Define EGREP.
2006-11-12 08:22:46 +01:00
Jim Meyering
b40b5b6917 Avoid a shell bug in Tru64 4.0 sh's handling of double-quoted strings.
[patch by Paul Eggert]

* tests/chmod/c-option: When double-quoting part of a word, prefer
to double-quote the whole word.  This is a bit easier to read (at
least for me), and in some cases it avoids a shell bug with Tru64
4.0 sh reported by Nelson H. F. Beebe.  For example, instead of
"$abs_srcdir"/../setgid-check we now write
"$abs_srcdir/../setgid-check".

* tests/cp/cp-parents: Likewise.
* tests/du/inaccessible-cwd: Likewise.
* tests/du/long-from-unreadable: Likewise.
* tests/install/basic-1: Likewise.
* tests/install/trap: Likewise.
* tests/misc/close-stdout: Likewise.
* tests/mkdir/concurrent-1: Likewise.
* tests/mkdir/p-1: Likewise.
* tests/mkdir/p-3: Likewise.
* tests/mkdir/parents: Likewise.
* tests/mkdir/perm: Likewise.
* tests/readlink/can-e: Likewise.
* tests/readlink/can-f: Likewise.
* tests/readlink/can-m: Likewise.
* tests/rm/inaccessible: Likewise.
* tests/rm/unread3: Likewise.
* tests/touch/no-create-missing: Likewise.

* lib/.cvsignore: Add uinttostr.c.
2006-10-26 11:03:30 +02:00