Skip to content

safe_copy(..., preserve_meta=False) does preserve perms #4937

@samsrabin

Description

@samsrabin

According to the safe_copy() docstring, we do NOT want permissions preserved when preserve_meta=False:

cime/CIME/utils.py

Lines 1415 to 1418 in 7997bb9

preserve_meta toggles if file meta-data, like permissions, should be preserved. If you are
copying baseline files, you should be within a SharedArea context manager and preserve_meta
should be false so that the umask set up by SharedArea can take affect regardless of the
permissions of the src files.

However, they are preserved, and the SharedArea umask does not seem to be respected. This explains why sometimes CTSM baseline files on Izumi are only owner-readable.

Note that this bug only happens when using safe_copy on files directly; directories and their contents work fine.

Will submit a PR shortly that includes failing tests to illustrate, then fixes the bug.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions