Odd order of chroot and chdir calls
Hello, in https://gitlab.freedesktop.org/realmd/realmd/-/blob/master/service/realm-daemon.c#L509 there's back-to-back calls to chdir(2)
and chroot(2)
. This probably works with absolute paths but is unlikely to work with relative paths.
It's more common to use chroot(somewhere)
followed by chdir("/")
, as this will work with both absolute and relative paths, and reinforces that the process should now be in the new root.
Thanks