svn commit: r202873 - head/lib/libarchive

Tim Kientzle kientzle at FreeBSD.org
Sat Jan 23 07:57:17 UTC 2010


Author: kientzle
Date: Sat Jan 23 07:57:17 2010
New Revision: 202873
URL: http://svn.freebsd.org/changeset/base/202873

Log:
  Don't try to hardlink block or character device nodes that come out
  of cpio archives.

Modified:
  head/lib/libarchive/archive_entry_link_resolver.c

Modified: head/lib/libarchive/archive_entry_link_resolver.c
==============================================================================
--- head/lib/libarchive/archive_entry_link_resolver.c	Sat Jan 23 07:55:53 2010	(r202872)
+++ head/lib/libarchive/archive_entry_link_resolver.c	Sat Jan 23 07:57:17 2010	(r202873)
@@ -181,8 +181,10 @@ archive_entry_linkify(struct archive_ent
 	/* 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) {


More information about the svn-src-all mailing list