Debian Bug report logs - #775247
tar: transform applied to symlink targets incorrectly when changing directory level

version graph

Package: tar; Maintainer for tar is Janos Lenart <ocsi@debian.org>; Source for tar is src:tar (PTS, buildd, popcon).

Reported by: Frank Heckenbach <f.heckenbach@fh-soft.de>

Date: Tue, 13 Jan 2015 02:54:02 UTC

Severity: normal

Found in version tar/1.26+dfsg-0.1

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Bdale Garbee <bdale@gag.com>:
Bug#775247; Package tar. (Tue, 13 Jan 2015 02:54:06 GMT) (full text, mbox, link).


Acknowledgement sent to Frank Heckenbach <f.heckenbach@fh-soft.de>:
New Bug report received and forwarded. Copy sent to Bdale Garbee <bdale@gag.com>. (Tue, 13 Jan 2015 02:54:06 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Frank Heckenbach <f.heckenbach@fh-soft.de>
To: submit@bugs.debian.org
Subject: tar: transform applied to symlink targets incorrectly when changing directory level
Date: Tue, 13 Jan 2015 03:51:32 +0100
Package: tar
Version: 1.26+dfsg-0.1
Severity: normal

Transform by default also applies to symlink targets. In most cases,
that's useful:

% touch foo
% ln -s foo bar
% tar --transform=s/o/u/ -cf baz foo bar
% tar tvf baz
-rw------- frank/frank       0 2015-01-13 03:35 fuo
lrwxrwxrwx frank/frank       0 2015-01-13 03:35 bar -> fuo

So far, so good.

However, when the transform adds (or removes) a directory level, the
resulting symlink is broken:

% tar --transform=s,^,sub/, -cf baz foo bar
% tar tvf baz
-rw------- frank/frank       0 2015-01-13 03:35 sub/foo
lrwxrwxrwx frank/frank       0 2015-01-13 03:35 sub/bar -> sub/foo

I know it's not a trivial problem. With both above transforms
combined, tar would need to apply the first and not the second to
the target. Or more generally, apply the whole transform to the
target, then if it's a relative link, add or remove the necessary
directory levels ...

For my current problem, the "S" flag will help me out since all
affected symlinks are local, but in more complicated cases, it might
not suffice.



Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Tue Jul 2 23:27:44 2024; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.