bug-tar
[Top][All Lists]
Advanced

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

[Bug-tar] Restoring part of a TAR archive: Meta information


From: Markus Fromme
Subject: [Bug-tar] Restoring part of a TAR archive: Meta information
Date: Thu, 08 Sep 2016 20:38:19 +0200

Hello,

please allow for a short question as I'm not sure whether I'm encountering
a bug or expected behaviour.

When extracting part of a TAR archive any directories and files given as
arguments on the command line a restored with the correct meta information
(uid/gid), but higher-level directories which are created implicitly don't
receive the correct meta data.

I have created a short testcase:

linux:/tmp # mkdir -p foo/bar
linux:/tmp # echo MyFile > foo/bar/myfile
linux:/tmp # chown -R 5000:5000 foo

linux:/tmp # find foo -ls
271257    4 drwxr-xr-x   3 5000     5000     4096 Sep  8 20:03 foo
271258    4 drwxr-xr-x   2 5000     5000     4096 Sep  8 20:03 foo/bar
271259    4 -rw-r--r--   1 5000     5000        7 Sep  8 20:03 foo/bar/myfile

linux:/tmp # tar cvfj foo.tar.bz2 foo
foo/
foo/bar/
foo/bar/myfile

linux:/tmp # rm -rf foo  # remove original files/dirs

linux:/tmp # tar xvfj foo.tar.bz2 foo/bar/myfile  # extract single file
foo/bar/myfile

linux:/tmp # find foo -ls
271257    4 drwxr-xr-x   3 root     root     4096 Sep  8 20:05 foo
271258    4 drwxr-xr-x   2 root     root     4096 Sep  8 20:05 foo/bar
271259    4 -rw-r--r--   1 5000     5000        7 Sep  8 20:03 foo/bar/myfile

Only the file given on the command line, foo/bar/myfile, has been extracted,
showing the correct uid/gid while foo and foo/bar do not.

I suppose that this a consequence of creating the higher-level directories
implicitly by TAR. Nevertheless it would desirable to restore part of a
TAR archive having the meta information of higher-level directories set
to the original values.

If the behaviour shown is not a bug I would be thankful for a short tip
on this issue.

Thanks in advance
Markus

--
Markus Fromme
ILI Institute for Innovation in Learning
Friedrich-Alexander-Universität Erlangen-Nürnberg
Dr.-Mack-Straße 77, 90762 Fürth, Germany

reply via email to

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