This fixes (as t-run-keepenv-path says) the problem found be Ze Loff:
http://marc.info/?l=openbsd-misc&m=143807620616845&w=2
Okay?
--
WBR,
Vadim Zhukov
Index: doas.c
===================================================================
RCS file: /cvs/src/usr.bin/doas/doas.c,v
retrieving revision 1.27
diff -u -p -r1.27 doas.c
--- doas.c 26 Jul 2015 22:44:33 -0000 1.27
+++ doas.c 28 Jul 2015 13:02:31 -0000
@@ -256,8 +256,10 @@ copyenv(const char **oldenvp, struct rul
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--;
}
}
}