summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2008-02-07mkdir, split: write --verbose output to stdout, not stderr.Steven Schubiger
* src/mkdir.c (verbose_output): New function. (announce_mkdir): Use it. * src/split.c (usage): Update. * src/split.c (cwrite): Write to stdout, not stderr. * doc/coreutils.texi (split invocation): Remove the mention of --verbose output being printed to stderr. * tests/mkdir/p-v: Redirect stdout, not stderr. * tests/misc/split-a: Likewise. * NEWS: Mention this change. * TODO: Remove this item.
2008-01-31Don't modify argv in dd due to ',' in arguments.Paul Eggert
* src/dd.c: Include quotearg.h. (operand_matches): New function. (parse_symbols, operand_is): Use it. (parse_symbols): 1st arg is now const pointer. Don't modify it. msgid arg is now just the message, not a format. (scanargs): Add some 'const's to check for problems like the above.
2008-01-30* src/c99-to-c89.diff: Adjust remove.c offsets, again.Jim Meyering
2008-01-30Now that system.h defines is_empty_dir, include "openat.h".Jim Meyering
* src/system.h: Include "openat.h" here, ... * src/chcon.c: ... not here. * src/chmod.c: Likewise. * src/chown-core.c: Likewise. * src/remove.c: Likewise. Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-01-30* src/c99-to-c89.diff: Adjust remove.c offsets.Jim Meyering
2008-01-30Improve "rmdir --ignore-fail-on-non-empty"Jim Meyering
* src/rmdir.c (remove_parents, main): With --ignore-fail-on-non-empty, suppress a diagnostic also for other errno values, which can arise with read-only media or when the parent directory has the immutable attribute (set via chattr +i). (errno_may_be_empty, ignorable_failure): New functions. * src/remove.c (is_empty_dir): Move function to ... * src/system.h (is_empty_dir): ...here, and make it inline. Suggested by Josselin Mouette in <http://bugs.debian.org/363011> via Bob Proulx. * NEWS: Mention the improvement.
2008-01-30Don't modify argv in dd.Paul Eggert
* src/dd.c (operand_is): New function. (scanargs): Use it so that we don't need to modify argv, as a nicety. Problem reported by Adam Goode in <http://lists.gnu.org/archive/html/bug-coreutils/2008-01/msg00264.html>.
2008-01-29ls: don't segfault on files in /proc with an old libselinuxJim Meyering
* src/ls.c (gobble_file): Work around a bug in libselinux1-2.0.15 whereby getfilecon returns 0 yet sets the context to NULL. Reported by Jan Moringen via Michael Stone in http://bugs.debian.org/463043 * tests/ls/Makefile.am (TESTS): Add proc-selinux-segfault. * tests/ls/proc-selinux-segfault: Test for the above fix. * NEWS: Mention the fix.
2008-01-26chcon: correct description of --no-dereference (-h) option.Jim Meyering
* src/chcon.c (usage): Remove invalid reference to lchown. Reported by Göran Uddeborg.
2008-01-26src/dircolors.hin (TERM): Add jfbterm.Mike Frysinger
2008-01-26Add a ";", so "make install" works with --enable-install-program=su.Zvi Har'El
* src/Makefile.am (install_su): Add a semicolon.
2008-01-26Avoid misinterpreting mgetgroups failure in running root-only tests.Jim Meyering
* src/setuidgid.c (main): Don't misinterpret as size_t an error return from mgetgroups. Reported by Theodoros V. Kalamatianos.
2008-01-17Do not define-away __attribute__ when __STRICT_ANSI__ is set.Jim Meyering
* src/system.h (__attribute__): Remove the __STRICT_ANSI__ disjunct. It has been unnecessary since approximately gcc-2.6, and now, leaving it would cause gcc -Werror -ansi to fail to compile csplit.c. * gl/lib/randread.c (__attribute__): Likewise.
2008-01-12* src/dircolors.hin (image formats): Add the .svg suffix.Mike Frysinger
2008-01-09Fix a minor race condition when using cp -p --parents.Paul Eggert
* src/cp.c (make_dir_parents_private): If stat fails on the parent directory, do not add it to the list of directories whose modes might need fixing later. Also, do not bother invoking 'stat' unless the stat results might be needed later.
2008-01-08Remove uses of now-undefined Makefile variable.Jim Meyering
* src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD): Remove uses of no-longer-defined variable, $(LIB_ACL_TRIVIAL).
2008-01-07cp (but not copy.c): plug a small leak.Jim Meyering
* src/cp.c (do_copy) [--parents]: Free the attribute list.
2008-01-07cp --parents: don't use uninitialized memory when restoring permissionsJan Blunck
* src/cp.c (make_dir_parents_private): Always stat each source directory, in case its permissions are required in re_protect, when setting permissions of a just-created destination directory.
2008-01-06touch: ignore "-d now" option, when appropriatePaul Eggert
* src/touch.c (main): Treat "-d now" as if it were absent, if neither -a nor -m is specified. Problem reported by Dan Jacobson in: http://lists.gnu.org/archive/html/bug-coreutils/2008-01/msg00010.html
2008-01-06Avoid tr case-conversion failure in some locales.Jim Meyering
* src/tr.c (skip_construct): New function. (main): When processing a pair of case-converting classes, don't iterate through the elements of each [:upper:] or [:lower:] class. Reported by Gerald Pfeifer in <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12218>. * tests/tr/Test.pm [tolower-F]: New test for the above fix. [upcase-xtra, dncase-xtra]: New tests, for a related code path. * NEWS: Mention the tr bug fix.
2007-12-30* src/dircolors.hin (TERM): Add gnome-256color.Mike Frysinger
2007-12-19Improve wording in uniq's --help "Note".Paul Eggert
2007-12-18* src/uniq.c (usage): Say "key-selection", not "field-selection".Jim Meyering
Quote example commands consistently.
2007-12-18Note that sorting uniq's input is often useful.Jim Meyering
Suggested by Eric Blake.
2007-12-11"ls -l" wouldn't output "+" on SELinux hosts unless -Z was also given.Paul Eggert
* src/ls.c (gobble_file): Also get the file context if -l is specified. Treat getfilecon failures like file_has_acl failures. (UNKNOWN_SECURITY_CONTEXT): New constant. (clear_files): Don't free it. (gobble_file): Set unknown security contexts to it; that way, we don't have to have special cases for unknown contexts. (print_long_format, print_file_name_and_frills): Don't worry about scontext being null, since it's always some string now.
2007-12-09"rm" as root would fail to unlink a non-directory on OS X 10.4.xJim Meyering
* src/remove.c (remove_entry) ["can unlink directories"]: Fix a mistakenly reversed condition. * NEWS: Mention this bug fix. Reported by Pieter Bowman.
2007-12-08* src/c99-to-c89.diff: Adjust shred.c offsets.Jim Meyering
2007-12-04Reflect change in gnulib: don't include getpagesize.h,Jim Meyering
now that it's provided by unistd.h. * src/cat.c: Don't include getpagesize.h. * src/copy.c: Likewise. * src/dd.c: Likewise. * src/shred.c: Likewise. * src/split.c: Likewise.
2007-12-02Remove just-installed su, if unable to make it set-UID root.Jim Meyering
Normally, su isn't even installed. However, if you configure with --enable-install-program=su, and then install with insufficient privileges, we now make sure to remove the just-installed binary. * src/Makefile.am (install-exec-hook): Rename from install-exec-local, so that this rule is guaranteed to be run *after* installation. If unable to chown and chmod the installed "su" program, remove it. Reported by Greg Schaefer.
2007-12-01* NEWS: Mention some of the SELinux changes.Jim Meyering
Record release date and new version number. * src/stat.c (main): Adjust a comment.
2007-12-01Add "extern" keyword to declaration of cp_options_default.Jim Meyering
* src/copy.c (cp_options_default): Mark as "extern", so the "sc_tight_scope" part of "make distcheck" passes.
2007-12-01Fix a security race with "cp -p A B" when B already exists.Paul Eggert
* src/copy.h (struct cp_options): New member owner_privileges. * src/copy.c (USE_ACL): Define to 0 if not defined, for convenience. (owner_failure_ok): New function. (set_owner): Avoid a security-related race by doing an extra chmod first if it looks like there might be trouble right after a chown. Accept a source struct stat rather than a uid and gid, and accept a boolean NEW_DST and destination struct stat. All callers changed. * src/copy.h (cp_options_default): New function, replacing the old chown_privileges. * src/copy.c (cp_options_default): Likewise. * src/cp.c (cp_option_init): Use it. * src/install.c (cp_option_init): Likewise. * src/mv.c (cp_option_init): Likewise.
2007-11-29Close a file descriptor leak when cp --preserve=context fails.Paul Eggert
* src/copy.c (copy_reg): Close dest_desc too, if getfscreatecon or fsetfilecon fail.
2007-11-26setuidgid.c: more cleanupJim Meyering
* src/setuidgid.c: Include "mgetgroups.h". (main): Don't presume there's a fixed limit on the maximum number of group IDs. Don't use NGROUPS; it's artificially low. Change the name of a local: s/gids_count/n_gids/. Remove non-portable "const": s/const int tmp =.../int tmp =.../
2007-11-25setuidgid: Update --help output.Jim Meyering
* src/setuidgid.c (usage): Describe -g GID[,GID1...] option. Mention that USER may be a numeric ID or a user name.
2007-11-24setuidgid: minor clean-up.Jim Meyering
* setuidgid.c: Include "xstrtoul.h". (main): Detect overflow in string-to-gid_t and -to-uid_t conversions. Improve diagnostics.
2007-11-24setuidgid.c: Normalize leading white space: no more TABsJim Meyering
2007-11-24setuidgid: accept numeric UID, and new option -g GID,GID1,GID2,...Lasse Collin
* src/setuidgid.c: Add functionality for the new test above.
2007-11-24"cp -p" tries to preserve GID even if preserving the UID fails.Lasse Collin
* NEWS: Mention this new feature. * src/copy.c (set_owner): Try to preserve just the GID, when initial fchown/lchown fails. * src/cp.c (re_protect): Likewise.
2007-11-23* src/runcon.c (main): Remove unused parameter, "envp".Jim Meyering
2007-11-22Quiet warnings about unused parameters.Jim Meyering
* src/copy.c (set_author) [!HAVE_STRUCT_STAT_ST_AUTHOR]: "Use" each of the parameters.
2007-11-22cp: by default, refuse to copy through a dangling destination symlinkJim Meyering
* NEWS: Mention this change. * doc/coreutils.texi (cp invocation): Describe the new behavior. * src/copy.c: No longer include "canonicalize.h". (copy_reg): Upon failure to open a dangling destination symlink, don't canonicalize the name, but rather fail (default) or, with POSIXLY_CORRECT, repeat the open call without O_EXCL (potentially dangerous). * src/copy.h (struct cp_options) [open_dangling_dest_symlink]: New member. Reorder the others, grouping "bool" and "enum" members together. * tests/cp/thru-dangling: Test for changed and new behavior. * src/cp.c (cp_option_init): Initialize new member. * src/install.c (cp_option_init): Likewise. * src/mv.c (cp_option_init): Likewise. Signed-off-by: Jim Meyering <meyering@redhat.com>
2007-11-21* src/c99-to-c89.diff: Adjust seq.c offsets.Jim Meyering
2007-11-21* src/seq.c (print_numbers): Rewrite in an attempt to avoid thePaul Eggert
more-general rounding issues exposed by the previous patch.
2007-11-18* src/c99-to-c89.diff: Adjust seq.c offsets.Jim Meyering
2007-11-18Remove unused parameter in remove.c.Jim Meyering
* src/remove.c (fd_to_subdirp): Remove unused parameter. (remove_cwd_entries, remove_dir): Update callers.
2007-11-17Correct preceding patch.Jim Meyering
* src/seq.c (print_numbers): Also handle first < last && step < 0. * tests/misc/seq [empty-rev]: New test for this case.
2007-11-17"seq .1 .1" would mistakenly generate no output on some systemsJim Meyering
* NEWS: Say this. * src/seq.c (print_numbers): Handle another floating point corner case. This avoids failure of seq's eq-wid-7 test on FreeBSD 6.1.
2007-11-16Port to Solaris 'make' and use a Posixish shell on Solaris.Jim Meyering
* bootstrap.conf (gnulib_modules): Add gnu-make, posix-shell. * build-aux/check.mk (SHELL): Set to $(PREFERABLY_POSIX_SHELL), so that commands can assume Posix syntax. (ENABLE_HARD_ERRORS, TEST_LOGS): Don't use GNU Make's "?=" syntax. (SH_E_WORKAROUND): New macro. (am__check_pre, $(TEST_SUITE_LOG)): Use it. (am__check_pre): Fail if "mkdir" fails. Use $(SHELL) rather than relying on the "#!/bin/sh" in the file, so that tests can use Posix syntax. (am__check_pre, am__tty_colors): Use $$src rather than $$<, to support the Posix-make $(TEST_LOGS) rule. (%.log: %.test, %.log: %$(EXEEXT)): Remove unused inference rules that rely on a GNU Make extension and cause Solaris 'make' to fail. (SUFFIXES): New macro, so that we can use Posix style inference rules. (%.log: %): Use this rule only if GNU_MAKE. Set $$src so that macros can use $$src rather than $$<. (CHECK-FORCE, DEPENDENCY, $(TEST_LOGS)): New macros and rules, which rely only on Posix 'make' semantics, and are used only with non-GNU 'make' implementations. $(TEST_LOGS) invokes 'make' recursively (and a bit inefficiently) to simulate the GNU 'make' rules. (.log.html): Renamed from "%.html: %.log", so that it relies only on Posix 'make' semantics. (check-clean, .PHONY): Do not depend on check-clean-local, since Solaris 'make' complains about nonexistent rules like that. * src/Makefile.am (SUFFIXES): Remove; no longer needed. (groups): Use a specific rule rather than an inference rule that is only instantiated once. The inference-rule approach does not work with Solaris 'make', which gets confused by the "groups: Makefile" line. It's not clear from the Posix spec that Solaris 'make' is buggy here, so instead of worrying about it, rewrite the makefile so that it clearly conforms to Posix. * tests/check.mk (TESTS_ENVIRONMENT): Export PACKAGE_BUGREPORT. GNU 'make' does this automatically for us, but Solaris 'make' doesn't. 2007-11-15 Paul Eggert <eggert@cs.ucla.edu>
2007-11-15Avoid misbehavior of a cross-device "mv" or "install".Jim Meyering
Those programs must not dereference a destination symlink. * src/copy.c (copy_reg): Don't treat a dangling destination symlink differently in move mode. In move mode, the only way the added O_EXCL can cause failure is when some other process has recreated the file this code unlinked a few instructions before.