Re: [gdm-list] Per-user session scripts for GDM defaults?




Jouko:

It would be reasonable to file an RFE in the "gdm" category at
http://bugzilla.gnome.org/ with this request.  It seems reasonable to
add a hook to these scripts so that sysadmins can specify additional
code to run without needing to modify the scripts shipped as a part of
GDM.

I was hoping to convince a developer to try this themselves,
so they'd push it thorough.

Good luck!  Sometimes just suggesting an improvement or highlighting
a bug is enough to get someone to do the work, but not always.

If nobody gets interested enough, well,
perhaps it is less useful than I believed.

I think your idea is useful.  But, like many people, I am also busy
and am personally focused on other ways to improve GDM at the moment.

It probably does not make sense to integrate Firefox specific code
into the default GDM scripts.

No, obviously not. That's why I only linked to it.

I'm assuming other developers use Linux minilaptops when travelling,
and that little script helps a lot, there. Tryy eeet.
You'll need to make sure you're using a tmpfs at /tmp or
set up one at /ramtmp, yourself; also remember to configure Firefox
to limit its temprary files to a safe small size, few megabytes.

I wanted to see if I could lure a GDM developer to see for themselves
exactly how useful this is, and let them work the red tape.

Really, your suggestion is useful to anyone who wants to customize the
script behavior.  It would be nice to not have to modify the GDM
scripts directly since they can get stomped on update.

However, adding a hook so that
the GDM PostLogin, PreSession, and PostLogin scripts can run a
separate script defined by the sysadmin would make sense.

I was hoping to add hooks for *users* to run those.

I understand.  Really there are two issues:

1) The ability to make it easier for sysadmins to customize the
   scripts by adding a level of indirection.  For exapmle, if GDM also
   ran a script that the sysadmin could provide, then this would allow
   sysadmins to run their own code without having to modify the default
   scripts.

2) The ability to add a hook for users to run user-defined scripts.
   While there are cases that this would be useful, this would need
   to be implemented with proper security in mind.  It would not
   be good to run the user-defined scripts with any inappropriate
   privileges.  Getting this right might be some work.

Note that solution #1 can also provide the solution for #2 since
the sysadmin can add a hook to run scripts in the user's $HOME
directory (including dropping privilege) if desired.

For improved security, one could even redirect stdin/stdout/stderr
and run the scripts in a new session using setsid. That would
completely detach the scripts from gdm.

I wouldn't call this "improved security", I would call it a
"requirement" that any user-defined scripts be run with user privileges.

Perhaps, for
example, /etc/gdm/PreSession/Default could check for the existence of a
script named /etc/gdm/PreSession/Default.system and run it if it is
present.

I'd rather just extend
	daemon/gdm-slave.c: gdm_slave_run_script()
to search and run multiple (matching) files,
in addition to a global one. For example:
	.../always
	.../$DISPLAY
	.../root:$USER
	.../root:$USER$DISPLAY
Personally, I'd also like to have the forked child process drop
privileges and run
	.../users
	.../users$DISPLAY
	.../user:$USER
	.../user:$USER$DISPLAY
as the user themselves, if these files exist,
because the child could detach and drop privileges once,
and then run all four scripts, if they exist.

That sounds like it would be useful.

One issue with running user-defined scripts is to ensure that you
properly manage the situation where the user-defined scripts cause
problems with the login process.  GDM should make reasonable efforts to
recover and report any issues to the user.

For example, what happens if the user-defined script hangs?  If this
causes GDM to hang, this would be a problem.  Opening the door to user
defined script opens a lot of concerns that will need to be thought
about and discussed, I think.

Also, providing a proposed patch for discussion would likely speed the
process.

Here is an example patch to PostSession/Default and PreSession/Default
for gdm-2.28.2 to run per-user session scripts with user privileges
(and not root privileges).

I think there will be a fair bit of discussion and work involved before
this gets accepted upstream.  It is more likely this will get done if
the issue is raised as an RFE in the "gdm" category of
http://bugzilla.gnome.org/.

Bugzilla is much more useful for reviewing code, raising issues, and
discussing a proposed idea than email.

Brian



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]