Bug 178005

Summary: setuid periodic checks do dumb diff of file information; emits unnecessary noise
Product: Base System Reporter: Enji Cooper <ngie>
Component: confAssignee: freebsd-bugs (Nobody) <bugs>
Status: Open ---    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description Enji Cooper freebsd_committer freebsd_triage 2013-04-20 20:20:02 UTC
The setuid periodic script is checking the ls -l output of files and diffing it versus old data instead of just checking whether or not the mode has changed, which results in a lot of noise in the periodic emails that get sent out whenever an installworld is run. Here's the code that does this ( ls -liTd in etc/periodic/security/100.chksetuid )...

46         MP=`mount -t ufs,zfs | awk '$0 !~ /no(suid|exec)/ { print $3 }'`
47         find -sx $MP /dev/null -type f \
48             \( -perm -u+x -or -perm -g+x -or -perm -o+x \) \
49             \( -perm -u+s -or -perm -g+s \) -exec ls -liTd \{\} \+ |
50         check_diff setuid - "${host} setuid diffs:"

While this might catch other issues (files being modified), it really doesn't make sense why this script should be doing this. Furthermore, changing the system locale will mess up output with -T in use because it's very locale dependent.

Ultimately, the only things that should really matter are:
1. Whether or not the permissions changed.
2. The path for the permissions (so the result can be properly correlated and diffed).

For debuggability the inode number and date should be included in the email, but not in the diff parsing. Thus, check_diff in etc/periodic/security/security.functions should be modified to only diff certain fields, potentially.

How-To-Repeat: - Run 100.chksetuid .
- make installworld .
- Reboot.
- Run 100.chksetuid .
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:58:49 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped