mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-10-21 07:08:12 +00:00
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.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user