Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.2
accountsservice
as-fate318433-prevent-same-account-multi-logins...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File as-fate318433-prevent-same-account-multi-logins.patch of Package accountsservice
Index: b/src/libaccountsservice/act-user-manager.c =================================================================== --- a/src/libaccountsservice/act-user-manager.c 2019-09-11 17:40:53.726949739 +0800 +++ b/src/libaccountsservice/act-user-manager.c 2019-09-11 17:41:00.547007450 +0800 @@ -1752,12 +1752,22 @@ maybe_add_new_session (ActUserManagerNew if (new_session->x11_display == NULL) { g_debug ("AcUserManager: (mostly) ignoring session '%s' since it's not graphical", new_session->id); - is_ours = FALSE; + /* SLE: ignore non-graphical session completely */ + /* see `act_user_is_logged_in_anywhere` */ + unload_new_session (new_session); + return; } else if (session_is_login_window (manager, new_session->id)) { new_session->state = ACT_USER_MANAGER_NEW_SESSION_STATE_LOADED; unload_new_session (new_session); return; } else if (!session_is_on_our_seat (manager, new_session->id)) { + /** + * NOTE: if `manager->priv->seat.id` or `new_session->id` is + * either NULL, it's not on our seat: this is reasonable, as + * non-seat session is not switchable and thus no need to be + * ours. However, this nondiscrimination for all non-seated + * sessions is possibly a source for bugs. + */ is_ours = FALSE; } Index: b/src/libaccountsservice/act-user.c =================================================================== --- a/src/libaccountsservice/act-user.c 2019-09-11 17:40:53.726949739 +0800 +++ b/src/libaccountsservice/act-user.c 2019-09-11 17:41:00.547007450 +0800 @@ -868,6 +868,8 @@ act_user_is_logged_in (ActUser *user) * (Currently, this function is only implemented for systemd-logind. * For ConsoleKit, it is equivalent to act_user_is_logged_in.) * + * (SLE-12 SP2: 'other_sessions' have been modified to contain only X sessions) + * * Returns: %TRUE or %FALSE */ gboolean @@ -896,6 +898,24 @@ act_user_get_saved (ActUser *user) } /** + * act_user_is_x_logged_in_remotely: + * @user: a #ActUser + * + * Returns whether or not #ActUser is currently graphically logged in on a + * different seat or no seat. + * + * (For SLE12-SP2: fate#318433) + * + * Returns: %TRUE or %FALSE + */ +gboolean +act_user_is_x_logged_in_remotely (ActUser *user) +{ + /* return user->remote_x_sessions; */ + return (user->other_sessions != NULL); +} + +/** * act_user_get_locked: * @user: a #ActUser * Index: b/src/libaccountsservice/act-user.h =================================================================== --- a/src/libaccountsservice/act-user.h 2019-09-11 17:40:53.726949739 +0800 +++ b/src/libaccountsservice/act-user.h 2019-09-11 17:41:00.547007450 +0800 @@ -67,6 +67,7 @@ guint act_user_get_num_sessions guint act_user_get_num_sessions_anywhere (ActUser *user); gboolean act_user_is_logged_in (ActUser *user); gboolean act_user_is_logged_in_anywhere (ActUser *user); +gboolean act_user_is_x_logged_in_remotely (ActUser *user); int act_user_get_login_frequency (ActUser *user); gint64 act_user_get_login_time (ActUser *user); const GVariant*act_user_get_login_history (ActUser *user);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor