[PATCH] host/rootfs: Always fail if there is a globbing problem

Demi Marie Obenour
2025-12-05T16:27:21Z

Better to fail than to continue after an unknown problem has happened.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
---
host/rootfs/image/etc/s6-rc/static-nodes/up | 2 +-
host/rootfs/image/usr/bin/assign-devices | 2 +-
host/rootfs/image/usr/bin/run-vmm | 2 +-
host/rootfs/image/usr/bin/vm-import | 2 +-
host/rootfs/image/usr/bin/vm-start | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/host/rootfs/image/etc/s6-rc/static-nodes/up b/host/rootfs/image/etc/s6-rc/static-nodes/up
index e1bdd4061441b39d7b46575a05754331970b951e..66f4fa7954beffc201f0985b3be10bd6a98f1d3a 100644
--- a/host/rootfs/image/etc/s6-rc/static-nodes/up
+++ b/host/rootfs/image/etc/s6-rc/static-nodes/up
@@ -2,7 +2,7 @@
# SPDX-FileCopyrightText: 2021 Alyssa Ross <hi@alyssa.is>

pipeline {
- elglob -0 modules_devname /lib/modules/*/modules.devname
+ elglob -w0 modules_devname /lib/modules/*/modules.devname
/etc/parse-devname $modules_devname
}

diff --git a/host/rootfs/image/usr/bin/assign-devices b/host/rootfs/image/usr/bin/assign-devices
index 58dd3cc0dfc3ceec4c82988755ed1ddbd224abfd..99988d64dbf2802cdbfd69c299f899ccbc1cf390 100755
--- a/host/rootfs/image/usr/bin/assign-devices
+++ b/host/rootfs/image/usr/bin/assign-devices
@@ -2,7 +2,7 @@
# SPDX-License-Identifier: EUPL-1.2+
# SPDX-FileCopyrightText: 2025 Alyssa Ross <hi@alyssa.is>

-elglob -0 devices /sys/bus/pci/drivers/vfio-pci/????:??:??.?
+elglob -w0 devices /sys/bus/pci/drivers/vfio-pci/????:??:??.?
forx -pE device { $devices }

# This script is designed to be re-entrant and called multiple times.
diff --git a/host/rootfs/image/usr/bin/run-vmm b/host/rootfs/image/usr/bin/run-vmm
index ba8b59c2677408acdd01c2eda3cf2dd60992d881..1a09c93bd1ac121c72f8132393979bf03663f1c2 100755
--- a/host/rootfs/image/usr/bin/run-vmm
+++ b/host/rootfs/image/usr/bin/run-vmm
@@ -22,7 +22,7 @@ background -d {

# Find any net-provider relationships this VM is involved in
cd /run/vm/by-id
- elglob -0 providers */config/providers/net/*
+ elglob -w0 providers */config/providers/net/*
forx -pE path { $providers }
backtick -E client_id {
awk -v path=${path} -F / "BEGIN { split(path, p); print p[1] }"
diff --git a/host/rootfs/image/usr/bin/vm-import b/host/rootfs/image/usr/bin/vm-import
index c1d1bbc106b8034c82c8e09c1bff81a06c233fe4..06f90d83509c318bc364d9c0e111878235ae50d3 100755
--- a/host/rootfs/image/usr/bin/vm-import
+++ b/host/rootfs/image/usr/bin/vm-import
@@ -3,7 +3,7 @@
# SPDX-FileCopyrightText: 2023-2024 Alyssa Ross <hi@alyssa.is>

cd $2
-elglob -0 names *
+elglob -w0 names *

forx -po0 -E name { $names }

diff --git a/host/rootfs/image/usr/bin/vm-start b/host/rootfs/image/usr/bin/vm-start
index 67480e5215d8a8260ce3f03c67f71ba8f210c291..94d08437b75f59a728be0e8a1efbc5af3b44f6c5 100755
--- a/host/rootfs/image/usr/bin/vm-start
+++ b/host/rootfs/image/usr/bin/vm-start
@@ -7,7 +7,7 @@ foreground { s6-rc -bu change vm-env }
foreground {
redirfd -w 2 /dev/null
cd /run/vm/by-id/${1}/config/providers/net
- elglob -0 providers *
+ elglob -w0 providers *
forx -pE provider { $providers }
backtick -E provider_id {
backtick -E id_path { readlink /run/vm/by-name/${provider} }

---
base-commit: 92e219e7c08c479d216a46d2736ea9d229ff034d
change-id: 20251203-globfail-41a5db0de497

--
Sincerely,
Demi Marie Obenour (she/her/hers)