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)
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
+