4udak / pyftpdlib

Automatically exported from code.google.com/p/pyftpdlib
Other
1 stars 1 forks source link

on_logout() called for invalid user #233

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am not sure this is a bug, but I am not sure this behavior is intentional. 
Looking for clarification.

What steps will reproduce the problem?
1. Connect to pyftpdlib FTP server.
2. Send USER command with invalid username.
3. Send QUIT

--
$ telnet localhost 21
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 FTP Server Ready.
USER foobar
331 Username ok, send password.
QUIT
221 Goodbye.
--

What is the expected output? What do you see instead?

In this case, on_logout() is called with the invalid username. I would not 
expect on_logout() under these conditions since the user did not actually log 
in.

I guess the fact that the username is invalid is inconsequential, in fact, even 
a valid username should not invoke on_logout() in the conditions. At least that 
is my expectation.

Original issue reported on code.google.com by btimby@gmail.com on 7 Jan 2013 at 6:37

GoogleCodeExporter commented 9 years ago
Yes, you're right. Would you mind fixing it?

Original comment by g.rodola on 7 Jan 2013 at 6:38

GoogleCodeExporter commented 9 years ago
No sir, I will send a patch and tests soon.

Original comment by btimby@gmail.com on 7 Jan 2013 at 6:50

GoogleCodeExporter commented 9 years ago
Thanks sir! :D

Original comment by g.rodola on 7 Jan 2013 at 6:51

GoogleCodeExporter commented 9 years ago
Here is a patch, can you review it for me? I will go back and add a couple test 
cases.

Original comment by btimby@gmail.com on 15 Jan 2013 at 3:15

Attachments:

GoogleCodeExporter commented 9 years ago
Patch looks ok to me.

Original comment by g.rodola on 15 Jan 2013 at 1:28

GoogleCodeExporter commented 9 years ago
I fixed it (including tests) as of r1151. Hope you don't mind.

Original comment by g.rodola on 24 Jan 2013 at 4:38

GoogleCodeExporter commented 9 years ago
I don't mind, I am just sorry I did not get to it fast enough!.

Original comment by btimby@gmail.com on 24 Jan 2013 at 4:54

GoogleCodeExporter commented 9 years ago
No probs.

Original comment by g.rodola on 24 Jan 2013 at 4:55