diff options
| -rwxr-xr-x | meta/recipes-core/volatile-binds/files/mount-copybind | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/meta/recipes-core/volatile-binds/files/mount-copybind b/meta/recipes-core/volatile-binds/files/mount-copybind index e32e675308..57a5ce5f21 100755 --- a/meta/recipes-core/volatile-binds/files/mount-copybind +++ b/meta/recipes-core/volatile-binds/files/mount-copybind | |||
| @@ -46,6 +46,12 @@ if [ -d "$mountpoint" ]; then | |||
| 46 | fi | 46 | fi |
| 47 | 47 | ||
| 48 | mount -o "bind$options" "$spec" "$mountpoint" | 48 | mount -o "bind$options" "$spec" "$mountpoint" |
| 49 | # restore the selinux context. | ||
| 50 | if command -v selinuxenabled > /dev/null 2>&1; then | ||
| 51 | if selinuxenabled; then | ||
| 52 | restorecon -R "$mountpoint" | ||
| 53 | fi | ||
| 54 | fi | ||
| 49 | fi | 55 | fi |
| 50 | elif [ -f "$mountpoint" ]; then | 56 | elif [ -f "$mountpoint" ]; then |
| 51 | if [ ! -f "$spec" ]; then | 57 | if [ ! -f "$spec" ]; then |
| @@ -53,4 +59,10 @@ elif [ -f "$mountpoint" ]; then | |||
| 53 | fi | 59 | fi |
| 54 | 60 | ||
| 55 | mount -o "bind$options" "$spec" "$mountpoint" | 61 | mount -o "bind$options" "$spec" "$mountpoint" |
| 62 | # restore the selinux context. | ||
| 63 | if command -v selinuxenabled > /dev/null 2>&1; then | ||
| 64 | if selinuxenabled; then | ||
| 65 | restorecon -R "$mountpoint" | ||
| 66 | fi | ||
| 67 | fi | ||
| 56 | fi | 68 | fi |
