apk3: mkpkg: support explicit ownership of files?
After investigating apk3 for my downstream distro use a bit, I came across one potential blocker. I need to be able to supply a way to set user/group ownership on certain files - currently I have my own generator for the packages, so I can do that just fine, but if creating packages becomes apk's responsibility, this is no longer going to be possible.
The reason for this is that in my case the builds run unprivileged in a sandbox that uses namespaces. This precludes creation of new users/groups (or rather, I can create them, but trying to use chown
for any user/group other than the current primary will result in EINVAL
- this makes sense because as an unprivileged user, the user within the namespace is mapped to your own user, and you can't really touch other uids and gids).
However, I don't really care about ownership of the files within the sandbox per se. All I care about is the ownership within the archive, since that's what will determine what user/group the files will be owned by. Would it be possible to add some kind of option to explicitly override ownerships on certain files, as well as ensure the ownership for everything else goes to root? (since things would be run with an unprivileged user effective uid/gid). Alternatively, maybe you have a better idea how to do this?
Thanks