This is necessary so that "r" can be nested and are always executed in
the same order.
Fixes: #10191
ItemArray *j;
j = ordered_hashmap_get(items, prefix);
+ if (!j)
+ j = ordered_hashmap_get(globs, prefix);
if (j) {
r = set_ensure_allocated(&j->children, NULL);
if (r < 0)
--- /dev/null
+#! /bin/bash
+#
+# Verifies the issues described by https://github.com/systemd/systemd/issues/10191
+#
+
+set -e
+set -x
+
+rm -rf /tmp/test-prefix
+
+mkdir /tmp/test-prefix
+touch /tmp/test-prefix/file
+
+systemd-tmpfiles --remove - <<EOF
+r /tmp/test-prefix
+r /tmp/test-prefix/file
+EOF
+
+! test -f /tmp/test-prefix/file
+! test -f /tmp/test-prefix
+
+mkdir /tmp/test-prefix
+touch /tmp/test-prefix/file
+
+systemd-tmpfiles --remove - <<EOF
+r /tmp/test-prefix/file
+r /tmp/test-prefix
+EOF
+
+! test -f /tmp/test-prefix/file
+! test -f /tmp/test-prefix