mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
authpf(8) read_config() should chop off trailing white space
if administrator mistakenly types into configuration file anchor=authpf_test where 'authpf_test' is followed by white space, the authpf(8) is going to use anchor 'authpf_test ' instead of the 'authpf_test' which is defined in pf.conf(5) as 'anchor authpf_test/*' issue kindly reported and patch submitted by Avinash Duduskar <avinash.duduskar (_at_) gmail (_dot_) com> OK sashan@ PR: 296958 MFC after: 1 week Obtained from: OpenBSD, sashan <[email protected]>, 2d12a8e44d Sponsored by: Rubicon Communications, LLC ("Netgate")
This commit is contained in:
1 parent
54e6dec44b
commit
04f25ef716
1 file changed
+2
-2
@@ -404,8 +404,8 @@ read_config(FILE *f)
|
||||
if (ap != &pair[2])
|
||||
goto parse_error;
|
||||
|
||||
tp = pair[1] + strlen(pair[1]);
|
||||
while ((*tp == ' ' || *tp == '\t') && tp >= pair[1])
|
||||
tp = pair[1] + strlen(pair[1]) - 1;
|
||||
while (tp >= pair[1] && (*tp == ' ' || *tp == '\t'))
|
||||
*tp-- = '\0';
|
||||
|
||||
if (strcasecmp(pair[0], "anchor") == 0) {
|
||||
|
||||
Reference in new issue
Block a user