diff options
Diffstat (limited to 'loginutils/login.c')
-rw-r--r-- | loginutils/login.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/loginutils/login.c b/loginutils/login.c index 714829db1..6b8f6c651 100644 --- a/loginutils/login.c +++ b/loginutils/login.c | |||
@@ -22,20 +22,15 @@ | |||
22 | // import from utmp.c | 22 | // import from utmp.c |
23 | static void checkutmp(int picky); | 23 | static void checkutmp(int picky); |
24 | static void setutmp(const char *name, const char *line); | 24 | static void setutmp(const char *name, const char *line); |
25 | /* Stuff global to this file */ | ||
26 | struct utmp utent; | ||
25 | #endif | 27 | #endif |
26 | 28 | ||
27 | // import from encrypt.c | ||
28 | extern char *pw_encrypt(const char *clear, const char *salt); | ||
29 | |||
30 | |||
31 | // login defines | 29 | // login defines |
32 | #define TIMEOUT 60 | 30 | #define TIMEOUT 60 |
33 | #define EMPTY_USERNAME_COUNT 10 | 31 | #define EMPTY_USERNAME_COUNT 10 |
34 | #define USERNAME_SIZE 32 | 32 | #define USERNAME_SIZE 32 |
35 | 33 | ||
36 | /* Stuff global to this file */ | ||
37 | struct utmp utent; | ||
38 | |||
39 | 34 | ||
40 | static int check_nologin ( int amroot ); | 35 | static int check_nologin ( int amroot ); |
41 | 36 | ||
@@ -131,12 +126,15 @@ extern int login_main(int argc, char **argv) | |||
131 | else | 126 | else |
132 | safe_strncpy ( tty, "UNKNOWN", sizeof( tty )); | 127 | safe_strncpy ( tty, "UNKNOWN", sizeof( tty )); |
133 | 128 | ||
129 | #ifdef CONFIG_FEATURE_U_W_TMP | ||
134 | if ( amroot ) | 130 | if ( amroot ) |
135 | memset ( utent.ut_host, 0, sizeof utent.ut_host ); | 131 | memset ( utent.ut_host, 0, sizeof utent.ut_host ); |
132 | #endif | ||
136 | 133 | ||
137 | if ( opt_host ) { | 134 | if ( opt_host ) { |
135 | #ifdef CONFIG_FEATURE_U_W_TMP | ||
138 | safe_strncpy ( utent.ut_host, opt_host, sizeof( utent. ut_host )); | 136 | safe_strncpy ( utent.ut_host, opt_host, sizeof( utent. ut_host )); |
139 | 137 | #endif | |
140 | snprintf ( fromhost, sizeof( fromhost ) - 1, " on `%.100s' from `%.200s'", tty, opt_host ); | 138 | snprintf ( fromhost, sizeof( fromhost ) - 1, " on `%.100s' from `%.200s'", tty, opt_host ); |
141 | } | 139 | } |
142 | else | 140 | else |