diff options
author | Karel Zak | 2017-07-10 10:42:49 +0200 |
---|---|---|
committer | Karel Zak | 2017-07-10 10:42:49 +0200 |
commit | a273d83db9be88d77d54f723a261a61b9b06f7b8 (patch) | |
tree | 72ba27432a4ea0bbec59ebc79fd3d50ec4a36d21 /term-utils/agetty.c | |
parent | Merge branch 'help' of https://github.com/rudimeier/util-linux (diff) | |
download | kernel-qcow2-util-linux-a273d83db9be88d77d54f723a261a61b9b06f7b8.tar.gz kernel-qcow2-util-linux-a273d83db9be88d77d54f723a261a61b9b06f7b8.tar.xz kernel-qcow2-util-linux-a273d83db9be88d77d54f723a261a61b9b06f7b8.zip |
agetty: print /etc/issue on --skip-login
The current --skip-login implementation disables also issue file
printing. This is unexpected behavior as /etc/issue may contains
important information and we have --noissue for admins who don't want
it.
This patch forces /etc/issue printing if --noissue no specified.
Addresses: https://github.com/karelzak/util-linux/issues/480
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'term-utils/agetty.c')
-rw-r--r-- | term-utils/agetty.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/term-utils/agetty.c b/term-utils/agetty.c index 23cac403e..e5f2ff229 100644 --- a/term-utils/agetty.c +++ b/term-utils/agetty.c @@ -317,6 +317,7 @@ static ssize_t append(char *dest, size_t len, const char *sep, const char *src) static void check_username (const char* nm); static void login_options_to_argv(char *argv[], int *argc, char *str, char *username); static void reload_agettys(void); +static void print_issue_file(struct options *op, struct termios *tp); /* Fake hostname for ut_host specified on command line. */ static char *fakehost; @@ -452,7 +453,9 @@ int main(int argc, char **argv) username = options.autolog; } - if ((options.flags & F_NOPROMPT) == 0) { + if (options.flags & F_NOPROMPT) { /* --skip-login */ + print_issue_file(&options, &termios); + } else { /* regular (auto)login */ if (options.autolog) { /* Autologin prompt */ do_prompt(&options, &termios); |