package/audit: replace deprecated matchpathcon calls from init script
authorJosé Pekkarinen <jose.pekkarinen@unikie.com>
Fri, 23 Jul 2021 09:51:13 +0000 (12:51 +0300)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sat, 24 Jul 2021 21:36:49 +0000 (23:36 +0200)
This patch replace matchpathcon calls in the auditd init script by
calls to selabel_lookup. Indeed, matchpathcon is now deprecated, and
this causes warning during the boot process.

Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/audit/S02auditd

index 2ecf0f1df9318156b114ad000efcf4455e56abfb..0eef881cee1a12ffdb8f685e7a9c8792225bbcec 100644 (file)
@@ -18,9 +18,9 @@ start(){
 
        # Create dir to store log files in if one doesn't exist. Create
        # the directory with SELinux permissions if possible
-       command -v matchpathcon >/dev/null 2>&1
+       command -v selabel_lookup >/dev/null 2>&1
        if [ $? = 0 ]; then
-               mkdir -p /var/log/audit -Z `matchpathcon -n /var/log/audit`
+               mkdir -p /var/log/audit -Z `selabel_lookup -b file -k /var/log/audit`
        else
                mkdir -p /var/log/audit
        fi