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 311497 - add gnome-screensaver support
add gnome-screensaver support
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
2.8.x
Other Linux
: High enhancement
: ---
Assigned To: GDM maintainers
GDM maintainers
Depends on:
Blocks: 302344
 
 
Reported: 2005-07-25 15:13 UTC by William Jon McCann
Modified: 2005-09-28 17:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (8.87 KB, patch)
2005-07-25 15:20 UTC, William Jon McCann
needs-work Details | Review
updated patch (4.79 KB, patch)
2005-09-27 19:30 UTC, William Jon McCann
committed Details | Review

Description William Jon McCann 2005-07-25 15:13:50 UTC
Here is a patch that adds gnome-screensaver support to GDM.
Comment 1 William Jon McCann 2005-07-25 15:20:05 UTC
Created attachment 49724 [details] [review]
patch

Look ok?
Comment 2 Brian Cameron 2005-07-25 19:49:49 UTC
I think this patch needs work.

1) It isn't cool for a GDM program to launch xserver using PATH.  For security
   reasons (to avoid trojans), the full PATH the the screensaver should be
   specified, perhaps in the config file instead of depending on the PATH. 

2) The code shouldn't have hardcoded logic to choose one
   screensaver over the other.  Instead, it should be specified in the 
   gdm.conf file, and should be specified with full-pathname to avoid 
   trojan attacks. 

3) The configure script should check to see which screensavers are installed 
   and can make gnome-screensaver the default in gdm.conf if it is present.  
   It would also be nice to have a configure option to specify the full path 
   of the screensaver to use (and thus avoid the checking).  This is useful
   if a person has the screensaver installed to a non-default location
   that the configure script wouldn't know about.

 
Comment 3 William Jon McCann 2005-07-26 16:46:37 UTC
1. OK, I can make it use the full path.  Note that the way it is now relies on
PATH too.

2. What other screensaver programs are you hoping to support?  This is exactly
the same logic that gnome-panel and gnome-session use to detect the screensaver. 

3. We can't check for screensavers in configure because that would add a build
time dependency on them.  This would result in a circular dependency.  The
screensaver must be detected at run time.  I don't think adding a dependency in
gdm.conf is the right way to go either for similar reasons.

The screensaver should be able to be switched out without rebuilding gdm or
changing the gdm configuration.  In other words, it should be detected at run
time.  I don't see any problem "hard coding" a list of known screensavers that
can be detected.  Honestly, there are really only two.


The right way in the longer term will be to develop a common Dbus interface to
the screensaver.  So, any screensaver that is registered for the
"org.gnome.screensaver" service can implement a setActive(bool active) method.

In fact, gnome-screensaver-command is already just a wrapper around this Dbus
interface.

What do you think?
Comment 4 Brian Cameron 2005-07-26 17:22:46 UTC
Yes, I realize that the current code depends on PATH.  That isn't a good idea,
though, for security reasons, and should be fixed.

GDM shouldn't use the same logic as gnome-panel and gnome-session since GDM
is also used by people who don't use GNOME, such as KDE.

I'm agreeable to checking for screensavers at runtime.  What I recommend doing
is setting up a gdm.conf configuration variable where you can list the
screensavers, separated by a "," character.  Then at runtime, we loop through
them and try them one at a time.  This way the sysadmin can control which
screensaver's are used.  We can set the default value to try gnome-screensaver
first, then xscreensaver.  Users who are using KDE, or their own screensaver,
might want to customize this list.  This might be easier than a Dbus interface.

The default list of screensaver's should be full-path for security reasons.  
It might be nice to add a configure option so the user can specify this list at
configure time, rather than having to customize the gdm.conf by hand after it is
built, or patching it.
Comment 5 Brian Cameron 2005-09-27 02:39:50 UTC
After discussion, it seemed to make the most sense for GDM to work like other
GNOME programs, so the same code for launching gnome-screensaver used in other
GNOME programs is now used in GDM.
Comment 6 William Jon McCann 2005-09-27 19:15:20 UTC
I think this version is a little bit better than Rodrigo's patch since it
doesn't use deprecated functions or duplicate code.  I'll update it for HEAD.
Comment 7 William Jon McCann 2005-09-27 19:30:46 UTC
Created attachment 52742 [details] [review]
updated patch
Comment 8 Brian Cameron 2005-09-27 22:12:37 UTC
Okay, please update it in CVS head.  Actually if you want you can put this 
patch in the 2.12 branch since I plan to do a 2.8.0.5 release sometime soon
and it would probably be nice to have this available sooner than 2.14.
Though if you do provide this patch in the 2.12 branch please change the 
g_warning message strings so that they are the same as they are in the old code
since the l10n people won't want to update the strings for this branch.
Comment 9 William Jon McCann 2005-09-28 17:25:11 UTC
OK, thanks.  Committed to head and gnome-2-12.