debian-forge-composer/internal/blueprint
Achilleas Koutsou f2849e2165 blueprint: sanitize user home directories
If a home directory has a trailing slash, the `useradd` command fails to
set the correct selinux contexts for the home directory on creation.
This can lead to various issues, but the one that we came across was
that the ~/.ssh directory and authorized_keys file cannot be read by
sshd and we couldn't log in to the system.

This only manifests if the user is created through the kickstart file
because:
1. `useradd` does not set the selinux contexts when creating the
   directory
2. Anaconda runs `restorecon` on the home directory and authorized_keys
   file when it creates them, but uses the install-time mount path
   `/mnt/sysroot/...` for which selinux does not have contexts.

In most cases we get around this bug because we run `setfiles` on the
tree at the end of our pipelines.
For the ostree case, the relabeling in Anaconda is done correctly.
2022-03-28 14:08:57 +02:00
..
blueprint.go weldr: Add distro field to blueprints 2021-07-12 08:58:42 +02:00
blueprint_test.go internal/blueprint: allow filesystem size specified with units 2021-11-02 18:32:47 +01:00
customizations.go blueprint: sanitize user home directories 2022-03-28 14:08:57 +02:00
customizations_test.go blueprint: add CheckAllowed helper 2021-08-28 09:20:19 +02:00