On 05/29/2012 04:33 PM, Jordi Moles Blanco wrote:
3. You copy /dev/null in the jail "the FreeBSD way", that is,
cp /dev/null /jailkitpath/dev/null
I know little about FreeBSD, but on Linux you cannot copy devices with
cp. You have to create a device with mknod.
Well... although this /dev/null thing allows you to run some binaries,
it fails when for example you want to use git. The reason is because it
needs /dev/urandom and that doesn't exist in FreeBSD. Actually, we do
have /dev/urandom
but...
# ls -la /dev/urandom
lrwxr-xr-x 1 root wheel 6 Nov 3 2011 /dev/urandom -> random
it's a mere link...
which causes problems because
/dev/random doesn't work the same way as /dev/urandom
in order to fix this...
we have to literally copy /dev/random into the jail, again with "cp" and
not "jk_cp"
cp /dev/random /jailkitpath/dev/urandom
cp /dev/random /jailkitpath/dev/random
actually, you have to run these commands and then "ctrl+c", that is,
cancel the commands, after a second or two. If you don't do that, the
"cp" command will continue to create random numbers and store them in
the /jailkitpath/dev/random file.
again, use mknod and not cp them. Copy them will indeed copy the
contents, and not create a device.
Olivier