static int
checkconfig(const char *confpath, int argc, char **argv,
static int
checkconfig(const char *confpath, int argc, char **argv,
- uid_t uid, gid_t *groups, int ngroups, uid_t target) {
+ uid_t uid, gid_t *groups, int ngroups, uid_t target)
+{
if (permit(uid, groups, ngroups, &rule, target, argv[0],
(const char **)argv + 1)) {
printf("permit%s\n", (rule->options & NOPASS) ? " nopass" : "");
if (permit(uid, groups, ngroups, &rule, target, argv[0],
(const char **)argv + 1)) {
printf("permit%s\n", (rule->options & NOPASS) ? " nopass" : "");
- if (confpath)
- exit(!checkconfig(confpath, argc, argv, uid, groups, ngroups,
- target));
+ 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 */
parseconfig("/etc/doas.conf", 1);
/* cmdline is used only for logging, no need to abort on truncate */