#include <bsd_auth.h>
#endif
+#include "config.h"
+
typedef struct {
int screen;
Window root, win;
errno = 0;
pw = getpwuid(getuid());
- if (errno)
- die("slock: getpwuid: %s\n", strerror(errno));
- else if (!pw)
- die("slock: cannot retrieve password entry (make sure to suid or sgid slock)\n");
- endpwent();
+ if (!pw) {
+ if (errno)
+ die("slock: getpwuid: %s\n", strerror(errno));
+ else
+ die("slock: cannot retrieve password entry (make sure to suid or sgid slock)\n");
+ }
rval = pw->pw_passwd;
#if HAVE_SHADOW_H
sp = getspnam(getenv("USER"));
if(!sp)
die("slock: cannot retrieve shadow entry (make sure to suid or sgid slock)\n");
- endspent();
rval = sp->sp_pwdp;
}
#endif