On Ubuntu, the rust-coreutils multi-call binary (similar to busybox) uses hardlinks for each of the utilities. It also uses an Ubuntu-specific patch that requires /proc/self/exe to point to a file with the same name as argv[0].
When using nitro-cli build-enclave to convert a container with this package installed, the hardlinks get converted into symlinks. This then results in the coreutils binaries not working at all:
root@(none):~# ls -la /usr/bin/mkdir
Security violation: Requested utility `ls` does not match executable name:
/usr/bin/coreutils
root@(none):~# /bin/busybox ls -la /usr/bin/mkdir
lrwxrwxrwx 1 root root 32 Sep 26 18:16 /usr/bin/mkdir -> ../lib/cargo/bin/coreutils/mkdir
root@(none):~# /bin/busybox ls -la /usr/bin/../lib/cargo/bin/coreutils/mkdir
lrwxrwxrwx 1 root root 25 Oct 22 10:39 /usr/bin/../lib/cargo/bin/coreutils/mkdir -> ../../../../bin/coreutils
On Ubuntu, the rust-coreutils multi-call binary (similar to busybox) uses hardlinks for each of the utilities. It also uses an Ubuntu-specific patch that requires
/proc/self/exeto point to a file with the same name asargv[0].When using
nitro-cli build-enclaveto convert a container with this package installed, the hardlinks get converted into symlinks. This then results in the coreutils binaries not working at all: