summaryrefslogtreecommitdiffstats
path: root/term-utils/agetty.c
diff options
context:
space:
mode:
authorSami Kerola2017-04-01 12:38:01 +0200
committerSami Kerola2017-04-03 20:55:15 +0200
commit343cc275591327bc2094f88387f09702a542dc8c (patch)
tree1379ed4cc0982e09bd9d0cec3f1873dcd16f5379 /term-utils/agetty.c
parentlib/cpuset: stop changing variable that is not read (diff)
downloadkernel-qcow2-util-linux-343cc275591327bc2094f88387f09702a542dc8c.tar.gz
kernel-qcow2-util-linux-343cc275591327bc2094f88387f09702a542dc8c.tar.xz
kernel-qcow2-util-linux-343cc275591327bc2094f88387f09702a542dc8c.zip
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 <kerolasa@iki.fi>
Diffstat (limited to 'term-utils/agetty.c')
-rw-r--r--term-utils/agetty.c9
1 files changed, 6 insertions, 3 deletions
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)