* [gentoo-commits] repo/gentoo:master commit in: sys-libs/glibc/files/, sys-libs/glibc/
@ 2020-05-12 20:44 Andreas K. Hüttel
0 siblings, 0 replies; 2+ messages in thread
From: Andreas K. Hüttel @ 2020-05-12 20:44 UTC (permalink / raw
To: gentoo-commits
commit: e5e772b10ee7d0329a5eb0618a914ed9c620379d
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Tue May 12 20:36:35 2020 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Tue May 12 20:43:45 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e5e772b1
sys-libs/glibc: Use etc files from FILESDIR instead of patchset
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
sys-libs/glibc/files/host.conf-1 | 24 +++++++++++
sys-libs/glibc/files/nscd-1 | 85 +++++++++++++++++++++++++++++++++++++
sys-libs/glibc/glibc-2.31-r3.ebuild | 13 +++---
sys-libs/glibc/glibc-9999.ebuild | 13 +++---
4 files changed, 123 insertions(+), 12 deletions(-)
diff --git a/sys-libs/glibc/files/host.conf-1 b/sys-libs/glibc/files/host.conf-1
new file mode 100644
index 00000000000..4c58e52d6b3
--- /dev/null
+++ b/sys-libs/glibc/files/host.conf-1
@@ -0,0 +1,24 @@
+# /etc/host.conf:
+# $Header: /var/cvsroot/gentoo/src/patchsets/glibc/extra/etc/host.conf,v 1.1 2006/09/29 23:52:23 vapier Exp $
+
+# The file /etc/host.conf contains configuration information specific to
+# the resolver library. It should contain one configuration keyword per
+# line, followed by appropriate configuration information. The keywords
+# recognized are order, trim, mdns, multi, nospoof, spoof, and reorder.
+
+
+
+# This keyword specifies how host lookups are to be performed. It
+# should be followed by one or more lookup methods, separated by
+# commas. Valid methods are bind, hosts, and nis.
+#
+order hosts, bind
+
+
+# Valid values are on and off. If set to on, the resolv+ library
+# will return all valid addresses for a host that appears in the
+# /etc/hosts file, instead of only the first. This is off by
+# default, as it may cause a substantial performance loss at sites
+# with large hosts files.
+#
+multi off
diff --git a/sys-libs/glibc/files/nscd-1 b/sys-libs/glibc/files/nscd-1
new file mode 100644
index 00000000000..f69c8e2eacd
--- /dev/null
+++ b/sys-libs/glibc/files/nscd-1
@@ -0,0 +1,85 @@
+#!/sbin/openrc-run
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+description="The 'Name Service Cache Daemon' is a daemon that provides a cache"
+description="${description} for the most common name service requests"
+
+extra_started_commands="flush_all flush_hosts flush_group flush_passwd flush_netgroup flush_services"
+
+description_flush_all="Will invalidate hosts, group, passwd, netgroup and services cache"
+description_flush_hosts="Will invalidate hosts cache"
+description_flush_group="Will invalidate group cache"
+description_flush_passwd="Will invalidate passwd cache"
+description_flush_netgroup="Will invalidate netgroup cache"
+description_flush_services="Will invalidate services cache"
+
+pidfile="/run/nscd/nscd.pid"
+command="/usr/sbin/nscd"
+
+depend() {
+ use dns ldap net slapd logger
+}
+
+checkconfig() {
+ if [ ! -d /run/nscd ] ; then
+ checkpath -d -m 755 /run/nscd
+ fi
+
+ if [ -z "${NSCD_PERMS_OK}" ] && [ "$(stat -c %a /run/nscd)" != "755" ] ; then
+ ewarn "nscd run dir is not world readable, you should reset the perms:"
+ ewarn "chmod 755 /run/nscd"
+ ewarn "chmod a+rw /run/nscd/socket"
+ ewarn "To disable this warning, set 'NSCD_PERMS_OK' in /etc/conf.d/nscd"
+ fi
+
+ if grep -qs '^[[:space:]]*persistent\>' /etc/nscd.conf ; then
+ checkpath -d -m 700 /var/db/nscd
+ fi
+}
+
+_flush() {
+ local table=$1
+
+ ebegin "Flushing ${table} table"
+ ${command} --invalidate ${table}
+ eend $?
+}
+
+flush_all() {
+ local has_errors=0
+
+ ebegin "Flushing all caches"
+
+ local table=
+ for table in passwd group hosts netgroup services; do
+ ${command} --invalidate ${table}
+ [ $? -ne 0 ] && has_errors=1
+ done
+
+ eend ${has_errors}
+}
+
+flush_hosts() {
+ _flush hosts
+}
+
+flush_group() {
+ _flush group
+}
+
+flush_passwd() {
+ _flush passwd
+}
+
+flush_netgroup() {
+ _flush netgroup
+}
+
+flush_services() {
+ _flush services
+}
+
+start_pre() {
+ checkconfig
+}
diff --git a/sys-libs/glibc/glibc-2.31-r3.ebuild b/sys-libs/glibc/glibc-2.31-r3.ebuild
index b11334fe86e..c05055b8811 100644
--- a/sys-libs/glibc/glibc-2.31-r3.ebuild
+++ b/sys-libs/glibc/glibc-2.31-r3.ebuild
@@ -1313,11 +1313,15 @@ glibc_do_src_install() {
# Install misc network config files
insinto /etc
- doins nscd/nscd.conf posix/gai.conf nss/nsswitch.conf
- doins "${WORKDIR}"/extra/etc/*.conf
+ doins posix/gai.conf nss/nsswitch.conf
+
+ # Gentoo-specific
+ newins "${FILESDIR}"/host.conf-1 host.conf
if use nscd ; then
- doinitd "$(prefixify_ro "${WORKDIR}"/extra/etc/nscd)"
+ doins nscd/nscd.conf
+
+ newinitd "$(prefixify_ro "${FILESDIR}"/nscd-1)" nscd
local nscd_args=(
-e "s:@PIDFILE@:$(strings "${ED}"/usr/sbin/nscd | grep nscd.pid):"
@@ -1327,9 +1331,6 @@ glibc_do_src_install() {
systemd_dounit nscd/nscd.service
systemd_newtmpfilesd nscd/nscd.tmpfiles nscd.conf
- else
- # Do this since extra/etc/*.conf above might have nscd.conf.
- rm -f "${ED}"/etc/nscd.conf
fi
echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00glibc
diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild
index 32cac60af6e..cc1528ef61a 100644
--- a/sys-libs/glibc/glibc-9999.ebuild
+++ b/sys-libs/glibc/glibc-9999.ebuild
@@ -1316,11 +1316,15 @@ glibc_do_src_install() {
# Install misc network config files
insinto /etc
- doins nscd/nscd.conf posix/gai.conf nss/nsswitch.conf
- doins "${WORKDIR}"/extra/etc/*.conf
+ doins posix/gai.conf nss/nsswitch.conf
+
+ # Gentoo-specific
+ newins "${FILESDIR}"/host.conf-1 host.conf
if use nscd ; then
- doinitd "$(prefixify_ro "${WORKDIR}"/extra/etc/nscd)"
+ doins nscd/nscd.conf
+
+ newinitd "$(prefixify_ro "${FILESDIR}"/nscd-1)" nscd
local nscd_args=(
-e "s:@PIDFILE@:$(strings "${ED}"/usr/sbin/nscd | grep nscd.pid):"
@@ -1330,9 +1334,6 @@ glibc_do_src_install() {
systemd_dounit nscd/nscd.service
systemd_newtmpfilesd nscd/nscd.tmpfiles nscd.conf
- else
- # Do this since extra/etc/*.conf above might have nscd.conf.
- rm -f "${ED}"/etc/nscd.conf
fi
echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00glibc
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/glibc/files/, sys-libs/glibc/
@ 2021-12-01 15:09 Sam James
0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2021-12-01 15:09 UTC (permalink / raw
To: gentoo-commits
commit: 6c160db5f224ffa6d45c54ffb2636047d567f804
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 1 15:07:42 2021 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Dec 1 15:09:32 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6c160db5
sys-libs/glibc: make non-functional changes to clone3 patch
Making it conditional based on a #define so that we can
easily unconditionally apply it.
Signed-off-by: Sam James <sam <AT> gentoo.org>
... glibc-2.34-make-clone3-syscall-optional.patch} | 38 ++++++++++++++--------
sys-libs/glibc/glibc-2.34-r3.ebuild | 10 ++++--
2 files changed, 31 insertions(+), 17 deletions(-)
diff --git a/sys-libs/glibc/files/glibc-2.34-disable-clone3-syscall.patch b/sys-libs/glibc/files/glibc-2.34-make-clone3-syscall-optional.patch
similarity index 53%
rename from sys-libs/glibc/files/glibc-2.34-disable-clone3-syscall.patch
rename to sys-libs/glibc/files/glibc-2.34-make-clone3-syscall-optional.patch
index 3c65a125c3b4..bbc6cabb463d 100644
--- a/sys-libs/glibc/files/glibc-2.34-disable-clone3-syscall.patch
+++ b/sys-libs/glibc/files/glibc-2.34-make-clone3-syscall-optional.patch
@@ -1,6 +1,14 @@
+From 22afb7abbfa0e2d4d168dcd2844aa9935a71cb37 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Wed, 1 Dec 2021 14:58:40 +0000
+Subject: [PATCH] clone-internal.c: disable use of clone3 conditinally
+
We're disabling clone3 for now _CONDITIONALLY_ (not by default) to allow
compatibility with applications using older Electron.
+Use -DGENTOO_USE_CLONE3 to enable clone3 for now. In future, we will
+revert back to always using clone3.
+
This was impacting e.g. Discord and Skype. This patch stops glibc from using
clone3 internally (which is the only real use of it) and falls back to the old
behaviour.
@@ -16,23 +24,25 @@ https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/glibc/plain/debian/pat
This is the same as the patch that was considered but ultimately rejected
for 2.34 because Docker got sorted out in time:
https://patchwork.ozlabs.org/project/glibc/patch/87eebkf8ph.fsf@oldenburg.str.redhat.com/.
+
+Signed-off-by: Sam James <sam@gentoo.org>
+---
+ sysdeps/unix/sysv/linux/clone-internal.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sysdeps/unix/sysv/linux/clone-internal.c b/sysdeps/unix/sysv/linux/clone-internal.c
+index 979f7880be..c5566daf73 100644
--- a/sysdeps/unix/sysv/linux/clone-internal.c
+++ b/sysdeps/unix/sysv/linux/clone-internal.c
-@@ -48,17 +48,6 @@
+@@ -48,7 +48,7 @@ __clone_internal (struct clone_args *cl_args,
int (*func) (void *arg), void *arg)
{
int ret;
-#ifdef HAVE_CLONE3_WRAPPER
-- /* Try clone3 first. */
-- int saved_errno = errno;
-- ret = __clone3 (cl_args, sizeof (*cl_args), func, arg);
-- if (ret != -1 || errno != ENOSYS)
-- return ret;
--
-- /* NB: Restore errno since errno may be checked against non-zero
-- return value. */
-- __set_errno (saved_errno);
--#endif
-
- /* Map clone3 arguments to clone arguments. NB: No need to check
- invalid clone3 specific bits in flags nor exit_signal since this
++#if defined(HAVE_CLONE3_WRAPPER) && defined(GENTOO_USE_CLONE3)
+ /* Try clone3 first. */
+ int saved_errno = errno;
+ ret = __clone3 (cl_args, sizeof (*cl_args), func, arg);
+--
+2.34.1
+
diff --git a/sys-libs/glibc/glibc-2.34-r3.ebuild b/sys-libs/glibc/glibc-2.34-r3.ebuild
index d98d8a72fba5..7053b85282f1 100644
--- a/sys-libs/glibc/glibc-2.34-r3.ebuild
+++ b/sys-libs/glibc/glibc-2.34-r3.ebuild
@@ -791,11 +791,15 @@ src_prepare() {
einfo "Done."
fi
- if ! use clone3 ; then
+ # Apply patch to allow conditional disabling of clone3
+ eapply "${FILESDIR}"/${PN}-2.34-make-clone3-syscall-optional.patch
+
+ if use clone3 ; then
+ append-cppflags -DGENTOO_USE_CLONE3
+ else
+ # See e.g. bug #827386, bug #819045.
elog "Disabling the clone3 syscall for compatibility with older Electron apps."
elog "Please re-enable this flag before filing bugs!"
- # See e.g. bug #827386, bug #819045.
- eapply "${FILESDIR}"/${P}-disable-clone3-syscall.patch
fi
default
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-01 15:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-01 15:09 [gentoo-commits] repo/gentoo:master commit in: sys-libs/glibc/files/, sys-libs/glibc/ Sam James
-- strict thread matches above, loose matches on Subject: below --
2020-05-12 20:44 Andreas K. Hüttel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox