Skip to content

Commit

Permalink
Add --fake-super to allow ci-storage to be run as root in the source …
Browse files Browse the repository at this point in the history
…machine and still backup/restore files owners correctly, even though it doesn't have root access on destination (#22)

## PRs in the Stack
- ➡ #22

(The stack is managed by
[git-grok](https://github.com/dimikot/git-grok).)
  • Loading branch information
dimikot authored Oct 5, 2024
1 parent 8c3ae16 commit d418a4f
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions ci-storage
Original file line number Diff line number Diff line change
Expand Up @@ -492,11 +492,15 @@ def cmd_to_debug_str(
cmd: list[str],
) -> str:
inv = dict((v, k) for k, v in SCRIPTS.items())
return shlex.join(
[
f"<{inv[arg]}>" if arg in inv else arg.rstrip().replace("\n", "\\n")
for arg in cmd
]
return re.sub(
r" '(--[^=]+=)",
r" \1'",
shlex.join(
[
f"<{inv[arg]}>" if arg in inv else arg.rstrip().replace("\n", "\\n")
for arg in cmd
]
),
)


Expand Down Expand Up @@ -583,6 +587,7 @@ def build_rsync_args(
else []
),
*(["--prune-empty-dirs"] if layer and action == "store" else []),
*(["--rsync-path=rsync --fake-super"] if os.geteuid() == 0 else []),
]


Expand Down

0 comments on commit d418a4f

Please sign in to comment.