]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
mtree: Escape standard pathname matching characters 3007/head
authorJose Luis Duran <jlduran@FreeBSD.org>
Wed, 15 Apr 2026 04:00:16 +0000 (04:00 +0000)
committerJose Luis Duran <jlduran@FreeBSD.org>
Thu, 7 May 2026 10:36:18 +0000 (10:36 +0000)
Escape all strsvis(3) VIS_GLOB matching characters ('*', '?', '[', or
'#').

libarchive/archive_write_set_format_mtree.c

index 01573f243d7b5830888193ec0bb5f73e980c9a1a..79cedbe43f310607ac3dee7ea5c011d53bd2edb7 100644 (file)
@@ -307,14 +307,14 @@ static const uint32_t crctab[] = {
 static const unsigned char safe_char[256] = {
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 00 - 0F */
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 10 - 1F */
-       /* !"$%&'()*+,-./  EXCLUSION:0x20( ) 0x23(#) */
-       0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 20 - 2F */
-       /* 0123456789:;<>?  EXCLUSION:0x3d(=) */
-       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, /* 30 - 3F */
+       /* !"$%&'()+,-./  EXCLUSION:0x20( ) 0x23(#) 0x2a(*) */
+       0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, /* 20 - 2F */
+       /* 0123456789:;<>  EXCLUSION:0x3d(=) 0x3f(?) */
+       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, /* 30 - 3F */
        /* @ABCDEFGHIJKLMNO */
        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 40 - 4F */
-       /* PQRSTUVWXYZ[]^_ EXCLUSION:0x5c(\)  */
-       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, /* 50 - 5F */
+       /* PQRSTUVWXYZ]^_ EXCLUSION:0x5b([) 0x5c(\)  */
+       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, /* 50 - 5F */
        /* `abcdefghijklmno */
        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 60 - 6F */
        /* pqrstuvwxyz{|}~ */