vukbgit / ftp-remote-edit-plus

a fork of ftp-remote-edit Atom package
MIT License
5 stars 1 forks source link

Executable permission not preserved since update to 1.4.0 #12

Open vmkalbskopf opened 3 years ago

vmkalbskopf commented 3 years ago

When editing a script on the remote server (linux) using this module on my laptop (mac os), the execution permission of the file is not preserved. I have tested this by creating a new file on the server (using vim) and making it executable. Then I edit the file using atom. The executable permission is lost.

I have tried deleting the server. I am also using the same user on the server and in the server settings.

I have changed the file attribute settings using the dialog provided by the package. But as soon as I save the file, it changes back to this:

Screenshot 2021-09-27 at 11 07 11

I have tried putting in xs but it throws this error:

Uncaught TypeError: Cannot read property 'other' of undefined

/Users/victor/.atom/packages/ftp-remote-edit-plus/lib/helper/format.js:208
Hide Stack Trace
TypeError: Cannot read property 'other' of undefined
    at permissionsToRights (/Users/victor/.atom/packages/ftp-remote-edit-plus/lib/helper/format.js:208:32)
    at PermissionsView.updateCheckboxInputs (/Users/victor/.atom/packages/ftp-remote-edit-plus/lib/views/permissions-view.js:513:18)
    at /Users/victor/.atom/packages/ftp-remote-edit-plus/lib/views/permissions-view.js:145:12
    at Function.simpleDispatch (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1186925)
    at Emitter.emit (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1188366)
    at TextBuffer.emitDidChangeTextEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:507940)
    at TextBuffer.transact (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:495895)
    at TextEditor.transact (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:26664)
    at /Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:18599
    at TextEditor.mergeSelections (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:41978)
    at TextEditor.mergeIntersectingSelections (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:41487)
    at TextEditor.mutateSelectedText (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:18562)
    at TextEditor.insertText (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:18111)
    at TextEditorComponent.didTextInput (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:96704)
vukbgit commented 3 years ago

Hello, I digged a bit into it and it seems related to the SSH/SFTP library not returning files permission anymore, so the library defaults back to 644. I had to update the dependency version recently due to a security issue of the library and I am now facing some troubles. I'll try to work it out again but I can't promise anything...any help appreciated!

vmkalbskopf commented 3 years ago

Oh man! That sounds very frustrating. Unfortunately I don't have any experience with this, so I can't help. I'll just add a permission change when I am executing the script server side. A hack, but good enough for now.

vmkalbskopf commented 3 years ago

I submitted a bug here: https://github.com/mscdex/ssh2/issues/1073

Is that useful?

vukbgit commented 3 years ago

well we'll discover soon, I'll try to add asap some technical context to your issue

vmkalbskopf commented 3 years ago

Sorry for jumping ahead of you :-|

vukbgit commented 3 years ago

no problem. I just tested the original package and:

Of course if you switch to ftp-remote-edit you wont have the benefit of folders anymore, your choice!

vmkalbskopf commented 3 years ago

Yes, I've noticed the slow-down as well. I guess the api has changed a lot. Good luck my friend!