summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* sort: update commentHEADmasterPaul Eggert2017-03-301-4/+4
| | | | * src/sort.c: Update identifiers in comment.
* doc: clarify in dd man page that bs= overrides [io]bs=Chris Davies2017-03-301-1/+2
| | | | | * src/dd.c (usage): Add the extra info. Reported in https://bugs.debian.org/859021
* tests: avoid false ulimit failure on some systemsLudovic Courtès2017-03-281-2/+1
| | | | | | | | * tests/misc/cut-huge-range.sh: On some systems returns_ may use more memory, so incorporate that in the determination of the ulimit value to use. Noticed on ARMv7 with bash-4.4.12, and x86_64 with bash-4.2.37. Fixes http://bugs.gnu.org/26253
* maint: avoid syntax check failure with wrapped returns_Pádraig Brady2017-03-281-0/+1
| | | | | | * cfg.mk (sc_prohibit_env_returns): Allow wrapped calls to return_ of the form: `wrapper_ returns_ ...` which is needed with the following commit.
* split: add new --hex-suffixes optionMichael Heimpold2017-03-284-42/+48
| | | | | | | | | * doc/coreutils.texi (split invocation): Document the new option. * src/split.c (usage): Likewise. (main): Process the new option much like --numeric-suffixes, but with an adjusted alphabet. * tests/split/numeric.sh: Refactor to support --hex mode. * NEWS: Mention the new feature.
* md5sum,b2sum,sha*sum: don't erroneously trigger BSD reversed modePádraig Brady2017-03-283-18/+32
| | | | | | | | | * src/md5sum.c (split_3): Verify hex digits internally before triggering the global bsd_reversed mode flag. (bsd_split_3): Likewise. * tests/misc/md5sum-bsd.sh: Add a test case. * NEWS: Mention the bug fix. Fixes http://bugs.gnu.org/26263
* df: avoid querying excluded file systemsPhilipp Thomas2017-03-272-1/+7
| | | | | | | * src/df.c (filter_mount_list): Avoid stat() on explicitly excluded file systems, which is especially significant in cases like `-x nfs` which may hang. * NEWS: Mention the bug fix.
* maint: avoid a static analysis warning in expand-commonPádraig Brady2017-03-261-0/+2
| | | | | | | * src/expand-common.c (next_file): We're dependent on calling this function with NULL to initialize things appropriately. So enforce this with assert(), which avoids a warning from clang-anaylzer.
* split: process more efficiently when filters exit earlyPádraig Brady2017-03-262-25/+45
| | | | | | | | | * src/split.c (bytes_split): Don't write to an existing filter if it has exited. When filters exit early, skip input data if possible. Refactor out 2 redundant variables. * tests/split/filter.sh: Improve test coverage given the new more efficient processing. Also use a 10TB file to expand the file systems tested on.
* split: ensure input is processed when filters exit earlyPádraig Brady2017-03-263-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit v8.25-4-g62e7af0 introduced the issue as it broke out of the processing loop irrespective of the value of new_file_flag which was used to indicate a finite number of filters or not. For example, this ran forever (as it should): $ yes | split --filter="head -c1 >/dev/null" -b 1000 However this exited immediately due to EPIPE being propagated back through cwrite and the loop not considering new filters: $ yes | split --filter="head -c1 >/dev/null" -b 100000 Similarly processing would exit early for a bounded number of output files, resulting in empty data sent to all but the first: $ truncate -s10T big.in $ split --filter='head -c1 >$FILE' -n 2 big.in $ echo $(stat -c%s x??) 1 0 I was alerted to this code by clang-analyzer, which indicated dead assigments, which is often an indication of code that hasn't considered all cases. * src/split.c (bytes_split): Change the last condition in the processing loop to also consider the number of files before breaking out of the processing loop. * tests/split/filter.sh: Add a test case. * NEWS: Mention the bug fix.
* tests: avoid a false failure on OS X 10.5.8Pádraig Brady2017-03-111-6/+6
| | | | | | | | * tests/misc/sort-debug-keys.sh: Disparate LC_CTYPE and LC_MESSAGES are not supported, with the result LC_MESSAGES=C is used throughout. Therefore just set LC_ALL in the test, and normalize the message variants with sed. Reported and tested by J Rogowsky.
* build: fix missing renameat() on OS X 10.5.8Pádraig Brady2017-03-111-0/+1
| | | | | | * bootstrap.conf: Depend on renameat. Reported and tested by J Rogowsky. Fixes http://bugs.gnu.org/26044
* tests: port to tzdb-2017aPaul Eggert2017-03-101-4/+5
| | | | | | | Problem reported by Bernhard Voelker in: http://lists.gnu.org/archive/html/coreutils/2017-03/msg00026.html * tests/misc/date-debug.sh: Port test to tzdb 2017a, and future-proof the America/Belize test.
* build: for factor use C in more cases for arm64 and ppc64Pádraig Brady2017-03-091-13/+60
| | | | | * src/longlong.h: Sync from gmp repo incorporating: Use asm-free umul_ppmm() on arm64 and ppc64.
* doc: rearrange a recent bug entry to an improvement in NEWSPádraig Brady2017-03-092-5/+5
| | | | | * NEWS: The stat,tail change was an improvement, not a bug fix. * cfg.mk [old_NEWS_hash]: update with `make update-NEWS-hash`.
* maint: post-release administriviaPádraig Brady2017-03-093-2/+5
| | | | | | * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.
* version 8.27Pádraig Brady2017-03-091-1/+1
| | | | * NEWS: Record release date.
* build: update gnulib submodule to latestPádraig Brady2017-03-091-0/+0
| | | | Removes extraneous parse-datetime.c generated during build
* stat,tail: support "RDT" Linux kernel control file systemPádraig Brady2017-03-092-0/+6
| | | | | * src/stat.c (human_fstype): This file system is the user interface for resource allocation in Intel's Resource Director Technology.
* doc: spelling fix for recent doc additionPádraig Brady2017-03-091-1/+1
| | | | * doc/coreutils.texi (join invocation): s/preceeding/preceding/.
* build: avoid redundant build of tr with --enable-single-binaryBernhard Voelker2017-03-081-1/+1
| | | | | | | * src/local.mk [check-duplicate-no-install]: Depend on the single-binary tr, or the system tr, as the edge case where these are not available only result in the sanity check being effectively ignored.
* build: fix 'install-html' targetAssaf Gordon2017-03-081-0/+7
| | | | | | | | | | | | Switching to non-recursive makefiles broke the 'install-html' target: The gettext plumbing requires an 'install-html' target in po/Makefile. This was fixed in gettext v0.19.8.1-41-ge5a008a, but packages using older gettext need to manually patch po/Makefile.in.in. Reported (for 'sed') and suggested fix by Eric Blake in https://bugs.gnu.org/25690 . * bootstrap.conf (bootstrap_epilogue): Add 'install-{html,pdf,dvi,ps}' targets to po/Makefile.in.in (if needed).
* maint: bump makeinfo --version requirement to 6.1Pádraig Brady2017-03-041-1/+1
| | | | | | | * bootstrap.conf: s/4.13/6.1/ as versions previous to that generated invalid html with interspersed <span> tags that were visible to the user. Version 6.1 is available for a year now, and is available in most distros.
* doc: avoid makeinfo warningBernhard Voelker2017-03-041-1/+1
| | | | | | | | | | makeinfo issues the following: doc/coreutils.texi:6568: warning: @sc argument all uppercase,\ thus no effect. * doc/coreutils.texi (join invocation): Remove the @sc macro around the all uppercase "GNU".
* build: update gnulib submodule to latestPádraig Brady2017-03-031-0/+0
| | | | Fixes a test-lock failure on MacOS
* timeout: handle multiple children on solarisPádraig Brady2017-03-031-1/+13
| | | | | | | | | * src/timeout.c (install_sigchld): A new function to install the SIGCHLD handler using sigaction() rather than signal(), because with the latter on solaris the signal handler is reset to default and thus sigsuspend() only returns for the first finished child. Reported by Assaf Gordon.
* tests: avoid a spurious failure on older debianPádraig Brady2017-03-031-0/+1
| | | | | | | * tests/misc/cut-huge-range.sh: Bump up the ulimit, to avoid a false failure due hitting the previously detected ulimit. Reported by Assaf Gordon.
* build: fix libstdbuf build on AIX 7Pádraig Brady2017-03-031-0/+5
| | | | | | | * src/libstdbuf.c: undef malloc so as libstdbuf is not linked with gnulib, and anyway the replacement is never needed since we never malloc(0). Reported by Assaf Gordon.
* doc: expand 'join' info sectionAssaf Gordon2017-03-021-35/+389
| | | | | | * doc/coreutils.texi (join invocation): Expand section to add examples and more details. Suggested by Dan Jacobson in https://bugs.gnu.org/25870
* doc: give a stronger security warning in md5/sha1 man pagesPádraig Brady2017-03-012-4/+4
| | | | | | | * man/md5sum.x: Give a more direct warning againt the use of this hash algorithm for security purposes. * man/sha1sum.x: Likewise. Suggested by Jim Meyering.
* expand: avoid an extraneous warning on 32 bitPádraig Brady2017-03-011-3/+2
| | | | | | * src/expand-common (parse-tab-stops): Exit earlier upon overflow so another warning isn't issued (on 32 bit) in add_tab_stop(). Flagged in https://hydra.nixos.org/build/49499970
* doc: indicate sha1 has the same limitations as md5Pádraig Brady2017-03-013-11/+15
| | | | | | | | | * doc/coreutils.texi (sha1sum invocation): Given that a SHA-1 preimage attack has occurred as documented at http://shattered.io/, document sha1sum as having the same limitations as md5sum. (md5sum): Parameterize the warning for use in both cases. * man/md5sum.x: Mention b2sum(1) as a more secure alternative. * man/sha1sum.x: Give the same warning as done for md5sum(1).
* maint: avoid a -Werror=null-dereference with GCC-6.3.1Pádraig Brady2017-03-011-0/+2
| | | | | * src/stty.c (sane_mode): Assert to inform the compiler we know the pointer will be valid.
* expand,unexpand: support specifying a trailing tab sizePádraig Brady2017-03-014-13/+99
| | | | | | | | | | | | | | | | | | | * doc/coreutils.texi (expand invocation): Document the feature. (unexpand invocation): Likewise. * src/expand-common.c (extend_size): A new global to use when the last tab stop is prefixed by '/'. (set_extend_size): A new function to validate and set the new extend_size global. (parse_tab_stops): Call set_extend_size() for '/' prefixes. (finalize_tab_stops): Ensure a single specified '/' is treated like a standard tabsize, but also ensure that when '/' is specified with a single other entry that we process as a list rather than a tab size. (get_next_tab_stop): Use the tab size if set, for items after the user specified tab position list. * tests/misc/expand.pl: Add test cases * NEWS: Mention the new feature. Fixes http://bugs.gnu.org/25540
* nproc: support OMP_THREAD_LIMIT to set a max valuePádraig Brady2017-02-264-9/+73
| | | | | | | | | | | | | | | | | This comes from the latest gnulib. Also handling of OMP_NUM_THREADS has been adjusted to support comma separated values indicating a nesting level, in which case the first value is taken. Also OMP_NUM_THREADS=0 is now ignored instead of being treated as 1, to match the behavior of libgomp. * NEWS: Mention the OMP_THREAD_LIMIT improvement, and OMP_NUM_THREADS now handling nested values. * doc/coreutils.texi (nproc invocation): Describe OMP_THREAD_LIMIT as a way to set the max value, with OMP_THREAD_LIMIT setting the min. * tests/misc/nproc-override.sh: A new test to exercise the updated gnulib code with all combinations of these OMP variables. * tests/local.mk: Reference the new test.
* build: update gnulib submodule to latestPádraig Brady2017-02-261-0/+0
|
* doc: add NEWS for an improvement to dd in the last releasePádraig Brady2017-02-232-1/+5
| | | | | | * NEWS: Mention the avoidance of the gotcha with specifying a hex constant like count=0x1000 etc. as that previously was silently interpreted as 0.
* cp: set SELinux context for --parents directoriesPádraig Brady2017-02-235-4/+55
| | | | | | | | | | | * src/copy.c (set_process_security_ctx, set_file_security_ctx): Export for use in cp.c. * src/copy.h: Likewise. * src/cp.c (make_dir_parents_private): Call the exported functions to set the security context for new and updated directories. * tests/cp/cp-a-selinux.sh: Add a test case. Fixes http://bugs.gnu.org/25378
* maint: tweaks so syntax tests pass for previous commitPádraig Brady2017-02-182-2/+1
| | | | | * .gitignore: placate sc_gitignore_redundant. * po/POTFILES.in: placate sc_po_check.
* doc: avoid makeinfo warningBernhard Voelker2017-02-161-1/+1
| | | | | | | | | | Commit v8.26-38-g99deaff introduced this warning: MAKEINFO doc/coreutils.info ./doc/coreutils.texi:10268: \ warning: `.' or `,' must follow @xref, not `@'. * doc/coreutils.texi (readlink invocation): Add '.' after @xref macro.
* maint: xsetmode renamed to xbinary-ioPaul Eggert2017-02-1614-35/+35
| | | | | | | | * bootstrap.conf, src/base64.c, src/cat.c, src/cksum.c: * src/head.c, src/md5sum.c, src/od.c, src/split.c, src/sum.c: * src/tac.c, src/tail.c, src/tee.c, src/tr.c, src/wc.c: Adjust to renaming of the xsetmode module to xbinary-io, and of the xsetmode function to xset_binary_mode.
* build: update gnulib submodule to latestPaul Eggert2017-02-161-0/+0
|
* maint: use xsetmode, not xfreopenPaul Eggert2017-02-1514-58/+38
| | | | | | | | | | | | | | | | | | | | | | | This fixes a bug noted by Eric Blake. Code was using xfreopen to change files to binary mode, but this fails for stdout when in append mode. Such code should use xsetmode instead. This affects only the port on platforms like MS-Windows which distiguish text from binary I/O. * bootstrap.conf (gnulib_modules): Remove xfreopen and add xsetmode. Sort. * src/base64.c (main): * src/cat.c (main): * src/cksum.c (cksum): * src/head.c (head_file, main): * src/md5sum.c (digest_file): * src/od.c (open_next_file): * src/split.c (main): * src/sum.c (bsd_sum_file, sysv_sum_file): * src/tac.c (tac_file, main): * src/tail.c (tail_file): * src/tee.c (tee_files): * src/tr.c (main): * src/wc.c (wc_file): Use xsetmode, not xfreopen.
* build: update gnulib submodule to latestPaul Eggert2017-02-151-0/+0
|
* maint: tweaks so syntax tests pass for previous commitPádraig Brady2017-02-132-9/+3
| | | | | | * src/force-link.h: Don't include headers already included by system.h * src/force-link.c: Likewise. Also include system.h and explicitly mark extern functions as such.
* ln: replace destination links more atomicallyPaul Eggert2017-02-1210-94/+268
| | | | | | | | | | | | | | | | | | | | | | | If the file B already exists, commands like 'ln -f A B' and 'cp -fl A B' no longer remove B before creating the new link. Instead, they arrange for the new link to replace B atomically. This should fix a race condition reported by Mike Crowe (Bug#25680). * NEWS, doc/coreutils.texi (cp invocation, ln invocation): Document this. * bootstrap.conf (gnulib_modules): Add symlinkat. * src/copy.c, src/ln.c: Include force-link.h. * src/copy.c (same_file_ok): It's also OK to remove a destination symlink when creating symbolic links, or when the source and destination are on the same file system and when creating hard links. * src/copy.c (create_hard_link, copy_internal): * src/ln.c (do_link): Rewrite using force_linkat and force_symlinkat, to close a window where the destination temporarily does not exist. * src/cp.c (main): Do not set x.unlink_dest_before_opening merely because we are in link-creation mode. * src/force-link.c, src/force-link.h: New files. * src/local.mk (copy_sources, src_ln_SOURCES): Add them. * tests/cp/same-file.sh: Adjust test case to match fixed behavior.
* timeout: fix race possibly terminating wrong processTobias Stoeckmann2017-02-104-24/+62
| | | | | | | | | | | | | | | | | | | | | | | The race is unlikely, as timeout(1) needs to receive a signal in the few operations between waitpid() returning and exit(). Also the system needs to have reallocated the just released pid in this time window. Previously we never disabled the signal handler that sent the termination signal to the "child" pid. However once waitpid() has reaped the child, the system is free to allocate that pid, so we must ensure we don't process any further signals. * build-aux/gen-lists-of-programs.sh: Build timeout(1) optionally... * configure.ac: ...predicated on sigsuspend() being available. * src/timeout.c (block_cleanup): A new function to ensure the cleanup() handler is disabled after waitpid has returned. (main): Use sigsuspend() to wait with cleanup() enabled but disabled once it returns, and thus disabled for the waitpid() call. (monitored_pid): Change to the more accurate pid_t. * NEWS: Mention the fix. Fixes http://bugs.gnu.org/25624
* doc: note the relationship between realpath and readlinkPádraig Brady2017-02-102-1/+9
| | | | | | | * doc/coreutils.texi (realpath invocation): Mention that realpath is the preferred command for canonicalization. (readlink invocation): Likewise. * man/readlink.x: Likewise.
* tail: fix output of redundant headers when resumingJanne Snabb2017-02-084-16/+109
| | | | | | | | | | | | * src/tail.c (check_fspec): Only enable printing of the file header if we've actually read some data and this is a new file. Also move printing of the file header to... (dump_remainder): ...here, to allow printing only when data read. * tests/tail-2/overlay-headers.sh: A new test for suspension and resumption of tail. * tests/local.mk: Reference the new test. * NEWS: Mention the fix. Fixes http://bugs.gnu.org/23539
* tests: fix tail test race causing false failurePádraig Brady2017-02-081-2/+3
| | | | | | | | | * tests/tail-2/retry.sh: The replacement of the "missing" directory is not atomic, and therefore tail(1) can take a different path, especially if there is a delay between the rmdir(2) and creat(2). This is noticeable for example with `make coverage` because in that case the coverage files written by rmdir(1) on exit, induce a significant delay thus triggering the issue.