Is it possible to revert old -r behavior when config can be placed
outside of the chroot point?

A change 6 days ago has introduced the testing flag "-T"
where also the code locality was improved. This moved the
reading of the configuration file after the chroot() command.

This is fixed now and is commented in the source code
Many thanks for the good bug report!

-g

On 14.08.20 08:51, oleg wrote:
Hello.

I noticed that the naviserver behavior in the chroot mode (command line
switch -r <path>) has changed in the latest version of the server
(4.77.20a).

Now the configuration is loaded by the server AFTER performing the
chroot, so the config file located out of the chroot box becomes
inaccessible.

Script to reproduce (var NS contains buildname):

rm -rf /tmp/ns
mkdir /tmp/ns
mkdir /tmp/ns/etc
mkdir /tmp/ns/bin
mkdir /tmp/ns/lib
grep nsadmin /etc/passwd > /tmp/ns/etc/passwd
cp -a /opt/$NS/bin/init.tcl /tmp/ns/bin/
cp -a /opt/$NS/lib/tcl8.6 /tmp/ns/lib/
echo error error > /tmp/ns.tcl
/opt/$NS/bin/nsd -V
sudo env -i TCL_LIBRARY=/lib/tcl8.6 /opt/$NS/bin/nsd -u nsadmin -t
/tmp/ns.tcl -r /tmp/ns -f

Outputs for current and older naviserver:
---
NaviServer/4.99.20a
    Tag:             ae638d77dc90
    Built:           Aug 13 2020 at 12:48:41
    Tcl version:     8.6
    Platform:        linux
[13/Aug/2020:17:28:11][72992.7f12f0199740][-main:conf-] Notice: OpenSSL
1.1.1c FIPS  28 May 2019 initialized
[13/Aug/2020:17:28:11][72992.7f12f0199740][-main:conf-] Notice: binder:
started [13/Aug/2020:17:28:11][72992.7f12f0199740][-main:conf-] Fatal:
config: can't open configuration file '/tmp/ns.tcl': 'No such file or
directory' [13/Aug/2020:17:28:11][72992.7f12f0199740][binder] Notice:
binder: stopped
--
--
NaviServer/4.99.19
    Tag:             tar-4.99.19
    Built:           Aug 13 2020 at 16:41:28
    Tcl version:     8.6
    Platform:        linux
[13/Aug/2020:17:27:47][72960.7fc289aa6740][-main-] Notice: OpenSSL
1.1.1c FIPS  28 May 2019 initialized
[13/Aug/2020:17:27:47][72960.7fc289aa6740][-main-] Notice: binder:
started [13/Aug/2020:17:27:47][72960.7fc289aa6740][-main-] Error: error
error while executing
"error error"
(context: config eval)
[13/Aug/2020:17:27:47][72960.7fc289aa6740][-main-] Fatal: config error
[13/Aug/2020:17:27:47][72960.7fc289aa6740][binder] Notice: binder:
stopped
---

Is it possible to revert old -r behavior when config can be placed
outside of the chroot point?

Regards,
Oleg/


_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel


_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to