]> git.ipfire.org Git - thirdparty/util-linux.git/commit
agetty: improve login(1) argv[]
authorKarel Zak <kzak@redhat.com>
Thu, 4 Aug 2011 16:37:25 +0000 (18:37 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 8 Aug 2011 10:07:07 +0000 (12:07 +0200)
commit9aeb66dc6b878bfb51bbcd4497107bc34e71b73d
treeaa0b9ada7e99a548c8004940fb7f4f14d2baf75e
parentbaecaf21cea148a0bc6a1dc615f587a649d063ed
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 <username>"
  is always used.

  The new code uses:
    a) "login -f <username>"    by default
    b) "login <login-options>"  for --login-options + --autologin

  where for b) the username from "--autologin <username>" is used to
  replace \u magic string in <login-options>.

* 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 <bernhard.voelker@siemens-enterprise.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
term-utils/agetty.8
term-utils/agetty.c