From patchwork Fri May 8 12:35:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 226178 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD872C38A2A for ; Fri, 8 May 2020 12:59:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7834B20720 for ; Fri, 8 May 2020 12:59:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942779; bh=gwwltBoEbues8SEU545brQ4mqhSyAnYy0hmSd/ji+j8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=FQlLvkHEcEDLI65mnPLUIoRsfXn6JFJ8kjqZqacpvXhgMzPJturwa1XSULoHjxo5t nD0TEz6ffw3QsKuPs053u1D83fLm/ME0Q33NRfuqrkUT835H1iLbLWgiYHzf4ii1+k YfqzWoAe5S/q47R0gek+E1yBr5yET8QOTnlvemqg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729250AbgEHMxG (ORCPT ); Fri, 8 May 2020 08:53:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:34550 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730022AbgEHMxF (ORCPT ); Fri, 8 May 2020 08:53:05 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0CD1424953; Fri, 8 May 2020 12:53:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942384; bh=gwwltBoEbues8SEU545brQ4mqhSyAnYy0hmSd/ji+j8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ic6aVHO3xBdFELvvmx641J0IFtODHTrFqk0mEveDZ9Vjoa/29EvY7Ulv63a4F2ivt cLOAXqLFVZ6GRje9PXr0RH8T0xqjOJ/esu921CQbxhXsnGqpApN/49k9OJnQIu8gHO cJ3pZ+gT54bxwH6d/OAIspjX2j/Yb4+3ZQgJ5790= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Jeremie Francois (on alpha)" , Masahiro Yamada , Sasha Levin Subject: [PATCH 5.4 23/50] scripts/config: allow colons in option strings for sed Date: Fri, 8 May 2020 14:35:29 +0200 Message-Id: <20200508123046.630074353@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200508123043.085296641@linuxfoundation.org> References: <20200508123043.085296641@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jeremie Francois (on alpha) [ Upstream commit e461bc9f9ab105637b86065d24b0b83f182d477c ] Sed broke on some strings as it used colon as a separator. I made it more robust by using \001, which is legit POSIX AFAIK. E.g. ./config --set-str CONFIG_USBNET_DEVADDR "de:ad:be:ef:00:01" failed with: sed: -e expression #1, char 55: unknown option to `s' Signed-off-by: Jeremie Francois (on alpha) Signed-off-by: Masahiro Yamada Signed-off-by: Sasha Levin --- scripts/config | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/config b/scripts/config index e0e39826dae90..eee5b7f3a092a 100755 --- a/scripts/config +++ b/scripts/config @@ -7,6 +7,9 @@ myname=${0##*/} # If no prefix forced, use the default CONFIG_ CONFIG_="${CONFIG_-CONFIG_}" +# We use an uncommon delimiter for sed substitutions +SED_DELIM=$(echo -en "\001") + usage() { cat >&2 <"$tmpfile" + sed -e "s$SED_DELIM$before$SED_DELIM$after$SED_DELIM" "$infile" >"$tmpfile" # replace original file with the edited one mv "$tmpfile" "$infile" }