1 # change makes proftpd to comply with RFC 640/RFC 959.
3 # RFC 640 defines format of multi-line responses. All the foundation
4 # to produce proper multi-line error codes exists already in proftpd
5 # code. The change allows proftpd to do the right thing.
7 # Patch has been submitted to upstream
8 # https://github.com/proftpd/proftpd/pull/874
11 --- a/modules/mod_facts.c
12 +++ b/modules/mod_facts.c
13 @@ -1464,7 +1464,7 @@ MODRET facts_mlsd(cmd_rec *cmd) {
15 pr_fsio_closedir(dirh);
17 - pr_response_add_err(R_550, "%s: %s", (char *) cmd->argv[0],
18 + pr_response_add_err(R_425, "%s: %s", (char *) cmd->argv[0],
21 pr_cmd_set_errno(cmd, xerrno);
22 --- a/modules/mod_ls.c
23 +++ b/modules/mod_ls.c
24 @@ -1960,7 +1960,7 @@ static int dolist(cmd_rec *cmd, const char *opt, const char *resp_code,
25 if (pr_data_open(NULL, "file list", PR_NETIO_IO_WR, 0) < 0) {
28 - pr_response_add_err(R_450, "%s: %s", (char *) cmd->argv[0],
29 + pr_response_add_err(R_425, "%s: %s", (char *) cmd->argv[0],
32 pr_cmd_set_errno(cmd, xerrno);
33 @@ -2205,7 +2205,7 @@ static int dolist(cmd_rec *cmd, const char *opt, const char *resp_code,
34 if (pr_data_open(NULL, "file list", PR_NETIO_IO_WR, 0) < 0) {
37 - pr_response_add_err(R_450, "%s: %s", (char *) cmd->argv[0],
38 + pr_response_add_err(R_425, "%s: %s", (char *) cmd->argv[0],
41 pr_cmd_set_errno(cmd, xerrno);
42 @@ -3106,7 +3106,7 @@ MODRET ls_nlst(cmd_rec *cmd) {
43 if (pr_data_open(NULL, "file list", PR_NETIO_IO_WR, 0) < 0) {
46 - pr_response_add_err(R_450, "%s: %s", (char *) cmd->argv[0],
47 + pr_response_add_err(R_425, "%s: %s", (char *) cmd->argv[0],
50 pr_cmd_set_errno(cmd, xerrno);
51 @@ -3133,7 +3133,7 @@ MODRET ls_nlst(cmd_rec *cmd) {
52 if (pr_data_open(NULL, "file list", PR_NETIO_IO_WR, 0) < 0) {
55 - pr_response_add_err(R_450, "%s: %s", (char *) cmd->argv[0],
56 + pr_response_add_err(R_425, "%s: %s", (char *) cmd->argv[0],
59 pr_cmd_set_errno(cmd, xerrno);
60 @@ -3162,7 +3162,7 @@ MODRET ls_nlst(cmd_rec *cmd) {
61 if (pr_data_open(NULL, "file list", PR_NETIO_IO_WR, 0) < 0) {
64 - pr_response_add_err(R_450, "%s: %s", (char *) cmd->argv[0],
65 + pr_response_add_err(R_425, "%s: %s", (char *) cmd->argv[0],
68 pr_cmd_set_errno(cmd, xerrno);
69 @@ -3255,7 +3255,7 @@ MODRET ls_nlst(cmd_rec *cmd) {
70 if (pr_data_open(NULL, "file list", PR_NETIO_IO_WR, 0) < 0) {
73 - pr_response_add_err(R_450, "%s: %s", (char *) cmd->argv[0],
74 + pr_response_add_err(R_425, "%s: %s", (char *) cmd->argv[0],
77 pr_cmd_set_errno(cmd, xerrno);
78 @@ -3292,7 +3292,7 @@ MODRET ls_nlst(cmd_rec *cmd) {
79 if (pr_data_open(NULL, "file list", PR_NETIO_IO_WR, 0) < 0) {
82 - pr_response_add_err(R_450, "%s: %s", (char *) cmd->argv[0],
83 + pr_response_add_err(R_425, "%s: %s", (char *) cmd->argv[0],
86 pr_cmd_set_errno(cmd, xerrno);
87 @@ -3333,7 +3333,7 @@ MODRET ls_nlst(cmd_rec *cmd) {
88 if (pr_data_open(NULL, "file list", PR_NETIO_IO_WR, 0) < 0) {
91 - pr_response_add_err(R_450, "%s: %s", (char *) cmd->argv[0],
92 + pr_response_add_err(R_425, "%s: %s", (char *) cmd->argv[0],
95 pr_cmd_set_errno(cmd, xerrno);
96 @@ -3358,7 +3358,7 @@ MODRET ls_nlst(cmd_rec *cmd) {
97 if (pr_data_open(NULL, "file list", PR_NETIO_IO_WR, 0) < 0) {
100 - pr_response_add_err(R_450, "%s: %s", (char *) cmd->argv[0],
101 + pr_response_add_err(R_425, "%s: %s", (char *) cmd->argv[0],
104 pr_cmd_set_errno(cmd, xerrno);
105 @@ -3373,6 +3373,9 @@ MODRET ls_nlst(cmd_rec *cmd) {
106 if (pr_data_open(NULL, "file list", PR_NETIO_IO_WR, 0) < 0) {
109 + pr_response_add_err(R_425, "%s: %s", (char *) cmd->argv[0],
112 pr_cmd_set_errno(cmd, xerrno);
114 return PR_ERROR(cmd);