Re: [dev] [slock] fixing the annoying combination with PAM

From: Petr Sabata <psabata_AT_redhat.com>
Date: Wed, 20 Apr 2011 09:12:19 +0200

On Tue, Apr 19, 2011 at 10:24:38PM +0200, markus schnalke wrote:
> Hoi,
>
> at my university PAM is used for user login. They have slock installed
> because they have the suckless-tools package (Ubuntu) installed.
>
> If I run slock , X gets locked like it should. Unfortunately I'm not
> able to unlock it again because slock checks against /etc/passwd which
> does not contain an entry for my account. This leaves me stuck in an
> dead end. This is annoying.
>
> Of course, I could simply not use slock, but you know how things
> happen from time to time ... your habits take over. ;-) Hence I though
> that slock could check for an passwd entry before it locks. Thus it
> can prevent locking the screen when you won't be able to unlock it
> afterwards.
>
> Here is a patch against current tip which implements this check. I'm
> no expert in this topic, I just hacked it to work for me.
>
>
> meillo
>
>
> diff -r 4d3769ac5d02 slock.c
> --- a/slock.c Thu Nov 26 12:53:26 2009 +0000
> +++ b/slock.c Tue Apr 19 18:50:59 2011 +0200
> @@ -228,6 +228,10 @@
> else if(argc != 1)
> usage();
>
> + if(!getpwuid(getuid()))
> + die("no passwd entry for you");
> +
> #ifndef HAVE_BSD_AUTH
> pws = get_password();
> #endif
>

I wrote this for such situations:
http://lists.suckless.org/dev/1011/6405.html

-- 
Petr 'contyk' Sabata, Red Hat

Received on Wed Apr 20 2011 - 09:12:19 CEST

This archive was generated by hypermail 2.2.0 : Wed Apr 20 2011 - 09:24:02 CEST