From 4a0eeb1f61d35d5cbe9adcbcbf522c0e412bff63 Mon Sep 17 00:00:00 2001 From: lemniskett Date: Thu, 29 Oct 2020 12:33:19 +0700 Subject: [PATCH] Revert "Bring XDG_RUNTIME_DIR variable to chroot" This reverts commit 0e7434a12aaa2f4e1fe4bf2aabfd020c79384547. --- archbox.bash | 9 ++++----- archboxcommand.bash | 6 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/archbox.bash b/archbox.bash index 3b885e4..0f431d6 100755 --- a/archbox.bash +++ b/archbox.bash @@ -14,9 +14,8 @@ asroot(){ [[ $EUID -ne 0 ]] && err "Run this as root!" } -storeenv(){ - echo "DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS" > /tmp/env_archbox - echo "XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR" >> /tmp/env_archbox +storedbus(){ + echo $DBUS_SESSION_BUS_ADDRESS > /tmp/archbox_dbus_session_address } help_text(){ @@ -79,7 +78,7 @@ case $1 in chroot $CHROOT /bin/bash -c "sh /chroot_setup" ;; --enter) - storeenv + storedbus copyresolv $PRIV /usr/local/share/archbox/bin/archbox enter ;; @@ -93,7 +92,7 @@ case $1 in err "Unknown option: $1" ;; *) - storeenv + storedbus copyresolv COMMAND=$(echo $@ | tr ' ' '\ ') $PRIV /usr/local/share/archbox/bin/archbox $COMMAND diff --git a/archboxcommand.bash b/archboxcommand.bash index 93ce184..2363aa4 100755 --- a/archboxcommand.bash +++ b/archboxcommand.bash @@ -2,7 +2,7 @@ source /etc/archbox.conf -ENV="$(cat /tmp/env_archbox)" +DBUS_ADDRESS="$(cat /tmp/archbox_dbus_session_address)" COMMAND=$(echo $@ | tr ' ' '\ ') -[[ $1 = "enter" ]] && chroot $CHROOT /sbin/env $ENV /bin/su $USER \ - || chroot $CHROOT /bin/su -c "env $ENV $COMMAND" $USER +[[ $1 = "enter" ]] && chroot $CHROOT /sbin/env DBUS_SESSION_BUS_ADDRESS=$DBUS_ADDRESS /bin/su $USER \ + || chroot $CHROOT /bin/su -c "env DBUS_SESSION_BUS_ADDRESS=$DBUS_ADDRESS $COMMAND" $USER