From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753181AbeFERPh (ORCPT ); Tue, 5 Jun 2018 13:15:37 -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 X-Google-Smtp-Source: ADUXVKKJnGiETvb6zLxykhF/VCfrR8Nj6j23FDi/qr7FAchrs5Ym1I2fxm4XWNGtfBl6xucl88zXVTgtSNeoqDi/2xc= MIME-Version: 1.0 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 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