From a00d9d30ed78d37ccec3b7a8e9f97e2196215068 Mon Sep 17 00:00:00 2001 From: git-bruh Date: Sun, 18 Sep 2022 13:04:04 +0530 Subject: [PATCH] zip: add --- extra/zip/build | 15 ++++++++++++++ extra/zip/checksums | 5 +++++ extra/zip/depends | 1 + extra/zip/patches/zip-3.0-currdir.patch | 12 +++++++++++ extra/zip/patches/zip-3.0-exec-shield.patch | 20 +++++++++++++++++++ .../zip/patches/zip-3.0-format-security.patch | 20 +++++++++++++++++++ extra/zip/patches/zipnote.patch | 16 +++++++++++++++ extra/zip/sources | 5 +++++ extra/zip/version | 1 + 9 files changed, 95 insertions(+) create mode 100755 extra/zip/build create mode 100644 extra/zip/checksums create mode 100644 extra/zip/depends create mode 100644 extra/zip/patches/zip-3.0-currdir.patch create mode 100644 extra/zip/patches/zip-3.0-exec-shield.patch create mode 100644 extra/zip/patches/zip-3.0-format-security.patch create mode 100644 extra/zip/patches/zipnote.patch create mode 100644 extra/zip/sources create mode 100644 extra/zip/version diff --git a/extra/zip/build b/extra/zip/build new file mode 100755 index 00000000..7e3bead0 --- /dev/null +++ b/extra/zip/build @@ -0,0 +1,15 @@ +#!/bin/sh -e + +for p in *.patch; do + patch -p1 < "$p" +done + +make \ + prefix=/usr \ + CC="$CC $CFLAGS $CXXFLAGS" \ + -f unix/Makefile generic + +make \ + prefix="$1/usr" \ + MANDIR="$1/usr/share/man/man1" \ + -f unix/Makefile install diff --git a/extra/zip/checksums b/extra/zip/checksums new file mode 100644 index 00000000..74c2fdd2 --- /dev/null +++ b/extra/zip/checksums @@ -0,0 +1,5 @@ +f0e8bb1f9b7eb0b01285495a2699df3a4b766784c1765a8f1aeedf63c0806369 +44cac3d4e8b447988b6e4eeb4bb6e701110cedfb09ea49eac471011328c8acab +10f0f3756a2415e33edf1455373b322404962b743b3a52a757b669e47dd7f1b2 +3759134487afad9c63e2e9693aa05b9dcc67f55a9ef961e82074b587b094292a +66ab4ce03f342c6624aa14be5fa43b90e5608a4f6babcc9c3680828f2c246a74 diff --git a/extra/zip/depends b/extra/zip/depends new file mode 100644 index 00000000..7a457127 --- /dev/null +++ b/extra/zip/depends @@ -0,0 +1 @@ +bzip2 diff --git a/extra/zip/patches/zip-3.0-currdir.patch b/extra/zip/patches/zip-3.0-currdir.patch new file mode 100644 index 00000000..40da32e7 --- /dev/null +++ b/extra/zip/patches/zip-3.0-currdir.patch @@ -0,0 +1,12 @@ +diff -up zip30/util.c.currdir zip30/util.c +--- zip30/util.c.currdir 2009-11-16 12:42:17.783961701 +0100 ++++ zip30/util.c 2009-11-16 12:42:58.185960707 +0100 +@@ -493,6 +493,8 @@ int cs; /* force case-se + /* Compare the sh pattern p with the string s and return true if they match, + false if they don't or if there is a syntax error in the pattern. */ + { ++ while (s[0] == '.' && s[1] == '/') ++ s += 2; /* strip redundant leading "./" sections */ + return recmatch(p, s, cs) == 1; + } + diff --git a/extra/zip/patches/zip-3.0-exec-shield.patch b/extra/zip/patches/zip-3.0-exec-shield.patch new file mode 100644 index 00000000..05c1a6c4 --- /dev/null +++ b/extra/zip/patches/zip-3.0-exec-shield.patch @@ -0,0 +1,20 @@ +diff -up zip30/crc_i386.S.exec_shield zip30/crc_i386.S +--- zip30/crc_i386.S.exec_shield 2009-11-13 18:37:45.000000000 +0100 ++++ zip30/crc_i386.S 2009-11-13 18:39:54.435390166 +0100 +@@ -302,3 +302,6 @@ _crc32: /* ulg c + #endif /* i386 || _i386 || _I386 || __i386 */ + + #endif /* !USE_ZLIB && !CRC_TABLE_ONLY */ ++ ++.section .note.GNU-stack, "", @progbits ++.previous +diff -up zip30/match.S.exec_shield zip30/match.S +--- zip30/match.S.exec_shield 2005-01-28 10:40:14.000000000 +0100 ++++ zip30/match.S 2009-11-13 18:39:48.570389058 +0100 +@@ -405,3 +405,6 @@ L__return: + #endif /* i386 || _I386 || _i386 || __i386 */ + + #endif /* !USE_ZLIB */ ++ ++.section .note.GNU-stack, "", @progbits ++.previous diff --git a/extra/zip/patches/zip-3.0-format-security.patch b/extra/zip/patches/zip-3.0-format-security.patch new file mode 100644 index 00000000..54ce2e66 --- /dev/null +++ b/extra/zip/patches/zip-3.0-format-security.patch @@ -0,0 +1,20 @@ +--- a/zip.c ++++ a/zip.c +@@ -1028,7 +1028,7 @@ local void help_extended() + + for (i = 0; i < sizeof(text)/sizeof(char *); i++) + { +- printf(text[i]); ++ printf("%s", text[i]); + putchar('\n'); + } + #ifdef DOS +@@ -1225,7 +1225,7 @@ local void version_info() + CR_MAJORVER, CR_MINORVER, CR_BETA_VER, CR_VERSION_DATE); + for (i = 0; i < sizeof(cryptnote)/sizeof(char *); i++) + { +- printf(cryptnote[i]); ++ printf("%s", cryptnote[i]); + putchar('\n'); + } + ++i; /* crypt support means there IS at least one compilation option */ diff --git a/extra/zip/patches/zipnote.patch b/extra/zip/patches/zipnote.patch new file mode 100644 index 00000000..75752799 --- /dev/null +++ b/extra/zip/patches/zipnote.patch @@ -0,0 +1,16 @@ +From: Christian Spieler +Subject: zipnote.c: Close in_file instead of undefined file x +Bug-Debian: http://bugs.debian.org/628594 +X-Debian-version: 3.0-4 + +--- a/zipnote.c ++++ b/zipnote.c +@@ -661,7 +661,7 @@ + if ((r = zipcopy(z)) != ZE_OK) + ziperr(r, "was copying an entry"); + } +- fclose(x); ++ fclose(in_file); + + /* Write central directory and end of central directory with new comments */ + if ((c = zftello(y)) == (zoff_t)-1) /* get start of central */ diff --git a/extra/zip/sources b/extra/zip/sources new file mode 100644 index 00000000..dab8d386 --- /dev/null +++ b/extra/zip/sources @@ -0,0 +1,5 @@ +https://downloads.sourceforge.net/infozip/zip30.tar.gz +patches/zip-3.0-currdir.patch +patches/zip-3.0-exec-shield.patch +patches/zip-3.0-format-security.patch +patches/zipnote.patch diff --git a/extra/zip/version b/extra/zip/version new file mode 100644 index 00000000..f90f0a39 --- /dev/null +++ b/extra/zip/version @@ -0,0 +1 @@ +3.0 2