user with no read permission can corrupt local files

Need help with FileZilla Client? Something does not work as expected? In this forum you may find an answer.

Moderator: Project members

Post Reply
Message
Author
Tyson
504 Command not implemented
Posts: 9
Joined: 2010-04-23 00:24
First name: Tyson
Last name: Domer

user with no read permission can corrupt local files

#1 Post by Tyson » 2010-04-23 00:30

Here's my issue:

When logged on to the FTP server (FileZilla Server) as a user with no Read permissions, attempting to download a file from the server to the local site when a file with name already exists on the local site results in the local file being overwritten with a corrupted 0Kb file if any 'overwrite' option is chosen in the "Target file already exists" dialog box.

Since the user logged on to the server has no Read permission, there is no reason for the "Target file already exists" dialog to come up anyway.

Does this make sense?

User avatar
botg
Site Admin
Posts: 32463
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse
Contact:

Re: user with no read permission can corrupt local files

#2 Post by botg » 2010-04-23 06:10

This is normal and expected behavior. FTP does not advertise permissions, a client can only ever figure it out by attempting to start a transfer. Before starting the transfer however it needs to ask the user what to do with the already existing file.

Tyson
504 Command not implemented
Posts: 9
Joined: 2010-04-23 00:24
First name: Tyson
Last name: Domer

Re: user with no read permission can corrupt local files

#3 Post by Tyson » 2010-04-23 14:28

I understand, but it is odd behavior, since the user has no remote read permission, yet the local file is getting overwritten. But I am a newbie, and this is the first FTP server I have ever set up, and I'm not too familiar with FTP...

If I were the user that tried to download a newer version of some file from an FTP server, and I had logged on with a profile that disallowed read permission (i.e. no downloading allowed) I would be pretty astounded to find out that I had overwritten my old local copy of the file with a corrupt 0 byte file. A word to the newbies...

Thanks for your response, and thanks for making the FileZilla suite available. Just awesome.

User avatar
boco
Contributor
Posts: 24776
Joined: 2006-05-01 03:28
Location: Germany

Re: user with no read permission can corrupt local files

#4 Post by boco » 2010-04-23 16:21

since the user has no remote read permission
Yes, the problem is that FileZilla client doesn't know that. Only when the transfer starts, but is denied by the server, it learns that fact. At that point the local file already has been overwritten.
### BEGIN SIGNATURE BLOCK ###
No support requests per PM! You will NOT get any reply!!!
FTP connection problems? Do yourself a favor and read Network Configuration.
All FileZilla products fully support IPv6. http://worldipv6launch.org
### END SIGNATURE BLOCK ###

Tyson
504 Command not implemented
Posts: 9
Joined: 2010-04-23 00:24
First name: Tyson
Last name: Domer

Re: user with no read permission can corrupt local files

#5 Post by Tyson » 2010-04-23 22:16

OK, I see. The client doesn't know any better...because it's waiting on the server to transfer the file. The server doesn't transfer anything, so you're stuck with an empty file on the local side. That makes sense, but why can't the FileZilla client wait to overwrite the local file until after it receives confirmation that everything went OK on the server side and the file was downloaded? That type of non-destructive local overwrite behavior would make the client more robust.

But wait, doesn't the client already know the permissions for each file? I assume the client could use the file-level permission information to flag situations where a transfer would not be allowed, and simply not initiate the transfer. Perhaps that violates the FTP protocol...or I am missing something.

Either way, I think a non-destructive local overwrite is a good idea, however it can be implemented. Should I post this somewhere else more appropriate for feature requests?

Thanks again.

User avatar
botg
Site Admin
Posts: 32463
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse
Contact:

Re: user with no read permission can corrupt local files

#6 Post by botg » 2010-04-24 08:45

But wait, doesn't the client already know the permissions for each file? I assume the client could use the file-level permission information to flag situations where a transfer would not be allowed, and simply not initiate the transfer. Perhaps that violates the FTP protocol...or I am missing something.
The client simply doesn't know this information as the FTP specifications to not offer the required functionality.
Either way, I think a non-destructive local overwrite is a good idea, however it can be implemented.
I still do not think it makes sense. After all the file is only getting overwritten after the user has told FileZilla that the old file is no longer needed in the file exists dialog.

Tyson
504 Command not implemented
Posts: 9
Joined: 2010-04-23 00:24
First name: Tyson
Last name: Domer

Re: user with no read permission can corrupt local files

#7 Post by Tyson » 2010-04-24 23:17

I don't want to get into a pissing match, but

I believe the FTP client does know the file permissions since they're displayed in the remote window.

And I would guess that the user isn't expecting to lose the original local file, even if they indicate that an overwrite is OK. This is especially true if they choose the "only overwrite if newer" option.

Just a suggestion.

Tyson

User avatar
botg
Site Admin
Posts: 32463
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse
Contact:

Re: user with no read permission can corrupt local files

#8 Post by botg » 2010-04-25 15:47

I believe the FTP client does know the file permissions since they're displayed in the remote window.
Yet it cannot interpret the semantics of the permissions. It's completely undefined, the FTP specifications do not say how permissions should look like. Even if the client would know how to interpret the permissions, it still does not know under which account and group the server runs under.

Example: "-rw-rw----", that could just as well mean "Readable by all but your best friend, unless it's a goldfish". Even if that particular permissions would be classical Unix permissions, the client still doesn't know its own user (FTP login username and server's actual username may differ) and group.

Tyson
504 Command not implemented
Posts: 9
Joined: 2010-04-23 00:24
First name: Tyson
Last name: Domer

Re: user with no read permission can corrupt local files

#9 Post by Tyson » 2010-04-28 03:28

Ah I see. I understand. Good to know. Thanks for the continuing explanation. FileZilla suite is working great for me. Thanks again.
Tyson

User avatar
boco
Contributor
Posts: 24776
Joined: 2006-05-01 03:28
Location: Germany

Re: user with no read permission can corrupt local files

#10 Post by boco » 2010-04-28 05:14

Couldn't FileZilla simply attempt to download the first byte (or first few bytes) from the first file it encounters? If that succeeds, the user obviously has Read permission.

Just a question.
### BEGIN SIGNATURE BLOCK ###
No support requests per PM! You will NOT get any reply!!!
FTP connection problems? Do yourself a favor and read Network Configuration.
All FileZilla products fully support IPv6. http://worldipv6launch.org
### END SIGNATURE BLOCK ###

User avatar
botg
Site Admin
Posts: 32463
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse
Contact:

Re: user with no read permission can corrupt local files

#11 Post by botg » 2010-04-28 06:13

Only to then figure out that it cannot write to the local file?

User avatar
boco
Contributor
Posts: 24776
Joined: 2006-05-01 03:28
Location: Germany

Re: user with no read permission can corrupt local files

#12 Post by boco » 2010-04-28 06:25

botg wrote:Only to then figure out that it cannot write to the local file?
Maybe, but that wouldn't destroy local files.
### BEGIN SIGNATURE BLOCK ###
No support requests per PM! You will NOT get any reply!!!
FTP connection problems? Do yourself a favor and read Network Configuration.
All FileZilla products fully support IPv6. http://worldipv6launch.org
### END SIGNATURE BLOCK ###

User avatar
botg
Site Admin
Posts: 32463
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse
Contact:

Re: user with no read permission can corrupt local files

#13 Post by botg » 2010-04-28 20:02

But potentionally waste lots of server resources if trying to download a complete directory hierarchy into an unwriteable place.

Post Reply