From: Peter Pentchev Date: Sun, 31 May 2020 13:24:27 +0000 (+0300) Subject: Add a patch to make unzck require a *.zck extension. X-Git-Tag: archive/raspbian/1.1.9+ds1-1+rpi1~1^2~16 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=392b7c53318ec3a6e0b8c95ff0bc7805b2c56408;p=zchunk.git Add a patch to make unzck require a *.zck extension. --- diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..b0d7ca7 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +unzck-require-ext.patch diff --git a/debian/patches/unzck-require-ext.patch b/debian/patches/unzck-require-ext.patch new file mode 100644 index 0000000..83778fb --- /dev/null +++ b/debian/patches/unzck-require-ext.patch @@ -0,0 +1,21 @@ +Description: unzck: require a *.zck extension. +Forwarded: https://github.com/zchunk/zchunk/pull/26 +Author: Peter Pentchev +Last-Update: 2020-06-01 + +--- a/src/unzck.c ++++ b/src/unzck.c +@@ -120,6 +120,13 @@ + + zck_set_log_level(arguments.log_level); + ++ if(!arguments.std_out) { ++ if(strlen(arguments.args[0]) < 5 || ++ strcmp(arguments.args[0] + strlen(arguments.args[0]) - 4, ".zck") != 0) { ++ dprintf(STDERR_FILENO, "Not a *.zck file: %s\n", arguments.args[0]); ++ exit(1); ++ } ++ } + int src_fd = open(arguments.args[0], O_RDONLY); + if(src_fd < 0) { + dprintf(STDERR_FILENO, "Unable to open %s\n", arguments.args[0]);