After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 591383 - Need the ability to set automatic/timed login user via a script
Need the ability to set automatic/timed login user via a script
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
2.27.x
Other All
: Normal normal
: ---
Assigned To: Brian Cameron
GDM maintainers
Depends on:
Blocks:
 
 
Reported: 2009-08-10 22:27 UTC by Brian Cameron
Modified: 2010-07-02 19:09 UTC
See Also:
GNOME target: ---
GNOME version: 2.27/2.28


Attachments
patch fixing issue (7.33 KB, patch)
2009-09-02 22:42 UTC, Brian Cameron
committed Details | Review

Description Brian Cameron 2009-08-10 22:27:37 UTC
GDM 2.20 and earlier had the feature that you could set the automatic or timed login user to a script by specifying "|scriptname".  The script would return the username to be used.  If an invalid user is specified, then this is the same as automatic/timed login not being on for the session.

This is useful in multi-display kiosk modes, for example, where you may want all the displays to automatically log into different displays based on the $DISPLAY value.  Therefore, it is important to ensure the script has access to the normal environment variables, such as DISPLAY.

It would be useful to add this feature back, especially as multi-seat support is being added to ConsoleKit/GDM.
Comment 1 Brian Cameron 2009-09-02 22:42:42 UTC
Created attachment 142363 [details] [review]
patch fixing issue


This patch modifies the code so that you can use the same syntax as the old GDM, of specifying a script followed by the "|" symbol, such as 
"/usr/bin/autologinuser|" and it will run the script and use whatever username is returned from the script.  The script is passed $DISPLAY so that it can determine the username per-display if desired.

If the script returns an invalid username (or if an invalid username is specified 
as a static user) the automatic/timed login is not considered enabled for that 
session, so normal login just works in this case.
Comment 2 Ray Strode [halfline] 2009-09-09 18:29:39 UTC
Comment on attachment 142363 [details] [review]
patch fixing issue

seems fine.
Comment 3 Brian Cameron 2009-09-10 00:38:25 UTC
Thanks, committed to master.  I also added some docs in the docs/C/gdm.xml file 
to explain this:

              <para>
                If the value ends with a vertical bar | (the pipe symbol),
                then GDM will execute the program specified and use whatever
                value is returned on standard out from the program as the user.
                The program is run with the DISPLAY environment variable set so
                that it is possible to specify the user in a per-display
                fashion.  For example if the value is "/usr/bin/getloginuser|",
                then the program "/usr/bin/getloginuser" will be run to get the
                user value.
              </para>