Suggested 'minor enhancement' to fixfiles....

Tom London selinux at comcast.net
Fri May 21 18:16:09 UTC 2004


'fixfiles relabel' cleans out /tmp, including log files from previous
runs of fixfiles.  (I had just run 'fixfiles check' and didn't expect
to lose the log!).

Also, 'fixfiles relabel' does not log changes....

Does it make sense to change the 'relabel()' fn in fixfiles from:
    relabel() {
    echo "Cleaning out /tmp"
    rm -rf /tmp/.??* /tmp/*
    ${SETFILES} ${FC} ${FILESYSTEMS} 2>&1 | tee $LOGFILE
    }
to something like:
    relabel() {
    echo "Cleaning out /tmp (saving previous fixfiles logs)"
    find /tmp -maxdepth 1 -mindepth 1 | grep -v /tmp/fixfiles | xargs rm -rf
    ${SETFILES} -v ${FC} ${FILESYSTEMS} 2>&1 | tee $LOGFILE | grep -v "/usr/sbin/setfiles: relabeling"
    }

This way the changes are logged (but not displayed on the console),
and previous log files are retained.

tom




More information about the fedora-selinux-list mailing list