Commit Graph

24461 Commits

Author SHA1 Message Date
Jim Meyering
5ab25eb05b Rename uses of futimens -> gl_futimens; glibc now declares the former.
* src/copy.c (copy_reg): Reflect renaming: futimens -> gl_futimens.
* src/touch.c (touch): Likewise.
2007-05-19 18:36:03 +02:00
Jim Meyering
ab4f4bdc18 * Makefile.maint (my-distcheck): Remove -pedantic from $(CFLAGS)
for now, to avoid c89-check failure due to use of #include_next.
2007-05-18 09:01:03 +02:00
Jim Meyering
b3414967d5 Generate a dozen test-related Makefile.am files at bootstrap-time.
* README-hacking: Build-from-checkout now require Perl, too.
* bootstrap: Now that these generated Makefile.am files are no longer
under version control, they must be created at bootstrap time.
2007-05-15 10:18:48 +02:00
Paul Eggert
f4a5097ea3 * man/chmod.x: Document chmod's behavior with setuid and setgid bits.
Remove misleading implication about leading zero.  Problem
reported by Jan Engelhardt in
<http://lists.gnu.org/archive/html/bug-coreutils/2007-05/msg00134.html>.
2007-05-15 07:14:55 +02:00
Jim Meyering
893ac688cc Remove the generated tests/*/Makefile.am files from version control.
* tests/cut/Makefile.am: git-remove this generated file.
* tests/head/Makefile.am: Likewise.
* tests/join/Makefile.am: Likewise.
* tests/pr/Makefile.am: Likewise.
* tests/sort/Makefile.am: Likewise.
* tests/tac/Makefile.am: Likewise.
* tests/tail/Makefile.am: Likewise.
* tests/test/Makefile.am: Likewise.
* tests/tr/Makefile.am: Likewise.
* tests/uniq/Makefile.am: Likewise.
* tests/wc/Makefile.am: Likewise.
* .cvsignore, .gitignore: Ignore these generated files.

* src/.cvsignore, src/.gitignore: Add chcon here, ...
* .cvsignore, .gitignore: ... not here.
2007-05-13 18:23:41 +02:00
Jim Meyering
16385191ce Test uniq's new --zero-terminated (-z) option.
* tests/uniq/Test.pm: When possible, create a "-z"-testing variant
of each existing test.
(2z, 3z, 4z, 5z, 20z, 122, 123): New tests from James Youngman.
2007-05-13 11:29:54 +02:00
James Youngman
e06252480a Add -z option to uniq. Originally proposed by Egmont Koblinger.
* NEWS: Mention uniq's new option: --zero-terminated (-z).
* src/uniq.c: Add new option, --zero-terminated (-z), to make
uniq use the NUL byte as separator/delimiter rather than newline.
(check_file): Add a parameter: delimiter.  Update caller.
Use readlinebuffer_delim in place of readlinebuffer everywhere.
(main): Handle the new option.
(usage): Describe new option the same way sort does.
* doc/coreutils.texi (uniq invocation): Describe the new option.
2007-05-13 11:02:43 +02:00
Jim Meyering
cdd66362dc * NEWS: Mention that last week's tr bug dates back to 1992. 2007-05-07 21:56:27 +02:00
Jim Meyering
283dadf095 Avoid test failure when run with an unusual umask.
* tests/ls/color-dtype-dir: Set umask to 022.
Suggestion from AIDA Shinra.
2007-05-04 13:32:46 +02:00
Jim Meyering
3affac54ed Avoid failure of root-only test when run with a restrictive umask.
* tests/rm/no-give-up: Ensure that non-root can access "d/" through
root-owned ".".  Reported by AIDA Shinra.
2007-05-04 12:01:43 +02:00
Jim Meyering
ab402c29f9 tr -c: don't abort when translating with S2 larger than complement of S1
* src/tr.c (main): Remove invalid assertion triggered by e.g.,
tr -c a '[b*256]'.  There's nothing wrong with having Set2 larger
than Set1.  Reported by Guntram Blohm.
* tests/tr/Test.pm (no-abort-1): Test for the above.
* NEWS: Mention this bug fix.
* THANKS: Add Guntram Blohm.
2007-05-04 10:03:01 +02:00
Jim Meyering
bf8cfacd24 Avoid test failure when run with a permissive umask.
* tests/rm/no-give-up: Set permissions of test directory properly,
i.e., not depending on umask prohibiting go=w.
Reported by AIDA Shinra.
2007-05-03 19:36:34 +02:00
Paul Eggert
2539b53760 The following commands and options now support the standard size
suffixes kB, M, MB, G, GB, and so on for T, P, Y, Z, and Y:
head -c, head -n, od -j, od -N, od -S, split -b, split -C,
tail -c, tail -n.
* doc/coreutils.texi (od invocation, head invocation, tail invocation):
Document support for new size suffixes.
(head invocation, tail invocation):
Document that -n uses the same suffixes as -c.
(tail invocation): More-clearly document what leading "+" does.
* src/head.c (usage, string_to_integer): Support new suffixes.
* src/od.c (usage, main): Likewise.
* src/split.c (usage, main): Likewise.
* src/tail.c (usage, parse_options): Likewise.
Prompted by a patch from Evan Hunt.
2007-05-03 13:45:26 +02:00
Jim Meyering
4e89cf8fb8 * src/du.c (usage): Tweak description of --dereference-args (-D) again.
Prompted by another request for clarification from Justin Pryzby.
2007-05-02 23:37:55 +02:00
Jim Meyering
aa3f52d17b Invoke rm via 'setuidgid ... env PATH="$PATH" ...', as in fail-eperm.
* tests/rm/fail-2eperm: Patch from AIDA Shinra.
Reported by Peter Dyballa.
* THANKS: Add AIDA Shinra and Peter Dyballa.
2007-05-02 23:34:33 +02:00
Paul Eggert
60f3c362f5 * src/nohup.c (usage): Describe how standard input and output are redirected. 2007-04-28 20:48:36 +02:00
Jim Meyering
cebbc9ee6d Add "runcon" to .cvsignore and .gitignore files. 2007-04-25 15:52:53 +02:00
Jim Meyering
0de4ae4b25 * src/du.c (usage): Clarify description of --dereference-args (-D).
Prompted by a report from Justin Pryzby.
2007-04-25 13:54:21 +02:00
Jim Meyering
0e8bf7bffe * bootstrap.conf (gnulib_modules): Add autobuild.
* m4/autobuild.m4: Remove file.  Now, provided by gnulib.
2007-04-25 11:33:44 +02:00
Jim Meyering
3d19a12976 * bootstrap.conf (gnulib_modules): Add fseeko and ftello. 2007-04-25 10:55:56 +02:00
Jim Meyering
5c82d3f1ce Add to .cvsignore and .gitignore files. 2007-04-25 10:55:35 +02:00
Jim Meyering
0361f46554 * bootstrap.conf (gnulib_modules): Add fseeko. 2007-04-25 10:40:12 +02:00
Jim Meyering
9213769933 Add to .cvsignore and .gitignore files. 2007-04-25 10:39:48 +02:00
Jim Meyering
383713e030 * THANKS: Add Andreas Frische.
* NEWS: Mention today's ls --color fix.
* tests/ls-2/tests (sl-dangle): Add a test for today's fix.
2007-04-24 09:20:52 +02:00
Eric Blake
1d85945321 ls --color once again colors dangling symlinks correctly
* src/ls.c (gobble_file): Much like the 2007-04-07 fix,
add a term to the expression that decides whether we need
stat and/or lstat calls.  Reported by Andreas Frische.
2007-04-24 09:18:56 +02:00
Jim Meyering
25b8a7a987 cut synopsis: fix coreutils.texi, too.
* doc/coreutils.texi (cut invocation): Adjust synopsis to show that an
* THANKS: Add Rudolf Kastl.
OPTION is required.  Reported by Rudolf Kastl.
2007-04-16 22:01:46 +02:00
Jim Meyering
14816cf338 * src/cut.c (usage): Adjust synopsis to show that an OPTION is required.
Reported by Rudolf Kastl.
2007-04-16 16:26:13 +02:00
Jim Meyering
74932c721b Add to .cvsignore and .gitignore files. 2007-04-12 14:48:50 +02:00
Paul Eggert
395fcee97a split --line-bytes=N (-C N): don't create an empty file.
* src/split.c (line_bytes_split): Don't create an empty line
afterwards if the last buffer happens to be exactly full.
* tests/misc/split-fail: Add a test case for this.
* NEWS: mention this.
2007-04-12 00:21:25 +02:00
Jim Meyering
f839bfad73 ls: don't form or compute the length of strings that won't be used.
* src/ls.c (gobble_file): Form and compute length of strings for
block size, owner, group, author, major+minor numbers and file size
only if they'll actually be used.  I.e., don't form most of them
when not producing long format output.
2007-04-10 00:21:07 +02:00
Jim Meyering
4d484fe09f Add a test for, and document, today's fix.
* NEWS: Mention today's ls --color fix.
* tests/ls-2/tests (sl-target): Add a test for today's fix.
* THANKS: Add Kirk Kelsey.
2007-04-07 20:51:13 +02:00
Eric Blake
d63623eb7c Fix a bug in how the LS_COLORS ln=target attribute is handled.
* src/ls.c (gobble_file): Use "stat" (not lstat) also when the
ln=target attribute applies.  Reported by Kirk Kelsey.
2007-04-07 20:14:07 +02:00
Jim Meyering
abdf924333 * src/copy.c (copy_reg): Initialize local "con", before calling
getfscreatecon, in case that function (or its inline stub) does
not set it.
2007-04-02 22:06:22 +02:00
Paul Eggert
a3b65a63a0 * src/ls.c (print_horizontal): Fix bug reported by Mike Frysinger:
ls -x DIR would sometimes output the wrong string in place of the
first entry.
* NEWS: Mention the bug fix.
* tests/ls/x-option: New file.
* tests/ls/Makefile.am (TESTS): Add x-option.
2007-04-02 18:29:41 +02:00
Paul Eggert
0b39324840 gnulib moved md5 and sha1 modules into a new crypt/ directory; adapt
* bootstrap.conf (gnulib_modules): Adjust to gnulib's renaming of
md5 to crypt/md5 and sha1 to crypt/sha1.
2007-04-02 14:48:35 +02:00
Jim Meyering
a301ea6697 * NEWS: Mention these SELinux changes. 2007-03-30 16:02:54 +02:00
Jim Meyering
e4e19d87a0 * ChangeLog-selinux: Remove file.
Move its contents into this file, removing old dates.
2007-03-30 11:16:00 +02:00
Jim Meyering
848bd19d21 * src/runcon.c (main): Don't reorder arguments. Reported by
Ulrich Drepper in <http://bugzilla.redhat.com/232652>.
* tests/misc/runcon-no-reorder: New file.  Test for the above.
* tests/misc/Makefile.am (TESTS): Add runcon-no-reorder.
2007-03-29 21:37:06 +02:00
Jim Meyering
aefac2c02e * src/runcon.c (main): Remove "." at end of a diagnostic. 2007-03-29 21:37:06 +02:00
Jim Meyering
add8b36148 Arrange for "make check-root" to run the new root-only test.
* tests/Makefile.am (t9): New target, to run tests/cp/cp-a-selinux.
(all_t): Add t9.

Use a directory on a loopback device mounted with -o context=...
* tests/cp/cp-a-selinux: Since this test now runs mount and umount,
it is a root-only one.
2007-03-29 21:37:06 +02:00
Jim Meyering
c6922b6f7e * src/runcon.c: New program.
* src/Makefile.am (bin_PROGRAMS): Add runcon.
(runcon_LDADD): Define.
* README: Add runcon to the list of programs.
* AUTHORS: Add this: runcon: Russell Coker
* tests/help-version: Add runcon as an exception.
* man/Makefile.am (dist_man_MANS): Add runcon.1.
(runcon.1): New dependency.
* po/POTFILES.in: Add src/runcon.c.
2007-03-29 21:37:06 +02:00
Jim Meyering
c2bbd117f5 Regenerate .cvsignore and .gitignore files. 2007-03-29 21:37:06 +02:00
Jim Meyering
447b254923 mkfifo, mknod: Accept new "-Z, --context=C" option.
* src/mkfifo.c, src/mknod.c: Include <selinux/selinux.h>.
(main): Honor it.
* src/Makefile.am (mkfifo_LDADD, mknod_LDADD): Use $(LIB_SELINUX).
2007-03-29 21:37:06 +02:00
Jim Meyering
301fbaf431 mkdir: Accept new "-Z, --context=C" option.
* src/mkdir.c: Include <selinux/selinux.h>.
(main): Honor it.
* src/Makefile.am (mkdir_LDADD): Use $(LIB_SELINUX).
2007-03-29 21:37:06 +02:00
Jim Meyering
8a86223d45 * tests/cp/cp-a-selinux: New file. Test for the bug reported in
* tests/cp/Makefile.am (TESTS): Add cp-a-selinux.

* tests/selinux: New file.
* tests/Makefile.am (EXTRA_DIST): Add selinux.
* tests/misc/selinux: Source the new script, rather than open coding it.

Change how "cp -a" and "cp --preserve=context" work with SELinux.
Now, cp -a attempts to preserve context, but failure to do so does
not change cp's exit status.  However "cp --preserve=context" is
similar, but failure *does* cause cp to exit with nonzero status.
* src/copy.h (struct cp_options) [require_preserve_context]: New member.
* src/copy.c (copy_reg, copy_internal): Implement the above.
* src/mv.c (cp_option_init): Initialize the new member.
* src/install.c (cp_option_init): Likewise.
* src/cp.c (cp_option_init): Likewise.
(decode_preserve_arg): Set it or reset it.

FIXME: add an on-writable-NFS-only test
2007-03-29 21:37:06 +02:00
Jim Meyering
adcfd944a8 * src/system.h (GETOPT_SELINUX_CONTEXT_OPTION_DECL): Define. 2007-03-29 21:37:06 +02:00
Jim Meyering
85ddc626be cp, mv, install: add SELinux support, but unlike with the Red Hat
patch, mv and cp do not provide the "-Z context" option.
* src/copy.c: Include <selinux/selinux.h>.
(restore_default_fscreatecon): New function.
(copy_reg): Make cp --preserve=context work for existing destination.
(copy_internal): Likewise for new destinations.
* src/copy.h (cp_options) [preserve_security_context]: New member.
* src/cp.c: Include <selinux/selinux.h>.
(selinux_enabled): New global.
(usage): Mention new --preserve=context option.
(PRESERVE_CONTEXT): Define/use.
(decode_preserve_arg): Handle PRESERVE_CONTEXT.
(main): Remove an obsolete comment.
If --preserve=context is specified on a system without SELinux
enabled, give a diagnostic and fail.
* src/mv.c: Include <selinux/selinux.h>.
Set x->preserve_security_context if SELinux is enabled.
* src/install.c: Accept new "-Z, --context=C" option.
Accept --preserve-context option (but not -P option).
Accept alternate spelling: --preserve_context, for now.
Include <selinux/selinux.h> and "quotearg.h".
(selinux_enabled, use_default_selinux_context): New globals.
(PRESERVE_CONTEXT_OPTION): Define.
(cp_option_init): Default: do not preserve security context.
(setdefaultfilecon): New function.
(main): Honor new options.
* src/Makefile.am (mv_LDADD, cp_LDADD, ginstall_LDADD):
Add $(LIB_SELINUX).
2007-03-29 21:37:06 +02:00
Jim Meyering
5a7fe9c0f8 * tests/misc/selinux [VERBOSE]: Print version info for each
of the tested tools, not just ls.
2007-03-29 21:37:06 +02:00
Jim Meyering
3459fe4506 * src/c99-to-c89.diff: Remove the ls.c patch, now that I've
temporarily removed the offending c99'ism.
2007-03-29 21:37:06 +02:00
Jim Meyering
380c858b71 * src/chcon.c (usage): Split a string literal that was longer than 509. 2007-03-29 21:37:05 +02:00