summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2015-07-20 01:00:48 +0000
committertedu <tedu@openbsd.org>2015-07-20 01:00:48 +0000
commit1533224dcba323b5ab6e8fb87f16f868d5d8d64b (patch)
tree65b34ce8be6572f36621a9e79ba24a4dcef52c42
parentrescope and rename some variables to reduce pressure on the alphabet (diff)
downloadwireguard-openbsd-1533224dcba323b5ab6e8fb87f16f868d5d8d64b.tar.xz
wireguard-openbsd-1533224dcba323b5ab6e8fb87f16f868d5d8d64b.zip
check that badlisted env has = after the name
-rw-r--r--usr.bin/doas/doas.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/doas/doas.c b/usr.bin/doas/doas.c
index 325f484f316..241b2ab59cd 100644
--- a/usr.bin/doas/doas.c
+++ b/usr.bin/doas/doas.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: doas.c,v 1.12 2015/07/20 00:57:53 tedu Exp $ */
+/* $OpenBSD: doas.c,v 1.13 2015/07/20 01:00:48 tedu Exp $ */
/*
* Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
*
@@ -213,7 +213,8 @@ copyenv(const char **oldenvp, struct rule *rule)
size_t j;
for (j = 0; j < nbad; j++) {
size_t len = strlen(badset[j]);
- if (strncmp(oldenvp[i], badset[j], len) == 0) {
+ if (strncmp(oldenvp[i], badset[j], len) == 0 &&
+ oldenvp[i][len] == '=') {
break;
}
}