case PERM_SUDOERS:
/* assume euid == ROOT_UID, ruid == user */
- if (setresgid(-1, SUDOERS_GID, -1))
- error(1, "unable to change to sudoers gid");
+ if (setresgid(-1, SUDOERS_GID, -1)) {
+ errstr = "unable to change to sudoers gid";
+ goto bad;
+ }
/*
* If SUDOERS_UID == ROOT_UID and SUDOERS_MODE
case PERM_SUDOERS:
/* assume euid == ROOT_UID, ruid == user */
- if (setregid(-1, SUDOERS_GID))
- error(1, "unable to change to sudoers gid");
+ if (setregid(-1, SUDOERS_GID)) {
+ errstr = "unable to change to sudoers gid";
+ goto bad;
+ }
/*
* If SUDOERS_UID == ROOT_UID and SUDOERS_MODE
break;
case PERM_SUDOERS:
- if (setegid(SUDOERS_GID))
- error(1, "unable to change to sudoers gid");
+ if (setegid(SUDOERS_GID)) {
+ errstr = "unable to change to sudoers gid";
+ goto bad;
+ }
/*
* If SUDOERS_UID == ROOT_UID and SUDOERS_MODE