Skip to content

Platform-agnostic method to copy owner and permissions between files - #7968

Merged
bmw merged 3 commits into
certbot:masterfrom
adferrand:copy-ownership-and-mode-fn
May 6, 2020
Merged

bmw merged 3 commits into
certbot:masterfrom
adferrand:copy-ownership-and-mode-fn

Conversation

@adferrand

Copy link
Copy Markdown
Contributor

Related to #7649 since @joohoi needs a method to copy owner and permissions together from a source file to a destination file.

This PR creates the method copy_ownership_and_mode() in certbot.compat.filesystem module to achieve this goal. Its behavior is consistent across Linux and Windows in respect to the security model that have been defined for Certbot on Windows.

The method behaves globally the same than copy_ownership_and_apply_mode, but this time the permissions are extracted from the source file. For Windows it means that the DACL is copied from the source to the destination with the same content.

@adferrand adferrand changed the title Platform-independant method to copy owner and permissions between files Platform-agnostic method to copy owner and permissions between files May 4, 2020

@bmw bmw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have a few documentation nitpicks but this otherwise LGTM!

Thanks for writing this PR so quickly.

Comment thread certbot/certbot/compat/filesystem.py Resolved
Comment thread certbot/tests/compat/filesystem_test.py Resolved
Comment thread certbot/tests/compat/filesystem_test.py Resolved
@bmw bmw self-assigned this May 4, 2020
@bmw
bmw merged commit bb6a660 into certbot:master May 6, 2020
@bmw bmw added this to the 1.5.0 milestone May 6, 2020
@bmw bmw mentioned this pull request Jul 28, 2020
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants