Skip to content

Commit

Permalink
fix: respect permissions of the target dir, especially setgid (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
johanneskoester authored Feb 23, 2024
1 parent 8f13152 commit 2132a5a
Showing 1 changed file with 5 additions and 2 deletions.
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

0 comments on commit 2132a5a

Please sign in to comment.