Fix chroot(2) call in control process.
authorbluhm <bluhm@openbsd.org>
Fri, 22 Mar 2024 19:14:28 +0000 (19:14 +0000)
committerbluhm <bluhm@openbsd.org>
Fri, 22 Mar 2024 19:14:28 +0000 (19:14 +0000)
commit12690b15432155c8cdd2d0cd268bc11c914fd725
tree916bb5293affbbdeb130691a5760fe12505bd9c5
parent97ca6483dad3629b30f7d3c616adf94f36009e8e
Fix chroot(2) call in control process.

Use /var/empty as chroot directory.  Call chroot(2) before setresuid(2).
Do the error check correctly.  Call chdir(2) after chroot(2).

from spiros thanasoulas; with florian@ tb@; OK millert@
usr.sbin/lpd/control.c