summaryrefslogtreecommitdiff
path: root/loginutils/getty.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-10-10 03:55:09 +0000
committerEric Andersen <andersen@codepoet.org>2002-10-10 03:55:09 +0000
commitfdfe298a966da0e6eecdc355efd640acf73c00e5 (patch)
treebbba20b8aeb730194fe47b35bea6deea8d752a37 /loginutils/getty.c
parentd274b53c1d45aa829178c0aded9434f50a044a2f (diff)
downloadbusybox-w32-fdfe298a966da0e6eecdc355efd640acf73c00e5.tar.gz
busybox-w32-fdfe298a966da0e6eecdc355efd640acf73c00e5.tar.bz2
busybox-w32-fdfe298a966da0e6eecdc355efd640acf73c00e5.zip
last_patch60 from vodz:
login and getty applets writes utmp/wtmp but init do clearing not. I think, in current time deny wtmp/utmp writes as undefault features.
Diffstat (limited to 'loginutils/getty.c')
-rw-r--r--loginutils/getty.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/loginutils/getty.c b/loginutils/getty.c
index 468208a49..fec8ae8e5 100644
--- a/loginutils/getty.c
+++ b/loginutils/getty.c
@@ -37,8 +37,6 @@
37#define USE_SYSLOG 37#define USE_SYSLOG
38#endif 38#endif
39 39
40extern void updwtmp(const char *filename, const struct utmp *ut);
41
42 /* If USE_SYSLOG is undefined all diagnostics go directly to /dev/console. */ 40 /* If USE_SYSLOG is undefined all diagnostics go directly to /dev/console. */
43#ifdef USE_SYSLOG 41#ifdef USE_SYSLOG
44#include <syslog.h> 42#include <syslog.h>
@@ -52,7 +50,10 @@ extern void updwtmp(const char *filename, const struct utmp *ut);
52 50
53#ifdef LOGIN_PROCESS /* defined in System V utmp.h */ 51#ifdef LOGIN_PROCESS /* defined in System V utmp.h */
54#define SYSV_STYLE /* select System V style getty */ 52#define SYSV_STYLE /* select System V style getty */
53#ifdef CONFIG_FEATURE_U_W_TMP
54extern void updwtmp(const char *filename, const struct utmp *ut);
55#endif 55#endif
56#endif /* LOGIN_PROCESS */
56 57
57 /* 58 /*
58 * Things you may want to modify. 59 * Things you may want to modify.
@@ -218,7 +219,6 @@ static struct Speedtab speedtab[] = {
218 219
219static void parse_args(int argc, char **argv, struct options *op); 220static void parse_args(int argc, char **argv, struct options *op);
220static void parse_speeds(struct options *op, char *arg); 221static void parse_speeds(struct options *op, char *arg);
221static void update_utmp(char *line);
222static void open_tty(char *tty, struct termio *tp, int local); 222static void open_tty(char *tty, struct termio *tp, int local);
223static void termio_init(struct termio *tp, int speed, struct options *op); 223static void termio_init(struct termio *tp, int speed, struct options *op);
224static void auto_baud(struct termio *tp); 224static void auto_baud(struct termio *tp);
@@ -234,6 +234,10 @@ static int caps_lock(const char *s);
234static int bcode(const char *s); 234static int bcode(const char *s);
235static void error(const char *fmt, ...) __attribute__ ((noreturn)); 235static void error(const char *fmt, ...) __attribute__ ((noreturn));
236 236
237#ifdef CONFIG_FEATURE_U_W_TMP
238static void update_utmp(char *line);
239#endif
240
237/* The following is used for understandable diagnostics. */ 241/* The following is used for understandable diagnostics. */
238 242
239/* Fake hostname for ut_host specified on command line. */ 243/* Fake hostname for ut_host specified on command line. */
@@ -286,9 +290,12 @@ int getty_main(int argc, char **argv)
286 290
287 /* Update the utmp file. */ 291 /* Update the utmp file. */
288 292
293
289#ifdef SYSV_STYLE 294#ifdef SYSV_STYLE
295#ifdef CONFIG_FEATURE_U_W_TMP
290 update_utmp(options.tty); 296 update_utmp(options.tty);
291#endif 297#endif
298#endif
292 299
293 debug("calling open_tty\n"); 300 debug("calling open_tty\n");
294 /* Open the tty as standard { input, output, error }. */ 301 /* Open the tty as standard { input, output, error }. */
@@ -492,6 +499,7 @@ static void parse_speeds(struct options *op, char *arg)
492} 499}
493 500
494#ifdef SYSV_STYLE 501#ifdef SYSV_STYLE
502#ifdef CONFIG_FEATURE_U_W_TMP
495 503
496/* update_utmp - update our utmp entry */ 504/* update_utmp - update our utmp entry */
497static void update_utmp(char *line) 505static void update_utmp(char *line)
@@ -544,7 +552,8 @@ static void update_utmp(char *line)
544 } 552 }
545} 553}
546 554
547#endif 555#endif /* CONFIG_FEATURE_U_W_TMP */
556#endif /* SYSV_STYLE */
548 557
549/* open_tty - set up tty as standard { input, output, error } */ 558/* open_tty - set up tty as standard { input, output, error } */
550static void open_tty(char *tty, struct termio *tp, int local) 559static void open_tty(char *tty, struct termio *tp, int local)