Ignore files ending in - in the /etc/ dir e.g /etc/shadow-
Some checks failed
CI / test (push) Failing after 1m43s
Lint / test (push) Successful in 32s
Trivy / test (push) Successful in 23s

This commit is contained in:
Miguel Jacq 2026-01-05 15:48:17 +11:00
parent b5e32770a3
commit 91ec1b8791
Signed by: mig5
GPG key ID: 59B3F0C24135C6A9
2 changed files with 5 additions and 2 deletions

View file

@ -3,7 +3,7 @@
* Introduce `enroll explain` - a tool to analyze and explain what's in (or not in) a harvest and why. * Introduce `enroll explain` - a tool to analyze and explain what's in (or not in) a harvest and why.
* Centralise the cron and logrotate stuff into their respective roles, we had a bit of duplication between roles based on harvest discovery. * Centralise the cron and logrotate stuff into their respective roles, we had a bit of duplication between roles based on harvest discovery.
* Capture other files in the user's home directory such as `.bashrc`, `.bash_aliases`, `.profile`, if these files differ from the `/etc/skel` defaults * Capture other files in the user's home directory such as `.bashrc`, `.bash_aliases`, `.profile`, if these files differ from the `/etc/skel` defaults
* Ignore files that end with a tilde (probably backup files generated by editors) * Ignore files that end with a tilde or - (probably backup files generated by editors or shadow file changes)
# 0.2.3 # 0.2.3

View file

@ -102,7 +102,10 @@ class IgnorePolicy:
return "log_file" return "log_file"
# Ignore editor/backup files that end with a trailing tilde. # Ignore editor/backup files that end with a trailing tilde.
if path.endswith("~"): if path.endswith("~"):
return "tilde_backup" return "backup_file"
# Ignore backup shadow files
if path.startswith("/etc/") and path.endswith("-"):
return "backup_file"
if not self.dangerous: if not self.dangerous:
for g in self.deny_globs or []: for g in self.deny_globs or []: