From 334ed65e2765062a449897d70925255929eae8a8 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Fri, 2 Dec 2016 12:08:26 +0000 Subject: 40068: Abort execution when setuid/setgid fail. The incumbent code would print an error message and continue execution with the previous uid/gid values, not even setting lastval: % UID=42 id -u; echo $? zsh: failed to change user ID: operation not permitted 1000 0 % --- Src/params.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Src') diff --git a/Src/params.c b/Src/params.c index 21a910190..c64d7486b 100644 --- a/Src/params.c +++ b/Src/params.c @@ -4077,7 +4077,7 @@ uidsetfn(UNUSED(Param pm), zlong x) { #ifdef HAVE_SETUID if (setuid((uid_t)x)) - zwarn("failed to change user ID: %e", errno); + zerr("failed to change user ID: %e", errno); #endif } @@ -4098,7 +4098,7 @@ euidsetfn(UNUSED(Param pm), zlong x) { #ifdef HAVE_SETEUID if (seteuid((uid_t)x)) - zwarn("failed to change effective user ID: %e", errno); + zerr("failed to change effective user ID: %e", errno); #endif } @@ -4119,7 +4119,7 @@ gidsetfn(UNUSED(Param pm), zlong x) { #ifdef HAVE_SETUID if (setgid((gid_t)x)) - zwarn("failed to change group ID: %e", errno); + zerr("failed to change group ID: %e", errno); #endif } @@ -4140,7 +4140,7 @@ egidsetfn(UNUSED(Param pm), zlong x) { #ifdef HAVE_SETEUID if (setegid((gid_t)x)) - zwarn("failed to change effective group ID: %e", errno); + zerr("failed to change effective group ID: %e", errno); #endif } -- cgit 1.4.1