[x] add tests (need to ignore file size, swapfile, etc..., and timestamp)
In this pull request, we are ensuring the dirs and files in the / root path of the temproot is as close as the 'real' one as possible.
$SANDBOX_DIR/temproot is now being created with the same permission as the host, and every other directories are created with the same mode as the real one.
Symlinks are now also created in the unshare, and removed after unshare finishes.
Tests are created to check the mode, ownership, and symlink of the files in the / directory.
Known issues
In the test, we're ignoring files with the name swap.
And also /proc, our current mount -t proc proc /proc invocation are creating the /proc dir with nobody and nogroup ownership.
This PR currently assumes there are no other files in the root dir besides the swap.img.
In this pull request, we are ensuring the dirs and files in the
/
root path of the temproot is as close as the 'real' one as possible.$SANDBOX_DIR/temproot
is now being created with the same permission as the host, and every other directories are created with the same mode as the real one. Symlinks are now also created in the unshare, and removed after unshare finishes. Tests are created to check the mode, ownership, and symlink of the files in the/
directory.Known issues In the test, we're ignoring files with the name swap. And also /proc, our current
mount -t proc proc /proc
invocation are creating the /proc dir with nobody and nogroup ownership.This PR currently assumes there are no other files in the root dir besides the swap.img.
Fixes #80 Fixes #139