aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-03-22 19:17:36 +0100
committerMattias Andrée <maandree@kth.se>2021-03-22 19:17:36 +0100
commit288b586867005aed92d61354785e58faf98e9e04 (patch)
tree0e38693a07431fb7f7b24b2bbac1ab0c255194e7
parentCorrection: set value of SHELL to pw_shell, rather than pw_dir (diff)
downloadasroot-1.1.3.tar.gz
asroot-1.1.3.tar.bz2
asroot-1.1.3.tar.xz
Fix support for long hostnames1.1.3
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--asroot.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/asroot.c b/asroot.c
index be28d13..193926d 100644
--- a/asroot.c
+++ b/asroot.c
@@ -241,7 +241,8 @@ check_password(void)
}
*hostname = 0;
if (!gethostname(hostname, size)) {
- break;
+ if (!hostname[size - 2])
+ break;
} else if (errno != ENAMETOOLONG) {
fprintf(stderr, "%s: gethostname %zu: %s\n", argv0, size, strerror(errno));
exit(EXIT_ERROR);