Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: respect permissions of the target dir, especially setgid #11

Merged
merged 2 commits into from
Feb 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions snakemake_storage_plugin_fs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

@dataclass
class StorageProviderSettings(StorageProviderSettingsBase):
latency_wait: int = field(
latency_wait: Optional[int] = field(
default=1,
metadata={
"help": "Time in seconds to wait until retry if file operation is not "
Expand Down Expand Up @@ -231,8 +231,11 @@ def store_object(self):
# Ensure that the object is stored at the location specified by
# self.local_path().
self.query_path.parent.mkdir(exist_ok=True, parents=True)
# We want to respect the permissions in the target folder, in particular the
# setgid bit. Hence, we use --no-p to avoid preserving of permissions from the
# source to the target.
cmd = sysrsync.get_rsync_command(
str(self.local_path()), str(self.query_path), options=["-av"]
str(self.local_path()), str(self.query_path), options=["-av", "--no-p"]
)
self._run_cmd(cmd)

Expand Down
Loading