!33 Upgrade to 3.6.1
From: @zhang__3125 Reviewed-by: @xiezhipeng1 Signed-off-by: @xiezhipeng1
This commit is contained in:
commit
bf65438694
29
0001-Drop-rmd160-from-OpenSSL.patch
Normal file
29
0001-Drop-rmd160-from-OpenSSL.patch
Normal file
@ -0,0 +1,29 @@
|
||||
From ec97aebcd2a3c4ed3a2fbb0037364b349bf9e84a Mon Sep 17 00:00:00 2001
|
||||
From: Stephen Gallagher <sgallagh@redhat.com>
|
||||
Date: Fri, 3 Dec 2021 11:07:55 -0500
|
||||
Subject: [PATCH] Drop rmd160 from OpenSSL
|
||||
|
||||
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
|
||||
---
|
||||
configure.ac | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index cb89c3ee81530e63e18f12aec2bbf04e8c0a1a34..b4d8ceabba4131a93589c0cf6bcd29bed8bdc774 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -1205,11 +1205,10 @@ if test "x$with_openssl" != "xno"; then
|
||||
*)
|
||||
AC_CHECK_LIB(crypto,OPENSSL_config)
|
||||
;;
|
||||
esac
|
||||
CRYPTO_CHECK(MD5, OPENSSL, md5)
|
||||
- CRYPTO_CHECK(RMD160, OPENSSL, rmd160)
|
||||
CRYPTO_CHECK(SHA1, OPENSSL, sha1)
|
||||
CRYPTO_CHECK(SHA256, OPENSSL, sha256)
|
||||
CRYPTO_CHECK(SHA384, OPENSSL, sha384)
|
||||
CRYPTO_CHECK(SHA512, OPENSSL, sha512)
|
||||
AC_CHECK_FUNCS([PKCS5_PBKDF2_HMAC_SHA1])
|
||||
--
|
||||
2.33.1
|
||||
|
||||
@ -1,212 +0,0 @@
|
||||
From ede459d2ebb879f5eedb6f7abea203be0b334230 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Matuska <martin@matuska.org>
|
||||
Date: Wed, 17 Nov 2021 21:06:00 +0100
|
||||
Subject: [PATCH] archive_write_disk_posix: fix writing fflags broken in
|
||||
8a1bd5c
|
||||
|
||||
The fixup list was erroneously assumed to be directories only.
|
||||
Only in the case of critical file flags modification (e.g. SF_IMMUTABLE
|
||||
on BSD systems), other file types (e.g. regular files or symbolic links)
|
||||
may be added to the fixup list. We still need to verify that we are writing
|
||||
to the correct file type, so compare the archive entry file type with
|
||||
the file type of the file to be modified.
|
||||
|
||||
Fixes #1617
|
||||
Conflict:NA
|
||||
Reference:https://github.com/libarchive/libarchive/commit/ede459d2ebb879f5eedb6f7abea203be0b334230
|
||||
说明:这是CVE-2021-31556的后置补丁,CVE-2021-31556虽然已在基线tar包修复,但我们仍然建议合入该补丁,并且以该CVE号来命名
|
||||
---
|
||||
libarchive/archive_write_disk_posix.c | 87 +++++++++++++++++++++++----
|
||||
1 file changed, 75 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c
|
||||
index aadc58718..7e57aac2e 100644
|
||||
--- a/libarchive/archive_write_disk_posix.c
|
||||
+++ b/libarchive/archive_write_disk_posix.c
|
||||
@@ -173,6 +173,7 @@ struct fixup_entry {
|
||||
struct fixup_entry *next;
|
||||
struct archive_acl acl;
|
||||
mode_t mode;
|
||||
+ __LA_MODE_T filetype;
|
||||
int64_t atime;
|
||||
int64_t birthtime;
|
||||
int64_t mtime;
|
||||
@@ -357,6 +358,7 @@ struct archive_write_disk {
|
||||
|
||||
static int la_opendirat(int, const char *);
|
||||
static int la_mktemp(struct archive_write_disk *);
|
||||
+static int la_verify_filetype(mode_t, __LA_MODE_T);
|
||||
static void fsobj_error(int *, struct archive_string *, int, const char *,
|
||||
const char *);
|
||||
static int check_symlinks_fsobj(char *, int *, struct archive_string *,
|
||||
@@ -464,6 +466,39 @@ la_opendirat(int fd, const char *path) {
|
||||
#endif
|
||||
}
|
||||
|
||||
+static int
|
||||
+la_verify_filetype(mode_t mode, __LA_MODE_T filetype) {
|
||||
+ int ret = 0;
|
||||
+
|
||||
+ switch (filetype) {
|
||||
+ case AE_IFREG:
|
||||
+ ret = (S_ISREG(mode));
|
||||
+ break;
|
||||
+ case AE_IFDIR:
|
||||
+ ret = (S_ISDIR(mode));
|
||||
+ break;
|
||||
+ case AE_IFLNK:
|
||||
+ ret = (S_ISLNK(mode));
|
||||
+ break;
|
||||
+ case AE_IFSOCK:
|
||||
+ ret = (S_ISSOCK(mode));
|
||||
+ break;
|
||||
+ case AE_IFCHR:
|
||||
+ ret = (S_ISCHR(mode));
|
||||
+ break;
|
||||
+ case AE_IFBLK:
|
||||
+ ret = (S_ISBLK(mode));
|
||||
+ break;
|
||||
+ case AE_IFIFO:
|
||||
+ ret = (S_ISFIFO(mode));
|
||||
+ break;
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ return (ret);
|
||||
+}
|
||||
+
|
||||
static int
|
||||
lazy_stat(struct archive_write_disk *a)
|
||||
{
|
||||
@@ -822,6 +857,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry)
|
||||
fe = current_fixup(a, archive_entry_pathname(entry));
|
||||
if (fe == NULL)
|
||||
return (ARCHIVE_FATAL);
|
||||
+ fe->filetype = archive_entry_filetype(entry);
|
||||
fe->fixup |= TODO_MODE_BASE;
|
||||
fe->mode = a->mode;
|
||||
}
|
||||
@@ -832,6 +868,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry)
|
||||
fe = current_fixup(a, archive_entry_pathname(entry));
|
||||
if (fe == NULL)
|
||||
return (ARCHIVE_FATAL);
|
||||
+ fe->filetype = archive_entry_filetype(entry);
|
||||
fe->mode = a->mode;
|
||||
fe->fixup |= TODO_TIMES;
|
||||
if (archive_entry_atime_is_set(entry)) {
|
||||
@@ -865,6 +902,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry)
|
||||
fe = current_fixup(a, archive_entry_pathname(entry));
|
||||
if (fe == NULL)
|
||||
return (ARCHIVE_FATAL);
|
||||
+ fe->filetype = archive_entry_filetype(entry);
|
||||
fe->fixup |= TODO_ACLS;
|
||||
archive_acl_copy(&fe->acl, archive_entry_acl(entry));
|
||||
}
|
||||
@@ -877,6 +915,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry)
|
||||
fe = current_fixup(a, archive_entry_pathname(entry));
|
||||
if (fe == NULL)
|
||||
return (ARCHIVE_FATAL);
|
||||
+ fe->filetype = archive_entry_filetype(entry);
|
||||
fe->mac_metadata = malloc(metadata_size);
|
||||
if (fe->mac_metadata != NULL) {
|
||||
memcpy(fe->mac_metadata, metadata,
|
||||
@@ -891,6 +930,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry)
|
||||
fe = current_fixup(a, archive_entry_pathname(entry));
|
||||
if (fe == NULL)
|
||||
return (ARCHIVE_FATAL);
|
||||
+ fe->filetype = archive_entry_filetype(entry);
|
||||
fe->fixup |= TODO_FFLAGS;
|
||||
/* TODO: Complete this.. defer fflags from below. */
|
||||
}
|
||||
@@ -2463,7 +2503,7 @@ _archive_write_disk_close(struct archive *_a)
|
||||
struct fixup_entry *next, *p;
|
||||
struct stat st;
|
||||
char *c;
|
||||
- int fd, ret;
|
||||
+ int fd, ret, openflags;
|
||||
|
||||
archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC,
|
||||
ARCHIVE_STATE_HEADER | ARCHIVE_STATE_DATA,
|
||||
@@ -2490,32 +2530,53 @@ _archive_write_disk_close(struct archive *_a)
|
||||
if (p->fixup == 0)
|
||||
goto skip_fixup_entry;
|
||||
else {
|
||||
- fd = open(p->name, O_BINARY | O_NOFOLLOW | O_RDONLY
|
||||
+ /*
|
||||
+ * We need to verify if the type of the file
|
||||
+ * we are going to open matches the file type
|
||||
+ * of the fixup entry.
|
||||
+ */
|
||||
+ openflags = O_BINARY | O_NOFOLLOW | O_RDONLY
|
||||
+ | O_CLOEXEC;
|
||||
#if defined(O_DIRECTORY)
|
||||
- | O_DIRECTORY
|
||||
+ if (p->filetype == AE_IFDIR)
|
||||
+ openflags |= O_DIRECTORY;
|
||||
#endif
|
||||
- | O_CLOEXEC);
|
||||
+ fd = open(p->name, openflags);
|
||||
+
|
||||
+#if defined(O_DIRECTORY)
|
||||
/*
|
||||
- ` * If we don't support O_DIRECTORY,
|
||||
- * or open() has failed, we must stat()
|
||||
- * to verify that we are opening a directory
|
||||
+ * If we support O_DIRECTORY and open was
|
||||
+ * successful we can skip the file type check
|
||||
+ * for directories. For other file types
|
||||
+ * we need to verify via fstat() or lstat()
|
||||
*/
|
||||
-#if defined(O_DIRECTORY)
|
||||
- if (fd == -1) {
|
||||
+ if (fd == -1 || p->filetype != AE_IFDIR) {
|
||||
+#if HAVE_FSTAT
|
||||
+ if (fd > 0 && (
|
||||
+ fstat(fd, &st) != 0 ||
|
||||
+ la_verify_filetype(st.st_mode,
|
||||
+ p->filetype) == 0)) {
|
||||
+ goto skip_fixup_entry;
|
||||
+ } else
|
||||
+#endif
|
||||
if (lstat(p->name, &st) != 0 ||
|
||||
- !S_ISDIR(st.st_mode)) {
|
||||
+ la_verify_filetype(st.st_mode,
|
||||
+ p->filetype) == 0) {
|
||||
goto skip_fixup_entry;
|
||||
}
|
||||
}
|
||||
#else
|
||||
#if HAVE_FSTAT
|
||||
if (fd > 0 && (
|
||||
- fstat(fd, &st) != 0 || !S_ISDIR(st.st_mode))) {
|
||||
+ fstat(fd, &st) != 0 ||
|
||||
+ la_verify_filetype(st.st_mode,
|
||||
+ p->filetype) == 0)) {
|
||||
goto skip_fixup_entry;
|
||||
} else
|
||||
#endif
|
||||
if (lstat(p->name, &st) != 0 ||
|
||||
- !S_ISDIR(st.st_mode)) {
|
||||
+ la_verify_filetype(st.st_mode,
|
||||
+ p->filetype) == 0) {
|
||||
goto skip_fixup_entry;
|
||||
}
|
||||
#endif
|
||||
@@ -2689,6 +2750,7 @@ new_fixup(struct archive_write_disk *a, const char *pathname)
|
||||
fe->next = a->fixup_list;
|
||||
a->fixup_list = fe;
|
||||
fe->fixup = 0;
|
||||
+ fe->filetype = 0;
|
||||
fe->name = strdup(pathname);
|
||||
return (fe);
|
||||
}
|
||||
@@ -3811,6 +3873,7 @@ set_fflags(struct archive_write_disk *a)
|
||||
le = current_fixup(a, a->name);
|
||||
if (le == NULL)
|
||||
return (ARCHIVE_FATAL);
|
||||
+ le->filetype = archive_entry_filetype(a->entry);
|
||||
le->fixup |= TODO_FFLAGS;
|
||||
le->fflags_set = set;
|
||||
/* Store the mode if it's not already there. */
|
||||
|
||||
@ -1,58 +0,0 @@
|
||||
From a7ce8a6aa7b710986ab918761c8d2ff1b0e9f537 Mon Sep 17 00:00:00 2001
|
||||
From: Samanta Navarro <ferivoz@riseup.net>
|
||||
Date: Sat, 28 Aug 2021 11:58:00 +0000
|
||||
Subject: [PATCH] Fix size_t cast in read_mac_metadata_blob
|
||||
|
||||
The size_t data type on 32 bit systems is smaller than int64_t. Check
|
||||
the int64_t value before casting to size_t. If the value is too large
|
||||
then stop operation instead of continuing operation with truncated
|
||||
value.
|
||||
|
||||
Conflict:NA
|
||||
Reference:https://github.com/libarchive/libarchive/commit/a7ce8a6aa7b710986ab918761c8d2ff1b0e9f537
|
||||
---
|
||||
libarchive/archive_read_support_format_tar.c | 12 +++++++++---
|
||||
1 file changed, 9 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/libarchive/archive_read_support_format_tar.c b/libarchive/archive_read_support_format_tar.c
|
||||
index 7e8febacf..773796a5d 100644
|
||||
--- a/libarchive/archive_read_support_format_tar.c
|
||||
+++ b/libarchive/archive_read_support_format_tar.c
|
||||
@@ -1396,6 +1396,7 @@ read_mac_metadata_blob(struct archive_read *a, struct tar *tar,
|
||||
struct archive_entry *entry, const void *h, size_t *unconsumed)
|
||||
{
|
||||
int64_t size;
|
||||
+ size_t msize;
|
||||
const void *data;
|
||||
const char *p, *name;
|
||||
const wchar_t *wp, *wname;
|
||||
@@ -1434,6 +1435,11 @@ read_mac_metadata_blob(struct archive_read *a, struct tar *tar,
|
||||
|
||||
/* Read the body as a Mac OS metadata blob. */
|
||||
size = archive_entry_size(entry);
|
||||
+ msize = (size_t)size;
|
||||
+ if (size < 0 || (uintmax_t)msize != (uintmax_t)size) {
|
||||
+ *unconsumed = 0;
|
||||
+ return (ARCHIVE_FATAL);
|
||||
+ }
|
||||
|
||||
/*
|
||||
* TODO: Look beyond the body here to peek at the next header.
|
||||
@@ -1447,13 +1453,13 @@ read_mac_metadata_blob(struct archive_read *a, struct tar *tar,
|
||||
* Q: Is the above idea really possible? Even
|
||||
* when there are GNU or pax extension entries?
|
||||
*/
|
||||
- data = __archive_read_ahead(a, (size_t)size, NULL);
|
||||
+ data = __archive_read_ahead(a, msize, NULL);
|
||||
if (data == NULL) {
|
||||
*unconsumed = 0;
|
||||
return (ARCHIVE_FATAL);
|
||||
}
|
||||
- archive_entry_copy_mac_metadata(entry, data, (size_t)size);
|
||||
- *unconsumed = (size_t)((size + 511) & ~ 511);
|
||||
+ archive_entry_copy_mac_metadata(entry, data, msize);
|
||||
+ *unconsumed = (msize + 511) & ~ 511;
|
||||
tar_flush_unconsumed(a, unconsumed);
|
||||
return (tar_read_header(a, tar, entry, unconsumed));
|
||||
}
|
||||
|
||||
@ -1,193 +0,0 @@
|
||||
commit 8a1bd5c18e896f0411a991240ce0d772bb02c840
|
||||
Author: Martin Matuska <martin@matuska.org>
|
||||
Date: Fri Aug 27 10:56:28 2021 +0200
|
||||
|
||||
Fix following symlinks when processing the fixup list
|
||||
|
||||
The previous fix in b41daecb5 was incomplete. Fixup entries are
|
||||
given the original path without calling cleanup_pathname().
|
||||
To make sure we don't follow a symlink, we must strip trailing
|
||||
slashes from the path.
|
||||
|
||||
The fixup entries are always directories. Make sure we try to modify
|
||||
only directories by providing O_DIRECTORY to open() (if supported)
|
||||
and if it fails to check directory via lstat().
|
||||
|
||||
Fixes #1566
|
||||
|
||||
diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c
|
||||
index fcd733af..aadc5871 100644
|
||||
--- a/libarchive/archive_write_disk_posix.c
|
||||
+++ b/libarchive/archive_write_disk_posix.c
|
||||
@@ -2462,6 +2462,7 @@ _archive_write_disk_close(struct archive *_a)
|
||||
struct archive_write_disk *a = (struct archive_write_disk *)_a;
|
||||
struct fixup_entry *next, *p;
|
||||
struct stat st;
|
||||
+ char *c;
|
||||
int fd, ret;
|
||||
|
||||
archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC,
|
||||
@@ -2475,24 +2476,49 @@ _archive_write_disk_close(struct archive *_a)
|
||||
while (p != NULL) {
|
||||
fd = -1;
|
||||
a->pst = NULL; /* Mark stat cache as out-of-date. */
|
||||
- if (p->fixup &
|
||||
- (TODO_TIMES | TODO_MODE_BASE | TODO_ACLS | TODO_FFLAGS)) {
|
||||
- fd = open(p->name,
|
||||
- O_WRONLY | O_BINARY | O_NOFOLLOW | O_CLOEXEC);
|
||||
+
|
||||
+ /* We must strip trailing slashes from the path to avoid
|
||||
+ dereferencing symbolic links to directories */
|
||||
+ c = p->name;
|
||||
+ while (*c != '\0')
|
||||
+ c++;
|
||||
+ while (c != p->name && *(c - 1) == '/') {
|
||||
+ c--;
|
||||
+ *c = '\0';
|
||||
+ }
|
||||
+
|
||||
+ if (p->fixup == 0)
|
||||
+ goto skip_fixup_entry;
|
||||
+ else {
|
||||
+ fd = open(p->name, O_BINARY | O_NOFOLLOW | O_RDONLY
|
||||
+#if defined(O_DIRECTORY)
|
||||
+ | O_DIRECTORY
|
||||
+#endif
|
||||
+ | O_CLOEXEC);
|
||||
+ /*
|
||||
+ ` * If we don't support O_DIRECTORY,
|
||||
+ * or open() has failed, we must stat()
|
||||
+ * to verify that we are opening a directory
|
||||
+ */
|
||||
+#if defined(O_DIRECTORY)
|
||||
if (fd == -1) {
|
||||
- /* If we cannot lstat, skip entry */
|
||||
- if (lstat(p->name, &st) != 0)
|
||||
+ if (lstat(p->name, &st) != 0 ||
|
||||
+ !S_ISDIR(st.st_mode)) {
|
||||
goto skip_fixup_entry;
|
||||
- /*
|
||||
- * If we deal with a symbolic link, mark
|
||||
- * it in the fixup mode to ensure no
|
||||
- * modifications are made to its target.
|
||||
- */
|
||||
- if (S_ISLNK(st.st_mode)) {
|
||||
- p->mode &= ~S_IFMT;
|
||||
- p->mode |= S_IFLNK;
|
||||
}
|
||||
}
|
||||
+#else
|
||||
+#if HAVE_FSTAT
|
||||
+ if (fd > 0 && (
|
||||
+ fstat(fd, &st) != 0 || !S_ISDIR(st.st_mode))) {
|
||||
+ goto skip_fixup_entry;
|
||||
+ } else
|
||||
+#endif
|
||||
+ if (lstat(p->name, &st) != 0 ||
|
||||
+ !S_ISDIR(st.st_mode)) {
|
||||
+ goto skip_fixup_entry;
|
||||
+ }
|
||||
+#endif
|
||||
}
|
||||
if (p->fixup & TODO_TIMES) {
|
||||
set_times(a, fd, p->mode, p->name,
|
||||
@@ -2504,14 +2530,13 @@ _archive_write_disk_close(struct archive *_a)
|
||||
if (p->fixup & TODO_MODE_BASE) {
|
||||
#ifdef HAVE_FCHMOD
|
||||
if (fd >= 0)
|
||||
- fchmod(fd, p->mode);
|
||||
+ fchmod(fd, p->mode & 07777);
|
||||
else
|
||||
#endif
|
||||
#ifdef HAVE_LCHMOD
|
||||
- lchmod(p->name, p->mode);
|
||||
+ lchmod(p->name, p->mode & 07777);
|
||||
#else
|
||||
- if (!S_ISLNK(p->mode))
|
||||
- chmod(p->name, p->mode);
|
||||
+ chmod(p->name, p->mode & 07777);
|
||||
#endif
|
||||
}
|
||||
if (p->fixup & TODO_ACLS)
|
||||
@@ -2664,7 +2689,6 @@ new_fixup(struct archive_write_disk *a, const char *pathname)
|
||||
fe->next = a->fixup_list;
|
||||
a->fixup_list = fe;
|
||||
fe->fixup = 0;
|
||||
- fe->mode = 0;
|
||||
fe->name = strdup(pathname);
|
||||
return (fe);
|
||||
}
|
||||
diff --git a/libarchive/test/test_write_disk_fixup.c b/libarchive/test/test_write_disk_fixup.c
|
||||
index c399c984..b83b7307 100644
|
||||
--- a/libarchive/test/test_write_disk_fixup.c
|
||||
+++ b/libarchive/test/test_write_disk_fixup.c
|
||||
@@ -47,26 +47,50 @@ DEFINE_TEST(test_write_disk_fixup)
|
||||
/*
|
||||
* Create a file
|
||||
*/
|
||||
- assertMakeFile("victim", 0600, "a");
|
||||
+ assertMakeFile("file", 0600, "a");
|
||||
+
|
||||
+ /*
|
||||
+ * Create a directory
|
||||
+ */
|
||||
+ assertMakeDir("dir", 0700);
|
||||
|
||||
/*
|
||||
* Create a directory and a symlink with the same name
|
||||
*/
|
||||
|
||||
- /* Directory: dir */
|
||||
+ /* Directory: dir1 */
|
||||
+ assert((ae = archive_entry_new()) != NULL);
|
||||
+ archive_entry_copy_pathname(ae, "dir1/");
|
||||
+ archive_entry_set_mode(ae, AE_IFDIR | 0555);
|
||||
+ assertEqualIntA(ad, 0, archive_write_header(ad, ae));
|
||||
+ assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
|
||||
+ archive_entry_free(ae);
|
||||
+
|
||||
+ /* Directory: dir2 */
|
||||
assert((ae = archive_entry_new()) != NULL);
|
||||
- archive_entry_copy_pathname(ae, "dir");
|
||||
- archive_entry_set_mode(ae, AE_IFDIR | 0606);
|
||||
+ archive_entry_copy_pathname(ae, "dir2/");
|
||||
+ archive_entry_set_mode(ae, AE_IFDIR | 0555);
|
||||
assertEqualIntA(ad, 0, archive_write_header(ad, ae));
|
||||
assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
|
||||
archive_entry_free(ae);
|
||||
|
||||
- /* Symbolic Link: dir -> foo */
|
||||
+ /* Symbolic Link: dir1 -> dir */
|
||||
+ assert((ae = archive_entry_new()) != NULL);
|
||||
+ archive_entry_copy_pathname(ae, "dir1");
|
||||
+ archive_entry_set_mode(ae, AE_IFLNK | 0777);
|
||||
+ archive_entry_set_size(ae, 0);
|
||||
+ archive_entry_copy_symlink(ae, "dir");
|
||||
+ assertEqualIntA(ad, 0, r = archive_write_header(ad, ae));
|
||||
+ if (r >= ARCHIVE_WARN)
|
||||
+ assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
|
||||
+ archive_entry_free(ae);
|
||||
+
|
||||
+ /* Symbolic Link: dir2 -> file */
|
||||
assert((ae = archive_entry_new()) != NULL);
|
||||
- archive_entry_copy_pathname(ae, "dir");
|
||||
+ archive_entry_copy_pathname(ae, "dir2");
|
||||
archive_entry_set_mode(ae, AE_IFLNK | 0777);
|
||||
archive_entry_set_size(ae, 0);
|
||||
- archive_entry_copy_symlink(ae, "victim");
|
||||
+ archive_entry_copy_symlink(ae, "file");
|
||||
assertEqualIntA(ad, 0, r = archive_write_header(ad, ae));
|
||||
if (r >= ARCHIVE_WARN)
|
||||
assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
|
||||
@@ -75,7 +99,9 @@ DEFINE_TEST(test_write_disk_fixup)
|
||||
assertEqualInt(ARCHIVE_OK, archive_write_free(ad));
|
||||
|
||||
/* Test the entries on disk. */
|
||||
- assertIsSymlink("dir", "victim", 0);
|
||||
- assertFileMode("victim", 0600);
|
||||
+ assertIsSymlink("dir1", "dir", 0);
|
||||
+ assertIsSymlink("dir2", "file", 0);
|
||||
+ assertFileMode("dir", 0700);
|
||||
+ assertFileMode("file", 0600);
|
||||
#endif
|
||||
}
|
||||
Binary file not shown.
BIN
libarchive-3.6.1.tar.gz
Normal file
BIN
libarchive-3.6.1.tar.gz
Normal file
Binary file not shown.
@ -1,22 +1,19 @@
|
||||
%bcond_without check
|
||||
|
||||
Name: libarchive
|
||||
Version: 3.5.2
|
||||
Release: 3
|
||||
Version: 3.6.1
|
||||
Release: 1
|
||||
Summary: Multi-format archive and compression library
|
||||
|
||||
License: BSD
|
||||
URL: https://www.libarchive.org/
|
||||
Source0: https://www.libarchive.org/downloads/%{name}-%{version}.tar.gz
|
||||
Source0: https://libarchive.org/downloads/%{name}-%{version}.tar.gz
|
||||
|
||||
BuildRequires: gcc bison sharutils zlib-devel bzip2-devel xz-devel
|
||||
BuildRequires: lzo-devel e2fsprogs-devel libacl-devel libattr-devel
|
||||
BuildRequires: openssl-devel libxml2-devel lz4-devel automake libzstd-devel
|
||||
BuildRequires: autoconf libtool make
|
||||
|
||||
Patch6000: backport-libarchive-3.5.2-symlink-fix.patch
|
||||
Patch6001: backport-CVE-2021-36976.patch
|
||||
Patch6002: backport-CVE-2021-31566.patch
|
||||
|
||||
Patch0001: 0001-Drop-rmd160-from-OpenSSL.patch
|
||||
Patch9000: libarchive-uninitialized-value.patch
|
||||
|
||||
%description
|
||||
@ -67,13 +64,14 @@ standard output.
|
||||
%autosetup -n %{name}-%{version} -p1
|
||||
|
||||
%build
|
||||
%configure --disable-rpath
|
||||
autoreconf -ifv
|
||||
%configure --disable-rpath --disable-static LT_SYS_LIBRARY_PATH=%_libdir
|
||||
%disable_rpath
|
||||
|
||||
%make_build
|
||||
|
||||
%install
|
||||
%make_install
|
||||
%make_install
|
||||
%delete_la
|
||||
|
||||
replace ()
|
||||
@ -84,15 +82,18 @@ replace ()
|
||||
pattern=${binary##bsd}
|
||||
|
||||
awk "
|
||||
# replace the topic
|
||||
/^.Dt ${pattern^^} 1/ {
|
||||
print \".Dt ${binary^^} 1\";
|
||||
next;
|
||||
}
|
||||
# replace the first occurence of \"$pattern\" by \"$binary\"
|
||||
!stop && /^.Nm $pattern/ {
|
||||
print \".Nm $binary\" ;
|
||||
stop = 1 ;
|
||||
next;
|
||||
}
|
||||
# print remaining lines
|
||||
1;
|
||||
" "$filename" > "$filename.new"
|
||||
mv "$filename".new "$filename"
|
||||
@ -104,7 +105,6 @@ do
|
||||
replace "$installed_manpage"
|
||||
done
|
||||
|
||||
|
||||
%check
|
||||
%if %{with check}
|
||||
logfiles ()
|
||||
@ -131,7 +131,8 @@ cat_logs ()
|
||||
run_testsuite ()
|
||||
{
|
||||
rc=0
|
||||
LD_LIBRARY_PATH=`pwd`/.libs make %{?_smp_mflags} check -j1 || {
|
||||
%make_build check -j1 || {
|
||||
# error happened - try to extract in koji as much info as possible
|
||||
cat_logs
|
||||
|
||||
for i in `tempdirs`; do
|
||||
@ -149,8 +150,6 @@ run_testsuite
|
||||
|
||||
%endif
|
||||
|
||||
%ldconfig_scriptlets
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%{!?_licensedir:%global license %%doc}
|
||||
@ -162,7 +161,6 @@ run_testsuite
|
||||
%{_includedir}/*.h
|
||||
%{_libdir}/%{name}.so
|
||||
%{_libdir}/pkgconfig/%{name}.pc
|
||||
%{_libdir}/*.a
|
||||
|
||||
%files help
|
||||
%defattr(-,root,root)
|
||||
@ -190,6 +188,9 @@ run_testsuite
|
||||
%{_bindir}/bsdcat
|
||||
|
||||
%changelog
|
||||
* Mon Jun 6 2022 lin zhang <lin.zhang@turbolinux.com.cn> - 3.6.1-1
|
||||
- Upgrade to 3.6.1
|
||||
|
||||
* Sat Apr 09 2022 wangkerong <wangkerong@h-paetners.com> - 3.5.2-3
|
||||
- fix CVE-2021-36976,CVE-2021-31566,fix fuzz test
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
version_control: github
|
||||
src_repo: libarchive/libarchive
|
||||
tag_prefix: ^v
|
||||
seperator: .
|
||||
separator: .
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user