diff options
| author | Yi Zhao <yi.zhao@windriver.com> | 2020-07-07 16:29:13 +0800 |
|---|---|---|
| committer | Joe MacDonald <joe@deserted.net> | 2020-07-14 18:56:06 -0400 |
| commit | 8b79480663bc9de2343e0146ed8d3d0e59ab48be (patch) | |
| tree | 85d3c47967f2630144a5671320174a46fa8ac580 | |
| parent | 9e986d7d794f044464e1af914ddbcd57d8f1c2e9 (diff) | |
| download | meta-selinux-8b79480663bc9de2343e0146ed8d3d0e59ab48be.tar.gz | |
audit: set correct security context for /var/log/audit
By default /var/log is a symbolic link of /var/volatile/log. But
restorecon does not follow symbolic links then we will encounter the
following error when set /var/log/audit directory:
$ /sbin/restorecon -F /var/log/audit
/sbin/restorecon: SELinux: Could not get canonical path for /var/log/audit restorecon: Permission denied.
Use readlink to find the real path before set security context.
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
| -rw-r--r--[-rwxr-xr-x] | recipes-security/audit/audit/auditd | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/recipes-security/audit/audit/auditd b/recipes-security/audit/audit/auditd index cda2e43..6aa7f94 100755..100644 --- a/recipes-security/audit/audit/auditd +++ b/recipes-security/audit/audit/auditd | |||
| @@ -86,7 +86,7 @@ do_reload() { | |||
| 86 | 86 | ||
| 87 | if [ ! -e /var/log/audit ]; then | 87 | if [ ! -e /var/log/audit ]; then |
| 88 | mkdir -p /var/log/audit | 88 | mkdir -p /var/log/audit |
| 89 | [ -x /sbin/restorecon ] && /sbin/restorecon -F /var/log/audit | 89 | [ -x /sbin/restorecon ] && /sbin/restorecon -F $(readlink -f /var/log/audit) |
| 90 | fi | 90 | fi |
| 91 | 91 | ||
| 92 | case "$1" in | 92 | case "$1" in |
