summaryrefslogtreecommitdiffstats
path: root/lib/libarchive
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2010-01-23 07:57:17 +0000
committerkientzle <kientzle@FreeBSD.org>2010-01-23 07:57:17 +0000
commitdace1f6d748e9b099a9a3e8799a5cf79d543b256 (patch)
tree92be3e2003a7ce1af42d1828a08b2c3c503e02dd /lib/libarchive
parenta90eac212e8ef882cb857c3f6c843a88bdcd99be (diff)
downloadFreeBSD-src-dace1f6d748e9b099a9a3e8799a5cf79d543b256.zip
FreeBSD-src-dace1f6d748e9b099a9a3e8799a5cf79d543b256.tar.gz
Don't try to hardlink block or character device nodes that come out
of cpio archives.
Diffstat (limited to 'lib/libarchive')
-rw-r--r--lib/libarchive/archive_entry_link_resolver.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libarchive/archive_entry_link_resolver.c b/lib/libarchive/archive_entry_link_resolver.c
index c190108..a5eb624 100644
--- a/lib/libarchive/archive_entry_link_resolver.c
+++ b/lib/libarchive/archive_entry_link_resolver.c
@@ -181,8 +181,10 @@ archive_entry_linkify(struct archive_entry_linkresolver *res,
/* If it has only one link, then we're done. */
if (archive_entry_nlink(*e) == 1)
return;
- /* Directories never have hardlinks. */
- if (archive_entry_filetype(*e) == AE_IFDIR)
+ /* Directories, devices never have hardlinks. */
+ if (archive_entry_filetype(*e) == AE_IFDIR
+ || archive_entry_filetype(*e) == AE_IFBLK
+ || archive_entry_filetype(*e) == AE_IFCHR)
return;
switch (res->strategy) {
OpenPOWER on IntegriCloud