]> Dogcows Code - chaz/tar/commitdiff
tar: port --overwrite symlink test to GNU/Hurd
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 18 Jan 2012 06:21:52 +0000 (22:21 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 18 Jan 2012 06:22:23 +0000 (22:22 -0800)
Problem reported by Pino Toscano in
<http://lists.gnu.org/archive/html/bug-tar/2012-01/msg00040.html>.
* gnulib.modules: Add fcntl-h, which defines
HAVE_WORKING_O_NOFOLLOW.
* src/extract.c (open_output_file): Use HAVE_WORKING_O_NOFOLLOW,
not O_NOFOLLOW, when testing whther O_NOFOLLOW works.

This file is a placeholder. It will be replaced with the actual ChangeLog
by make dist.  Run make ChangeLog if you wish to create it earlier.

gnulib.modules
src/extract.c

index 49eab656fc155376b29921943753c2bdc14a5e4a..43c9de16d48f8fe15883505666e11f597bef9dad 100644 (file)
@@ -12,6 +12,7 @@ dirname
 error
 exclude
 exitfail
+fcntl-h
 fdopendir
 fdutimensat
 fileblocks
index 55f3eb860e2a616f982529f667adb044b7caf16c..bd5e7bf588daecfa0da25ef9fa1bc64957e1be8e 100644 (file)
@@ -887,7 +887,8 @@ open_output_file (char const *file_name, int typeflag, mode_t mode,
   /* If O_NOFOLLOW is needed but does not work, check for a symlink
      separately.  There's a race condition, but that cannot be avoided
      on hosts lacking O_NOFOLLOW.  */
-  if (! O_NOFOLLOW && overwriting_old_files && ! dereference_option)
+  if (! HAVE_WORKING_O_NOFOLLOW
+      && overwriting_old_files && ! dereference_option)
     {
       struct stat st;
       if (fstatat (chdir_fd, file_name, &st, AT_SYMLINK_NOFOLLOW) == 0
This page took 0.025966 seconds and 4 git commands to generate.