You are not logged in.

#1 2017-05-07 18:24:38

mh00h
Member
Registered: 2017-05-07
Posts: 5

LightDM Recurring Lock Screen

I'm running i3 and having a weird issue where I am required to type my password in several times in order to unlock the screen. The amount of times my password is required is commiserate with the amount of time the laptop has been ide. Overnight, dmlock will have so many instances that I can't type my password in enough times to get the screen to unlock and it's easier to restart! Any ideas on where I could start looking for this bug?

Systemd triggers a script to lock things at boot, and xautolock handles things when idle.

➜  system cat dmToolLock.service 
[Unit]
Description=User suspend actions
Before=sleep.target

[Service]
User=$USER (redacted)
Type=forking
Environment=DISPLAY=:0
Environment=XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
ExecStart=/home/$USER/scripts/lockScreen.sh

[Install]
WantedBy=sleep.target

➜  system cat ~/scripts/lockScreen.sh 
#!/bin/bash
export DISPLAY=:0
export XAUTHORITY=cat /home/$USER/.Xauthority
dm-tool lock
sleep 1

Offline

#2 2017-05-07 18:49:32

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: LightDM Recurring Lock Screen

EDIT: I completely misunderstood what this dm-tool lock does. I thought it's like i3lock and is a screensaver.

This was my original post, but it's wrong and shouldn't work:

What's the process name of this dm-lock tool? You could put something like this at the beginning of your lockScreen.sh:

if pgrep -x dm-lock &> /dev/null; then
    exit
fi

That pgrep tool is in a package procps-ng.

Last edited by Ropid (2017-05-07 19:04:59)

Offline

#3 2017-05-07 19:55:07

mh00h
Member
Registered: 2017-05-07
Posts: 5

Re: LightDM Recurring Lock Screen

Thanks Ropid. If anyone thinks this is a bug in light dm I can file one but wanted to make sure I'm not missing something first.

Offline

#4 2017-05-17 17:58:24

ImbaLocus
Member
Registered: 2012-05-09
Posts: 22

Re: LightDM Recurring Lock Screen

I have a similar issue using "dm-tool lock" together with xautolock.
In my case I start xautolock with a corner option to trigger dm-tool after x seconds.
If I put the mouse at the corner dm-tool runs and screen is locked - but, it retriggers again after x seconds indefinitely which leads to me having to type in my password as many times as it was triggered.
Even if mouse pointer is moved when inside the locker it's returned to original position when screen is unlocked - not sure how lightdm works in regards to mouse pointer but could it be possible the actual mouse position stays the same somehow and making xautolock retrigger while lightdm shows some emulated pointer?

In any case - perhaps lightdm should check if screen already is locked and not run/lock if so.

Offline

#5 2017-05-17 18:06:43

mh00h
Member
Registered: 2017-05-07
Posts: 5

Re: LightDM Recurring Lock Screen

Thanks for the confirmation. I've filed a bug here- https://bugs.launchpad.net/lightdm/+bug/1691337

Offline

#6 2017-05-19 21:22:21

ImbaLocus
Member
Registered: 2012-05-09
Posts: 22

Re: LightDM Recurring Lock Screen

Great initiative with reporting.

I've noticed now that it happens not only as I've described above, when activating using corners/the mouse, but also with regular xautolock timeouts. As in your case the number of times I have to type in my password correlates to how much time has passed - i.e. how many times xautolock timeout has triggered. It's as if xautolock can't detect that the locker is running and launches it again.

Seems we both use xautolock and surely this is a quite common use case? xautolock + dm-tool? Could it be tinkered with using xautolock somehow?

Last edited by ImbaLocus (2017-05-19 21:26:14)

Offline

#7 2017-05-19 21:50:44

seth
Member
Registered: 2012-09-03
Posts: 49,614

Re: LightDM Recurring Lock Screen

xautolock doesn't "detect that the locker is running" because, despite the name, it doesn't actually deal with lockers.
The problem is that your locker process is just a very brief call to dm-tool which returns immediately. At this point xautolock is armed and watching again.
You could "xautolock -disable" in ~/scripts/lockScreen.sh, but don't ask me how to know when to "xautolock -enable" it again ...

Offline

#8 2017-05-19 22:29:42

mh00h
Member
Registered: 2017-05-07
Posts: 5

Re: LightDM Recurring Lock Screen

I'm going to update wiki pages. It doesn't look like this is a good way to lock a user session. Googling, I also discovered a long standing bug where Ctrl-Alt-F7 allows someone to bypass light-dm's lock screen. The internet is replete with bug filings on the subject spanning several years, but I don't see many solutions. This new issue affects my i3 installation even today, years after discovery of this problem. I strongly caution that users avoid use of this command. There are many other screen lockers to choose from, and while not integrated as tightly, they appear more secure to me.

According to here, https://bugs.launchpad.net/ubuntu/+sour … ug/1205384, light locker is a viable alternative, but it hasn't seen a code update in a few years.

To recap, we're looking at two bugs: The F7 bypass method, and the multiple lock screen issue.

Can you check if using light locker fixes both the F7 and multiple lock screen bug?

Offline

#9 2017-05-19 22:41:20

mh00h
Member
Registered: 2017-05-07
Posts: 5

Re: LightDM Recurring Lock Screen

I would also like to add that the F7 problem is also exhibited when using '' dm-tool switch-to-greeter'' instead of ''dm-tool lock''. Both are unsafe.

Offline

#10 2017-05-20 06:15:46

seth
Member
Registered: 2012-09-03
Posts: 49,614

Re: LightDM Recurring Lock Screen

Afaiu the bug report, "dm-too lock" isn't supposed to protect your session but just switches to the greeter (on apparently a different VT ?)
Personally, I'd look into i3lock (notably since you're using i3wm ;-) or slock for lightweight X11 screenlockers (if light-locker turns out to be useless)
Otherwise there's always xscreensaver (which one needs to install anyway, just to steer at the matrix)

And just ftr: xdm looks crap by default, but that's not unfixable. See https://www.archlinux.org/packages/comm … archlinux/ as at least a pattern on how to "fix" its 1989 appearance smile

Offline

Board footer

Powered by FluxBB