]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Issue #659: Fix xar parsing of archives with appleextended ACLs
authorTim Kientzle <kientzle@acm.org>
Sun, 14 Feb 2016 05:52:24 +0000 (21:52 -0800)
committerTim Kientzle <kientzle@acm.org>
Sun, 14 Feb 2016 05:52:24 +0000 (21:52 -0800)
The parser treated the <appleextended> tag as both known and
unknown, leaving the parser in a state that prevented it
from reading any further attributes.  Depending on the
order of attributes, this could result in a file with no
name, for instance.

libarchive/archive_read_support_format_xar.c

index 19c1b780ea2156aec9a044304ea61f35507e2035..40308984edc4f847046c8979a0e613cc3d916708 100644 (file)
@@ -2168,7 +2168,7 @@ xml_start(struct archive_read *a, const char *name, struct xmlattr_list *list)
        case FILE_ACL:
                if (strcmp(name, "appleextended") == 0)
                        xar->xmlsts = FILE_ACL_APPLEEXTENDED;
-               if (strcmp(name, "default") == 0)
+               else if (strcmp(name, "default") == 0)
                        xar->xmlsts = FILE_ACL_DEFAULT;
                else if (strcmp(name, "access") == 0)
                        xar->xmlsts = FILE_ACL_ACCESS;