opendoas

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

commit 73e0aef5b2bb0bc50ca67870b02b71d77150f312
parent e8c995662696d6038d05dde43bf348d4549e36c0
Author: Vadim Zhukov <zhuk@openbsd.org>
Date:   Tue, 28 Jul 2015 14:08:52 +0000

Fix keepenv handling. Initially reported by Ze Loff on misc@.

tedu@ agrees.

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

diff --git a/doas.c b/doas.c @@ -1,4 +1,4 @@ -/* $OpenBSD: doas.c,v 1.27 2015/07/26 22:44:33 tedu Exp $ */ +/* $OpenBSD: doas.c,v 1.28 2015/07/27 15:38:11 espie Exp $ */ /* * Copyright (c) 2015 Ted Unangst <tedu@openbsd.org> * @@ -256,8 +256,10 @@ copyenv(const char **oldenvp, struct rule *rule) size_t j; for (j = 0; j < nextras; j++) { if (strcmp(extra[j], safeset[i]) == 0) { - extra[j--] = extra[nextras--]; + nextras--; + extra[j] = extra[nextras]; extra[nextras] = NULL; + j--; } } }