Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remote: ssh: push: make files protected (read-only) when uploading #3839

Closed
gwerbin opened this issue May 20, 2020 · 2 comments
Closed

remote: ssh: push: make files protected (read-only) when uploading #3839

gwerbin opened this issue May 20, 2020 · 2 comments
Labels
enhancement Enhances DVC p2-medium Medium priority, should be done, but less important

Comments

@gwerbin
Copy link

gwerbin commented May 20, 2020

Versions

  • DVC: 0.94.0
  • Installation method: Pip via Pipx
  • Platform: Linux

Intended behavior

In a local-file or SSH remote, files are expected to have 444 permissions. dvc pull should not modify files in the remote.

Current behavior

  1. dvc push creates files in the remote according to the user's default umask, typically 022, resulting in files with 644 permissions
  2. dvc pull notices that some files have incorrect permissions, and tries to fix them with chmod.
  3. If the above-mentioned files are not owned by the current user, the chmod fails and dvc pull fails with an error.
  4. To fix it, the file owner must manually chmod 444 every affected file in the remote, e.g. with find <remote-dir> -type f -exec chmod 444 '{}' \;

Solution

As discussed on Discord, dvc push should set the correct file permissions, and dvc pull should not attempt to mess with file permissions at all.

My additional suggestion is to have dvc push and dvc pull emit a warning when it detects incorrect file permissions, and/or give the user an option to ignore incorrect permissions.

This bug report is related to feature request iterative/dvc-ssh#15 , which would ensure that directories in the remote are created with either 755 or 775 permissions as needed by the user.

@triage-new-issues triage-new-issues bot added the triage Needs to be triaged label May 20, 2020
@efiop efiop changed the title Files in SSH and local filesystem DVC remotes are created with incorrect permissions, causing "dvc pull" to fail due to an over-zealous consistency check remote: ssh: push: make files protected (read-only) when uploading May 21, 2020
@efiop efiop added the p2-medium Medium priority, should be done, but less important label May 21, 2020
@triage-new-issues triage-new-issues bot removed the triage Needs to be triaged label May 21, 2020
@efiop efiop added the enhancement Enhances DVC label May 21, 2020
@efiop
Copy link
Contributor

efiop commented May 22, 2020

Similar to #3858

@efiop
Copy link
Contributor

efiop commented Dec 8, 2023

Closing as stale

@efiop efiop closed this as not planned Won't fix, can't repro, duplicate, stale Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhances DVC p2-medium Medium priority, should be done, but less important
Projects
None yet
Development

No branches or pull requests

2 participants