summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorINSUN PYO <insun.pyo@ubuntu1604.playinsun.pe.kr>2017-02-17 11:19:31 +0900
committerINSUN PYO <insun.pyo@samsung.com>2017-02-16 18:52:09 -0800
commit19f1b4fa995b577b6810b28e251b062fcafd28d5 (patch)
tree90af04e6bd9a60b85da7029acac4df3be7fb792f
parent9f35da3aea7e5a30be531b5a858a4fa94707fcee (diff)
downloaddbus-19f1b4fa995b577b6810b28e251b062fcafd28d5.tar.gz
dbus-19f1b4fa995b577b6810b28e251b062fcafd28d5.tar.bz2
dbus-19f1b4fa995b577b6810b28e251b062fcafd28d5.zip
Change the method to get DBUS addres when changing user with "su -" command.
The adbd's privilege has been changed form "System::Privileged" to "User::Shell". So, pgrep does not work with smack errors when accessing /proc. If it fails to find DBUS address, the fixed address is used. Signed-off-by: INSUN PYO <insun.pyo@ubuntu1604.playinsun.pe.kr> Change-Id: I4f9e0bc0939de2ecd7b866df8a2f266b4258338b (cherry picked from commit 4f11f164f44d78ec6a54892e5d4095ca52e7117d)
-rw-r--r--packaging/dbus.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/packaging/dbus.sh b/packaging/dbus.sh
index d9b0a5db..def85861 100644
--- a/packaging/dbus.sh
+++ b/packaging/dbus.sh
@@ -10,3 +10,12 @@ if [[ -z "$DBUS_SESSION_BUS_ADDRESS" ]]; then
fi
fi
+
+# The adbd's privilege has been changed form "System::Privileged" to "User::Shell".
+# So, pgrep does not work with smack errors when accessing /proc.
+# If it fails to find DBUS address, the fixed address is used.
+
+if [[ -z "$DBUS_SESSION_BUS_ADDRESS" ]]; then
+ [[ "$UID" != "0" ]] && export DBUS_SESSION_BUS_ADDRESS="kernel:path=/sys/fs/kdbus/${UID}-user/bus;unix:path=/run/user/${UID}/dbus/user_bus_socket"
+fi
+