Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1182492imm; Tue, 5 Jun 2018 10:17:10 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIR02NKZz/yIrRqmAZu/iXYuIZoVROZBe2xZymiwNlZ5miD9TC+FQ8JmaTRoGCD56S/Yuji X-Received: by 2002:a63:a05d:: with SMTP id u29-v6mr21612244pgn.80.1528219030923; Tue, 05 Jun 2018 10:17:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528219030; cv=none; d=google.com; s=arc-20160816; b=FnpexvlElUiJw5lcbahe4EdND/1qHeES/Yw+0dYXB5GUd/6ED3UeVCjoVYUzLzve3g cKtAQDf+uRFNPgYkZV4IMr/LU4x3tza2X/PMSG88kZfFyY9b2S3pyv9szh71LKGX0Dqh nVA5r8WT99inEEk94fFeYofE8Ky/Ph2XpS872U3/a+8M9z8cYy5GS0n6ZJ9K69GfWgZw ZSmCixdf9sw1nyE9BJz4u1hlnMXehBqC85nf/8z8f5m/resLskPhwUX/H/ufzzWfRZR9 pj0PSf+UEAyL9LlVRgt08c2WVPiqCerSeRSRhKtyPvr3bYu4S1N/fg37gP6Ovczrd9en GcUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=bF1CR2qsK8jOAYOkJS03kmIipTowewlCCJfMjbpFnv8=; b=KIypcbv2gOl8o3eFSGBQwIQl4aoI3Ih2wb7XmQCMQ4icjIbxLF0ucXi/QtCriYvglT 3Eq5dzxOOYBkAfe3HhfcM6q+BjdNVHPG+dgI3qGCnuEQD6qt89d5piZAfp71XXX673aT O4A7F+1DlxhqrwtmnpOSSVM7u4/efk92RsIvIlRfZErqHI0v5RarFyUqrjSqQ98C1VNZ rybCTcW98InSFmM+WSY81UziRb//GZJqBx8j/LlCz0Gn5Lcvec1b6iQiHvtj0FORdBgS AFA1KYCE5RRWoYlwK0SVuE/4uLDJsV1QZWBBhl69KkvTlKl3vK2bvqOu8l7Ma68IQEMQ 6WDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kqvx0EeP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j8-v6si48413340plk.0.2018.06.05.10.16.56; Tue, 05 Jun 2018 10:17:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kqvx0EeP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753055AbeFERPg (ORCPT + 99 others); Tue, 5 Jun 2018 13:15:36 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:37791 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753404AbeFERFv (ORCPT ); Tue, 5 Jun 2018 13:05:51 -0400 Received: by mail-qt0-f196.google.com with SMTP id q13-v6so3204642qtp.4; Tue, 05 Jun 2018 10:05:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=bF1CR2qsK8jOAYOkJS03kmIipTowewlCCJfMjbpFnv8=; b=kqvx0EePf1WoydO9npBcAo5YuQ+0gpCgP61aTTJo/3+ktmayeMPXO2ZuRBneZTTFOb 20XlufPCssZZDuNVyFxpW0kYlSE3UGj14nDE3v7UL6YeqibKmYRutrgMl+LAVs38iHMj qh/Q2+um6xm6bIImre/Ujko4/aAG1uM8AHBOWCrKzwfITcHFED6IX+1UYj0DdIRSXnoQ JEibuxYcEiK4RtwBUJqi36L/qKEOFCtLeCnwUNofA8SkPF1tcb/VZE2sK2m6Qk4F/nXP tQp4S5uwxjpEvhyxmjR5POH1d6/nPsL68Pqa8pG/+wrKS5Yq1peKPXn8glCra+4tByzz JPVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=bF1CR2qsK8jOAYOkJS03kmIipTowewlCCJfMjbpFnv8=; b=t/vKMGxqKKX36y5TjAEOEdQeNVgHtCG6FhiXCXdjJkm+EcbYtdCyoeuO/tu8OsT5H/ QfuFg1TE/qPELRtylRLc0tffI2MTyFBw8xFdGC1dsO8qaOx6gLcXSjt4BElvar2UIC2Q lLW+46o2AQsDv7mQRTDaiY7+6ZTy9D01p1OoNSIAhUGjK88BlFYgaLN8jLy/BiNS7FsM w7EOd9ugLn9PWDJZECd+e9zJAeW9oLQ7UCFOFMAK/vg2w7pcFn8s9hOGEV3NT/iTosyv mQrvYVsQ8DzfOrsnnsJvRWJemVDbtOAeDzH0iTw7/1mLfYsOeSciZKFU8dE80kGV2m3Z S2gw== X-Gm-Message-State: APt69E2k4WH65zMXNaINq01Zd9wmXnE5mC0xN1rVof2IY7C9r/O6i5Pf APxQzj1pAYu94E85lCRQoB8hSfjaMyBkIq9QK00= X-Received: by 2002:ac8:32f3:: with SMTP id a48-v6mr24118362qtb.404.1528218351061; Tue, 05 Jun 2018 10:05:51 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a0c:98f9:0:0:0:0:0 with HTTP; Tue, 5 Jun 2018 10:05:50 -0700 (PDT) In-Reply-To: References: From: Andy Shevchenko Date: Tue, 5 Jun 2018 20:05:50 +0300 Message-ID: Subject: Re: [PATCH v10 0/5] Kernel parameter parser cleanup/enhancement To: Michal Suchanek Cc: Jonathan Corbet , Arnd Bergmann , Frederic Weisbecker , Ingo Molnar , Aaron Wu , Tony Luck , Andrew Morton , Thomas Gleixner , "Steven Rostedt," , Laura Abbott , Dominik Brodowski , Alexey Dobriyan , Tom Lendacky , Jeffrey Hugo , Baoquan He , Ilya Matveychikov , Linux Documentation List , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 5, 2018 at 7:43 PM, Michal Suchanek wrote: > Hello, > > due to work on the fadump_extra_args I looked at the kernel parameter parser > and found its grammar rather curious. > > It supports double quotes but not any other quoting characters so double quotes > cannot be quoted. What's more, the quotes can be anywhere in the parameter > name or value and are interpteted but are removed only from start and end of > the parameter value. > > These are the patches not specific to fadump which somewhat straighten the > qouting grammar to make it on par with common shell interpreters. I didn't notice any use of string_unescape_*() functionality. So, your patch is kinda very specific to some narrow subset of escaping and unescaping stuff. Thus, it's still not on par with shell, right? > > Specifically double and single quotes can be used for quoting as well as > backslashes with the usual shell semantic. All quoting characters are removed > while the parameters are parsed. > > Previous versions (including the fadump part) can be found here: > > https://www.mail-archive.com/linuxppc-dev@lists.ozlabs.org/msg126148.html > https://www.mail-archive.com/linuxppc-dev@lists.ozlabs.org/msg123639.html > > Thanks > > Michal > > Michal Suchanek (5): > lib/cmdline.c: Add backslash support to kernel commandline parsing. > Documentation/admin-guide: backslash support in kernel arguments. > init/main.c: simplify repair_env_string. > lib/cmdline.c: Implement single quotes in commandline argument > parsing. > Documentation/admin-guide: single quotes in kernel arguments. > > Documentation/admin-guide/kernel-parameters.rst | 5 +- > init/main.c | 13 ++--- > lib/cmdline.c | 63 +++++++++++++++---------- > 3 files changed, 46 insertions(+), 35 deletions(-) > > -- > 2.13.6 > -- With Best Regards, Andy Shevchenko