svn rev #22519: trunk/src/appl/gssftp/ftpd/

ghudson@MIT.EDU ghudson at MIT.EDU
Wed Aug 12 14:53:48 EDT 2009


http://src.mit.edu/fisheye/changelog/krb5/?cs=22519
Commit By: ghudson
Log Message:
ticket: 6543
subject: Reply message ordering bug in ftpd
tags: pullup
target_version: 1.7

user() was replying to the user command and then calling login(),
which could send a continuation reply if it fails to chdir to the
user's homedir.  Continuation replies must come before the actual
reply; the mis-ordering was causing ftp and ftpd to deadlock.  To fix
the bug, invoke login() before reply() so that the continuation reply
comes first.



Changed Files:
U   trunk/src/appl/gssftp/ftpd/ftpd.c
Modified: trunk/src/appl/gssftp/ftpd/ftpd.c
===================================================================
--- trunk/src/appl/gssftp/ftpd/ftpd.c	2009-08-12 17:58:24 UTC (rev 22518)
+++ trunk/src/appl/gssftp/ftpd/ftpd.c	2009-08-12 18:53:47 UTC (rev 22519)
@@ -758,11 +758,10 @@
 			result = 331;
 		} else
 			result = 232;
-		reply(result, "%s", buf);
-		syslog(authorized ? LOG_INFO : LOG_ERR, "%s", buf);
-
 		if (result == 232)
 			login(NULL, result);
+		reply(result, "%s", buf);
+		syslog(authorized ? LOG_INFO : LOG_ERR, "%s", buf);
 		return;
 	}
 




More information about the cvs-krb5 mailing list