From 5692fdefb17f49c0165b0e41c0a12ffb1a6c8252 Mon Sep 17 00:00:00 2001 From: Andrii Sultanov Date: Mon, 3 Aug 2026 08:27:58 +0000 Subject: [PATCH] scripts/attach-static-vdis: Toggle nullglob to fix behavior on empty dir If STATE_DIR exists but is not empty, then globs for it in the form of STATE_DIR/* and STATE_DIR/*/vdi-uuid will be passed in literal form, causing errors like: cat: /etc/xensource/static-vdis-test/*/vdi-uuid: No such file or directory Toggle nullglob instead, which turns the whole glob string empty and does not enter the body of the loop iterating over the matches. Signed-off-by: Andrii Sultanov (cherry picked from commit ae4d3ec4e46253860c7d7b3bf101d777121b976c) --- scripts/attach-static-vdis | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/attach-static-vdis b/scripts/attach-static-vdis index 2745fa82ada..cab5688a05b 100755 --- a/scripts/attach-static-vdis +++ b/scripts/attach-static-vdis @@ -2,6 +2,8 @@ # # attach-static-vdis Attaches any statically-configured VDIs to dom0 +shopt -s nullglob + STATE_DIR=/etc/xensource/static-vdis [ -d ${STATE_DIR} ] || exit 0 @@ -52,7 +54,7 @@ start() { clear_stale_state attach_all RC=$? - echo + echo return $RC }