- if session["user_id"] != "0":
- dbus_info = dbus.Interface(conn.get_object("org.freedesktop.DBus", "/org/freedesktop/DBus/Bus", False), "org.freedesktop.DBus")
- uid = dbus_info.GetConnectionUnixUser(sender)
- if str(uid) != session["user_id"]:
- raise RuntimeError("Cannot start a session on behalf of another user")
+ dbus_info = dbus.Interface(conn.get_object("org.freedesktop.DBus", "/org/freedesktop/DBus/Bus", False), "org.freedesktop.DBus")
+ 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")