Files
floci/docker
TiM 7e3ff3c5ee fix(docker): re-own the configured persistent path, not only /app/data (#4525)
* fix(docker): re-own the configured persistent path, not only /app/data

The entrypoint's root phase re-owned /app/data, while the writability probe
and the boot-time check both use FLOCI_STORAGE_PERSISTENT_PATH. A named volume
mounted at any other path arrived root-owned, the chown never reached it, and
with non-memory storage the container refused to start.

The root phase now re-owns the same directory the probe checks. The path is
resolved physically first and never re-owned when it resolves to /, since it
now comes from an environment variable.

* test(docker): make the chown helper prove the root phase completed

An empty chown log also results from a root phase that stops before the
privilege drop, so the 'skips a missing dir' case could pass for the wrong
reason. The helper now reports when the drop was never reached.

* fix(docker): resolve the persistent path without CDPATH

A relative FLOCI_STORAGE_PERSISTENT_PATH was resolved with cd, which searches
CDPATH and prints the directory it picks, so a set CDPATH could send the chown
to another directory or corrupt its argument. The resolution now clears it.
The test stub also records chown's full arguments, so the owner and the
recursive flag are asserted, not only the target.

* fix(docker): compare the persistent path to / by inode

bash keeps a leading // through cd -P and pwd -P, so the string test let
FLOCI_STORAGE_PERSISTENT_PATH=// reach a recursive chown on the native images,
which run bash as sh. -ef compares device and inode and holds in every shell,
and chown --preserve-root refuses / on its own as a second guard. The test
harness can now run the entrypoint under a chosen shell, and a bash case pins
the // spelling that dash alone cannot reach.
2026-09-28 22:57:18 -05:00
..