summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-09-11 09:27:00 +0200
committerGravatar Christian Hesse <mail@eworm.de>2024-09-11 10:11:50 +0200
commit3d2aaec9a604282bf0e561df6e676277dd079c7f (patch)
tree42ed64fe7be60942eea025e432c69cbf9949ece1
parent60b8118e03992a2e888690e2cd1c43327b931a47 (diff)
downloadpacman-offline-3d2aaec9a604282bf0e561df6e676277dd079c7f.tar.gz
pacman-offline-3d2aaec9a604282bf0e561df6e676277dd079c7f.tar.zst
use pkexec to elevate privileges
This requires polkit to be installed.
-rw-r--r--README.md4
-rwxr-xr-xbin/pacman-offline4
2 files changed, 6 insertions, 2 deletions
diff --git a/README.md b/README.md
index 7f7b3c1..0a8ef9f 100644
--- a/README.md
+++ b/README.md
@@ -16,6 +16,10 @@ There are the runtime dependencies:
* [pacman](https://archlinux.org/pacman/)
* [systemd](https://www.github.com/systemd/systemd)
+And there's an optional dependency to support elevating privileges:
+
+* [polkit](https://github.com/polkit-org/polkit)
+
Optional basic support for
[plymouth](https://www.freedesktop.org/wiki/Software/Plymouth/) is
integrated.
diff --git a/bin/pacman-offline b/bin/pacman-offline
index a6e2a99..ae2ec19 100755
--- a/bin/pacman-offline
+++ b/bin/pacman-offline
@@ -36,9 +36,9 @@ while getopts 'cfhprty' opt; do
done
if [ "${UID}" -ne 0 ]; then
- if command -v run0 >/dev/null; then
+ if command -v pkexec >/dev/null; then
echo 'Missing privileges, trying to elevate.' >&2
- exec run0 "${0}" "${@}"
+ exec pkexec "${0}" "${@}"
fi
echo "You need elevated privileges. Please run as user 'root'!" >&2