apk3: wrong ACLs applied when initializing new system
example:
q66@rimi: /home/q66/cports-orig$ sudo mkdir test
q66@rimi: /home/q66/cports-orig$ sudo apk --root test --repository /home/q66/cports-orig/packages/main --keys-dir /home/q66/cports-orig/etc/keys --initdb add base-files
(1/1) Installing base-files (0.1-r0)
OK: 0 MiB in 1 packages
q66@rimi: /home/q66/cports-orig$ ls -l test
total 56
lrwxrwxrwx 1 65534 65534 7 Apr 15 02:39 bin -> usr/bin
drwxr-xr-x 2 65534 65534 4096 Apr 15 02:39 boot
drwxr-xr-x 2 65534 65534 4096 Apr 15 02:39 dev
drwxr-xr-x 6 65534 65534 4096 Apr 15 02:39 etc
drwxr-xr-x 2 65534 65534 4096 Apr 15 02:39 home
lrwxrwxrwx 1 65534 65534 7 Apr 15 02:39 lib -> usr/lib
drwxr-xr-x 2 65534 65534 4096 Apr 15 02:39 media
drwxr-xr-x 2 65534 65534 4096 Apr 15 02:39 mnt
drwxr-xr-x 2 65534 65534 4096 Apr 15 02:39 opt
dr-xr-xr-x 2 root root 4096 Apr 15 02:39 proc
drwxr-x--- 2 65534 65534 4096 Apr 15 02:39 root
drwxr-xr-x 3 65534 65534 4096 Apr 15 02:39 run
lrwxrwxrwx 1 65534 65534 7 Apr 15 02:39 sbin -> usr/bin
drwxr-xr-x 2 65534 65534 4096 Apr 15 02:39 sys
drwxrwxrwx 2 65534 65534 4096 Apr 15 02:39 tmp
drwxr-xr-x 8 65534 65534 4096 Apr 15 02:39 usr
drwxr-xr-x 10 root root 4096 Apr 15 02:39 var
The base-files
in my case is the first package that gets installed, containing /etc/passwd
and /etc/group
besides other things. However, the idcache does not account for it, and gives all these files the fallback owner. When installing a larger metapackage (like base-minimal
that installs base-files
first, most of the installed files still have wrong ownership. Only from certain point onwards (when scriptlets are first run) do the files have correct owner/group.
A quick solution for this would be to make root
special, and always pre-populate that in the idcache (by the time more users are added, the passwd
should be readable) but maybe you have a better solution in mind?