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 536371 - Support PreSession and PostSession scripts
Support PreSession and PostSession scripts
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
2.22.x
Other All
: Normal major
: ---
Assigned To: GDM maintainers
GDM maintainers
Depends on:
Blocks:
 
 
Reported: 2008-06-03 06:58 UTC by Brian Cameron
Modified: 2008-07-21 14:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch adding PreSession/PostSession script support (3.75 KB, patch)
2008-06-03 06:59 UTC, Brian Cameron
none Details | Review

Description Brian Cameron 2008-06-03 06:58:46 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.
Comment 1 Brian Cameron 2008-06-03 06:59:25 UTC
Created attachment 112021 [details] [review]
patch adding PreSession/PostSession script support
Comment 2 William Jon McCann 2008-07-21 14:45:15 UTC
Looks like this was fixed in trunk.