pg_file.py: set mode via the file owner's setuid wrapper; bump versio… - #120
Merged
Merged
Conversation
…n to 3.0.12 Files downloaded from Quasar via Globus are owned by the endpoint's mapped identity, so chmod fails with EPERM and aborted 'dsarch <ds> rq' restores. set_local_mode() now runs the chmod through get_local_command() as the file owner, and falls back to a warning instead of a fatal error. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates local permission-setting behavior to handle files downloaded via Globus/Quasar that are owned by a mapped endpoint identity (so direct chmod can fail with EPERM), and bumps the package version accordingly.
Changes:
- Update
PgFile.set_local_mode()to attemptchmodviaget_local_command()as the file owner (viapgstart_<owner>wrapper) and warn instead of failing hard when it can’t change permissions. - Bump package version from
3.0.11to3.0.12.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/rda_python_common/pg_file.py | Adds a wrapper-based chmod path when the current user isn’t the file owner, and downgrades failure to a warning in that scenario. |
| pyproject.toml | Version bump to 3.0.12. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+1644
to
+1648
| euid = os.geteuid() | ||
| if euid and logname and pwd.getpwnam(logname).pw_uid != euid: | ||
| # only the file owner (or root) can chmod; try the pgstart_<owner> setuid wrapper | ||
| cmd = "chmod {} {}".format(self.int2base(nmode, 8), file) | ||
| wcmd = self.get_local_command(cmd, logname) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…n to 3.0.12
Files downloaded from Quasar via Globus are owned by the endpoint's mapped identity, so chmod fails with EPERM and aborted 'dsarch rq' restores. set_local_mode() now runs the chmod through get_local_command() as the file owner, and falls back to a warning instead of a fatal error.