Introduction
Introduction Statistics Contact Development Disclaimer Help
applied Michaels patch - slock - simple X display locker utility
git clone git://git.suckless.org/slock
Log
Files
Refs
README
LICENSE
---
commit f013cb264e654125c043ed637b7f47692376f967
parent 5a5c581285e86fe53c9602c7e0fb7e19ec742391
Author: [email protected] <unknown>
Date: Tue, 24 Jan 2012 22:10:02 +0100
applied Michaels patch
Diffstat:
M slock.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/slock.c b/slock.c
@@ -50,9 +50,9 @@ getpw(void) { /* only run as root */
const char *rval;
struct passwd *pw;
- if(geteuid() != 0)
- die("cannot retrieve password entry (make sure to suid slock)"…
pw = getpwuid(getuid());
+ if(!pw)
+ die("cannot retrieve password entry (make sure to suid or sgid…
endpwent();
rval = pw->pw_passwd;
@@ -60,6 +60,8 @@ getpw(void) { /* only run as root */
{
struct spwd *sp;
sp = getspnam(getenv("USER"));
+ if(!sp)
+ die("slock: cannot retrieve shadow entry (make sure to…
endspent();
rval = sp->sp_pwdp;
}
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.