From patchwork Fri May 8 12:35:48 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: 226206 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=ham 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 E73A6C38A2A for ; Fri, 8 May 2020 12:55:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BCE8024958 for ; Fri, 8 May 2020 12:55:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942531; bh=gwwltBoEbues8SEU545brQ4mqhSyAnYy0hmSd/ji+j8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=t8+gnjoE1nVdftfiAlHiDSBu4n/MUeeL0AE2w+mYXOFvaZ225jWrBDzmPxNRvNz85 cBtYu/AEkZv6TylE15HrD2o3fUpATl6UkX1lIUVqMe8snTPmC4YSjrqoLsowdWp7SY T1sZEmeh5IGK5diNsLTDLEodaZ468Jwo8t8/Nlew= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730080AbgEHMza (ORCPT ); Fri, 8 May 2020 08:55:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:38458 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729885AbgEHMz2 (ORCPT ); Fri, 8 May 2020 08:55:28 -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 5D8D024958; Fri, 8 May 2020 12:55:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942527; bh=gwwltBoEbues8SEU545brQ4mqhSyAnYy0hmSd/ji+j8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QFITd2Kgfw81VDKzfqJY6JHxs575HtAfQfGXS/EKZhtiYG7e4YqtrL03cKCwwpCQB A0RsNOKCzKRZ8bMyiFXwZpbxBgsk5hBVxFF3R1JOnCVuIeOB5YQA48s+Ah4DagisHl 6qjuqYoU8P2qqrTrMkKeHKXBi4P/Jmset2fD/MMY= 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.6 31/49] scripts/config: allow colons in option strings for sed Date: Fri, 8 May 2020 14:35:48 +0200 Message-Id: <20200508123047.347017108@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200508123042.775047422@linuxfoundation.org> References: <20200508123042.775047422@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" }