Browse code

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 <selva.nair@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
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 <gert@greenie.muc.de>

Selva Nair authored on 2022/11/30 19:55:02
Showing 1 changed files
... ...
@@ -5385,6 +5385,12 @@ apply_pull_filter(const struct options *o, char *line)
5385 5385
         return true;
5386 5386
     }
5387 5387
 
5388
+    /* skip leading spaces matching the behaviour of parse_line */
5389
+    while (isspace(*line))
5390
+    {
5391
+        line++;
5392
+    }
5393
+
5388 5394
     for (f = o->pull_filter_list->head; f; f = f->next)
5389 5395
     {
5390 5396
         if (f->type == PUF_TYPE_ACCEPT && strncmp(line, f->pattern, f->size) == 0)