summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2018-03-05 12:24:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2018-03-05 12:24:11 +0000
commit9fe6883be00f4e0a41cd59fe1a55965d7e8ffe2f (patch)
tree66c1b8db1995b058313ebf5f30f13025ed5dd114
parentReleasing progress-linux version 1:4.3-4~dschinn1. (diff)
downloadsquashfs-tools-9fe6883be00f4e0a41cd59fe1a55965d7e8ffe2f.zip
squashfs-tools-9fe6883be00f4e0a41cd59fe1a55965d7e8ffe2f.tar.xz
Merging debian version 1:4.3-5.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
-rw-r--r--debian/changelog18
-rw-r--r--debian/compat2
-rw-r--r--debian/control17
-rw-r--r--debian/patches/0004-unsquashfs-add-support-for-LZMA-magics.patch10
-rw-r--r--debian/patches/0005-add-fstime.patch170
-rw-r--r--debian/patches/0006-uptream-fix-race.patch4
-rw-r--r--debian/patches/0007-fix-2GB-limit-in-mksquashfs.patch2
-rw-r--r--debian/patches/0008-preserve_file_capabilities.patch32
-rw-r--r--debian/patches/0009-unsquashfs-preserve-symlink-times.patch61
-rw-r--r--debian/patches/series3
-rwxr-xr-xdebian/rules7
11 files changed, 297 insertions, 29 deletions
diff --git a/debian/changelog b/debian/changelog
index 92ce7de..d98ada0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,21 @@
+squashfs-tools (1:4.3-5) unstable; urgency=medium
+
+ * Patch unsquashfs to preserve file capabilities (closes: #804194).
+ * Update debhelper level to 11:
+ - don't specify parallel to debhelper.
+ * Update Standards-Version to 4.1.3:
+ - remove squashfs-tools-dbg package and use the auto-generated one.
+ * Sync with Ubuntu.
+
+ [ Tyler Hicks <tyhicks@canonical.com> ]
+ * debian/patches/0005-add-fstime.patch: Fix -Wint-conversion warning by
+ initializing the time_t variable with (time_t)-1 instead of NULL
+ * debian/patches/0009-unsquashfs-preserve-symlink-times.patch: Preserve
+ atime and mtime of symlink inodes in unsquashfs rather than using the
+ current time (LP: #1555305)
+
+ -- Laszlo Boszormenyi (GCS) <gcs@debian.org> Sun, 04 Mar 2018 19:36:55 +0000
+
squashfs-tools (1:4.3-4~dschinn1) dschinn-backports; urgency=medium
* Initial upload to dschinn-backports.
diff --git a/debian/compat b/debian/compat
index ec63514..b4de394 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-9
+11
diff --git a/debian/control b/debian/control
index bb09a5f..f319124 100644
--- a/debian/control
+++ b/debian/control
@@ -7,8 +7,8 @@ XSBC-Original-Maintainer: Laszlo Boszormenyi (GCS) <gcs@debian.org>
XSBC-Original-Uploaders: Filesystems Group <filesystems-devel@lists.alioth.debian.org>
Bugs: mailto:maintainers@lists.progress-linux.org
Build-Depends:
- debhelper (>= 9), libattr1-dev, liblzma-dev, liblzo2-dev, liblz4-dev, zlib1g-dev
-Standards-Version: 3.9.6
+ debhelper (>= 11), libattr1-dev, liblzma-dev, liblzo2-dev, liblz4-dev, zlib1g-dev
+Standards-Version: 4.1.3
Homepage: http://squashfs.sourceforge.net/
Vcs-Browser: https://sources.progress-linux.org/distributions/dschinn-backports/packages/squashfs-tools
Vcs-Git: https://sources.progress-linux.org/distributions/dschinn-backports/packages/squashfs-tools
@@ -25,16 +25,3 @@ Description: Tool to create and append to squashfs filesystems
Squashfs is intended for general read-only filesystem use, for archival use
(i.e. in cases where a .tar.gz file may be used), and in constrained block
device/memory systems (e.g. embedded systems) where low overhead is needed.
-
-Package: squashfs-tools-dbg
-Section: debug
-Priority: extra
-Architecture: linux-any kfreebsd-any
-Depends: ${misc:Depends}, squashfs-tools (= ${binary:Version})
-Description: Tool to create and append to squashfs filesystems (debug)
- Squashfs is a highly compressed read-only filesystem for Linux. It uses zlib
- compression to compress both files, inodes and directories. Inodes in the
- system are very small and all blocks are packed to minimise data overhead.
- Block sizes greater than 4K are supported up to a maximum of 64K.
- .
- This package contains the debugging symbols.
diff --git a/debian/patches/0004-unsquashfs-add-support-for-LZMA-magics.patch b/debian/patches/0004-unsquashfs-add-support-for-LZMA-magics.patch
index 258416b..e72423f 100644
--- a/debian/patches/0004-unsquashfs-add-support-for-LZMA-magics.patch
+++ b/debian/patches/0004-unsquashfs-add-support-for-LZMA-magics.patch
@@ -26,7 +26,7 @@ diff --git a/squashfs-tools/squashfs_fs.h b/squashfs-tools/squashfs_fs.h
index d4fba1b..8462a6b 100644
--- a/squashfs-tools/squashfs_fs.h
+++ b/squashfs-tools/squashfs_fs.h
-@@ -30,6 +30,12 @@
+@@ -31,6 +31,12 @@
#define SQUASHFS_MAGIC_SWAP 0x68737173
#define SQUASHFS_START 0
@@ -43,7 +43,7 @@ diff --git a/squashfs-tools/unsquashfs.c b/squashfs-tools/unsquashfs.c
index 320bead..7869a38 100644
--- a/squashfs-tools/unsquashfs.c
+++ b/squashfs-tools/unsquashfs.c
-@@ -1516,10 +1516,12 @@ int read_super(char *source)
+@@ -1783,10 +1783,12 @@ int read_super(char *source)
*/
read_fs_bytes(fd, SQUASHFS_START, sizeof(struct squashfs_super_block),
&sBlk_4);
@@ -58,7 +58,7 @@ index 320bead..7869a38 100644
sBlk_4.s_minor == 0) {
s_ops.squashfs_opendir = squashfs_opendir_4;
s_ops.read_fragment = read_fragment_4;
-@@ -1532,7 +1534,11 @@ int read_super(char *source)
+@@ -1799,7 +1801,11 @@ int read_super(char *source)
/*
* Check the compression type
*/
@@ -71,7 +71,7 @@ index 320bead..7869a38 100644
return TRUE;
}
-@@ -1547,8 +1553,10 @@ int read_super(char *source)
+@@ -1814,8 +1820,10 @@ int read_super(char *source)
* Check it is a SQUASHFS superblock
*/
swap = 0;
@@ -84,7 +84,7 @@ index 320bead..7869a38 100644
squashfs_super_block_3 sblk;
ERROR("Reading a different endian SQUASHFS filesystem "
"on %s\n", source);
-@@ -1626,7 +1634,11 @@ int read_super(char *source)
+@@ -1893,7 +1901,11 @@ int read_super(char *source)
/*
* 1.x, 2.x and 3.x filesystems use gzip compression.
*/
diff --git a/debian/patches/0005-add-fstime.patch b/debian/patches/0005-add-fstime.patch
new file mode 100644
index 0000000..fb6528d
--- /dev/null
+++ b/debian/patches/0005-add-fstime.patch
@@ -0,0 +1,170 @@
+Author: Jamie Strandboge <jamie@canonical.com>
+Description: add -fstime to unsquashfs to extract the fs superblock information
+ and -fstime to mksquashfs to set the fs superblock time on create. This is
+ needed to support Ubuntu Store unpack and repack checks.
+Forwarded: no
+
+Index: squashfs-tools-4.3/squashfs-tools/mksquashfs.c
+===================================================================
+--- squashfs-tools-4.3.orig/squashfs-tools/mksquashfs.c
++++ squashfs-tools-4.3/squashfs-tools/mksquashfs.c
+@@ -81,6 +81,8 @@ int delete = FALSE;
+ int fd;
+ struct squashfs_super_block sBlk;
+
++time_t forced_time = (time_t)-1;
++
+ /* filesystem flags for building */
+ int comp_opts = FALSE;
+ int no_xattrs = XATTR_DEF;
+@@ -4836,6 +4838,34 @@ int parse_numberll(char *start, long lon
+ }
+
+
++int parse_time(char *start, time_t *res)
++{
++ char *end;
++ long number = strtol(start, &end, 10);
++
++ /*
++ * http://www.gnu.org/software/libc/manual/html_node/Simple-Calendar-Time.html
++ * states that "In the GNU C Library, time_t is equivalent to long
++ * int. In other systems, time_t might be either an integer or
++ * floating-point type." As such, because strtol returns a long and
++ * because a valid value of time_t is 0 or higher, we need only check
++ * for a negative value. For this patch to be portable, we would need
++ * to account for other implementations of time_t.
++ */
++
++ /* Reject negative numbers as invalid */
++ if(number < 0)
++ return 0;
++
++ if(end[0] != '\0')
++ /* trailing junk after number */
++ return 0;
++
++ *res = (time_t) number;
++ return 1;
++}
++
++
+ int parse_number(char *start, int *res, int size)
+ {
+ long long number;
+@@ -5334,6 +5364,12 @@ print_compressor_options:
+ exit(1);
+ }
+ root_name = argv[i];
++ } else if(strcmp(argv[i], "-fstime") == 0) {
++ if((++i == argc) || !parse_time(argv[i], &forced_time)) {
++ ERROR("%s: -fstime missing or invalid "
++ "number\n", argv[0]);
++ exit(1);
++ }
+ } else if(strcmp(argv[i], "-version") == 0) {
+ VERSION();
+ } else {
+@@ -5377,6 +5413,8 @@ printOptions:
+ ERROR("\t\t\tdirectory containing that directory, "
+ "rather than the\n");
+ ERROR("\t\t\tcontents of the directory\n");
++ ERROR("-fstime secs\t\tSet fs time to seconds "
++ "since epoch. Default to current time\n");
+ ERROR("\nFilesystem filter options:\n");
+ ERROR("-p <pseudo-definition>\tAdd pseudo file "
+ "definition\n");
+@@ -5605,6 +5643,8 @@ printOptions:
+
+ printf("Creating %d.%d filesystem on %s, block size %d.\n",
+ SQUASHFS_MAJOR, SQUASHFS_MINOR, argv[source + 1], block_size);
++ if (forced_time)
++ printf("Setting fs time: %s\n", asctime(gmtime(&forced_time)));
+
+ /*
+ * store any compressor specific options after the superblock,
+@@ -5779,7 +5819,10 @@ printOptions:
+ sBlk.flags = SQUASHFS_MKFLAGS(noI, noD, noF, noX, no_fragments,
+ always_use_fragments, duplicate_checking, exportable,
+ no_xattrs, comp_opts);
+- sBlk.mkfs_time = time(NULL);
++ if (forced_time)
++ sBlk.mkfs_time = (time_t)forced_time;
++ else
++ sBlk.mkfs_time = time(NULL);
+
+ disable_info();
+
+Index: squashfs-tools-4.3/squashfs-tools/unsquashfs.c
+===================================================================
+--- squashfs-tools-4.3.orig/squashfs-tools/unsquashfs.c
++++ squashfs-tools-4.3/squashfs-tools/unsquashfs.c
+@@ -1623,6 +1623,13 @@ void dir_scan(char *parent_name, unsigne
+ }
+
+
++void squashfs_fstime(time_t *fstime)
++{
++ time_t mkfs_time = (time_t) sBlk.s.mkfs_time;
++ *fstime = (time_t) mkfs_time;
++}
++
++
+ void squashfs_stat(char *source)
+ {
+ time_t mkfs_time = (time_t) sBlk.s.mkfs_time;
+@@ -2509,13 +2516,14 @@ int parse_number(char *arg, int *res)
+ int main(int argc, char *argv[])
+ {
+ char *dest = "squashfs-root";
+- int i, stat_sys = FALSE, version = FALSE;
++ int i, stat_sys = FALSE, version = FALSE, stat_fstime = FALSE;
+ int n;
+ struct pathnames *paths = NULL;
+ struct pathname *path = NULL;
+ long long directory_table_end;
+ int fragment_buffer_size = FRAGMENT_BUFFER_DEFAULT;
+ int data_buffer_size = DATA_BUFFER_DEFAULT;
++ time_t fstime;
+
+ pthread_mutex_init(&screen_mutex, NULL);
+ root_process = geteuid() == 0;
+@@ -2604,6 +2612,8 @@ int main(int argc, char *argv[])
+ else if(strcmp(argv[i], "-stat") == 0 ||
+ strcmp(argv[i], "-s") == 0)
+ stat_sys = TRUE;
++ else if(strcmp(argv[i], "-fstime") == 0)
++ stat_fstime = TRUE;
+ else if(strcmp(argv[i], "-lls") == 0 ||
+ strcmp(argv[i], "-ll") == 0) {
+ lsonly = TRUE;
+@@ -2674,6 +2684,8 @@ options:
+ "overwrite\n");
+ ERROR("\t-s[tat]\t\t\tdisplay filesystem superblock "
+ "information\n");
++ ERROR("\t-fstime\t\t\tdisplay filesystem superblock "
++ "time\n");
+ ERROR("\t-e[f] <extract file>\tlist of directories or "
+ "files to extract.\n\t\t\t\tOne per line\n");
+ ERROR("\t-da[ta-queue] <size>\tSet data queue to "
+@@ -2709,6 +2721,20 @@ options:
+ exit(0);
+ }
+
++ if(stat_fstime) {
++ squashfs_fstime(&fstime);
++ /*
++ * http://www.gnu.org/software/libc/manual/html_node/Simple-Calendar-Time.html
++ * states that "In the GNU C Library, time_t is equivalent to
++ * long int. In other systems, time_t might be either an
++ * integer or floating-point type." For this patch to be
++ * portable, we would need to account for other implementations
++ * of time_t.
++ */
++ printf("%ld\n", (long)fstime);
++ exit(0);
++ }
++
+ if(!check_compression(comp))
+ exit(1);
+
diff --git a/debian/patches/0006-uptream-fix-race.patch b/debian/patches/0006-uptream-fix-race.patch
index 3cefbe5..4f4c4d5 100644
--- a/debian/patches/0006-uptream-fix-race.patch
+++ b/debian/patches/0006-uptream-fix-race.patch
@@ -6,7 +6,7 @@ Date: Thu Sep 18 01:28:11 2014 +0100
Fix a rare race condition in fragment waiting when finalising the
filesystem. This is a race condition that was initially fixed in 2009,
- but inadvertantly re-introduced in the latest release when the code
+ but inadvertently re-introduced in the latest release when the code
was rewritten.
Background:
@@ -42,7 +42,7 @@ diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
index 87b7d86..f1fcff1 100644
--- a/squashfs-tools/mksquashfs.c
+++ b/squashfs-tools/mksquashfs.c
-@@ -2445,8 +2445,8 @@ void *frag_deflator(void *arg)
+@@ -2447,8 +2447,8 @@ void *frag_deflator(void *arg)
write_buffer->block = bytes;
bytes += compressed_size;
fragments_outstanding --;
diff --git a/debian/patches/0007-fix-2GB-limit-in-mksquashfs.patch b/debian/patches/0007-fix-2GB-limit-in-mksquashfs.patch
index c689a3a..58c892e 100644
--- a/debian/patches/0007-fix-2GB-limit-in-mksquashfs.patch
+++ b/debian/patches/0007-fix-2GB-limit-in-mksquashfs.patch
@@ -16,7 +16,7 @@ diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
index f1fcff1..d221c35 100644
--- a/squashfs-tools/mksquashfs.c
+++ b/squashfs-tools/mksquashfs.c
-@@ -2055,7 +2055,7 @@ struct file_info *duplicate(long long file_size, long long bytes,
+@@ -2057,7 +2057,7 @@ struct file_info *duplicate(long long file_size, long long bytes,
inline int is_fragment(struct inode_info *inode)
{
diff --git a/debian/patches/0008-preserve_file_capabilities.patch b/debian/patches/0008-preserve_file_capabilities.patch
new file mode 100644
index 0000000..640abbe
--- /dev/null
+++ b/debian/patches/0008-preserve_file_capabilities.patch
@@ -0,0 +1,32 @@
+From 8b53425f2eb284728852d0851ace2bc172e1a637 Mon Sep 17 00:00:00 2001
+From: Wessel Dankers <wsl-debian-804194@fruit.je>
+Date: Fri, 17 Jun 2016 09:46:42 +0800
+Subject: [PATCH] unsquashfs: Correctly set file capabilities
+
+As posted on https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804194.
+---
+ squashfs-tools/unsquashfs.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/squashfs-tools/unsquashfs.c b/squashfs-tools/unsquashfs.c
+index 1323dd6..a5f0117 100644
+--- a/squashfs-tools/unsquashfs.c
++++ b/squashfs-tools/unsquashfs.c
+@@ -821,8 +821,6 @@ int set_attributes(char *pathname, int mode, uid_t uid, gid_t guid, time_t time,
+ {
+ struct utimbuf times = { time, time };
+
+- write_xattr(pathname, xattr);
+-
+ if(utime(pathname, &times) == -1) {
+ ERROR("set_attributes: failed to set time on %s, because %s\n",
+ pathname, strerror(errno));
+@@ -845,6 +843,8 @@ int set_attributes(char *pathname, int mode, uid_t uid, gid_t guid, time_t time,
+ return FALSE;
+ }
+
++ write_xattr(pathname, xattr);
++
+ return TRUE;
+ }
+
diff --git a/debian/patches/0009-unsquashfs-preserve-symlink-times.patch b/debian/patches/0009-unsquashfs-preserve-symlink-times.patch
new file mode 100644
index 0000000..604c2e0
--- /dev/null
+++ b/debian/patches/0009-unsquashfs-preserve-symlink-times.patch
@@ -0,0 +1,61 @@
+From ff6f3f685498d33858d9306884962075415ab5f2 Mon Sep 17 00:00:00 2001
+From: Tyler Hicks <tyhicks@canonical.com>
+Date: Wed, 29 Nov 2017 16:48:23 +0000
+Subject: [PATCH] unsquashfs: Preserve times on symlink inodes
+
+This patch fixes a bug that caused symlinks created by unsquashfs to
+use the current time for atime and mtime rather than the times present
+in the squashfs archive.
+
+The timestamps are set using utimensat(2) which does not dereference the
+symlink when the AT_SYMLINK_NOFOLLOW flag is used. The utimensat(2)
+system call supports nanosecond precision but that's not needed by
+squashfs so timespec.tv_nsec is unconditionally set to 0.
+
+Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
+Bug-Ubuntu: https://launchpad.net/bugs/1724152
+Forwarded: https://sourceforge.net/p/squashfs/mailman/message/36140758/
+---
+ squashfs-tools/unsquashfs.c | 15 ++++++++++++++-
+ 1 file changed, 14 insertions(+), 1 deletion(-)
+
+Index: squashfs-tools-4.3/squashfs-tools/unsquashfs.c
+===================================================================
+--- squashfs-tools-4.3.orig/squashfs-tools/unsquashfs.c
++++ squashfs-tools-4.3/squashfs-tools/unsquashfs.c
+@@ -1087,7 +1087,12 @@ int create_inode(char *pathname, struct
+ file_count ++;
+ break;
+ case SQUASHFS_SYMLINK_TYPE:
+- case SQUASHFS_LSYMLINK_TYPE:
++ case SQUASHFS_LSYMLINK_TYPE: {
++ struct timespec times[2] = {
++ { i->time, 0 },
++ { i->time, 0 }
++ };
++
+ TRACE("create_inode: symlink, symlink_size %lld\n",
+ i->data);
+
+@@ -1101,6 +1106,13 @@ int create_inode(char *pathname, struct
+ break;
+ }
+
++ if (utimensat(AT_FDCWD, pathname, times,
++ AT_SYMLINK_NOFOLLOW) == -1) {
++ ERROR("create_inode: failed to set time on "
++ "%s, because %s\n", pathname,
++ strerror(errno));
++ }
++
+ write_xattr(pathname, i->xattr);
+
+ if(root_process) {
+@@ -1113,6 +1125,7 @@ int create_inode(char *pathname, struct
+
+ sym_count ++;
+ break;
++ }
+ case SQUASHFS_BLKDEV_TYPE:
+ case SQUASHFS_CHRDEV_TYPE:
+ case SQUASHFS_LBLKDEV_TYPE:
diff --git a/debian/patches/series b/debian/patches/series
index 8975032..6b639d6 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,5 +2,8 @@
0002-fix_phys_mem_calculation.patch
0003-CVE-2015-4645_and_CVE-2015-4646.patch
0004-unsquashfs-add-support-for-LZMA-magics.patch
+0005-add-fstime.patch
0006-uptream-fix-race.patch
0007-fix-2GB-limit-in-mksquashfs.patch
+0008-preserve_file_capabilities.patch
+0009-unsquashfs-preserve-symlink-times.patch
diff --git a/debian/rules b/debian/rules
index e107e44..8af05f1 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,7 +7,7 @@
export DEB_CFLAGS_MAINT_APPEND = -fgnu89-inline
%:
- dh ${@} --sourcedirectory=squashfs-tools/ --parallel
+ dh ${@} --sourcedirectory=squashfs-tools/
override_dh_auto_configure:
dh_auto_configure -- $(shell dpkg-buildflags --export=cmdline)
@@ -21,7 +21,4 @@ override_dh_auto_install:
override_dh_builddeb:
dh_builddeb -- -Zxz
-override_dh_strip:
- dh_strip --dbg-package=squashfs-tools-dbg
-
-.PHONY: override_dh_auto_build override_dh_auto_install override_dh_strip override_dh_builddeb
+.PHONY: override_dh_auto_build override_dh_auto_install override_dh_builddeb