Skip to content

userTransfer: source-side rsync runs as the user, so rootless-Docker files owned by sub-UIDs with owner-only modes are silently not copied #964

Description

@MagnaCapax

Problem

pmssUserTransferBuildRsyncCommand() (scripts/lib/userTransfer/remoteScripts.php) pulls as <remoteUser>, so the sending rsync on the source runs as the user. Rootless Docker keeps container-owned files under the user's sub-UIDs. Any image layer, volume or bind-mount file with an owner-only mode (0600/0700) owned by a non-root container UID is unreadable to the user. rsync logs send_files failed to open / opendir ... failed: Permission denied (13) on every pass, skips it (a directory takes its whole subtree along), and the target silently lacks it. Seen in production with containerd image-layer snapshots (Docker 29 containerd store) and with volume data. Users whose images carry no such files transfer cleanly.

Reproduce: rootless docker run -d -e POSTGRES_PASSWORD=x postgres (data dir 0700, container uid 999), transfer the user, then grep the log for Permission denied (13) and compare file counts as root.

Suggested fix (for review)

  1. Read inside the user's own user namespace: --rsync-path='unshare --map-auto --map-root-user rsync' (util-linux ≥ 2.38) or an equivalent newuidmap wrapper. This needs no new privilege; the IDs come out namespace-relative, which fits the offset remap of userTransfer: rootless Docker ownership breaks when source/target subuid ranges differ (data-root keeps foreign sub-IDs, bind mounts get flattened) #961.
  2. Or pull as root from the source: simpler, but it widens source-side privilege for every transfer.

Once the companion .resourceData exclude fix lands, a remaining rc=23 is a genuine "something was not copied" signal. Related: #961, #962.

(Unreadable by design, uncopied by accident.)


Tier-3 declared at filing: --why multiple-fix-paths — GH#631 tier gate. Declared fix size: 20 lines vs 14-line body — size gate (operator directive 2026-07-29). Owner: scripts/lib/userTransfer/remoteScripts.php in MagnaCapax/PMSS — owner gate.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions