Skip to content

io: load passwd/group lazily and use a root fallback in idcache

q66 requested to merge q66/apk-tools:fix-early-perms into master

In order to address the problem with early file ownership (before passwd/group exists), do a few changes here:

  1. Only mark the idcache as empty if we actually manage to get the passwd/group file. Otherwise, try again next time. Before, the old behavior would just ensure the idcache would never actually try to populate, as it would check for existence of passwd/group during installation of first package, which would inevitably fail.
  2. During the brief period of non-existence of passwd/group, use an explicit fallback for the root user, in order to ensure the early files have correct permissions. There should be no files not owned by root during this time, and root is the one uid/gid that we are always sure of.

Fixes #10837 (closed)

Merge request reports