diff --git a/scripts/check-privileges.py b/scripts/check-privileges.py index 7da8d7e..14499c8 100644 --- a/scripts/check-privileges.py +++ b/scripts/check-privileges.py @@ -350,7 +350,8 @@ def valid_roots(env): for r in ROOT_VARS: v = env.get(r, "") if v and v.startswith("/") and os.path.normpath(v) == v and v != "/" and not has_dotdot(v) and v.startswith(DRIVE_NAMESPACE): - out.append(v) + # as the box: under HDD_PATH only appdata/ is a root (backups/ holds the recovery units with app secrets) + out.append(v + "/appdata" if r == "HDD_PATH" else v) return out diff --git a/scripts/test_gate_decoys.py b/scripts/test_gate_decoys.py index cf30624..15c5e1a 100644 --- a/scripts/test_gate_decoys.py +++ b/scripts/test_gate_decoys.py @@ -883,6 +883,7 @@ def privileges_cases(): run("FACT: a second service EXTENDS homepage (inherits the socket)", {"homepage/docker-compose.yml": homepage.replace("volumes:\n homepage_config:", " evil:\n image: evil/x:1\n extends:\n service: homepage\nvolumes:\n homepage_config:")}, 1, ("extends homepage",)) run("FACT: homepage's healthcheck runs a shell", {"homepage/docker-compose.yml": homepage.replace('["CMD", "wget", "--spider", "-q", "http://127.0.0.1:3000"]', '["CMD-SHELL", "id"]')}, 1, ("healthcheck the list names",)) run("FACT: a YAML merge key (the box expands it, the reader does not)", {"a/docker-compose.yml": "x-base: &base\n privileged: true\n" + compose(" <<: *base\n")}, 1, ("anchor",)) + run("FACT: the drive's backups/ through ${HDD_PATH} (not appdata/)", {"a/docker-compose.yml": compose(vol=" - ${HDD_PATH}/backups:/b\n")}, 1, ("bind /mnt/felhom-drives/check/felhom-data/backups",)) run("FACT: a variable in a bind's options", {"a/docker-compose.yml": compose(vol=" - ${HDD_PATH}/a:/a:${MODE}\n")}, 1, ("variable in its target or options",)) run("GENUINE: homepage bumped to a new tag of the same image", {"homepage/docker-compose.yml": homepage.replace("homepage:v1.13.2", "homepage:v1.14.0")}, 0) run("FACT: the list copy differs from the controller's", {"a/docker-compose.yml": compose()}, 1, ("differs",), controller_copy=allow.replace("homepage", "glance"))