Compare commits
No commits in common. "c9s" and "c8" have entirely different histories.
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
|||||||
unzip60.tar.gz
|
SOURCES/unzip60.tar.gz
|
||||||
|
|||||||
1
.unzip.metadata
Normal file
1
.unzip.metadata
Normal file
@ -0,0 +1 @@
|
|||||||
|
abf7de8a4018a983590ed6f5cbd990d4740f8a22 SOURCES/unzip60.tar.gz
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
From 8f6be666289211661906922cdfe6ea5a08c5b458 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jakub Martisko <jamartis@redhat.com>
|
||||||
|
Date: Tue, 13 Nov 2018 09:57:43 +0100
|
||||||
|
Subject: [PATCH] envargs.c: strcpy with overlapping strings
|
||||||
|
|
||||||
|
---
|
||||||
|
envargs.c | 4 +++-
|
||||||
|
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/envargs.c b/envargs.c
|
||||||
|
index f0a230d..daa3e47 100644
|
||||||
|
--- a/envargs.c
|
||||||
|
+++ b/envargs.c
|
||||||
|
@@ -31,6 +31,7 @@
|
||||||
|
#define __ENVARGS_C /* identifies this source module */
|
||||||
|
#define UNZIP_INTERNAL
|
||||||
|
#include "unzip.h"
|
||||||
|
+#include <string.h>
|
||||||
|
|
||||||
|
#ifdef __EMX__ /* emx isspace() returns TRUE on extended ASCII !! */
|
||||||
|
# define ISspace(c) ((c) & 0x80 ? 0 : isspace((unsigned)c))
|
||||||
|
@@ -118,7 +119,8 @@ int envargs(Pargc, Pargv, envstr, envstr2)
|
||||||
|
|
||||||
|
/* remove escape characters */
|
||||||
|
while ((argstart = MBSCHR(argstart, '\\')) != (char *)NULL) {
|
||||||
|
- strcpy(argstart, argstart + 1);
|
||||||
|
+ //strcpy(argstart, argstart + 1);
|
||||||
|
+ memmove(argstart, argstart + 1,strlen(argstart + 1) + 1);
|
||||||
|
if (*argstart)
|
||||||
|
++argstart;
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.14.5
|
||||||
|
|
||||||
@ -174,8 +174,8 @@ Index: unzip-6.0/unzip.c
|
|||||||
+#else /* UNIX */
|
+#else /* UNIX */
|
||||||
+static ZCONST char Far ZipInfoUsageLine3[] = "miscellaneous options:\n\
|
+static ZCONST char Far ZipInfoUsageLine3[] = "miscellaneous options:\n\
|
||||||
+ -h print header line -t print totals for listed files or for all\n\
|
+ -h print header line -t print totals for listed files or for all\n\
|
||||||
+ -z print zipfile comment -T print file times in sortable decimal format\n\
|
+ -z print zipfile comment %c-T%c print file times in sortable decimal format\
|
||||||
+ -C be case-insensitive %s\
|
+\n %c-C%c be case-insensitive %s\
|
||||||
+ -x exclude filenames that follow from listing\n\
|
+ -x exclude filenames that follow from listing\n\
|
||||||
+ -O CHARSET specify a character encoding for DOS, Windows and OS/2 archives\n\
|
+ -O CHARSET specify a character encoding for DOS, Windows and OS/2 archives\n\
|
||||||
+ -I CHARSET specify a character encoding for UNIX and other archives\n";
|
+ -I CHARSET specify a character encoding for UNIX and other archives\n";
|
||||||
@ -7,8 +7,9 @@
|
|||||||
Summary: A utility for unpacking zip files
|
Summary: A utility for unpacking zip files
|
||||||
Name: unzip
|
Name: unzip
|
||||||
Version: 6.0
|
Version: 6.0
|
||||||
Release: 60%{?dist}
|
Release: 48%{?dist}
|
||||||
License: BSD
|
License: BSD
|
||||||
|
Group: Applications/Archiving
|
||||||
Source: http://downloads.sourceforge.net/infozip/unzip60.tar.gz
|
Source: http://downloads.sourceforge.net/infozip/unzip60.tar.gz
|
||||||
|
|
||||||
# Not sent to upstream.
|
# Not sent to upstream.
|
||||||
@ -58,30 +59,29 @@ Patch22: unzip-6.0-timestamp.patch
|
|||||||
|
|
||||||
# fix possible heap based stack overflow in passwd protected files
|
# fix possible heap based stack overflow in passwd protected files
|
||||||
Patch23: unzip-6.0-cve-2018-1000035-heap-based-overflow.patch
|
Patch23: unzip-6.0-cve-2018-1000035-heap-based-overflow.patch
|
||||||
|
|
||||||
Patch24: unzip-6.0-cve-2018-18384.patch
|
Patch24: unzip-6.0-cve-2018-18384.patch
|
||||||
|
|
||||||
# covscan issues
|
|
||||||
Patch25: unzip-6.0-COVSCAN-fix-unterminated-string.patch
|
Patch25: unzip-6.0-COVSCAN-fix-unterminated-string.patch
|
||||||
|
|
||||||
Patch26: unzip-zipbomb-part1.patch
|
|
||||||
Patch27: unzip-zipbomb-part2.patch
|
|
||||||
Patch28: unzip-zipbomb-part3.patch
|
|
||||||
Patch29: unzip-zipbomb-manpage.patch
|
|
||||||
Patch30: unzip-zipbomb-part4.patch
|
|
||||||
Patch31: unzip-zipbomb-part5.patch
|
|
||||||
Patch32: unzip-zipbomb-part6.patch
|
|
||||||
Patch33: unzip-zipbomb-switch.patch
|
|
||||||
|
|
||||||
Patch34: unzip-6.0-fix-warning-messages-on-big-files.patch
|
Patch26: unzip-6.0-COVSCAN-strcpy-with-overlapping-strings.patch
|
||||||
|
|
||||||
|
#zipbomb related patches (CVE-2019-13232)
|
||||||
|
Patch27: unzip-zipbomb-part1.patch
|
||||||
|
Patch28: unzip-zipbomb-part2.patch
|
||||||
|
Patch29: unzip-zipbomb-part3.patch
|
||||||
|
Patch30: unzip-zipbomb-manpage.patch
|
||||||
|
|
||||||
|
Patch31: unzip-zipbomb-part4.patch
|
||||||
|
Patch32: unzip-zipbomb-part5.patch
|
||||||
|
Patch33: unzip-zipbomb-part6.patch
|
||||||
|
|
||||||
|
Patch34: unzip-zipbomb-switch.patch
|
||||||
|
|
||||||
|
Patch35: unzip-6.0-fix-warning-messages-on-big-files.patch
|
||||||
#https://sources.debian.org/src/unzip/6.0-29/debian/patches/29-handle-windows-zip64-files.patch/
|
#https://sources.debian.org/src/unzip/6.0-29/debian/patches/29-handle-windows-zip64-files.patch/
|
||||||
Patch35: unzip-6.0-RHEL-86228.patch
|
Patch36: unzip-6.0-RHEL-86228.patch
|
||||||
Patch36: unzip-zipbomb-part7.patch
|
|
||||||
|
|
||||||
URL: http://www.info-zip.org/UnZip.html
|
URL: http://www.info-zip.org/UnZip.html
|
||||||
BuildRequires: make
|
BuildRequires: bzip2-devel
|
||||||
BuildRequires: bzip2-devel, gcc
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
The unzip utility is used to list, test, or extract files from a zip
|
The unzip utility is used to list, test, or extract files from a zip
|
||||||
@ -96,37 +96,39 @@ a zip archive.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n unzip60
|
%setup -q -n unzip60
|
||||||
%patch1 -p1
|
%patch1 -p1 -b .bzip2-configure
|
||||||
%patch2 -p1
|
%patch2 -p1 -b .exec-shield
|
||||||
%patch3 -p1
|
%patch3 -p1 -b .close
|
||||||
%patch4 -p1
|
%patch4 -p1 -b .attribs-overflow
|
||||||
%patch5 -p1
|
%patch5 -p1 -b .configure
|
||||||
%patch6 -p1
|
%patch6 -p1 -b .manpage-fix
|
||||||
%patch7 -p1
|
%patch7 -p1 -b .recmatch
|
||||||
%patch8 -p1
|
%patch8 -p1 -b .symlink
|
||||||
%patch9 -p1
|
%patch9 -p1 -b .caseinsensitive
|
||||||
%patch10 -p1
|
%patch10 -p1 -b .format-secure
|
||||||
%patch11 -p1
|
%patch11 -p1 -b .valgrind
|
||||||
%patch12 -p1
|
%patch12 -p1 -b .x-option
|
||||||
%patch13 -p1
|
%patch13 -p1 -b .overflow
|
||||||
%patch14 -p1
|
%patch14 -p1 -b .cve-2014-8139
|
||||||
%patch15 -p1
|
%patch15 -p1 -b .cve-2014-8140
|
||||||
%patch16 -p1
|
%patch16 -p1 -b .cve-2014-8141
|
||||||
%patch17 -p1
|
%patch17 -p1 -b .overflow-long-fsize
|
||||||
%patch18 -p1
|
%patch18 -p1 -b .heap-overflow-infloop
|
||||||
%patch19 -p1
|
%patch19 -p1 -b .utf
|
||||||
%patch20 -p1
|
%patch20 -p1 -b .utf-print
|
||||||
%patch21 -p1
|
%patch21 -p1 -b .cve-2016-9844
|
||||||
%patch22 -p1
|
%patch22 -p1 -b .timestamp
|
||||||
%patch23 -p1
|
%patch23 -p1 -b .cve-2018-1000035
|
||||||
%patch24 -p1
|
%patch24 -p1 -b .cve-2018-18384
|
||||||
%patch25 -p1
|
|
||||||
|
|
||||||
%patch26 -p1
|
%patch25 -p1 -b .covscan1
|
||||||
%patch27 -p1
|
%patch26 -p1 -b .covscan2
|
||||||
%patch28 -p1
|
|
||||||
%patch29 -p1
|
%patch27 -p1 -b .zipbomb1
|
||||||
|
%patch28 -p1 -b .zipbomb2
|
||||||
|
%patch29 -p1 -b .zipbomb3
|
||||||
%patch30 -p1
|
%patch30 -p1
|
||||||
|
|
||||||
%patch31 -p1
|
%patch31 -p1
|
||||||
%patch32 -p1
|
%patch32 -p1
|
||||||
%patch33 -p1
|
%patch33 -p1
|
||||||
@ -135,109 +137,68 @@ a zip archive.
|
|||||||
%patch36 -p1
|
%patch36 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
# Use the C implementation of CRC instead of assembly (only on i386, other architectures use C by default)
|
|
||||||
sed -i -e 's:-DASM_CRC::g' unix/configure
|
|
||||||
sed -i -e 's:CRC32OA="crc_gcc.o":CRC32OA="":g' unix/configure
|
|
||||||
|
|
||||||
# IZ_HAVE_UXUIDGID is needed for right functionality of unzip -X
|
# IZ_HAVE_UXUIDGID is needed for right functionality of unzip -X
|
||||||
# NOMEMCPY solve problem with memory overlapping - decomression is slowly,
|
# NOMEMCPY solve problem with memory overlapping - decomression is slowly,
|
||||||
# but successfull.
|
# but successfull.
|
||||||
%make_build -f unix/Makefile CF_NOOPT="-I. -DUNIX $RPM_OPT_FLAGS -DNOMEMCPY -DIZ_HAVE_UXUIDGID -DNO_LCHMOD" \
|
make -f unix/Makefile CF_NOOPT="-I. -DUNIX $RPM_OPT_FLAGS -DNOMEMCPY -DIZ_HAVE_UXUIDGID -DNO_LCHMOD" \
|
||||||
LFLAGS2="%{?__global_ldflags}" generic_gcc
|
LFLAGS2="%{?__global_ldflags}" generic_gcc %{?_smp_mflags}
|
||||||
|
|
||||||
%install
|
%install
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
make -f unix/Makefile prefix=$RPM_BUILD_ROOT%{_prefix} MANDIR=$RPM_BUILD_ROOT/%{_mandir}/man1 INSTALL="cp -p" install
|
make -f unix/Makefile prefix=$RPM_BUILD_ROOT%{_prefix} MANDIR=$RPM_BUILD_ROOT/%{_mandir}/man1 INSTALL="cp -p" install
|
||||||
|
|
||||||
%files
|
%files
|
||||||
|
%defattr(-,root,root)
|
||||||
%license LICENSE COPYING.OLD
|
%license LICENSE COPYING.OLD
|
||||||
%doc README BUGS
|
%doc README BUGS
|
||||||
%{_bindir}/*
|
%{_bindir}/*
|
||||||
%{_mandir}/*/*
|
%{_mandir}/*/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Fri Oct 10 2025 Jakub Martisko <jamartis@redhat.com> - 6.0-60
|
* Mon Apr 07 2025 Jakub Martisko <jamartis@redhat.com> - 6.0-48
|
||||||
- Another zipbomb patch (ported from c10s)
|
|
||||||
Related: RHEL-6272
|
|
||||||
|
|
||||||
* Mon Apr 07 2025 Jakub Martisko <jamartis@redhat.com> - 6.0-59
|
|
||||||
- Allow decompression of some wrongly compressed files
|
- Allow decompression of some wrongly compressed files
|
||||||
Resolves: RHEL-86228
|
Resolves: RHEL-86231
|
||||||
|
|
||||||
* Tue Sep 24 2024 Matteo Croce <teknoraver@meta.com> - 6.0-58
|
* Wed Jul 03 2024 Jakub Martisko <jamartis@redhat.com> - 6.0-47
|
||||||
- Fix obscure invalid memory access in zipinfo
|
|
||||||
Resolves: RHEL-60054
|
|
||||||
|
|
||||||
* Wed Jul 03 2024 Jakub Martisko <jamartis@redhat.com> - 6.0-57
|
|
||||||
- Fix: Unzip Fails on Large Zip Files
|
- Fix: Unzip Fails on Large Zip Files
|
||||||
- Use the patch from Debian dealing with this
|
- Use the patch from Debian dealing with this
|
||||||
Resolves: RHEL-45994
|
Resolves: RHEL-45997
|
||||||
|
|
||||||
* Wed Jan 26 2022 Jakub Martisko <jamartis@redhat.com> - 6.0-56
|
* Thu Dec 16 2021 Jakub Martisko <jamartis@redhat.com> - 6.0-46
|
||||||
- Use the C crc implementation instead of the asm (i686 only, other arches already use C)
|
- Add environment variable that disables the zipbomb detection
|
||||||
Related: rhbz#2045075
|
- Resolves: rhbz#2020320
|
||||||
|
|
||||||
* Wed Jan 05 2022 Jakub Martisko <jamartis@redhat.com> - 6.0-55
|
* Tue Nov 24 2020 Jakub Martisko <jamartis@redhat.com> - 6.0-45
|
||||||
- Rebuild with the gating tests enabled
|
Fix a false positive zipbomb detection
|
||||||
Related: rhbz#2036946
|
Related: 1954649
|
||||||
|
Related: 1953565
|
||||||
|
|
||||||
* Mon Dec 20 2021 Jakub Martisko <jamartis@redhat.com> - 6.0-54
|
* Tue Nov 24 2020 Jakub Martisko <jamartis@redhat.com> - 6.0-44
|
||||||
- Add an environment variable that disables the zipbomb detection
|
* Fix out of memory errors while checking for zip-bombs
|
||||||
Resolves: rhbz#2031730
|
Resolves: #1900915
|
||||||
|
|
||||||
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 6.0-53
|
* Mon Nov 18 2019 Jakub Martisko <jamartis@redhat.com> - 6.0-43
|
||||||
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
|
- Update the man page with the new exit code introduced in 6.0-42
|
||||||
Related: rhbz#1991688
|
- Related: CVE-2019-13232
|
||||||
|
|
||||||
* Fri Apr 30 2021 Jakub Martisko <jamartis@redhat.com> - 6.0-52
|
* Thu Oct 17 2019 Jakub Martisko <jamartis@redhat.com> - 6.0-42
|
||||||
- Add several patches dealing with false positice zipbomb detection
|
- Fix CVE-2019-13232
|
||||||
Resolves: #1954651
|
- Resolves: CVE-2019-13232
|
||||||
|
|
||||||
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 6.0-51
|
* Wed Nov 14 2018 Jakub Martisko <jamartis@redhat.com> - 6.0-41
|
||||||
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
|
- Fix strcpy call with possibly overlapping src/dest strings.
|
||||||
|
- Related: #1602721
|
||||||
|
|
||||||
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 6.0-50
|
* Mon Nov 12 2018 Jakub Martisko <jamartis@redhat.com> - 6.0-40
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
|
||||||
|
|
||||||
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 6.0-49
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
|
||||||
|
|
||||||
* Tue Jul 14 2020 Tom Stellard <tstellar@redhat.com> - 6.0-48
|
|
||||||
- Use make macros
|
|
||||||
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
|
|
||||||
|
|
||||||
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 6.0-47
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
|
||||||
|
|
||||||
* Mon Nov 18 2019 Jakub Martisko <jamartis@redhat.com> - 6.0-46
|
|
||||||
- Mention the zipbomb exit code in the manpage
|
|
||||||
Related: CVE-2019-13232
|
|
||||||
|
|
||||||
* Wed Oct 23 2019 Jakub Martisko <jamartis@redhat.com> - 6.0-45
|
|
||||||
- Fix possible zipbomb in unzip
|
|
||||||
Resolves: CVE-2019-13232
|
|
||||||
|
|
||||||
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 6.0-44
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
|
||||||
|
|
||||||
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 6.0-43
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
|
||||||
|
|
||||||
* Thu Nov 08 2018 Jakub Martisko <jamartis@redhat.com> - 6.0-42
|
|
||||||
- fix several possibly unterminated strings
|
- fix several possibly unterminated strings
|
||||||
When copying to OEM_CP and ISO_CP strings, the string could end unterminated
|
When copying to OEM_CP and ISO_CP strings, the string could end unterminated
|
||||||
(stncpy does not append '\0').
|
(stncpy does not append '\0').
|
||||||
|
- Related: #1602721
|
||||||
|
|
||||||
* Thu Nov 08 2018 Jakub Martisko <jamartis@redhat.com> - 6.0-41
|
* Mon Nov 05 2018 Jakub Martisko <jamartis@redhat.com> - 6.0-39
|
||||||
- Fix CVE-2018-18384
|
- Fix CVE-2018-18384
|
||||||
Resolves: CVE-2018-18384
|
Resolves: CVE-2018-18384
|
||||||
|
|
||||||
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 6.0-40
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
|
||||||
|
|
||||||
* Thu Mar 01 2018 Jakub Martisko <jamartis@redhat.com> - 6.0-39
|
|
||||||
- Add gcc to buildrequires
|
|
||||||
|
|
||||||
* Tue Feb 13 2018 Jakub Martisko <jamartis@redhat.com> - 6.0-38
|
* Tue Feb 13 2018 Jakub Martisko <jamartis@redhat.com> - 6.0-38
|
||||||
- Fix CVE-2018-1000035 - heap based buffer overflow when opening
|
- Fix CVE-2018-1000035 - heap based buffer overflow when opening
|
||||||
password protected files.
|
password protected files.
|
||||||
19
STAGE1-unzip
19
STAGE1-unzip
@ -1,19 +0,0 @@
|
|||||||
srpm unzip
|
|
||||||
mcd $BUILDDIR/$1
|
|
||||||
rsync -av $SRC/unzip*/ ./
|
|
||||||
make $J -f unix/Makefile \
|
|
||||||
CC=${TARGET}-gcc \
|
|
||||||
AS=${TARGET}-as \
|
|
||||||
AR=${TARGET}-ar \
|
|
||||||
STRIP=${TARGET}-strip \
|
|
||||||
RANLIB=${TARGET}-ranlib \
|
|
||||||
prefix=/usr \
|
|
||||||
generic
|
|
||||||
make $J -f unix/Makefile \
|
|
||||||
CC=${TARGET}-gcc \
|
|
||||||
AS=${TARGET}-as \
|
|
||||||
AR=${TARGET}-ar \
|
|
||||||
STRIP=${TARGET}-strip \
|
|
||||||
RANLIB=${TARGET}-ranlib \
|
|
||||||
prefix=${ROOTFS}/usr \
|
|
||||||
install
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
--- !Policy
|
|
||||||
product_versions:
|
|
||||||
- rhel-9
|
|
||||||
decision_context: osci_compose_gate
|
|
||||||
rules:
|
|
||||||
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
|
|
||||||
@ -1,55 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
passed=0
|
|
||||||
subtests=(basic/* unzip/* zip/*)
|
|
||||||
total=${#subtests[@]}
|
|
||||||
skipped=0
|
|
||||||
|
|
||||||
for subtest in ${subtests[@]}
|
|
||||||
do
|
|
||||||
#tests to be skipped
|
|
||||||
if [ $subtest == "zip/largefiles" ]
|
|
||||||
then
|
|
||||||
((skipped++))
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
pushd $subtest >/dev/null
|
|
||||||
./test.sh
|
|
||||||
result=$?
|
|
||||||
echo "Test $subtest result: $result"
|
|
||||||
if [ "$result" == "0" ]
|
|
||||||
then
|
|
||||||
((passed++))
|
|
||||||
fi
|
|
||||||
popd >/dev/null
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "Passed $passed/$total tests"
|
|
||||||
echo "Skipped $skipped/$total tests"
|
|
||||||
[[ $total == $((passed + skipped)) ]] || exit 1
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./out.zip"
|
|
||||||
rm -f $files
|
|
||||||
echo "Hello World" > ./in
|
|
||||||
echo "Hello World" > ./exp
|
|
||||||
|
|
||||||
zip ./out.zip ./in >/dev/null || exit 1
|
|
||||||
ls ./out.zip > /dev/null || exit 1
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./out.zip"
|
|
||||||
rm -f $files
|
|
||||||
echo "Hello World" > ./in
|
|
||||||
echo "Hello World" > ./exp
|
|
||||||
|
|
||||||
zip ./out.zip ./in > /dev/null || exit 1
|
|
||||||
|
|
||||||
rm -f ./in
|
|
||||||
|
|
||||||
unzip ./out.zip > /dev/null || exit 1
|
|
||||||
|
|
||||||
diff ./in ./exp || exit 1
|
|
||||||
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./out.zip ./out"
|
|
||||||
rm -f $files
|
|
||||||
echo "Hello World" > ./in
|
|
||||||
zip ./out.zip ./in >/dev/null || exit 1
|
|
||||||
|
|
||||||
unzip -c ./out.zip >./out || exit 1
|
|
||||||
|
|
||||||
(cat ./out |grep "Archive:[ \t]*./out.zip" >/dev/null) || exit 1
|
|
||||||
(cat ./out |grep "[ \t]*extracting:[ \t]*in" >/dev/null) || exit 1
|
|
||||||
(cat ./out |grep "Hello World" >/dev/null) || exit 1
|
|
||||||
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
@ -1,43 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./out.zip ./out"
|
|
||||||
rm -f $files
|
|
||||||
echo "Hello World" > ./in
|
|
||||||
echo "Hello World" > ./exp
|
|
||||||
|
|
||||||
zip ./out.zip ./in >/dev/null || exit 1
|
|
||||||
|
|
||||||
UNZIP=-p unzip ./out.zip >./out || exit 1
|
|
||||||
|
|
||||||
diff ./out ./exp || exit 1
|
|
||||||
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
exit 1
|
|
||||||
@ -1,43 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./out.zip ./dir"
|
|
||||||
rm -rf $files
|
|
||||||
echo "Hello World" > ./in
|
|
||||||
echo "Hello World" > ./exp
|
|
||||||
mkdir ./dir
|
|
||||||
|
|
||||||
zip ./out.zip ./in >/dev/null || exit 1
|
|
||||||
rm -f ./in
|
|
||||||
|
|
||||||
unzip -d dir ./out.zip >/dev/null || exit 1
|
|
||||||
|
|
||||||
diff ./dir/in ./exp >/dev/null || exit 1
|
|
||||||
|
|
||||||
rm -rf $files
|
|
||||||
exit 0
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./in2 ./out.zip"
|
|
||||||
rm -f $files
|
|
||||||
echo "Hello World" > ./in
|
|
||||||
echo "Hello World" > ./in2
|
|
||||||
echo "Hello World" > ./exp
|
|
||||||
|
|
||||||
zip ./out.zip ./in ./in2 >/dev/null || exit 1
|
|
||||||
rm -f ./in ./in2
|
|
||||||
|
|
||||||
unzip ./out.zip in >/dev/null || exit 1
|
|
||||||
|
|
||||||
ls ./in >/dev/null || exit 1
|
|
||||||
ls ./in2 2>/dev/null && exit 1
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./out.zip"
|
|
||||||
rm -f $files
|
|
||||||
echo "Hello World" > ./in
|
|
||||||
echo "Hello World" > ./exp
|
|
||||||
|
|
||||||
zip ./out.zip ./in >/dev/null || exit 1
|
|
||||||
|
|
||||||
echo "Hello" > ./in
|
|
||||||
|
|
||||||
touch --date="last month" ./in
|
|
||||||
|
|
||||||
unzip -of ./out.zip >/dev/null || exit 1
|
|
||||||
diff ./exp ./in >/dev/null || exit 1
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
@ -1,43 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./out.zip ./dir"
|
|
||||||
rm -rf $files
|
|
||||||
mkdir dir
|
|
||||||
echo "Hello World" > ./dir/in
|
|
||||||
echo "Hello World" > ./exp
|
|
||||||
|
|
||||||
zip ./out.zip ./dir ./dir/in >/dev/null || exit 1
|
|
||||||
rm -rf ./dir
|
|
||||||
|
|
||||||
unzip -j ./out.zip >/dev/null || exit 1
|
|
||||||
|
|
||||||
diff ./exp ./in || exit 1
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
@ -1,43 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./out.zip"
|
|
||||||
rm -f $files
|
|
||||||
echo "Hello" > ./in
|
|
||||||
echo "Hello World" > ./exp
|
|
||||||
|
|
||||||
zip ./out.zip ./in >/dev/null || exit 1
|
|
||||||
|
|
||||||
echo "Hello World" > ./in
|
|
||||||
|
|
||||||
unzip -n ./out.zip >/dev/null || exit 1
|
|
||||||
|
|
||||||
diff ./in ./exp >/dev/null || exit 1
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
@ -1,43 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./out.zip"
|
|
||||||
rm -f $files
|
|
||||||
echo "Hello World" > ./in
|
|
||||||
echo "Hello World" > ./exp
|
|
||||||
|
|
||||||
zip ./out.zip ./in >/dev/null || exit 1
|
|
||||||
|
|
||||||
echo "Hello" > ./in
|
|
||||||
|
|
||||||
unzip -o ./out.zip >/dev/null || exit 1
|
|
||||||
|
|
||||||
diff ./in ./exp >/dev/null || exit 1
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./out.zip"
|
|
||||||
rm -f $files
|
|
||||||
echo "Hello World" > ./in
|
|
||||||
echo "Hello World" > ./exp
|
|
||||||
|
|
||||||
zip -P password ./out.zip ./in >/dev/null || exit 1
|
|
||||||
rm -f ./in
|
|
||||||
|
|
||||||
unzip -P password ./out.zip >/dev/null || exit 1
|
|
||||||
|
|
||||||
diff ./in ./exp || exit 1
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./out.zip ./out"
|
|
||||||
rm -f $files
|
|
||||||
echo "Hello World" > ./in
|
|
||||||
echo "Hello World" > ./exp
|
|
||||||
|
|
||||||
zip ./out.zip ./in >/dev/null || exit 1
|
|
||||||
|
|
||||||
unzip -p ./out.zip >./out || exit 1
|
|
||||||
|
|
||||||
diff ./out ./exp || exit 1
|
|
||||||
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./in2 ./exp ./out.zip"
|
|
||||||
rm -f $files
|
|
||||||
echo "Hello World" > ./in
|
|
||||||
echo "Hello World" > ./in2
|
|
||||||
echo "Hello World" > ./exp
|
|
||||||
|
|
||||||
zip ./out.zip ./in ./in2 >/dev/null || exit 1
|
|
||||||
|
|
||||||
echo "Hello" > ./in
|
|
||||||
touch --date="last month" ./in || exit 1
|
|
||||||
|
|
||||||
rm -f ./in2
|
|
||||||
|
|
||||||
unzip -ou ./out.zip >/dev/null || exit 1
|
|
||||||
|
|
||||||
diff ./in ./exp || exit 1
|
|
||||||
diff ./in2 ./exp || exit 1
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./in2 ./out.zip"
|
|
||||||
rm -f $files
|
|
||||||
echo "Hello World" > ./in
|
|
||||||
echo "Hello World" > ./in2
|
|
||||||
echo "Hello World" > ./exp
|
|
||||||
|
|
||||||
zip ./out.zip ./in ./in2 >/dev/null || exit 1
|
|
||||||
rm -f ./in ./in2
|
|
||||||
|
|
||||||
unzip ./out.zip -x in2 >/dev/null || exit 1
|
|
||||||
|
|
||||||
ls ./in >/dev/null || exit 1
|
|
||||||
ls ./in2 2>/dev/null && exit 1
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./in2 ./exp2 ./out.zip"
|
|
||||||
rm -f $files
|
|
||||||
echo "Hello World" > ./in
|
|
||||||
echo "Hello World" > ./exp
|
|
||||||
echo "Hello World 2" > ./in2
|
|
||||||
echo "Hello World 2" > ./exp2
|
|
||||||
|
|
||||||
zip out.zip ./in >/dev/null || exit 1
|
|
||||||
zip out.zip ./in2 >/dev/null || exit 1
|
|
||||||
|
|
||||||
rm -f ./in ./in2
|
|
||||||
|
|
||||||
unzip ./out.zip >/dev/null || exit 1
|
|
||||||
|
|
||||||
diff ./in ./exp || exit 1
|
|
||||||
diff ./in2 ./exp2 || exit 1
|
|
||||||
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
@ -1,45 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./out.zip ./out2.zip"
|
|
||||||
rm -f $files
|
|
||||||
echo "Hello World" > ./in
|
|
||||||
echo "Hello World" > ./exp
|
|
||||||
|
|
||||||
zip out.zip ./in >/dev/null || exit 1
|
|
||||||
|
|
||||||
rm -f ./in
|
|
||||||
|
|
||||||
zip -U ./out.zip in --out ./out2.zip >/dev/null || exit 1
|
|
||||||
unzip ./out2.zip >/dev/null || exit 1
|
|
||||||
|
|
||||||
diff ./in ./exp || exit 1
|
|
||||||
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
@ -1,49 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./in2 ./exp2 ./out.zip ./list"
|
|
||||||
rm -f $files
|
|
||||||
echo "Hello World" > ./in
|
|
||||||
echo "Hello World" > ./in2
|
|
||||||
echo "Hello World" > ./exp
|
|
||||||
|
|
||||||
zip ./out.zip ./in ./in2 >/dev/null || exit 1
|
|
||||||
|
|
||||||
rm -f ./in ./in2
|
|
||||||
|
|
||||||
|
|
||||||
zip -d ./out.zip ./in >/dev/null || exit 1
|
|
||||||
|
|
||||||
unzip ./out.zip >/dev/null || exit 1
|
|
||||||
|
|
||||||
ls ./in 2>/dev/null && exit 1
|
|
||||||
diff ./in2 ./exp || exit 1
|
|
||||||
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./in2 ./out.zip"
|
|
||||||
rm -f $files
|
|
||||||
echo "Hello World" > ./in
|
|
||||||
echo "Hello World" > ./in2
|
|
||||||
echo "Hello World" > ./exp
|
|
||||||
|
|
||||||
zip ./out.zip ./in ./in2 >/dev/null || exit 1
|
|
||||||
|
|
||||||
export ZIPOPT="-d"
|
|
||||||
zip ./out.zip in2 >/dev/null || exit 1
|
|
||||||
|
|
||||||
rm -f ./in ./in2
|
|
||||||
|
|
||||||
unzip ./out.zip >/dev/null || exit 1
|
|
||||||
|
|
||||||
diff ./in ./exp || exit 1
|
|
||||||
ls ./in2 2>/dev/null && exit 1
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./in2 ./out.zip"
|
|
||||||
rm -fr $files
|
|
||||||
echo "Hello World" > ./in
|
|
||||||
echo "Hello World" > ./in2
|
|
||||||
|
|
||||||
zip ./out.zip ./in ./in2 -x ./in2 >/dev/null || exit 1
|
|
||||||
|
|
||||||
rm -f ./in ./in2 >/dev/null
|
|
||||||
|
|
||||||
unzip ./out.zip >/dev/null || exit 1
|
|
||||||
|
|
||||||
ls ./in >/dev/null || exit 1
|
|
||||||
ls ./in2 2>/dev/null && exit 1
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./in2 ./exp2 ./out.zip ./list"
|
|
||||||
rm -f $files
|
|
||||||
echo "Hello World" > ./in
|
|
||||||
echo "Hello World" > ./exp
|
|
||||||
echo "Hello World 2" > ./in2
|
|
||||||
echo "Hello World 2" > ./exp2
|
|
||||||
cat << EOF > ./list
|
|
||||||
./in
|
|
||||||
./in2
|
|
||||||
EOF
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
zip -@ ./out.zip <./list >/dev/null || exit 1
|
|
||||||
|
|
||||||
rm -f ./in ./in2
|
|
||||||
|
|
||||||
unzip ./out.zip >/dev/null || exit 1
|
|
||||||
|
|
||||||
diff ./in ./exp || exit 1
|
|
||||||
diff ./in2 ./exp2 || exit 1
|
|
||||||
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./in2 ./exp2 ./out.zip"
|
|
||||||
rm -f $files
|
|
||||||
echo "Hello World" > ./in
|
|
||||||
echo "Hello World" > ./exp
|
|
||||||
echo "Hello World 2" > ./in2
|
|
||||||
echo "Hello World 2" > ./exp2
|
|
||||||
|
|
||||||
touch --date "last month" ./in
|
|
||||||
|
|
||||||
zip out.zip ./in >/dev/null || exit 1
|
|
||||||
|
|
||||||
|
|
||||||
echo "Hello World 2" > ./in
|
|
||||||
|
|
||||||
zip -f ./out.zip ./in ./in2
|
|
||||||
rm -f ./in ./in2
|
|
||||||
|
|
||||||
unzip ./out.zip >/dev/null || exit 1
|
|
||||||
|
|
||||||
diff ./in ./exp2 || exit 1
|
|
||||||
ls ./in2 2>/dev/null && exit 1
|
|
||||||
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
@ -1,46 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in.in ./exp ./in2.notin ./exp2 ./out.zip"
|
|
||||||
rm -f $files
|
|
||||||
echo "Hello World" > ./in.in
|
|
||||||
echo "Hello World" > ./exp
|
|
||||||
echo "Hello World 2" > ./in2.notin
|
|
||||||
echo "Hello World 2" > ./exp2
|
|
||||||
|
|
||||||
zip out.zip ./in.in ./in2.notin -i \*.in >/dev/null || exit 1
|
|
||||||
|
|
||||||
rm -f ./in.in ./in2.notin
|
|
||||||
|
|
||||||
unzip ./out.zip >/dev/null || exit 1
|
|
||||||
|
|
||||||
diff ./in.in ./exp || exit 1
|
|
||||||
ls in2.notin 2>/dev/null && exit 1
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./out.zip ./dir"
|
|
||||||
rm -fr $files
|
|
||||||
mkdir dir
|
|
||||||
echo "Hello World" > ./dir/in
|
|
||||||
echo "Hello World" > ./exp
|
|
||||||
|
|
||||||
zip -j ./out.zip ./dir/in >/dev/null || exit 1
|
|
||||||
|
|
||||||
rm -rf ./dir
|
|
||||||
|
|
||||||
unzip ./out.zip >/dev/null
|
|
||||||
|
|
||||||
diff ./in ./exp || exit 1
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./out.zip"
|
|
||||||
rm -fr $files
|
|
||||||
dd if=/dev/urandom of=./exp bs=10M count=600 iflag=fullblock 2>/dev/null
|
|
||||||
|
|
||||||
cp ./exp ./in
|
|
||||||
|
|
||||||
zip ./out.zip ./in >/dev/null || exit 1
|
|
||||||
rm -f ./in
|
|
||||||
|
|
||||||
unzip ./out.zip || exit 1
|
|
||||||
|
|
||||||
diff ./exp ./in
|
|
||||||
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./out.zip "
|
|
||||||
rm -f $files
|
|
||||||
echo "Hello World" > ./in
|
|
||||||
echo "Hello World" > ./exp
|
|
||||||
|
|
||||||
zip -m ./out.zip ./in >/dev/null || exit 1
|
|
||||||
|
|
||||||
ls ./in 2>/dev/null && exit 1
|
|
||||||
|
|
||||||
unzip ./out.zip >/dev/null || exit 1
|
|
||||||
|
|
||||||
diff ./in ./exp || exit 1
|
|
||||||
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
@ -1,37 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./out.zip"
|
|
||||||
rm -fr $files
|
|
||||||
echo "Hello World" > ./in
|
|
||||||
echo "Hello World" > ./exp
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
@ -1,46 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./out.zip ./dir ./subdir"
|
|
||||||
rm -fr $files
|
|
||||||
mkdir -p ./dir/subdir
|
|
||||||
echo "Hello World" > ./dir/in
|
|
||||||
echo "Hello World" > ./dir/subdir/in
|
|
||||||
echo "Hello World" > ./exp
|
|
||||||
|
|
||||||
zip -r ./out.zip ./dir >/dev/null || exit 1
|
|
||||||
|
|
||||||
rm -rf ./dir
|
|
||||||
|
|
||||||
unzip ./out.zip >/dev/null || exit 1
|
|
||||||
|
|
||||||
diff ./dir/in ./exp || exit 1
|
|
||||||
diff ./dir/subdir/in ./exp || exit 1
|
|
||||||
|
|
||||||
rm -rf $files
|
|
||||||
exit 0
|
|
||||||
@ -1,49 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./out.zip ./dir ./subdir"
|
|
||||||
rm -fr $files
|
|
||||||
mkdir -p ./dir/subdir
|
|
||||||
echo "Hello World" > ./dir/in.in
|
|
||||||
echo "Hello World" > ./dir/in.notin
|
|
||||||
echo "Hello World" > ./dir/subdir/in.in
|
|
||||||
echo "Hello World" > ./exp
|
|
||||||
|
|
||||||
zip -R ./out.zip "*.in" >/dev/null || exit 1
|
|
||||||
|
|
||||||
rm -rf ./dir
|
|
||||||
|
|
||||||
unzip ./out.zip >/dev/null || exit 1
|
|
||||||
|
|
||||||
diff ./dir/in.in ./exp || exit 1
|
|
||||||
diff ./dir/subdir/in.in ./exp || exit 1
|
|
||||||
|
|
||||||
ls ./dir/in.notin >/dev/null 2>/dev/null && exit 1
|
|
||||||
|
|
||||||
rm -rf $files
|
|
||||||
exit 0
|
|
||||||
@ -1,45 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./out.zip"
|
|
||||||
rm -f $files
|
|
||||||
echo "Hello" > ./in
|
|
||||||
echo "Hello World" > ./exp
|
|
||||||
|
|
||||||
zip ./out.zip ./in >/dev/null || exit 1
|
|
||||||
echo "Hello World" > ./in
|
|
||||||
zip ./out.zip ./in >/dev/null || exit 1
|
|
||||||
|
|
||||||
rm -f ./in
|
|
||||||
|
|
||||||
unzip ./out.zip >/dev/null || exit 1
|
|
||||||
|
|
||||||
diff ./in ./exp || exit 1
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
@ -1,50 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./out.zip"
|
|
||||||
rm -fr $files
|
|
||||||
|
|
||||||
(dd if=/dev/urandom bs=1 count=50000 2>/dev/null | base64 -w 0) >./exp
|
|
||||||
|
|
||||||
for i in {0..9}
|
|
||||||
do
|
|
||||||
rm -f ./in ./out.zip
|
|
||||||
cp ./exp ./in
|
|
||||||
zip -$i ./out.zip ./in >/dev/null || exit 1
|
|
||||||
|
|
||||||
rm -f ./in
|
|
||||||
|
|
||||||
unzip ./out.zip >/dev/null || exit 1
|
|
||||||
diff ./in ./exp || exit 1
|
|
||||||
rm -f ./out.zip ./in
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
@ -1,54 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./out.zip ./out.z01 ./out.z02 ./out2.zip"
|
|
||||||
rm -fr $files
|
|
||||||
|
|
||||||
for i in {1..100000}
|
|
||||||
do
|
|
||||||
echo "Hello World" >> ./in
|
|
||||||
echo "Hello World" >> ./exp
|
|
||||||
done
|
|
||||||
|
|
||||||
zip -Z store -s 500k ./out.zip ./in >/dev/null
|
|
||||||
|
|
||||||
rm -f ./in
|
|
||||||
|
|
||||||
ls ./out.z01 >/dev/null|| exit 1
|
|
||||||
ls ./out.z02 >/dev/null|| exit 1
|
|
||||||
ls ./out.zip >/dev/null|| exit 1
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
zip -o -s- ./out.zip -O ./out2.zip >/dev/null || exit 1
|
|
||||||
|
|
||||||
unzip ./out2.zip >/dev/null || exit 1
|
|
||||||
diff ./in ./exp || exit 1
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
@ -1,37 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./out.zip"
|
|
||||||
rm -f $files
|
|
||||||
echo "Hello World" > ./in
|
|
||||||
echo "Hello World" > ./exp
|
|
||||||
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
exit 1
|
|
||||||
@ -1,45 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./out.zip ./link"
|
|
||||||
rm -f $files
|
|
||||||
echo "Hello World" > ./in
|
|
||||||
echo "Hello World" > ./exp
|
|
||||||
|
|
||||||
ln -s ./in ./link
|
|
||||||
zip --symlinks ./out.zip ./in ./link >/dev/null || exit 1
|
|
||||||
rm -f ./in ./link
|
|
||||||
|
|
||||||
unzip ./out.zip >/dev/null || exit 1
|
|
||||||
|
|
||||||
(ls -l ./link | grep "lrwxrwxrwx") >/dev/null || exit 1
|
|
||||||
|
|
||||||
diff ./link ./exp || exit 1
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (C) 2019 Jakub Martisko <jamartis at redhat dot com>
|
|
||||||
|
|
||||||
# All rights reserved.
|
|
||||||
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# * Redistributions in binary form must reproduce the above
|
|
||||||
# copyright notice, this list of conditions and the following disclaimer
|
|
||||||
# in the documentation and/or other materials provided with the
|
|
||||||
# distribution.
|
|
||||||
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
files="./in ./exp ./out.zip ./in2 ./exp2"
|
|
||||||
rm -f $files
|
|
||||||
echo "Hello" > ./in
|
|
||||||
echo "Hello" > ./in2
|
|
||||||
echo "Hello" > ./exp
|
|
||||||
echo "Hello World" > ./exp2
|
|
||||||
|
|
||||||
zip ./out.zip ./in ./in2 >/dev/null || exit 1
|
|
||||||
|
|
||||||
echo "Hello World" > ./in
|
|
||||||
echo "Hello World" > ./in2
|
|
||||||
touch --date="last month" ./in
|
|
||||||
touch --date="next month" ./in2
|
|
||||||
|
|
||||||
zip -u ./out.zip ./in ./in2 >/dev/null || exit 1
|
|
||||||
|
|
||||||
rm -f ./in ./in2
|
|
||||||
|
|
||||||
unzip ./out.zip >/dev/null || exit 1
|
|
||||||
|
|
||||||
diff ./in ./exp || exit 1
|
|
||||||
diff ./in2 ./exp2 || exit 1
|
|
||||||
|
|
||||||
rm -f $files
|
|
||||||
exit 0
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
---
|
|
||||||
- hosts: localhost
|
|
||||||
vars:
|
|
||||||
- artifacts: ./artifacts
|
|
||||||
remote_user: root
|
|
||||||
roles:
|
|
||||||
- role: standard-test-basic
|
|
||||||
tags:
|
|
||||||
- atomic
|
|
||||||
- classic
|
|
||||||
- container
|
|
||||||
tests:
|
|
||||||
- simple:
|
|
||||||
dir: gating
|
|
||||||
run: ./all.sh
|
|
||||||
required_packages:
|
|
||||||
- zip
|
|
||||||
- unzip
|
|
||||||
- coreutils
|
|
||||||
@ -1,172 +0,0 @@
|
|||||||
From af0d07f95809653b669d88aa0f424c6d5aa48ba0 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Mark Adler <fork@madler.net>
|
|
||||||
Date: Sat, 2 Jul 2022 14:35:04 -0700
|
|
||||||
Subject: [PATCH] Be more liberal in the acceptance of data descriptors.
|
|
||||||
|
|
||||||
Previously the zip64 flag determined the size of the lengths in the
|
|
||||||
data descriptor. This is compliant with the zip format. However, a
|
|
||||||
bug in the Java zip library results in an incorrect setting of that
|
|
||||||
flag. This commit permits either 32-bit or 64-bit lengths, auto-
|
|
||||||
detecting which it is, which works around the Java bug.
|
|
||||||
---
|
|
||||||
extract.c | 146 +++++++++++++++++++++++++++++++++++++++++++++---------
|
|
||||||
1 file changed, 123 insertions(+), 23 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/extract.c b/extract.c
|
|
||||||
index 878817d..b1c74df 100644
|
|
||||||
--- a/extract.c
|
|
||||||
+++ b/extract.c
|
|
||||||
@@ -2173,30 +2173,130 @@ static int extract_or_test_member(__G) /* return PK-type error code */
|
|
||||||
undefer_input(__G);
|
|
||||||
if (uO.zipbomb == TRUE) {
|
|
||||||
if ((G.lrec.general_purpose_bit_flag & 8) != 0) {
|
|
||||||
- /* skip over data descriptor (harder than it sounds, due to signature
|
|
||||||
- * ambiguity)
|
|
||||||
- */
|
|
||||||
-# define SIG 0x08074b50
|
|
||||||
-# define LOW 0xffffffff
|
|
||||||
- uch buf[12];
|
|
||||||
- unsigned shy = 12 - readbuf((char *)buf, 12);
|
|
||||||
- ulg crc = shy ? 0 : makelong(buf);
|
|
||||||
- ulg clen = shy ? 0 : makelong(buf + 4);
|
|
||||||
- ulg ulen = shy ? 0 : makelong(buf + 8); /* or high clen if ZIP64 */
|
|
||||||
- if (crc == SIG && /* if not SIG, no signature */
|
|
||||||
- (G.lrec.crc32 != SIG || /* if not SIG, have signature */
|
|
||||||
- (clen == SIG && /* if not SIG, no signature */
|
|
||||||
- ((G.lrec.csize & LOW) != SIG || /* if not SIG, have signature */
|
|
||||||
- (ulen == SIG && /* if not SIG, no signature */
|
|
||||||
- (G.pInfo->zip64 ? G.lrec.csize >> 32 : G.lrec.ucsize) != SIG
|
|
||||||
- /* if not SIG, have signature */
|
|
||||||
- )))))
|
|
||||||
- /* skip four more bytes to account for signature */
|
|
||||||
- shy += 4 - readbuf((char *)buf, 4);
|
|
||||||
- if (G.pInfo->zip64)
|
|
||||||
- shy += 8 - readbuf((char *)buf, 8); /* skip eight more for ZIP64 */
|
|
||||||
- if (shy)
|
|
||||||
+ // Skip over the data descriptor. We need to correctly position the
|
|
||||||
+ // read pointer after the data descriptor for the proper detection of
|
|
||||||
+ // overlapped zip file components.
|
|
||||||
+ //
|
|
||||||
+ // We need to resolve an ambiguity over four possible data descriptor
|
|
||||||
+ // formats. We check for all four, and pick the longest match. The data
|
|
||||||
+ // descriptor can have a signature or not, and it can use four or
|
|
||||||
+ // eight-byte lengths. The zip format requires resolving the ambiguity
|
|
||||||
+ // of a signature or not, but it uses the zip64 flag to determine
|
|
||||||
+ // whether the lengths are four or eight bytes. However there is a bug
|
|
||||||
+ // in the Java zip library that applies the wrong value of that flag.
|
|
||||||
+ // This works around that bug by always trying both length formats.
|
|
||||||
+ //
|
|
||||||
+ // So why the longest match? And does this resolve the ambiguity? No,
|
|
||||||
+ // it doesn't definitively resolve the ambiguity. However choosing the
|
|
||||||
+ // longest match at least resolves it for a normal zip file, where the
|
|
||||||
+ // bytes following the data descriptor must be another zip signature
|
|
||||||
+ // that is not a data descriptor signature. There are a few specific
|
|
||||||
+ // cases for which more than one of the formats will match the given
|
|
||||||
+ // CRC and lengths. The most plausible is between four and eight-byte
|
|
||||||
+ // lengths, either with or without a signature. That only occurs for an
|
|
||||||
+ // entry with an uncompressed size of zero. We consider the data
|
|
||||||
+ // descriptor to be a vector of four-byte values. Then the possible
|
|
||||||
+ // data descriptors are [(s) 0 c 0] and [(s) 0 c 0 0 0], where (s) is
|
|
||||||
+ // the optional signature, and c is the compressed length. c would be
|
|
||||||
+ // two for the Deflate compressed data format. These look the same, so
|
|
||||||
+ // if the file contains [(s) 0 c 0 0 0], then we cannot discriminate
|
|
||||||
+ // them. However if the data descriptor was intended to be [(s) 0 c 0],
|
|
||||||
+ // then it has been followed by eight zero bytes in the zip file for
|
|
||||||
+ // some reason. For a normal zip file this cannot be the case. The data
|
|
||||||
+ // descriptor would always be immediately followed by another zip file
|
|
||||||
+ // signature, which is four bytes that are not zeros. The other cases
|
|
||||||
+ // where more than one format matches are vanishingly unlikely, but the
|
|
||||||
+ // longest match strategy resolves those as well in a normal zip file.
|
|
||||||
+ // Those pairs are [s s s] vs. [s s s s], [s s s] vs. [s s s 0 s 0],
|
|
||||||
+ // and [s s s s s] vs. [s s s s s s]. For all, s is the signature for a
|
|
||||||
+ // data descriptor. For the first two we have an entry whose CRC,
|
|
||||||
+ // compressed length, and uncompressed length are all equal (!), and
|
|
||||||
+ // are all equal to the signature (!!). If this occurs, clearly someone
|
|
||||||
+ // is messing with us. However the strategy works nonetheless. We see
|
|
||||||
+ // that if the shorter descriptor, [s s s] were what was intended, then
|
|
||||||
+ // it has been followed by either four zero bytes or a data descriptor
|
|
||||||
+ // signature. Neither can occur for a normal zip file, where it must be
|
|
||||||
+ // followed by a signature that is not a data descriptor signature. So
|
|
||||||
+ // the longest match is the correct choice. The final case is outright
|
|
||||||
+ // insane, since the compressed and uncompressed lengths are the data
|
|
||||||
+ // descriptor signature repeated twice to make a 64-bit length, which
|
|
||||||
+ // is about 6e17. The largest drive available as I write this is 100TB,
|
|
||||||
+ // which is one six thousandth of that length. If I apply Moore's law
|
|
||||||
+ // to drive capacity, we might get to 6e17 about 25 years from now. If
|
|
||||||
+ // this code is still in use then (I've seen other code I've written in
|
|
||||||
+ // use for over 30 years), then we're still in luck. A data descriptor
|
|
||||||
+ // cannot be followed by a data descriptor signature in a normal zip
|
|
||||||
+ // file. The longest match strategy continues to work.
|
|
||||||
+ //
|
|
||||||
+ // So what is a not normal zip file, where these assumptions might fall
|
|
||||||
+ // apart? zip files have been used in a non-standard way as a poor
|
|
||||||
+ // substitute for a file system, with entries deleted and perhaps
|
|
||||||
+ // others replacing them partially, with fragmented zip files being the
|
|
||||||
+ // result. Then all bets are off as to what might or might not follow a
|
|
||||||
+ // data descriptor. Though if this sort of data descriptor ambiguity
|
|
||||||
+ // falls in one of those gaps, then there should be no adverse
|
|
||||||
+ // consequences for picking the unintended one.
|
|
||||||
+ int len = 0;
|
|
||||||
+# define SIG 0x08074b50 // optional data descriptor signature
|
|
||||||
+#ifdef LARGE_FILE_SUPPORT
|
|
||||||
+ uch buf[24];
|
|
||||||
+ int got = readbuf((char *)buf, sizeof(buf));
|
|
||||||
+ if (got >= 24 && makelong(buf) == SIG &&
|
|
||||||
+ makelong(buf + 4) == G.lrec.crc32 &&
|
|
||||||
+ makeint64(buf + 8) == G.lrec.csize &&
|
|
||||||
+ makeint64(buf + 16) == G.lrec.ucsize)
|
|
||||||
+ // Have a data descriptor with a signature and 64-bit lengths.
|
|
||||||
+ len = 24;
|
|
||||||
+ else if (got >= 20 && makelong(buf) == G.lrec.crc32 &&
|
|
||||||
+ makeint64(buf + 4) == G.lrec.csize &&
|
|
||||||
+ makeint64(buf + 12) == G.lrec.ucsize)
|
|
||||||
+ // Have a data descriptor with no signature and 64-bit lengths.
|
|
||||||
+ len = 20;
|
|
||||||
+ else if ((G.lrec.csize >> 32) == 0 && (G.lrec.ucsize >> 32) == 0)
|
|
||||||
+ // Both lengths are short enough to fit in 32 bits.
|
|
||||||
+#else
|
|
||||||
+ uch buf[16];
|
|
||||||
+ int got = readbuf((char *)buf, sizeof(buf));
|
|
||||||
+#endif
|
|
||||||
+ {
|
|
||||||
+ if (got >= 16 && makelong(buf) == SIG &&
|
|
||||||
+ makelong(buf + 4) == G.lrec.crc32 &&
|
|
||||||
+ makelong(buf + 8) == G.lrec.csize &&
|
|
||||||
+ makelong(buf + 12) == G.lrec.ucsize)
|
|
||||||
+ // Have a data descriptor with a signature and 32-bit lengths.
|
|
||||||
+ len = 16;
|
|
||||||
+ else if (got >= 12 && makelong(buf) == G.lrec.crc32 &&
|
|
||||||
+ makelong(buf + 4) == G.lrec.csize &&
|
|
||||||
+ makelong(buf + 8) == G.lrec.ucsize)
|
|
||||||
+ // Have a data descriptor with no signature and 32-bit lengths.
|
|
||||||
+ len = 12;
|
|
||||||
+ }
|
|
||||||
+ if (len == 0)
|
|
||||||
+ // There is no data descriptor that matches the entry CRC and
|
|
||||||
+ // length values.
|
|
||||||
error = PK_ERR;
|
|
||||||
+
|
|
||||||
+ // Back up got-len bytes, to position the read pointer after the data
|
|
||||||
+ // descriptor. Or to where the data descriptor was supposed to be, in
|
|
||||||
+ // the event none was found.
|
|
||||||
+ int back = got - len;
|
|
||||||
+ if (G.incnt + back > INBUFSIZ) {
|
|
||||||
+ // Need to load the preceding buffer. We've been here before.
|
|
||||||
+ G.cur_zipfile_bufstart -= INBUFSIZ;
|
|
||||||
+#ifdef USE_STRM_INPUT
|
|
||||||
+ zfseeko(G.zipfd, G.cur_zipfile_bufstart, SEEK_SET);
|
|
||||||
+#else /* !USE_STRM_INPUT */
|
|
||||||
+ zlseek(G.zipfd, G.cur_zipfile_bufstart, SEEK_SET);
|
|
||||||
+#endif /* ?USE_STRM_INPUT */
|
|
||||||
+ read(G.zipfd, (char *)G.inbuf, INBUFSIZ);
|
|
||||||
+ G.incnt -= INBUFSIZ - back;
|
|
||||||
+ G.inptr += INBUFSIZ - back;
|
|
||||||
+ }
|
|
||||||
+ else {
|
|
||||||
+ // Back up within current buffer.
|
|
||||||
+ G.incnt += back;
|
|
||||||
+ G.inptr -= back;
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return error;
|
|
||||||
Loading…
Reference in New Issue
Block a user