I found that nsd 3.0.1 invoked with -t option fails to write
xfrdfile at least exit time.
I guess that the reason is that the pathname of chroot()
jail is NOT striped from pathname of xfrdfile which is done
for dbfile and pidfile in server.c::server_init().
The following quick hack seems to fixes the problem.
Thanks for the bugreport (bug #146). I have incorporated the patch into
NSD svn. Below my addition to the patch so the 'difffile:' entry also
works. Fix will be released in NSD 3.0.2.
Thanks for the fix,
Wouter
Koh-ichi Ito wrote:
Hello,
I found that nsd 3.0.1 invoked with -t option fails to write
xfrdfile at least exit time.
I guess that the reason is that the pathname of chroot()
jail is NOT striped from pathname of xfrdfile which is done
for dbfile and pidfile in server.c::server_init().
The following quick hack seems to fixes the problem.
I only examined my fix on the condition nsd.conf has
"xfrdfile:" entry. On this case, my fix works fine. But
without "xfrdfile:" entry, the value relies on the compile
time default. On this case, the assignment
if(!statefile)
statefile = XFRDFILE;
is done on xfrd-disk.c::xfrd_write_state(), so pathname of
chroot() jail is not stripped from XFRDFILE.
By the brute-force tactics, do same process on
xfrd_write_state() may help, but it may not elegant way.
Speak on DIFFFILE, the default value of "difffile:", the
assignment of default value is done on
options.c::nsd_options_create(), so it seems not to involved
the issue.
Yes you are right, I've treated xfrdfile like difffile is treated (in
nsd_options_create()). This saves work in other places. Changes are in
svn repository.
This then fixes chroot using default xfrdfile entry.