When doing a send and receive of a btrfs volume the file capabilities are not preserved. In the original root volume: # find /usr -type f | xargs getcap /usr/bin/systemd-detect-virt = cap_dac_override,cap_sys_ptrace+ep /usr/bin/ping = cap_net_admin,cap_net_raw+ep /usr/bin/ping6 = cap_net_admin,cap_net_raw+ep /usr/bin/rcp = cap_net_bind_service+ep /usr/bin/rlogin = cap_net_bind_service+ep /usr/bin/rsh = cap_net_bind_service+ep /usr/sbin/arping = cap_net_raw+ep /usr/sbin/clockdiff = cap_net_raw+ep /usr/sbin/mtr = cap_net_raw+ep In the received volume: # find /mnt/root_received/usr -type f | xargs getcap <empty> Versions used: btrfs-progs-3.12-1.fc20.x86_64 kernel-3.12.7-300.fc20.x86_64
Reproduced on Fedora Rawhide with: kernel-3.15.0-0.rc3.git0.1.fc21.x86_64 btrfs-progs-3.14-1.fc21.x86_64 cp -a preserves these, but btrfs send/receive drops them.
Hi, also with 3.18.5-201.fc21.x86_64 capabilities are dropped, any idea when this will be supported? regards
Hi again, forgot btrfs-progs version. btrfs-progs-3.18.1-1.fc21.x86_64 regards
I cannot reproduce it with kernel 4.1-rc and progs from current git (equivalent to 4.0.1). A quick test with kernel 3.14 and progs 3.18 (or 3.14) works as well.
Oh well, chown resets the capabilities, I've missed that in http://thread.gmane.org/gmane.comp.file-systems.btrfs/42655
Proposed fix https://patchwork.kernel.org/patch/6491351/ , feel free to test and reopen the bug eventually.
This problem exists again with btrfs-progs 4.14 and kernel 4.14.14 (on Archlinux) # find /usr/bin -type f | xargs getcap /usr/bin/rsh = cap_net_bind_service+ep /usr/bin/rcp = cap_net_bind_service+ep /usr/bin/rlogin = cap_net_bind_service+ep /usr/bin/ping = cap_net_raw+ep /usr/bin/mtr-packet = cap_net_bind_service,cap_net_raw+ep /usr/bin/sway = cap_sys_ptrace+eip /usr/bin/dumpcap = cap_dac_override,cap_net_admin,cap_net_raw+eip send/received volume: # find /usr/bin -type f | xargs getcap <nothing>