pull up r22519 from trunk
authorTom Yu <tlyu@mit.edu>
Tue, 29 Sep 2009 01:39:02 +0000 (01:39 +0000)
committerTom Yu <tlyu@mit.edu>
Tue, 29 Sep 2009 01:39:02 +0000 (01:39 +0000)
 ------------------------------------------------------------------------
 r22519 | ghudson | 2009-08-12 14:53:47 -0400 (Wed, 12 Aug 2009) | 12 lines

 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.

ticket: 6543
version_fixed: 1.7.1
status: resolved

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-7@22812 dc483132-0cff-0310-8789-dd5450dbe970

src/appl/gssftp/ftpd/ftpd.c

index 71e98552965af72c92a8cb0c4ea0660c0eed2a07..d8278128c8773031e7c8416efae12bc8a6032875 100644 (file)
@@ -758,11 +758,10 @@ user(name)
                        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;
        }