SFTP 'Renaming bug'

Advertisement

OpenFutura
Joined:
Posts:
2
Location:
Vigo - Galicia - Spain

SFTP 'Renaming bug'

Hi there Martin, I'm Pablo:

Let me expose the scenario...
I have one lil' server running OpenSSH_3.6.1p2 Debian 1:3.6.1p2-9, SSH protocols 1.5/2.0, OpenSSL 0x0090703f connected to a Windoze 2000 server using SaMBa Version 3.0.0-Debian. OK? Lets go...

When using SFTP to remotely upload a file in a smbmounted path it fails after e-v-e-r-y file complaining about "Permission denied" when renaming the transfered file from whatever.txt.filepart to whatever.txt.
So, to isolate the problem, i tried renaming an already transferred file. I am root, the smbshare is mounted by root, and the files' permissions are 644. No success. If I try a folder instead then it'll work.

SCP itself works perfectly for both folders and files.

Clues?

btw... i've just sent you an updated ini.

Thanks again, man.
_________________
Internet : Seguridad : Redes

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: SFTP 'Renaming bug'

Do I understand it right that you cannot rename any file with SFTP? What SFTP version does the server support? You can see the version on status bar, i.e. SFTP (v3).

As temporary workaround to allow uploads, switch off resume support on Transfer tab of Preferences dialog.

Reply with quote

trymate
Guest

Has anybody ever solved the SFTP rename bug on samba shares?

Hi there,

I'm currently experiencing this problem with the uploading of files and the .filepart renaming problem.

I use WinSCP 3.7.6 build 306 with some SUSE Linux 9.0 (x86) with:
SSH-2, OpenSSH_3.7.1p2, AES, compression yes, SFTP (v3)

I can upload, resume and rename just fine for example in the local Linux paths like /home/username and so forth, but as soon as I upload to the Samba share /mnt/g/ then it fails to rename the .filepart file right after it finished the upload.

Is there any real solution to this problem?

File permissions on the Samba share are set for everybody, all rights, read write execute and so forth, no problem there.

I can also delete files on the Samba share with WinSCP, but I can't rename at all with WinSCP on the Samba share.

Everything else works just fine (resume on local Linux paths, upload, download, delete,....)

Thanks for any hints how to resolve this problem.

Reply with quote

trymate
Guest

here are some loglines:

Listing directory "/mnt/g/TEMP".
Type: SSH_FXP_OPENDIR, Size: 20, Number: 46859
Type: SSH_FXP_HANDLE, Size: 13, Number: 46859
Type: SSH_FXP_READDIR, Size: 13, Number: 47116
Type: SSH_FXP_NAME, Size: 843, Number: 47116
Type: SSH_FXP_READDIR, Size: 13, Number: 47372
Type: SSH_FXP_STATUS, Size: 28, Number: 47372
Status/error code: 1
Type: SSH_FXP_CLOSE, Size: 13, Number: 47620
Detected incoming data while idle
Copying 1 files/directories to remote directory "/mnt/g/TEMP/"
  PrTime: No; PrRO: No; Rght: rw-r--r--; PrR: No; FnCs: N; RIC: 01; Resume: S (102400); CalcS: Yes; Mask: *.*
  TM: B; ClAr: No; ExclM(No): 
  AscM: *.*htm*; *.txt; *.php*; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex
File: "X:\Documents and Settings\user\My Documents\blubb.blabb.pdf"
Copying "X:\Documents and Settings\user\My Documents\blubb.blabb.pdf" to remote directory started.
Binary transfer mode selected.
Checking existence of file.
Type: SSH_FXP_LSTAT, Size: 50, Number: 47879
Type: SSH_FXP_STATUS, Size: 24, Number: 47620
Discarding reserved response
Type: SSH_FXP_STATUS, Size: 29, Number: 47879
Status/error code: 2
Checking existence of partially transfered file.
Type: SSH_FXP_LSTAT, Size: 59, Number: 48135
Type: SSH_FXP_STATUS, Size: 29, Number: 48135
Status/error code: 2
Opening remote file.
Type: SSH_FXP_OPEN, Size: 75, Number: 48387
Type: SSH_FXP_HANDLE, Size: 13, Number: 48387
Type: SSH_FXP_WRITE, Size: 4121, Number: 48902
Detected incoming data while idle
Detected incoming data while idle
Detected incoming data while idle
Detected incoming data while idle
Detected incoming data while idle
Detected incoming data while idle
Detected incoming data while idle
Detected incoming data while idle
Detected incoming data while idle
Detected incoming data while idle
Detected incoming data while idle
Detected incoming data while idle
Detected incoming data while idle
Detected incoming data while idle
Detected incoming data while idle
Detected incoming data while idle
Detected incoming data while idle
Detected incoming data while idle
39 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets.
Type: SSH_FXP_CLOSE, Size: 13, Number: 54276
Type: SSH_FXP_STATUS, Size: 24, Number: 53766
Type: SSH_FXP_STATUS, Size: 24, Number: 54022
Type: SSH_FXP_STATUS, Size: 24, Number: 54276
Status/error code: 0
Type: SSH_FXP_RENAME, Size: 104, Number: 54546
Type: SSH_FXP_STATUS, Size: 34, Number: 54546
Status/error code: 3, Message: 54546, Server: Permission denied, Language:  
(ETerminal) Permission denied.
Error code: 3
Error message from server: Permission denied 
Request code: 18
Asking user:
Transfer was succesfully finished, but temporary transfer file 'blubb.blabb.pdf.filepart' could not be renamed to target file name 'blubb.blabb.pdf'. If the problem persists, you may try to turn off transfer resume support. ("Permission denied.
Error code: 3
Error message from server: Permission denied 
Request code: 18")
(EScpSkipFile) Transfer was succesfully finished, but temporary transfer file 'blubb.blabb.pdf.filepart' could not be renamed to target file name 'blubb.blabb.pdf'. If the problem persists, you may try to turn off transfer resume support.
Permission denied.
Error code: 3
Error message from server: Permission denied 
Request code: 18
Listing directory "/mnt/g/TEMP".
Type: SSH_FXP_OPENDIR, Size: 20, Number: 54795
Type: SSH_FXP_HANDLE, Size: 13, Number: 54795
Type: SSH_FXP_READDIR, Size: 13, Number: 55052
Type: SSH_FXP_NAME, Size: 1015, Number: 55052
Type: SSH_FXP_READDIR, Size: 13, Number: 55308
Type: SSH_FXP_STATUS, Size: 28, Number: 55308
Status/error code: 1
Type: SSH_FXP_CLOSE, Size: 13, Number: 55556
Detected incoming data while idle
Sending null packet to keep session alive.
Sending special code: 15
Sending null packet to keep session alive.
Sending special code: 15

Reply with quote

Advertisement

martin
Site Admin
martin avatar

Re: has anybody ever solved the sftp rename bug on samba shares?

trymate wrote:

I can also delete files on the Samba share with WinSCP, but I can't rename at all with WinSCP on the Samba share.
Can you do that with any other SFTP client? (PSFTP, FileZilla, ...)

Reply with quote

broekpak
Guest

I've tried FileZilla, I got the same error.
I can rename dirs but not files.

I thought of maybe just disabling the .filepart renaming when you transfer a file would be a solution (at least for me).

Reply with quote

Alain Cote
Guest

Filepart files are not renamed (permission denied)

I've had this problem when copying .iso local files to a VMware ESX server.

The connexion was configured to use SFTP! I've changed it to SCP instead and now, the files are copied with no errors.

Reply with quote

Advertisement

davidenko
Guest

Re: Filepart files are not renamed (permission denied)

I've had this problem when copying .iso local files to a VMware ESX server.

In our situation the root user didn't have the proper rights in that directory. Therefore the copy didn't succeed. Rename or deleting also didn't work from the WinSCP GUI. So it wasn't a WinSCP problem, but more an ESX rights configuration.

Reply with quote

richardnlees
Guest

Rename issue in WinSCP

Hi Martin,
I've seen the solution for running WinSCP.exe, but what about the solution for WinSCP.com/scripting? Is there a way of turning off resume here too? Like an option or a switch ? I can't find anything on the forums.
I'm simply running a script via WinSCP.com, transfer works perfectly but error is the usual:
Transfer was successfully finished, but temprary transfer file 'x.filepart' could not be renamed to target filename 'x'.If the problem persists you may try to turn off transfer resume support.
Permission Denied.
Error code: 3
Error message from server: Permission denied!
Request code: 18
etc., etc.

Reply with quote

richardnlees
Guest

Re: Rename issue in WinSCP

Hi Martin,
As ever, you are a genius (was never in dispute, but...). Worked perfectly.
Many thanks
Best Regards,
Rich

Reply with quote

Advertisement

dweia
Joined:
Posts:
1

SCP tweak

Thanks for the helpful tip, I am now able to use "filepart" with the SMB-shares. One more tweak I had to apply: under "Settings > Session" I chose SCP and under "Settings > Environment > SCP/Shell" I had to set Shell to /bin/ksh, because with setting "Standard", WinSCP would complain about an invalid line in the file-listing because ls -al generates a summary-line that shows the total (k)bytes in the current folder.

Reply with quote

Advertisement

You can post new topics in this forum