[hackers] [slock] make error message prefix consistent || Markus Teich
commit 9698224090ff2989659717815bfa076d5d436a70
Author: Markus Teich <markus.teich_AT_stusta.mhn.de>
AuthorDate: Wed Sep 7 10:04:06 2016 +0200
Commit: Markus Teich <markus.teich_AT_stusta.mhn.de>
CommitDate: Wed Sep 7 10:04:06 2016 +0200
make error message prefix consistent
diff --git a/slock.c b/slock.c
index 08ada6f..62a9841 100644
--- a/slock.c
+++ b/slock.c
_AT_@ -99,9 +99,9 @@ getpw(void)
errno = 0;
if (!(pw = getpwuid(getuid()))) {
if (errno)
- die("getpwuid: %s\n", strerror(errno));
+ die("slock: getpwuid: %s\n", strerror(errno));
else
- die("cannot retrieve password entry\n");
+ die("slock: cannot retrieve password entry\n");
}
rval = pw->pw_passwd;
_AT_@ -109,7 +109,7 @@ getpw(void)
if (rval[0] == 'x' && rval[1] == '\0') {
struct spwd *sp;
if (!(sp = getspnam(getenv("USER"))))
- die("cannot retrieve shadow entry (make sure to suid or sgid slock)\n");
+ die("slock: cannot retrieve shadow entry (make sure to suid or sgid slock)\n");
rval = sp->sp_pwdp;
}
#endif
_AT_@ -117,7 +117,7 @@ getpw(void)
/* drop privileges */
if (geteuid() == 0 &&
((getegid() != pw->pw_gid && setgid(pw->pw_gid) < 0) || setuid(pw->pw_uid) < 0))
- die("cannot drop privileges\n");
+ die("slock: cannot drop privileges\n");
return rval;
}
#endif
Received on Wed Sep 07 2016 - 10:04:25 CEST
This archive was generated by hypermail 2.3.0
: Wed Sep 07 2016 - 10:12:21 CEST