diff options
Diffstat (limited to 'data')
-rw-r--r-- | data/com.canonical.Unity.Greeter.Broadcast.service.in | 1 | ||||
-rw-r--r-- | data/unity-greeter-session-broadcast-session.conf | 28 |
2 files changed, 27 insertions, 2 deletions
diff --git a/data/com.canonical.Unity.Greeter.Broadcast.service.in b/data/com.canonical.Unity.Greeter.Broadcast.service.in index 692c371..9cfe989 100644 --- a/data/com.canonical.Unity.Greeter.Broadcast.service.in +++ b/data/com.canonical.Unity.Greeter.Broadcast.service.in @@ -1,3 +1,4 @@ [D-BUS Service] Name=com.canonical.Unity.Greeter.Broadcast Exec=@pkglibexecdir@/unity-greeter-session-broadcast-service +User=root diff --git a/data/unity-greeter-session-broadcast-session.conf b/data/unity-greeter-session-broadcast-session.conf index 0e92905..db2425c 100644 --- a/data/unity-greeter-session-broadcast-session.conf +++ b/data/unity-greeter-session-broadcast-session.conf @@ -6,6 +6,30 @@ task emits application-start #TODO: Check GSettings Key -start on dbus-system SIGNAL="StartApplication" INTERFACE="com.canonical.Unity.Greeter.Broadcast" SENDER="com.canonical.Unity.Greeter.Broadcast" PATH="/com/canonical/Unity/Greeter/Broadcast" ARG0=${USER} +start on dbus BUS=system SIGNAL="StartApplication" INTERFACE="com.canonical.Unity.Greeter.Broadcast" PATH="/com/canonical/Unity/Greeter/Broadcast" -exec initctl emit application-start APP_ID=${ARG1} +pre-start script + PATH="/bin:/usr/bin:/sbin:/usr/sbin" + + if [ -z $ARG0 ] ; then + stop + exit 1 + fi + if [ $ARG0 != $USER ] ; then + stop + exit 1 + fi + + OWNER=`gdbus call --system --dest org.freedesktop.DBus --object-path / --method org.freedesktop.DBus.GetNameOwner com.canonical.Unity.Greeter.Broadcast | cut -d "'" -f 2` + + if [ -z $OWNER ] ; then + stop + exit 1 + fi + if [ $OWNER != $SENDER ] ; then + stop + exit 1 + fi +end script + +exec /sbin/initctl emit application-start APP_ID=${ARG1} |