2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 22:35:10 +00:00

Use debug logging instead of ignore_result() where possible.

This commit is contained in:
Todd C. Miller
2017-05-12 10:02:18 -06:00
parent d979898e71
commit a842913aa7
5 changed files with 72 additions and 18 deletions

View File

@@ -1181,8 +1181,13 @@ restore_perms(void)
*/
if (OID(euid) == ROOT_UID) {
/* setuid() may not set the saved ID unless the euid is ROOT_UID */
if (ID(euid) != ROOT_UID)
ignore_result(setreuid(-1, ROOT_UID));
if (ID(euid) != ROOT_UID) {
if (setreuid(-1, ROOT_UID) != 0) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_ERRNO,
"setreuid() [%d, %d] -> [-1, %d)", (int)state->ruid,
(int)state->euid, ROOT_UID);
}
}
if (setuid(ROOT_UID)) {
sudo_warn("setuid() [%d, %d] -> %d)", (int)state->ruid,
(int)state->euid, ROOT_UID);