summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2014-08-23maint: ensure fiemap extents flags are compared correctlyPádraig Brady
* src/extent-scan.c (extent_scan_read): Following on from the flags size adjustment in commit v8.23-13-g1505b37, verify that the internal representation of the flags is never truncated which could happen in the unlikely case on 32 bit if the kernel flags ever expanded to 64 bits which is theoretically possible given the reserved space.
2014-08-22maint: avoid int64_t and similar types unless they're neededPaul Eggert
C11 doesn't require them, even POSIX doesn't strictly require the 64-bit versions, and it makes the code a bit clearer if they're used only when needed. * src/copy.c (write_zeros, extent_copy): * src/extent-scan.h (struct extent_info.ext_length): Use off_t, not uint64_t, for a value derived from a file offset. * src/extent-scan.h (struct extent_info.ext_flags) Prefer plain unsigned int to uint32_t where either will do. (struct extent_scan.ei_count): Use size_t, not uint32_t, for a value bounded by SIZE_MAX. * src/factor.c (MAGIC64, MAGIC63, MAGIC65): Remove unnecessary casts to uint64_t.
2014-08-21maint: refactor ls QUOTING_STYLE env var handlingYurij Goncharuk
* src/ls.c (main): As per the FIXME comment, move the QUOTING_STYLE handling to a separate function.
2014-08-19df: improve mount point selection with inaccurate mount listPádraig Brady
v8.23 has a test failure on Fedora rawhide build servers in tests/df/skip-duplicate.sh. This was due to no '/' entry being output by df. That was due to an inaccurate /proc/mounts on the build environment as stat(/mnt/point) identified all these /proc/mounts entries as having the same device id: / rootfs / /dev/md1 /dev devtmpfs /run tmpfs /boot /dev/md0 /proc/filesystems /dev/md1 Since the device name on the right changes for a given id, that causes the entries to be continually replaced, thus resulting in no '/' entry. I'm guessing this is due to the mock environment bind mounting unneeded or sensitive items to a dummy file on the host / (/dev/md1) though have not looked into those details. So rather than relying on an accurate /proc/mounts, the attached patch takes a more conservative replacement approach and only swaps a new device entry when the mount point matches. That should handle all practical cases while also avoiding this situation. * src/df.c (filter_mount_list): Only replace entries with different device names when the mount point also matches.
2014-08-11cp: remove redundant possibly expensive heap deallocationRasmus Borup Hansen
If the hash structures grow sufficiently large so that the system is actively swapping, then the deallocation can take a significant amount of time. Details at: http://lists.gnu.org/archive/html/coreutils/2014-08/msg00012.html * src/cp.c (main): Only call hash deallocation routines when in lint checking mode. * THANKS.in: Remove as now in the git author list.
2014-08-04doc: indicate that FILE arguments are optional with rm -fReuben Thomas
* src/rm.c (usage): s/FILE/[FILE]/. Fixes http://bugs.gnu.org/18187
2014-08-03numfmt: fix misspelling in --debug messageAnders Jonsson
* src/numfmt.c (parse_format_string): s/overridding/overriding/. Fixes http://bugs.gnu.org/18050
2014-08-01chroot: perform chdir("/") again unless new --skip-chdir is specifiedBernhard Voelker
Since commit v8.22-94-g99960ee, chroot(1) skips the chroot(2) syscall for "/" arguments (and synonyms). The problem is that it also skips the following chdir("/") call in that case. The latter breaks existing scripts which expect "/" to be the working directory inside the chroot. While the first part of the change - i.e., skipping chroot("/") - is okay for consistency with systems where it might succeed for a non-root user, the second part might be malicious, e.g. cd /home/user && chroot '/' bin/foo In the "best" case, chroot(1) could not execute 'bin/foo' with ENOENT, but in the worst case, chroot(1) would execute '/home/user/bin/foo' in the case that exists - instead of '/bin/foo'. Revert that second part of the patch, i.e., perform the chdir("/) in the common case again - unless the new --skip-chdir option is specified. Restrict this new option to the case of "/" arguments. * src/chroot.c (SKIP_CHDIR): Add enum. (long_opts): Add entry for the new --skip-chdir option. (usage): Add --skip-chdir option, and while at it, move the other to options into alphabetical order. (main): Accept the above new option, allowing it only in the case when NEWROOT is the old "/". Move down the chdir() call after the if-clause to ensure it is run in any case - unless --skip-chdir is specified. Add a 'newroot' variable for the new root directory as it is used in a couple of places now. * tests/misc/chroot-fail.sh: Invert the last tests which check the working directory of the execvp()ed program when a "/"-like argument was passed: now expect it to be "/" - unless --skip-chdir is given. * doc/coreutils.texi (chroot invocation): Document the new option. Document that chroot(1) usually calls chdir("/") unless the new --skip-chdir option is specified. Sort options. * NEWS (Changes in behavior): Mention the fix. (New features): Mention the new option. * init.cfg (nonroot_has_perm_): Add chroot's new --skip-chdir option. * tests/cp/preserve-gid.sh (t1): Likewise. * tests/cp/special-bits.sh: Likewise. * tests/id/setgid.sh: Likewise. * tests/misc/truncate-owned-by-other.sh: Likewise. * tests/mv/sticky-to-xpart.sh: Likewise. * tests/rm/fail-2eperm.sh: Likewise. * tests/rm/no-give-up.sh: Likewise. * tests/touch/now-owned-by-other.sh: Likewise. Reported by Andreas Schwab in http://bugs.gnu.org/18062
2014-07-19maint: fix message translation glitchesPaul Eggert
Problem reported by Sebastian Rasmussen in: http://bugs.gnu.org/18054 * gl/lib/randread.c (randread_error): Don't put multiple string literals inside _(...), as xgettext doesn't support that. * src/chroot.c (main): In diagnostics, don't bother to distinguish between setting the number of supplemental group IDs to a zero or to a nonzero value, as the underlying system call is the same either way. This also makes the string easier to translate correctly.
2014-07-18build: don't distribute generated coreutils.hPádraig Brady
This issue was identified by the manifest comparisons done by `make distcheck` * src/local.mk (noinst_HEADERS): Remove coreutils.h from this always distributed list. (nodist_src_coreutils_SOURCES): Add coreutils.h as its contents are determined at configure time, so pointless to distribute. (src_coreutils_SOURCES): Define explicitly so that the corresponding nodist_ variable is honored. (DISTCLEANFILES): Add coreutils.h to this rather than CLEANFILES, as its contents are determined at configure time.
2014-07-16numfmt: fix isblank() usage for some unibyte localesAssaf Gordon
* src/numfmt.c (simple_strtod_int): Replace isdigit() with c_isdigit() to avoid locale concerns and -Wchar-subscripts warnings on cygwin. Remove the now redundant locale guard. (simple_strtod_human): Cast characters to unsigned so that the promoted int value passed to isblank() is positive, allowing it to work correctly for all characters in unibyte locales. Previously character 0xA0, i.e. non-breaking space, would be misclassified for example. (process_suffixed_number): Likewise. (skip_fields): Likewise. Both issues were triggered by the -Wchar-subscripts warning on GCC 4.8.3 on cygwin, due to the is*() implementations used there, but the issue is present on all platforms defaulting to signed chars. * NEWS: Mention the bug fix. Reported by Eric Blake
2014-07-14maint: avoid clang -Wint-to-pointer-cast warningPádraig Brady
* src/chroot.c: Explicitly cast int to pointer type.
2014-07-13sort: avoid undefined operation with destroying locked mutexPádraig Brady
This didn't seem to cause any invalid operation on GNU/Linux at least, but depending on the implementation, mutex deadlocks could occur. For example this might be the cause of lockups seen on Solaris: http://lists.gnu.org/archive/html/coreutils/2013-03/msg00048.html This was identified with valgrind 3.9.0 with this setup: seq 200000 > file.sort valgrind --tool=drd src/sort file.sort -o file.sort With that, valgrind would _intermittently_ report the following: Destroying locked mutex: mutex 0x5419548, recursion count 1, owner 2. at 0x4C2E3F0: pthread_mutex_destroy(in vgpreload_drd-amd64-linux.so) by 0x409FA2: sortlines (sort.c:3649) by 0x409E26: sortlines (sort.c:3621) by 0x40AA9E: sort (sort.c:3955) by 0x40C5D9: main (sort.c:4739) mutex 0x5419548 was first observed at: at 0x4C2DE82: pthread_mutex_init(in vgpreload_drd-amd64-linux.so) by 0x409266: init_node (sort.c:3276) by 0x4092F4: init_node (sort.c:3286) by 0x4090DD: merge_tree_init (sort.c:3234) by 0x40AA5A: sort (sort.c:3951) by 0x40C5D9: main (sort.c:4739) Thread 2: The object at address 0x5419548 is not a mutex. at 0x4C2F4A4: pthread_mutex_unlock(in vgpreload_drd-amd64-linux.so) by 0x4093CA: unlock_node (sort.c:3323) by 0x409C85: merge_loop (sort.c:3531) by 0x409F8F: sortlines (sort.c:3644) by 0x409CE3: sortlines_thread (sort.c:3574) by 0x4E44F32: start_thread (in /usr/lib64/libpthread-2.18.so) by 0x514EEAC: clone (in /usr/lib64/libc-2.18.so) * src/sort.c (sortlines): Move pthread_mutex_destroy() out to merge_tree_destroy(), so that we don't overlap mutex destruction with threads still operating on the nodes. (sort): Call the destructors only with "lint" defined, as the memory used will be deallocated implicitly at process end. * NEWS: Mention the bug fix.
2014-07-13sort: fix two threading issues reported by valgrindShayan Pooya
Neither issue impacts on the correct operation of sort. The issues were detected by both valgrind 3.8.1 and 3.9.0 using: seq 200000 > file.sort valgrind --tool=drd src/sort file.sort -o file.sort For tool usage and error details see: http://valgrind.org/docs/manual/drd-manual.html * src/sort.c (queue_insert): Unlock mutex _after_ signalling the associated condition variable. Valgrind flags this with: "Probably a race condition: condition variable 0xffeffffb0 has been signaled but the associated mutex 0xffeffff88 is not locked by the signalling thread." The explanation at the above URL is: "Sending a signal to a condition variable while no lock is held on the mutex associated with the condition variable. This is a common programming error which can cause subtle race conditions and unpredictable behavior." This should at least give more defined scheduling behavior. (merge_tree_destroy): Make symmetrical with merge_tree_init() thus destroying the correct mutex. Valgrind flags this with: "The object at address 0x5476cf8 is not a mutex."
2014-07-13maint: avoid an inconsequential mem leakPádraig Brady
* src/df.c (get_disk): Avoid an inconsequential mem leak spotted by coverity. Also s/duplicities/duplicates/.
2014-07-13build: support building all tools in a single binaryAlex Deymo
Add the --enable-single-binary option to the configure file. When enabled, this option builds a single binary file containing the selected tools. Which tool gets executed depends on the value of argv[0] which can be set implicitly through symlinks to the single program. This setup reduces significantly the size of a complete coreutils install, since code from lib/libcoreutils.a is not duplicated in every one of the more than 100 binaries. Runtime overhead is increased due to more dynamic libraries being loaded, and extra initialization being performed for all utils. Also initially a larger binary is loaded from storage, though this is usually alleviated due to caching and lazy mmaping of unused blocks, and in fact the single binary should have better caching characteristics. Comparing the size of the individual versus single binary on x86_64: $ cd src $ size coreutils $ size -t $(../build-aux/gen-lists-of-programs.sh --list-progs | grep -Ev '(coreutils|libstdbuf)') | tail -n1 text data bss dec hex filename 1097416 5388 88432 1191236 122d44 src/coreutils 4901010 124964 163768 5189742 4f306e (TOTALS) Storage requirements are reduced similarly: $ cd src $ du -h coreutils $ du -ch $(../build-aux/gen-lists-of-programs.sh --list-progs | grep -Ev '(coreutils|libstdbuf)') | tail -n1 1.2M coreutils 5.3M total When installing, the makefile will create either symlinks or shebangs based on the --enable-single-binary setting, for each configured tool. In this way, all the tools are still callable individually, but they are all implemented by the same "coreutils" binary installed on the same directory. * .gitignore: Add new generated files. * Makefile.am: New rules to generate build-aux/gen-single-binary.sh and install symlinks. * NEWS: Mention the new feature. * README: Add "coreutils" to the list of utils. * bootstrap.conf: Regenerate src/single-binary.mk * build-aux/gen-lists-of-programs.sh: New --list-progs option. * build-aux/gen-single-binary.sh: Regenerate * configure.ac: New --enable-single-binary option and other variables. Disallow --enable-single-binary=symlinks with --program-prefix et. al. * man/coreutils.x: Manpage hook. * man/local.mk: Add manpage hook and fix dependencies. * src/coreutils.c: Multicall implementation. * src/local.mk: New rules for the single binary option. * tests/local.mk: Add $single_binary_progs to support require_built_() from init.cfg * tests/misc/env.sh: Avoid the use of symlink to echo. * tests/misc/help-version.sh: Add exception for coreutils. * tests/install/basic-1.sh: Really avoid using ginstall strip functionality if there is an issue with the independent strip command. * src/kill.c: Changes to call exit() in main. * src/readlink.c: Likewise. * src/shuf.c: Likewise. * src/timeout.c: Likewise. * src/truncate.c: Likewise.
2014-07-04maint: simplify parsing df's output in shell scriptsBernhard Voelker
Avoid complicated and error-prone parsing of df's output via sed(1), cut(1), etc., and instead use df's more modern --output option. * src/ioblksize.h (in a comment): Simplify the extraction of the device name of the mounted file system from df's output. * tests/dd/skip-seek-past-dev.sh: Likewise. * tests/du/2g.sh: Likewise for the 'avail' column here. Also avoid the deprecated use of "tail -NUM". * tests/misc/stat-mount.sh: While at it, remove the determination of the mount point of "." via df(1) plus sed(1) as it is unused since commit v8.5-159-gf57cb37 anyway. Instead, improve this test by verifying that the output of "stat -c%m ." at least starts with a slash '/'.
2014-07-02pwd: revert default mode back to -PPádraig Brady
Revert commit v8.22-131-g3e89d5b as even though POSIX states that the default mode should be -L, common practice for stand-alone pwd implementations is to default to -P. * src/pwd.c (usage): Retain mention of the default mode of operation. Suggested by Bob Proulx
2014-07-02maint: fix context_t init warning on systems without selinuxAlex Deymo
On systems without libselinux, context_t is defined as an int type, but defined as a pointer type by SELinux. * src/chcon.c: Init with 0 rather than NULL to avoid warning.
2014-07-01maint: fix const correctness warnings with security_context_tPádraig Brady
The security_context_t type was always an artificial separation from a standard char* string, and various libselinux using code assumed both were synonymous. In addition, prior to libselinux 2.3 function declarations were incorrect wrt constness of this type. Here we replace security_context_t with char*, and also provide a wrapper function to cater for the const issue on older libselinux. * src/system.h (se_const): A new function to avoid and identify the const issue on older libselinux. * src/copy.c: s/security_context_t/char */. * src/cp.c: Likewise. * src/id.c: Likewise. * src/install.c: Likewise. * src/ls.c: Likewise. * src/mkdir.c: Likewise. * src/mkfifo.c: Likewise. * src/mknod.c: Likewise. * src/runcon.c: Likewise. * src/selinux.c: Likewise. * tests/cp/no-ctx.sh: Likewise. * src/chcon.c: Likesize.
2014-07-01chcon: avoid redundant context allocationsNamhyung Kim
Since context is verified by security_check_context() it can be used in change_file_context() without converting to context_t every time. * src/chcon.c (change_file_context): Use specified_context directly.
2014-07-01chcon: use security_check_context() for context validationNamhyung Kim
context_new() and _free() are used for checking validity of a specified context. libselinux provides security_check_context for this purpose so use it. Note that context_new() can fail for a valid context - e.g. ENOMEM. * src/chcon.c (main): Use security_check_context().
2014-06-30pwd: assume -L mode by default, as per POSIXPádraig Brady
* src/pwd.c (main): Adjust default mode to be "logical" and independent of the POSIXLY_CORRECT env var. (usage): Mention the default mode of operation. * doc/coreutils.texi (pwd invocation): Adjust accordingly. * tests/misc/pwd-option.sh: Likewise. * NEWS: Mention the change in behavior.
2014-06-26id: output the effective group for the processPetr Stodůlka
* src/id.c (print_full_info): When no user is specified, output the effective group for the _process_, rather than the default group from the system database, which may be different. * tests/id/setgid.sh: Add a case for `id` as well as `id -G`. * NEWS: Mention the bug fix. Fixes http://bugs.gnu.org/7320 Reported at http://bugzilla.redhat.com/1016163
2014-06-25df: report correct device in presence of eclipsed mountsPádraig Brady
* src/df.c (last_device_for_mount): A new function to identify the last device mounted for a mount point. (get_disk): Use the above to discard mount entries for a device, where a later mount entry uses a different device name than that of the user specified device. * tests/df/over-mount-device.sh: A new root test. * tests/local.mk: Reference the new test. * NEWS: Reword for all these related recent fixes. Discussed at: http://bugs.gnu.org/16539#69
2014-06-24df: look for accessible mount points for specified devicesPádraig Brady
* src/df.c (get_disk): Include whether we can access the mount dir, in the mount entry selection criteria. This handles the case where a device is (bind) mounted multiple times with the shortest mount path not being accessible, while some of the other mount points are. Discussed at: http://bugs.gnu.org/16539#63
2014-06-24df: output placeholder values for inaccessible mount pointsPádraig Brady
A system provided mount entry may be unavailable due to TOCTOU race, or if another device has been over-mounted at that position, or due to access permissions. In all these cases output "-" placeholder values rather than either producing an error, or in the over-mount case outputting values for the wrong device. * src/df.c (device_list): A new global list now updated by filter_mount_list(). (filter_mount_list): Adjust to take a parameter as to whether update the global mount list, or only the mount <-> device ID mapping. (get_dev): Use the device ID mapping to ensure we're not outputting stats for the wrong device. Also output placeholder values when we can't access a system specified mount point. (get_all_entries): Set the DEVICE_ONLY param for filter_mount_list(). (devname_for_dev): A new function to search the mount <-> dev mapping. * test/df/skip-duplicates.sh: Adjust accordingly. * NEWS: Mention the bug fixes. Discussed at: http://bugs.gnu.org/16539
2014-06-24du: ignore directory cycles due to bind mountsPádraig Brady
* src/du.c (process_file): Treat cycles due to bind mounts like cycles due to following symlinks. * tests/du/bind-mount-dir-cycle.sh: Adjust accordingly. * NEWS: Mention the change in behavior. Reported at http://bugzilla.redhat.com/836557
2014-06-24doc: state in ls --help, that -h affects --size formatPádraig Brady
* src/ls.c (usage): State that --human changes --size format. Fixes http://bugs.gnu.org/17838
2014-06-18df: use all of the last device details providedPádraig Brady
* src/df.c (filter_mount_list): Recent commit v8.22-108-g25a2c94 failed to copy file system type along with the updated device name. Therefore simply replace the existing mount entry with the current one with all the latest device details. Note the name, even if not shorter in this entry, will be replaced with a shorter name in a subsequent mount entry. * tests/df/skip-duplicates.sh: Add a test case.
2014-06-18seq: fix incorrect output with start or end of -0Pádraig Brady
* src/seq.c (main): Avoid seq_fast() with a start or end of -0. * tests/misc/seq.pl: Add test cases. * NEWS: Mention the fix. Fixes http://bugs.gnu.org/17800
2014-06-13tail: fix --follow to use polling mode for VXFSPádraig Brady
Veritas File System can run in single instance or clustered mode, so mark as remote to avoid using inotify for the latter case. * src/stat.c (human_fstype): Tag VXFS as remote, to use polling for the clustered variant (VXCFS). * NEWS: Mention the bug fix. Reported by Ondřej Vašík in http://bugzilla.redhat.com/1104244 Fixes http://bugs.gnu.org/17770
2014-06-12maint: suppress a theoretical buffer overflow warningPádraig Brady
* src/numfmt.c (double_to_human): The printf format is built up in a stack buffer which is big enough to hold any of the possible formats. However the size parameter passed to snprintf was too big by 1 when GROUP was true. So decrease the buffer available to snprintf to avoid this theoretical in practise but valid coverity warning.
2014-06-11install: allow options -D and -t to be used togetherBernhard Voelker
* src/install.c (install_file_in_file_parents): Factor out the creation of any parent directories into ... (mkancesdirs_safe_wd): ... this new function. (install_file_in_dir): Add the parameter 'mkdir_and_install', and call the above new function if it evaluates to true. (main): During parsing of the -t option, move the check whether the target_directory exists down after the option parsing loop, and do not complain about stat(optarg,...) failing if -D was given. Pass 'mkdir_and_install' to install_file_in_dir(). * doc/coreutils.texi (install invocation): Remove the (false) restriction that -D would be ignored together with -t. Instead, clarify install's new bahavior. Fix the node's reference in the top-level @direntry for consistency. * src/install/basic-1.sh: Add tests for the now-allowed combination of the -D and -t options. * NEWS: Mention the improvement.
2014-06-03tests: consolidate tests for true and falsePádraig Brady
* src/true.c (main): Add a comment about the possibility of true returning EXIT_FAILURE due to write failure. * tests/misc/false-status.sh: Fix so we're testing the tool and not the shell builtin. Add a case for true(1). * tests/misc/help-version.sh: Skip /dev/full test for true as well as false since the exit status is tested separately. Also remove the iterations for different LC_MESSAGES, as this was only applied for false(1). Translations are not honored in the test dir and so would need separate handling in any case.
2014-06-02maint: avoid compiler warnings with some assert() implementationsBen Walton
* src/df.c (get_dev): asssert() on Solaris 10 is not marked as __noreturn__ and thus the compiler may think V is uninitialized later on in the function. * THANKS.in: Remove the now committer.
2014-06-01cut: restore special case handling of -f with -d$'\n'Pádraig Brady
commits v8.20-98-g51ce0bf and v8.20-99-gd302aed changed cut(1) to process each line independently and thus promptly output each line without buffering. As part of those changes we removed the special handling of --delimiter=$'\n' --fields=... which could be used to select arbitrary (ranges of) lines, so as to simplify and optimize the implementation while also matching the behavior of different cut(1) implementations. However that GNU behavior was in place for a long time, and could be useful in certain cases like making a separated list like `seq 10 | cut -f1- -d$'\n' --output-delimiter=,` although other tools like head(1) and paste(1) are more suited to this operation. This patch reinstates that functionality but restricts the "line behind" buffering behavior to only the -d$'\n' case. We also fix the following related edge case to be more consistent: before> printf "\n" | cut -s -d$'\n' -f1- | wc -l 2 before> printf "\n" | cut -d$'\n' -f1- | wc -l 1 after > printf "\n" | cut -s -d$'\n' -f1- | wc -l 1 after > printf "\n" | cut -d$'\n' -f1- | wc -l 1 * src/cut.c (cut_fields): Adjust as discussed above. * tests/misc/cut.pl: Likewise. * NEWS: Mention the change in behavior both for v8.21 and this effective revert. * cfg.mk (old_NEWS_hash): Adjust for originally omitted v8.21 entry. * src/paste.c: s/delimeter/delimiter/ comment typo fix.
2014-06-01stat: avoid redundant stat() callsPádraig Brady
* src/stat.c (find_bind_mount): NAME is invariant in the loop, so only stat(NAME) outside the loop.
2014-05-29df: use the last device name provided by the systemPádraig Brady
The device name reported for a particular mount entry may no longer be valid if the mount point was subsequently mounted on a different device. Therefore honor the order of the mount list returned by the system and use the last reported device name. * src/df.c (filter_mount_list): When discarding the current mount entry, ensure that a new device name is not also discarded. * tests/df/skip-duplicates.sh: Add a test case. Also fix a false failure in the edge case of a system with only a single file system. * NEWS: Mention the fix.
2014-05-26stdbuf: support OS XPádraig Brady
* src/stdbuf.c (set_LD_PRELOAD): Adjust to use Mac OS X specific environment variables on __APPLE__ platforms. Fixes http://bugs.gnu.org/17590
2014-05-26build: uname: avoid shadowing warningJim Meyering
* src/uname.c (main) [__APPLE__]: Rename inner "s" to "cs", to avoid gcc shadowing warning.
2014-05-26doc: clarify --zero-terminated optionPádraig Brady
* src/join.c (usage): Reword to avoid implication that the NUL byte is only generated as the output delimeter. * src/sort.c (usage): Likewise. * src/shuf.c (usage): Likewise. Also since we're changing the translation string take the opportunity to separate out the description to a separate string to reduce translation overhead. * src/uniq.c (usage): Likewise. * src/stty.c (usage): s/null/NUL/ for consistency. * src/basename.c (usage): Reword for accuracy/consistency. * src/dirname.c (usage): Likewise. * src/du.c (usage): Likewise. * src/env.c (usage): Likewise. * src/printenv.c (usage): Likewise. * src/readlink.c (usage): Likewise. * src/realpath.c (usage): Likewise. * doc/coreutils.texi: Consolidate/share the descriptions of --null, --zero and --zero-terminated.
2014-05-25build: libstdbuf.so: avoid new OS X link failureJim Meyering
* src/local.mk (src_libstdbuf_so_LDADD): Add $(LIBINTL), to avoid link failure on OS X.
2014-05-25cat,cp,split: use a larger buffer for copyingJim Meyering
* src/ioblksize.h (IO_BUFSIZE): Double the size, to 128KB. Add four more columns to the blksize-vs-bandwidth table
2014-05-23stat,tail: improve support for LogFS and ConfigFSPádraig Brady
* src/stat.c (human_fstype): Add new file system ID definitions. * NEWS: Mention the improvement.
2014-05-22maint: enforce consistent width and case of file system constantsPádraig Brady
* src/stat.c (human_fstype): Adjust a couple of existing constants to be a consistent width and capitalization so that the src/fs-magic-compare target works without reporting false positives. * cfg.mk (sc_fs-magic-compare): A new syntax check to enforce this. Improved by: Jim Meyering
2014-05-21stdbuf: support compilers other than __GNUC__Pádraig Brady
__SUNPRO_C >= 0x590 /*12.0*/ supports __attribute((constructor)) required by stdbuf, so use a more direct check for this. Note ensure that --libexecdir is set to the appropriate install location for libstdbuf.so so that stdbuf works when installed on the system like it does when running tests in the build directory. * configure.ac (stdbuf_supported): Use a test prog to determine support. * src/libstdbuf.c (stdbuf): Define appropriately for non GCC compilers, and provide early feedback (compilation warning) if trying to compile libstdbuf without the necessary support. * src/stdbuf.c (set_LD_PRELOAD): Add a note on having stdbuf look for libstdbuf.so in the default lib search path. * cfg.mk (sc_prohibit-gl-attributes): Adjust so we can exclude libstdbuf.so from prohibiting '__attribute', since we want this form to avoid silently eliding this required attribute on non GCC. Reported and tested by Rich Burridge.
2014-05-21tests: use chroot --user rather than internal setuidgid toolPádraig Brady
* init.cfg (require_root_): Adjust to use chroot, and make `require_built_ chroot` implicit when chroot used in the test. * po/POTFILES.in: Remove reference to setuidgid tool. * src/.gitignore: Likewise. * src/local.mk: Likewise. * src/setuidgid.c: Remove. * tests/cp/preserve-gid.sh: s/setuidgid/chroot --user/. * tests/cp/special-bits.sh: Likewise. * tests/id/setgid.sh: Likewise. * tests/misc/truncate-owned-by-other.sh * tests/mv/sticky-to-xpart.sh: Likewise. * tests/rm/fail-2eperm.sh: Likewise. * tests/rm/no-give-up.sh: Likewise. * tests/touch/now-owned-by-other.sh: Likewise. * tests/misc/chroot-fail.sh: Skip if chroot not built.
2014-05-21chroot: make changing root check more robustPádraig Brady
* src/chroot.c (is_root): A new helper function to determine if the passed argument is the root directory based on inode comparison. (main): Use the new helper rather than comparing strings. * tests/misc/chroot-fail.sh: Add cases for alternative root paths.
2014-05-21chroot: exit immediately upon failurePádraig Brady
* src/chroot.c (main): Consistently exit with failure status immediately upon hitting a terminal issue, rather than diagnosing multiple issues lest users think previous failing actions are optional.