From: Henrik Nordstrom <hno@ma...> - 2004-04-24 10:15:03
Something seems to have changed in how hostfs parses the filesystem flags
option. It no longer succeeds in specifying the location of the hostfs
directory and the uml instead always uses the host root (/).
Neither rootflags=/... for booting from hostfs or manual mount works. In
both cases it always gives the host root (/), not the specified directory.
Using the current 2.4 CVS, ported to 2.4.26.
Was previously using the almost current 2.4 CVS (before humfs), ported to
2.4.26-rc2 with no problem.
The attached patch fixes a number of hostfs problems in the current 2.4
tree. With this patch hostfs again has the same capabilities as before the
addition of humfs.
* Use the specified host directory like was done earlier, not hardcoded
* Allocate the root directory name. The mount flags is freed by the
* host_file.c was missing #include <string.h> (uses strlen, memcpy
etc..) (gcc warnings)
* make all hostfs files owned by root (uid=0), not file owner on the
- Give hostfs a real mount structure in the kernel superblock like humfs
has, allowing for storage of various mount flags and not only a root path.
- uid= mount flag to specify what uid the filesystem should be mounted
as inside the uml. [depends on the above]
- use "nobody" as uid if the host file uid is different from the host
uid running the uml. [almost a oneliner, independent of the above but
touches the same area]
- The hostfs "jail" option is not very secure in combination with the
ability to specify a root path. One can easily use .. or symlinks to
subvert this. The ability to specify a root path should maybe be disabled
if a jail path is specified. Chrooting would be a much better option.