summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2014-10-24 10:23:32 +0000
committerschwarze <schwarze@openbsd.org>2014-10-24 10:23:32 +0000
commit9add677ac5681504ecab6e200fba576aec19c44d (patch)
treeb61c4f92c1f9d755233635a17e5835aaeee8e7c2
parentThis tool doesn't actually support networks(5). (diff)
downloadwireguard-openbsd-9add677ac5681504ecab6e200fba576aec19c44d.tar.xz
wireguard-openbsd-9add677ac5681504ecab6e200fba576aec19c44d.zip
tedu networks(5) support;
OK florian@ henning@
-rw-r--r--usr.bin/getent/getent.16
-rw-r--r--usr.bin/getent/getent.c46
2 files changed, 3 insertions, 49 deletions
diff --git a/usr.bin/getent/getent.1 b/usr.bin/getent/getent.1
index e0646905c6a..0169ff7eca8 100644
--- a/usr.bin/getent/getent.1
+++ b/usr.bin/getent/getent.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: getent.1,v 1.11 2014/02/12 17:23:25 schwarze Exp $
+.\" $OpenBSD: getent.1,v 1.12 2014/10/24 10:23:32 schwarze Exp $
.\" $NetBSD: getent.1,v 1.13 2005/09/11 23:16:15 wiz Exp $
.\"
.\" Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: February 12 2014 $
+.Dd $Mdocdate: October 24 2014 $
.Dt GETENT 1
.Os
.Sh NAME
@@ -63,7 +63,6 @@ may be one of:
.It ethers Ta address name
.It group Ta group:passwd:gid:[member[,member]...]
.It hosts Ta address name [alias ...]
-.It networks Ta name network [alias ...]
.It passwd Ta user:passwd:uid:gid:gecos:home_dir:shell
.It protocols Ta name protocol [alias ...]
.It rpc Ta name number [alias ...]
@@ -114,7 +113,6 @@ There is no support for enumeration on
.Xr ethers 5 ,
.Xr group 5 ,
.Xr hosts 5 ,
-.Xr networks 5 ,
.Xr passwd 5 ,
.Xr protocols 5 ,
.Xr rpc 5 ,
diff --git a/usr.bin/getent/getent.c b/usr.bin/getent/getent.c
index 137173b4522..acade337ab2 100644
--- a/usr.bin/getent/getent.c
+++ b/usr.bin/getent/getent.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getent.c,v 1.7 2014/10/20 16:19:05 schwarze Exp $ */
+/* $OpenBSD: getent.c,v 1.8 2014/10/24 10:23:32 schwarze Exp $ */
/* $NetBSD: getent.c,v 1.7 2005/08/24 14:31:02 ginsbach Exp $ */
/*-
@@ -58,7 +58,6 @@ static int usage(void);
static int ethers(int, char *[]);
static int group(int, char *[]);
static int hosts(int, char *[]);
-static int networks(int, char *[]);
static int passwd(int, char *[]);
static int protocols(int, char *[]);
static int rpc(int, char *[]);
@@ -80,7 +79,6 @@ static struct getentdb {
{ "ethers", ethers, },
{ "group", group, },
{ "hosts", hosts, },
- { "networks", networks, },
{ "passwd", passwd, },
{ "protocols", protocols, },
{ "rpc", rpc, },
@@ -288,48 +286,6 @@ hosts(int argc, char *argv[])
return rv;
}
-static void
-networksprint(const struct netent *ne)
-{
- char buf[INET6_ADDRSTRLEN];
- struct in_addr ianet;
-
- ianet = inet_makeaddr(ne->n_net, 0);
- if (inet_ntop(ne->n_addrtype, &ianet, buf, sizeof(buf)) == NULL)
- strlcpy(buf, "# unknown", sizeof(buf));
- printfmtstrings(ne->n_aliases, " ", " ", "%-16s %s", ne->n_name, buf);
-}
-
-static int
-networks(int argc, char *argv[])
-{
- int i, rv = RV_OK;
- struct netent *ne;
- in_addr_t net;
-
- setnetent(1);
- if (argc == 2) {
- while ((ne = getnetent()) != NULL)
- networksprint(ne);
- } else {
- for (i = 2; i < argc; i++) {
- net = inet_network(argv[i]);
- if (net != INADDR_NONE)
- ne = getnetbyaddr(net, AF_INET);
- else
- ne = getnetbyname(argv[i]);
- if (ne != NULL)
- networksprint(ne);
- else {
- rv = RV_NOTFOUND;
- break;
- }
- }
- }
- endnetent();
- return rv;
-}
-
#define PASSWDPRINT \
printf("%s:%s:%u:%u:%s:%s:%s\n", \
pw->pw_name, pw->pw_passwd, pw->pw_uid, \