diff options
author | 2014-10-20 16:19:05 +0000 | |
---|---|---|
committer | 2014-10-20 16:19:05 +0000 | |
commit | 1865cfe23be7c7cb68153d882e524028511ddaf2 (patch) | |
tree | 929a8f0e671f3be7f79a49e749a0ce6079746472 | |
parent | correct the spacing after in-line equations (diff) | |
download | wireguard-openbsd-1865cfe23be7c7cb68153d882e524028511ddaf2.tar.xz wireguard-openbsd-1865cfe23be7c7cb68153d882e524028511ddaf2.zip |
As reported by Marcus Merighi, hosts enumeration no longer works.
The asr library no longer supports gethostent(3), and there is no
reasonable way to implement it. Consequently, as suggested
by guenther@, error out when hosts enumeration is requested.
OK deraadt@ guenther@ florian@
Also remove the now useless calls to sethostent(3) and endhostend(3)
as suggested by florian@.
-rw-r--r-- | usr.bin/getent/getent.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.bin/getent/getent.c b/usr.bin/getent/getent.c index d991d0cfb37..137173b4522 100644 --- a/usr.bin/getent/getent.c +++ b/usr.bin/getent/getent.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getent.c,v 1.6 2013/03/30 14:03:08 florian Exp $ */ +/* $OpenBSD: getent.c,v 1.7 2014/10/20 16:19:05 schwarze Exp $ */ /* $NetBSD: getent.c,v 1.7 2005/08/24 14:31:02 ginsbach Exp $ */ /*- @@ -268,10 +268,10 @@ hosts(int argc, char *argv[]) int i, rv = RV_OK; struct hostent *he; - sethostent(1); if (argc == 2) { - while ((he = gethostent()) != NULL) - hostsprint(he); + fprintf(stderr, "%s: Enumeration not supported on hosts\n", + __progname); + rv = RV_NOENUM; } else { for (i = 2; i < argc; i++) { he = NULL; @@ -285,7 +285,6 @@ hosts(int argc, char *argv[]) break; } } - endhostent(); return rv; } |