Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stages/files: filter out non-existent paths before relabeling
The code that handles systemd unit enablement via preset will no op if disabling a systemd unit that is already disabled, which means that we wouldn't create a preset file in that case. But we did mark the preset file as needing relabeling unconditionally. Since `setfiles` errors out if you pass it a path that doesn't exist, this would break boot. Fix this by filtering out all entries that don't exist right before we call `setfiles`. Another approach would've been to only mark the file for relabeling if we actually did write the file, but this is more complex than it seems because the relabeling logic needs to know what is the first component in the path that had to be created. So we'd need logic both before and after file creation. This isn't user-reported; we hit this in a CI test.
- Loading branch information