From: Selva Nair Date: Wed, 30 Nov 2022 10:55:02 +0000 (-0500) Subject: pull-filter: ignore leading "spaces" in option names X-Git-Tag: v2.6_beta1~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f02946ff9900a37dd36f61748173d53eca01adf9;p=thirdparty%2Fopenvpn.git pull-filter: ignore leading "spaces" in option names 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 Message-Id: <20221130105502.662374-1-selva.nair@gmail.com> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg25582.html Signed-off-by: Gert Doering --- diff --git a/src/openvpn/options.c b/src/openvpn/options.c index b7b34c9cc..e48e4b459 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)