aboutsummaryrefslogtreecommitdiff
path: root/loginutils
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-10-10 04:20:21 +0000
committerEric Andersen <andersen@codepoet.org>2002-10-10 04:20:21 +0000
commit71ae64bdc6b044eef0a9f3bebd85cc4a6b67362f (patch)
tree802990cf39a805f253b9d32f3888a7c749babd01 /loginutils
parentfdfe298a966da0e6eecdc355efd640acf73c00e5 (diff)
downloadbusybox-71ae64bdc6b044eef0a9f3bebd85cc4a6b67362f.tar.gz
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.c24
-rw-r--r--loginutils/login.c14
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)
switch (c) {
case 'I':
if (!(op->initstring = strdup(optarg)))
- error("can't malloc initstring");
+ error(memory_exhausted);
{
- char ch, *p, *q;
- int i;
+ const char *p;
+ char *q;
/* copy optarg into op->initstring decoding \ddd
octal codes into chars */
q = op->initstring;
p = optarg;
while (*p) {
- if (*p == '\\') { /* know \\ means \ */
+ if (*p == '\\') {
p++;
- if (*p == '\\') {
- ch = '\\';
- p++;
- } else { /* handle \000 - \177 */
- ch = 0;
- for (i = 1; i <= 3; i++) {
- if (*p >= '0' && *p <= '7') {
- ch <<= 3;
- ch += *p - '0';
- p++;
- } else
- break;
- }
- }
- *q++ = ch;
+ *q++ = process_escape_sequence(&p);
} else {
*q++ = *p++;
}
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 @@
// import from utmp.c
static void checkutmp(int picky);
static void setutmp(const char *name, const char *line);
+/* Stuff global to this file */
+struct utmp utent;
#endif
-// import from encrypt.c
-extern char *pw_encrypt(const char *clear, const char *salt);
-
-
// login defines
#define TIMEOUT 60
#define EMPTY_USERNAME_COUNT 10
#define USERNAME_SIZE 32
-/* Stuff global to this file */
-struct utmp utent;
-
static int check_nologin ( int amroot );
@@ -131,12 +126,15 @@ extern int login_main(int argc, char **argv)
else
safe_strncpy ( tty, "UNKNOWN", sizeof( tty ));
+#ifdef CONFIG_FEATURE_U_W_TMP
if ( amroot )
memset ( utent.ut_host, 0, sizeof utent.ut_host );
+#endif
if ( opt_host ) {
+#ifdef CONFIG_FEATURE_U_W_TMP
safe_strncpy ( utent.ut_host, opt_host, sizeof( utent. ut_host ));
-
+#endif
snprintf ( fromhost, sizeof( fromhost ) - 1, " on `%.100s' from `%.200s'", tty, opt_host );
}
else