diff options
author | kientzle <kientzle@FreeBSD.org> | 2005-05-08 19:10:41 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2005-05-08 19:10:41 +0000 |
commit | 942b7e7d55f566a72bbc49d6a57ee6b32d0b98da (patch) | |
tree | d14b7bd2f6e28d70963c03decb4aaecc45f6f471 /lib/libarchive/archive_entry.c | |
parent | 27c543668baefe5a124d7e62e2250fe8e836e773 (diff) | |
download | FreeBSD-src-942b7e7d55f566a72bbc49d6a57ee6b32d0b98da.zip FreeBSD-src-942b7e7d55f566a72bbc49d6a57ee6b32d0b98da.tar.gz |
archive_entry_set_link is supposed to update whichever link field
(symlink or hardlink) is already set. Instead, it was always setting
the hardlink field. In particular, this caused GNU tar format long
symlinks to be interpreted as hardlinks.
Thanks to: Brooks Davis
MFC after: 7 days
Diffstat (limited to 'lib/libarchive/archive_entry.c')
-rw-r--r-- | lib/libarchive/archive_entry.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libarchive/archive_entry.c b/lib/libarchive/archive_entry.c index f0f0042..b4b7435 100644 --- a/lib/libarchive/archive_entry.c +++ b/lib/libarchive/archive_entry.c @@ -575,7 +575,8 @@ archive_entry_set_link(struct archive_entry *entry, const char *target) if (entry->ae_symlink.aes_mbs != NULL || entry->ae_symlink.aes_wcs != NULL) aes_set_mbs(&entry->ae_symlink, target); - aes_set_mbs(&entry->ae_hardlink, target); + else + aes_set_mbs(&entry->ae_hardlink, target); } void |