aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Unangst <tedu@openbsd.org>2015-07-20 01:00:48 +0000
committerTed Unangst <tedu@openbsd.org>2015-07-20 01:00:48 +0000
commite634f2b4be7a088bede88873ca0b51e5995d47b0 (patch)
tree1bcac547fd7e835c41c279df3336060caa733e0d
parentcfaba1b73233afafd94b7d75245487e847d77cc4 (diff)
downloadopendoas-e634f2b4be7a088bede88873ca0b51e5995d47b0.tar.gz
check that badlisted env has = after the name
-rw-r--r--doas.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/doas.c b/doas.c
index 8ba6c96..b07059c 100644
--- a/doas.c
+++ b/doas.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: doas.c,v 1.11 2015/07/20 00:54:01 tedu Exp $ */
+/* $OpenBSD: doas.c,v 1.12 2015/07/20 00:57:53 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;
}
}