Bug 3989 - hardlinks to symlinks cause corrupted permissions
Summary: hardlinks to symlinks cause corrupted permissions
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: star (show other bugs)
Version: unstable
Hardware: all Linux
: P2 major
Assignee: Nobody's working on this, feel free to take it
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-18 22:43 MSD by Sergey Vlasov
Modified: 2007-01-16 16:53 MSK (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Vlasov 2004-04-18 22:43:56 MSD
When extracting a tar archive which contains hardlinks to symlinks, star
corrupts permissions of files pointed to by these links.

Steps to Reproduce:
$ mkdir test
$ cd test
$ mkdir dir1 dir2
$ cd dir1
$ touch file1
$ ln -s file1 link1
$ ln link1 link2
$ cd ..
$ star -cvv -f dir1.tar -C dir1 .
a       0 drwxr-xr-x   2 vsu/vsu Apr 18 22:35 2004 .
a       0 -rw-r--r--   1 vsu/vsu Apr 18 22:35 2004 file1
a       0 lrwxrwxrwx   2 vsu/vsu Apr 18 22:35 2004 link1 -> file1
a       0 lrwxrwxrwx   2 vsu/vsu Apr 18 22:35 2004 link2 link to link1 -> link1
star: 1 blocks + 0 bytes (total of 10240 bytes = 10.00k).
$ star -xpvv -f dir1.tar -C dir2
x       0 drwxr-xr-x  vsu/vsu Apr 18 22:35 2004 ./
x       0 -rw-r--r--  vsu/vsu Apr 18 22:35 2004 file1
x       0 lrwxrwxrwx  vsu/vsu Apr 18 22:35 2004 link1 -> file1
x       0 Hrwxrwxrwx  vsu/vsu Apr 18 22:35 2004 link2 link to link1
star: 1 blocks + 0 bytes (total of 10240 bytes = 10.00k).
$ ls -lR
.:
total 12
drwxr-xr-x  2 vsu vsu    42 Apr 18 22:35 dir1
-rw-r--r--  1 vsu vsu 10240 Apr 18 22:36 dir1.tar
drwxr-xr-x  2 vsu vsu    42 Apr 18 22:35 dir2

./dir1:
total 0
-rw-r--r--  1 vsu vsu 0 Apr 18 22:35 file1
lrwxrwxrwx  2 vsu vsu 5 Apr 18 22:35 link1 -> file1
lrwxrwxrwx  2 vsu vsu 5 Apr 18 22:35 link2 -> file1

./dir2:
total 0
-rwxrwxrwx  1 vsu vsu 0 Apr 18 22:35 file1
lrwxrwxrwx  2 vsu vsu 5 Apr 18 22:37 link1 -> file1
lrwxrwxrwx  2 vsu vsu 5 Apr 18 22:37 link2 -> file1

Actual Results:  
Permissions of "file1" in dir2 are corrupted (0777 instead of 0644).

Extracting the same tar file with the GNU tar instead of star produces the
expected result (permissions are correct).  Archiving with GNU tar and
extracting with star gives corrupted permissions.

Expected Results:  
File permissions should be preserved correctly.
Comment 1 Michael Shigorin 2006-12-28 12:21:06 MSK
2 icesik: если как-нить (не спеша) доберёшься, тоже зачтётся.
Comment 2 Victor Forsyuk 2006-12-28 13:43:28 MSK
Можете  не добираться. В текущей сизифной версии (star 1.5a75) этого бага нет.