lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <9ad57a14bf19e798c5a3643e57a28e829a8518a2.1505231820.git.msuchanek@suse.de>
Date:   Tue, 12 Sep 2017 18:01:41 +0200
From:   Michal Suchanek <msuchanek@...e.de>
To:     Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Paul Mackerras <paulus@...ba.org>,
        Michael Ellerman <mpe@...erman.id.au>,
        Jonathan Corbet <corbet@....net>, Jessica Yu <jeyu@...nel.org>,
        Rusty Russell <rusty@...tcorp.com.au>,
        Jason Baron <jbaron@...mai.com>,
        Mahesh Salgaonkar <mahesh@...ux.vnet.ibm.com>,
        Hari Bathini <hbathini@...ux.vnet.ibm.com>,
        Michal Suchanek <msuchanek@...e.de>,
        Daniel Axtens <dja@...ens.net>,
        Nicholas Piggin <npiggin@...il.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Michael Neuling <mikey@...ling.org>,
        Thiago Jung Bauermann <bauerman@...ux.vnet.ibm.com>,
        "Sylvain 'ythier' Hitier" <sylvain.hitier@...il.com>,
        David Howells <dhowells@...hat.com>,
        Ingo Molnar <mingo@...nel.org>,
        Kees Cook <keescook@...omium.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        "Steven Rostedt," <rostedt@...dmis.org>,
        Michal Hocko <mhocko@...e.com>,
        Laura Abbott <lauraa@...eaurora.org>,
        Tejun Heo <tj@...nel.org>,
        Tom Lendacky <thomas.lendacky@....com>,
        Viresh Kumar <viresh.kumar@...aro.org>,
        Lokesh Vutla <lokeshvutla@...com>, Baoquan He <bhe@...hat.com>,
        Ilya Matveychikov <matvejchikov@...il.com>,
        linuxppc-dev@...ts.ozlabs.org, linux-doc@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH v8 3/6] lib/cmdline.c: Remove quotes symmetrically.

Remove quotes from argument value only if there is qoute on both sides.

Signed-off-by: Michal Suchanek <msuchanek@...e.de>
---
 lib/cmdline.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/lib/cmdline.c b/lib/cmdline.c
index 171c19b6888e..6d398a8b63fc 100644
--- a/lib/cmdline.c
+++ b/lib/cmdline.c
@@ -227,14 +227,12 @@ char *next_arg(char *args, char **param, char **val)
 		*val = args + equals + 1;
 
 		/* Don't include quotes in value. */
-		if (**val == '"') {
-			(*val)++;
-			if (args[i-1] == '"')
-				args[i-1] = '\0';
+		if ((args[i-1] == '"') && ((quoted) || (**val == '"'))) {
+			args[i-1] = '\0';
+			if (!quoted)
+				(*val)++;
 		}
 	}
-	if (quoted && args[i-1] == '"')
-		args[i-1] = '\0';
 
 	if (args[i]) {
 		args[i] = '\0';
-- 
2.10.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ