uid = dbus_info.GetConnectionUnixUser(sender)
if str(uid) not in ["0", session["user_id"]]:
raise RuntimeError("Cannot start a session on behalf of another user")
+ pid = dbus_info.GetConnectionUnixProcessID(sender)
+ if str(uid) != "0" and str(pid) != session["pid"]:
+ raise RuntimeError("Invalid session pid")
do_start(self.args, session)
@dbus.service.method("id.waydro.ContainerManager", in_signature='b', out_signature='')
tools.helpers.run.user(
args, ["waydroid-sensord", "/dev/" + args.HWBINDER_DRIVER], output="background")
- # Mount rootfs
- cfg = tools.config.load(args)
- helpers.images.mount_rootfs(args, cfg["waydroid"]["images_path"], session)
-
- helpers.protocol.set_aidl_version(args)
-
# Cgroup hacks
if which("start"):
command = ["start", "cgroup-lite"]
if which("stop"):
command = ["stop", "nfcd"]
tools.helpers.run.user(args, command, check=False)
+ elif which("systemctl") and (tools.helpers.run.user(args, ["systemctl", "is-active", "-q", "nfcd"], check=False) == 0):
+ command = ["systemctl", "stop", "nfcd"]
+ tools.helpers.run.user(args, command, check=False)
# Set permissions
set_permissions(args)
helpers.mount.bind(args, session["waydroid_data"],
tools.config.defaults["data"])
+ # Mount rootfs
+ cfg = tools.config.load(args)
+ helpers.images.mount_rootfs(args, cfg["waydroid"]["images_path"], session)
+
+ helpers.protocol.set_aidl_version(args)
+
helpers.lxc.start(args)
services.hardware_manager.start(args)
if which("start"):
command = ["start", "nfcd"]
tools.helpers.run.user(args, command, check=False)
+ elif which("systemctl") and (tools.helpers.run.user(args, ["systemctl", "is-enabled", "-q", "nfcd"], check=False) == 0):
+ command = ["systemctl", "start", "nfcd"]
+ tools.helpers.run.user(args, command, check=False)
# Sensors
if which("waydroid-sensord"):