Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp570174pxb; Wed, 22 Sep 2021 08:21:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvpBRUvMGdPYc2LQwvlHOXtr2ym6l1lmtyqE4MozYQWr+Gro80oUFsptU2DgZSBU2lQl3L X-Received: by 2002:a17:906:a382:: with SMTP id k2mr101435ejz.454.1632324061264; Wed, 22 Sep 2021 08:21:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632324061; cv=none; d=google.com; s=arc-20160816; b=Voir1IHq515gNFXa5JvDctgg5hOLIzi7eZINEha4HbNjrkMfsZeF/r77XBxDKsE9XY b4o4EVi6tymnxpc9ePtzvmfdiKztHPztMX8YeBXYx5eQPIDeonX9TMcXqB7pYaPlDX2m QyOtPk6Yhd2w78wVc+VXf/0PhQFUYqRPc6eHVN3mM+D3a0e0nj3XiDdKyt2+sw7SLa5z wSuGxaLPZrVnPU+/ReRM9URFAN/GQRtHN7lKOQx/JsB+nJmbEIqE7UgwM+ZikOIJB115 jbWrjHLLV4p24Zi+9tEVQPhwtEODgyDkY0y2ZxKphQ92t8EdtHajfUz7da42fthUz5VG iMVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=tmGq3/knU8QCRrpfHfquzBxr8F9eY9YHQyMQvlUSRTk=; b=JMS3NM6cL7pllJfB/nS95VP2J58oJKRCjLYd7MwweAWVsSx3ZZecgOHJBNXd6TsMr7 Yh2TFcTXb2zFdWkfOmC1q2O14Pjju4I1k+4NMCDKFK4ElaJvP5qCPLsZ4sJhsa2ubVbC nUXNUdQpJA08KBAxWcoySF4tO6NCZxzfBWHO6M7HVIfz/IdIZZAWLPDsRo6dz5F62THg HbBiMtHZt/s7hj+1Jsp+EvhN1Vi4hwSxdXtbTU9dgD/ug+BuTGIC6Mms1f6Dmxz+Zs5x I9wDbaIejltmVrXtyoOvj8baNMDY1JE/bpGQA7Cn+15iV2Mja0GL0tBJDeD1BTIRlVUT 5RhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codesynthesis.com header.s=mail1 header.b=QveitF47; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e4si3176763ejs.733.2021.09.22.08.20.34; Wed, 22 Sep 2021 08:21:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@codesynthesis.com header.s=mail1 header.b=QveitF47; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236372AbhIVPUW (ORCPT + 99 others); Wed, 22 Sep 2021 11:20:22 -0400 Received: from codesynthesis.com ([188.40.148.39]:51316 "EHLO codesynthesis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232318AbhIVPUV (ORCPT ); Wed, 22 Sep 2021 11:20:21 -0400 Received: from brak.codesynthesis.com (197-255-152-207.static.adept.co.za [197.255.152.207]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by codesynthesis.com (Postfix) with ESMTPSA id 70F146037E; Wed, 22 Sep 2021 15:18:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codesynthesis.com; s=mail1; t=1632323929; bh=Fop8KzuTj8eJDYWxQnTsAojwrY2EXG/OV4zfG0aaIH4=; h=Date:From:To:Subject:Message-ID:MIME-Version:From; b=QveitF47fr2YPXgvZGRPBqlvmiv90lfX4H8ZJ42tUrArNFfFdmtPkLthPw2PPhk++ rVo40kVwCSMmfyLqXjU7XZQqUPGe30eydO+rPZotX85zGwj8nboEbcBG0IAD3Unt06 5d4iKtUtqYQXbC8eVO/WysF5szx1f5k6xu6F5TtOxt2nRUOer75MBsyvA/LndoUR53 Yan+ABEofWI3NrBca3TvhvGeOENLMjHL1G4DA0E5ocgiJiz8AIXJgPZY5HYdu8z0Vq FqzBn3gThbAel1BLh/5x9366+4VhbQWZ5w3tcvyI1xpneDsFOT30JWg2tvQLhb2YUp 8M+CWLh9Qvh9A== Received: by brak.codesynthesis.com (Postfix, from userid 1000) id 550821A800C4; Wed, 22 Sep 2021 17:18:43 +0200 (SAST) Date: Wed, 22 Sep 2021 17:18:43 +0200 From: Boris Kolpackov To: Richard Weinberger Cc: masahiroy@kernel.org, linux-kernel , linux-kbuild@vger.kernel.org Subject: Re: [PATCH 2/2] kconfig: Deny command substitution in string values Message-ID: References: <20210920213957.1064-1-richard@nod.at> <20210920213957.1064-2-richard@nod.at> <1402570794.96583.1632295660867.JavaMail.zimbra@nod.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1402570794.96583.1632295660867.JavaMail.zimbra@nod.at> Organization: Code Synthesis User-Agent: Mutt/1.5.24 (2015-08-30) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Richard Weinberger writes: > > So effectively it's now impossible to include ` or $ in kconfig > > string values. Seems like a major, backwards-incompatible > > restriction. > > Do you have a working example? You mean of a project that uses kconfig and that is capable of handling string values with these characters? If so, then yes, see for example, libbuild2-kconfig[1] which is a build system module that implements kconfig-based configuration support for build2. In particular, it exposes values from .config as buildfile variables but it doesn't do this by sourcing .config. Instead it loads .config using the kconfig API and then sets the corresponding buildfile variables programmatically. > Since the config is sourced in the scripts/setlocalversion it will > not work correctly anyway. The actual file being sources is include/config/auto.conf, not .config, right? > > I think if this is really desired, then it should be re-done with > > escaping (similar to ") rather than outright banning inconvenient > > characters. > > Escaping is not so easy since the very same content is included > in shell scripts (sertlocalversion), in Makefiles and in C files. Again, I don't think it's .config that gets included in C files but rather include/generated/autoconf.h, right? > At least I didn't find find a good way to escape these characters > such that all three programming environments will accept it. If my understanding is correct, then you are concerned with the autoconf functionality: the auto.conf makefile and autoconf.h header, and not the .config file itself. Perhaps it will be less disruptive to do the escaping (or banning) at that level? Specifically: 1. If you do escaping at that level, then you can do it differently for auto.conf and autoconf.h. Though auto.conf still seems to be read by both make and shell. 2. Alternatively, you can detect and ban the inconvenient characters when generating these files (I personally don't care for autoconf and have it disabled). [1] https://github.com/build2/libbuild2-kconfig