Skip to content

container.sh upgrade: keep data snapshots private - #107

Merged
margani merged 1 commit into
mainfrom
fix/104-snapshot-modes
Nov 2, 2026
Merged

margani merged 1 commit into
mainfrom
fix/104-snapshot-modes

Conversation

@margani

@margani margani commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Closes #104.

What changed

  • A new snapshot directory is created with mode 0700. An existing directory's mode is left alone, because --snapshots may name a shared directory.
  • The helper writes the archive under umask 077. Afterwards the script runs chmod 600 on every <service>-*.tar.gz in the directory, which also covers snapshots made before this change.

Why

Under the usual 022 umask, the snapshot directory was 0755 and the archive 0644. That left a full copy of the service's data readable by local accounts that cannot read the live volume under /var/lib/docker.

Verification

  • container/tests/upgrade_test.sh asserts directory 700 and archive 600. On the old code (umask 022): FAIL: snapshot directory is 755, not 700; new code: PASS.
  • ./run-tests: all 10 passed, 3 skipped.

Not verified

  • Against a real Docker daemon and helper image. The host-side chmod 600 does not depend on the helper's umask.

A snapshot directory made with plain mkdir -p and archives written under the
helper's default umask left a full copy of the service's data readable by
every local account. A new directory is now 0700, archives are written under
umask 077 and chmod 600 afterwards (older ones too).

Closes #104
@margani
margani merged commit 72467ec into main Nov 2, 2026
4 checks passed
@margani
margani deleted the fix/104-snapshot-modes branch November 2, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

container.sh upgrade: keep data snapshots private (0700 directory, 0600 archives)

1 participant