From patchwork Tue Nov 29 18:37:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selva Nair X-Patchwork-Id: 2871 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director14.mail.ord1d.rsapps.net ([172.27.255.1]) by backend30.mail.ord1d.rsapps.net with LMTP id oPhdLKZRhmNXLQAAIUCqbw (envelope-from ) for ; Tue, 29 Nov 2022 13:38:30 -0500 Received: from proxy9.mail.iad3a.rsapps.net ([172.27.255.1]) by director14.mail.ord1d.rsapps.net with LMTP id GPDzK6ZRhmMHEwAAeJ7fFg (envelope-from ) for ; Tue, 29 Nov 2022 13:38:30 -0500 Received: from smtp31.gate.iad3a ([172.27.255.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy9.mail.iad3a.rsapps.net with LMTPS id oCRjI6ZRhmOnLAAAGuSQww (envelope-from ) for ; Tue, 29 Nov 2022 13:38:30 -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: smtp31.gate.iad3a.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: 04b1411c-7015-11ed-8c0c-5254003d9392-1-1 Received: from [216.105.38.7] ([216.105.38.7:38922] helo=lists.sourceforge.net) by smtp31.gate.iad3a.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 0D/B0-28631-5A156836; Tue, 29 Nov 2022 13:38:30 -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 1p05Ud-0004Oh-9J; Tue, 29 Nov 2022 18:38:07 +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 1p05Ub-0004Ob-Va for openvpn-devel@lists.sourceforge.net; Tue, 29 Nov 2022 18:38:05 +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=Ez24P/vl10WAqkTv2meDwoVtbPtr93sH4GEYGquhwKE=; b=BcK8jDnjp4a9+DQRtRi4mbY0+d BdLfQtfToYU/WYw4VZqlSDhBdxuuX+/GUHpol1xXlfIbkW3aaxM8JFGh43bUzqIDXuWoD3vZsjBS7 aS1aqzGeUPWcZqpLeyQRVG4nX+kzQUOYH90AZM6fzSCNVp69s5nZLB5N6Zy6Sx91GCmU=; 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=Ez24P/vl10WAqkTv2meDwoVtbPtr93sH4GEYGquhwKE=; b=j9IvKLwIk5Os+1s423cuyIhIUg q3D9sFBlFu/zJPD8GtgAhC4VYJIxVz4IDtSwY3onb8PIEA9j67lX5M0J4tYMr4dLxr7bdp7iHU2az 0uZlMr26OCTBn8aZ7ykN9oTvYVIonAZenSKQu5XxDyemQ883u05IoDRK2mLxBoIUyi+U=; Received: from mail-io1-f53.google.com ([209.85.166.53]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1p05Ub-0005ZN-EE for openvpn-devel@lists.sourceforge.net; Tue, 29 Nov 2022 18:38:05 +0000 Received: by mail-io1-f53.google.com with SMTP id y6so10699568iof.9 for ; Tue, 29 Nov 2022 10:38:05 -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=Ez24P/vl10WAqkTv2meDwoVtbPtr93sH4GEYGquhwKE=; b=JgAZxDR0eqfWE5sfUe9zKrPJUZn7cgXSsiWPflO0hfMgcdRuwCGYdqXBgqgMGCtO1p SootHZNzWqN//4r8AhSivQkwLG4U8EWrsEcSJU68RPiMulSajIMe9j+cCPWk4UA86p+e vSlxBsIOprjxsrrqCmnBMFLQYazNXaJrLqbpUARqkuNtvd3OtT6PxB6HfMAZWqxYYIEy dY+B1/V4lZYKCL4nWUUiZNIPcHpNcMBkIu1wdt7cTDdbipD5akajPQl0+c4+jGYNQJ6B KUgKh6c2YJcVPszqHJYWVWuDY7agfbfiEWnZdA4vvI56vpDuDxKViM+SHkc+JOx8opCc 3ghA== 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=Ez24P/vl10WAqkTv2meDwoVtbPtr93sH4GEYGquhwKE=; b=nWibAzkM4OUJJtZ11o36FUJ6WkPIgUk5P/W9YLjk8rf9cIRy+06VRB28VelV0/dAZv /m/2vRtZZeKsQDWl9djDHmYdDL8PA+s6GDbwlHxdZCh6TPhPBbcw5zevkFR5ujol0YxU pxcLBcp1+ZGH8m3+VNacFkWZpVuNtDcdGK9IK3bliOoAppOGPPiGsczJtt1eTpcxxqDb T0qwr8aFsXvbB0KIcwcduJvyzQ6VUBAD7lW/GoaGm0NDFHKzbhwwMW9jkLryvWqPJk/b sBwVIJe69nVDH92qf/CjI5AdnKRxeVVCjCLUUS9kpZmO6grOvU/EEcIZ4lGM/xENlBcT VP1g== X-Gm-Message-State: ANoB5pmhOP0rn07EcyFetmjKHacpjNb1LAK7KHh4pkcDhw10Tz0hQ9wM mvoOhMEWytkYVr7xKV5ug0NwTabCa2o= X-Google-Smtp-Source: AA0mqf5x3/0oGNLm4lSNx/x1FDpUyQzRGo0JsStOMMP8tcm7cK+IB7E+oM5cYFRJAVNSm/64q1tR2g== X-Received: by 2002:a05:6638:4907:b0:389:fe43:3395 with SMTP id cx7-20020a056638490700b00389fe433395mr484180jab.316.1669747079621; Tue, 29 Nov 2022 10:37:59 -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 h25-20020a05660208d900b006bb640769ecsm5613233ioz.13.2022.11.29.10.37.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 10:37:59 -0800 (PST) From: selva.nair@gmail.com To: openvpn-devel@lists.sourceforge.net Date: Tue, 29 Nov 2022 13:37:56 -0500 Message-Id: <20221129183756.657793-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-1.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. 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.53 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_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.166.53 listed in wl.mailspike.net] X-Headers-End: 1p05Ub-0005ZN-EE Subject: [Openvpn-devel] [PATCH v2] 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. Signed-off-by: Selva Nair --- src/openvpn/options.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/openvpn/options.c b/src/openvpn/options.c index b7b34c9c..94cbd659 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(*line && space(*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)