aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2007-03-18* src/runcon.c (main): Don't reorder arguments. Reported byselinuxJim Meyering4-2/+65
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-18* src/runcon.c (main): Remove "." at end of a diagnostic.Jim Meyering2-1/+5
2007-03-18Arrange for "make check-root" to run the new root-only test.Jim Meyering3-17/+31
* 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-18* src/runcon.c: New program.Jim Meyering10-8/+293
* 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-18Regenerate .cvsignore and .gitignore files.Jim Meyering2-0/+4
2007-03-18mkfifo, mknod: Accept new "-Z, --context=C" option.Jim Meyering4-4/+39
* 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-18mkdir: Accept new "-Z, --context=C" option.Jim Meyering3-2/+22
* src/mkdir.c: Include <selinux/selinux.h>. (main): Honor it. * src/Makefile.am (mkdir_LDADD): Use $(LIB_SELINUX).
2007-03-18* tests/cp/cp-a-selinux: New file. Test for the bug reported inJim Meyering11-19/+175
* 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-18* src/system.h (GETOPT_SELINUX_CONTEXT_OPTION_DECL): Define.Jim Meyering2-0/+3
2007-03-18cp, mv, install: add SELinux support, but unlike with the Red HatJim Meyering7-15/+243
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-18* tests/misc/selinux [VERBOSE]: Print version info for eachJim Meyering2-0/+7
of the tested tools, not just ls.
2007-03-18* src/c99-to-c89.diff: Remove the ls.c patch, now that I'veJim Meyering2-20/+3
temporarily removed the offending c99'ism.
2007-03-18* src/chcon.c (usage): Split a string literal that was longer than 509.Jim Meyering2-0/+4
2007-03-18* src/ls.c (gobble_file): Don't call getfilecon unless print_scontext.Jim Meyering2-3/+7
Upon failed getfilecon, accept not just ENOTSUP, but also ENODATA.
2007-03-18* src/c99-to-c89.diff: Adjust offsets.Jim Meyering2-2/+4
2007-03-18* AUTHORS: Add chcon.Jim Meyering2-0/+3
2007-03-18* src/c99-to-c89.diff: Remove trailing blanks.Jim Meyering2-4/+6
2007-03-18* src/chcon.c: Don't include "dirname.h". system.h already includes it.Jim Meyering2-1/+2
2007-03-18* gl/lib/selinux-at.c: Remove a use of HAVE_CONFIG_H.Jim Meyering2-3/+3
2007-03-18* src/c99-to-c89.diff: Handle a new c99'ism in ls.c.Jim Meyering2-0/+22
2007-03-18* src/id.c (main): Tweak id -Z diagnostic.Jim Meyering2-2/+4
2007-03-18* POTFILES.in: Add src/chcon.c.Jim Meyering2-1/+6
2007-03-18id: Add SELinux support: -Z option.Jim Meyering3-10/+62
* src/id.c (main): Apply patches from Fedora, with these changes: Remove #ifdef WITH_SELINUX. Use error (EXIT_FAILURE, not fprintf+exit(1). * src/Makefile.am (id_LDADD): Define, so as to add $(LIB_SELINUX).
2007-03-18Keep SELinux-related ChangLog entries here.Jim Meyering1-0/+92
2007-03-18stat: Add support for SELinux in the form of a %C format directive.Jim Meyering2-6/+43
* src/stat.c (follow_links): Make this variable file-global. (out_file_context): New function. (print_statfs): Honor %C. (print_stat): Honor %C. (do_stat): Remove follow_links parameter. (usage): Document the two %C directives. (main): Accept -Z (though it's a no-op). * src/Makefile.am (stat_LDADD): Define.
2007-03-18add chconJim Meyering2-2/+2
2007-03-18ls: Add support for SELinux and a slightly modified -Z option.Jim Meyering18-74/+278
I started with the patches from Red Hat. The entries below tell how the code evolved. * src/ls.c (print_long_format, print_file_name_and_frills): When there is no security context (due to getfilecon/lgetfilecon failing with e.g. ENOTSUP), print it as "?", not "". * src/ls.c (print_file_name_and_frills): Make -Z work without -l. (length_of_file_name_and_frills): Likewise. * src/ls.c: Remove the --lcontext and --scontext options. Change the way -Z, --context work so that it no longer implies -l. Thus, -Z -l will work like -lcontext and -Z without -l will work like --scontext. Adjust tests to reflect new 'ls -l' syntax -- affects only systems with SELinux when operating on a file with no ACL. These tests assumed that everything before the first space on each line is the 10-byte mode string. But there may also be a "+" in the 11th column, just before the space. However, note that this is not new. The same thing would have happened even without the change below, when listing a file with an ACL. * tests/chmod/equals, tests/cp/cp-parents, tests/cp/fail-perm: * tests/cp/link-preserve, tests/install/basic-1, tests/misc/mknod: * tests/mkdir/parents, tests/mkdir/special-1, tests/mv/partition-perm: Don't make compilation depend on USE_ACL. An SELinux security context counts as an "alternate access control method", so ls must output a "+" for each file with a security context. * src/ls.c [struct fileinfo] (have_acl): Declare unconditionally. (FILE_HAS_ACL): Remove macro definition. Use f->have_acl directly. (gobble_file): Record whether a file has a security context, and update the condition used to determine whether to print the "+". (gobble_file): Call getfilecon/lgetfilecon also when format == long_format, so that we get the "+". * src/ls.c (gobble_file): Add a comment explaining why (with a security context option) ls doesn't exit nonzero due to e.g., getfilecon failing with errno == ENOTSUP. * src/ls.c (gobble_file): Ignore failure of getfilecon if it's due to ENOTSUP. * src/ls.c (gobble_file): Factor out three small blocks using getfilecon and lgetfilecon. Don't ignore return value from getfilecon and lgetfilecon. * src/ls.c (print_long_format): Don't use ?: (empty 2nd arg with C ternary operator). (print_scontext_format): Likewise. (print_scontext): Declare to be "bool", not int. Adjust uses. * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD): Add $(LIB_SELINUX). * tests/misc/chcon: New file. * tests/misc/chcon-fail: New file. * tests/Makefile.am (check-root): Run new, root-only misc/chcon test. * tests/misc/Makefile.am (TESTS): Add chcon and chcon-fail. * tests/misc/Makefile.am (TESTS): Add selinux. * tests/misc/selinux: New file. * tests/help-version: Skip chcon.
2007-03-18* man/chcon.x: New file.Jim Meyering3-1/+9
* man/Makefile.am: Build chcon.1.
2007-03-18.cvsignore, .gitignore: updateJim Meyering6-0/+16
2007-03-18New program: chconJim Meyering13-10/+943
* gl/modules/selinux-at: New module. Check for libselinux and set LIB_SELINUX here, unconditionally, rather than depending on the configure-time --enable-selinux option. * gl/modules/selinux-h: New module. * bootstrap.conf (gnulib_modules): Add selinux-at. * gl/lib/selinux-at.c, gl/lib/selinux-at.h: New files. * gl/lib/se-selinux_.h: New file. * gl/lib/se-context_.h: New file. * gl/m4/selinux-selinux-h.m4: New file. * gl/m4/selinux-context-h.m4: New file. * src/Makefile.am (bin_PROGRAMS): Add chcon. (chcon_LDADD): Define. * README: Add chcon to the list of programs. * src/chcon.c: Rewrite the original (Red Hat) chcon to use fts.
2007-03-18Merge branch 'master' of /cuJim Meyering19-81/+691
2007-03-18Fix a bug in how pr -m -s works.Jim Meyering6-2/+79
* NEWS: Describe how the fix affects pr. * src/pr.c (init_parameters): The --merge (-m) option does not imply --expand-tabs (-e), so don't set "untabify_input". Reported by Wis Macomson. * tests/misc/pr: New file. Test for the above fix. * tests/misc/Makefile.am (TESTS): Add pr. * THANKS: Update.
2007-03-17Fix a silly syntax error introduced in last change.Jim Meyering1-4/+3
2007-03-17fix a syntax errorJim Meyering1-1/+0
2007-03-17Detect use of AC_CONFIG_AUX_DIR also when its argument is quoted.Jim Meyering2-2/+12
* bootstrap: Put ""s around use of $build_aux, in case someone uses a name containing shell meta-characters. Reported by Alfred M. Szmidt.
2007-03-17* tests/misc/tty-eof: Add shuf to the list of tested commands.Jim Meyering2-0/+3
2007-03-17Avoid test failure on NFS-mounted Solaris ZFS file system.Jim Meyering2-17/+24
* tests/du/basic: Skip a test if "." is on a non-local file system.
2007-03-17Avoid an obscure build failure, prefer waitpid over wait.Jim Meyering2-5/+8
* src/install.c (strip): Use waitpid, not wait. It's equivalent, but feels less obsolescent.
2007-03-17* bootstrap: Don't use \> in grep regexp. For HP-UX.Jim Meyering2-1/+5
2007-03-16Begin adding support for Solaris ZFS (4 entries per trivial ACL)Jim Meyering2-8/+35
* gl/lib/acl.c (ACL_NOT_WELL_SUPPORTED): New macro. (file_has_acl, copy_acl): Use it, rather than enumerating errno values. (is_trivial_acl): New function. Incomplete, for now. (file_has_acl, copy_acl): Use the new function, rather than counting the number of entries in an ACL.
2007-03-16* bootstrap: Update from gnulib.Jim Meyering2-29/+38
2007-03-16* .x-sc_prohibit_atoi_atof: Add TODO here, too.Jim Meyering2-0/+5
2007-03-16* src/copy.c: Include filemode.h.Paul Eggert3-4/+19
(overwrite_prompt): Say "try to overwrite", not "overwrite", to make it clearer that the attempt may fail. Problem reported by Dan Jacobson in: http://lists.gnu.org/archive/html/bug-coreutils/2007-03/msg00130.html Output symbolic mode as well as numeric. * tests/mv/i-2 (fail): Adjust to new prompt format.
2007-03-16Fix manual in response to bug reports by Dan Jacobson.Paul Eggert2-14/+28
* coreutils.texi (sort invocation): Explain numeric sorts better. Compress self-congratulation into a simple "comparison is exact" notice; the --general-numeric-sort option already explains the tradeoffs. (seq invocation): Add example of -f.
2007-03-15Enforce policy: don't use *scanf functions.Jim Meyering4-3/+15
* Makefile.maint (sc_prohibit_atoi_atof): Add to regexp and diagnostic. * .x-sc_prohibit_atoi_atof: Give stty a temporary pass. * TODO: note that stty.c needs this small clean-up.
2007-03-13Prepare to work on ACL-related failure when using Solaris ZFS.Jim Meyering2-0/+409
* gl/lib/acl.c: New file, copied from gnulib.
2007-03-13Work around a failing test due to an NFS-based race condition.Jim Meyering2-1/+6
* tests/cp/sparse: Accept a report that the copy is *smaller*.
2007-03-12* coreutils.texi (cp invocation): Mention that --preserve=timestampsJim Meyering2-1/+13
doesn't preserve time stamps on symbolic links. Reported by Polo Talnir in <https://bugzilla.redhat.com/230866>.
2007-03-12Merge branch 'master' of /cuJim Meyering87-1311/+1733
2007-03-12Make bootstrap.conf a tiny bit more generic.Jim Meyering2-14/+35
* bootstrap.conf (XGETTEXT_OPTIONS): Exclude gettext-related .m4 files when e.g., AM_GNU_GETTEXT([external] appears in configure.ac.