Can't lock the screen on 1.2 XFCE

Please reproduce your error on a second machine before posting, and check the error by running without saved changes or extra modules (See FAQ No. 13, "How to report a bug"). For unstable Porteus versions (alpha, beta, rc) please use the relevant thread in our "Development" section.
Kaso_Da_Zmok
White ninja
White ninja
Posts: 10
Joined: 12 Jan 2011, 11:47
Location: Ireland

Can't lock the screen on 1.2 XFCE

Post#1 by Kaso_Da_Zmok » 19 Jul 2012, 19:21

Have tried to lock the screen on 1,2 XFCE as guest or as new user and it goes black as if forced DPMS but is not locked. Screen locking is fine on the KDE version.

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: Can't lock the screen on 1.2 XFCE

Post#2 by Ahau » 19 Jul 2012, 19:33

I had a feeling this would come up, and I think I've mentioned it in older changelogs:

The screenlocking program included with Xfce is 'slock'. Xfce does not have it's own screen locker (just a wrapper to run commonly used third party locking applications) and I had a tough time finding a suitable locking program. I settled on slock which is small and functional, but it takes a little getting used to. When you lock the screen, it will go black; when you move your mouse or press a key to wake up the screen, the monitor turns on but remains black. To unlock it, simply type the password for the current user and press enter. There is no popup that opens to prompt input, you just have to type your password blindly.

To avoid confusion in 2.0, I plan to write a simple message box that will come up the first time the user locks the screen, to let them know that this is the normal behavior, with an option to disable the message from popping up again (via saving something to a module or rootcopy). If anyone knows of a small screen locker that looks halfway decent (most of the ones I tried were horribly ugly or very large with added dependencies), please suggest it, and I'll evaluate it for inclusion.

Thanks!
Please take a look at our online documentation, here. Suggestions are welcome!

Kaso_Da_Zmok
White ninja
White ninja
Posts: 10
Joined: 12 Jan 2011, 11:47
Location: Ireland

Re: Can't lock the screen on 1.2 XFCE

Post#3 by Kaso_Da_Zmok » 19 Jul 2012, 20:16

that is true only if you run slock as root. othwerwise it is not working

Code: Select all

guest@porteus:~$ slock 
slock: cannot retrieve shadow entry (make sure to suid or sgid slock)

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: Can't lock the screen on 1.2 XFCE

Post#4 by Ahau » 23 Jul 2012, 15:00

Oops -- I will look into that. It appears there were some changes (from suid to sgid) in slock, when I bumped it from 0.9 to 1.0; I'll do some testing, find a fix, and push an update. Thanks!

Posted after 9 hours 17 minutes 27 seconds:
Ok, I figured out what happened -- the Makefile for slock runs 'chmod u+s' on slock when you run 'make install'. However, I just ran 'make' and then copied the binary into a package without running 'make install' (the source code only generates one file when you compile it).

The fix for now (for locking the screen as guest) is:

Code: Select all

su
(enter root password)
chmod u+s /usr/bin/slock
exit
And then guest can run slock.

This sets the suid sticky bit. I was hoping to be able to use guid but it doesn't appear to work. I'll compare the source code to the patch I found online (submitted by a debian dev to allow guid) and see if I can get that working, and I'll see about a gui warning screen as well.

Posted after 3 days 8 hours 10 minutes 3 seconds:
OK, I've prepared a fix. I wrote a slackbuild for slock which runs 'make install', so suid is now set at package build-time (still unable to get this working with guid). I also wrote a script with a gtkdialog warning screen, which will popup when a user locks the screen with slock. That dialog has a checkbox for 'do not show this message again', which generates a file at ~/.slock_no_warn, so the warning screen can be easily disabled. If the user is not saving changes, they will be asked if they want to generate a module, which will place ~/.slock_no_warn for ALL users on the system (root authentication required).

To put this in effect, I have moved /usr/bin/slock to /usr/bin/slock-binary, then set /usr/bin/slock as a symlink to /opt/porteus-scripts/xfce/start-slock, which is where the gtkdialog is started, and then 'slock-binary' is called at the end. I also commented out the line in xflock4 that turns of dpms, as I'm forcing it off inside 'start-slock' instead.

Download the fix here:
32-bit: http://porteus-xfce.googlecode.com/file ... 120723.xzm
64-bit: http://porteus-xfce.googlecode.com/file ... 120723.xzm

place the module in /porteus/modules, and activate (or reboot). Then lock the screen with 'slock' at the command line, or from the xfce panel (in the menu of the 'user' button on the far right).

I would really appreciate some testing and feedback on this one before I have it added to the updates section on the official repo. This application should work in any desktop.

Note: I thought about putting this warning on a 30 second timer, such that if a user chose to lock their screen after a period of inactivity, and walked away, the warning would pop up, but their screen would still lock after a bit (securing their system); however, I've not added such a feature, as I figure it's better to make sure they see the warning the first time. Otherwise,they are liable to have the screen lock up on them when they go inactive, and be unable to recover their system. I'm curious to know what users think of this.
Please take a look at our online documentation, here. Suggestions are welcome!

don570
Contributor
Contributor
Posts: 99
Joined: 01 Jun 2012, 00:37
Location: Ontario

Re: Can't lock the screen on 1.2 XFCE

Post#5 by don570 » 23 Jul 2012, 23:07

Puppy linux uses Xlock. It has an easy to use interface.
It requires compiling.

http://puppylinuxfaq.org/bundled-softwa ... saver.html

_________________________

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: Can't lock the screen on 1.2 XFCE

Post#6 by Ahau » 24 Jul 2012, 01:55

@don570,

do you know if that is the old xlock, or is it xlockmore? (with xlockmore, the binary file is still called 'xlock').

I have tried xlockmore in the past, and found the interface to be a little plain/ugly, and the same goes for the screensavers (I'd rather have nothing than something that detracts). When I tried it before, I wasn't able to find a way to customize it, other than editing the source code directly. Maybe someone at Puppy has improved it? I'm picky, I know... lol!
Please take a look at our online documentation, here. Suggestions are welcome!

Post Reply