From be8ce8b9759bfcd78143ec6dd77293dce68b0472 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Thu, 8 Oct 2026 20:31:22 -0300 Subject: [PATCH] fix(probe): preserve Debian library directory permissions The Debian package set the xCAT helper directory to 0644, preventing unprivileged users from loading the probe modules. Set library directories to 0755 and regular files to 0644. Repair the old helper-directory mode during configuration because dpkg preserves existing modes. Leave administrator overrides, other modes, and symlinks unchanged. --- xCAT-probe/debian/postinst | 6 ++++++ xCAT-probe/debian/rules | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/xCAT-probe/debian/postinst b/xCAT-probe/debian/postinst index 5ced18096..19af47964 100644 --- a/xCAT-probe/debian/postinst +++ b/xCAT-probe/debian/postinst @@ -20,6 +20,12 @@ set -e case "$1" in configure) + probe_lib=/opt/xcat/probe/lib/perl/xCAT + if [ -d "$probe_lib" ] && [ ! -L "$probe_lib" ] && + [ "$(stat -c %a "$probe_lib")" = 644 ] && + ! dpkg-statoverride --list "$probe_lib" >/dev/null; then + chmod 755 "$probe_lib" + fi ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/xCAT-probe/debian/rules b/xCAT-probe/debian/rules index bb1842ebe..7f1a3c4ba 100755 --- a/xCAT-probe/debian/rules +++ b/xCAT-probe/debian/rules @@ -42,8 +42,8 @@ binary-arch: dh_install -X".svn" chmod 755 `pwd`/debian/xcat-probe/opt/xcat/bin/* chmod 755 `pwd`/debian/xcat-probe/opt/xcat/probe/subcmds/* - chmod 644 `pwd`/debian/xcat-probe/opt/xcat/probe/lib/perl/* - chmod 644 `pwd`/debian/xcat-probe/opt/xcat/probe/lib/perl/xCAT/* + find `pwd`/debian/xcat-probe/opt/xcat/probe/lib -type d -exec chmod 755 {} + + find `pwd`/debian/xcat-probe/opt/xcat/probe/lib -type f -exec chmod 644 {} + # dh_installmenu # dh_installdebconf # dh_installlogrotate