]> Git Repo - buildroot-mgba.git/commitdiff
package/audit: Fix type output on log folder creation
authorJosé Pekkarinen <[email protected]>
Fri, 1 Oct 2021 06:20:52 +0000 (09:20 +0300)
committerArnout Vandecappelle (Essensium/Mind) <[email protected]>
Mon, 11 Oct 2021 21:03:55 +0000 (23:03 +0200)
Testing buildroot 2021.05 I observed that after first
boot I was having the following folders:

/context:
/system_u:object_r:auditd_log_t

The root of this problem turned to be a difference in the
output of $(selabel_lookup -b file -k /var/log/audit) called
by S02auditd that from this version on looks like:

$ selabel_lookup -b file -k /var/log/audit
Default context: system_u:object_r:auditd_log_t

This patch will cut it to retrieve the type piece only. Unfortunately,
audit has no options to create machine-readable output that is
guaranteed not to change, so that's the best we can do.

Signed-off-by: José Pekkarinen <[email protected]>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <[email protected]>
package/audit/S02auditd

index 0eef881cee1a12ffdb8f685e7a9c8792225bbcec..dd3dc22d6d42a321a3cad979ca7835fd1c356ee7 100644 (file)
@@ -20,7 +20,7 @@ start(){
        # the directory with SELinux permissions if possible
        command -v selabel_lookup >/dev/null 2>&1
        if [ $? = 0 ]; then
        # the directory with SELinux permissions if possible
        command -v selabel_lookup >/dev/null 2>&1
        if [ $? = 0 ]; then
-               mkdir -p /var/log/audit -Z `selabel_lookup -b file -k /var/log/audit`
+               mkdir -p /var/log/audit -Z `selabel_lookup -b file -k /var/log/audit | cut -d ' ' -f 3`
        else
                mkdir -p /var/log/audit
        fi
        else
                mkdir -p /var/log/audit
        fi
This page took 0.037937 seconds and 4 git commands to generate.