From 3fc62fd3a59ae490c8d7011fcc9d11953886c752 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 17 May 2011 13:21:45 +0200 Subject: agetty: remove unnecessary options synonyms Signed-off-by: Karel Zak --- term-utils/agetty.8 | 18 +++++++++--------- term-utils/agetty.c | 9 ++------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/term-utils/agetty.8 b/term-utils/agetty.8 index dc4919316..4ccb28a14 100644 --- a/term-utils/agetty.8 +++ b/term-utils/agetty.8 @@ -125,18 +125,18 @@ backslash (\\). For example to send a linefeed character (ASCII 10, octal 012) write \\012. .PP .TP -\-l, \-\-login-program \fIlogin_program\fP +\-l, \-\-login\-program \fIlogin_program\fP Invoke the specified \fIlogin_program\fP instead of /bin/login. This allows the use of a non-standard login program (for example, one that asks for a dial-up password or that uses a different password file). .TP -\-L, \-\-local-line +\-L, \-\-local\-line Force the line to be a local line with no need for carrier detect. This can be useful when you have a locally attached terminal where the serial line does not set the carrier detect signal. .TP -\-m, \-\-extract-baud +\-m, \-\-extract\-baud Try to extract the baud rate the CONNECT status message produced by Hayes(tm)\-compatible modems. These status messages are of the form: "". @@ -164,7 +164,7 @@ by the login name. Defaults to "-- \\u", which is suitable for \fB/bin/login\fP. Please read the SECURITY NOTICE below if you want to use this. .TP -\-p, \-\-loginpause +\-p, \-\-login\-pause Wait for any key before dropping to the login prompt. Can be combined with \fB\-\-autologin\fP to save memory by lazily spawning shells. .TP @@ -198,7 +198,7 @@ Do not clear the screen before prompting for the login name \-\-nonewline Do not print a newline before writing out /etc/issue. .TP -\-\-no\-hostname +\-\-nohostname By default the hostname will be printed. With this option enabled, no hostname at all will be shown. .TP @@ -240,13 +240,13 @@ dis-connection and turn on auto-answer after 1 ring.) /sbin/agetty \-w \-I 'ATE0Q1&D2&C1S0=1\\015' 115200 ttyS1 .SH SECURITY NOTICE -If you use the \fB\-\-login\fP and \fB\-\-logopts\fP options, be aware -that a malicious user may try to enter lognames with embedded options, -which then get passed to the used login program. Agetty does check +If you use the \fB\-\-login\-program\fP and \fB\-\-login\-options\fP options, +be aware that a malicious user may try to enter lognames with embedded options, +which then get passed to the used login program. Agetty does check for a leading "\-" and makes sure the logname gets passed as one parameter (so embedded spaces will not create yet another parameter), but depending on how the login binary parses the command line that might not be sufficient. -Check that the used login program can not be abused this way. +Check that the used login program can not be abused this way. .PP Some programs use "\-\-" to indicate that the rest of the commandline should not be interpreted as options. Use this feature if available by passing "\-\-" diff --git a/term-utils/agetty.c b/term-utils/agetty.c index 4a90dad94..11491cd3c 100644 --- a/term-utils/agetty.c +++ b/term-utils/agetty.c @@ -458,16 +458,12 @@ static void parse_args(int argc, char **argv, struct options *op) { "init-string", required_argument, 0, 'I' }, { "noclear", no_argument, 0, 'J' }, { "login-program", required_argument, 0, 'l' }, - { "login", required_argument, 0, 'l' }, /* compat option */ - { "loginprog", required_argument, 0, 'l' }, /* compat option */ { "local-line", no_argument, 0, 'L' }, { "extract-baud", no_argument, 0, 'm' }, { "skip-login", no_argument, 0, 'n' }, { "nonewline", no_argument, 0, 'N' }, { "login-options", required_argument, 0, 'o' }, - { "loginopts", required_argument, 0, 'o' }, /* compat option */ - { "logopts", required_argument, 0, 'o' }, /* compat option */ - { "loginpause", no_argument, 0, 'p' }, + { "login-pause", no_argument, 0, 'p' }, { "nice", required_argument, 0, 'P' }, { "chroot", required_argument, 0, 'r' }, { "hangup", no_argument, 0, 'R' }, @@ -475,8 +471,7 @@ static void parse_args(int argc, char **argv, struct options *op) { "timeout", required_argument, 0, 't' }, { "detect-case", no_argument, 0, 'U' }, { "wait-cr", no_argument, 0, 'w' }, - { "no-hostname", no_argument, 0, NOHOSTNAME_OPTION }, - { "nohostname", no_argument, 0, NOHOSTNAME_OPTION }, /* compat option */ + { "nohostname", no_argument, 0, NOHOSTNAME_OPTION }, { "long-hostname", no_argument, 0, LONGHOSTNAME_OPTION }, { "version", no_argument, 0, VERSION_OPTION }, { "help", no_argument, 0, HELP_OPTION }, -- cgit v1.2.3-55-g7522