Bug 444 - setusercontext is called too late
setusercontext is called too late
Status: RESOLVED FIXED
Product: unbound
Classification: Unclassified
Component: server
1.4.15
Other OpenBSD
: P5 enhancement
Assigned To: unbound team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-03 20:23 CEST by stu-nlnetlabs
Modified: 2012-04-05 11:30 CEST (History)
1 user (show)

See Also:


Attachments
setusercontext before chroot (1.60 KB, application/octet-stream)
2012-04-03 20:23 CEST, stu-nlnetlabs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description stu-nlnetlabs 2012-04-03 20:23:57 CEST
Created attachment 204 [details]
setusercontext before chroot

setusercontext() is called too late, at least on OpenBSD it needs /etc/login.conf and doesn't have access to it once chrooted.

Apr  3 19:10:52 symphytum unbound: cannot stat /etc/login.conf: No such file or directory
Apr  3 19:10:52 symphytum unbound: could not set user environment: No such file or directory
Apr  3 19:10:52 symphytum unbound: [24594:0] warning: unable to setusercontext _unbound: No such file or directory

Attached diff (submitted by Bjorn Ketelaars) moves it up above the chroot, as was also done in NSD r3151.
Comment 1 Wouter Wijngaards 2012-04-05 11:30:41 CEST
Hi Stu,

Patch in svn trunk.  Thanks for the report and thanks to Bjorn for the patch :-)

Best regards,
   Wouter