| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | |
| 3 | set -eu |
| 4 | |
| 5 | |
| 6 | if [scip-shell system . . `[`. ! -f /etc/selinux/configscip-shell filesystem . . `/etc/selinux/config`. ]; then |
| 7 | return |
| 8 | fi |
| 9 | |
| 10 | if ! command -v sefcontext_compile >/dev/nullscip-shell filesystem . . `/dev/null`. 2>&1; then |
| 11 | echoscip-shell system . . echo. "Pre-compiled SELinux file contexts not built: sefcontext_compile not found (missing package selinux-utils)" |
| 12 | return |
| 13 | fi |
| 14 | |
| 15 | . /etc/selinux/configscip-shell source . . `/etc/selinux/config`. |
| 16 | |
| 17 | if [scip-shell system . . `[`. -z ${SELINUXTYPE+x} ]; then |
| 18 | echoscip-shell system . . echo. "Pre-compiled SELinux file contexts not built: SELINUXTYPE not defined in /etc/selinux/config" |
| 19 | return |
| 20 | fi |
| 21 | |
| 22 | if [scip-shell system . . `[`. ! -d "/etc/selinux/$SELINUXTYPE/contexts/files" ]; then |
| 23 | echoscip-shell system . . echo. "Pre-compiled SELinux file contexts not build: configuration for policy $SELINUXTYPE not found" |
| 24 | return |
| 25 | fi |
| 26 | |
| 27 | if [scip-shell system . . `[`. -f "/etc/selinux/$SELINUXTYPE/contexts/files/file_contexts" ]; then |
| 28 | sefcontext_compile "/etc/selinux/$SELINUXTYPE/contexts/files/file_contexts" || truescip-shell system . . true. |
| 29 | fi |
| 30 | |
| 31 | if [scip-shell system . . `[`. -f "/etc/selinux/$SELINUXTYPE/contexts/files/file_contexts.homedirs" ]; then |
| 32 | sefcontext_compile "/etc/selinux/$SELINUXTYPE/contexts/files/file_contexts.homedirs" || truescip-shell system . . true. |
| 33 | fi |
| 34 | |
| 35 | if [scip-shell system . . `[`. -f "/etc/selinux/$SELINUXTYPE/contexts/files/file_contexts.local" ]; then |
| 36 | sefcontext_compile "/etc/selinux/$SELINUXTYPE/contexts/files/file_contexts.local" || truescip-shell system . . true. |
| 37 | fi |