Capture other files in the user's home directory
Some checks failed
CI / test (push) Failing after 1m57s
Lint / test (push) Successful in 32s
Trivy / test (push) Successful in 27s

Such as `.bashrc`, `.bash_aliases`, `.profile`, if these files differ from the `/etc/skel` defaults
This commit is contained in:
Miguel Jacq 2026-01-05 15:02:22 +11:00
parent e68ec0bffc
commit a1433d645f
Signed by: mig5
GPG key ID: 59B3F0C24135C6A9
3 changed files with 110 additions and 1 deletions

View file

@ -819,7 +819,12 @@ def _manifest_from_bundle_dir(
group = str(u.get("primary_group") or owner)
break
mode = "0600" if mf.get("reason") == "authorized_keys" else "0644"
# Prefer the harvested file mode so we preserve any deliberate
# permissions (e.g. 0600 for certain dotfiles). For authorized_keys,
# enforce 0600 regardless.
mode = mf.get("mode") or "0644"
if mf.get("reason") == "authorized_keys":
mode = "0600"
ssh_files.append(
{
"dest": dest,