diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2005-05-26 04:07:46 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2005-05-26 04:07:46 +0000 |
commit | 42c7e2c52056fc7e744642316bd261f0c119dc70 (patch) | |
tree | f0bff3263d4620102a7e9540e9bfd663fd5281ec /sys/net/if.c | |
parent | 48e0b42aa2bb1155a70d789836509e7cfdcf376b (diff) |
deny groupnames ending in digits in if_addgroup, frantzen ok
(this has been on my todo, mike beat me to it with the check in ifconfig, but
we want it here too)
Diffstat (limited to 'sys/net/if.c')
-rw-r--r-- | sys/net/if.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 0d2e34c731c..edb7761af18 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.122 2005/05/26 03:44:27 henning Exp $ */ +/* $OpenBSD: if.c,v 1.123 2005/05/26 04:07:45 henning Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -1583,6 +1583,10 @@ if_addgroup(struct ifnet *ifp, char *groupname) struct ifg_group *ifg = NULL; struct ifg_member *ifgm; + if (groupname[0] && groupname[strlen(groupname) - 1] >= '0' && + groupname[strlen(groupname) - 1] <= '9') + return (EINVAL); + TAILQ_FOREACH(ifgl, &ifp->if_groups, ifgl_next) if (!strcmp(ifgl->ifgl_group->ifg_group, groupname)) return (EEXIST); |