checkconfig(const char *confpath, int argc, char **argv,
    uid_t uid, gid_t *groups, int ngroups, uid_t target)
{
	struct rule *rule;
        int status;

	#if defined(__linux__) || defined(__FreeBSD__)
	status = setresuid(uid, uid, uid);
	#else
	status = setreuid(uid, uid);
	#endif
	if (status == -1)
	{
		printf("doas: Unable to set UID\n");
		exit(1);
	}
	parseconfig(confpath, 0);
	if (!argc)
		exit(0);

	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);
	}
}
checkconfig(const char *confpath, int argc, char **argv,
    uid_t uid, gid_t *groups, int ngroups, uid_t target)
{
	struct rule *rule;
        int status;

	#if defined(__linux__) || defined(__FreeBSD__)
	status = setresuid(uid, uid, uid);
	#else
	status = setreuid(uid, uid);
	#endif
	if (status == -1)
	{
		printf("doas: Unable to set UID\n");
		exit(1);
	}
	parseconfig(confpath, 0);
	if (!argc)
		exit(0);

	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);
	}
}