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 573495 - logout_command setting may be overwritten with keyboard_command value
logout_command setting may be overwritten with keyboard_command value
Status: RESOLVED FIXED
Product: gnome-screensaver
Classification: Deprecated
Component: daemon
2.24.x
Other All
: Normal normal
: ---
Assigned To: gnome-screensaver maintainers
gnome-screensaver maintainers
Depends on:
Blocks:
 
 
Reported: 2009-02-28 00:01 UTC by Robert Basch
Modified: 2009-05-01 23:28 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
Fix overwriting of logout_command value with the keyboard_command value (450 bytes, patch)
2009-02-28 00:03 UTC, Robert Basch
committed Details | Review

Description Robert Basch 2009-02-28 00:01:32 UTC
Please describe the problem:
The gnome-screensaver daemon's internal setting for the logout_command value is sometimes overwritten with the value for keyboard_command (from the gconf key embedded_keyboard_command), thus breaking the logout button in the unlock dialog.


Steps to reproduce:
1. Enable logout (e.g. /apps/gnome-screensaver/logout_enabled = true, /apps/gnome-screensaver/logout_command = /usr/bin/gnome-session-save --kill --silent, /apps/gnome-screensaver/logout_delay = 1) and locking (/apps/gnome-screensaver/lock_enabled = true, /apps/gnome-screensaver/lock_delay = 1)
2. Lock the screen (e.g. gnome-screensaver-command -l), wait for the logout delay interval to elapse
3. Click the Logout button when it appears in the unlock dialog.


Actual results:
On some occasions, nothing; more specifically, on these occasions, it will try to execute what has been set as the embedded_keyboard_command instead of the logout_command.  If the embedded_keyboard_command value is unset, nothing happens.

Expected results:
The command specified in logout_command should be executed.

Does this happen every time?
No

Other information:
This seems to be caused by a copy-and-paste error in gs-manager.c, which causes the logout_command value to be overwritten internally with the value of embedded_keyboard_command, when it is trying to update the internal value for the latter.  (I am not exactly sure when this update happens).  I will attach a patch which should fix the problem.

Also, I noticed that at least in some places where the code is checking whether a command value is set, it only checks for a NULL string, not an empty string, though it seems that an empty string is actually retrieved from the gconf setting.  Thus when this bug is triggered, and embedded_keyboard_command is unset, you will see that gnome-screensaver-dialog is invoked with arguments "... --enable-logout --logout-command= ...", i.e. with the logout command set to an empty string.  The patch I am attaching does not address this problem.
Comment 1 Robert Basch 2009-02-28 00:03:13 UTC
Created attachment 129697 [details] [review]
Fix overwriting of logout_command value with the keyboard_command value

Attaching the patch.
Comment 2 William Jon McCann 2009-04-14 01:40:49 UTC
Nice catch.  Fixed the copy/paste bug in stable.  Thanks!  Yes would be best to also check for empty strings too.  Do you have a patch for that also?
Comment 3 Robert Basch 2009-05-01 23:28:24 UTC
No, sorry, I do not have a patch for the empty strings problem, and am not sure when I might have time to do so.