From patchwork Wed Nov 30 10:55:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selva Nair X-Patchwork-Id: 2872 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director14.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id IYJwG7k2h2NlDQAAIUCqbw (envelope-from ) for ; Wed, 30 Nov 2022 05:55:53 -0500 Received: from proxy15.mail.iad3b.rsapps.net ([172.31.255.6]) by director14.mail.ord1d.rsapps.net with LMTP id WB6cGrk2h2MoKwAAeJ7fFg (envelope-from ) for ; Wed, 30 Nov 2022 05:55:53 -0500 Received: from smtp10.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy15.mail.iad3b.rsapps.net with LMTPS id UBnOE7k2h2MIZAAAhyf7VQ (envelope-from ) for ; Wed, 30 Nov 2022 05:55:53 -0500 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp10.gate.iad3b.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=gmail.com; dmarc=fail (p=none; dis=none) header.from=gmail.com X-Suspicious-Flag: YES X-Classification-ID: 8e36e620-709d-11ed-bb86-52540055034d-1-1 Received: from [216.105.38.7] ([216.105.38.7:54410] helo=lists.sourceforge.net) by smtp10.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id BC/08-14087-8B637836; Wed, 30 Nov 2022 05:55:52 -0500 Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1p0KkN-0005tc-0Z; Wed, 30 Nov 2022 10:55:23 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1p0KkM-0005tW-3u for openvpn-devel@lists.sourceforge.net; Wed, 30 Nov 2022 10:55:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=4ADXk+tDQdKd7qFt+tDVo/sGitDn0HiD7H3OEsFyoQs=; b=MJFDsVqvNNgdE6tZ7orQdYjd+F t+U/68EKt59gC8qr2jZjtpC7ij1oGwCQ7bVxmpyxCV56RNDtNGsZLXdZQc7zli2XIZtUYa1NozUoF wTqIF2T6y3+zpAU5ScPHv7cHwLeP/oovRilvYFSdod1V9NLAhYvllh+vLcTB/Ff/kPNA=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=4ADXk+tDQdKd7qFt+tDVo/sGitDn0HiD7H3OEsFyoQs=; b=mncx9ExiKXuuiOgHz8MzNuds9b d0+Ph9vKWrxsiGL5iLGrRyPyA3cVG2yFYU50JbACJtGuKRlJ/KPGNQ6agYg2+vwy5A0ufO00xaldL OEqkxNklKUXy+KsOgjswnQZsIu89HdL3szShxxYuzUG7qztf9Ns0Q40UdQmMkgdyM2Qk=; Received: from mail-io1-f48.google.com ([209.85.166.48]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1p0KkI-001Jz3-HN for openvpn-devel@lists.sourceforge.net; Wed, 30 Nov 2022 10:55:22 +0000 Received: by mail-io1-f48.google.com with SMTP id q21so12035962iod.4 for ; Wed, 30 Nov 2022 02:55:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4ADXk+tDQdKd7qFt+tDVo/sGitDn0HiD7H3OEsFyoQs=; b=YstaElh03ElrkAfh02hGGMGygaTIaJkw0lyhcp1PHQ94KqsFem6V6/WN32Q/ruQWta rewuiyIjfbQdsaDLe6aRV/zoWoOpKftMObnyOplmK/EkTtv8NtsGPt0hTVEC0TyVA8vC 2ZTVrS/f1zOviyJMbQco/JsCzAOPbGBnaMSUB1A75V/v7P1EU9qZJfr+Jzln12TEROKq 2jSpFzlEKijkGPJMhdI3+tEgCIZPa+sup5YfNF/kokrScmek2Q5kQ0PJkGV6TvkJkpuC xii4JYl95oYE+qy2N+S+rE7D3EMnjwxYl+j8q/lHft9upWrtFLWAGGigZ/JTiXP2fwhk RyYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4ADXk+tDQdKd7qFt+tDVo/sGitDn0HiD7H3OEsFyoQs=; b=0YeB1czpg1NFYiEt1YccMOhuEchkVWbEDEb5hyz7CocC0zBL1LSDAqW7rPEZmWdJCS I/pOE4QmniY3ePrue21JCTnDRwM3zaAns5N9a9YaZJl3e/wbCglDVh0b6G6fMn3rWUza VlbUBFC6LSdkwkjVgc4D0/n03XMHSPANceGuWZO64YpC5LxfjDi6GsnJrKRey0VEy7ml pH6WNAtiQF7pO7cn08dBfvdjJPOEmxOVR2SqtFHpZaisfGLeRZAdDrI+d8FY2+GZUuBg 5goswLRVz5v/k4wOgz/ofYitYoeuiOf7Pw7o4ks3Ti1AkzibcnNTcFPaule33PkbErdk 4Gaw== X-Gm-Message-State: ANoB5pm9khVD6tAPazFl8lvJOuoI4ooQpoN0o8+/ZPqtFr+LPlMkYez1 Oy++L5YiJTwK8x9Se/EySgrIjEXVNxA= X-Google-Smtp-Source: AA0mqf7qzF0ZYYY715dbWERdZJUwhjyfZh5N9YkBli5i15gb4+RDmJ0Rey8lg3oBhffBlLKfYLJeJA== X-Received: by 2002:a6b:d819:0:b0:6de:90a6:6b02 with SMTP id y25-20020a6bd819000000b006de90a66b02mr18806607iob.86.1669805712718; Wed, 30 Nov 2022 02:55:12 -0800 (PST) Received: from uranus.sansel.ca (bras-vprn-tnhlon4053w-lp130-01-70-51-222-66.dsl.bell.ca. [70.51.222.66]) by smtp.gmail.com with ESMTPSA id q9-20020a056e02096900b003032a97913asm447585ilt.17.2022.11.30.02.55.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Nov 2022 02:55:12 -0800 (PST) From: selva.nair@gmail.com To: openvpn-devel@lists.sourceforge.net Date: Wed, 30 Nov 2022 05:55:02 -0500 Message-Id: <20221130105502.662374-1-selva.nair@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221129180534.657529-1-selva.nair@gmail.com> References: <20221129180534.657529-1-selva.nair@gmail.com> MIME-Version: 1.0 X-Spam-Report: Spam detection software, running on the system "util-spamd-2.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Selva Nair It seems sometimes comma-separated pulled options have an offending leading space. Not sure whether that is an error, but the change here matches the behaviour of option parsing. v2: fix typo in commit message v3: space() --> isspace() Content analysis details: (-0.2 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.166.48 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [selva.nair[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.166.48 listed in wl.mailspike.net] X-Headers-End: 1p0KkI-001Jz3-HN Subject: [Openvpn-devel] [PATCH v3] pull-filter: ignore leading "spaces" in option names X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox From: Selva Nair It seems sometimes comma-separated pulled options have an offending leading space. Not sure whether that is an error, but the change here matches the behaviour of option parsing. v2: fix typo in commit message v3: space() --> isspace() Signed-off-by: Selva Nair Acked-by: Gert Doering --- src/openvpn/options.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/openvpn/options.c b/src/openvpn/options.c index b7b34c9c..cba99846 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -5385,6 +5385,12 @@ apply_pull_filter(const struct options *o, char *line) return true; } + /* skip leading spaces matching the behaviour of parse_line */ + while(isspace(*line)) + { + line++; + } + for (f = o->pull_filter_list->head; f; f = f->next) { if (f->type == PUF_TYPE_ACCEPT && strncmp(line, f->pattern, f->size) == 0)