summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-10-21ls: fix off by one error when determining max display columnsPádraig Brady
* src/ls.c (main): Account for the first column not including a separator when calculating max_idx. * tests/ls/w-option.sh: Add a test case. * NEWS: Mention the bug fix.
2015-10-21ls: allow -w0 to mean no limit on line lengthPádraig Brady
* src/ls.c (print_with_separator): Renamed from print_with_commas, and parameterized to accept the separator to print. Also fix an edge case where '\n' not printed when the POS variable overflows SIZE_MAX. (print_current_files): Degenerate -x and -C to using the cheaper print_with_separator() in the -w0 case. * doc/coreutils.texi (ls invocation): Document the new feature. * tests/ls/w-option.sh: A new test. * tests/local.mk: Reference the new test. * NEWS: Mention the improvement. Fixes http://bugs.gnu.org/21325
2015-10-19ls: detect terminal color support using glob patternsPádraig Brady
* src/ls.c (know_term_type): Corresponding to commit v8.24-48-gc249a5a, use fnmatch to inspect the dircolors database. Noticed due to failing tests/ls/color-{dtype-dir,term}.sh tests.
2015-10-19tests: adjust recent change to csplit VM limitPádraig Brady
* tests/misc/csplit-heap.sh: A little more memory is required for the full run case. Noticed with --enable-single-binary.
2015-10-19maint: fixes to support improved sc_tight_scopePádraig Brady
The gnulib provided sc_tight_scope target was ineffective, as it was checking against an invalid blank regular expression, and thus ignoring any extern function issues. This is now fixed up in gnulib, and so we need to fix our scoping issues before the next gnulib update. * cfg.mk: Setup and document the tight_scope config variables appropriately. * src/selinux.h: Since declared in *_SOURCES, use the two line form for the extern function declarations. * src/set-fields.h: Add the extern declarations, and since declared in noinst_HEADERS use the single line form.
2015-10-19tests: avoid failure when auto selecting factor testsPádraig Brady
* tests/factor/run.sh: If this template is found through `grep -El "print_ver_.* factor"` for example, then just skip it.
2015-10-19factor: remove unreachable SQUFOF code at compile timePádraig Brady
It was a little confusing as to whether the SQUFOF algorithm was enabled, and in fact there were no options available to enable it. Therefore clarify the 3 configurable behaviors for the code to 3 defines at the top of the program, and only include the SQUFOF code if enabled at compile time. $ size src/factor-before text data bss 93997 1412 2504 $ size src/factor-after text data bss 87885 1404 2504 * src/factor.c: Only include the SQUFOF factor code when enabled via the USE_SQUFOF define. * doc/coreutils.texi (factor invocation): Update note about factor limits, as we can factor 128 bit numbers without GMP.
2015-10-19doc: reference shuf(1) from the sort (-R) man pagePádraig Brady
* man/sort.x: Cross reference with shuf(1). * src/sort.c (usage): Mention shuf(1) with -R option. Suggested in http://bugs.debian.org/641166
2015-10-18maint: avoid duplicate test runsBernhard Voelker
* tests/local.mk (all_tests): Remove the tests 'tests/id/setgid.sh' and 'tests/mkdir/smack-root.sh' because they are mentioned in the 'all_root_tests' list; these tests are skipped anyway during a non-root run because flagged with 'require_root_'.
2015-10-16doc: remove obsolete performance commentPaul Eggert
sha512sum can be faster than sha256sum. E.g., ‘dd if=/dev/zero bs=1024k count=1024 | time sha256sum’ reports 8.16 user CPU seconds on my host, whereas sha512sum consumes 5.45 seconds (Fedora x86-64 on an AMD Phenom II X4 910e). Although sha512sum is still considerably slower on x86, a good chunk of uses are on 64-bit hosts and anyway there’s little point to scaring people away from sha512sum nowadays. * doc/coreutils.texi (sha2 utilities): Remove obsolete comment.
2015-10-16maint: avoid uniq.c warning from bleeding-edge gcc's -Wstrict-overflowJim Meyering
* src/uniq.c (main): Make the type of "nfiles" unsigned, to avoid a brand new warning from a gcc I built from today's sources (gcc version 6.0.0 20151015 (experimental) (GCC)): src/uniq.c:523:14: error: assuming signed overflow does not occur \ when simplifying conditional to constant [-Werror=strict-overflow] if (nfiles == 2) ^
2015-10-16dircolors: support globbing of TERM entriesPádraig Brady
* src/dircolors.c (dc_parse_stream): Support globbing of TERM entries, to allow entries like "TERM *256color*" for example. * src/dircolors.hin: Reduce the internal list with globbing. * tests/misc/dircolors.pl: New test cases. * NEWS: Mention the improvement.
2015-10-15tests: avoid false failure in rm/r-root.sh with gdb warningsPádraig Brady
* tests/rm/r-root.sh: Skip the test if there are gdb warnings that will impact further stderr checks. For example some buggy gdb versions may report "Got object file from memory but can't read symbols: File truncated". Also fix an incorrect stderr check from the previous change. Reported by Bernhard Voelker.
2015-10-15tests: avoid false failure in rm/r-root.sh under loadPádraig Brady
* tests/rm/r-root.sh: Use gdb rather than timeout(1) as the last resort protection against unlinkat() calls. The timeout of 2s was susceptible to false positives under load, and gdb is stronger protection in any case. We remove the "expensive" tag on this test also since it should be robust. Reported by Jim Meyering.
2015-10-15tests: avoid false failure in a tail test under loadPádraig Brady
* tests/tail-2/follow-stdin.sh: Use the standard tail testing framework to avoid the race seen under very high load, and also test the non inotify case. Reported by Jim Meyering
2015-10-14tests: avoid false failures with default ACLsPádraig Brady
To reproduce: setfacl -dm group::rx . setfacl -dm other::rx . make check * init.cfg (require_no_default_acl_): A new function to skip when default ACLs are detected, or if the getfacl utility is not available then skip if any non LSM ACLs detected. * tests/cp/existing-perm-race.sh: Call require_no_default_acl_. * tests/mkdir/parents.sh: Likewise. * tests/mkdir/perm.sh: Likewise.
2015-10-12tail: no longer warn about unrecognized file systemsPádraig Brady
* src/tail.c (fremote): No longer prompt the user to email with the unrecognized file system constant, since we have process in place to sync periodically with the latest Linux constants, and the fall back polling mode is still fully functional.
2015-10-10tests: avoid false failure when restorecon is ineffectivePádraig Brady
* tests/cp/cp-a-selinux.sh: Ensure we skip the portion of the test depending on restorecon to be effective. I.E. also skip when restorecon warns, as it doesn't exit with error status when matchpathcon fails to find a match for a file. This is the case in /tmp on Fedora for example, in which case the new destination that cp creates will have the default security context of the process, rather than the explicit context we set on the source file. Details at: http://bugzilla.redhat.com/1247641
2015-10-10tests: make a long running test responsive to Ctrl-CPádraig Brady
* tests/misc/sort-compress-hang.sh: Use --foreground with the timeout(1) command (noting the caveats), to run the sort command in the foreground program group, and thus be responsive to Ctrl-C. This very_expensive_ test takes over a minute on a i3-2310M, with RAM backed /tmp.
2015-10-08tests: adjust recent changes to virtual memory limitsPádraig Brady
* tests/dd/no-allocate.sh: Account for timeout(1) when determining the required mem, as timeout has additional shared libs. This avoids the need for the hardcoded 4M addition to the limit. * tests/misc/head-c.sh: Increase the base limit, to account for the fact that head(1) will allocate some additional mem in this case. * tests/misc/cut-huge-range.sh: Remove mention of specific limits. * tests/misc/printf-surprise.sh: Likewise. Reported by Dmitry V. Levin
2015-10-06csplit: remove erroneous mention of -m in --helpPádraig Brady
* src/csplit.c (usage): -m is not accepted, only --suppress-matched. * tests/misc/csplit-suppress-matched.pl: Spelling fix. Reported by Ondrej Oprala
2015-10-03tee: simplify argv handlingPaul Eggert
* src/tee.c (tee_files): Last arg is now char ** instead of char const **, as that is a bit simpler. All callers changed. Modify files[-1], not files[nfiles], as that is a bit faster and simpler. Latter problem pointed out by Rainer Deyke in: http://bugs.gnu.org/21611
2015-10-03build: update gnulib submodule to latestPaul Eggert
2015-10-03build: Pacify GCC 5 on 32-bit hostsPaul Eggert
This pacifies GCC 5 in a better way, without disabling diagnostics. * src/df.c (main): Tell compiler that optind is positive. * src/shred.c (known): New function. (dopass): Go back to off_t for file sizes. Avoid integer overflow if we run off the end of the file. Tell compiler that a write cannot write more bytes than requested.
2015-10-03tail: handle kernel dentry unlink racePádraig Brady
Avoid the intermittent loss of "... has become inaccessible" messages. That would cause tests/tail-2/assert.sh to fail sometimes, mainly on uniprocessor systems. * src/tail.c (tail_forever_inotify): Also monitor IN_DELETE events on the directory, to avoid a dentry unlink()..open() race, where the open() on the deleted file was seen to succeed after an, unlink() and a subsequent IN_ATTRIB, was sent to tail. Note an IN_ATTRIB is sent on the monitored file to indicate the change in number of links, and we can't just use a decrease in the number of links to determine the file being unlinked, due to the possibility of the file having multiple links. Reported by Assaf Gordon and Ludovic Courtès. Fixes http://bugs.gnu.org/21460
2015-10-03build: avoid -Wstrict-overflow warnings with GCC 5.1 on 32 bitPádraig Brady
* src/shred.c (dopass): With -O2, GCC 5.1 gives "assuming signed overflow does not occur when simplifying conditional to constant" warnings, in regard to the signed (off_t) variables. Therefore use unsigned (uintmax_t) instead, and a separate boolean to cater for the special meaning of the negative part of the integer range. Noticed at http://hydra.nixos.org/build/24983447
2015-10-03build: update gnulib submodule to latestPádraig Brady
Includes a change to xalloc.h to avoid -Wstrict-overflow warnings with GCC 5.1 on 32 bit with optimization enabled. A subsequent commit will fix similar issues in shred.
2015-10-02dircolors: add xterm-termite entryDario Giovannetti
* src/dircolors.hin: Add "xterm-termite" as this VTE based terminal emulator is quite different from xterm, despite the name. For example "Termite supports italic text and it won't work if TERM is set to xterm. Even the backspace key won't work properly anymore for applications relying on terminfo". Reported also by Lukas Sabota and Sven-Hendrik Haase.
2015-09-23df: prioritize mounts nearer the device rootDave Chiluk
In the presence of bind mounts of a device, the 4th "mount root" field from /proc/self/mountinfo is now considered, so as to prefer mount points closer to the root of the device. Note on older systems with an /etc/mtab file, the source device was listed as the originating directory, and so this was not an issue. Details at http://pad.lv/1432871 * src/df.c (filter_mount_list): When deduplicating mount entries, only prefer sources nearer or at the root of the device, when the target is nearer the root of the device. * NEWS: Mention the change in behavior.
2015-09-23build: update gnulib submodule to latestPádraig Brady
This includes a change to propagate the 4th "mount root" field from /proc/self/mountinfo from the mountlist module, which is needed in a subsequent commit in df. * gl/lib/regcomp.c.diff: Regenerate against latest gnulib. * gl/lib/regex_internal.c.diff: Likewise. * gl/lib/regex_internal.h.diff: Likewise. * cfg.mk: Exclude diffs from trailing whitespace check, which is generally correct, and now needed.
2015-09-22maint: use adaptive approach for `ulimit -v` based testsBernhard Voelker
When configured with either 'symlinks' or 'shebangs' as value for the --enable-single-binary option, tests based on `ulimit -v` are skipped. The reason is that the multicall 'coreutils' binary requires much more memory due to shared libraries being loaded, and the size of the 'date' binary (~290KiB) compared to the multicall binary (~5MiB), of course. Finally, in the case of 'shebangs', the starting shell requires more memory, too Instead of using hard-coded values for the memory limit, use an adaptive approach: first determine the amount of memory for a similar, yet more trivial invocation of the command, and then do the real test run using that limit (plus some buffer in some cases). * init.cfg (require_ulimit_v_): Remove function. (get_min_ulimit_v_): Add function to determine the minimum memory limit required for a given command in an adaptive way. * cfg.mk (sc_prohibit_test_ulimit_without_require_): Change the name of the above function in the syntax-check rule. * tests/cp/link-heap.sh: Use the above function to determine the minimum memory required to run a command simpler than in the real test run. Use that limit plus a buffer there. While at it, change to list of commands in the subshell to fail also if the beginning `ulimit -v` fails. * tests/dd/no-allocate.sh: Likewise. * tests/misc/csplit-heap.sh: Likewise. * tests/misc/cut-huge-range.sh: Likewise. * tests/misc/head-c.sh: Likewise. * tests/misc/printf-surprise.sh: Likewise. * tests/split/line-bytes.sh: Likewise. * tests/rm/many-dir-entries-vs-OOM.sh: Likewise - doing it separately for each program under test.
2015-09-22maint: avoid deprecation warning with <selinux/flask.h>Pádraig Brady
* src/runcon.c (main): As per the compile time warning from libselinux-2.4-3, lookup the class with string_to_security_class(), rather than using defines from flask.h.
2015-09-22sort,numfmt: with --debug, diagnose failure to set localePádraig Brady
* src/sort.c (main): With --debug, warn upon setlocale() failure, which can happen due to incorrectly specified environment variables, or due to memory exhaustion (simulated with ulimit -v), etc. * tests/misc/sort-debug-warn.sh: Add a test case. See also http://savannah.gnu.org/bugs/11004
2015-09-18du: avoid to stat all mount points if possibleBernhard Voelker
du calls stat for each mount point at startup. This would block or even make du fail if stat for an unrelated mount point hangs. The result is not needed in the normal case anyway and therefore should be avoided. Issue introduced in commit v8.19-2-gcf7e1b5. * src/du.c (fill_mount_table): Move function up as it's not used ... (mount_point_in_fts_cycle): ... here, i.e., the DI_MNT set is initialized and filled only iff FTS has detected a directory cycle. (main): Remove the initialization and filling of the DI_MNT set here, and free the DI_MNT set only if it was used.
2015-09-17shred: don’t document -NUMBER optionPaul Eggert
The -NUMBER option was removed from ‘shred’ in 1999, but the manual wasn’t updated to match. Problem reported by Nick Rose in: http://bugs.gnu.org/21502 * doc/coreutils.texi (shred invocation): Remove documentation for -NUMBER option.
2015-09-12numfmt: use new set-fields module to parse --fieldAssaf Gordon
numfmt --field=LIST can accept the same options as cut. * bootstrap.conf: remove xlist, linked-list * src/local.mk: link numfmt with set-fields * src/numfmt.c: use set-fields.c instead of custom field parsing code. (include_field): adapt to new code. * tests/misc/numfmt.pl: add new tests, adapt current tests to new error message wording from set-fields.c
2015-09-12cut: refactor into set-fields moduleAssaf Gordon
Extract the functionality of parsing --field=LIST into a separate module, to be used by other programs. * src/cut.c: move field parsing code from here ... * src/set-fields.{c,h}: ... to here. (set_fields): generalize by supporting multiple parsing/reporting options. (struct range_pair): rename to field_range_pair. * src/local.mk: link cut with set-field. * po/POTFILES.in: add set-field.c * tests/misc/cut.pl: update wording of error messages
2015-09-08maint: fix heap manipulations in previous commitPádraig Brady
* src/sort.c (main): Ensure we don't free() and invalid pointer when reading implicit stdin. Also avoid "definitely lost" valgrind warnings in the --files0-from case.
2015-09-04maint: avoid "definitely lost" valgrind warningsPádraig Brady
Since commit v8.23-19-g8defcee, main() will return, rather than call exit(), this inducing "definitely lost" warnings in valgrind's leak checker. That precludes using the following to flag memory leaks: valgrind --leak-check=full --error-exitcode=1 \ --errors-for-leak-kinds=definite * src/pr.c (main): In dev builds, explicitly free memory allocated. * src/sort.c (main): Likewise. * src/tail.c (main): Likewise. * src/tsort.c (tsort): Likewise.
2015-09-03tests: test numfmt stdin behaviorPádraig Brady
* tests/misc/tty-eof.pl: Add numfmt to the list of programs that accept input on stdin.
2015-09-03ls,ptx: restrict quotearg use to file name outputPádraig Brady
* src/ls.c (getenv_quoting_style, decode_switches, parse_ls_color): Use quote() rather than quotearg(), as the latter defaults to outputting the input unquoted. * src/ptx.c (main): Likewise.
2015-09-03base64: no longer support hex or oct --wrap paramsPádraig Brady
* src/base64.c (main): Support decimal numbers with leading zeros, by disabling the auto detection of octal and hex. It's not envisaged that base conversion is needed for --wrap parameters, and in the edge case it is, $((0x0)) shell constructs can be used. * tests/misc/base64.pl: Adjust accordingly. * NEWS: Mention the change in behavior.
2015-09-03base64: use stricter validation on wrap columnPádraig Brady
* src/base64.c (main): Use the higher level xnumtoumax() rather than xstrtoumax(), which is simpler and improves validation of input. Also pass the _empty_ rather than NULL string as the suffixes parameter so that invalid trailing characters are not allowed. For example -w08 is now flagged as an error, rather than being interpreted as 0. A subsequent commit will further improve verification of numbers with leading zeros by dropping backwards compatibility wrt auto parsing oct and hex numbers. * tests/misc/base64.pl: Add tests for invalid wrap values.
2015-09-03base32: A new program similar to base64Pádraig Brady
Suggested in https://bugzilla.redhat.com/1250113 * AUTHORS: Add base32. * THANKS.in: Add suggester. * README: Reference the new program. * NEWS: Mention the new program. * src/.gitignore: Ignore the new binary. * bootstrap.conf: Reference the gnulib base32 module. * build-aux/gen-lists-of-programs.sh: Add base32. * man/base32.x: A new template. * man/.gitignore: Ignore the new man page. * man/local.mk: Reference the new man page. * doc/coreutils.texi (base32 invocation): Document the new command. * src/local.mk: Adjust to build base32 based on base64.c. * src/base64.c: Parameterize to use the correct headers, functions and buffer sizes, depending on which binary is being built. * tests/misc/base64.pl: Adjust to test both base32 and base64. * tests/misc/tty-eof.pl: Add base32 as a program that accepts input on stdin without any options specified. * scripts/git-hooks/commit-msg: Add base32 to the template.
2015-09-01build: update gnulib submodule to latestPádraig Brady
This includes a tweak to support building the gnulib base32 module with -Wsuggest-attribute=const
2015-08-31doc: clarify in --help/man where short options take no paramPádraig Brady
* src/shred.c (usage): For -u, separate the decscription of the short and long option, to clarify that the short option takes no parameter. * src/split.c (usage): Likewise for -d. * src/tee.c (usage): Likewise for -p. * src/uniq.c (usage): Likewise for -D. Suggested by Stephane Chazelas
2015-08-30tests: avoid FP of ls/stat-free-color.sh with newer glibcBernhard Voelker
Since glibc-2.22, specifically commit [0], the opendir() implementation implicitly makes an additional stat call thus leading to a FP. Seen on openSUSE:Tumbleweed since snapshot 20150821. [0] https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=46f894d8c60a * tests/ls/stat-free-color.sh: Change the test to verify that ls(1) needs the same number of stat-like calls for a single, empty directory argument as for one with a few directory entries (sub-directory, regular file, symlink, etc.).
2015-08-27doc: clarify where ambiguous if short options take no paramPádraig Brady
* doc/coreutils.texi (split invocation): Clarify that -d takes no param. (uniq invocation): Likewise for -D. (shred invocation): Likewise for -u. (tee invocation): Likewise for -p.
2015-08-22ls: allow -w18446744073709551616Paul Eggert
Problem reported by Beco in: http://bugs.gnu.org/21325 * src/ls.c (set_line_length): New function. (decode_switches): Use it to decode COLUMNS and -w.
2015-08-18maint: add syntax check to ensure larger man/*.x files have a CopyrightBernhard Voelker
* cfg.mk (sc_man_check_x_copyright): Add rule to ensure that non-trivial .x files in the 'man/' subdirectory, i.e., files exceeding a line count of 20 or a byte count of 1000, contain a proper Copyright notice.