From 9aeb66dc6b878bfb51bbcd4497107bc34e71b73d Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 4 Aug 2011 18:37:25 +0200 Subject: agetty: improve login(1) argv[] * fix regression: missing username should not be reported (EPERM) if -n/--skip-login is given and username is NULL. * don't compose login options *string* if we can use argv *array* (the string is necessary only for --login-options). * don't overwrite --login-options by --autologin The old code silently ignores login-options and "login -f " is always used. The new code uses: a) "login -f " by default b) "login " for --login-options + --autologin where for b) the username from "--autologin " is used to replace \u magic string in . * the \u could be used more than once in one login argv string, for example: agetty --login-options "-o user=\\u,name=\\u --foo" * the space in --login-options is correctly ignored, for example agetty --login-options " hello world ". Reviewed-by: Voelker, Bernhard Signed-off-by: Karel Zak --- term-utils/agetty.8 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'term-utils/agetty.8') diff --git a/term-utils/agetty.8 b/term-utils/agetty.8 index 4ccb28a14..c43f4561c 100644 --- a/term-utils/agetty.8 +++ b/term-utils/agetty.8 @@ -87,9 +87,11 @@ whatever init(8) may have set, and is inherited by login and the shell. Assume that the tty is 8-bit clean, hence disable parity detection. .TP \-a, \-\-autologin \fIusername\fP -Log the specified user automatically in without asking for a login -name and password. Check the \-f option from -\fB/bin/login\fP for this. +Log the specified user automatically in without asking for a login name and +password. The \-f \fIusername\fP option is added to the \fB/bin/login\fP +command line by default. The \-\-login-options option changes this default +behaviour and then only \\u is replaced by the \fIusername\fP and no other +option is added to the login command line. .TP \-c, \-\-noreset Don't reset terminal cflags (control modes). See \fItermios(3)\fP for more @@ -160,9 +162,10 @@ is run as root. .TP \-o, \-\-login\-options \fI"login_options"\fP Options that are passed to the login program. \\u is replaced -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. +by the login name. The default \fB/bin/login\fP command line +is "/bin/login -- ". + +Please read the SECURITY NOTICE below if you want to use this. .TP \-p, \-\-login\-pause Wait for any key before dropping to the login prompt. Can be combined -- cgit v1.2.3-55-g7522