From: Tim Kientzle Date: Mon, 24 Jan 2011 04:57:05 +0000 (-0500) Subject: When fetching the file contents from disk, obey local system X-Git-Tag: v3.0.0a~718 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ddc294262fdfbaddb933754ff985c2dbfee23c27;p=thirdparty%2Flibarchive.git When fetching the file contents from disk, obey local system limitations. (This should probably be rewritten to use archive_read_disk_entry_from_file().) SVN-Revision: 2944 --- diff --git a/libarchive/archive_read_support_format_mtree.c b/libarchive/archive_read_support_format_mtree.c index 973241168..8822d6ae9 100644 --- a/libarchive/archive_read_support_format_mtree.c +++ b/libarchive/archive_read_support_format_mtree.c @@ -625,24 +625,34 @@ parse_file(struct archive_read *a, struct archive_entry *entry, if ((st->st_mode & S_IFMT) == S_IFREG && archive_entry_filetype(entry) != AE_IFREG) mismatched_type = 1; +#ifdef S_IFLNK if ((st->st_mode & S_IFMT) == S_IFLNK && archive_entry_filetype(entry) != AE_IFLNK) mismatched_type = 1; +#endif +#ifdef S_IFSOCK if ((st->st_mode & S_IFSOCK) == S_IFSOCK && archive_entry_filetype(entry) != AE_IFSOCK) mismatched_type = 1; +#endif +#ifdef S_IFCHR if ((st->st_mode & S_IFMT) == S_IFCHR && archive_entry_filetype(entry) != AE_IFCHR) mismatched_type = 1; +#endif +#ifdef S_IFBLK if ((st->st_mode & S_IFMT) == S_IFBLK && archive_entry_filetype(entry) != AE_IFBLK) mismatched_type = 1; +#endif if ((st->st_mode & S_IFMT) == S_IFDIR && archive_entry_filetype(entry) != AE_IFDIR) mismatched_type = 1; +#ifdef S_IFIFO if ((st->st_mode & S_IFMT) == S_IFIFO && archive_entry_filetype(entry) != AE_IFIFO) mismatched_type = 1; +#endif if (mismatched_type) { if ((parsed_kws & MTREE_HAS_OPTIONAL) == 0) {