AOSC-Dev / ciel-rs

A tool for controlling AOSC OS packaging environments using multi-layer filesystems and containers (version 3)
MIT License
8 stars 5 forks source link

Certain folder ownerships were lost when using `ciel load-os` #1

Open late-in-autumn opened 2 years ago

late-in-autumn commented 2 years ago

When I was using ciel load-os to load my own rootfs tarball that contains folders with the ownership of root:blah where blah is some regular user's home group, the extracted folder would incorrectly have the ownership of root:root. But if I manually tar xf then the ownership would be correct. See the example below:

root@kagami /var/lib/ciel # ciel load-os https://archmips.local.suzushi.ro/dist/arch-mipsr6-20210721-rootfs.txz
info: Downloading base OS tarball...
ciel load-os   16.30s user 1.78s system 94% cpu 19.196 total
root@kagami /var/lib/ciel # ls -l .ciel/container/dist/var/cache 
总用量 0
drwx------ 2 root root 23  7月 21 21:21 ldconfig
drwxrwxr-x 2 root root  6  7月 21 21:21 makepkg
drwxr-xr-x 3 root root 17  7月 21 21:21 pacman
drwx------ 2 root root  6  7月 21 21:21 private
root@kagami /var/lib/ciel # rm -rf .ciel/container/dist/*       
zsh: sure you want to delete all 19 files in /var/lib/ciel/.ciel/container/dist [yn]? y
root@kagami /var/lib/ciel # tar xf arch-mipsr6-20210721-rootfs.txz -C .ciel/container/dist 
tar xf arch-mipsr6-20210721-rootfs.txz -C .ciel/container/dist  15.27s user 1.71s system 132% cpu 12.780 total
root@kagami /var/lib/ciel # ls -l .ciel/container/dist/var/cache 
总用量 0
drwx------ 2 root root      23  7月 21 20:02 ldconfig
drwxrwxr-x 2 root hachiroku  6  7月 14 20:25 makepkg
drwxr-xr-x 3 root root      17  6月 15 01:31 pacman
drwx------ 2 root root       6  6月 15 01:31 private

Note that the var/cache/makepkg folder has ownership of root:root if extracted with ciel load-os, but the correct ownership should be root:hachiroku as shown in the result created with manual tar xf.

liushuyu commented 2 years ago

Fixed in https://github.com/alexcrichton/tar-rs/commit/c3e2cb848afea5954f485f593668e69e0106513e.

Upstream has not made a new tag yet.