]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Reply message ordering bug in ftpd
authorGreg Hudson <ghudson@mit.edu>
Wed, 12 Aug 2009 18:53:47 +0000 (18:53 +0000)
committerGreg Hudson <ghudson@mit.edu>
Wed, 12 Aug 2009 18:53:47 +0000 (18:53 +0000)
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
tags: pullup
target_version: 1.7

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22519 dc483132-0cff-0310-8789-dd5450dbe970

src/appl/gssftp/ftpd/ftpd.c

index 51072ee60723d0080fef8c7834d2e27bee1d8335..ad3c4201a83a64f67c8c8d414ecab5e68481402f 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;
        }