Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More robust ausearch time input #135

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
More robust ausearch time input
Depending on what locale you were using, you may have time that would show AM or PM.
This would cause the time to be incorrect on noon and midnight rollovers. This change allows
all the output of strptime's %x and %X to be captured and provided to ausearch.
  • Loading branch information
kruton committed Mar 13, 2019
commit 3e7a8f2482d56df32669842161bd1a0156397edf
5 changes: 3 additions & 2 deletions python/sepolicy/sepolicy/templates/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@

if [ $# -eq 1 ]; then
if [ "$1" = "--update" ] ; then
time=`ls -l --time-style="+%x %X" TEMPLATEFILE.te | awk '{ printf "%s %s", $6, $7 }'`
rules=`ausearch --start $time -m avc --raw -se TEMPLATETYPE`
time=`date -r TEMPLATETYPE.te "+%x"`
date=`date -r TEMPLATETYPE.te "+%X"`
rules=`ausearch --start "$time" "$date" -m avc --raw -se TEMPLATETYPE`
if [ x"$rules" != "x" ] ; then
echo "Found avc's to update policy with"
echo -e "$rules" | audit2allow -R
Expand Down