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

Permissions not preserved when editing remote file via sftp connection #7538

Closed
cyberduck opened this issue Nov 1, 2013 · 21 comments
Closed
Assignees
Milestone

Comments

@cyberduck
Copy link
Collaborator

3b6a417 created the issue

When editing a remote file via an sftp connection, the permissions of the file are not preserved when uploading the file. They are always reset to rw-r--r--. This always happens, regardless of the settings in the Transfers preferences.

This behaviour does not happen in version 4.3.1.


Attachments

@cyberduck
Copy link
Collaborator Author

@dkocher commented

In e1de1ad and 8f368a9.

@cyberduck
Copy link
Collaborator Author

2e30060 commented

I can reproduce this but with the latest Snapshot (14063). Is this fixed in v 14063 ?

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Replying to [comment:3 michael vöhringer]:

I can reproduce this but with the latest Snapshot (14063). Is this fixed in v 14063 ?

On Windows?

@cyberduck
Copy link
Collaborator Author

2e30060 commented

no, its OSX 10.9

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Additional fix when local filesystem does not support UNIX permissions in d11da8c.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Replying to [comment:5 michael vöhringer]:

no, its OSX 10.9

I cannot reproduce the issue on OS X with build 14063 and later.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Please post the transcript from the log drawer (⌘-L).

@cyberduck
Copy link
Collaborator Author

2e30060 commented

How to reproduce:

  • Open sftp connection to remote host (linux)
  • create a file test.txt
  • change the owner of the file to something different (for example www-data if you are connected as root via sftp)
  • Open the file with the "editor"-icon in cyberduck
  • save the file.

-> on my system the owner changed from www-data to root and the permission to "-rw-r--r--" after saving the file

SSH_FXP_READDIR
SSH_FXP_STATUS
SSH_FXP_CLOSE
SSH_FXP_STATUS
SSH_FXP_OPEN
SSH_FXP_HANDLE
SSH_FXP_READ
SSH_FXP_DATA
SSH_FXP_READ
SSH_FXP_STATUS
SSH_FXP_CLOSE
SSH_FXP_STATUS
SSH_FXP_STAT
SSH_FXP_ATTRS
SSH_FXP_STAT
SSH_FXP_ATTRS
SSH_FXP_OPEN
SSH_FXP_HANDLE
SSH_FXP_WRITE
SSH_FXP_STATUS
SSH_FXP_CLOSE
SSH_FXP_STATUS
SSH_FXP_STAT
SSH_FXP_ATTRS
SSH_FXP_REMOVE
SSH_FXP_STATUS
SSH_FXP_RENAME
SSH_FXP_STATUS
SSH_FXP_SETSTAT
SSH_FXP_STATUS

@cyberduck
Copy link
Collaborator Author

2e30060 commented

FYI: i can not reproduce this, if i only download/upload the file.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Thanks for the transcript. We see one SSH_FXP_SETSTAT being sent after the upload is complete. We would expect it two times, once to set the timestamp and once for the permissions.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

I can reproduce this only when setting Preferences → Uploads → Change permissions → to these permissions: and uncheck all checkboxes. With this setting no permissions are updated after the upload is complete.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Can you find any error output in the system.log (/Applications/Utilities/Console.app) from Cyberduck?

@cyberduck
Copy link
Collaborator Author

2e30060 commented

Screen Shot 2013-11-20 at 16.58.39.png

  • Change Permission is not set
  • No errors in the log

Anything else i can check?

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Thanks for the screenshot. You will have to set Change permissions for Downloads otherwise the edited file will have the default mode 644 on OS X.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Replying to [comment:12 dkocher]:

Thanks for the transcript. We see one SSH_FXP_SETSTAT being sent after the upload is complete. We would expect it two times, once to set the timestamp and once for the permissions.

Actually expected because setting the timestamp explicitly for uploads is disabled by default.

@cyberduck
Copy link
Collaborator Author

2e30060 commented

ok, the permissions are stable after i set Download->Change permissions, but the user of the online-file changed. I can reproduce this only if use the edit function within cyberduck. When download/upload via drag&drop the permission/user/group did not change online.

Permission before editing the file:

-rw------- 1 www-data root   41 Nov 20 17:20 test.txt

Permission after saving the file in Sublime

-rw------- 1 root root   47 Nov 20 17:23 test.txt

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Replying to [comment:19 michael vöhringer]:

ok, the permissions are stable after i set Download->Change permissions, but the user of the online-file changed. I can reproduce this only if use the edit function within cyberduck. When download/upload via drag&drop the permission/user/group did not change online.

Permission before editing the file:

-rw------- 1 www-data root   41 Nov 20 17:20 test.txt

Permission after saving the file in Sublime

-rw------- 1 root root   47 Nov 20 17:23 test.txt

Yes, this is expected because of the temporary rename feature enabled by default for edits. See hidden property editor.upload.temporary to disable the use of temporary name on upload when uploading changes from the editor on save.

defaults write ch.sudo.cyberduck editor.upload.temporary false

@cyberduck
Copy link
Collaborator Author

cyberduck commented Nov 20, 2013

@dkocher commented

Handling of file owner related to #11965.

@cyberduck
Copy link
Collaborator Author

2e30060 commented

thank you very much, after setting "editor.upload.temporary false" the edit works as (I) expected. Now the behavior of V 4.3 is back.

@cyberduck
Copy link
Collaborator Author

12d3422 commented

Still doesn't work with 4.4.3.

"defaults write ch.sudo.cyberduck editor.upload.temporary false"

helps to prevent the file-owner, but still changes the permissions from 0755 to 0644.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

In e65d74a.

@iterate-ch iterate-ch locked as resolved and limited conversation to collaborators Nov 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants