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

Attachment: pgp5da4dGLUAf.pgp
Description: PGP signature

Reply via email to