Compare commits

...

65 Commits
v8.28 ... v8.29

Author SHA1 Message Date
Pádraig Brady
27b2b19aa8 version 8.29
* NEWS: Record release date.
2017-12-27 17:54:32 +00:00
Pádraig Brady
8992dfa54c tests: avoid false failure on AIX 7.2
* tests/tail-2/pipe-f.sh: Close stdout in a subshell
to ensure the current shell isn't impacted.  Subsequent
piped commands like `echo foo | blah` were seen to fail
due to the previous closing of stdout.
Reported by Assaf Gordon.
2017-12-23 10:25:57 +00:00
Pádraig Brady
f4fec33607 doc: describe recent build checks for 32 bit time_t
* README: Document the new handling of 32 bit time_t,
with examples of how to build in 64 bit mode on AIX.
Also mention that GNU make is desired on AIX
due to its mishandling of the "[" target.
Suggested by Assaf Gordon.
2017-12-23 10:25:56 +00:00
Pádraig Brady
ba4b0bde2e tests: fix recent portability issues on solaris 10
* tests/misc/ptx.pl: Escape the '^' character which is
otherwise considered as a line continuation character.
* tests/misc/shred-remove.sh: sed doesn't support \n.
2017-12-21 13:52:24 +00:00
Pádraig Brady
70c84e046e maint: remove reference to excluded changelog item
* build-aux/git-log-fix: Remove old entry.
2017-12-21 12:15:29 +00:00
Pádraig Brady
6821f2fb4e maint: add doc/coverage to .gitignore
* .gitignore: Ignore the generated coverage report.
2017-12-20 14:53:29 +00:00
Pádraig Brady
9f8b16e992 doc: remove older ChangeLog items
* Makefile.am: Update the oldest documented version
to 8.20 which is now about 5 years old.
2017-12-20 14:36:37 +00:00
Bernhard Voelker
47fb363432 doc: mention which privileges are needed to chmod
POSIX specification for chmod(1):
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/chmod.html

* doc/coreutils.texi (chmod invocation): Add a sentence about who can
change the file mode bits of a file - (almost) a copy from what POSIX
requires.

Fixes https://bugs.gnu.org/29207.
2017-12-18 08:07:12 +01:00
Pádraig Brady
177f131385 tests: fix recent regressions with dash
* tests/misc/timeout.sh: dash outputs the "Killed"
message to stderr rather than the terminal.
* tests/misc/usage_vs_getopt.sh: dash doesn't yet
support the POSIX proposed $'...' shell quoting syntax.
2017-12-16 13:34:19 -08:00
Pádraig Brady
a1300c60ef build: avoid a signed overflow warning in ptx
* src/ptx.c (fix_output_parameters): GCC 6.3.1 with
./configure --enable-single-binary would give:
  error: assuming signed overflow does not occur
  when simplifying conditional to constant [-Werror=strict-overflow]
    if (file_index > 0)
So change the type of file_index to signed (size_t).
2017-12-16 13:08:43 -08:00
Bernhard Voelker
36325c7f03 maint: adjust for the renamed nstrfime gnulib module
* bootstrap.conf: s/strftime/nstrfrime/.
2017-12-10 18:46:17 -08:00
Pádraig Brady
108f34a71b build: update gnulib submodule to latest
* gnulib: Update with various build/test fixes.
2017-12-10 18:03:35 -08:00
Pádraig Brady
a58ce6f023 tests: fix false failure in new dd/nocache_eof test
* test/dd/nocache_eof.sh: Also handle fadvise64_64 which is
used on 32 bit x86.  Note strace internally maps fadvise64_64
to {arm,xtensa}_fadvise64_64.
2017-12-10 17:13:18 -08:00
Pádraig Brady
e44df9d3f5 tail: fix tailing non seekable files on certain systems
* src/tail.c (tail_bytes): On systems were blksize_t is unsigned
and the same size or wider than off_t (android for example),
our initialized (off_t) -1 would be promoted to unsigned before
comparison, and thus fail to follow the appropriate path.
* tests/tail-2/tail-c.sh: Add a test case.
* NEWS: Mention the fix.
This issue was introduced in commit v8.23-47-g2662702
Reported at https://github.com/termux/termux-app/issues/233
2017-12-10 17:13:18 -08:00
Pádraig Brady
8fb32039bc build: avoid build failure without sys/mtio.h
* m4/jm-macros.m4: Check for the header.
* src/dd.c: Avoid the workaround where the header
is not available (on non glibc systems).
* src/shred.c: Likewise.
2017-12-10 17:13:18 -08:00
Pádraig Brady
b697bac049 doc: reorganize ls -k and --time-style help
* src/ls.c (usage): Clarify -k only applies to -s usage
and directory 'total' lines.  Move the description
of TIME_STYLE out of the option section as it was awkward
to read and write there within 80 columns.
2017-12-10 17:12:49 -08:00
Pádraig Brady
532b4285de doc: clarify numeric setuid handling in chmod man page
* man/chmod.x: Update the information to state one can
clear the setuid and setgid bits for directories numerically
using an additional leading '0' or a leading '='.
That has been supported since v8.15-64-g8931cdb.
Fixes https://bugs.gnu.org/29390
2017-12-09 18:26:56 -08:00
Pádraig Brady
6150b10698 doc: shred: change 'truncate' to the more descriptive 'deallocate'
* doc/coreutils.texi (shred invocation): s/truncate/deallocate/.
* src/shred.c (usage): Likewise.
Fixes https://bugs.gnu.org/29317
2017-12-09 16:54:03 -08:00
Pádraig Brady
f17c1df391 doc: clarify that cp --force may recreate files
* doc/coreutils.texi (cp invocation): The language used
to describe recreating the file was a little confusing
as it mentioned opening a removed file.
Fixes https://bugs.gnu.org/29315
2017-12-09 16:18:00 -08:00
Kamil Dudka
e184a46e39 doc: fix default QUOTING_STYLE for %N format of stat(1)
* doc/coreutils.texi (stat invocation): The default value
of QUOTING_STYLE for the %N format of 'stat --printf' is
'shell-escape-always'.
Fixes https://bugs.gnu.org/29563
Reported by Christian Groessler at
https://bugzilla.redhat.com/1520399#c3
2017-12-04 10:29:42 -08:00
Jean Delvare
166fe58561 tests: make ls/block-size more readable
* tests/ls/block-size.sh: The output of the test was hard to read. Add
comments saying what we are testing to make it easier to understand.
2017-12-02 16:54:32 +01:00
Bernhard Voelker
052cce9e3e tests: verify usage vs. getopt
Verify that all options mentioned in usage are actually recognized
by the program.

* tests/misc/usage_vs_getopt.sh: Add test.
* tests/local.mk (all_tests): Reference it.

Co-authored-by: Pádraig Brady <P@draigBrady.com>
2017-11-29 13:29:00 +01:00
Pádraig Brady
ba9c7449b9 readlink: remove superfluous comma from usage output
* src/readlink.c (usage): Remove ',' after --quiet option.
2017-11-29 13:27:51 +01:00
Bernhard Voelker
5782a362e1 all: use consistent diagnostics for unknown long options
Previously, e.g. cksum failed to output the offending unknown long
option:
  $ cksum --unknown-opt
  cksum: invalid option -- '-'
  Try 'cksum --help' for more information.
i.e., it tried to diagnose '-' as short option.
Instead, it should diagnose the unknown long option:
  $ cksum --unknown-opt
  cksum: unrecognized option '--unknown-opt'
  Try 'cksum --help' for more information.

* src/cksum.c (long_options): Add struct with null entry only.
(main): Use it in the getopt_long call.
* src/dd.c: Likewise.
* src/hostid.c: Likewise.
* src/hostname.c: Likewise.
* src/link.c: Likewise.
* src/logname.c: Likewise.
* src/nohup.c: Likewise.
* src/sleep.c: Likewise.
* src/tsort.c: Likewise.
* src/unlink.c: Likewise.
* src/uptime.c: Likewise.
* src/users.c: Likewise.
* src/whoami.c: Likewise.
* src/yes.c: Likewise.
* NEWS (Improvements): Mention the fix.
2017-11-29 13:27:02 +01:00
Pádraig Brady
b505dc5734 test: fix issues with tests/cp/preserve-mode.sh
* tests/cp/preserve-mode.sh: This was the only use of awk,
which may not be available on the system resulting
in an ineffective test.  Also the permissions bits for
directories were not being checked at all.
2017-11-28 22:12:22 -08:00
Pádraig Brady
b5d6f66b60 build: update gnulib submodule to latest
* gnulib: Update with various build/test fixes.
2017-11-28 22:04:39 -08:00
Pádraig Brady
346de3c1e1 build: update gnulib submodule to latest
* gnulib: Update including various build fixes.
2017-11-28 00:45:07 -08:00
Bernhard Voelker
a72abc9304 timeout: also support short -v option
* src/timeout.c (main): Add short option character 'v' to getopt_long
call.
* tests/misc/timeout.sh: Run the test both for the long and the short
option.
2017-11-27 22:05:56 +01:00
Pádraig Brady
5f02cddc18 dd: support iflag=direct with arbitrary sized files
* src/dd.c (iread): Handle read error with a non-aligned
file offset in the O_DIRECT case.  This is not an issue
on XFS at least, but on EXT4 the final read will return
EINVAL rather than the expected 0 to indicate EOF.
* tests/dd/direct.sh: Test the iflag=direct case also.
* NEWS: Mention the improvement.
2017-11-24 16:28:57 -08:00
Pádraig Brady
559c7a57c7 timeout: add --verbose to diagnose timeouts
This is useful as handling in shell is complicated
with the varying exit status in the --kill-after case.

* src/timeout.c (main): Handle '-v' and store
COMMAND for the diagnostic.
(cleanup): Diagnose the signal name before sending.
(usage): Document -v, --verbose.
* doc/coreutils.texi (timeout invocation): Likewise.
* tests/misc/timeout.sh: Add a test case.
* NEWS: Mention the new feature
Fixes https://bugs.gnu.org/21760
2017-11-23 17:46:55 -08:00
Pádraig Brady
31dd7a0de2 tail: seek to the end of block devices
* src/tail.c (tail_bytes): Try lseek(..., SEEK_END) when
we can't determine the file size.
* tests/tail-2/end-of-device.sh: Add a new root only test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the improvement.
Paul Eggert suggested using lseek() (rather than ioctl(BLKGETSIZE64)).
Fixes https://bugs.gnu.org/29259
2017-11-18 22:26:02 -08:00
Bernhard Voelker
25030d942d maint: include the module year2038 from gnulib
* bootstrap.conf (gnulib_modules): Add 'year2038' to ensure that time_t
is 64-bit (and thus works after 2038).

Suggested by Bruno Haible in
https://lists.gnu.org/r/bug-gnulib/2017-11/msg00022.html
2017-11-14 10:12:01 +01:00
Bernhard Voelker
60e77fa49a maint: update gnulib to latest
* gnulib: Update - mainly for the recent year2038 changes.
* tests/init.sh: Update from gnulib/tests/init.sh.
2017-11-14 10:12:01 +01:00
Assaf Gordon
a4eedb251e doc: add github issue/pull-request templates
These templates instruct contributors not to use github, and instead
use the upstream GNU development resources. Discussed in
http://lists.gnu.org/archive/html/coreutils/2017-11/msg00007.html .

* .github/ISSUE_TEMPLATE.txt,
  .github/PULL_REQUEST_TEMPLATE.txt: New files.
2017-11-09 15:15:15 -07:00
Jim Meyering
95bfb36292 maint: make hook script reject "/archive/html" in lists.gnu.org URLS
* scripts/git-hooks/commit-msg: Require the abbreviated "/r/"
form in any log message URL.
2017-11-07 20:16:55 -08:00
Jim Meyering
9d88182ce1 maint: shorten https://lists.gnu.org/archive/html/... links
Each /archive/html/ part can be replace with /r/.
Run this to induce the change:
git grep -l archive/html|xargs perl -pi -e 's,/archive/html/,/r/,g'
* TODO: Perform that substitution.
* bootstrap: Likewise.
* src/sort.c (sequential_sort): Likewise.
* src/tail.c (tail_file): Likewise.
* tests/misc/sort-merge-fdlimit.sh: Likewise.
* tests/misc/stty-row-col.sh: Likewise.
* tests/misc/unexpand.pl: Likewise.
* tests/rm/readdir-bug.sh: Likewise.
* tests/tail-2/inotify-rotate.sh: Likewise.
2017-11-07 20:16:13 -08:00
Thomas Deutschmann
aebefc25f9 tests: avoid false failure with inaccessible mount points
* tests/ls/readdir-mountpoint-inode.sh: Skip the test
if any mount points are inaccessible by the current user.
Fixes https://bugs.gnu.org/29167
Reported at: https://bugs.gentoo.org/353164
2017-11-06 21:34:40 -08:00
Bernhard Voelker
e83f10c483 doc: fix "Up" field of realpath usage examples
Older versions of 'makeinfo' choke on a missing reference:

  ./doc/coreutils.texi:14177: `Realpath usage examples' has no Up field\
  (perhaps incorrect sectioning?).
  makeinfo: Removing output file `doc/coreutils.info' due to errors; \
  use --force to preserve.

* doc/coreutils.texi (realpath invocation): Add a menu referencing
the usage examples - introduced in v8.27-91-g7449f0d.
2017-11-05 16:56:39 -08:00
Pádraig Brady
ada1caedd5 maint: ensure https:// URLs are used in --help and man pages
* configure.ac(AC_INIT): Specify the URL explicitly, so we're
not dependent on unreleased autoconf.
2017-11-05 16:36:58 -08:00
Assaf Gordon
5ab71e4d3f stat: output default formats for --terse in usage
Suggested by L A Walsh in https://bugs.gnu.org/28763 .

* src/stat.c (fmt_terse_fs): Define format for --terse -f here.
(fmt_terse_regular): Define format for --terse here.
(fmt_terse_selinux): Likewise for when SELinux is enabled.
(default_format): Use the above constants.
(usage): Output the formats for the terse modes.
2017-10-31 16:31:16 -06:00
Pádraig Brady
b04ce61958 df: fix hang with fifo argument
* src/df.c (main): stat() before open(), and avoid
the optional open when given a fifo argument.
* tests/df/unreadable.sh: Add a test case.
* NEWS: Mention the fix.
Fixes https://bugs.gnu.org/29038
2017-10-30 09:47:43 -07:00
Jim Meyering
f89c20bdf7 build: ls.c: apply _GL_ATTRIBUTE_PURE to more functions
* src/ls.c (DEFINE_SORT_FUNCTIONS): Apply _GL_ATTRIBUTE_PURE
to each strcmp-derived function definition, since GCC8 with
-Wsuggest-attribute=pure now warns it is needed.
2017-10-27 21:18:46 -07:00
Vincent Lefevre
61a8b5cb56 doc: reference statfs(2) in the stat(1) man page
* man/stat.x (SEE ALSO): Mention statfs(2) in addition to stat(2).
Note statfs() is generally used rather than statvfs(),
so we'll defer that reference to the SEE ALSO section of statfs(2).
Fixes https://bugs.gnu.org/28989
2017-10-25 21:36:19 -07:00
Pádraig Brady
e818f19cf8 tests: avoid false failure when O_DIRECT isn't supported
* tests/dd/nocache_eof.sh: Only run the O_DIRECT tests
when 512 byte alignment is supported.  Otherwise with older
XFS on systems with > 1MiB pages, or on file systems not
supporting O_DIRECT, there would have been false failures.
* tests/dd/direct.sh: Clarify the skip message.
2017-10-24 20:08:05 -07:00
Pádraig Brady
de15a497d1 dd: fix nocache regions passed to posix_fadvise()
Previously with oflag=direct the call to invalidate_cache()
was not passed to the kernel, as it was less than a page size,
and a subsequent call was not made to invalidate the pending space.
Similarly with oflag=nocache the pending space at EOF was
not invalidated.  Even though these amount to only a single page
in the page cache it can be significant.  For example on
XFS before kernel patch v4.9-rc1-4-g0ee7a3f, O_DIRECT files
would have been read inefficiently if any pages were cached,
even if they were already synced to storage.

* src/dd.c (i_nocache_eof, o_nocache_eof): New bools used
to control when we want invalidate_cache(,0) to clear to EOF.
(cache_round): Use IO_BUFSIZE (currently 132KiB) to minimize
calls to the relatively expensive advise function, rather
than page_size.  This also makes it clear that while the
kernel function operates on pages, this size is chosen for
performance reasons.
(invalidate_cache): Refactor to share more code between
input and output paths. Use i_nocache_eof and o_nocache_eof
rather than proxying off max_records.  Ensure we
invalidate full pages when clearing to EOF as the kernel
will ignore any non complete pages.  Fix the offset used
for the output path.
(dd_copy): Invalidate the cache of the input after the
offset is updated, for consistency and so we don't try to
invalidate before the start of the file.  When we read
EOF on input, set flags so that we invalidate to EOF.
(main): Invalidate to EOF in more cases, by depending
on the i_nocache_eof and o_nocache_eof flags.
* doc/coreutils.texi (dd invocation): Clarify the alignment
and persisted caveats on the example applying "nocache"
to part of a file.
* tests/dd/nocache_eof.sh: A new test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the bug fix.
Issue reported by Eric Bergen.
2017-10-24 19:38:12 -07:00
Michael Stone
9fa178fccd doc: mention QUOTING_STYLE env var in ls man page
* src/ls.c (usage): Mention QUOTING_STYLE with the --quoting-style
option, and indicate it has lower precedence than that option.
2017-10-24 10:29:35 -07:00
Pádraig Brady
84f7231dfa maint: apply suggested cleanup to recent stty.c change
This should have been part of commit v8.28-17-gf926f7c
* src/stty.c (check_argument): Align line continuation chars,
and ensure the function macro is immune to usage with if/else.
Suggested by Jim Meyering and Paul Eggert.
2017-10-23 23:31:40 -07:00
Pádraig Brady
cc19f63be3 b2sum: fix crash with --check and truncated input
* src/md5sum.c (split_3): Ensure we don't walk off
the end of the string.
* tests/misc/b2sum.sh: Add test cases.
Fixes https://bugs.gnu.org/28860
2017-10-23 23:17:17 -07:00
Pádraig Brady
f926f7ce0e stty: fix processing of options when -F is specified
This was a latent issue that became significant with
the addition of the -F option in FILEUTILS-3_16n-56-ge46a424

* src/stty.c (apply_settings): Refactor argument checking
to a function macro.  Augment the argument check to ignore
NULLed out arguments (already processed -F).
* NEWS: Mention the fix.
* tests/misc/stty-invalid.sh: Add a test case.
Fixes https://bugs.gnu.org/28859
2017-10-23 23:15:25 -07:00
Pádraig Brady
cbf35912da timeout: fix a small race that would ignore command exit
This fixes a regression from commit v8.26-39-g2f69dba

* src/timeout.c (block_cleanup_and_chld): Rename from block_cleanup
to indicate we also block SIGCHLD to avoid the race where SIGCHLD
fires between waitpid() polling and sigsuspend() waiting for a signal.
* NEWS: Mention the fix.
2017-10-23 23:10:42 -07:00
Thomas Jarosch
cccd01b4da timeout: fix regression when invoked with blocked SIGCHLD
We inherit the signal mask from our parent process,
therefore ensure SIGCHLD is not blocked.

If SIGCHLD is blocked, sigsuspend() won't be interrupted
when the child process exits and we hang until the timeout (SIGALRM).

This fixes a regression from commit v8.26-39-g2f69dba

* src/timeout.c (install_sigchld): Ensure SIGCHLD is unblocked.
* NEWS: Mention the issue.
2017-10-23 23:09:02 -07:00
Pádraig Brady
856b828320 build: reinstate distribution of man pages
man pages change little between systems,
so falling back to distributed pages make sense
when cross compiling or lacking perl.

* man/local.mk: Add all man pages to EXTRA_DIST
so that they're distributed in the generated tarball.
Use the dummy-man page generator if cross compiling.
Set TZ to avoid a distcheck failure where man pages
used a diffent month than those rebuilt (with a .timestamp).
* man/dummy-man: Only fall back to generating a stub
if copying an existing man page fails.
* man/help2man: Sync portable TZ=UTC0 specification
from upstream help2man.
* NEWS: Mention the build-related change.
Fixes https://bugs.gnu.org/28574
2017-10-01 17:32:48 -07:00
Pádraig Brady
6774b991db maint: remove a duplicate entry from THANKS
* .mailmap: Prefer Colin Watson's last used email address.
2017-10-01 17:32:30 -07:00
Paul Eggert
4b8c92b940 copy: revert recent patch for vulnerable dirs
I plan to propose a better patch to catch vulnerable parent
directories.
* NEWS, doc/coreutils.texi (Target directory): Document this.
* src/cp.c, src/install.c, src/ln.c, src/mv.c:
Do not include targetdir.h.
(target_directory_operand): Remove test for vulnerable parents.
* src/cp.c (stat_target_operand): Remove.  All uses removed.
* src/local.mk (noinst_HEADERS): Remove src/targetdir.h.
(src_ginstall_SOURCES, src_cp_SOURCES, src_ln_SOURCES)
(src_mv_SOURCES): Remove src/targetdir.c.
* src/targetdir.c, src/targetdir.h: Remove.
* tests/mv/vulnerable-target.sh: Remove.
* tests/local.mk (all_root_tests): Remove it.
2017-09-24 23:10:56 -07:00
Pádraig Brady
63d2f05f52 tests: fix test hang on case insenitive file systems
* tests/split/filter.sh: Due to an invalid 'FILE = zero.in'
construct trying to initialize a FILE variable, it would
instead try to run the FILE command which is present on
macOS 10.13 with APFS.
We also remove a redundant duplicate test clause introduced
during a rebase, and simplify the piped timeout command,
to avoid requiring a subshell and associated quoting.
* THANKS.in: Add the reporter Jack Howarth.
Fixes https://bugs.gnu.org/28506
2017-09-24 12:37:39 -07:00
Pádraig Brady
3a3f5f359e tests: avoid a false failure in expr test with UTF8
* tests/misc/expr.pl: Skip the quote varying tests in
the multi-byte locales as these tests aren't that interesting
in those locales.  Also ERR_SUBST is already defined for
some tests so awkward to redefine to munge UTF8 quotes to ASCII.
2017-09-20 22:21:31 -07:00
Assaf Gordon
454d7f31c5 expr: add detailed syntax error messages
Show offending argument instead of a generic 'syntax error' message.
Suggested by Bernhard Voelker in https://bugs.gnu.org/28461#13 .

* src/expr.c (syntax_error): Remove.
(required_more_args): New function.
(eval7, main): Replace syntax_error call with detailed die message.
* tests/misc/expr.pl: Add tests for new messages.
2017-09-19 23:51:54 -06:00
Pádraig Brady
a608f1e781 maint: fix new syntax-check failures from HTTPS adjustments
* cfg.mk [old_NEWS_hash]: update with `make update-NEWS-hash`.
[sc_long_lines]: Avoid flagging (long) URLs in NEWS.
* src/sort.c: Tweak to a shorter line.
* src/tail.c: Likewise.
Introduced in v8.28-4-gbe87d61
2017-09-19 22:32:00 -07:00
Pádraig Brady
0be99382d9 maint: fix new syntax check failures from copy restrictions
* doc/coreutils.texi: Remove doubled word.
* src/targetdir.c: Explicitly mark exported function.
* tests/local.mk: This is not a root only test.
* tests/mv/vulnerable-target.sh: Use returns_.
Introduced in v8.28-3-g44ccd1c
2017-09-19 22:21:28 -07:00
Pádraig Brady
c34f8d5c78 shred: reinstate --remove file name length obfuscation
This was unintentionally removed in v8.27-60-g2ae1460
* src/shred.c (wipename): Interate through all name lengths.
* tests/misc/shred-remove.sh: Add test cases.
* NEWS: Mention the bug fix.
Fixes https://bugs.gnu.org/28507
2017-09-19 21:24:38 -07:00
Paul Eggert
4cb3f4faa4 maint: copy bootstrap from Gnulib 2017-09-19 01:25:13 -07:00
Paul Eggert
be87d61299 all: prefer HTTPS in URLs 2017-09-19 01:22:54 -07:00
Paul Eggert
44ccd1c465 copy: check for vulnerable target dirs
* NEWS, doc/coreutils.texi (Target directory): Document this.
* src/cp.c, src/install.c, src/ln.c, src/mv.c: Include targetdir.h.
(target_directory_operand): Use the new targetdir_operand_type
function to check for vulnerable target directories.
* src/cp.c (stat_target_operand): New function.
(target_directory_operand, do_copy): Use it.
* src/local.mk (noinst_HEADERS): Add src/targetdir.h.
(src_ginstall_SOURCES, src_cp_SOURCES, src_ln_SOURCES)
(src_mv_SOURCES): Add src/targetdir.c.
* src/targetdir.c, src/targetdir.h: New files.
* tests/mv/vulnerable-target.sh: New test.
* tests/local.mk (all_root_tests): Add it.
2017-09-19 00:14:30 -07:00
Bernhard Voelker
97c5045435 ptx: avoid infloop due to zero-length matches with -S regex
* src/ptx.c (find_occurs_in_text): Die with an appropriate error
diagnostic when the given regular expression returns a match of
length 0.
* tests/misc/ptx.pl (S-infloop): Add a test.
* NEWS (Bug fixes): Mention the fix.

Fixes https://bugs.gnu.org/28417 which was detected using
Symbolic Execution techniques developed in the course of the
SYMBIOSYS research project at COMSYS, RWTH Aachen University.
2017-09-14 07:50:27 +02:00
Pádraig Brady
5d9d07bbb1 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2017-09-01 19:25:50 -07:00
783 changed files with 1886 additions and 1080 deletions

85
.github/ISSUE_TEMPLATE.txt vendored Normal file
View File

@@ -0,0 +1,85 @@
Please **do not** send pull-requests or open new issues on Github.
Github is a downstream mirror and is not frequently monitored,
all development is coordinated upstream on GNU resources.
* Send general questions or suggestions to: coreutils@gnu.org .
* Send bugs reports to: bug-coreutils@gnu.org .
## Bug reports
Before reporting a new bug, please check the following resources:
* Coreutils FAQ: https://www.gnu.org/software/coreutils/faq/coreutils-faq.html
* Coreutils Gotchas: https://www.pixelbeat.org/docs/coreutils-gotchas.html
contains a list of some quirks and unexpected behaviour (which are often
mistaken for bugs).
* Online Manual:
https://www.gnu.org/software/coreutils/manual/html_node/index.html
* Search the archives for previous questions and answers:
* Coreutils Mailing list (General usage and advice):
https://lists.gnu.org/archive/html/coreutils/
* Bug reports Mailing List:
https://lists.gnu.org/archive/html/bug-coreutils/
* Open Bugs:
https://debbugs.gnu.org/cgi/pkgreport.cgi?which=pkg&data=coreitils
* Translation related issues:
https://translationproject.org/domain/coreutils.html
## Effective bug reports
* Include a descriptive subject line (e.g. the program with which
you experience a problem, and what the problem is).
* Include the version of the program (e.g. the output of `PROG --version`).
* Include the operating system and the type of hardware you are using
(e.g. the output of `uname -a`).
* Include the exact command and parameters you have used.
* Clearly explain what is the output you expected to get, and what is
the actual result you encountered.
* Include as much information as possible to reproduce the problem.
If the problem happens on a very large input file, try to provide
a minimal example (a subset of the input file) that still causes the problem.
*Do not* include attachments over 40kB.
* List policy is reply-to-all, and non-subscribers may post.
* There may be a moderation delay for a first-time post, whether or not
you subscribe.
## Mailing List Etiquette
When sending messages to coreutils@gnu.org or bug-coreutils@gnu.org :
* Send messages as plain text.
* Do not send messages encoded as HTML nor encoded as base64 MIME nor
included as multiple formats.
* Avoid sending large messages, such as log files, system call trace
output, and other content resulting in messages over about 40 kB.
* Avoid sending screenshots (e.g. PNG files). When reporting errors
you encounter on the terminal, copy and paste the text to your message.
<!--
Copyright (C) 2017 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->

105
.github/PULL_REQUEST_TEMPLATE.txt vendored Normal file
View File

@@ -0,0 +1,105 @@
Please *do not* send pull-requests or open new issues on Github.
See "hacking resources" below for recommended alternatives.
Github is a downstream mirror and is not frequently monitored,
all development is coordinated upstream on GNU resources.
* Send general questions or suggestions to: coreutils@gnu.org .
* Send bugs reports to: <bug-coreutils@gnu.org>
Before sending the bug, please consult the FAQ and Mailing list
archives (see below). Often these perceived bugs are simply due to
wrong program usage.
Please remember that development of Coreutils is a volunteer effort,
and you can also contribute to its development. For information about
contributing to the GNU Project, please read
[How to help GNU](https://www.gnu.org/help/].
## Getting Help
* Coreutils FAQ: https://www.gnu.org/software/coreutils/faq/coreutils-faq.html
* Coreutils Gotchas: https://www.pixelbeat.org/docs/coreutils-gotchas.html
contains a list of some quirks and unexpected behaviour (which are often
mistaken for bugs).
* Online Manual:
https://www.gnu.org/software/coreutils/manual/html_node/index.html
* Search the archives for previous questions and answers:
* Coreutils Mailing list (General usage and advice):
https://lists.gnu.org/archive/html/coreutils/
* Bug reports Mailing List:
https://lists.gnu.org/archive/html/bug-coreutils/
* Open Bugs: https://debbugs.gnu.org/cgi/pkgreport.cgi?which=pkg&data=coreitils
* Translation related issues:
https://translationproject.org/domain/coreutils.html
## Mailing List Etiquette
When sending messages to coreutils@gnu.org or bug-coreutils@gnu.org :
* Send messages as plain text.
* Do not send messages encoded as HTML nor encoded as base64 MIME nor
included as multiple formats.
* Include a descriptive subject line.
* Avoid sending large messages, such as log files, system call trace
output, and other content resulting in messages over about 40 kB.
* Avoid sending screenshots (e.g. PNG files). When reporting errors
you encounter on the terminal, copy and paste the text to your message.
* List policy is reply-to-all, and non-subscribers may post.
* There may be a moderation delay for a first-time post, whether or not
you subscribe.
## Hacking resources
files contain information about hacking and contributing to GNU coreutils:
https://git.savannah.gnu.org/cgit/coreutils.git/tree/HACKING
https://git.savannah.gnu.org/cgit/coreutils.git/tree/README-hacking
Please read them first.
Before suggesting a new feature, read the list of rejected features requests:
https://www.gnu.org/software/coreutils/rejected_requests.html
Send a patch as an email attachment. Patches can be generated with
`git format-patch` (the HACKING links above provide examples of generating
a patch).
## Copyright Assignment
If your change is significant (i.e., if it adds more than ~10 lines),
then you'll have to have a copyright assignment on file with the FSF.
To learn more see https://www.gnu.org/licenses/why-assign.html .
The HACKING file (above) contains more details about how to initial
the copyright assignment process. Coreutils maintainers can also help
in this matter.
<!--
Copyright (C) 2017 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->

1
.gitignore vendored
View File

@@ -40,6 +40,7 @@
/coreutils-*.tar.xz
/coreutils-*.tar.xz.sig
/doc/manual
/doc/coverage
/gnulib-tests
/lib/.dirstamp
/lib/.gitignore

View File

@@ -28,6 +28,7 @@ Pádraig Brady <P@draigBrady.com>
<stephane.raimbault@gmail.com> <stephane.raimbault@makina-corpus.com>
<jarkko.sakkinen@iki.fi> <jarkko.sakkinen@linux.intel.com>
<tobias@stoeckmann.org> <tobias@bugol.de>
<cjwatson@debian.org> <cjwatson@ubuntu.com>
# Prefer spelled-out middle name and its address.
Arne Henrik Juul <arnej@imf.unit.no> Arne H. Juul <arnej@solan.unit.no>

View File

@@ -1 +1 @@
8.27
8.28

View File

@@ -13,7 +13,7 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
{
libc_dl_open

View File

@@ -13,7 +13,7 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
ALL_RECURSIVE_TARGETS =
@@ -93,7 +93,7 @@ dist-hook: gen-ChangeLog
$(AM_V_at)touch $(distdir)/doc/constants.texi \
$(distdir)/doc/coreutils.info
gen_start_ver = 8.18
gen_start_ver = 8.20
.PHONY: gen-ChangeLog
gen-ChangeLog:
$(AM_V_GEN)if test -d .git; then \
@@ -120,7 +120,7 @@ THANKS-to-translators: po/LINGUAS THANKStt.in
$(AM_V_GEN)( \
cat $(srcdir)/THANKStt.in; \
for lang in `cat $(srcdir)/po/LINGUAS`; do \
echo http://translationproject.org/team/$$lang.html; \
echo https://translationproject.org/team/$$lang.html; \
done; \
) > $@-tmp && mv $@-tmp $@

62
NEWS
View File

@@ -1,5 +1,61 @@
GNU coreutils NEWS -*- outline -*-
* Noteworthy changes in release 8.29 (2017-12-27) [stable]
** Bug fixes
b2sum no longer crashes when processing certain truncated check files.
[bug introduced with b2sum coreutils-8.26]
dd now ensures the correct cache ranges are specified for the "nocache"
and "direct" flags. Previously some pages in the page cache were not
invalidated. [bug introduced for "direct" in coreutils-7.5,
and with the "nocache" implementation in coreutils-8.11]
df no longer hangs when given a fifo argument.
[bug introduced in coreutils-7.3]
ptx -S no longer infloops for a pattern which returns zero-length matches.
[the bug dates back to the initial implementation]
shred --remove will again repeatedly rename files with shortening names
to attempt to hide the original length of the file name.
[bug introduced in coreutils-8.28]
stty no longer crashes when processing settings with -F also specified.
[bug introduced in fileutils-4.0]
tail --bytes again supports non seekable inputs on all systems.
On systems like android it always tried to process as seekable inputs.
[bug introduced in coreutils-8.24]
timeout will again notice its managed command exiting, even when
invoked with blocked CHLD signal, or in a narrow window where
this CHLD signal from the exiting child was missed. In each case
timeout would have then waited for the time limit to expire.
[bug introduced in coreutils-8.27]
** New features
timeout now supports the --verbose option to diagnose forced termination.
** Improvements
dd now supports iflag=direct with arbitrary sized files on all file systems.
tail --bytes=NUM will efficiently seek to the end of block devices,
rather than reading from the start.
Utilities which do not support long options (other than the default --help
and --version), e.g. cksum and sleep, now use more consistent error diagnostic
for unknown long options.
** Build-related
Default man pages are now distributed which are used if perl is
not available on the build system, or when cross compiling.
* Noteworthy changes in release 8.28 (2017-09-01) [stable]
** Bug fixes
@@ -3582,7 +3638,7 @@ GNU coreutils NEWS -*- outline -*-
These changes are in response to decisions taken in the January 2005
Austin Group standardization meeting. For more details, please see
"Utility Syntax Guidelines" in the Minutes of the January 2005
Meeting <http://www.opengroup.org/austin/docs/austin_239.html>.
Meeting <https://www.opengroup.org/austin/docs/austin_239.html>.
** Binary input and output are now implemented more consistently.
These changes affect only platforms like MS-DOS that distinguish
@@ -3660,9 +3716,9 @@ GNU coreutils NEWS -*- outline -*-
The new -P option checks whether a file name component has leading "-",
as suggested in interpretation "Austin-039:XCU:pathchk:pathchk -p"
<http://www.opengroup.org/austin/interps/doc.tpl?gdid=6232>.
<https://collaboration.opengroup.org/austin/interps/documents.php?action=show&gdid=6232>.
It also rejects the empty name even if the current host accepts it; see
<http://www.opengroup.org/austin/interps/doc.tpl?gdid=6233>.
<https://collaboration.opengroup.org/austin/interps/documents.php?action=show&gdid=6233>.
The --portability option is now equivalent to -p -P.

24
README
View File

@@ -94,16 +94,30 @@ Here is one possible patch to correct the problem:
************************
OSF/1 4.0d build failure
OSF/1 4.0d and AIX build failures
------------------------
If you use /usr/bin/make on an OSF/1 4.0d system, it will fail due
to the presence of the "[" target. That version of make appears to
treat "[" as some syntax relating to locks. To work around that,
If you use /usr/bin/make on these systems, the build will fail due
to the presence of the "[" target. OSF/1 make(1) appears to
treat "[" as some syntax relating to locks, while AIX make(1)
appears to skip the "[" target. To work around these issues
the best solution is to use GNU make. Otherwise, simply remove
all mention of "[$(EXEEXT)" from src/Makefile.
************************
32 bit time_t build failures
------------------------
On systems where it's determined that 64 bit time_t is supported
(indicated by touch -t <some time after 2038>), but that coreutils
would be built with a narrower time_t, the build will fail.
This can be allowed by passing TIME_T_32_BIT_OK=yes to configure,
or avoided by enabling 64 bit builds. For example GCC on AIX defaults
to 32 bit, and to enable the 64 bit ABI one can use:
./configure CFLAGS=-maix64 LDFLAGs=-maix64 AR='ar -X64'
*************************************************
"make check" failure on IRIX 6.5 and Solaris <= 9
-------------------------------------------------
@@ -179,7 +193,7 @@ reproduce whatever problem prompted it. Plus, you'll earn lots of
karma if you include a test case to exercise any bug(s) you fix.
Here are instructions for checking out the latest development sources:
http://savannah.gnu.org/git/?group=coreutils
https://savannah.gnu.org/git/?group=coreutils
If your patch adds a new feature, please try to get some sort of consensus
that it is a worthwhile change. One way to do that is to send mail to

View File

@@ -106,4 +106,4 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.

View File

@@ -8,7 +8,7 @@ I.e., the tools checked for by the bootstrap script and include:
- Git <https://git-scm.com/>
- Gperf <https://www.gnu.org/software/gperf/>
- Gzip <https://www.gnu.org/software/gzip/>
- Perl <http://www.cpan.org/>
- Perl <https://www.cpan.org/>
- Rsync <https://rsync.samba.org/>
- Tar <https://www.gnu.org/software/tar/>
- Texinfo <https://www.gnu.org/software/texinfo/>

View File

@@ -16,7 +16,7 @@ Here are most of the steps we (maintainers) follow when making a release.
* Ensure that you've pushed all changes that belong in the release
and that the NixOS/Hydra autobuilder is reporting all is well:
http://hydra.nixos.org/jobset/gnu/coreutils-master
https://hydra.nixos.org/jobset/gnu/coreutils-master
* Run bootstrap one last time. This downloads any new translations:

View File

@@ -14,7 +14,7 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.

View File

@@ -75,7 +75,7 @@ Augey Mikus mikus@dqc.org
Austin Donnelly Austin.Donnelly@cl.cam.ac.uk
Axel Dörfler axeld@pinc-software.de
Axel Kittenberger Anshil@gmx.net
Barry Kelly http://barrkel.blogspot.com/
Barry Kelly http://blog.barrkel.com/
Bauke Jan Douma bjdouma@xs4all.nl
Ben Elliston bje@air.net.au
Ben Harris bjh21@netbsd.org
@@ -192,6 +192,7 @@ Eli Zaretskii eliz@is.elta.co.il
Emile LeBlanc leblanc@math.toronto.edu
Emmanuel Lacour elacour@home-dn.net
Eric Backus ericb@lsid.hp.com
Eric Bergen eric.bergen@gmail.com
Eric G. Miller egm2@jps.net
Eric Pemente pemente@northpark.edu
Eric S. Raymond esr@snark.thyrsus.com
@@ -264,6 +265,7 @@ Ilya N. Golubev gin@mo.msk.ru
Ingo Saitz ingo@debian.org
Ivan Labath labath3@st.fmph.uniba.sk
Ivo Timmermans ivo@debian.org
Jack Howarth howarth.mailing.lists@gmail.com
Jacky Fong jacky.fong@utoronto.ca
James Antill jmanti%essex.ac.uk@seralph21.essex.ac.uk
James Hunt jamesodhunt@hotmail.com
@@ -375,9 +377,9 @@ Marc Haber mh+debian-bugs@zugschlus.de
Marc Lehman schmorp@schmorp.de
Marc Mengel mengel@fnal.gov
Marc Olzheim marcolz@stack.nl
Marcel Böhme http://www.comp.nus.edu.sg/~mboehme
Marcel Böhme https://www.comp.nus.edu.sg/~mboehme
Marco Franzen Marco.Franzen@Thyron.com
Marcus Brinkmann http://www.marcus-brinkmann.de
Marcus Brinkmann https://www.marcus-brinkmann.de
Marcus Daniels marcus@ee.pdx.edu
Mark A. Thomas thommark@access.digex.net
Mark Conty Mark_Conty@cargill.com

15
TODO
View File

@@ -7,9 +7,9 @@ before embarking on a big project.
==================================================
Modify chmod so that it does not change an inode's st_ctime
when the selected operation would have no other effect.
First suggested by Hans Ecke <http://hans.ecke.ws> in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/2920
Discussed more recently on <http://bugs.debian.org/497514>.
First suggested by Hans Ecke <https://hans.ecke.ws> in
https://lists.gnu.org/r/bug-coreutils/2004-09/msg00145.html
Discussed more recently on <https://bugs.debian.org/497514>.
document the following in coreutils.texi:
[
@@ -52,7 +52,7 @@ Write an autoconf test to work around build failure in HPUX's 64-bit mode.
See notes in README -- and remove them once there's a work-around.
Integrate use of sendfile, suggested here:
http://mail.gnu.org/archive/html/bug-fileutils/2003-03/msg00030.html
https://lists.gnu.org/r/bug-fileutils/2003-03/msg00030.html
I don't plan to do that, since a few tests demonstrate no significant benefit.
printf: consider adapting builtins/printf.def from bash
@@ -86,14 +86,11 @@ sort: Investigate better sorting algorithms; see Knuth vol. 3.
Mathematical Monthly 66 (1959), 387-389.
shred: Update shred as described here to conform to DoD 5220 rules:
http://lists.gnu.org/archive/html/bug-coreutils/2007-05/msg00075.html
https://lists.gnu.org/r/bug-coreutils/2007-05/msg00075.html
Remove suspicious uses of alloca (ones that may allocate more than
about 4k)
Adapt these contribution guidelines for coreutils:
http://sources.redhat.com/automake/contribute.html
Improve test coverage.
See HACKING for instructions on generating an html test coverage report.
Find a program that has poor coverage and improve.
@@ -159,4 +156,4 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.

View File

@@ -1,6 +1,6 @@
#! /bin/sh
# Print a version string.
scriptversion=2017-01-09.19; # UTC
scriptversion=2017-09-19.08; # UTC
# Bootstrap this package from checked-out sources.
@@ -17,7 +17,7 @@ scriptversion=2017-01-09.19; # UTC
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Originally written by Paul Eggert. The canonical version of this
# script is maintained as build-aux/bootstrap in gnulib, however, to
@@ -141,7 +141,7 @@ po_download_command_format=\
# Fallback for downloading .po files (if rsync fails).
po_download_command_format2=\
"wget --mirror -nd -q -np -A.po -P '%s' \
http://translationproject.org/latest/%s/"
https://translationproject.org/latest/%s/"
# Prefer a non-empty tarname (4th argument of AC_INIT if given), else
# fall back to the package name (1st argument with munging)
@@ -699,7 +699,7 @@ download_po_files() {
echo "$me: getting translations into $subdir for $domain..."
cmd=$(printf "$po_download_command_format" "$domain" "$subdir")
eval "$cmd" && return
# Fallback to HTTP.
# Fallback to HTTPS.
cmd=$(printf "$po_download_command_format2" "$subdir" "$domain")
eval "$cmd"
}
@@ -792,7 +792,7 @@ symlink_to_dir()
# aren't confused into doing unnecessary builds. Conversely, if the
# existing symlink's timestamp is older than the source, make it afresh,
# so that broken tools aren't confused into skipping needed builds. See
# <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00326.html>.
# <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00326.html>.
test -h "$dst" &&
src_ls=$(ls -diL "$src" 2>/dev/null) && set $src_ls && src_i=$1 &&
dst_ls=$(ls -diL "$dst" 2>/dev/null) && set $dst_ls && dst_i=$1 &&

View File

@@ -13,7 +13,7 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# We don't need these modules.
@@ -180,6 +180,7 @@ gnulib_modules="
netinet_in
non-recursive-gnulib-prefix-hack
nproc
nstrftime
obstack
open
parse-datetime
@@ -235,7 +236,6 @@ gnulib_modules="
stpcpy
stpncpy
strdup-posix
strftime
strncat
strnumcmp
strpbrk
@@ -294,6 +294,7 @@ gnulib_modules="
xstrtol
xstrtold
xstrtoumax
year2038
yesno
"

View File

@@ -1,8 +1,3 @@
# This file is expected to be used via gitlog-to-changelog's --amend=FILE
# option. It specifies what changes to make to each given SHA1's commit
# log and metadata, using Perl-eval'able expressions.
# I was unable to apply the c-set using normal methods, so
# applied it with patch and then forgot to reset the Author.
51a4b04954ad5ad12de1d1b82a3603fc350a3bfa
s,Jim .*>,Ondrej Oprala <ooprala\@redhat.com>,

9
cfg.mk
View File

@@ -12,14 +12,14 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Used in maint.mk's web-manual rule
manual_title = Core GNU utilities
# Use the direct link. This is guaranteed to work immediately, while
# it can take a while for the faster mirror links to become usable.
url_dir_list = http://ftp.gnu.org/gnu/$(PACKAGE)
url_dir_list = https://ftp.gnu.org/gnu/$(PACKAGE)
# Exclude bundled external projects from syntax checks
VC_LIST_ALWAYS_EXCLUDE_REGEX = src/blake2/.*$$
@@ -48,7 +48,7 @@ export VERBOSE = yes
# 4914152 9e
export XZ_OPT = -8e
old_NEWS_hash = fbfecedc8eaff3d296b43a9f1db2a269
old_NEWS_hash = 8c2a749f657a6bd541e8b9c5227fe26f
# Add an exemption for sc_makefile_at_at_check.
_makefile_at_at_check_exceptions = ' && !/^cu_install_prog/ && !/dynamic-dep/'
@@ -320,11 +320,12 @@ sc_prohibit-gl-attributes:
$(_sc_search_regexp)
# Look for lines longer than 80 characters, except omit:
# - program-generated long lines in diff headers,
# - urls
# - the help2man script copied from upstream,
# - tests involving long checksum lines, and
# - the 'pr' test cases.
FILTER_LONG_LINES = \
\|^[^:]*NEWS:.*https\{,1\}://| d; \
\|^[^:]*man/help2man:| d; \
\|^[^:]*tests/misc/sha[0-9]*sum.*\.pl[-:]| d; \
\|^[^:]*tests/pr/|{ \|^[^:]*tests/pr/pr-tests:| !d; };

View File

@@ -14,7 +14,7 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
dnl Written by Jim Meyering.
@@ -23,9 +23,12 @@ AC_PREREQ([2.69])
# Make inter-release version strings look like, e.g., v6.9-219-g58ddd, which
# indicates that it is built from the 219th delta (in _some_ repository)
# following the v6.9 tag, and that 58ddd is a prefix of the commit SHA1.
# The explicit URL can be removed when autoconf > 2.69 is released.
AC_INIT([GNU coreutils],
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
[bug-coreutils@gnu.org])
[bug-coreutils@gnu.org],
[coreutils],
[https://www.gnu.org/software/coreutils/])
AC_CONFIG_SRCDIR([src/ls.c])

View File

@@ -955,7 +955,7 @@ that are upward compatible with the
@uref{http://www.bipm.org/en/publications/si-brochure/chapter3.html,
SI prefixes}
for decimal multiples and with the
@uref{http://physics.nist.gov/cuu/Units/binary.html, ISO/IEC 80000-13
@uref{https://physics.nist.gov/cuu/Units/binary.html, ISO/IEC 80000-13
(formerly IEC 60027-2) prefixes} for binary multiples.
With human-readable formats, output sizes are followed by a size letter
@@ -8520,8 +8520,9 @@ Equivalent to @option{--no-dereference --preserve=links}.
@opindex --force
When copying without this option and an existing destination file cannot
be opened for writing, the copy fails. However, with @option{--force},
when a destination file cannot be opened, @command{cp} then removes it and
tries to open it again. When this option is combined with
when a destination file cannot be opened, @command{cp} then
tries to recreate the file by first removing it.
When this option is combined with
@option{--link} (@option{-l}) or @option{--symbolic-link}
(@option{-s}), the destination link is replaced, and unless
@option{--backup} (@option{-b}) is also given there is no brief
@@ -9187,7 +9188,9 @@ dd if=ifile iflag=nocache count=0
# Ensure drop cache for the whole file
dd of=ofile oflag=nocache conv=notrunc,fdatasync count=0
# Drop cache for part of file
# Advise to drop cache for part of file
# Note the kernel will only consider complete and
# already persisted pages.
dd if=ifile iflag=nocache skip=10 count=10 of=/dev/null
# Stream data using just the read-ahead cache.
@@ -9955,8 +9958,8 @@ destroy it.
@command{shred} makes no attempt to detect or report this problem, just as
it makes no attempt to do anything about backups. However, since it is
more reliable to shred devices than files, @command{shred} by default does
not truncate or remove the output file. This default is more suitable
for devices, which typically cannot be truncated and should not be
not deallocate or remove the output file. This default is more suitable
for devices, which typically cannot be deallocated and should not be
removed.
Finally, consider the risk of backups and mirrors.
@@ -10013,7 +10016,7 @@ the whole file. @var{bytes} can be followed by a size specification like
@opindex --remove=wipe
@opindex --remove=wipesync
@cindex removing files after shredding
After shredding a file, truncate it (if possible) and then remove it.
After shredding a file, deallocate it (if possible) and then remove it.
If a file has multiple links, only the named links will be removed.
Often the file name is less sensitive than the file data, in which case
the optional @var{how} parameter, supported with the long form option,
@@ -11216,6 +11219,10 @@ line, @command{chmod} changes the permissions of the pointed-to file.
In contrast, @command{chmod} ignores symbolic links encountered during
recursive directory traversals.
Only a process whose effective user ID matches the user ID of the file,
or a process with appropriate privileges, is permitted to change the
file mode bits of a file.
A successful use of @command{chmod} clears the set-group-ID bit of a
regular file if the file's group ID does not match the user's
effective group ID or one of the user's supplementary group IDs,
@@ -12244,7 +12251,7 @@ numbers unambiguously octal, you can use @samp{%#03a}.
The @samp{%N} format can be set with the environment variable
@env{QUOTING_STYLE}@. If that environment variable is not set,
the default value is @samp{shell-escape}. Valid quoting styles are:
the default value is @samp{shell-escape-always}. Valid quoting styles are:
@quotingStyles
The @samp{%t} and @samp{%T} formats operate on the st_rdev member of
@@ -14173,6 +14180,10 @@ Exit status:
1 otherwise.
@end display
@menu
* Realpath usage examples:: Realpath usage examples.
@end menu
@node Realpath usage examples
@subsection Realpath usage examples
@@ -17382,6 +17393,12 @@ the @var{command}.
Send this @var{signal} to @var{command} on timeout, rather than the
default @samp{TERM} signal. @var{signal} may be a name like @samp{HUP}
or a number. @xref{Signal specifications}.
@item -v
@itemx --verbose
@opindex -v
@opindex --verbose
Diagnose to stderr, any signal sent upon timeout.
@end table
@cindex time units
@@ -18179,7 +18196,7 @@ to set a file's timestamp to an arbitrary value.
@chapter Opening the Software Toolbox
An earlier version of this chapter appeared in
@uref{http://www.linuxjournal.com/article.php?sid=2762, the
@uref{https://www.linuxjournal.com/article.php?sid=2762, the
@cite{What's GNU@?} column of the June 1994 @cite{Linux Journal}}.
It was written by Arnold Robbins.

View File

@@ -14,7 +14,7 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
info_TEXINFOS = doc/coreutils.texi

View File

@@ -13,7 +13,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Paul Eggert. */

View File

@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Without this pragma, gcc suggests that (given !HAVE_POSIX_FADVISE)
the fdadvise function might be a candidate for attribute 'const'. */

View File

@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>

View File

@@ -13,7 +13,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Paul Eggert. */

View File

@@ -13,7 +13,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Paul Eggert. */

View File

@@ -13,7 +13,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Full implementation: GDSL (http://gna.org/projects/gdsl/) by Nicolas
Darnis <ndarnis@free.fr>. */

View File

@@ -13,7 +13,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Full implementation: GDSL (http://gna.org/projects/gdsl/) by Nicolas
Darnis <ndarnis@free.fr>. Adapted by Gene Auyeung. */

View File

@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Pádraig Brady. */

View File

@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#include <stddef.h>

View File

@@ -14,7 +14,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.
Written by Colin Plumb and Paul Eggert. */

View File

@@ -14,7 +14,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.
Written by Colin Plumb and Paul Eggert. */

View File

@@ -13,7 +13,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Paul Eggert. */

View File

@@ -13,7 +13,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Paul Eggert. */

View File

@@ -13,7 +13,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Paul Eggert. */

View File

@@ -13,7 +13,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Paul Eggert. */

View File

@@ -13,7 +13,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Paul Eggert. */

View File

@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Jim Meyering. */

View File

@@ -13,7 +13,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#ifndef ROOT_DEV_INO_H
# define ROOT_DEV_INO_H 1

View File

@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Here we replace or wrap the most common smack functions used by coreutils.
Others will need to be protected by HAVE_SMACK. */

View File

@@ -13,7 +13,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Paul Eggert. */

View File

@@ -13,7 +13,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Mike Haertel. */

View File

@@ -13,7 +13,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Paul Eggert. */

View File

@@ -13,7 +13,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#include <config.h>

View File

@@ -13,7 +13,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#ifndef XDECTOINT_H_
# define XDECTOINT_H_ 1

View File

@@ -13,7 +13,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Jim Meyering. */

View File

@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Pádraig Brady. */

View File

@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Pádraig Brady. */

View File

@@ -13,7 +13,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Paul Eggert. */

2
gnulib

Submodule gnulib updated: a20922f105...21d224dc9e

View File

@@ -13,7 +13,7 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# This goes hand in hand with the "exec 9>&2;" in tests/Makefile.am's
# TESTS_ENVIRONMENT definition.
@@ -627,7 +627,7 @@ skip_if_setgid_()
# Skip if files are created with a different group to the current user
# This can happen due to a setgid dir, or by some other mechanism on OS X:
# http://unix.stackexchange.com/q/63865
# https://unix.stackexchange.com/q/63865
# https://bugs.gnu.org/14024#41
skip_if_nondefault_group_()
{

View File

@@ -14,7 +14,7 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# FIXME: add traps and choose top level names so that

View File

@@ -14,7 +14,7 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# GNULIB_BOOT_TIME([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
* ----------------------------------------------------------

View File

@@ -15,7 +15,7 @@ dnl Misc type-related macros for coreutils.
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Written by Jim Meyering.
@@ -211,6 +211,7 @@ AC_DEFUN([gl_CHECK_ALL_HEADERS],
paths.h
priv.h
stropts.h
sys/mtio.h
sys/param.h
sys/systeminfo.h
syslog.h

View File

@@ -20,7 +20,7 @@ m4_pattern_forbid([^gl_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Written by Jim Meyering.

View File

@@ -14,7 +14,7 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Written by Jim Meyering.

View File

@@ -1,7 +1,7 @@
'\" Copyright (C) 1998-2017 Free Software Foundation, Inc.
'\"
'\" This is free software. You may redistribute copies of it under the terms
'\" of the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
'\" of the GNU General Public License <https://www.gnu.org/licenses/gpl.html>.
'\" There is NO WARRANTY, to the extent permitted by law.
[NAME]
chmod \- change file mode bits
@@ -87,14 +87,19 @@ functionality of the underlying
system call. When in
doubt, check the underlying system behavior.
.PP
For directories
.B chmod
preserves a directory's set-user-ID and set-group-ID bits unless you
preserves set-user-ID and set-group-ID bits unless you
explicitly specify otherwise. You can set or clear the bits with
symbolic modes like
.B u+s
and
.BR g\-s ,
and you can set (but not clear) the bits with a numeric mode.
.BR g\-s .
To clear these bits for directories with a numeric mode requires
an additional leading zero, or leading = like
.B 00755
, or
.B =755
.SH "RESTRICTED DELETION FLAG OR STICKY BIT"
The restricted deletion flag or sticky bit is a single bit, whose
interpretation depends on the file type. For directories, it prevents

View File

@@ -1,7 +1,7 @@
'\" Copyright (C) 1998-2017 Free Software Foundation, Inc.
'\"
'\" This is free software. You may redistribute copies of it under the terms
'\" of the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
'\" of the GNU General Public License <https://www.gnu.org/licenses/gpl.html>.
'\" There is NO WARRANTY, to the extent permitted by law.
[NAME]
chown \- change file owner and group

View File

@@ -1,7 +1,7 @@
'\" Copyright (C) 1998-2017 Free Software Foundation, Inc.
'\"
'\" This is free software. You may redistribute copies of it under the terms
'\" of the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
'\" of the GNU General Public License <https://www.gnu.org/licenses/gpl.html>.
'\" There is NO WARRANTY, to the extent permitted by law.
[NAME]
df \- report file system disk space usage

View File

@@ -1,7 +1,7 @@
'\" Copyright (C) 1998-2017 Free Software Foundation, Inc.
'\"
'\" This is free software. You may redistribute copies of it under the terms
'\" of the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
'\" of the GNU General Public License <https://www.gnu.org/licenses/gpl.html>.
'\" There is NO WARRANTY, to the extent permitted by law.
[NAME]
du \- estimate file space usage

View File

@@ -1,8 +1,7 @@
#!/bin/sh
# Poor man's placeholder for help2man invocation on systems lacking perl;
# it generates a dummy man page stating that a proper one could not be
# generated, and redirecting the user back to either the info
# documentation or the '--help' output.
# Poor man's placeholder for help2man invocation on systems lacking perl,
# or when cross compiling.
# It just copies the distributed man pages.
set -e; set -u
@@ -24,12 +23,12 @@ while test $# -gt 0; do
# Help2man options we recognize and handle.
--output=*) output=`expr x"$1" : x'--output=\(.*\)'`;;
--output) shift; output=$1;;
--include=*) include=`expr x"$1" : x'--include=\(.*\)'`;;
--include) shift; include=$1;;
--source=*) source=`expr x"$1" : x'--source=\(.*\)'`;;
--source) shift; source=$1;;
# Recognize (as no-op) other help2man options that might be used
# in the makefile.
--include=*);;
--include) shift;;
--info-page=*);;
-*) fatal_ "invalid or unrecognized help2man option '$1'";;
--) shift; break;;
@@ -41,10 +40,13 @@ done
test $# -gt 0 || fatal_ "missing argument"
test $# -le 1 || fatal_ "too many non-option arguments"
dist_man=$(printf '%s\n' "$include" | sed 's/\.x$/.1/')
test -f "$dist_man" && cp "$dist_man" "$output" && exit || :
baseout=`basename_ "$output"`
sed 's/^/WARNING: /' >&2 <<END
Cannot create proper '$baseout' man page, since perl is missing or
inadequate on this system. Creating a stub man page instead.
Did not generate or find default '$baseout' man page.
Creating a stub man page instead.
END
progname=`basename_ "$1"`
@@ -55,9 +57,8 @@ cat >"$output" <<END
.SH NAME
$progname $bs- a $source program
.SH DESCRIPTION
.B OOOPS!
Due to the lack of perl on the build system, we were
unable to create a proper manual page for
.B OOPS!
We were unable to create a proper manual page for
.B $progname.
For concise option descriptions, run
.IP

View File

@@ -15,10 +15,10 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
# along with this program; if not, see <https://www.gnu.org/licenses/>.
# Written by Brendan O'Dea <bod@debian.org>
# Available from ftp://ftp.gnu.org/gnu/help2man/
# Available from https://ftp.gnu.org/gnu/help2man/
use 5.008;
use strict;
@@ -256,7 +256,7 @@ my $epoch_secs = time;
if (exists $ENV{SOURCE_DATE_EPOCH} and $ENV{SOURCE_DATE_EPOCH} =~ /^(\d+)$/)
{
$epoch_secs = $1;
$ENV{TZ} = 'UTC';
$ENV{TZ} = 'UTC0';
}
# Translators: the following message is a strftime(3) format string, which in

View File

@@ -14,26 +14,31 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
EXTRA_DIST += man/help2man man/dummy-man
## Use the distributed man pages if cross compiling or lack perl
if CROSS_COMPILING
run_help2man = $(SHELL) $(srcdir)/man/dummy-man
else
## Graceful degradation for systems lacking perl.
if HAVE_PERL
run_help2man = $(PERL) -- $(srcdir)/man/help2man
else
run_help2man = $(SHELL) $(srcdir)/man/dummy-man
endif
endif
man1_MANS = @man1_MANS@
EXTRA_DIST += $(man1_MANS:.1=.x)
EXTRA_DIST += $(man1_MANS) $(man1_MANS:.1=.x)
EXTRA_MANS = @EXTRA_MANS@
EXTRA_DIST += $(EXTRA_MANS:.1=.x)
EXTRA_DIST += $(EXTRA_MANS) $(EXTRA_MANS:.1=.x)
ALL_MANS = $(man1_MANS) $(EXTRA_MANS)
CLEANFILES += $(ALL_MANS)
MAINTAINERCLEANFILES += $(ALL_MANS)
# This is a kludge to remove generated 'man/*.1' from a non-srcdir build.
# Without this, "make distcheck" might fail.
@@ -179,13 +184,14 @@ endif
## Note the use of $$t/$*, rather than just '$*' as in other packages.
## That is necessary to avoid failures for programs that are also shell
## built-in functions like echo, false, printf, pwd.
rm -f $@ $@-t \
rm -f $@-t \
&& t=$*.td \
&& rm -rf $$t \
&& $(MKDIR_P) $$t \
&& (cd $$t && $(LN_S) '$(abs_top_builddir)/src/'$$prog$(EXEEXT) \
$$argv$(EXEEXT)) \
&& : $${SOURCE_DATE_EPOCH=`cat $(srcdir)/.timestamp 2>/dev/null || :`} \
&& : $${TZ=UTC0} && export TZ \
&& export SOURCE_DATE_EPOCH && $(run_help2man) \
--source='$(PACKAGE_STRING)' \
--include=$(srcdir)/man/$$name.x \
@@ -198,4 +204,4 @@ endif
$$t/$$name.1 > $@-t \
&& rm -rf $$t \
&& chmod a-w $@-t \
&& mv $@-t $@
&& rm -f $@ && mv $@-t $@

View File

@@ -1,7 +1,7 @@
'\" Copyright (C) 1998-2017 Free Software Foundation, Inc.
'\"
'\" This is free software. You may redistribute copies of it under the terms
'\" of the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
'\" of the GNU General Public License <https://www.gnu.org/licenses/gpl.html>.
'\" There is NO WARRANTY, to the extent permitted by law.
[NAME]
rm \- remove files or directories

View File

@@ -3,4 +3,4 @@ stat \- display file or file system status
[DESCRIPTION]
.\" Add any additional description here
[SEE ALSO]
stat(2)
stat(2), statfs(2)

View File

@@ -1,7 +1,7 @@
'\" Copyright (C) 2009-2017 Free Software Foundation, Inc.
'\"
'\" This is free software. You may redistribute copies of it under the terms
'\" of the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
'\" of the GNU General Public License <https://www.gnu.org/licenses/gpl.html>.
'\" There is NO WARRANTY, to the extent permitted by law.
[NAME]
stdbuf \-

View File

@@ -1,5 +1,5 @@
#!/bin/sh
VERSION='2015-10-06 12:49' # UTC
VERSION='2017-09-19 07:31' # UTC
# Building coreutils from a git-cloned directory may require versions of
# tools like autoconf, automake, gettext, etc. that are newer than the ones
@@ -26,12 +26,12 @@ prog_name=`basename $0`
die () { echo "$prog_name: $*" >&2; exit 1; }
tarballs='
http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz
http://ftp.gnu.org/gnu/m4/m4-1.4.17.tar.gz
http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
http://ftp.gnu.org/gnu/automake/automake-1.15.tar.gz
http://ftp.gnu.org/gnu/libtool/libtool-2.4.6.tar.gz
http://ftp.gnu.org/gnu/gettext/gettext-0.19.6.tar.gz
https://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz
https://ftp.gnu.org/gnu/m4/m4-1.4.17.tar.gz
https://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
https://ftp.gnu.org/gnu/automake/automake-1.15.tar.gz
https://ftp.gnu.org/gnu/libtool/libtool-2.4.6.tar.gz
https://ftp.gnu.org/gnu/gettext/gettext-0.19.6.tar.gz
'
usage() {

View File

@@ -125,10 +125,13 @@ sub check_msg($$)
my $buf = join ("\n", @line) . "\n";
$buf =~ m!https?://bugzilla\.redhat\.com/show_bug\.cgi\?id=(\d+)!s
and return "use shorter http://bugzilla.redhat.com/$1";
and return "use shorter https://bugzilla.redhat.com/$1";
$buf =~ m!https?://debbugs\.gnu\.org/(?:cgi/bugreport\.cgi\?bug=)?(\d+)!s
and return "use shorter http://bugs.gnu.org/$1";
and return "use shorter https://bugs.gnu.org/$1";
$buf =~ m!https://lists\.gnu\.org/archive/html/!s
and return "use '/r/' in place of '/archive/html/' in lists.gnu.org URLs";
$buf =~ /^ *Signed-off-by:/mi
and return q(do not use "Signed-off-by:");

View File

@@ -14,7 +14,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Simon Josefsson <simon@josefsson.org>. */

View File

@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#include <config.h>
#include <getopt.h>

View File

@@ -5,9 +5,9 @@
terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at
your option. The terms of these licenses can be found at:
- CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0
- CC0 1.0 Universal : https://creativecommons.org/publicdomain/zero/1.0
- OpenSSL license : https://www.openssl.org/source/license.html
- Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0
- Apache 2.0 : https://www.apache.org/licenses/LICENSE-2.0
More information about the BLAKE2 hash function can be found at
https://blake2.net.

View File

@@ -5,9 +5,9 @@
terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at
your option. The terms of these licenses can be found at:
- CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0
- CC0 1.0 Universal : https://creativecommons.org/publicdomain/zero/1.0
- OpenSSL license : https://www.openssl.org/source/license.html
- Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0
- Apache 2.0 : https://www.apache.org/licenses/LICENSE-2.0
More information about the BLAKE2 hash function can be found at
https://blake2.net.

View File

@@ -5,9 +5,9 @@
terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at
your option. The terms of these licenses can be found at:
- CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0
- CC0 1.0 Universal : https://creativecommons.org/publicdomain/zero/1.0
- OpenSSL license : https://www.openssl.org/source/license.html
- Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0
- Apache 2.0 : https://www.apache.org/licenses/LICENSE-2.0
More information about the BLAKE2 hash function can be found at
https://blake2.net.

View File

@@ -5,9 +5,9 @@
terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at
your option. The terms of these licenses can be found at:
- CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0
- CC0 1.0 Universal : https://creativecommons.org/publicdomain/zero/1.0
- OpenSSL license : https://www.openssl.org/source/license.html
- Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0
- Apache 2.0 : https://www.apache.org/licenses/LICENSE-2.0
More information about the BLAKE2 hash function can be found at
https://blake2.net.

View File

@@ -5,9 +5,9 @@
terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at
your option. The terms of these licenses can be found at:
- CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0
- CC0 1.0 Universal : https://creativecommons.org/publicdomain/zero/1.0
- OpenSSL license : https://www.openssl.org/source/license.html
- Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0
- Apache 2.0 : https://www.apache.org/licenses/LICENSE-2.0
More information about the BLAKE2 hash function can be found at
https://blake2.net.

View File

@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Differences from the Unix cat:
* Always unbuffered, -u is ignored.

View File

@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>

View File

@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */

View File

@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by David MacKenzie <djm@gnu.ai.mit.edu> */

View File

@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Extracted from chown.c/chgrp.c and librarified by Jim Meyering. */

View File

@@ -13,7 +13,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#ifndef CHOWN_CORE_H
# define CHOWN_CORE_H

View File

@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */

View File

@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Roland McGrath. */

View File

@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Q. Frank Xia, qx@math.columbia.edu.
Cosmetic changes and reorganization by David MacKenzie, djm@gnu.ai.mit.edu.
@@ -107,6 +107,11 @@ main (void)
# include "die.h"
# include "error.h"
static struct option const long_options[] =
{
{NULL, 0, NULL, 0}
};
/* Number of bytes to read at once. */
# define BUFLEN (1 << 16)
@@ -291,7 +296,7 @@ main (int argc, char **argv)
parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE, Version,
usage, AUTHORS, (char const *) NULL);
if (getopt_long (argc, argv, "", NULL, NULL) != -1)
if (getopt_long (argc, argv, "", long_options, NULL) != -1)
usage (EXIT_FAILURE);
have_read_stdin = false;

View File

@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Richard Stallman and David MacKenzie. */

View File

@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Extracted from cp.c and librarified by Jim Meyering. */

View File

@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Extracted from cp.c and librarified by Jim Meyering. */

View File

@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Alex Deymo <deymo@chromium.org>. */

View File

@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Alex Deymo <deymo@chromium.org>. */

View File

@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Alex Deymo <deymo@chromium.org>. */

View File

@@ -11,7 +11,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* coreutils.c aggregates the functionality of every other tool into a single
binary multiplexed by the value of argv[0]. This is enabled by passing

View File

@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.
Written by Torbjorn Granlund, Sweden (tege@sics.se).
Rewritten to use lib/hash.c by Jim Meyering. */

View File

@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.
Written by Torbjorn Granlund, David MacKenzie, and Jim Meyering. */

View File

@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Stuart Kemp, cpsrk@groper.jcu.edu.au.
Modified by David MacKenzie, djm@gnu.ai.mit.edu. */

View File

@@ -13,7 +13,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by David Ihnat. */

View File

@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.
David MacKenzie <djm@gnu.ai.mit.edu> */

View File

@@ -14,7 +14,7 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# written by Jim Meyering

147
src/dd.c
View File

@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Paul Rubin, David MacKenzie, and Stuart Kemp. */
@@ -31,6 +31,7 @@
#include "fd-reopen.h"
#include "gethrxtime.h"
#include "human.h"
#include "ioblksize.h"
#include "long-options.h"
#include "quote.h"
#include "verror.h"
@@ -45,6 +46,11 @@
proper_name ("David MacKenzie"), \
proper_name ("Stuart Kemp")
static struct option const long_options[] =
{
{NULL, 0, NULL, 0}
};
/* Use SA_NOCLDSTOP as a proxy for whether the sigaction machinery is
present. */
#ifndef SA_NOCLDSTOP
@@ -266,6 +272,9 @@ static sig_atomic_t volatile info_signal_count;
/* Whether to discard cache for input or output. */
static bool i_nocache, o_nocache;
/* Whether to instruct the kernel to discard the complete file. */
static bool i_nocache_eof, o_nocache_eof;
/* Function used for read (to handle iflag=fullblock parameter). */
static ssize_t (*iread_fnc) (int fd, char *buf, size_t size);
@@ -1000,7 +1009,8 @@ quit (int code)
exit (code);
}
/* Return LEN rounded down to a multiple of PAGE_SIZE
/* Return LEN rounded down to a multiple of IO_BUFSIZE
(to minimize calls to the expensive posix_fadvise(,POSIX_FADV_DONTNEED),
while storing the remainder internally per FD.
Pass LEN == 0 to get the current remainder. */
@@ -1013,7 +1023,7 @@ cache_round (int fd, off_t len)
if (len)
{
uintmax_t c_pending = *pending + len;
*pending = c_pending % page_size;
*pending = c_pending % IO_BUFSIZE;
if (c_pending > *pending)
len = c_pending - *pending;
else
@@ -1033,55 +1043,65 @@ static bool
invalidate_cache (int fd, off_t len)
{
int adv_ret = -1;
off_t offset;
bool nocache_eof = (fd == STDIN_FILENO ? i_nocache_eof : o_nocache_eof);
/* Minimize syscalls. */
off_t clen = cache_round (fd, len);
if (len && !clen)
return true; /* Don't advise this time. */
if (!len && !clen && max_records)
return true; /* Nothing pending. */
else if (! len && ! clen && ! nocache_eof)
return true;
off_t pending = len ? cache_round (fd, 0) : 0;
if (fd == STDIN_FILENO)
{
if (input_seekable)
{
/* Note we're being careful here to only invalidate what
we've read, so as not to dump any read ahead cache. */
#if HAVE_POSIX_FADVISE
adv_ret = posix_fadvise (fd, input_offset - clen - pending, clen,
POSIX_FADV_DONTNEED);
#else
errno = ENOTSUP;
#endif
}
offset = input_offset;
else
errno = ESPIPE;
{
offset = -1;
errno = ESPIPE;
}
}
else if (fd == STDOUT_FILENO)
else
{
static off_t output_offset = -2;
if (output_offset != -1)
{
if (0 > output_offset)
{
output_offset = lseek (fd, 0, SEEK_CUR);
output_offset -= clen + pending;
}
if (0 <= output_offset)
{
#if HAVE_POSIX_FADVISE
adv_ret = posix_fadvise (fd, output_offset, clen,
POSIX_FADV_DONTNEED);
#else
errno = ENOTSUP;
#endif
output_offset += clen + pending;
}
if (output_offset < 0)
output_offset = lseek (fd, 0, SEEK_CUR);
else if (len)
output_offset += clen + pending;
}
offset = output_offset;
}
if (0 <= offset)
{
if (! len && clen && nocache_eof)
{
pending = clen;
clen = 0;
}
/* Note we're being careful here to only invalidate what
we've read, so as not to dump any read ahead cache.
Note also the kernel is conservative and only invalidates
full pages in the specified range. */
#if HAVE_POSIX_FADVISE
offset = offset - clen - pending;
/* ensure full page specified when invalidating to eof. */
if (clen == 0)
offset -= offset % page_size;
adv_ret = posix_fadvise (fd, offset, clen, POSIX_FADV_DONTNEED);
#else
errno = ENOTSUP;
#endif
}
return adv_ret != -1 ? true : false;
}
@@ -1093,11 +1113,21 @@ static ssize_t
iread (int fd, char *buf, size_t size)
{
ssize_t nread;
static ssize_t prev_nread;
do
{
process_signals ();
nread = read (fd, buf, size);
/* Ignore final read error with iflag=direct as that
returns EINVAL due to the non aligned file offset. */
if (nread == -1 && errno == EINVAL
&& 0 < prev_nread && prev_nread < size
&& (input_flags & O_DIRECT))
{
errno = 0;
nread = 0;
}
}
while (nread < 0 && errno == EINTR);
@@ -1107,8 +1137,6 @@ iread (int fd, char *buf, size_t size)
if (0 < nread && warn_partial_read)
{
static ssize_t prev_nread;
if (0 < prev_nread && prev_nread < size)
{
uintmax_t prev = prev_nread;
@@ -1121,10 +1149,9 @@ iread (int fd, char *buf, size_t size)
prev);
warn_partial_read = false;
}
prev_nread = nread;
}
prev_nread = nread;
return nread;
}
@@ -1168,15 +1195,19 @@ iwrite (int fd, char const *buf, size_t size)
quotef (output_file));
/* Since we have just turned off O_DIRECT for the final write,
here we try to preserve some of its semantics. First, use
posix_fadvise to tell the system not to pollute the buffer
cache with this data. Don't bother to diagnose lseek or
posix_fadvise failure. */
we try to preserve some of its semantics. */
/* Call invalidate_cache() to setup the appropriate offsets
for subsequent calls. */
o_nocache_eof = true;
invalidate_cache (STDOUT_FILENO, 0);
/* Attempt to ensure that that final block is committed
to disk as quickly as possible. */
conversions_mask |= C_FSYNC;
/* After the subsequent fsync() we'll call invalidate_cache()
to attempt to clear all data from the page cache. */
}
while (total_written < size)
@@ -1562,11 +1593,13 @@ scanargs (int argc, char *const *argv)
if (input_flags & O_NOCACHE)
{
i_nocache = true;
i_nocache_eof = (max_records == 0 && max_bytes == 0);
input_flags &= ~O_NOCACHE;
}
if (output_flags & O_NOCACHE)
{
o_nocache = true;
o_nocache_eof = (max_records == 0 && max_bytes == 0);
output_flags &= ~O_NOCACHE;
}
}
@@ -1687,7 +1720,7 @@ advance_input_offset (uintmax_t offset)
The offending behavior has been confirmed with an Exabyte SCSI tape
drive accessed via /dev/nst0 on both Linux 2.2.17 and 2.4.16 kernels. */
#ifdef __linux__
#if defined __linux__ && HAVE_SYS_MTIO_H
# include <sys/mtio.h>
@@ -2149,13 +2182,19 @@ dd_copy (void)
else
nread = iread_fnc (STDIN_FILENO, ibuf, input_blocksize);
if (nread >= 0 && i_nocache)
invalidate_cache (STDIN_FILENO, nread);
if (nread == 0)
break; /* EOF. */
if (nread < 0)
if (nread > 0)
{
advance_input_offset (nread);
if (i_nocache)
invalidate_cache (STDIN_FILENO, nread);
}
else if (nread == 0)
{
i_nocache_eof |= i_nocache;
o_nocache_eof |= o_nocache && ! (conversions_mask & C_NOTRUNC);
break; /* EOF. */
}
else
{
if (!(conversions_mask & C_NOERROR) || status_level != STATUS_NONE)
error (0, errno, _("error reading %s"), quoteaf (input_file));
@@ -2194,7 +2233,6 @@ dd_copy (void)
}
n_bytes_read = nread;
advance_input_offset (nread);
if (n_bytes_read < input_blocksize)
{
@@ -2361,7 +2399,7 @@ main (int argc, char **argv)
usage, AUTHORS, (char const *) NULL);
close_stdout_required = false;
if (getopt_long (argc, argv, "", NULL, NULL) != -1)
if (getopt_long (argc, argv, "", long_options, NULL) != -1)
usage (EXIT_FAILURE);
/* Initialize translation table to identity translation. */
@@ -2470,13 +2508,12 @@ main (int argc, char **argv)
exit_status = EXIT_FAILURE;
}
}
else if (max_records != (uintmax_t) -1)
else
{
/* Invalidate any pending region less than page size,
in case the kernel might round up. */
if (i_nocache)
/* Invalidate any pending region or to EOF if appropriate. */
if (i_nocache || i_nocache_eof)
invalidate_cache (STDIN_FILENO, 0);
if (o_nocache)
if (o_nocache || o_nocache_eof)
invalidate_cache (STDOUT_FILENO, 0);
}

View File

@@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>.
--human-readable option added by lm@sgi.com.
@@ -1702,24 +1702,25 @@ main (int argc, char **argv)
if (optind < argc)
{
/* Open each of the given entries to make sure any corresponding
/* stat each of the given entries to make sure any corresponding
partition is automounted. This must be done before reading the
file system table. */
stats = xnmalloc (argc - optind, sizeof *stats);
for (int i = optind; i < argc; ++i)
{
/* Prefer to open with O_NOCTTY and use fstat, but fall back
on using "stat", in case the file is unreadable. */
int fd = open (argv[i], O_RDONLY | O_NOCTTY);
if ((fd < 0 || fstat (fd, &stats[i - optind]))
&& stat (argv[i], &stats[i - optind]))
if (stat (argv[i], &stats[i - optind]))
{
error (0, errno, "%s", quotef (argv[i]));
exit_status = EXIT_FAILURE;
argv[i] = NULL;
}
if (0 <= fd)
close (fd);
else if (! S_ISFIFO (stats[i - optind].st_mode))
{
/* open() is needed to automount in some cases. */
int fd = open (argv[i], O_RDONLY | O_NOCTTY);
if (0 <= fd)
close (fd);
}
}
}

Some files were not shown because too many files have changed in this diff Show More