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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 73F51138334 for ; Sat, 29 Dec 2018 17:45:56 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 75B47E09EB; Sat, 29 Dec 2018 17:45:55 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 32AACE09EB for ; Sat, 29 Dec 2018 17:45:55 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E3052335C7B for ; Sat, 29 Dec 2018 17:45:52 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D2BCF4D3 for ; Sat, 29 Dec 2018 17:45:50 +0000 (UTC) From: "Mikle Kolyada" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mikle Kolyada" Message-ID: <1546105547.b3fc94e26e94fdd3db193a8e77a4f0977d1591a4.zlogene@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/util-linux/, sys-apps/util-linux/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-apps/util-linux/files/util-linux-2.33-sparc-setarch.patch sys-apps/util-linux/util-linux-2.33.ebuild X-VCS-Directories: sys-apps/util-linux/files/ sys-apps/util-linux/ X-VCS-Committer: zlogene X-VCS-Committer-Name: Mikle Kolyada X-VCS-Revision: b3fc94e26e94fdd3db193a8e77a4f0977d1591a4 X-VCS-Branch: master Date: Sat, 29 Dec 2018 17:45:50 +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: 3159e944-3b4e-47c4-9c8b-bccfd95163af X-Archives-Hash: c7f28a38f2cd0eb2e5eacddf3f93816d commit: b3fc94e26e94fdd3db193a8e77a4f0977d1591a4 Author: Mikle Kolyada gentoo org> AuthorDate: Sat Dec 29 17:45:26 2018 +0000 Commit: Mikle Kolyada gentoo org> CommitDate: Sat Dec 29 17:45:47 2018 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b3fc94e2 sys-apps/util-linux: fix set_arch detection for sparc Signed-off-by: Mikle Kolyada gentoo.org> Package-Manager: Portage-2.3.51, Repoman-2.3.11 .../files/util-linux-2.33-sparc-setarch.patch | 80 ++++++++++++++++++++++ sys-apps/util-linux/util-linux-2.33.ebuild | 3 +- 2 files changed, 82 insertions(+), 1 deletion(-) diff --git a/sys-apps/util-linux/files/util-linux-2.33-sparc-setarch.patch b/sys-apps/util-linux/files/util-linux-2.33-sparc-setarch.patch new file mode 100644 index 00000000000..cbae6c0f263 --- /dev/null +++ b/sys-apps/util-linux/files/util-linux-2.33-sparc-setarch.patch @@ -0,0 +1,80 @@ +From 3fa06e049012218d883d0e1251df86bafbc446bf Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 22 Nov 2018 11:03:35 +0100 +Subject: [PATCH] setarch: fix obscure sparc32bash use-case + +Reported-by: Carlos Santos +Signed-off-by: Karel Zak +--- + sys-utils/setarch.c | 28 ++++++++++++++++++---------- + 1 file changed, 18 insertions(+), 10 deletions(-) + +diff --git a/sys-utils/setarch.c b/sys-utils/setarch.c +index a733f7b3c..7c0a63fbb 100644 +--- a/sys-utils/setarch.c ++++ b/sys-utils/setarch.c +@@ -268,6 +268,7 @@ int main(int argc, char *argv[]) + int c; + struct arch_domain *doms, *target; + unsigned long pers_value = 0; ++ char *shell = NULL, *shell_arg = NULL; + + /* Options without equivalent short options */ + enum { +@@ -310,14 +311,14 @@ int main(int argc, char *argv[]) + archwrapper = strcmp(program_invocation_short_name, "setarch") != 0; + if (archwrapper) { + arch = program_invocation_short_name; /* symlinks to setarch */ +-#if defined(__sparc64__) || defined(__sparc__) ++ ++ /* Don't use ifdef sparc here, we get "Unrecognized architecture" ++ * error message later if necessary */ + if (strcmp(arch, "sparc32bash") == 0) { +- if (set_arch(arch, 0L, 0)) +- err(EXIT_FAILURE, _("Failed to set personality to %s"), arch); +- execl("/bin/bash", "", NULL); +- errexec("/bin/bash"); ++ shell = "/bin/bash"; ++ shell_arg = ""; ++ goto set_arch; + } +-#endif + } else { + if (1 < argc && *argv[1] != '-') { + arch = argv[1]; +@@ -391,6 +392,7 @@ int main(int argc, char *argv[]) + argc -= optind; + argv += optind; + ++set_arch: + /* get execution domain (architecture) */ + if (arch) { + doms = init_arch_domains(); +@@ -422,17 +424,23 @@ int main(int argc, char *argv[]) + if (arch) + verify_arch_domain(target, arch); + ++ if (!argc) { ++ shell = "/bin/sh"; ++ shell_arg = "-sh"; ++ } + if (verbose) { +- printf(_("Execute command `%s'.\n"), argc ? argv[0] : "/bin/sh"); ++ printf(_("Execute command `%s'.\n"), shell ? shell : argv[0]); + /* flush all output streams before exec */ + fflush(NULL); + } + +- if (!argc) { +- execl("/bin/sh", "-sh", NULL); +- errexec("/bin/sh"); ++ /* Execute shell */ ++ if (shell) { ++ execl(shell, shell_arg, NULL); ++ errexec(shell); + } + ++ /* Execute on command line specified command */ + execvp(argv[0], argv); + errexec(argv[0]); + } diff --git a/sys-apps/util-linux/util-linux-2.33.ebuild b/sys-apps/util-linux/util-linux-2.33.ebuild index c95e045cc20..cf66f3c521b 100644 --- a/sys-apps/util-linux/util-linux-2.33.ebuild +++ b/sys-apps/util-linux/util-linux-2.33.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Foundation and others +# Copyright 1999-2018 Gentoo Authors and others # Copyright 2018 Sony Interactive Entertainment Inc. # Distributed under the terms of the GNU General Public License v2 @@ -65,6 +65,7 @@ S="${WORKDIR}/${MY_P}" PATCHES=( "${FILESDIR}/util-linux-2.32.1-skip-oids-test-when-uuidgen-is-not-available.patch" + "${FILESDIR}/${P}-sparc-setarch.patch" ) src_prepare() {