From nobody Thu May 16 11:41: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=1556872132; cv=none; d=zoho.com; s=zohoarc; b=YiUnGUzezEymRRy/abO9qIFxrLEQ9ELYoeTtqOcjBSYLOp4JJmp0ToP64TZ0rB4kucd3OWDMD6qjx1X/hpGTe4eZ8qcyo1jeVjoMS1FIzvB1LlcAKGTMjeabehuCHw9dp0I1ywQeNJFdVpMEiJP7cQf4PmcAHO+dJiqELThvHNI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556872132; 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=O/x1pmBYyHhH6YBHV9mpou5EYK1MlQCzx8xBUn4MzGw=; b=DAu5zhHUT6pd4KGe/x/khu52s8gnOoIAV+1Zz0RqEvCA2Fpv9+Waie+xMzr7Z8+n19vwD1EnQHKgRx7O87JnJC6dXdCSmrxCoyrI1FaWdOnoceTGKH3pJPT26yivp8rJR5f+5gqB9rRM1IpD0q2Upp0061hvBHzUnPpbQn9JpuE= 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 1556872131999318.8860162029447; Fri, 3 May 2019 01:28:51 -0700 (PDT) Received: from localhost ([127.0.0.1]:36523 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMTYn-0001Jx-1S for importer@patchew.org; Fri, 03 May 2019 04:28:49 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55086) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMTXu-0000yg-SN for qemu-devel@nongnu.org; Fri, 03 May 2019 04:27:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMTXt-0006vt-Pz for qemu-devel@nongnu.org; Fri, 03 May 2019 04:27:54 -0400 Received: from mail.ao2.it ([2001:4b98:dc0:41:216:3eff:fe7c:639b]:39650 helo=ao2.it) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hMTXt-0006uv-EB for qemu-devel@nongnu.org; Fri, 03 May 2019 04:27:53 -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 1hMTXl-0001Ll-K1; Fri, 03 May 2019 10:27:45 +0200 Received: from ao2 by jcn with local (Exim 4.92) (envelope-from ) id 1hMTXm-0004Ig-Eq; Fri, 03 May 2019 10:27:46 +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=O/x1pmBYyHhH6YBHV9mpou5EYK1MlQCzx8xBUn4MzGw=; b=v8Iky5DF6I55sWTtvOWAGdxtxKUyzD+k2H6V5wowpf0cboKr1rLThiHtpCBErJa/GpXh8fOg76W9R9VVNjbVuGyTsDBpUcXDFhZ70USUSpKplFLnaeYlTuC96xihubgZUn+TsImz11oVxssVL32UXg8jM0iy7hoG3RpXqPQh3qyS+S1NJ0ZqLHIPSUP6/SSxYRhhTP6KaIO6vRZyyIAm7k7YfAsQIP+j3tp/ERrYuXa/eevJK7j7TpGk49o6+fL7rEyqAR65kPdC/7HmgI8hGFx1oLEjVJ0pAevZfMIh5b0Fc/P3VocexHMTBYHBcNUTOElyAYrEG9nmi5vbxGlpgQ==; From: Antonio Ospite To: qemu-devel@nongnu.org Date: Fri, 3 May 2019 10:27:27 +0200 Message-Id: <20190503082728.16485-2-ao2@ao2.it> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190503082728.16485-1-ao2@ao2.it> References: <20190503082728.16485-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 v2 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 , Antonio Ospite 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. Signed-off-by: Antonio Ospite Reviewed-by: Eric Blake --- configure | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 60719ddcc5..9832cbca5c 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 Thu May 16 11:41: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=1556872198; cv=none; d=zoho.com; s=zohoarc; b=VBdiyk0NYahtTZULBE8fqPr3De49EakScbgPBLesXpvnVjL8r34tGN1KV8dJfGiLwUPCwNznkCWoQ8mTmYL+M+sRE1oxFAYndVn9BEy6wyk8NXtWRbuO7w4ZsHXNSDAMLB4a/bzpQIni3B61++y+dGZ4XnW1C6FwvO3jqbAFFVQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556872198; 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=+Ua6EzAy78sUfLQXiETF12f6tHOHpnJVclVZ/xwH61c=; b=HiuQp9u17PjANxb4X2qRea5+R4BkaA2BVtiiZ39cGyET+AN1cTWWRLFFyR61foC3lpB5EkX/WIMRkeAhvBXCn7fHyPHjuvLq9Vk2b4OGDo0umaECraw7S4qXGNsTCqK41XzDOrXtVYxURsm+KJ5jrZirYsvw8pWjlzVDuAdoNK8= 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 1556872198462103.12860931826151; Fri, 3 May 2019 01:29:58 -0700 (PDT) Received: from localhost ([127.0.0.1]:36531 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMTZp-00023s-Gn for importer@patchew.org; Fri, 03 May 2019 04:29:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55082) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMTXu-0000ye-Qn for qemu-devel@nongnu.org; Fri, 03 May 2019 04:27:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMTXt-0006vm-OC for qemu-devel@nongnu.org; Fri, 03 May 2019 04:27:54 -0400 Received: from mail.ao2.it ([2001:4b98:dc0:41:216:3eff:fe7c:639b]:39643 helo=ao2.it) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hMTXt-0006tw-BL for qemu-devel@nongnu.org; Fri, 03 May 2019 04:27:53 -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 1hMTXl-0001Lm-NG; Fri, 03 May 2019 10:27:45 +0200 Received: from ao2 by jcn with local (Exim 4.92) (envelope-from ) id 1hMTXm-0004Ii-HD; Fri, 03 May 2019 10:27:46 +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=+Ua6EzAy78sUfLQXiETF12f6tHOHpnJVclVZ/xwH61c=; b=wKccKUPxouVpuSVWjux9mcCBIlqr1/GYYiAUpy5DnpalkRyBj2tBXyer87LDEy+8yjqKdEoHzL8aNSMPZ7MvAdK3rQP/zM+OGwvFHzJ0xDKBBp5ooCKxL/ibB7Bn1dY7aBmp0BsPT3FN15gvUR9q2SNp4+Fw91iecXL2fhwNk8OcZFdphsV2c3TTqm69VI88Z4iV5P+DTLl4g9qZMcNAihE7iE/fBKzaxeuHD4GnBLY/TEE8dmLMvyCsbuX2OvavjVld8QkBuFf2hAuN6WiepgHNeFegS98BTWi+QkJgRjJ+fpRzZ8fuidk4WD/NazgTDZ3e3yX6YMiDQlI1iEl4uw==; From: Antonio Ospite To: qemu-devel@nongnu.org Date: Fri, 3 May 2019 10:27:28 +0200 Message-Id: <20190503082728.16485-3-ao2@ao2.it> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190503082728.16485-1-ao2@ao2.it> References: <20190503082728.16485-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 v2 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 , Antonio Ospite 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 Signed-off-by: Antonio Ospite Reviewed-by: Eric Blake --- Makefile | 4 ++++ configure | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/Makefile b/Makefile index 1211e78c91..7f3f7a7fef 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 9832cbca5c..f7ad4381bd 100755 --- a/configure +++ b/configure @@ -279,6 +279,12 @@ ld_has() { # make source path absolute source_path=3D$(cd "$(dirname -- "$0")"; pwd) =20 +if printf "%s\n" "$source_path" | grep -q "[[:space:]:]" || + printf "%s\n" "$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