]> rtime.felk.cvut.cz Git - sojka/lightdm.git/commitdiff
Fix reference count when creating sessions from greeters
authorRobert Ancell <robert.ancell@canonical.com>
Thu, 11 Aug 2016 04:35:32 +0000 (16:35 +1200)
committerRobert Ancell <robert.ancell@canonical.com>
Thu, 11 Aug 2016 04:35:32 +0000 (16:35 +1200)
src/seat.c
tests/Makefile.am
tests/scripts/session-greeter-unlock-twice.conf [new file with mode: 0644]
tests/test-session-greeter-unlock-twice [new file with mode: 0755]

index 6b3fa6d5fa5c19784f8fc178b63c1bab0a41052f..8f1053ea3ff183eda6f15c87d83fc6bcbe8518ed 100644 (file)
@@ -1887,7 +1887,7 @@ seat_real_create_greeter_session (Seat *seat)
 static Session *
 create_session_cb (Greeter *greeter, Seat *seat)
 {
-    return create_session (seat, FALSE);
+    return g_object_ref (create_session (seat, FALSE));
 }
 
 static Greeter *
index 24f102c88200f646489039fea9fc86eefd2ad865..d857007e31a4086e2dd5c2ebbcf46f76748bf643 100644 (file)
@@ -172,6 +172,7 @@ TESTS = \
        test-session-greeter-autologin \
        test-session-greeter-reconnect \
        test-session-greeter-unlock \
+       test-session-greeter-unlock-twice \
        test-vnc-login \
        test-vnc-command \
        test-vnc-dimensions \
@@ -555,6 +556,7 @@ EXTRA_DIST = \
        scripts/session-greeter-autologin.conf \
        scripts/session-greeter-reconnect.conf \
        scripts/session-greeter-unlock.conf \
+       scripts/session-greeter-unlock-twice.conf \        
        scripts/session-stdout.conf \
        scripts/session-stderr.conf \
        scripts/session-stderr-multi-write.conf \
diff --git a/tests/scripts/session-greeter-unlock-twice.conf b/tests/scripts/session-greeter-unlock-twice.conf
new file mode 100644 (file)
index 0000000..fc6d053
--- /dev/null
@@ -0,0 +1,54 @@
+#
+# Check can unlock user with an in-session greeter and re-lock again
+#
+
+[Seat:*]
+autologin-user=have-password1
+user-session=greeter
+
+#?*START-DAEMON
+#?RUNNER DAEMON-START
+
+# X server starts
+#?XSERVER-0 START VT=7 SEAT=seat0
+
+# Daemon connects when X server is ready
+#?*XSERVER-0 INDICATE-READY
+#?XSERVER-0 INDICATE-READY
+#?XSERVER-0 ACCEPT-CONNECT
+
+# Session starts
+#?SESSION-X-0 START XDG_SEAT=seat0 XDG_VTNR=7 XDG_GREETER_DATA_DIR=.*/have-password1 XDG_SESSION_TYPE=x11 XDG_SESSION_DESKTOP=greeter USER=have-password1
+#?LOGIN1 ACTIVATE-SESSION SESSION=c0
+#?XSERVER-0 ACCEPT-CONNECT
+#?SESSION-X-0 CONNECT-XSERVER
+
+# Start greeter inside session
+#?*SESSION-X-0 GREETER-START
+#?SESSION-X-0 GREETER-STARTED
+
+# Log into our account
+#?*SESSION-X-0 GREETER-AUTHENTICATE USERNAME=have-password1
+#?SESSION-X-0 GREETER-SHOW-PROMPT TEXT="Password:"
+#?*SESSION-X-0 GREETER-RESPOND TEXT="password"
+#?SESSION-X-0 GREETER-AUTHENTICATION-COMPLETE USERNAME=have-password1 AUTHENTICATED=TRUE
+#?*SESSION-X-0 GREETER-START-SESSION
+
+# We are reactivated
+#?LOGIN1 ACTIVATE-SESSION SESSION=c0
+
+# Authenticate again
+#?*SESSION-X-0 GREETER-AUTHENTICATE USERNAME=have-password1
+#?SESSION-X-0 GREETER-SHOW-PROMPT TEXT="Password:"
+#?*SESSION-X-0 GREETER-RESPOND TEXT="password"
+#?SESSION-X-0 GREETER-AUTHENTICATION-COMPLETE USERNAME=have-password1 AUTHENTICATED=TRUE
+#?*SESSION-X-0 GREETER-START-SESSION
+
+# We are reactivated
+#?LOGIN1 ACTIVATE-SESSION SESSION=c0
+
+# Cleanup
+#?*STOP-DAEMON
+#?SESSION-X-0 TERMINATE SIGNAL=15
+#?XSERVER-0 TERMINATE SIGNAL=15
+#?RUNNER DAEMON-EXIT STATUS=0
diff --git a/tests/test-session-greeter-unlock-twice b/tests/test-session-greeter-unlock-twice
new file mode 100755 (executable)
index 0000000..3554d0a
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+./src/dbus-env ./src/test-runner session-greeter-unlock-twice test-gobject-greeter