xflock4 fails to lock, if light-locker (and xscreensaver) is not running, but still exits with 0

Bug #1537507 reported by Jarno Suni
258
This bug affects 1 person
Affects Status Importance Assigned to Milestone
xfce4-session (Ubuntu)
Fix Released
High
Unassigned

Bug Description

xflock4 fails to lock, but still exits with 0, if xscreensaver is not running and light-locker is not running, but is installed. Related to Bug #1536238. Could be fixed by examining the output of "light-locker-command -q" to check, if light-locker is available for locking or by fixing `light-locker-command -l` to exit with nonzero in such case. (Besides, e.g. `i3lock -d -c 000000` or `xtrlock -b` could be used as backup locker in case light-locker fails for some reason.)

ProblemType: Bug
DistroRelease: Ubuntu 15.10
Package: xfce4-session 4.12.1-3ubuntu1
ProcVersionSignature: Ubuntu 4.2.0-25.30-generic 4.2.6
Uname: Linux 4.2.0-25-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.19.1-0ubuntu5
Architecture: amd64
CurrentDesktop: XFCE
Date: Sun Jan 24 17:53:54 2016
EcryptfsInUse: Yes
InstallationDate: Installed on 2015-11-21 (63 days ago)
InstallationMedia: Xubuntu 15.10 "Wily Werewolf" - Release amd64 (20151021)
SourcePackage: xfce4-session
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Jarno Suni (jarnos) wrote :
Revision history for this message
Jarno Suni (jarnos) wrote :

Besides fixing this bug, the patch works around Bug #1536237, and adds support for i3lock and xtrlock.

Revision history for this message
Jarno Suni (jarnos) wrote :

Does this security fix have to work in 12.04? Note that the script does not work there with xtrlock; `xtrlock -b`does not work there, for the option -b is implemented since xtrlock version 2.4 only. I can work this out, though. On the other hand, xlock is not provided after 12.04, propably for a reason, so it might be a good idea to remove the xlock option from the script.

Revision history for this message
Jarno Suni (jarnos) wrote :

Now xtrlock -b should not be a problem even in 12.04. I did not install mate-screensaver or cinnamon-screensaver it, but according to manual pages, mate-screensaver-command and cinnamon-screensaver-command support the same command-line options that are used in the script for light-locker-command and gnome-screensaver-command. (It is easy to remove the support for Mate and Cinnamon.)

Revision history for this message
Jarno Suni (jarnos) wrote :

Note, that the former attachments do not work by 14.04, because the old light-locker-command does not have --query option. See https://bugzilla.xfce.org/show_bug.cgi?id=10217 and espceially attachment http://bug-attachment.xfce.org/attachment.cgi?id=6595, especially comments 41 and 43 for more backwards compatible implementation; see also comment 40, but note that its attachment is not backwards compatible.

information type: Private Security → Public Security
information type: Public Security → Private Security
information type: Private Security → Public Security
Revision history for this message
Jarno Suni (jarnos) wrote :

This bug is a regression. In 14.04 `light-locker-command -l` works as expected (i.e. returns non-zero, if the daemon is not running).

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "patch against Wily's xflock4" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Jarno Suni (jarnos) wrote :

A remaining attachment contains a fix for Wily:
https://bugs.launchpad.net/ubuntu/+source/xfce4-session/+bug/1537507/+attachment/4558529/+files/xflock4-new

However, I have attached a better version in Xfce Bugzilla; the version that works with older light-locker could be backported to an older release of Xubuntu. Maybe most importantly, it restores DPMS state after using a regular (daemonless) locker, so Xfce4-power-manager's presentation mode is not disturbed (https://bugzilla.xfce.org/show_bug.cgi?id=9574). (That backwards compatible version of xflock4 contains line "set -o xtrace", so it displays debug information. Change it to "set +o xtrace" or delete the line to disable debug information.)

Changed in xfce4-session (Ubuntu):
status: New → Confirmed
Changed in xfce4-session (Ubuntu):
importance: Undecided → High
Revision history for this message
Theo Linkspfeifer (lastonestanding) wrote :

It looks like this was fixed. Tested in 18.04:

xubuntu@xubuntu:~$ which light-locker xscreensaver
/usr/bin/light-locker
/usr/bin/xscreensaver
xubuntu@xubuntu:~$ killall light-locker xscreensaver
light-locker: no process found
xscreensaver: no process found
xubuntu@xubuntu:~$ xflock4
xubuntu@xubuntu:~$ echo $?
1
xubuntu@xubuntu:~$

Changed in xfce4-session (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Jarno Suni (jarnos) wrote :

It still fails to work corrently, if additionally gnome-screensaver is installed, but not running IIRC. Please confirm.

Revision history for this message
Theo Linkspfeifer (lastonestanding) wrote :

Yes, I can confirm that.

xubuntu@xubuntu:~$ killall gnome-screensaver
gnome-screensaver: no process found
xubuntu@xubuntu:~$ gnome-screensaver-command --lock
xubuntu@xubuntu:~$ echo $?
0
xubuntu@xubuntu:~$

The command starts a gnome-screensaver process, but --lock does not seem to work at all (--activate shows the unlock screen without login form).

Revision history for this message
Jarno Suni (jarnos) wrote :

So the fix would be to modify the xflock4 script. I have done such a fix and I have developed the script further; See my attachment (and recent comments) at https://bugzilla.xfce.org/show_bug.cgi?id=10217

Note that later version of xfce4-session puts primary burden of determining which locker to use to new xfce-screensaver.c (but still uses xflock4 as one possible option).

Revision history for this message
Theo Linkspfeifer (lastonestanding) wrote :

How would that fix the broken gnome-screensaver(-command)? I assume that removing it from xflock4 is the only fix.

Revision history for this message
Jarno Suni (jarnos) wrote :

By using --query option like I do in https://bugzilla.xfce.org/attachment.cgi?id=7254 I referred to in previous comment (or in the attachment I uploaded in comment #4 about two and half years ago).

Revision history for this message
Theo Linkspfeifer (lastonestanding) wrote :

Again, why even keep supporting gnome-screensaver if it is deprecated and not working properly anymore..

Revision history for this message
Jarno Suni (jarnos) wrote :

I do not know. It is still in the repos and seems to be supported by the latest xfce4-session in git.

Revision history for this message
Jarno Suni (jarnos) wrote :

Do you know other issues with gnome-screensaver?

Revision history for this message
Theo Linkspfeifer (lastonestanding) wrote :

The only one I know about and encountered is that gnome-screensaver-command --lock exits with 0 after spawning a gnome-screensaver process (bug 1536237) while the screen remains not locked.

Revision history for this message
Jarno Suni (jarnos) wrote :

Oh, in my experience it does not spwan gnome-screensaver anymore in 18.04, but please tell about that in the bug report. It is still unconfirmed bug there.

To post a comment you must log in.
This report contains Public Security information  
Everyone can see this security related information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.