=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/doas/doas.c,v retrieving revision 1.23 retrieving revision 1.24 diff -c -r1.23 -r1.24 *** src/usr.bin/doas/doas.c 2015/07/26 19:08:17 1.23 --- src/usr.bin/doas/doas.c 2015/07/26 19:14:46 1.24 *************** *** 1,4 **** ! /* $OpenBSD: doas.c,v 1.23 2015/07/26 19:08:17 zhuk Exp $ */ /* * Copyright (c) 2015 Ted Unangst * --- 1,4 ---- ! /* $OpenBSD: doas.c,v 1.24 2015/07/26 19:14:46 tedu Exp $ */ /* * Copyright (c) 2015 Ted Unangst * *************** *** 284,290 **** static int checkconfig(const char *confpath, int argc, char **argv, ! uid_t uid, gid_t *groups, int ngroups, uid_t target) { struct rule *rule; setresuid(uid, uid, uid); --- 284,291 ---- static int checkconfig(const char *confpath, int argc, char **argv, ! uid_t uid, gid_t *groups, int ngroups, uid_t target) ! { struct rule *rule; setresuid(uid, uid, uid); *************** *** 295,304 **** if (permit(uid, groups, ngroups, &rule, target, argv[0], (const char **)argv + 1)) { printf("permit%s\n", (rule->options & NOPASS) ? " nopass" : ""); ! return 1; } else { printf("deny\n"); ! return 0; } } --- 296,305 ---- if (permit(uid, groups, ngroups, &rule, target, argv[0], (const char **)argv + 1)) { printf("permit%s\n", (rule->options & NOPASS) ? " nopass" : ""); ! exit(0); } else { printf("deny\n"); ! exit(1); } } *************** *** 369,377 **** argc = 1; } ! if (confpath) ! exit(!checkconfig(confpath, argc, argv, uid, groups, ngroups, ! target)); parseconfig("/etc/doas.conf", 1); /* cmdline is used only for logging, no need to abort on truncate */ --- 370,381 ---- argc = 1; } ! if (confpath) { ! checkconfig(confpath, argc, argv, uid, groups, ngroups, ! target); ! exit(1); /* fail safe */ ! } ! parseconfig("/etc/doas.conf", 1); /* cmdline is used only for logging, no need to abort on truncate */