Bug 57013 - BIND9 includes temporary files as zone; crashes
BIND9 includes temporary files as zone; crashes
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: DNS
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-6-errata
Assigned To: Philipp Hahn
Florian Best
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2024-01-31 09:12 CET by Philipp Hahn
Modified: 2024-03-07 13:07 CET (History)
0 users

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 6: Setup Problem: Issue for the setup process
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.069
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2024-01-31 09:12:47 CET
I was investigating a BIND9 zone file and opened it in `vim`, which creates a temporary file in /etc/bind/univention.conf.d/.
I then triggered some zone change, which included  in `/etc/bind/univention.conf`:
> include "/etc/bind/univention.conf.d/.256.in-addr.arpa.swp";

That change also triggered a reload of BIND9, which then crashed and failed to start again:
```
Jan 31 05:33:06 dc20 named[20315]: loading configuration from '/etc/bind/named.conf'
Jan 31 05:33:06 dc20 named[20315]: /etc/bind/univention.conf.d/.256.in-addr.arpa.swp:1: unknown option 'b0VIM'
```

This is caused by `services/univention-bind/bind.py:postrun()`:
```python
365             for f in os.listdir(NAMED_CONF_DIR):
366                 if not f.endswith('.proxy'):
367                     named_conf.write('include "%s";\n' % _quote_config_parameter(os.path.join(NAMED_CONF_DIR, f)))                                                                                                                      
368                 else:
369                     proxy_conf.write('include "%s";\n' % _quote_config_parameter(os.path.join(NAMED_CONF_DIR, f)))
```

`listdir()` returns all files including "hidden files".
Comment 1 Philipp Hahn univentionstaff 2024-03-04 20:05:08 CET
[bug/50385] e5f04c9e89 refactor(DNS): valid zone file name
 services/univention-bind/bind.py | 43 ++++++++++++++++++++-----------------------
 1 file changed, 20 insertions(+), 23 deletions(-)

[bug/50385] c6fa169743 fix(DNS): Ignore invalid zone files
 doc/errata/staging/univention-bind.yaml   | 6 ++++--
 services/univention-bind/bind.py          | 8 +++++---
 services/univention-bind/debian/changelog | 1 +
 3 files changed, 10 insertions(+), 5 deletions(-)

Package: univention-bind
Version: 14.0.6-1
Branch: ucs_5.0-0
Scope: errata5.0-6

Package: univention-directory-manager-modules
Version: 15.0.25-16
Branch: ucs_5.0-0
Scope: errata5.0-6
Comment 2 Florian Best univentionstaff 2024-03-05 11:42:17 CET
OK: invalid DNS zone files are ignored by the listener
OK: advisory