| Summary: | net-dns/bind init script (named) should remove commented text for pid-file directive | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Pontus Viking <meradan> |
| Component: | [OLD] Server | Assignee: | Gentoo Linux bug wranglers <bug-wranglers> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | normal | ||
| Priority: | High | ||
| Version: | 2005.0 | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
The net-dns/bind-9.2.5-r6 init script parses the config file for the directive "pid-file". When extracting the string for this directive, care is not taken to ensure that lines containing comments ( //... ) are extracted correctly. The current extraction looks like this: PIDFILE=$(grep "pid-file" ${CHROOT}/etc/bind/named.conf | \ egrep -v ".*[#,//].*pid-file" | \ head -n 1 | \ sed -ne 's:.*pid-file\(.*\)\"\(.*\)\";:\2:p') [ -n "$PIDFILE" ] || PIDFILE=/var/run/named/named.pid With a config line looking like this: pid-file "/var/run/named/named.pid"; // location of pid file the above code will produce the faulty PIDFILE variable of /var/run/named/named.pid // location of pid file If the sed command is changed to sed -ne 's:.*pid-file\(.*\)\"\(.*\)\";\(.*\):\2:p' the result will be the correct /var/run/named/named.pid Reproducible: Always Steps to Reproduce: 1. In named.conf, declare pid-file "/var/run/named/named.pid"; //comment 2. Run /etc/init.d/named start Actual Results: * Starting named ... usage: named [-c conffile] [-d debuglevel] [-f|-g] [-n number_of_cpus] [-p port] [-s] [-t chrootdir] [-u username] named: extra command line arguments [ !! ] Expected Results: * Starting named ... [ ok ]