aboutsummaryrefslogtreecommitdiffstats
path: root/main/bash/privmode-setuid-fail.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-06-20 13:32:27 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2014-06-20 13:32:27 +0200
commita7d689678a9c8f50ddb81af366bde03a47164f40 (patch)
treeb23693f53f587221e0ed35fc7b43e5d441a52afd /main/bash/privmode-setuid-fail.patch
parent101c1d4f70f18ff6a77b88fa67bef2792f063570 (diff)
downloadaports-a7d689678a9c8f50ddb81af366bde03a47164f40.tar.bz2
aports-a7d689678a9c8f50ddb81af366bde03a47164f40.tar.xz
main/bash: upgrade to 4.3.018 and update the suid patch
Diffstat (limited to 'main/bash/privmode-setuid-fail.patch')
-rw-r--r--main/bash/privmode-setuid-fail.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/main/bash/privmode-setuid-fail.patch b/main/bash/privmode-setuid-fail.patch
new file mode 100644
index 0000000000..059857d0bf
--- /dev/null
+++ b/main/bash/privmode-setuid-fail.patch
@@ -0,0 +1,29 @@
+*** ../bash-4.3-patched/shell.c 2014-01-14 08:04:32.000000000 -0500
+--- shell.c 2014-06-06 16:29:01.000000000 -0400
+***************
+*** 1227,1232 ****
+ disable_priv_mode ()
+ {
+! setuid (current_user.uid);
+! setgid (current_user.gid);
+ current_user.euid = current_user.uid;
+ current_user.egid = current_user.gid;
+--- 1229,1246 ----
+ disable_priv_mode ()
+ {
+! int e;
+!
+! if (setuid (current_user.uid) < 0)
+! {
+! e = errno;
+! sys_error (_("cannot set uid to %d: effective uid %d"), current_user.uid, current_user.euid);
+! #if defined (EXIT_ON_SETUID_FAILURE)
+! if (e == EAGAIN)
+! exit (e);
+! #endif
+! }
+! if (setgid (current_user.gid) < 0)
+! sys_error (_("cannot set gid to %d: effective gid %d"), current_user.gid, current_user.egid);
+!
+ current_user.euid = current_user.uid;
+ current_user.egid = current_user.gid;