Cyberduck Mountain Duck CLI

#8757 closed enhancement (fixed)

Edit with temporary file upload on save does not work with missing directory permissions

Reported by: lkmorlan Owned by: dkocher
Priority: normal Milestone: 4.8
Component: sftp Version: 4.6.5
Severity: normal Keywords:
Cc: Architecture: Intel
Platform: Mac OS X 10.6

Description (last modified by dkocher)

Over SFTP, if I edit a file that I have write permission on, but do not have write permission on the file's directory, when I try to save, I get an upload failed message, "Permission denied. Please contact your web hosting service provider for assistance." I sometimes get the message when just opening the file.

As well, saving or opening the file changes the owner of the file to me.

This behavior suggests that Cyberduck is removing the file and uploading a new one, instead of editing the existing file.

Log drawer for opening and saving a file:

263 OPENDIR
264 READDIR
265 READDIR
266 CLOSE
267 OPEN
268 READ
269 READ
270 CLOSE
271 OPENDIR
272 READDIR
273 READDIR
274 CLOSE
275 OPEN

Change History (11)

comment:1 Changed on Apr 22, 2015 at 4:02:17 PM by lkmorlan

  • Summary changed from Unable to write to writable file without write on directory to Unable to write to writable file without write permission on directory

comment:2 Changed on Apr 22, 2015 at 5:20:06 PM by dkocher

  • Component changed from core to sftp
  • Description modified (diff)
  • Owner set to dkocher

comment:3 Changed on Apr 22, 2015 at 8:28:45 PM by dkocher

  • Milestone set to 4.7
  • Resolution set to worksforme
  • Status changed from new to closed

This most possibly caused by the use of a temporary file to replace the edited file after upload only when the transfer is complete. Refer to Disable upload of temporary file on save.

comment:4 follow-up: Changed on Apr 22, 2015 at 8:36:48 PM by lkmorlan

Changing the hidden configuration option did fix it for me.

However, I'm sure other people will have this problem and won't be able to find the solution. I was only able to figure out what was happening because I had the ability to adjust the directory permissions and see the effect. Why does it ever upload a temp file on save? If there is a need for it, perhaps it should try to upload the temp file and if it doesn't work, revert to the other behavior. I think leaving things as-is will frustrate users.

comment:5 in reply to: ↑ 4 Changed on Apr 23, 2015 at 9:23:02 AM by dkocher

Replying to lkmorlan:

Changing the hidden configuration option did fix it for me.

Thanks for the confirmation.

comment:6 Changed on Apr 23, 2015 at 9:23:52 AM by dkocher

  • Milestone 4.7 deleted
  • Resolution worksforme deleted
  • Status changed from closed to reopened
  • Summary changed from Unable to write to writable file without write permission on directory to Edit with temporary file upload on save does not work with missing directory permissions
  • Type changed from defect to enhancement

comment:7 Changed on Apr 23, 2015 at 9:25:06 AM by dkocher

We have this enabled by default as a safeguard procedure for data loss when editing a file and the upload on save would be incomplete because of an I/O failure.

comment:8 follow-up: Changed on Apr 23, 2015 at 2:40:39 PM by lkmorlan

I understand.

I notice that even when I was not able to save the file, I could still upload a file of the same name and tell it to overwrite the existing file. So that must not use the temp file. I don't know the details of how to protocol works, but it seems to me that uploading and saving should work the same way.

Another idea: What if you tried to make the temp file in /tmp? Most users have write access to that.

Using rsync might be a good idea for updating files.

comment:9 in reply to: ↑ 8 Changed on Apr 23, 2015 at 3:14:19 PM by dkocher

Replying to lkmorlan:

I understand.

I notice that even when I was not able to save the file, I could still upload a file of the same name and tell it to overwrite the existing file. So that must not use the temp file. I don't know the details of how to protocol works, but it seems to me that uploading and saving should work the same way.

The use of a temporary filename for uploads is not enabled by default. Refer to Transfers → General → Uploads → Upload with temporary filename.

comment:10 Changed on Aug 26, 2015 at 7:50:54 PM by dkocher

#8982 closed as duplicate.

comment:11 Changed on Jan 21, 2016 at 1:33:47 PM by dkocher

  • Milestone set to 4.8
  • Resolution set to fixed
  • Status changed from reopened to closed

In r19085. The setting in Transfers → General → Uploads → Upload with temporary filename is disabled by default and now used for uploads from editors as well.

Note: See TracTickets for help on using tickets.