diff options
-rw-r--r-- | slock.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -99,9 +99,9 @@ getpw(void) | |||
99 | errno = 0; | 99 | errno = 0; |
100 | if (!(pw = getpwuid(getuid()))) { | 100 | if (!(pw = getpwuid(getuid()))) { |
101 | if (errno) | 101 | if (errno) |
102 | die("getpwuid: %s\n", strerror(errno)); | 102 | die("slock: getpwuid: %s\n", strerror(errno)); |
103 | else | 103 | else |
104 | die("cannot retrieve password entry\n"); | 104 | die("slock: cannot retrieve password entry\n"); |
105 | } | 105 | } |
106 | rval = pw->pw_passwd; | 106 | rval = pw->pw_passwd; |
107 | 107 | ||
@@ -109,7 +109,7 @@ getpw(void) | |||
109 | if (rval[0] == 'x' && rval[1] == '\0') { | 109 | if (rval[0] == 'x' && rval[1] == '\0') { |
110 | struct spwd *sp; | 110 | struct spwd *sp; |
111 | if (!(sp = getspnam(getenv("USER")))) | 111 | if (!(sp = getspnam(getenv("USER")))) |
112 | die("cannot retrieve shadow entry (make sure to suid or sgid slock)\n"); | 112 | die("slock: cannot retrieve shadow entry (make sure to suid or sgid slock)\n"); |
113 | rval = sp->sp_pwdp; | 113 | rval = sp->sp_pwdp; |
114 | } | 114 | } |
115 | #endif | 115 | #endif |
@@ -117,7 +117,7 @@ getpw(void) | |||
117 | /* drop privileges */ | 117 | /* drop privileges */ |
118 | if (geteuid() == 0 && | 118 | if (geteuid() == 0 && |
119 | ((getegid() != pw->pw_gid && setgid(pw->pw_gid) < 0) || setuid(pw->pw_uid) < 0)) | 119 | ((getegid() != pw->pw_gid && setgid(pw->pw_gid) < 0) || setuid(pw->pw_uid) < 0)) |
120 | die("cannot drop privileges\n"); | 120 | die("slock: cannot drop privileges\n"); |
121 | return rval; | 121 | return rval; |
122 | } | 122 | } |
123 | #endif | 123 | #endif |