mirror of
https://github.com/Snigdha-OS/snigdhaos-pkgbuilds.git
synced 2025-12-06 08:03:50 +01:00
🐛 fix(explicit): vulnerablities removed
This commit is contained in:
@@ -3,12 +3,14 @@
|
|||||||
"http://www.freedesktop.org/software/polkit/policyconfig-1.dtd">
|
"http://www.freedesktop.org/software/polkit/policyconfig-1.dtd">
|
||||||
<policyconfig>
|
<policyconfig>
|
||||||
|
|
||||||
|
<!-- Vendor Information -->
|
||||||
<vendor>Snigdha OS</vendor>
|
<vendor>Snigdha OS</vendor>
|
||||||
<vendor_url>https://snigdhaos.org</vendor_url>
|
<vendor_url>https://snigdhaos.org</vendor_url>
|
||||||
|
|
||||||
<action id="org.snigdhaos.libs.install-package.pkexec.policy.run">
|
<!-- Policy for Installing Packages -->
|
||||||
|
<action id="org.snigdhaos.package.install">
|
||||||
<description>Install software using the pacman package manager</description>
|
<description>Install software using the pacman package manager</description>
|
||||||
<message>Authentication is required to install software with pacman.</message>
|
<message>Administrator authentication is required to install software using pacman.</message>
|
||||||
<icon_name>snigdhaos-pacman</icon_name>
|
<icon_name>snigdhaos-pacman</icon_name>
|
||||||
<defaults>
|
<defaults>
|
||||||
<allow_any>no</allow_any>
|
<allow_any>no</allow_any>
|
||||||
@@ -19,10 +21,11 @@
|
|||||||
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
|
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
|
||||||
</action>
|
</action>
|
||||||
|
|
||||||
<action id="org.garuda.libs.pkexec-gui.pkexec.policy.run">
|
<!-- Policy for Running Graphical Programs with Elevated Privileges -->
|
||||||
<description>Run a graphical program as root</description>
|
<action id="org.snigdhaos.graphical.run-as-root">
|
||||||
<message>Authentication is required to run a graphical program with elevated privileges.</message>
|
<description>Run graphical applications with administrative privileges</description>
|
||||||
<icon_name>gnome-session</icon_name>
|
<message>Administrator authentication is required to run this graphical application with elevated privileges.</message>
|
||||||
|
<icon_name>snigdhaos-root-gui</icon_name>
|
||||||
<defaults>
|
<defaults>
|
||||||
<allow_any>no</allow_any>
|
<allow_any>no</allow_any>
|
||||||
<allow_inactive>no</allow_inactive>
|
<allow_inactive>no</allow_inactive>
|
||||||
|
|||||||
@@ -2,30 +2,32 @@
|
|||||||
|
|
||||||
# Ensure pkexec is available
|
# Ensure pkexec is available
|
||||||
if ! command -v pkexec &>/dev/null; then
|
if ! command -v pkexec &>/dev/null; then
|
||||||
echo "Error: pkexec is not installed. Please install PolicyKit."
|
echo "Error: 'pkexec' is not installed. Please install PolicyKit to proceed."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if running as root
|
# Check if the script is being run as root
|
||||||
if [[ $EUID -ne 0 ]]; then
|
if [[ $EUID -ne 0 ]]; then
|
||||||
# Attempt to execute the script as root via pkexec
|
# Attempt to elevate privileges and rerun the script with pkexec
|
||||||
exec pkexec /usr/lib/snigdhaos/pkexec-gui "$@"
|
exec pkexec /usr/lib/snigdhaos/pkexec-gui "$@"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Shellcheck disable: Read environment variables from parent process
|
# Export environment variables from the parent process
|
||||||
|
# ShellCheck Directive: Allow environment variables to be read and exported from /proc
|
||||||
# shellcheck disable=SC2163
|
# shellcheck disable=SC2163
|
||||||
# Read the necessary environment variables from the parent process
|
|
||||||
while IFS= read -rd '' var; do
|
while IFS= read -rd '' var; do
|
||||||
export "$var"
|
export "$var"
|
||||||
done < <(grep --null-data -ae "^\($XDG_CURRENT_DESKTOP\|WAYLAND_DISPLAY\|XDG_RUNTIME_DIR\|XDG_SESSION_TYPE\|XCURSOR_SIZE\|LC_*\|LANG\|LANGUAGE\|QT_WAYLAND_FORCE_DPI\|QT_QPA_PLATFORMTHEME\|QT_STYLE-OVERRIDE\|\)=.*\$" /proc/$PPID/environ)
|
done < <(
|
||||||
|
grep --null-data -ae "^\($XDG_CURRENT_DESKTOP\|WAYLAND_DISPLAY\|XDG_RUNTIME_DIR\|XDG_SESSION_TYPE\|XCURSOR_SIZE\|LC_.*\|LANG\|LANGUAGE\|QT_WAYLAND_FORCE_DPI\|QT_QPA_PLATFORMTHEME\|QT_STYLE_OVERRIDE\)=" /proc/$PPID/environ
|
||||||
|
)
|
||||||
|
|
||||||
# Adjust WAYLAND_DISPLAY if running on Wayland
|
# Adjust WAYLAND_DISPLAY if running on Wayland
|
||||||
if [[ -n "$WAYLAND_DISPLAY" ]]; then
|
if [[ -n "$WAYLAND_DISPLAY" ]]; then
|
||||||
export WAYLAND_DISPLAY="$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY"
|
export WAYLAND_DISPLAY="$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set the root user's XDG_RUNTIME_DIR
|
# Set the root user's runtime directory
|
||||||
export XDG_RUNTIME_DIR="/run/user/0"
|
export XDG_RUNTIME_DIR="/run/user/0"
|
||||||
|
|
||||||
# Execute the provided command with root privileges
|
# Execute the provided command with root privileges
|
||||||
|
|||||||
Reference in New Issue
Block a user