[1/2] mount-copybind: fix shellcheck warning

Message ID 20220325184032.1880706-1-luca.boccassi@gmail.com
State Accepted, archived
Commit 56c7962a6c31acfe0e118f713954aeafd7e2d9c0
Headers show
Series [1/2] mount-copybind: fix shellcheck warning | expand

Commit Message

Luca Boccassi March 25, 2022, 6:40 p.m. UTC
From: Luca Boccassi <bluca@debian.org>

$ shellcheck meta/recipes-core/volatile-binds/files/mount-copybind

In meta/recipes-core/volatile-binds/files/mount-copybind line 54:
            mountcontext=",rootcontext=$(matchpathcon -n $mountpoint)"
                                                         ^---------^ SC2086: Double quote to prevent globbing and word splitting.

Did you mean:
            mountcontext=",rootcontext=$(matchpathcon -n "$mountpoint")"

For more information:
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...

Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
---
 meta/recipes-core/volatile-binds/files/mount-copybind | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/meta/recipes-core/volatile-binds/files/mount-copybind b/meta/recipes-core/volatile-binds/files/mount-copybind
index aad022c6e4..8bbb406b3a 100755
--- a/meta/recipes-core/volatile-binds/files/mount-copybind
+++ b/meta/recipes-core/volatile-binds/files/mount-copybind
@@ -48,7 +48,7 @@  if [ -d "$mountpoint" ]; then
     # If that fails, fall back to slower copy.
     if command -v selinuxenabled > /dev/null 2>&1; then
         if selinuxenabled; then
-            mountcontext=",rootcontext=$(matchpathcon -n $mountpoint)"
+            mountcontext=",rootcontext=$(matchpathcon -n "$mountpoint")"
         fi
     fi
     if ! mount -t overlay overlay -olowerdir="$mountpoint",upperdir="$spec",workdir="$overlay_workdir""$mountcontext" "$mountpoint" > /dev/null 2>&1; then