From: selva.nair@...277... Date: Tue, 29 Nov 2022 13:37:56 -0500 Message-Id: <20221129183756.657793-1-selva.nair@...277...> In-Reply-To: <20221129180534.657529-1-selva.nair@...277...> References: <20221129180534.657529-1-selva.nair@...277...> MIME-Version: 1.0 Subject: [Openvpn-devel] [PATCH v2] pull-filter: ignore leading "spaces" in option names List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: openvpn-devel@lists.sourceforge.net 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) -- 2.34.1