From 343cc275591327bc2094f88387f09702a542dc8c Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sat, 1 Apr 2017 11:38:01 +0100 Subject: agetty: make --remote to forward --nohostname as -H to login Without this change an attempt to remove hostname printing required following rather clumsy agetty invocation. /sbin/agetty --nohostname --login-options '/bin/login -H -- \u' After the change --nohostname behaves similar way with --host option, that is when combined with --remote the effect is passed to login(1). Signed-off-by: Sami Kerola --- term-utils/agetty.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'term-utils/agetty.c') diff --git a/term-utils/agetty.c b/term-utils/agetty.c index 6a2085a3c..93a3843c7 100644 --- a/term-utils/agetty.c +++ b/term-utils/agetty.c @@ -493,9 +493,12 @@ int main(int argc, char **argv) login_options_to_argv(login_argv, &login_argc, options.logopt, username); } else { - if (fakehost && (options.flags & F_REMOTE)) { - login_argv[login_argc++] = "-h"; - login_argv[login_argc++] = fakehost; + if (options.flags & F_REMOTE) { + if (fakehost) { + login_argv[login_argc++] = "-h"; + login_argv[login_argc++] = fakehost; + } else if (options.flags & F_NOHOSTNAME) + login_argv[login_argc++] = "-H"; } if (username) { if (options.autolog) -- cgit v1.2.3-55-g7522