From: Michihiro NAKAJIMA Date: Fri, 18 Mar 2011 19:58:06 +0000 (-0400) Subject: Do not process sum if a file is not a regular file. X-Git-Tag: v3.0.0a~642 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=511f36a504b22eac10baf343048e337b7dbf4df6;p=thirdparty%2Flibarchive.git Do not process sum if a file is not a regular file. Fix r3028. SVN-Revision: 3030 --- diff --git a/libarchive/archive_write_set_format_mtree.c b/libarchive/archive_write_set_format_mtree.c index c014f8259..f10afe307 100644 --- a/libarchive/archive_write_set_format_mtree.c +++ b/libarchive/archive_write_set_format_mtree.c @@ -966,7 +966,8 @@ write_entry(struct archive_write *a, struct mtree_entry *me) } /* Write a bunch of sum. */ - sum_write(mtree, str, me); + if (me->filetype == AE_IFREG) + sum_write(mtree, str, me); archive_strcat(str, "\n"); if (mtree->indent) @@ -1012,7 +1013,8 @@ archive_write_mtree_finish_entry(struct archive_write *a) return (ARCHIVE_OK); mtree->mtree_entry = NULL; - sum_final(mtree, me); + if (me->filetype == AE_IFREG) + sum_final(mtree, me); if (mtree->set.output) { if (!mtree->dironly) { @@ -1072,7 +1074,8 @@ archive_write_mtree_data(struct archive_write *a, const void *buff, size_t n) if (mtree->mtree_entry == NULL) return (n); - sum_update(mtree, buff, n); + if (mtree->mtree_entry->filetype == AE_IFREG) + sum_update(mtree, buff, n); return (n); }