char *hostname;
char hostaddress[16];
+
+ pid_t pid;
};
/*
static struct passwd pwdcopy;
static char *username;
-static pid_t pid;
static void timedout(int);
static void sigint(int);
#endif
ut.ut_type = LOGIN_PROCESS; /* XXX doesn't matter */
- ut.ut_pid = pid;
+ ut.ut_pid = cxt->pid;
if (cxt->hostname) {
xstrncpy(ut.ut_host, cxt->hostname, sizeof(ut.ut_host));
if (cxt->hostaddress && *cxt->hostaddress)
pam_handle_t *pamh = NULL;
struct pam_conv conv = { misc_conv, NULL };
struct sigaction sa, oldsa_hup, oldsa_term;
- struct login_context cxt;
- memset(&cxt, 0, sizeof(cxt));
- pid = getpid();
+ struct login_context cxt = {
+ .pid = getpid()
+ };
signal(SIGALRM, timedout);
siginterrupt(SIGALRM, 1); /* we have to interrupt syscalls like ioclt() */
Michael Riepe <michael@stud.uni-hannover.de>
*/
while ((utp = getutent()))
- if (utp->ut_pid == pid
+ if (utp->ut_pid == cxt.pid
&& utp->ut_type >= INIT_PROCESS
&& utp->ut_type <= DEAD_PROCESS)
break;
}
#endif
ut.ut_type = USER_PROCESS;
- ut.ut_pid = pid;
+ ut.ut_pid = cxt.pid;
if (cxt.hostname) {
xstrncpy(ut.ut_host, cxt.hostname, sizeof(ut.ut_host));
if (cxt.hostaddress[0])