More updates

This commit is contained in:
David Tomaschik
2025-09-09 10:25:59 -07:00
parent dea3f289c2
commit f2faccd93f
5 changed files with 68 additions and 21 deletions

View File

@@ -835,14 +835,14 @@ case "$1" in
fi
cd /proc
N=$2
if [ -d $N ] ; then
if [ -d "$N" ] ; then
# read permissions?
if [ ! -r $N/exe ] ; then
if [ ! -r "$N/exe" ] ; then
if !(root_privs) ; then
printf "\033[31mNo read permissions for '/proc/$N/exe' (run as root).\033[m\n\n"
printf "\033[31mNo read permissions for '/proc/%s/exe' (run as root).\033[m\n\n" "$N"
exit 1
fi
if [ ! `readlink $N/exe` ] ; then
if [ ! "$(readlink "$N/exe")" ] ; then
printf "\033[31mPermission denied. Requested process ID belongs to a kernel thread.\033[m\n\n"
exit 1
fi
@@ -860,9 +860,9 @@ case "$1" in
printf "\033[31mError: libc not found.\033[m\n\n"
exit 1
fi
printf "* Process name (PID) : %s (%d)\n" `head -1 $N/status | cut -b 7-` $N
FS_chk_func_libc=( $(readelf -s $FS_libc | grep _chk@@ | awk '{ print $8 }' | cut -c 3- | sed -e 's/_chk@.*//') )
FS_functions=( $(readelf -s $2/exe | awk '{ print $8 }' | sed 's/_*//' | sed -e 's/@.*//') )
printf "* Process name (PID) : %s (%d)\n" "$(head -1 "$N/status" | cut -b 7-)" "$N"
FS_chk_func_libc=( $(readelf -s "$FS_libc" | grep _chk@@ | awk '{ print $8 }' | cut -c 3- | sed -e 's/_chk@.*//') )
FS_functions=( $(readelf -s "$2/exe" | awk '{ print $8 }' | sed 's/_*//' | sed -e 's/@.*//') )
FS_libc_check
FS_binary_check

View File

@@ -2,6 +2,7 @@
LOCKTIME="${SCREENSAVER_MIN:-5}"
LOCKER="i3lock -c 000000"
# intentionally want word splitting below
# do not quote this
/usr/bin/xss-lock -- ${LOCKER} &
exec /usr/bin/xautolock \
-time "${LOCKTIME}" \

View File

@@ -42,7 +42,7 @@ install_package() {
return 1
fi
echo "Installing '$package' using apt-get..."
sudo apt-get install -y "$package"
sudo apt-get install -y -- "$package"
return 0
elif command -v yum &> /dev/null; then
package=$(package_alias yum "${package}")
@@ -51,7 +51,7 @@ install_package() {
return 1
fi
echo "Installing '$package' using yum..."
sudo yum install -y "$package"
sudo yum install -y -- "$package"
return 0
elif command -v pacman &> /dev/null; then
package=$(package_alias pacman "${package}")
@@ -60,7 +60,7 @@ install_package() {
return 1
fi
echo "Installing '$package' using pacman..."
sudo pacman -S "$package"
sudo pacman -S -- "$package"
return 0
# For macOS, assume Homebrew is installed
elif command -v brew &> /dev/null; then
@@ -70,7 +70,7 @@ install_package() {
return 1
fi
echo "Installing '$package' using Homebrew..."
brew install "$package"
brew install -- "$package"
return 0
else
echo "Error: No suitable package manager found."

View File

@@ -25,14 +25,6 @@ function flameshot_gui_capture {
flameshot gui -p "${SCREENDIR}"
}
function flameshot_region_capture {
flameshot_gui_capture
}
function flameshot_window_capture {
flameshot_gui_capture
}
function flameshot_full_capture {
flameshot full -p "${SCREENDIR}"
}
@@ -52,7 +44,35 @@ function scrot_full_capture {
case "${CMD}" in
region|window|full)
mkdir -p "${SCREENDIR}"
${TOOL}_${CMD}_capture
case "${TOOL}" in
flameshot)
case "${CMD}" in
region|window)
flameshot_gui_capture
;;
full)
flameshot_full_capture
;;
esac
;;
scrot)
case "${CMD}" in
region)
scrot_region_capture
;;
window)
scrot_window_capture
;;
full)
scrot_full_capture
;;
esac
;;
*)
echo "Error: Unknown or unsupported tool '${TOOL}'" >&2
exit 1
;;
esac
exit $?
;;
*)