X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fwgtpkg-zip.c;h=c1b59e74a38aa6f930493a3a35246af5a699c133;hb=a123bb31906ef03ff813559aee426282416d729d;hp=a182261549bcd021d4a955d8d2a7787b9e60c5b5;hpb=7cf2890d871e76c082528565f59e1d0d1055b7f9;p=src%2Fapp-framework-main.git diff --git a/src/wgtpkg-zip.c b/src/wgtpkg-zip.c index a182261..c1b59e7 100644 --- a/src/wgtpkg-zip.c +++ b/src/wgtpkg-zip.c @@ -1,5 +1,5 @@ /* - Copyright 2015, 2016, 2017 IoT.bzh + Copyright (C) 2015-2020 IoT.bzh author: José Bollo @@ -58,7 +58,7 @@ static int is_valid_filename(const char *filename) if ((c < 0x1f) || ((lastsp = (c == 0x20)) && index == 0) || c == 0x7f || c == 0x3c || c == 0x3e - || c == 0x3a || c == 0x22 + || c == 0x3a || c == 0x22 || c == 0x5c || c == 0x7c || c == 0x3f || c == 0x2a || c == 0x5e || c == 0x60 || c == 0x7b || c == 0x7d || c == 0x21) @@ -263,7 +263,7 @@ static int zwr(struct zws *zws, size_t offset) ent = readdir(dir); while (ent != NULL) { len = strlen(ent->d_name); - if (ent->d_name[0] == '.' && (len == 1 || + if (ent->d_name[0] == '.' && (len == 1 || (ent->d_name[1] == '.' && len == 2))) ; else if (offset + len >= sizeof(zws->name)) { @@ -447,6 +447,7 @@ int zwrite(const char *zipfile) { const char *args[6]; + unlink(zipfile); args[0] = "zip"; args[1] = "-q"; args[2] = "-r";