GNOME Bugzilla – Bug 591383
Need the ability to set automatic/timed login user via a script
Last modified: 2010-07-02 19:09: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.
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 on attachment 142363 [details] [review] patch fixing issue seems fine.
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>