]> git.cworth.org Git - tar/commit
maybe_backup_file: Clear previously-set after_backup_name 508199
authorCarl Worth <cworth@cworth.org>
Tue, 4 Aug 2009 20:34:52 +0000 (13:34 -0700)
committerCarl Worth <cworth@cworth.org>
Wed, 5 Aug 2009 00:16:56 +0000 (17:16 -0700)
commit3c1a778dfd5bd4434aa6a15730af2e2b995c6ba5
treeaa563f4c5bd2feab4565350de3b73f785e56a7de
parent04176c5e3a481e57b4c6b10fdb6b4a5d82f213f2
maybe_backup_file: Clear previously-set after_backup_name

Without this, under various conditions, (including file_name being
a directory), maybe_backup_file would return true without having
done anything, nor having set after_backup_name. Then, if any
error was detected while extracting the member, (such as directory
already exists), the previously backed-up file would be restored,
potentially destroying user data.

This closes Debian bug #508199, with thanks to Eric Lammerts for
reporting it with a concise test case.
debian/changelog
src/misc.c