--- embedaddon/sudo/plugins/sudoers/set_perms.c 2013/10/14 07:56:35 1.1.1.5 +++ embedaddon/sudo/plugins/sudoers/set_perms.c 2014/06/15 16:12:54 1.1.1.6 @@ -79,9 +79,9 @@ static struct perm_state perm_stack[PERM_STACK_MAX]; static int perm_stack_depth = 0; #undef ID -#define ID(x) (state->x == ostate->x ? -1 : state->x) +#define ID(x) (state->x == ostate->x ? (uid_t)-1 : state->x) #undef OID -#define OID(x) (ostate->x == state->x ? -1 : ostate->x) +#define OID(x) (ostate->x == state->x ? (uid_t)-1 : ostate->x) void rewind_perms(void) @@ -359,8 +359,10 @@ set_perms(int perm) perm_stack_depth++; debug_return_bool(1); bad: - warningx("%s: %s", _(errstr), - errno == EAGAIN ? _("too many processes") : strerror(errno)); + if (errno == EAGAIN) + warningx(U_("%s: %s"), U_(errstr), U_("too many processes")); + else + warning("%s", U_(errstr)); if (noexit) debug_return_bool(0); exit(1); @@ -696,8 +698,10 @@ set_perms(int perm) perm_stack_depth++; debug_return_bool(1); bad: - warningx("%s: %s", _(errstr), - errno == EAGAIN ? _("too many processes") : strerror(errno)); + if (errno == EAGAIN) + warningx(U_("%s: %s"), U_(errstr), U_("too many processes")); + else + warning("%s", U_(errstr)); if (noexit) debug_return_bool(0); exit(1); @@ -887,7 +891,7 @@ set_perms(int perm) if (ostate->euid != ROOT_UID) { if (setreuid(-1, ROOT_UID)) { snprintf(errbuf, sizeof(errbuf), - "PERM_ROOT: setreuid(-1, %d)", PERM_ROOT); + "PERM_ROOT: setreuid(-1, %d)", ROOT_UID); goto bad; } } @@ -1053,8 +1057,10 @@ set_perms(int perm) perm_stack_depth++; debug_return_bool(1); bad: - warningx("%s: %s", _(errstr), - errno == EAGAIN ? _("too many processes") : strerror(errno)); + if (errno == EAGAIN) + warningx(U_("%s: %s"), U_(errstr), U_("too many processes")); + else + warning("%s", U_(errstr)); if (noexit) debug_return_bool(0); exit(1); @@ -1347,8 +1353,10 @@ set_perms(int perm) perm_stack_depth++; debug_return_bool(1); bad: - warningx("%s: %s", _(errstr), - errno == EAGAIN ? _("too many processes") : strerror(errno)); + if (errno == EAGAIN) + warningx(U_("%s: %s"), U_(errstr), U_("too many processes")); + else + warning("%s", U_(errstr)); if (noexit) debug_return_bool(0); exit(1); @@ -1513,8 +1521,10 @@ set_perms(int perm) perm_stack_depth++; debug_return_bool(1); bad: - warningx("%s: %s", _(errstr), - errno == EAGAIN ? _("too many processes") : strerror(errno)); + if (errno == EAGAIN) + warningx(U_("%s: %s"), U_(errstr), U_("too many processes")); + else + warning("%s", U_(errstr)); if (noexit) debug_return_bool(0); exit(1);