Block switching to same user as an user occupying current seat 59/41259/7
authorYoumin Ha <youmin.ha@samsung.com>
Wed, 13 May 2015 06:54:51 +0000 (15:54 +0900)
committerYoumin Ha <youmin.ha@samsung.com>
Mon, 12 Oct 2015 03:02:31 +0000 (12:02 +0900)
commit9e8e982fb23d1a72cca9942227df519b7d125335
treeace2475c705e3f53b3407ab7502e284b21cd1e23
parenta87f22b90ae3abb0b2c352e918f90089e7181b4b
Block switching to same user as an user occupying current seat

Switching to same user as the current user raises a abnormal behavior,
failing on re-login process. This is due to the inconsistance between
the tlm-sessiond daemon lifecycle and the systemd-logind's logout
procedure.
The standard solution is to receive a sessionTerminated signal from the
systemd-logind and sync it to the re-login procedure of TLM, but it
will take many structure changes of tlm-sessiond.
This patch just blocks switching to same user, preventing the abnormal
case with just a small effort.

 * src/daemon/tlm-seat.c|h: tlm_seat_get_occupying_username() is added.
 * src/daemon/tlm-dbus-observer.c: _is_valid_switch_user_dbus_request()
   is added and used in _process_request().

In addition, several comments and debug logs are given.

Change-Id: I9238098771bcce2b40aa89da47e9391ff7556922
configure.ac
src/daemon/dbus/tlm-dbus-login-adapter.c
src/daemon/tlm-dbus-observer.c
src/daemon/tlm-main.c
src/daemon/tlm-manager.c
src/daemon/tlm-seat.c
src/daemon/tlm-seat.h
src/daemon/tlm-session-remote.c
src/utils/tlm-client.c