[crux-commits] ports/contrib (refs/remotes/origin/3.6): sasquatch: initial commit, v4.3-3e0cc40

crux at crux.nu crux at crux.nu
Sat Apr 10 19:06:05 UTC 2021


commit 1835e8f9c057c782208ed3365b05ffe2d402d7a9
Author: Alexandr Savca <alexandr.savca89 at gmail.com>
Date:   Tue Jan 5 17:47:29 2021 +0200

    sasquatch: initial commit, v4.3-3e0cc40

diff --git a/sasquatch/.footprint b/sasquatch/.footprint
new file mode 100644
index 000000000..e9954aa49
--- /dev/null
+++ b/sasquatch/.footprint
@@ -0,0 +1,2 @@
+drwxr-xr-x	root/root	sbin/
+-rwxr-xr-x	root/root	sbin/sasquatch
diff --git a/sasquatch/.signature b/sasquatch/.signature
new file mode 100644
index 000000000..edaf838e3
--- /dev/null
+++ b/sasquatch/.signature
@@ -0,0 +1,7 @@
+untrusted comment: verify with /etc/ports/contrib.pub
+RWSagIOpLGJF36pkTT7xLzalnE+PWqlTw+Wd2dY9Hs6YkHyul3HpwZdUTM+0hiDJocXM1ffTKnWXqzfH+hDS2HQL0za3h1Tq2wk=
+SHA256 (Pkgfile) = 7e187ce6af35e08473d3e5d405b9c3caa31332e9266cba92d533d3b9efa942ff
+SHA256 (.footprint) = f65e0f81294a5ad9575bbefc38b4d244ae02ae95ff3066e9cf57e082d21c3f03
+SHA256 (squashfs4.3.tar.gz) = 0d605512437b1eb800b4736791559295ee5f60177e102e4d4ccd0ee241a5f3f6
+SHA256 (sasquatch-3e0cc40fc6dbe32bd3a5e6c553b3320d5d91ceed.tar.gz) = 3e1f8a4b510861fdcb3ba23b088c4cbd11e510e7ef0274b25264301efb0d39a2
+SHA256 (read_fragment_table_n_stack_overflow-fix.patch) = 120c2d208085129235bf998b1c22abee19db26120a98174b9beb5edd7b9c84e9
diff --git a/sasquatch/Pkgfile b/sasquatch/Pkgfile
new file mode 100644
index 000000000..a65ab14be
--- /dev/null
+++ b/sasquatch/Pkgfile
@@ -0,0 +1,22 @@
+# Description: Tools for squashfs, a highly compressed read-only filesystem for Linux
+# URL:         https://github.com/devttys0/sasquatch
+# Maintainer:  Alexandr Savca, alexandrsavca89 at gmail dot com
+# Depends on:  squashfs-tools zlib
+
+name=sasquatch
+version=4.3-3e0cc40
+_commit=3e0cc40fc6dbe32bd3a5e6c553b3320d5d91ceed
+release=1
+source=(https://downloads.sourceforge.net/project/squashfs/squashfs/squashfs4.3/squashfs4.3.tar.gz 
+	https://github.com/devttys0/$name/archive/$_commit/$name-$_commit.tar.gz
+        read_fragment_table_n_stack_overflow-fix.patch)
+
+build() {
+	cd squashfs4.3/squashfs-tools
+
+	patch -p1 -i $SRC/$name-$_commit/patches/patch0.txt
+	patch -p0 -i $SRC/read_fragment_table_n_stack_overflow-fix.patch
+
+	make GZIP_SUPPORT=1 LZO_SUPPORT=1 XZ_SUPPORT=1 EXTRA_CFLAGS="-fcommon"
+	make install INSTALL_DIR=$PKG/sbin
+}
diff --git a/sasquatch/read_fragment_table_n_stack_overflow-fix.patch b/sasquatch/read_fragment_table_n_stack_overflow-fix.patch
new file mode 100644
index 000000000..a9d39201a
--- /dev/null
+++ b/sasquatch/read_fragment_table_n_stack_overflow-fix.patch
@@ -0,0 +1,27 @@
+--- unsquash-4.c	2014-03-09 06:31:59.000000000 +0100
++++ unsquash-4.c.1	2016-10-15 11:41:12.914245961 +0200
+@@ -31,9 +31,9 @@
+ int read_fragment_table_4(long long *directory_table_end)
+ {
+ 	int res, i;
+-	int bytes = SQUASHFS_FRAGMENT_BYTES(sBlk.s.fragments);
+-	int  indexes = SQUASHFS_FRAGMENT_INDEXES(sBlk.s.fragments);
+-	long long fragment_table_index[indexes];
++	size_t bytes = SQUASHFS_FRAGMENT_BYTES(sBlk.s.fragments);
++	size_t indexes = SQUASHFS_FRAGMENT_INDEXES(sBlk.s.fragments);
++	long long *fragment_table_index;
+ 
+ 	TRACE("read_fragment_table: %d fragments, reading %d fragment indexes "
+ 		"from 0x%llx\n", sBlk.s.fragments, indexes,
+@@ -44,6 +44,11 @@
+ 		return TRUE;
+ 	}
+ 
++	fragment_table_index = malloc(indexes*sizeof(long long));
++	if(fragment_table_index == NULL)
++		EXIT_UNSQUASH("read_fragment_table: failed to allocate "
++			"fragment table index\n");
++
+ 	fragment_table = malloc(bytes);
+ 	if(fragment_table == NULL)
+ 		EXIT_UNSQUASH("read_fragment_table: failed to allocate "


More information about the crux-commits mailing list