GNOME Bugzilla – Bug 536371
Support PreSession and PostSession scripts
Last modified: 2008-07-21 14:45:15 UTC
The attached patch fixes GDM so that it again supports the PreSession, PostSession, and PostLogin scripts. It works similarly to GDM 2.20 in the sense that the PreSession and PostSession scripts are run with the environment of the user logging in. I fixed a bug in the gdm_slave_run_script function so that we don't try to build the script based on the "display_hostname" if slave->priv->display_hostname[0] is NULL. Fixing this bug, the calls to gdm_slave_run_script change as follows: - gdm_slave_run_script (GDM_SLAVE (slave), GDMCONFDIR "/Init/Default", "gdm"); + gdm_slave_run_script (GDM_SLAVE (slave), GDMCONFDIR "/Init", "gdm"); Note it isn't good to specify the "/Default" since this is normally added by the gdm_slave_run_script function if it doesn't find a per-display script. ---- I made a minor change to the way PostLogin works. In the old GDM 2.20 code the only difference between PostLogin and PreSession is that PostLogin happens before GDM tickles the $HOME/.dmrc file, $HOME/.Xauth, and $HOME/.xsession-errors files. This doesn't seem particularly useful. In fact it might be okay to just drop support for PostLogin in GDM 2.22.0. However, in talking with the PAM team at Sun, they suggested it might be more useful if it were run after session is accredited but before PAM open session. This way you have a hook so that if there is a failure you can abort without session accounting happening. This could be useful, for example, if you want to use gdmlogin as a lock screen dialog and you don't plan on actually starting a session. So, I made the PostLogin integration work this way in the attached patch for consideration.
Created attachment 112021 [details] [review] patch adding PreSession/PostSession script support
Looks like this was fixed in trunk.