Files
DroidDeck/tools/linuxfs/overlay/usr/local/bin/droiddeck-user
T
Kurt Himebauch 186bae8f3e feat(native): run the desktop, its apps and shells as an ordinary user instead of fake root (#3587)
* feat(native): run the desktop, its apps and shells as an ordinary user instead of fake root

* fix(native): a script's interpreter takes DDNATV_BECOME, so sudo runs scripts as root

* fix(desktop): keep the Plasma start line the pipewire tests slice the script at
2026-12-02 13:50:06 -05:00

16 lines
723 B
Bash
Executable File

#!/bin/sh
# Runs COMMAND, or a shell, as an ordinary user ("deck", the app's own Android user) instead of
# root, for programs that refuse root or check who owns their files. Everything started from it
# stays that user; sudo and su still give root, and exit goes back.
case ${1:-} in
-h|--help) echo "usage: droiddeck-user [COMMAND [ARG...]]"; exit 0 ;;
esac
if [ -z "${DDNATV_ROOT:-}" ]; then
echo "droiddeck-user: needs the native userland (Settings > Performance > Run without proot)" >&2
exit 1
fi
export DDNATV_BECOME=app USER=deck LOGNAME=deck
[ $# -gt 0 ] && exec "$@"
[ -t 2 ] && echo "Programs here run as an ordinary user (deck), not root. sudo still works; exit goes back." >&2
exec "${SHELL:-/bin/bash}"