Bug 65160 - Non-graphical sessions should not be ignored.
Summary: Non-graphical sessions should not be ignored.
Status: RESOLVED FIXED
Alias: None
Product: accountsservice
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Matthias Clasen
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-30 07:35 UTC by Marius Vollmer
Modified: 2013-06-18 14:44 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Don't ignore non-graphical sessions. (3.01 KB, patch)
2013-05-30 07:35 UTC, Marius Vollmer
Details | Splinter Review
Don't completely ignore non-graphical sessions. (14.82 KB, patch)
2013-05-30 10:14 UTC, Marius Vollmer
Details | Splinter Review
Document current limitations of act_user_*_anywhere. (1.22 KB, patch)
2013-06-11 12:48 UTC, Marius Vollmer
Details | Splinter Review
Add missing prototypes for act_user_*_anywhere. (1.20 KB, patch)
2013-06-13 13:07 UTC, Marius Vollmer
Details | Splinter Review

Description Marius Vollmer 2013-05-30 07:35:15 UTC
Created attachment 80016 [details] [review]
Don't ignore non-graphical sessions.

I'd say that act_user_is_logged_in should return TRUE also when the user is logged in on a text terminal or via ssh.  Those are logins, too! :)

If necessary, we can also add a act_user_is_logged_in_graphically function for clients that really want to know this.

If this change in API is not acceptable, what about adding a act_user_is_logged_in_non_graphically function and clearly documenting that act_user_is_logged_in only considers graphical logins?

The attached patch only bothers about the systemd code path.  I can't easily test ConsoleKit, unfortunately.

(What is x11_display used for anyway?  Only to determine whether a session is graphical?  It looks like we can remove it completely after this patch, no?)
Comment 1 Marius Vollmer 2013-05-30 08:07:56 UTC
I just realized that this probably breaks act_user_get_primary_session.

Hmm, right now I think that act_user_is_logged_in means "graphically logged in on the same seat as us", and that act_user_get_primary_session should return one of the graphical sessions of the user on the same seat as us.  This is to let the display manager switch users on its seat.

I'll update the patch to reflect this.
Comment 2 Marius Vollmer 2013-05-30 10:14:13 UTC
Created attachment 80026 [details] [review]
Don't completely ignore non-graphical sessions.

Updated patch that keeps the semantics of act_user_is_logged_in et al.
Comment 3 Marius Vollmer 2013-06-11 12:48:13 UTC
Created attachment 80686 [details] [review]
Document current limitations of act_user_*_anywhere.

Hmm, this only works with systemd-logind, not with ConsoleKit.  I can't test with ConsoleKit, so here is a followup patch that at least documents this.

I can't see anything that would make this hard to implement for ConsoleKit.  I can give it a stab but I can't take it much further than "it compiles".
Comment 4 Matthias Clasen 2013-06-11 13:27:09 UTC
(In reply to comment #3)
> Created attachment 80686 [details] [review] [review]
> Document current limitations of act_user_*_anywhere.
> 
> Hmm, this only works with systemd-logind, not with ConsoleKit.  I can't test
> with ConsoleKit, so here is a followup patch that at least documents this.
> 
> I can't see anything that would make this hard to implement for ConsoleKit. 
> I can give it a stab but I can't take it much further than "it compiles".

Sure, lets document the limitation. I don't think you need to provide an implementation. If somebody shows up with a patch, ok.
Comment 5 Marius Vollmer 2013-06-13 13:02:26 UTC
(In reply to comment #3)
> Created attachment 80686 [details] [review] [review]
> Document current limitations of act_user_*_anywhere.

This is in master, but I have one more patch for this.  Forgot the prototypes... sorry for being so sloppy.
Comment 6 Marius Vollmer 2013-06-13 13:07:04 UTC
Created attachment 80771 [details] [review]
Add missing prototypes for act_user_*_anywhere.
Comment 7 Ray Strode [halfline] 2013-06-18 14:44:40 UTC
Attachment 80686 [details] pushed as aa4d93d - Document current limitations of act_user_*_anywhere.
Attachment 80771 [details] pushed as bfcf510 - Add missing prototypes for act_user_*_anywhere.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.