Date: Monday, March 20, 2023 @ 15:00:55
  Author: eworm
Revision: 471612

upgpkg: squashfs-tools 4.6-2: fix crash with xattr

Added:
  squashfs-tools/trunk/0001-xattr-fix-the-name-in-error-message.patch
Modified:
  squashfs-tools/trunk/PKGBUILD

------------------------------------------------+
 0001-xattr-fix-the-name-in-error-message.patch |   40 +++++++++++++++++++++++
 PKGBUILD                                       |   17 +++++++--
 2 files changed, 53 insertions(+), 4 deletions(-)

Added: 0001-xattr-fix-the-name-in-error-message.patch
===================================================================
--- 0001-xattr-fix-the-name-in-error-message.patch                              
(rev 0)
+++ 0001-xattr-fix-the-name-in-error-message.patch      2023-03-20 15:00:55 UTC 
(rev 471612)
@@ -0,0 +1,40 @@
+From 3ac6d8663740a7018d4e50778dc67f372afbddb1 Mon Sep 17 00:00:00 2001
+From: Christian Hesse <[email protected]>
+Date: Mon, 20 Mar 2023 11:02:27 +0100
+Subject: [PATCH 1/1] xattr: fix the name in error message
+
+Commit 744ca24fd680eb0535b251e801be10195d2ffcfb changed to no longer
+copy the name, but we need it. Mess with p only after we used it.
+
+Fixes #234
+---
+ squashfs-tools/xattr.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/squashfs-tools/xattr.c b/squashfs-tools/xattr.c
+index 32343f5..a46eb1f 100644
+--- a/squashfs-tools/xattr.c
++++ b/squashfs-tools/xattr.c
+@@ -219,15 +219,15 @@ static int read_xattrs_from_system(struct dir_ent 
*dir_ent, char *filename,
+               xattr_list = x;
+ 
+               xattr_list[i].type = xattr_get_prefix(&xattr_list[i], p);
+-              p += strlen(p) + 1;
+ 
+               if(xattr_list[i].type == -1) {
+-                      ERROR("Unrecognised xattr prefix %s\n",
+-                              xattr_list[i].full_name);
+-                      free(xattr_list[i].full_name);
++                      ERROR("Unrecognised xattr prefix %s\n", p);
++                      p += strlen(p) + 1;
+                       continue;
+               }
+ 
++              p += strlen(p) + 1;
++
+               while(1) {
+                       vsize = lgetxattr(filename, xattr_list[i].full_name,
+                                                               NULL, 0);
+-- 
+2.40.0
+

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2023-03-20 14:10:18 UTC (rev 471611)
+++ PKGBUILD    2023-03-20 15:00:55 UTC (rev 471612)
@@ -6,7 +6,7 @@
 
 pkgname=squashfs-tools
 pkgver=4.6
-pkgrel=1
+pkgrel=2
 pkgdesc='Tools for squashfs, a highly compressed read-only filesystem for 
Linux'
 arch=(x86_64)
 url='https://github.com/plougher/squashfs-tools'
@@ -21,10 +21,19 @@
   zstd
 )
 makedepends=(help2man)
-source=($url/archive/$pkgver/$pkgname-$pkgver.tar.gz)
-sha512sums=('3a9effb9a5cf46fbb9f393e58bd938874dc4121828b77c67d659117ee84643917998a8503d629f46f1eff1826f6d7ae59ac2d803a5cdc3cfb1006ef2b3abf8c8')
-b2sums=('1c04a8f6149863667151e76b3c1ecfdd5e9a181b305bea694af1d4968ac361114c9e926b351dcee2647796a21bc8cfc55b3d95f020ad88c3388007460de26053')
+source=("$url/archive/$pkgver/$pkgname-$pkgver.tar.gz"
+        '0001-xattr-fix-the-name-in-error-message.patch')
+sha512sums=('3a9effb9a5cf46fbb9f393e58bd938874dc4121828b77c67d659117ee84643917998a8503d629f46f1eff1826f6d7ae59ac2d803a5cdc3cfb1006ef2b3abf8c8'
+            
'c0f86bf3ab686fb889ccd302faeff60aa9d9188a35cf553e5ad53c638066e603adb80a51ef61fad16baf283b67b834a0dd120a90091c2f87c61c8216b2eee57f')
+b2sums=('1c04a8f6149863667151e76b3c1ecfdd5e9a181b305bea694af1d4968ac361114c9e926b351dcee2647796a21bc8cfc55b3d95f020ad88c3388007460de26053'
+        
'fbf7008f37c630a5a95ecaa0b05f0b808508f1b23b838e040f77aebbe8ed459a5a24f728c3730c4e22479f5711b8984380c5ff6e602d9a1b2bad0e25a5aa1804')
 
+prepare() {
+  cd $pkgname-$pkgver/
+
+  patch -Np1 < ../0001-xattr-fix-the-name-in-error-message.patch
+}
+
 build() {
   local make_options=(
     GZIP_SUPPORT=1

Reply via email to