Skip to content

pg_file.py: set mode via the file owner's setuid wrapper; bump versio… - #120

Merged
zaihuaji merged 1 commit into
mainfrom
hua-work-common
Aug 26, 2026
Merged

zaihuaji merged 1 commit into
mainfrom
hua-work-common

Conversation

@zaihuaji

Copy link
Copy Markdown
Collaborator

…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.

…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>
Copilot AI lite review requested due to automatic review settings August 26, 2026 16:14
@zaihuaji
zaihuaji merged commit d89776c into main Aug 26, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 attempt chmod via get_local_command() as the file owner (via pgstart_<owner> wrapper) and warn instead of failing hard when it can’t change permissions.
  • Bump package version from 3.0.11 to 3.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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants