summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryasuoka <yasuoka@openbsd.org>2014-07-12 20:07:07 +0000
committeryasuoka <yasuoka@openbsd.org>2014-07-12 20:07:07 +0000
commit0430ec61dcb80e5aa11a547f03ce79800824b61b (patch)
tree7e3fb25c79a27c825403e793fd0dd0087462c4b4
parentoh well, remove -Q entirely... I'm probably the only one who ever used that. (diff)
downloadwireguard-openbsd-0430ec61dcb80e5aa11a547f03ce79800824b61b.tar.xz
wireguard-openbsd-0430ec61dcb80e5aa11a547f03ce79800824b61b.zip
Fix a potential bug. privsep.c didn't check the interface name
correctly if it's pppx.
-rw-r--r--usr.sbin/npppd/npppd/privsep.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/npppd/npppd/privsep.c b/usr.sbin/npppd/npppd/privsep.c
index 6977644a2ac..5c79fa07b69 100644
--- a/usr.sbin/npppd/npppd/privsep.c
+++ b/usr.sbin/npppd/npppd/privsep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: privsep.c,v 1.11 2014/07/12 19:34:31 yasuoka Exp $ */
+/* $OpenBSD: privsep.c,v 1.12 2014/07/12 20:07:07 yasuoka Exp $ */
/*
* Copyright (c) 2010 Yasuoka Masahiko <yasuoka@openbsd.org>
@@ -1047,7 +1047,7 @@ static int
privsep_npppd_check_get_if_addr(struct PRIVSEP_GET_IF_ADDR_ARG *arg)
{
if (strncmp(arg->ifname, "tun", 3) == 0 ||
- strncmp(arg->ifname, "pppx", 4))
+ strncmp(arg->ifname, "pppx", 4) == 0)
return (0);
return (1);
@@ -1057,7 +1057,7 @@ static int
privsep_npppd_check_set_if_addr(struct PRIVSEP_SET_IF_ADDR_ARG *arg)
{
if (strncmp(arg->ifname, "tun", 3) == 0 ||
- strncmp(arg->ifname, "pppx", 4))
+ strncmp(arg->ifname, "pppx", 4) == 0)
return (0);
return (1);
@@ -1067,7 +1067,7 @@ static int
privsep_npppd_check_del_if_addr(struct PRIVSEP_DEL_IF_ADDR_ARG *arg)
{
if (strncmp(arg->ifname, "tun", 3) == 0 ||
- strncmp(arg->ifname, "pppx", 4))
+ strncmp(arg->ifname, "pppx", 4) == 0)
return (0);
return (1);
@@ -1077,7 +1077,7 @@ static int
privsep_npppd_check_get_if_flags(struct PRIVSEP_GET_IF_FLAGS_ARG *arg)
{
if (strncmp(arg->ifname, "tun", 3) == 0 ||
- strncmp(arg->ifname, "pppx", 4))
+ strncmp(arg->ifname, "pppx", 4) == 0)
return (0);
return (1);
@@ -1087,7 +1087,7 @@ static int
privsep_npppd_check_set_if_flags(struct PRIVSEP_SET_IF_FLAGS_ARG *arg)
{
if (strncmp(arg->ifname, "tun", 3) == 0 ||
- strncmp(arg->ifname, "pppx", 4))
+ strncmp(arg->ifname, "pppx", 4) == 0)
return (0);
return (1);