[arch-commits] Commit in bash/trunk (3 files)
Bartłomiej Piotrowski
bpiotrowski at nymeria.archlinux.org
Wed Jun 11 09:27:17 UTC 2014
Date: Wednesday, June 11, 2014 @ 11:27:17
Author: bpiotrowski
Revision: 214976
upgpkg: bash 4.3.018-3
use upstream patch for setuid() bug (FS#40663)
Added:
bash/trunk/privmode-setuid-fail.patch
Modified:
bash/trunk/PKGBUILD
Deleted:
bash/trunk/bash-4.3-fix-setuid.patch
----------------------------+
PKGBUILD | 8 ++++----
bash-4.3-fix-setuid.patch | 31 -------------------------------
privmode-setuid-fail.patch | 29 +++++++++++++++++++++++++++++
3 files changed, 33 insertions(+), 35 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2014-06-11 09:25:15 UTC (rev 214975)
+++ PKGBUILD 2014-06-11 09:27:17 UTC (rev 214976)
@@ -7,7 +7,7 @@
_basever=4.3
_patchlevel=018
pkgver=$_basever.$_patchlevel
-pkgrel=2
+pkgrel=3
pkgdesc='The GNU Bourne Again shell'
arch=('i686' 'x86_64')
license=('GPL')
@@ -23,7 +23,7 @@
dot.bash_logout
system.bashrc
system.bash_logout
- bash-4.3-fix-setuid.patch)
+ privmode-setuid-fail.patch)
if [[ $((10#${_patchlevel})) -gt 0 ]]; then
for (( _p=1; _p<=$((10#${_patchlevel})); _p++ )); do
@@ -40,7 +40,7 @@
done
# http://hmarco.org/bugs/bash_4.3-setuid-bug.html (FS#40663)
- patch -p0 -i ../bash-4.3-fix-setuid.patch
+ patch -p0 -i ../privmode-setuid-fail.patch
}
build() {
@@ -83,7 +83,7 @@
'42f4400ed2314bd7519c020d0187edc5'
'561949793177116b7be29a07c385ba8b'
'472f536d7c9e8250dc4568ec4cfaf294'
- 'c87b8d9e12d628eac829dc08f4607a20'
+ 'a577d42e38249d298d6a8d4bf2823883'
'1ab682b4e36afa4cf1b426aa7ac81c0d'
'SKIP'
'8fc22cf50ec85da00f6af3d66f7ddc1b'
Deleted: bash-4.3-fix-setuid.patch
===================================================================
--- bash-4.3-fix-setuid.patch 2014-06-11 09:25:15 UTC (rev 214975)
+++ bash-4.3-fix-setuid.patch 2014-06-11 09:27:17 UTC (rev 214976)
@@ -1,31 +0,0 @@
-diff --git shell.c shell.c
-index bbc8a66..5bfd466 100644
---- shell.c
-+++ shell.c
-@@ -1226,8 +1226,12 @@ uidget ()
- void
- disable_priv_mode ()
- {
-- setuid (current_user.uid);
-- setgid (current_user.gid);
-+
-+ if( (setuid (current_user.uid) !=0) || (setgid (current_user.gid) != 0) ){
-+ report_error("Drop privileges failed!!\n");
-+ exit(EX_DROPFAIL);
-+ }
-+
- current_user.euid = current_user.uid;
- current_user.egid = current_user.gid;
- }
-diff --git shell.h shell.h
-index 243e467..c3625be 100644
---- shell.h
-+++ shell.h
-@@ -72,6 +72,7 @@ extern int EOF_Reached;
- #define EX_REDIRFAIL 259 /* redirection failed */
- #define EX_BADASSIGN 260 /* variable assignment error */
- #define EX_EXPFAIL 261 /* word expansion failed */
-+#define EX_DROPFAIL 262 /* Drop privileges failed */
-
- /* Flag values that control parameter pattern substitution. */
- #define MATCH_ANY 0x000
Added: privmode-setuid-fail.patch
===================================================================
--- privmode-setuid-fail.patch (rev 0)
+++ privmode-setuid-fail.patch 2014-06-11 09:27:17 UTC (rev 214976)
@@ -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;
More information about the arch-commits
mailing list