opendoas

A portable version of the OpenBSD `doas` command
git clone https://pi.duncano.de/git/opendoas.git
Log | Files | Refs | README | LICENSE

commit e634f2b4be7a088bede88873ca0b51e5995d47b0
parent cfaba1b73233afafd94b7d75245487e847d77cc4
Author: Ted Unangst <tedu@openbsd.org>
Date:   Mon, 20 Jul 2015 01:00:48 +0000

check that badlisted env has = after the name

Diffstat:
doas.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 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; } }