bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Option "--no-overwrite-dir" does not work for empty directories


From: Michael Kaufmann
Subject: Option "--no-overwrite-dir" does not work for empty directories
Date: Fri, 07 Feb 2020 11:29:34 +0100
User-agent: Horde Application Framework 5

Hi tar maintainers,

I think I have found a bug with the option "--no-overwrite-dir". It does not work if the tarfile contains an empty directory. When restoring this directory, the metadata of the existing directory is overwritten. I use tar 1.32.

Example:

$ umask 022
$ mkdir test
$ chmod 777 test
$ tar -cf test.tar test
$ tar -x --no-overwrite-dir -f test.tar
$ ls -lad test
drwxr-xr-x 2 mka slt 4096 Feb  7 10:56 test

Expected Output:
drwxrwxrwx 2 mka slt 4096 Feb  7 10:56 test


Example with a non-empty directory (this works):

$ umask 022
$ mkdir test
$ chmod 777 test
$ touch test/file
$ tar -cf test.tar test
$ tar -x --no-overwrite-dir -f test.tar
$ ls -lad test
drwxrwxrwx 2 mka slt 4096 Feb  7 10:58 test


Kind regards,
Michael Kaufmann




reply via email to

[Prev in Thread] Current Thread [Next in Thread]