From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 07C7215808B for ; Sat, 5 Oct 2024 04:15:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 235E4E29CB; Sat, 5 Oct 2024 04:15:25 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CC099E29CF for ; Sat, 5 Oct 2024 04:15:24 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 732BE340C77 for ; Sat, 5 Oct 2024 04:15:23 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D6D9321C8 for ; Sat, 5 Oct 2024 04:15:21 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1723911396.e9e8c66c681b980668a8e9225bf8ec19135b9acc.sam@gentoo> Subject: [gentoo-commits] proj/gentoo-functions:master commit in: / X-VCS-Repository: proj/gentoo-functions X-VCS-Files: functions.sh X-VCS-Directories: / X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: e9e8c66c681b980668a8e9225bf8ec19135b9acc X-VCS-Branch: master Date: Sat, 5 Oct 2024 04:15:21 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: b4a38bb8-d4d5-4452-aa6b-6a2554427cb1 X-Archives-Hash: 0cc0a4e330b0e6b7d355ab3353d18685 commit: e9e8c66c681b980668a8e9225bf8ec19135b9acc Author: Kerin Millar plushkava net> AuthorDate: Sun Aug 11 18:37:44 2024 +0000 Commit: Sam James gentoo org> CommitDate: Sat Aug 17 16:16:36 2024 +0000 URL: https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=e9e8c66c Ensure that LC_ALL is exported in srandom(); be safer for macOS The slowest implementation of srandom() runs od(1) and awk(1) within a command substitution. There, both LC_ALL and LC_CTYPE are overridden but they should also be exported. For now, export LC_ALL=C exclusively, even though it overrides LC_MESSAGES, potentially affecting the user's preferred language for diagnostics. The reason for choosing this course of action is as follows. $ uname Darwin $ echo "$BASH_VERSION" 5.2.26(1)-release $ f() { nonexistent; }; $ ( export LC_ALL=; f ) objc[29971]: +[__SwiftNativeNSStringBase initialize] may have been in progress in another thread when fork() was called. objc[29971]: +[__SwiftNativeNSStringBase initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug. A fix for this is present in the devel branch: - https://git.savannah.gnu.org/cgit/bash.git/commit/?h=devel&id=b3d8c8a See, also: - https://trac.macports.org/ticket/68638 - https://lists.gnu.org/archive/html/bug-bash/2024-05/msg00088.html Of course, the fix hasn't been backported to an actual release. As such, I would prefer to play it safe for the time being. Signed-off-by: Kerin Millar plushkava.net> functions.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/functions.sh b/functions.sh index 8b7896f..406fe7f 100644 --- a/functions.sh +++ b/functions.sh @@ -590,8 +590,7 @@ srandom() local hex hex=$( - LC_ALL= - LC_CTYPE=C + export LC_ALL=C od -vAn -N256 -tx1 /dev/urandom | awk ' { gsub(/[[:space:]]/, "")