do endpwent(3).

This commit is contained in:
iratqq 2008-02-01 12:27:49 +00:00
commit c6e4953622

View file

@ -46,8 +46,8 @@ exec_auth()
pid_t child_pid = -1; pid_t child_pid = -1;
struct sigaction sa; struct sigaction sa;
if (socketpair(AF_LOCAL, SOCK_STREAM, PF_UNSPEC, socks) == -1) { if (socketpair(AF_LOCAL, SOCK_STREAM, PF_UNSPEC, socks) == -1) {
fprintf(stderr, "socketpair() failed"); fprintf(stderr, "socketpair() failed");
exit(255); exit(255);
} }
@ -63,11 +63,11 @@ exec_auth()
} }
memset(&sa, 0, sizeof(sa)); memset(&sa, 0, sizeof(sa));
sigemptyset(&sa.sa_mask); sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_RESTART; sa.sa_flags = SA_RESTART;
sa.sa_handler = SIG_DFL; sa.sa_handler = SIG_DFL;
for (i = 1; i < NSIG; i++) for (i = 1; i < NSIG; i++)
sigaction(i, &sa, NULL); sigaction(i, &sa, NULL);
strlcpy(chroot_dir, "/", sizeof(chroot_dir)); strlcpy(chroot_dir, "/", sizeof(chroot_dir));
set_priv("[auth]"); set_priv("[auth]");
@ -82,7 +82,7 @@ exec_auth()
if (may_read(socks[0], &cmd, sizeof(int))) if (may_read(socks[0], &cmd, sizeof(int)))
break; break;
switch (cmd) { switch (cmd) {
case AUTH_GETUGID: case AUTH_GETUGID:
/* length, user name */ /* length, user name */
must_read(socks[0], &username_len, sizeof(size_t)); must_read(socks[0], &username_len, sizeof(size_t));
if (username_len == 0 || username_len > sizeof(username)) if (username_len == 0 || username_len > sizeof(username))
@ -99,6 +99,7 @@ exec_auth()
ret = 0; ret = 0;
must_write(socks[0], &ret, sizeof(int)); must_write(socks[0], &ret, sizeof(int));
} }
endpwent();
break; break;
case AUTH_EXIT: case AUTH_EXIT:
close(socks[0]); close(socks[0]);