diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2018-10-28 01:45:17 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2018-10-28 01:46:11 -0700 |
commit | 806b0d15808cd28a3ab7da7bc038f4b8093dbffa (patch) | |
tree | 977249d77c4ae5f8e34d1f5610928b1fc564de78 /bootstrap.conf | |
parent | d9a4d983717c6db33b1b568180ad30ad9c2233b4 (diff) | |
download | coreutils-806b0d15808cd28a3ab7da7bc038f4b8093dbffa.tar.gz |
ln: use linkat and symlinkat
Open a target directory and use its file descriptor in linkat,
symlinkat, etc. syscalls, instead of constructing long file names
by concatenating the target directory name to a basename.
This avoids O(N²) behavior with ‘ln F1 F2 ... Fn DIR’ when DIR is
a long file name with many slashes. It also avoids some races if
DIR is renamed while ln is running.
* bootstrap.conf (gnulib_modules): Add openat-safer.
* src/ln.c: Include fcntl-safer.h.
(O_PATHSEARCH): New constant.
(errno_nonexisting, target_directory_operand): Remove; no longer used.
(atomic_link, do_link): New arg DESTDIR_FD. All uses changed.
(do_link): New arg DEST_BASE. All uses changed.
(main): Open target directory and use its file descriptor
as DESTDIR_FD.
Diffstat (limited to 'bootstrap.conf')
-rw-r--r-- | bootstrap.conf | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/bootstrap.conf b/bootstrap.conf index f193a5825..6e3f3e1ab 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -182,6 +182,7 @@ gnulib_modules=" nstrftime obstack open + openat-safer parse-datetime pathmax perl |