summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2013-04-10 16:40:40 +0000
committerMike Frysinger <vapier@gentoo.org>2013-04-10 16:40:40 +0000
commitb71c36c2559b9bff70e6021e880e590e194d0405 (patch)
treedb36d152c2bad52f45dc63758ba02ffefe42f9e6 /sys-libs/glibc/files
parentdetect systemd at runtime and try not to fail if it's not found, this makes p... (diff)
downloadhistorical-b71c36c2559b9bff70e6021e880e590e194d0405.tar.gz
historical-b71c36c2559b9bff70e6021e880e590e194d0405.tar.bz2
historical-b71c36c2559b9bff70e6021e880e590e194d0405.zip
Add USE=suid to control pt_chown setuid behavior #465308 by Nikoli.
Package-Manager: portage-2.2.0_alpha170/cvs/Linux x86_64 Manifest-Sign-Key: 0xFB7C4156
Diffstat (limited to 'sys-libs/glibc/files')
-rw-r--r--sys-libs/glibc/files/eblits/pkg_preinst.eblit13
-rw-r--r--sys-libs/glibc/files/eblits/src_install.eblit7
2 files changed, 18 insertions, 2 deletions
diff --git a/sys-libs/glibc/files/eblits/pkg_preinst.eblit b/sys-libs/glibc/files/eblits/pkg_preinst.eblit
index b57205f45259..cd0f075ab270 100644
--- a/sys-libs/glibc/files/eblits/pkg_preinst.eblit
+++ b/sys-libs/glibc/files/eblits/pkg_preinst.eblit
@@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/pkg_preinst.eblit,v 1.8 2013/02/09 05:39:21 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/pkg_preinst.eblit,v 1.9 2013/04/10 16:40:28 vapier Exp $
# Simple test to make sure our new glibc isnt completely broken.
# Make sure we don't test with statically built binaries since
@@ -46,4 +46,15 @@ eblit-glibc-pkg_preinst() {
[[ ${ROOT} != "/" ]] && return 0
[[ -d ${D}/$(get_libdir) ]] || return 0
glibc_sanity_check
+
+ # Make sure devpts is mounted correctly for use w/out setuid pt_chown.
+ if ! use suid ; then
+ if awk '$3 == "devpts" && $4 ~ /[, ]gid=5[, ]/ { exit 1 }' /proc/mounts ; then
+ eerror "In order to use glibc with USE=-suid, you must make sure that"
+ eerror "you have devpts mounted at /dev/pts with the gid=5 option."
+ eerror "Openrc should do this for you, so you should check /etc/fstab"
+ eerror "and make sure you do not have any invalid settings there."
+ die "mount & fix your /dev/pts settings"
+ fi
+ fi
}
diff --git a/sys-libs/glibc/files/eblits/src_install.eblit b/sys-libs/glibc/files/eblits/src_install.eblit
index 73e0dffc8546..8d3f89fd1d40 100644
--- a/sys-libs/glibc/files/eblits/src_install.eblit
+++ b/sys-libs/glibc/files/eblits/src_install.eblit
@@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/src_install.eblit,v 1.28 2013/04/05 00:25:16 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/src_install.eblit,v 1.29 2013/04/10 16:40:28 vapier Exp $
toolchain-glibc_src_install() {
local GBUILDDIR
@@ -105,6 +105,11 @@ toolchain-glibc_src_install() {
fi
done
+ # With devpts under Linux mounted properly, we do not need the pt_chown
+ # binary to be setuid. This is because the default owners/perms will be
+ # exactly what we want.
+ use suid || find "${D}" -name pt_chown -exec chmod -s {} +
+
#################################################################
# EVERYTHING AFTER THIS POINT IS FOR NATIVE GLIBC INSTALLS ONLY #
# Make sure we install some symlink hacks so that when we build