From 9e4730ab624bfc2e8e5356c278aa4e4bb53a9be3b3629887a5df87d517550998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 2 Dec 2016 13:53:54 +0000 Subject: [PATCH] Accepting request 443193 from OBS:Server:Unstable fix OBS-URL: https://build.opensuse.org/request/show/443193 OBS-URL: https://build.opensuse.org/package/show/Archiving/libarchive?expand=0&rev=67 --- fix-extract-over-links.patch | 23 +++++++++++++++++++++++ libarchive.changes | 7 +++++++ libarchive.spec | 7 +++++-- 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 fix-extract-over-links.patch diff --git a/fix-extract-over-links.patch b/fix-extract-over-links.patch new file mode 100644 index 0000000..f3d24ff --- /dev/null +++ b/fix-extract-over-links.patch @@ -0,0 +1,23 @@ +--- a/libarchive/archive_write_disk_posix.c.orig 2016-12-02 13:13:57.433550535 +0000 ++++ a/libarchive/archive_write_disk_posix.c 2016-12-02 13:16:36.770020356 +0000 +@@ -2051,12 +2051,14 @@ create_filesystem_object(struct archive_ + /* EPERM is more appropriate than error_number for our callers */ + return (EPERM); + } +- r = check_symlinks_fsobj(linkname_copy, &error_number, &error_string, a->flags); +- if (r != ARCHIVE_OK) { +- archive_set_error(&a->archive, error_number, "%s", error_string.s); +- free(linkname_copy); +- /* EPERM is more appropriate than error_number for our callers */ +- return (EPERM); ++ if (a->flags & ARCHIVE_EXTRACT_SECURE_SYMLINKS) { ++ r = check_symlinks_fsobj(linkname_copy, &error_number, &error_string, a->flags); ++ if (r != ARCHIVE_OK) { ++ archive_set_error(&a->archive, error_number, "%s", error_string.s); ++ free(linkname_copy); ++ /* EPERM is more appropriate than error_number for our callers */ ++ return (EPERM); ++ } + } + free(linkname_copy); + r = link(linkname, a->name) ? errno : 0; diff --git a/libarchive.changes b/libarchive.changes index 191d7ae..97655c5 100644 --- a/libarchive.changes +++ b/libarchive.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Dec 2 13:37:54 UTC 2016 - adrian@suse.com + +- fix extracting over symlinks: fix-extract-over-links.patch + the problem is solved upstream different, but git master + is too different atm. + ------------------------------------------------------------------- Wed Oct 26 09:27:32 UTC 2016 - adrian@suse.com diff --git a/libarchive.spec b/libarchive.spec index 3858f82..0f8d645 100644 --- a/libarchive.spec +++ b/libarchive.spec @@ -41,6 +41,8 @@ Group: Productivity/Archiving/Compression Url: http://www.libarchive.org/ Source0: http://www.libarchive.org/downloads/libarchive-%{version}.tar.gz Source1: baselibs.conf +# PATCH-FIX-OPENSUSE the problem is solved upstream different, but git master is too different atm. +Patch0: fix-extract-over-links.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: libacl-devel BuildRequires: libbz2-devel @@ -55,7 +57,7 @@ BuildRequires: libxml2-devel BuildRequires: pkg-config BuildRequires: xz-devel BuildRequires: zlib-devel -Patch0: libarchive-openssl.patch +Patch1: libarchive-openssl.patch %description Libarchive is a programming library that can create and read several @@ -162,8 +164,9 @@ static library for libarchive %prep %setup -q +%patch0 -p1 %if %{with openssl} -%patch0 -p0 +%patch1 -p0 %endif %build