]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Tighten mode check: '8' and '9' don't make good octal digits.
authorJoerg Sonnenberger <joerg@bec.de>
Sat, 29 Apr 2017 20:15:52 +0000 (22:15 +0200)
committerJoerg Sonnenberger <joerg@bec.de>
Sat, 29 Apr 2017 20:15:52 +0000 (22:15 +0200)
libarchive/archive_read_support_format_mtree.c

index 1590187febe597daa09596f45c83e0f6187d02a2..6edc4ec9a386b0f424f4347398325b7e88c6ad42 100644 (file)
@@ -1535,14 +1535,14 @@ parse_keyword(struct archive_read *a, struct mtree *mtree,
                if (strcmp(key, "md5") == 0 || strcmp(key, "md5digest") == 0)
                        break;
                if (strcmp(key, "mode") == 0) {
-                       if (val[0] >= '0' && val[0] <= '9') {
+                       if (val[0] >= '0' && val[0] <= '7') {
                                *parsed_kws |= MTREE_HAS_PERM;
                                archive_entry_set_perm(entry,
                                    (mode_t)mtree_atol8(&val));
                        } else {
                                archive_set_error(&a->archive,
                                    ARCHIVE_ERRNO_FILE_FORMAT,
-                                   "Symbolic mode \"%s\" unsupported", val);
+                                   "Symbolic or non-octal mode \"%s\" unsupported", val);
                                return ARCHIVE_WARN;
                        }
                        break;