public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/musl/files/
@ 2015-08-31  3:06 Anthony G. Basile
  0 siblings, 0 replies; 7+ messages in thread
From: Anthony G. Basile @ 2015-08-31  3:06 UTC (permalink / raw
  To: gentoo-commits

commit:     4311d97f2a466e82077d04130e20a4eb6e49ce80
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 31 03:10:44 2015 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Mon Aug 31 03:10:44 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4311d97f

sys-libs/musl: remove old ldconfig script.

Package-Manager: portage-2.2.20.1

 sys-libs/musl/files/ldconfig | 143 -------------------------------------------
 1 file changed, 143 deletions(-)

diff --git a/sys-libs/musl/files/ldconfig b/sys-libs/musl/files/ldconfig
deleted file mode 100644
index be0aa2b..0000000
--- a/sys-libs/musl/files/ldconfig
+++ /dev/null
@@ -1,143 +0,0 @@
-#!/bin/bash -e
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-ROOT="/"
-
-LDSO_CONF="/etc/ld.so.conf"
-if [[ ! -e $LDSO_CONF ]]; then
-	echo "$LDSO_CONF not found" >&2
-	exit 1
-fi
-
-LDSO_CONF_DIR=$(dirname $LDSO_CONF)
-
-VERBOSE=0
-
-UPDATE_LINKS=1
-
-get_options() {
-	while getopts "vnNXf:C:r:p" opt "$@"; do
-		case $opt in
-		v)
-			echo "ldconfig for musl in Gentoo"
-			VERBOSE=1
-			;;
-		r)
-			ROOT=$OPTARG
-			;;
-		f)
-			LDSO_CONF=$OPTARG
-			;;
-		X)
-			UPDATE_LINKS=0
-			;;
-		\?)
-			echo "Invalid option: -$opt" >&2
-			exit 1
-			;;
-		n|N|C|p)
-			echo "Unimplemented option: -$opt" >&2
-			exit 1
-			;;
-		esac
-	done
-
-	if [[ $UPDATE_LINKS == 1 ]]; then
-		echo "Updating links is not implemented."
-	fi
-}
-
-
-repeated() {
-	local l=$1
-	local drs="${@:2}"
-	for m in $drs; do
-		[[ $m == $l ]] && return 0
-	done
-	return 1
-}
-
-expand() {
-	# We are assuming the ld.so.conf's 'include' is not recursive
-	local f line l
-	local glob="$LDSO_CONF_DIR/$1"
-	local drs="${@:2} "
-
-	for f in $glob; do
-		[[ ! -f $f ]] && continue
-		while read line; do
-			line=${line%%#*}
-			line=${line//:/ }
-			line=${line//,/ }
-			for l in $line; do
-				#We must add this whether or not the directory exists
-				repeated $l $drs && continue
-				drs+=" $l "
-			done
-		done < $f
-	done
-
-	echo $drs
-}
-
-read_ldso_conf() {
-	local drs=" "
-
-	while read line; do
-		# Sanitize the line - see ldconfig(8) for delimiters
-		# Note: bash read turns tabs into spaces and read already
-		# delimits on newlines with the default $IFS
-		line=${line%%#*}   # Remove comments
-		line=${line//:/ }  # Change colon delimiter to space
-		line=${line//,/ }  # Change comma delimiter to space
-
-		next=0
-		for l in $line; do
-			if [[ $next == 1 ]]; then
-				next=0
-				drs=$(expand $l $drs)
-			elif [[ $l == "include" ]]; then
-				next=1
-			else
-				# glibc's ldconfig silently skips non directories
-				if [[ -d $l ]]; then
-					repeated $l $drs && continue
-					drs+=" $l "
-				fi
-			fi
-		done
-	done < $1
-
-	echo $drs
-}
-
-sanitize() {
-	local drs=$@
-
-	repeated "/lib" $drs || drs="/lib $drs"
-	repeated "/usr/lib" $drs || drs="/usr/lib $drs"
-
-	echo $drs
-}
-
-get_options "$@"
-drs=$(read_ldso_conf "$LDSO_CONF")
-drs=$(sanitize $drs)
-
-LDSO_PATH=$(ls /lib/ld-musl-*.so.1)
-if [[ ! -e $LDSO_PATH ]]; then
-	echo "$LDSO_PATH not found" >&2
-	exit 1
-fi
-
-LDSO_ARCH=$(basename $LDSO_PATH)
-LDSO_NAME=${LDSO_ARCH%.so.1}
-ETC_LDSO_PATH=/etc/${LDSO_NAME}.path
-
-X=$(mktemp --tmpdir=/tmp ${LDSO_NAME}.XXXXXX)
-for d in $drs; do
-	echo $d >> $X
-done
-chmod 644 $X
-mv $X $ETC_LDSO_PATH


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/musl/files/
@ 2015-11-29  2:05 Anthony G. Basile
  0 siblings, 0 replies; 7+ messages in thread
From: Anthony G. Basile @ 2015-11-29  2:05 UTC (permalink / raw
  To: gentoo-commits

commit:     1d680e00176a356d41090d7493f99e85bb87ca59
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 29 02:12:03 2015 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sun Nov 29 02:12:30 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d680e00

sys-libs/musl: use short option for mktemp in ldconfig

Since busybox's mktemp doesn't take the long options --tmpdir=
we switch to the short option which works both for busybox and
for coreutils.

Package-Manager: portage-2.2.20.1

 sys-libs/musl/files/ldconfig.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys-libs/musl/files/ldconfig.in b/sys-libs/musl/files/ldconfig.in
index a292190..19c94d8 100644
--- a/sys-libs/musl/files/ldconfig.in
+++ b/sys-libs/musl/files/ldconfig.in
@@ -136,7 +136,7 @@ LDSO_ARCH=$(basename $LDSO_PATH)
 LDSO_NAME=${LDSO_ARCH%.so.1}
 ETC_LDSO_PATH=/etc/${LDSO_NAME}.path
 
-X=$(mktemp --tmpdir=/tmp ${LDSO_NAME}.XXXXXX)
+X=$(mktemp -p /tmp ${LDSO_NAME}.XXXXXX)
 for d in $drs; do
 	echo $d >> $X
 done


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/musl/files/
@ 2017-11-28 20:05 Anthony G. Basile
  0 siblings, 0 replies; 7+ messages in thread
From: Anthony G. Basile @ 2017-11-28 20:05 UTC (permalink / raw
  To: gentoo-commits

commit:     2f8aa26cbaafbf11cf92c861cfb3e1a57a3c5e67
Author:     Michael Mair-Keimberger <m.mairkeimberger <AT> gmail <DOT> com>
AuthorDate: Tue Nov 28 19:09:17 2017 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Tue Nov 28 20:05:07 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2f8aa26c

sys-libs/musl: remove unused patches/file

 sys-libs/musl/files/getent                   | 45 ------------------
 sys-libs/musl/files/musl-1.1.15-CVE.patch    | 68 ----------------------------
 sys-libs/musl/files/musl-1.1.15-assert.patch | 43 ------------------
 3 files changed, 156 deletions(-)

diff --git a/sys-libs/musl/files/getent b/sys-libs/musl/files/getent
deleted file mode 100644
index b7de424354b..00000000000
--- a/sys-libs/musl/files/getent
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/sh
-# This files is part of uClibc. 
-# Distributed under the terms of the Lesser GNU General Public License v2
-#
-# Closely (not perfectly) emulate the behavior of glibc's getent utility
-#
-#passwd|shadow|group|aliases|hosts|networks|ethers|netgroup|protocols|services|rpc
-# only returns the first match (by design)
-# dns based search is not supported (hosts,networks)
-# case-insensitive matches not supported (ethers; others?)
-# may return false-positives (hosts,protocols,rpc,services,ethers)
-
-[ -z "$PATH" ] && PATH="/bin:/usr/bin" || PATH="${PATH}:/bin:/usr/bin"
-export PATH
-
-file="/etc/$1"
-case $1 in
-	passwd|group)
-		match="^$2:\|^[^:]*:[^:]*:$2:" ;;
-	shadow)
-		match="^$2:" ;;
-	networks|netgroup)
-		match="^[[:space:]]*$2\>" ;;
-	hosts|protocols|rpc|services|ethers)
-		match="\<$2\>" ;;
-	aliases)
-		match="^[[:space:]]*$2[[:space:]]*:" ;;
-	""|-h|--help)
-		echo "USAGE: $0 database [key]"
-		exit 0 ;;
-	*)
-		echo "$0: Unknown database: $1" 1>&2
-		exit 1 ;;
-esac
-
-if [ ! -f "$file" ] ; then
-	echo "$0: Could not find database file for $1" 1>&2
-	exit 1
-fi
-
-if [ $# -eq 1 ] ; then
-	exec cat "$file"
-else
-	sed "s/#.*//; /$match/q; d" "$file" | grep . || exit 2
-fi

diff --git a/sys-libs/musl/files/musl-1.1.15-CVE.patch b/sys-libs/musl/files/musl-1.1.15-CVE.patch
deleted file mode 100644
index 64fbbdcd8eb..00000000000
--- a/sys-libs/musl/files/musl-1.1.15-CVE.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-From c3edc06d1e1360f3570db9155d6b318ae0d0f0f7 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Thu, 06 Oct 2016 22:34:58 +0000
-Subject: fix missing integer overflow checks in regexec buffer size computations
-
-most of the possible overflows were already ruled out in practice by
-regcomp having already succeeded performing larger allocations.
-however at least the num_states*num_tags multiplication can clearly
-overflow in practice. for safety, check them all, and use the proper
-type, size_t, rather than int.
-
-also improve comments, use calloc in place of malloc+memset, and
-remove bogus casts.
----
-diff --git a/src/regex/regexec.c b/src/regex/regexec.c
-index 16c5d0a..dd52319 100644
---- a/src/regex/regexec.c
-+++ b/src/regex/regexec.c
-@@ -34,6 +34,7 @@
- #include <wchar.h>
- #include <wctype.h>
- #include <limits.h>
-+#include <stdint.h>
- 
- #include <regex.h>
- 
-@@ -206,11 +207,24 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string,
- 
-   /* Allocate memory for temporary data required for matching.	This needs to
-      be done for every matching operation to be thread safe.  This allocates
--     everything in a single large block from the stack frame using alloca()
--     or with malloc() if alloca is unavailable. */
-+     everything in a single large block with calloc(). */
-   {
--    int tbytes, rbytes, pbytes, xbytes, total_bytes;
-+    size_t tbytes, rbytes, pbytes, xbytes, total_bytes;
-     char *tmp_buf;
-+
-+    /* Ensure that tbytes and xbytes*num_states cannot overflow, and that
-+     * they don't contribute more than 1/8 of SIZE_MAX to total_bytes. */
-+    if (num_tags > SIZE_MAX/(8 * sizeof(int) * tnfa->num_states))
-+      goto error_exit;
-+
-+    /* Likewise check rbytes. */
-+    if (tnfa->num_states+1 > SIZE_MAX/(8 * sizeof(*reach_next)))
-+      goto error_exit;
-+
-+    /* Likewise check pbytes. */
-+    if (tnfa->num_states > SIZE_MAX/(8 * sizeof(*reach_pos)))
-+      goto error_exit;
-+
-     /* Compute the length of the block we need. */
-     tbytes = sizeof(*tmp_tags) * num_tags;
-     rbytes = sizeof(*reach_next) * (tnfa->num_states + 1);
-@@ -221,10 +235,9 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string,
-       + (rbytes + xbytes * tnfa->num_states) * 2 + tbytes + pbytes;
- 
-     /* Allocate the memory. */
--    buf = xmalloc((unsigned)total_bytes);
-+    buf = calloc(total_bytes, 1);
-     if (buf == NULL)
-       return REG_ESPACE;
--    memset(buf, 0, (size_t)total_bytes);
- 
-     /* Get the various pointers within tmp_buf (properly aligned). */
-     tmp_tags = (void *)buf;
---
-cgit v0.9.0.3-65-g4555

diff --git a/sys-libs/musl/files/musl-1.1.15-assert.patch b/sys-libs/musl/files/musl-1.1.15-assert.patch
deleted file mode 100644
index d531d172764..00000000000
--- a/sys-libs/musl/files/musl-1.1.15-assert.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From e738b8cbe64b6dd3ed9f47b6d4cd7eb2c422b38d Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Tue, 30 Aug 2016 20:39:54 +0000
-Subject: restore _Noreturn to __assert_fail
-
-this reverts commit 2c1f8fd5da3306fd7c8a2267467e44eb61f12dd4. without
-the _Noreturn attribute, the compiler cannot use asserts to perform
-reachability/range analysis. this leads to missed optimizations and
-spurious warnings.
-
-the original backtrace problem that prompted the removal of _Noreturn
-was not clearly documented at the time, but it seems to happen only
-when libc was built without -g, which also breaks many other
-backtracing cases.
----
-diff --git a/include/assert.h b/include/assert.h
-index e679adb..d14ec94 100644
---- a/include/assert.h
-+++ b/include/assert.h
-@@ -16,7 +16,7 @@
- extern "C" {
- #endif
- 
--void __assert_fail (const char *, const char *, int, const char *);
-+_Noreturn void __assert_fail (const char *, const char *, int, const char *);
- 
- #ifdef __cplusplus
- }
-diff --git a/src/exit/assert.c b/src/exit/assert.c
-index e87442a..49b0dc3 100644
---- a/src/exit/assert.c
-+++ b/src/exit/assert.c
-@@ -1,7 +1,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- 
--void __assert_fail(const char *expr, const char *file, int line, const char *func)
-+_Noreturn void __assert_fail(const char *expr, const char *file, int line, const char *func)
- {
- 	fprintf(stderr, "Assertion failed: %s (%s: %s: %d)\n", expr, file, func, line);
- 	fflush(NULL);
---
-cgit v0.9.0.3-65-g4555


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/musl/files/
@ 2019-11-29 22:08 Aaron Bauman
  0 siblings, 0 replies; 7+ messages in thread
From: Aaron Bauman @ 2019-11-29 22:08 UTC (permalink / raw
  To: gentoo-commits

commit:     895257bb170e00475394a89e38cc8a0ab33025c7
Author:     Michael Mair-Keimberger <m.mairkeimberger <AT> gmail <DOT> com>
AuthorDate: Mon Nov 25 12:44:10 2019 +0000
Commit:     Aaron Bauman <bman <AT> gentoo <DOT> org>
CommitDate: Fri Nov 29 22:07:49 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=895257bb

sys-libs/musl: remove unused patch

Signed-off-by: Michael Mair-Keimberger <m.mairkeimberger <AT> gmail.com>
Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>

 .../musl/files/musl-1.1.20-fix-getaddrinfo.patch   | 51 ----------------------
 1 file changed, 51 deletions(-)

diff --git a/sys-libs/musl/files/musl-1.1.20-fix-getaddrinfo.patch b/sys-libs/musl/files/musl-1.1.20-fix-getaddrinfo.patch
deleted file mode 100644
index 28d4558b8b6..00000000000
--- a/sys-libs/musl/files/musl-1.1.20-fix-getaddrinfo.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From f381c118b2d4f7d914481d3cdc830ce41369b002 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Wed, 19 Sep 2018 18:03:22 -0400
-Subject: fix getaddrinfo regression with AI_ADDRCONFIG on some configurations
-
-despite not being documented to do so in the standard or Linux
-documentation, attempts to udp connect to 127.0.0.1 or ::1 generate
-EADDRNOTAVAIL when the loopback device is not configured and there is
-no default route for IPv6. this caused getaddrinfo with AI_ADDRCONFIG
-to fail with EAI_SYSTEM and EADDRNOTAVAIL on some no-IPv6
-configurations, rather than the intended behavior of detecting IPv6 as
-unsuppported and producing IPv4-only results.
-
-previously, only EAFNOSUPPORT was treated as unavailability of the
-address family being probed. instead, treat all errors related to
-inability to get an address or route as conclusive that the family
-being probed is unsupported, and only fail with EAI_SYSTEM on other
-errors.
-
-further improvements may be desirable, such as reporting EAI_AGAIN
-instead of EAI_SYSTEM for errors which are expected to be transient,
-but this patch should suffice to fix the serious regression.
----
- src/network/getaddrinfo.c | 11 ++++++++++-
- 1 file changed, 10 insertions(+), 1 deletion(-)
-
-diff --git a/src/network/getaddrinfo.c b/src/network/getaddrinfo.c
-index ba26847a..e33bfa28 100644
---- a/src/network/getaddrinfo.c
-+++ b/src/network/getaddrinfo.c
-@@ -76,7 +76,16 @@ int getaddrinfo(const char *restrict host, const char *restrict serv, const stru
- 				close(s);
- 				if (!r) continue;
- 			}
--			if (errno != EAFNOSUPPORT) return EAI_SYSTEM;
-+			switch (errno) {
-+			case EADDRNOTAVAIL:
-+			case EAFNOSUPPORT:
-+			case EHOSTUNREACH:
-+			case ENETDOWN:
-+			case ENETUNREACH:
-+				break;
-+			default:
-+				return EAI_SYSTEM;
-+			}
- 			if (family == tf[i]) return EAI_NONAME;
- 			family = tf[1-i];
- 		}
--- 
-cgit v1.2.1
-


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/musl/files/
@ 2021-05-02 14:36 Jory Pratt
  0 siblings, 0 replies; 7+ messages in thread
From: Jory Pratt @ 2021-05-02 14:36 UTC (permalink / raw
  To: gentoo-commits

commit:     1e3c5b806bde5ac553054d63b07029d3c16efeb9
Author:     Michael Mair-Keimberger <mmk <AT> levelnine <DOT> at>
AuthorDate: Sun May  2 12:00:16 2021 +0000
Commit:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
CommitDate: Sun May  2 14:36:12 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1e3c5b80

sys-libs/musl: remove unused patch

Closes: https://github.com/gentoo/gentoo/pull/20651
Package-Manager: Portage-3.0.18, Repoman-3.0.3
Signed-off-by: Michael Mair-Keimberger <mmk <AT> levelnine.at>
Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org>

 .../musl/files/musl-1.2.1-CVE-2020-28928.patch     | 114 ---------------------
 1 file changed, 114 deletions(-)

diff --git a/sys-libs/musl/files/musl-1.2.1-CVE-2020-28928.patch b/sys-libs/musl/files/musl-1.2.1-CVE-2020-28928.patch
deleted file mode 100644
index 9797e92ec42..00000000000
--- a/sys-libs/musl/files/musl-1.2.1-CVE-2020-28928.patch
+++ /dev/null
@@ -1,114 +0,0 @@
-https://bugs.gentoo.org/755695
-https://git.musl-libc.org/cgit/musl/patch/?id=3ab2a4e02682df1382955071919d8aa3c3ec40d4
-From 3ab2a4e02682df1382955071919d8aa3c3ec40d4 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Thu, 19 Nov 2020 17:12:43 -0500
-Subject: rewrite wcsnrtombs to fix buffer overflow and other bugs
-
-the original wcsnrtombs implementation, which has been largely
-untouched since 0.5.0, attempted to build input-length-limiting
-conversion on top of wcsrtombs, which only limits output length. as
-best I recall, this choice was made out of a mix of disdain over
-having yet another variant function to implement (added in POSIX 2008;
-not standard C) and preference not to switch things around and
-implement the wcsrtombs in terms of the more general new function,
-probably over namespace issues. the strategy employed was to impose
-output limits that would ensure the input limit wasn't exceeded, then
-finish up the tail character-at-a-time. unfortunately, none of that
-worked correctly.
-
-first, the logic in the wcsrtombs loop was wrong in that it could
-easily get stuck making no forward progress, by imposing an output
-limit too small to convert even one character.
-
-the character-at-a-time loop that followed was even worse. it made no
-effort to ensure that the converted multibyte character would fit in
-the remaining output space, only that there was a nonzero amount of
-output space remaining. it also employed an incorrect interpretation
-of wcrtomb's interface contract for converting the null character,
-thereby failing to act on end of input, and remaining space accounting
-was subject to unsigned wrap-around. together these errors allow
-unbounded overflow of the destination buffer, controlled by input
-length limit and input wchar_t string contents.
-
-given the extent to which this function was broken, it's plausible
-that most applications that would have been rendered exploitable were
-sufficiently broken not to be usable in the first place. however, it's
-also plausible that common (especially ASCII-only) inputs succeeded in
-the wcsrtombs loop, which mostly worked, while leaving the wildly
-erroneous code in the second loop exposed to particular non-ASCII
-inputs.
-
-CVE-2020-28928 has been assigned for this issue.
----
- src/multibyte/wcsnrtombs.c | 46 +++++++++++++++++++---------------------------
- 1 file changed, 19 insertions(+), 27 deletions(-)
-
-diff --git a/src/multibyte/wcsnrtombs.c b/src/multibyte/wcsnrtombs.c
-index 676932b5..95e25e70 100644
---- a/src/multibyte/wcsnrtombs.c
-+++ b/src/multibyte/wcsnrtombs.c
-@@ -1,41 +1,33 @@
- #include <wchar.h>
-+#include <limits.h>
-+#include <string.h>
- 
- size_t wcsnrtombs(char *restrict dst, const wchar_t **restrict wcs, size_t wn, size_t n, mbstate_t *restrict st)
- {
--	size_t l, cnt=0, n2;
--	char *s, buf[256];
- 	const wchar_t *ws = *wcs;
--	const wchar_t *tmp_ws;
--
--	if (!dst) s = buf, n = sizeof buf;
--	else s = dst;
--
--	while ( ws && n && ( (n2=wn)>=n || n2>32 ) ) {
--		if (n2>=n) n2=n;
--		tmp_ws = ws;
--		l = wcsrtombs(s, &ws, n2, 0);
--		if (!(l+1)) {
--			cnt = l;
--			n = 0;
-+	size_t cnt = 0;
-+	if (!dst) n=0;
-+	while (ws && wn) {
-+		char tmp[MB_LEN_MAX];
-+		size_t l = wcrtomb(n<MB_LEN_MAX ? tmp : dst, *ws, 0);
-+		if (l==-1) {
-+			cnt = -1;
- 			break;
- 		}
--		if (s != buf) {
--			s += l;
-+		if (dst) {
-+			if (n<MB_LEN_MAX) {
-+				if (l>n) break;
-+				memcpy(dst, tmp, l);
-+			}
-+			dst += l;
- 			n -= l;
- 		}
--		wn = ws ? wn - (ws - tmp_ws) : 0;
--		cnt += l;
--	}
--	if (ws) while (n && wn) {
--		l = wcrtomb(s, *ws, 0);
--		if ((l+1)<=1) {
--			if (!l) ws = 0;
--			else cnt = l;
-+		if (!*ws) {
-+			ws = 0;
- 			break;
- 		}
--		ws++; wn--;
--		/* safe - this loop runs fewer than sizeof(buf) times */
--		s+=l; n-=l;
-+		ws++;
-+		wn--;
- 		cnt += l;
- 	}
- 	if (dst) *wcs = ws;
--- 
-cgit v1.2.1
-


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/musl/files/
@ 2021-11-19  3:03 Sam James
  0 siblings, 0 replies; 7+ messages in thread
From: Sam James @ 2021-11-19  3:03 UTC (permalink / raw
  To: gentoo-commits

commit:     9d41e6bdaff27bd16fbd33f46406f77e9074ae78
Author:     Wiktor Kerr <w <AT> kerr <DOT> sh>
AuthorDate: Thu Nov 18 00:43:49 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Nov 19 03:02:31 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9d41e6bd

sys-libs/musl: make ldconfig script respect -r

Bug: https://bugs.gentoo.org/666246
Signed-off-by: Wiktor Kerr <w <AT> kerr.sh>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-libs/musl/files/ldconfig.in-r1 | 146 +++++++++++++++++++++++++++++++++++++
 1 file changed, 146 insertions(+)

diff --git a/sys-libs/musl/files/ldconfig.in-r1 b/sys-libs/musl/files/ldconfig.in-r1
new file mode 100644
index 000000000000..362d11ce815a
--- /dev/null
+++ b/sys-libs/musl/files/ldconfig.in-r1
@@ -0,0 +1,146 @@
+#!/bin/bash -e
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+ROOT="/"
+
+LDSO_CONF="/etc/ld.so.conf"
+if [[ ! -e $LDSO_CONF ]]; then
+	echo "$LDSO_CONF not found" >&2
+	exit 1
+fi
+
+LDSO_CONF_DIR=$(dirname $LDSO_CONF)
+
+VERBOSE=0
+
+UPDATE_LINKS=1
+
+get_options() {
+	while getopts "vnNXf:C:r:p" opt "$@"; do
+		case $opt in
+		v)
+			echo "ldconfig for musl in Gentoo"
+			VERBOSE=1
+			;;
+		r)
+			ROOT=$OPTARG
+			LDSO_CONF=$ROOT$LDSO_CONF
+			LDSO_CONF_DIR=$(dirname $LDSO_CONF)
+			;;
+		f)
+			LDSO_CONF=$OPTARG
+			;;
+		X)
+			UPDATE_LINKS=0
+			;;
+		\?)
+			echo "Invalid option: -$opt" >&2
+			exit 1
+			;;
+		n|N|C|p)
+			echo "Unimplemented option: -$opt" >&2
+			exit 1
+			;;
+		esac
+	done
+
+	if [[ $UPDATE_LINKS == 1 ]]; then
+		echo "Updating links is not implemented."
+	fi
+}
+
+
+repeated() {
+	local l=$1
+	local drs="${@:2}"
+	for m in $drs; do
+		[[ $m == $l ]] && return 0
+	done
+	return 1
+}
+
+expand() {
+	# We are assuming the ld.so.conf's 'include' is not recursive
+	local f line l
+	local glob="$LDSO_CONF_DIR/$1"
+	local drs="${@:2} "
+
+	for f in $glob; do
+		[[ ! -f $f ]] && continue
+		while read line; do
+			line=${line%%#*}
+			line=${line//:/ }
+			line=${line//,/ }
+			for l in $line; do
+				#We must add this whether or not the directory exists
+				repeated $l $drs && continue
+				drs+=" $l "
+			done
+		done < $f
+	done
+
+	echo $drs
+}
+
+read_ldso_conf() {
+	local drs=" "
+
+	while read line; do
+		# Sanitize the line - see ldconfig(8) for delimiters
+		# Note: bash read turns tabs into spaces and read already
+		# delimits on newlines with the default $IFS
+		line=${line%%#*}   # Remove comments
+		line=${line//:/ }  # Change colon delimiter to space
+		line=${line//,/ }  # Change comma delimiter to space
+
+		next=0
+		for l in $line; do
+			if [[ $next == 1 ]]; then
+				next=0
+				drs=$(expand $l $drs)
+			elif [[ $l == "include" ]]; then
+				next=1
+			else
+				# glibc's ldconfig silently skips non directories
+				if [[ -d $l ]]; then
+					repeated $l $drs && continue
+					drs+=" $l "
+				fi
+			fi
+		done
+	done < $1
+
+	echo $drs
+}
+
+sanitize() {
+	local drs=$@
+
+	repeated "/lib" $drs || drs="/lib $drs"
+	repeated "/usr/lib" $drs || drs="/usr/lib $drs"
+
+	echo $drs
+}
+
+get_options "$@"
+drs=$(read_ldso_conf "$LDSO_CONF")
+drs=$(sanitize $drs)
+
+ARCH=@@ARCH@@
+LDSO_PATH="$ROOT/lib/ld-musl-${ARCH}.so.1"
+if [[ ! -e $LDSO_PATH ]]; then
+	echo "$LDSO_PATH not found" >&2
+	exit 1
+fi
+
+LDSO_ARCH=$(basename $LDSO_PATH)
+LDSO_NAME=${LDSO_ARCH%.so.1}
+ETC_LDSO_PATH="$ROOT/etc/${LDSO_NAME}.path"
+
+X=$(mktemp -p /tmp ${LDSO_NAME}.XXXXXX)
+for d in $drs; do
+	echo $d >> $X
+done
+chmod 644 $X
+mv $X $ETC_LDSO_PATH


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/musl/files/
@ 2022-07-27 19:01 Conrad Kostecki
  0 siblings, 0 replies; 7+ messages in thread
From: Conrad Kostecki @ 2022-07-27 19:01 UTC (permalink / raw
  To: gentoo-commits

commit:     63cc74065040bb3cb3f538867883226a303f4f53
Author:     Michael Mair-Keimberger <mmk <AT> levelnine <DOT> at>
AuthorDate: Wed Jul 27 16:30:07 2022 +0000
Commit:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
CommitDate: Wed Jul 27 19:00:48 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=63cc7406

sys-libs/musl: remove unused patch

Signed-off-by: Michael Mair-Keimberger <mmk <AT> levelnine.at>
Portage 3.0.34 / pkgdev 0.2.1 / pkgcheck 0.10.11
Closes: https://github.com/gentoo/gentoo/pull/26624
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>

 sys-libs/musl/files/musl-1.2.2-gethostid.patch | 43 --------------------------
 1 file changed, 43 deletions(-)

diff --git a/sys-libs/musl/files/musl-1.2.2-gethostid.patch b/sys-libs/musl/files/musl-1.2.2-gethostid.patch
deleted file mode 100644
index 96c799cfca29..000000000000
--- a/sys-libs/musl/files/musl-1.2.2-gethostid.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-Subject: [musl] [PATCH] extend gethostid beyond a stub
-Archived-At: <https://inbox.vuxu.org/musl/20210420191519.23822-3-ericonr@disroot.org/>
-List-Archive: <https://inbox.vuxu.org/musl/>
-List-Post: <mailto:musl@inbox.vuxu.org>
-
-From: Érico Rolim <erico.erc@gmail.com>
-
-Implement part of the glibc behavior, where the 32-bit identifier stored
-in /etc/hostid, if the file exists, is returned. If this file doesn't
-contain at least 32 bits or can't be opened for some reason, return 0.
----
- src/misc/gethostid.c | 15 ++++++++++++++-
- 1 file changed, 14 insertions(+), 1 deletion(-)
-
-diff --git a/src/misc/gethostid.c b/src/misc/gethostid.c
-index 25bb35db..d529de9c 100644
---- a/src/misc/gethostid.c
-+++ b/src/misc/gethostid.c
-@@ -1,6 +1,19 @@
- #include <unistd.h>
-+#include <stdio.h>
-+#include <stdint.h>
- 
- long gethostid()
- {
--	return 0;
-+	FILE *f;
-+	int32_t rv = 0;
-+
-+	f = fopen("/etc/hostid", "reb");
-+	if (f) {
-+		if (fread(&rv, sizeof(rv), 1, f) == 0) {
-+			rv = 0;
-+		}
-+		fclose(f);
-+	}
-+
-+	return rv;
- }
--- 
-2.31.1
-
-


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-07-27 19:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-28 20:05 [gentoo-commits] repo/gentoo:master commit in: sys-libs/musl/files/ Anthony G. Basile
  -- strict thread matches above, loose matches on Subject: below --
2022-07-27 19:01 Conrad Kostecki
2021-11-19  3:03 Sam James
2021-05-02 14:36 Jory Pratt
2019-11-29 22:08 Aaron Bauman
2015-11-29  2:05 Anthony G. Basile
2015-08-31  3:06 Anthony G. Basile

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox