From nobody Sun Apr 28 18:55:53 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ao2.it ARC-Seal: i=1; a=rsa-sha256; t=1558882936; cv=none; d=zoho.com; s=zohoarc; b=Dy/bTjlXHOrhJHJ9iXoAGmpqytjcNf0nVVEk4SvgnUTcLQzdxHZpUALwpD5mV+Okd0yadqTJnyY3aSWETxxuMwLi6xU21PaBh605i2zVSWpM326BD1kFziVImQgKUvV7z9XymcbXQk+5g9buz8/xs36HpDH1uWh8zY6GDBFBRTA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558882936; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=/dJd9Idb5t9LEOYYSwPyANPLg2VsmDLepPBJ8ZkWXD4=; b=AxwwRZeMh7V6QeZNVyV9kcNrXwUyF16u2NPtWeKhHG0T88+OMrs3LxrmPp1Zk62HpVwZA+Ncf3S1aV9PWwlwLZXV0ldE4Wc2YWuvRsxgt7S+pEgFFBNvu7vg0oPG782Zim5qajbpVp6/tJHD5fwrO815X/V3YejCOBFGj7CJqks= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1558882935995265.87239374523915; Sun, 26 May 2019 08:02:15 -0700 (PDT) Received: from localhost ([127.0.0.1]:56230 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hUuex-0002Nc-JH for importer@patchew.org; Sun, 26 May 2019 11:02:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58201) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hUudL-00017c-LF for qemu-devel@nongnu.org; Sun, 26 May 2019 11:00:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hUuSB-0003F8-3T for qemu-devel@nongnu.org; Sun, 26 May 2019 10:48:52 -0400 Received: from mail.ao2.it ([2001:4b98:dc0:41:216:3eff:fe7c:639b]:59056 helo=ao2.it) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hUuSA-00039m-Gw for qemu-devel@nongnu.org; Sun, 26 May 2019 10:48:51 -0400 Received: from localhost ([::1] helo=jcn) by ao2.it with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1hUuRf-0001fE-Mt; Sun, 26 May 2019 16:48:19 +0200 Received: from ao2 by jcn with local (Exim 4.92) (envelope-from ) id 1hUuS0-0007oy-UV; Sun, 26 May 2019 16:48:40 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ao2.it; s=20180927; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=/dJd9Idb5t9LEOYYSwPyANPLg2VsmDLepPBJ8ZkWXD4=; b=DltCLW8XmusOZT8+leA8gIKVZ99pm2IncH3Ic92TFrhqqdbcC0rzRufIi2vPlSxaSYCVsScysYnpXNvwme0EnUqpEdDVJNC49KgNUPGmG+l30TMZv6JMBcoAXYNdw4vNOqfKcGBHgBjQUb/96yxJ7sX3G5vTm41G7DzCM5TI7Snoe7C2wDfOKhnZScWQuRjc6yJ/bvhDkoDBOYuqT3w4iyXTdmc1jgKAwrG1JUuU6R4rxg0QgCsCGP9wfdHCQo4Mn/uXGiGIMDKu7BswOqeKTBuinyLM1LqZgWNVEKCpR/MrxANM6ZSjLuD1JXbU0OuDY14pQQNBjBUiyxJK2HIUWw==; From: Antonio Ospite To: qemu-devel@nongnu.org Date: Sun, 26 May 2019 16:47:46 +0200 Message-Id: <20190526144747.30019-2-ao2@ao2.it> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190526144747.30019-1-ao2@ao2.it> References: <20190526144747.30019-1-ao2@ao2.it> MIME-Version: 1.0 X-Face: z*RaLf`X<@C75u6Ig9}{oW$H; 1_\2t5)({*|jhM/Vb; ]yA5\I~93>J<_`<4)A{':UrE Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4b98:dc0:41:216:3eff:fe7c:639b Subject: [Qemu-devel] [PATCH v3 1/2] configure: set source_path only once and make its definition more robust X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Antonio Ospite , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Antonio Ospite Since commit 79d77bcd36 (configure: Remove --source-path option, 2019-04-29) source_path cannot be overridden anymore, move it out of the "default parameters" block since the word "default" may suggest that the value can change, while in fact it does not. While at it, only set source_path once and separate the positional argument of basename with "--" to more robustly cover the case of path names starting with a dash. Reviewed-by: Eric Blake Signed-off-by: Antonio Ospite --- configure | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 528b9ff705..9f12120ad9 100755 --- a/configure +++ b/configure @@ -276,10 +276,10 @@ ld_has() { $ld --help 2>/dev/null | grep ".$1" >/dev/null 2>&1 } =20 -# default parameters -source_path=3D$(dirname "$0") # make source path absolute -source_path=3D$(cd "$source_path"; pwd) +source_path=3D$(cd "$(dirname -- "$0")"; pwd) + +# default parameters cpu=3D"" iasl=3D"iasl" interp_prefix=3D"/usr/gnemul/qemu-%M" --=20 2.20.1 From nobody Sun Apr 28 18:55:53 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ao2.it ARC-Seal: i=1; a=rsa-sha256; t=1558883043; cv=none; d=zoho.com; s=zohoarc; b=nBrESXkTqJTKT0w6NBCohBFkUmjg63PfWVmUGufiTrymWIhCpDZ425xe13Zv7yC63N5MoSPiViePs1deavhHznEkCsDo72Dv5SEPRqWMwCfPNVFMv83sfxu7l0HEx1jT3Vdoli+7+pKQuJok3INBldOkRv9qGmML34XlCQwx2rE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558883043; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=L5J+dSdjLsPO2TI1jfaBAO2x1P444tZo5GX3+5PiF2M=; b=V0mjr9sO616/GDmvHVT1+uPBWVPWMeN8AT8VV2atPPbEmM9g0I+pGwZiAG7HATD1AatfgJWt8aaOw46sr5h2QGG77TUaaBPau1A7goev8iyhqjGJhbdGdzzkAL/DfToG5ZmsHJzZ45gCC7iqZy3i6UtTqVq3l86wmHg26KoD0kM= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1558883043107313.12679613889213; Sun, 26 May 2019 08:04:03 -0700 (PDT) Received: from localhost ([127.0.0.1]:56244 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hUugn-0003ml-77 for importer@patchew.org; Sun, 26 May 2019 11:03:57 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58201) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hUudN-00017c-Qg for qemu-devel@nongnu.org; Sun, 26 May 2019 11:00:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hUuSA-0003Er-SB for qemu-devel@nongnu.org; Sun, 26 May 2019 10:48:51 -0400 Received: from mail.ao2.it ([2001:4b98:dc0:41:216:3eff:fe7c:639b]:59058 helo=ao2.it) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hUuSA-00039n-Gv for qemu-devel@nongnu.org; Sun, 26 May 2019 10:48:50 -0400 Received: from localhost ([::1] helo=jcn) by ao2.it with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1hUuRf-0001fD-K0; Sun, 26 May 2019 16:48:19 +0200 Received: from ao2 by jcn with local (Exim 4.92) (envelope-from ) id 1hUuS1-0007p0-1D; Sun, 26 May 2019 16:48:41 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ao2.it; s=20180927; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=L5J+dSdjLsPO2TI1jfaBAO2x1P444tZo5GX3+5PiF2M=; b=Jjnlaihg+A7nTpKtStZ0npd9zbqcLyK71HcQjBKE9qGAWp/Ob6BqNKTz1Wq+iryDUnvbCuikYbc/ByZe2/7ef8YM4/TxYQrnftrGitl9fNstK3OiL/8uS8sYXQKJqcJFinUN3F9SRjP3OW/MvSctRl5F9TDI+9ajKhQIbOb5UZSkKsBcbkrQzUiPdc8fYRzFVTPguIkAWnosCexr6yS9jydHFtSTs2eLN7TiVjYnn6pMsp7w9EztvaqA8CiagXHcjxuhPL4+/w6oskM3DwXMzzYL5+KTC8ISzEMrHp1NqoiG0QOX+nMucHpKps3KJ58crrMAXheaBZ7vZ/9xDrKdCA==; From: Antonio Ospite To: qemu-devel@nongnu.org Date: Sun, 26 May 2019 16:47:47 +0200 Message-Id: <20190526144747.30019-3-ao2@ao2.it> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190526144747.30019-1-ao2@ao2.it> References: <20190526144747.30019-1-ao2@ao2.it> MIME-Version: 1.0 X-Face: z*RaLf`X<@C75u6Ig9}{oW$H; 1_\2t5)({*|jhM/Vb; ]yA5\I~93>J<_`<4)A{':UrE Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4b98:dc0:41:216:3eff:fe7c:639b Subject: [Qemu-devel] [PATCH v3 2/2] configure: disallow spaces and colons in source path and build path X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Antonio Ospite , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Antonio Ospite The configure script breaks when the qemu source directory is in a path containing white spaces, in particular the list of targets is not correctly generated when calling "./configure --help" because of how the default_target_list variable is built. In addition to that, *building* qemu from a directory with spaces breaks some assumptions in the Makefiles, even if the original source path does not contain spaces like in the case of an out-of-tree build, or when symlinks are involved. To avoid these issues, refuse to run the configure script and the Makefile if there are spaces or colons in the source path or the build path, taking as inspiration what the kbuild system in linux does. Buglink: https://bugs.launchpad.net/qemu/+bug/1817345 Reviewed-by: Eric Blake Signed-off-by: Antonio Ospite --- Makefile | 4 ++++ configure | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/Makefile b/Makefile index e02b88bcb1..bed1323a45 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,9 @@ # Makefile for QEMU. =20 +ifneq ($(words $(subst :, ,$(CURDIR))), 1) + $(error main directory cannot contain spaces nor colons) +endif + # Always point to the root of the build tree (needs GNU make). BUILD_DIR=3D$(CURDIR) =20 diff --git a/configure b/configure index 9f12120ad9..2833d73ccc 100755 --- a/configure +++ b/configure @@ -279,6 +279,11 @@ ld_has() { # make source path absolute source_path=3D$(cd "$(dirname -- "$0")"; pwd) =20 +if printf %s\\n "$source_path" "$PWD" | grep -q "[[:space:]:]"; +then + error_exit "main directory cannot contain spaces nor colons" +fi + # default parameters cpu=3D"" iasl=3D"iasl" --=20 2.20.1