mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-17 10:04:41 +00:00
Firewall / Alias - when reading current alias content using pfctl, make sure to ignore empty lines. closes https://github.com/opnsense/core/issues/5788
This commit is contained in:
parent
11e8c26079
commit
021786612c
@ -158,8 +158,10 @@ if __name__ == '__main__':
|
||||
if alias.get_parser():
|
||||
# only try to replace the contents of this alias if we're responsible for it (know how to parse)
|
||||
sp = subprocess.run(['/sbin/pfctl', '-t', alias_name, '-T', 'show'], capture_output=True, text=True)
|
||||
for line in sp.stdout.strip().split('\n'):
|
||||
alias_pf_content.append(line.strip())
|
||||
tmp = sp.stdout.strip()
|
||||
if len(tmp) > 0:
|
||||
for line in tmp.split('\n'):
|
||||
alias_pf_content.append(line.strip())
|
||||
|
||||
if (len(alias_content) != len(alias_pf_content) or alias_changed_or_expired):
|
||||
# if the alias is changed, expired or the one in memory has a different number of items, load table
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user