From 6f8c12deb46596df32fb1efe5c2116cb5df1f484 Mon Sep 17 00:00:00 2001 From: Paul Moore Date: Thu, 5 Sep 2024 13:05:35 -0400 Subject: [PATCH] all: fix the "Old style watch rules are slower" warning Signed-off-by: Paul Moore --- tests/fanotify/test | 2 +- tests/file_create/test | 2 +- tests/file_delete/test | 2 +- tests/file_rename/test | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/fanotify/test b/tests/fanotify/test index e4154da..2cd7d84 100755 --- a/tests/fanotify/test +++ b/tests/fanotify/test @@ -37,7 +37,7 @@ system("auditctl -D >& /dev/null"); # Create test rule. my $key = key_gen(); my $testfile = "/tmp/$key"; -system("auditctl -w $testfile -k $key"); +system("auditctl -a always,exit -F path=$testfile -k $key"); # Start fanotify watcher in the background. my $fanotify_pid = open3( undef, undef, undef, "$basedir/fanotify /tmp" ); diff --git a/tests/file_create/test b/tests/file_create/test index 65d14fc..04c20c2 100755 --- a/tests/file_create/test +++ b/tests/file_create/test @@ -41,7 +41,7 @@ my $dir = tempdir( TEMPLATE => '/tmp/audit-testsuite-XXXX', CLEANUP => 1 ); # set the directory watch my $key = key_gen(); -system("auditctl -w $dir -k $key"); +system("auditctl -a always,exit -F path=$dir -k $key"); # create a new file in the watched directory ( my $fh, my $filename ) = diff --git a/tests/file_delete/test b/tests/file_delete/test index 3bde29c..1571705 100755 --- a/tests/file_delete/test +++ b/tests/file_delete/test @@ -63,7 +63,7 @@ my $gid_fmt = getgrgid($uid); # set the directory watch my $key = key_gen(); -system("auditctl -w $dir -k $key"); +system("auditctl -a always,exit -F path=$dir -k $key"); # delete file unlink($filename); diff --git a/tests/file_rename/test b/tests/file_rename/test index 651aa3a..9349fc6 100755 --- a/tests/file_rename/test +++ b/tests/file_rename/test @@ -63,7 +63,7 @@ my $gid_fmt = getgrgid($uid); # set the directory watch my $key = key_gen(); -system("auditctl -w $dir -k $key"); +system("auditctl -a always,exit -F path=$dir -k $key"); # move/rename the file rename( $filename, $filename . "-new" );