diff options
author | Eric Andersen <andersen@codepoet.org> | 2002-10-10 04:20:21 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2002-10-10 04:20:21 +0000 |
commit | 71ae64bdc6b044eef0a9f3bebd85cc4a6b67362f (patch) | |
tree | 802990cf39a805f253b9d32f3888a7c749babd01 /loginutils | |
parent | fdfe298a966da0e6eecdc355efd640acf73c00e5 (diff) | |
download | busybox-w32-71ae64bdc6b044eef0a9f3bebd85cc4a6b67362f.tar.gz busybox-w32-71ae64bdc6b044eef0a9f3bebd85cc4a6b67362f.tar.bz2 busybox-w32-71ae64bdc6b044eef0a9f3bebd85cc4a6b67362f.zip |
last_patch61 from vodz:
New complex patch for decrease size devel version. Requires previous patch.
Also removed small problems from dutmp and tar applets.
Also includes vodz' last_patch61_2:
Last patch correcting comment for #endif and more integrated
with libbb (very reduce size if used "cat" applet also).
Requires last_patch61 for modutils/config.in.
Diffstat (limited to 'loginutils')
-rw-r--r-- | loginutils/getty.c | 24 | ||||
-rw-r--r-- | loginutils/login.c | 14 |
2 files changed, 11 insertions, 27 deletions
diff --git a/loginutils/getty.c b/loginutils/getty.c index fec8ae8e5..0f0778caf 100644 --- a/loginutils/getty.c +++ b/loginutils/getty.c | |||
@@ -388,34 +388,20 @@ static void parse_args(int argc, char **argv, struct options *op) | |||
388 | switch (c) { | 388 | switch (c) { |
389 | case 'I': | 389 | case 'I': |
390 | if (!(op->initstring = strdup(optarg))) | 390 | if (!(op->initstring = strdup(optarg))) |
391 | error("can't malloc initstring"); | 391 | error(memory_exhausted); |
392 | 392 | ||
393 | { | 393 | { |
394 | char ch, *p, *q; | 394 | const char *p; |
395 | int i; | 395 | char *q; |
396 | 396 | ||
397 | /* copy optarg into op->initstring decoding \ddd | 397 | /* copy optarg into op->initstring decoding \ddd |
398 | octal codes into chars */ | 398 | octal codes into chars */ |
399 | q = op->initstring; | 399 | q = op->initstring; |
400 | p = optarg; | 400 | p = optarg; |
401 | while (*p) { | 401 | while (*p) { |
402 | if (*p == '\\') { /* know \\ means \ */ | 402 | if (*p == '\\') { |
403 | p++; | 403 | p++; |
404 | if (*p == '\\') { | 404 | *q++ = process_escape_sequence(&p); |
405 | ch = '\\'; | ||
406 | p++; | ||
407 | } else { /* handle \000 - \177 */ | ||
408 | ch = 0; | ||
409 | for (i = 1; i <= 3; i++) { | ||
410 | if (*p >= '0' && *p <= '7') { | ||
411 | ch <<= 3; | ||
412 | ch += *p - '0'; | ||
413 | p++; | ||
414 | } else | ||
415 | break; | ||
416 | } | ||
417 | } | ||
418 | *q++ = ch; | ||
419 | } else { | 405 | } else { |
420 | *q++ = *p++; | 406 | *q++ = *p++; |
421 | } | 407 | } |
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 |