summaryrefslogtreecommitdiff
path: root/ftp/spegla/files/patch-jftp.c
diff options
context:
space:
mode:
authorHiroki Sato <hrs@FreeBSD.org>2006-03-23 10:36:38 +0000
committerHiroki Sato <hrs@FreeBSD.org>2006-03-23 10:36:38 +0000
commiteaaaeac3eccf45c860d94bcbd0d5155ae33a73e5 (patch)
tree3a37a9f0e00c15e9ecebce450a9adda638cb31cc /ftp/spegla/files/patch-jftp.c
parentUpdate to 2.05 (and pass maintainership to perl@). (diff)
- Fix reply code handling for USER command and bump PORTREVISION.
According to STD 9 (RFC 959), 230 reply code can be returned just after that command. While the upstream has been informed it is unlikely to roll out the next release including this fix in the near future. - Make portlint(1) happy. - Take maintainership.
Notes
Notes: svn path=/head/; revision=158000
Diffstat (limited to 'ftp/spegla/files/patch-jftp.c')
-rw-r--r--ftp/spegla/files/patch-jftp.c35
1 files changed, 32 insertions, 3 deletions
diff --git a/ftp/spegla/files/patch-jftp.c b/ftp/spegla/files/patch-jftp.c
index 7add9fc77920..5f966968e17a 100644
--- a/ftp/spegla/files/patch-jftp.c
+++ b/ftp/spegla/files/patch-jftp.c
@@ -1,5 +1,5 @@
---- jftp.c.orig Fri Mar 19 03:47:12 2004
-+++ jftp.c Fri Mar 19 03:47:57 2004
+--- jftp.c.orig Thu Mar 23 17:34:21 2006
++++ jftp.c Thu Mar 23 17:39:39 2006
@@ -40,6 +40,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
@@ -50,7 +50,36 @@
}
if(islongtext) {
size = sizeof(c->ftp_buf);
-@@ -980,7 +998,7 @@
+@@ -455,17 +473,22 @@
+ c->ftp_resp = JFTP_ERR;
+ return -1;
+ }
+- if (ftp_req(c, "user %s", c->ftp_user_name) < 0 || c->ftp_resp != 331) {
++ if (ftp_req(c, "user %s", c->ftp_user_name) < 0
++ || (c->ftp_resp != 331 && c->ftp_resp != 230)) {
+ E_LOGX_1(0, "Username %s: failed", c->ftp_user_name);
+ FD_CLOSE(c->ftp_com);
+ c->ftp_resp = JFTP_ERR;
+ return -1;
+ }
+- if (ftp_req(c, "pass %s", c->ftp_password) < 0 || c->ftp_resp != 230) {
+- E_LOGX(0, "Password xxxxx: failed");
+- FD_CLOSE(c->ftp_com);
+- c->ftp_resp = JFTP_ERR;
+- return -1;
++ /* USER command can respond 230 immediately in some cases */
++ if (c->ftp_resp != 230) {
++ if (ftp_req(c, "pass %s", c->ftp_password) < 0
++ || c->ftp_resp != 230) {
++ E_LOGX(0, "Password xxxxx: failed");
++ FD_CLOSE(c->ftp_com);
++ c->ftp_resp = JFTP_ERR;
++ return -1;
++ }
+ }
+ c->ftp_resp = 0;
+ if (ftp_req(c, "TYPE I") < 0 || c->ftp_resp != 200) {
+@@ -980,7 +1003,7 @@
/* Late versions of wu-ftpd does some kind of recursive
* listing if only a '.' is given as directory.
*/