]> git.proxmox.com Git - pmg-api.git/commitdiff
d/postinst: avoid processing non existent '*' templates due to glob
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 3 Jun 2020 17:37:32 +0000 (19:37 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 3 Jun 2020 17:37:40 +0000 (19:37 +0200)
if there's no file at all in that path the wildcard glob won't expand
and POSIX shell will use '*' as filename, which will then fail.

Avoid that.

Reported-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
debian/postinst

index d3b17cf770c7de3cfd3c902b6e37343c06a5e5ac..bde65bbeb8328a0029b60be865772bc2fdd25e6a 100644 (file)
@@ -5,6 +5,7 @@ set -e
 
 ucf_register_templates() {
     for template in /etc/pmg/templates/*; do
+       [ -e "$template" ] || continue;
        template_base=$(basename "${template}")
        if echo "${template_base}" | grep -q '\.ucf-'; then
                continue