[haiku-development] Re: chroot and package daemon bug
- From: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
- To: haiku-development@xxxxxxxxxxxxx
- Date: Thu, 11 Aug 2016 23:42:16 +0200
Hi Adrien,
Am 11/08/2016 um 22:38 schrieb Adrien Destugues:
My plan is to have the package kit provide it's filesystem root to the
package daemon, so the package daemon can reply with the correct package
mount points.
1) The package kit queries the current io_context to get the root vnode
from it (this is what is changed by chroot).
2) The vnode (or most likely, the dev and inode numbers) are sent to the
package daemon in GetInstallLocationInfo
3) The package daemon uses the given node as a root, instead of using
the default fSystemRoot (PackageDaemon.cpp:87)
4) The correct package dirs are returned, the code works as expected.
Does this sound sane, or did I miss something?
Depends :-)
You also mentioned security issues -- those would not be fixed by this,
as you could send any root to the package daemon, and it would just take
it for granted.
However, a solution for this problem would be a bit more involved.
I'm not familiar with the package daemon myself, so I'm not sure it can
work correctly here, either. Is the package daemon even responsible for
any packages (activated or not) within chroot?
Maybe the kit should notice it's inside a chroot and solve the issue
differently instead? At least, that would be my preferred solution if
the package daemon is otherwise not used there at all.
Bye,
Axel.
Other related posts: