[Bug 396842] New: nasty bug in tar turns symlinks into zero-length files
https://bugzilla.novell.com/show_bug.cgi?id=396842 Summary: nasty bug in tar turns symlinks into zero-length files Product: openSUSE 10.3 Version: Final Platform: Other OS/Version: openSUSE 10.3 Status: NEW Severity: Major Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: jnelson-suse@jamponi.net QAContact: qa@suse.de Found By: --- Doing a backup/restore I found this bug which was very annoying, and almost certainly not what you want to have happen. After I got a running system again, I google'd and found this: http://www.mail-archive.com/bug-tar@gnu.org/msg01362.html which is exactly the problem I encountered. The last message in that thread contains a patch, as does CVS probably. The bug is present in both 10.3 and 11.0 (rc1) versions of openSUSE, at least those versions of tar that are on the rescue media. If it were not for star restoring my backup would have been very painful! Please get this bug fixed any way you can. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=396842 Cristian Rodriguez <crrodriguez@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |crrodriguez@novell.com AssignedTo|bnc-team-screening@forge.provo.novell.com |mkoenig@novell.com -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=396842 User mkoenig@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=396842#c1 Matthias Koenig <mkoenig@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO Info Provider| |jnelson-suse@jamponi.net --- Comment #1 from Matthias Koenig <mkoenig@novell.com> 2008-06-04 03:03:36 MDT --- The patch mentioned for the bug has been released in version 1.17, which is exactly the version present in 10.3. Double checked the given patch, it is present in this version. So neither 10.3 nor 11.0 should be affected by the bug which is discussed in the given thread. Just to be sure, can you give the output of tar --version of your version which is broken? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=396842 User jnelson-suse@jamponi.net added comment https://bugzilla.novell.com/show_bug.cgi?id=396842#c2 Jon Nelson <jnelson-suse@jamponi.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW Info Provider|jnelson-suse@jamponi.net | --- Comment #2 from Jon Nelson <jnelson-suse@jamponi.net> 2008-06-05 13:37:30 MDT --- Apparently, GNU tar waits until the ENTIRE ARCHIVE has been extracted (successfully or not) to go back and change some 0-byte files to symlinks. I was able to observe this by creating a 20MB archive, and killing the extraction before it was complete. Then, I tried it again and allowed it to complete. The first time, 0-byte files were created. The second time, the appropriate symlinks were in place. I straced things and you can see this: open("./bin/pidof", O_WRONLY|O_CREAT|O_EXCL|O_LARGEFILE, 0) = 6 .. and then later, *after* the archive has been read in its entirety... lstat64("./bin/pidof", {st_mode=S_IFREG, st_size=0, ...}) = 0 unlink("./bin/pidof") = 0 symlink("/sbin/killall5", "./bin/pidof") = 0 lchown32("./bin/pidof", 0, 0) = 0 WHY GNU tar behaves like this when other tars (pax, star, etc...) do not is beyond me but it's hugely frustrating behavior. It's not strictly a bug but IMO it's pretty ugly. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=396842 User jnelson-suse@jamponi.net added comment https://bugzilla.novell.com/show_bug.cgi?id=396842#c3 --- Comment #3 from Jon Nelson <jnelson-suse@jamponi.net> 2008-06-05 13:49:12 MDT --- The following is a cut-n-paste from the Changelog for GNU tar, circa 2000-10-23. Invoke apply_nonancestor_delayed_set_stat here, not in caller. Extract potentially dangerous symbolic links more carefully, deferring their creation until the end, and using a regular file placeholder in the meantime. Do not remove trailing / and /. from file names. Do not bother checking for ".." when checking whether a directory loops back on itself, as loopbacks can occur with symlinks too. Also, in that case, do not bother saving and restoring errno; just set it to EEXIST. (apply_nonancestor_delayed_set_stat): A prefix is a potential ancestor if it ends in slash too (as well as ending in a char just before slash). I can't imagine what makes the symlinks /bin/pidof and others "dangerous" but... whatever. It's clearly been this way for a while, no matter how non-obvious it might seem. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=396842 User mkoenig@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=396842#c4 Matthias Koenig <mkoenig@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID --- Comment #4 from Matthias Koenig <mkoenig@novell.com> 2008-06-06 02:56:49 MDT --- Ok, then this is documented behaviour. Closing. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com