Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EINVAL for certain utime invocations when inside a chroot #84

Open
ihucos opened this issue Oct 5, 2018 · 0 comments
Open

EINVAL for certain utime invocations when inside a chroot #84

ihucos opened this issue Oct 5, 2018 · 0 comments

Comments

@ihucos
Copy link

ihucos commented Oct 5, 2018

When unionfs-fuse is used from inside an chroot, utime fails for some invocations:

$mkdir /tmp/rootfs
$ pip3 install plash # use https://github.com/ihucos/plash/ to get an alpine root filesystem with unionfs-fuse installed on it.
$ plash export-tar --from alpine --apk unionfs-fuse | tar -x -C /tmp/rootfs
$ sudo su
# mount -t proc proc /tmp/rootfs/proc/
# mount -o bind /dev /tmp/rootfs/dev/
# chroot /tmp/rootfs ash
# mkdir /tmp/a /tmp/aa /tmp/aaa
# unionfs  -o cow /tmp/a=RW:/tmp/aa=RO /tmp/aaa
# touch /tmp/aaa/filex
# touch -m /tmp/aaa/filex
touch: /tmp/aaa/filex: Invalid argument

This would work with e.g ubuntus touch binary, it depends on how exactly utime-like system calls are called.

Here an example for something that works as expected

utimensat(AT_FDCWD, "/", [UTIME_OMIT, UTIME_NOW], 0) = 0

And something that does fail with EINVAL

utimensat(AT_FDCWD, "/", NULL, 0) = -1

I am still trying to get into it. In case anyone wonder, I need this for a container engine. Here is the issue, where I write some notes to it: ihucos/plash#69

Note that this is not about mounting an unionfs and then chrooting into it but calling unionfs from inside a chroot.

EDIT:
I think the snippet I posted makes you run chroot as root on top of an user-owned file system. Its's really just for debugging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant