]>
Commit | Line | Data |
---|---|---|
d95dd929 AM |
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 @@ | |
67dbd305 | 5 | |
6 | #define SLEEP_EXIT_TIMEOUT 5 | |
7 | ||
8 | -#ifdef __linux__ | |
baf031b2 | 9 | +#ifndef __linux__ |
67dbd305 | 10 | #define DO_PS_FIDDLING |
11 | #endif | |
12 | ||
d95dd929 AM |
13 | @@ -515,8 +515,6 @@ |
14 | tcsetattr(0,TCSAFLUSH,&tt); | |
15 | } | |
eab95ebb | 16 | |
67dbd305 | 17 | - openlog("login", LOG_ODELAY, LOG_AUTHPRIV); |
18 | - | |
19 | #if 0 | |
20 | /* other than iso-8859-1 */ | |
21 | printf("\033(K"); | |
d95dd929 AM |
22 | @@ -646,8 +644,12 @@ |
23 | retcode = pam_setcred(pamh, PAM_ESTABLISH_CRED); | |
67dbd305 | 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; | |
d95dd929 | 35 | @@ -866,7 +868,9 @@ |
baf031b2 AF |
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(); | |
67dbd305 | 41 | + setutent(); |
42 | + memset(&ut, 0, sizeof(ut)); | |
baf031b2 | 43 | ut.ut_type = LOGIN_PROCESS; |
d95dd929 AM |
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 @@ | |
67dbd305 | 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")); |