]>
Commit | Line | Data |
---|---|---|
1 | diff -urN util-linux-2.11d.org/login-utils/login.c util-linux-2.11d/login-utils/login.c | |
2 | --- util-linux-2.11d.org/login-utils/login.c Sun May 20 22:27:44 2001 | |
3 | +++ util-linux-2.11d/login-utils/login.c Sun Jun 3 21:49:55 2001 | |
4 | @@ -156,7 +156,7 @@ | |
5 | ||
6 | #define SLEEP_EXIT_TIMEOUT 5 | |
7 | ||
8 | -#ifdef __linux__ | |
9 | +#ifndef __linux__ | |
10 | #define DO_PS_FIDDLING | |
11 | #endif | |
12 | ||
13 | @@ -515,8 +515,6 @@ | |
14 | tcsetattr(0,TCSAFLUSH,&tt); | |
15 | } | |
16 | ||
17 | - openlog("login", LOG_ODELAY, LOG_AUTHPRIV); | |
18 | - | |
19 | #if 0 | |
20 | /* other than iso-8859-1 */ | |
21 | printf("\033(K"); | |
22 | @@ -646,8 +644,12 @@ | |
23 | retcode = pam_setcred(pamh, PAM_ESTABLISH_CRED); | |
24 | PAM_FAIL_CHECK; | |
25 | ||
26 | + openlog("login", LOG_ODELAY, LOG_AUTHPRIV); | |
27 | + | |
28 | #else /* ! USE_PAM */ | |
29 | ||
30 | + openlog("login", LOG_ODELAY, LOG_AUTHPRIV); | |
31 | + | |
32 | for (cnt = 0;; ask = 1) { | |
33 | # ifndef __linux__ | |
34 | ioctlval = 0; | |
35 | @@ -866,7 +868,9 @@ | |
36 | /* If we can't find a pre-existing entry by pid, try by line. | |
37 | BSD network daemons may rely on this. (anonymous) */ | |
38 | if (utp == NULL) { | |
39 | - setutent(); | |
40 | + endutent(); | |
41 | + setutent(); | |
42 | + memset(&ut, 0, sizeof(ut)); | |
43 | ut.ut_type = LOGIN_PROCESS; | |
44 | strncpy(ut.ut_id, tty_number, sizeof(ut.ut_id)); | |
45 | strncpy(ut.ut_line, tty_name, sizeof(ut.ut_line)); | |
46 | @@ -1103,6 +1107,8 @@ | |
47 | #endif | |
48 | signal(SIGINT, SIG_DFL); | |
49 | ||
50 | + openlog("login", LOG_ODELAY, LOG_AUTHPRIV); | |
51 | + | |
52 | /* discard permissions last so can't get killed and drop core */ | |
53 | if(setuid(pwd->pw_uid) < 0 && pwd->pw_uid) { | |
54 | syslog(LOG_ALERT, _("setuid() failed")); |