Author Topic: mod_case and MLSD  (Read 784 times)

Offline cmerriman

  • Regular User
  • **
  • Posts: 37
    • View Profile
mod_case and MLSD
« on: February 11, 2016, 01:51:47 am »
ProFTPd seg faults when passing an MLSD command to mod_case.

Build: proftpd-1.3.5a
mod_case: 0.7

Configuration:
CaseEngine on
CaseIgnore on

Filezilla client output:
Code: [Select]
Command: TYPE I
Response: 200 Type set to I
Command: PASV
Response: 227 Entering Passive Mode (x,x,x,x,216,187).
Command: MLSD
Error: Connection closed by server
Error: Failed to retrieve directory listing

Debug output:
Code: [Select]
2016-02-10 15:39:04,361 host.dev proftpd[24630] x.x.x.x (x.x.x.x[x.x.x.x]): dispatching PRE_CMD command 'MLSD' to mod_core
2016-02-10 15:39:04,361 host.dev proftpd[24630] x.x.x.x (x.x.x.x[x.x.x.x]): dispatching PRE_CMD command 'MLSD' to mod_core
2016-02-10 15:39:04,361 host.dev proftpd[24630] x.x.x.x (x.x.x.x[x.x.x.x]): dispatching PRE_CMD command 'MLSD' to mod_case
2016-02-10 15:39:04,361 host.dev proftpd[24630] x.x.x.x (x.x.x.x[x.x.x.x]): FTP Today Server terminating (signal 11)
2016-02-10 15:39:04,363 host.dev proftpd[24630] x.x.x.x (x.x.x.x[x.x.x.x]): FTP session closed.

Trace log output
Code: [Select]
2016-02-10 15:39:04,361 [24630] <response:9>: clearing response lists before dispatching command 'MLSD'
2016-02-10 15:39:04,361 [24630] <command:7>: dispatching PRE_CMD command 'MLSD' to mod_rewrite.c
2016-02-10 15:39:04,361 [24630] <command:7>: dispatching PRE_CMD command 'MLSD' to mod_tls.c
2016-02-10 15:39:04,361 [24630] <command:7>: dispatching PRE_CMD command 'MLSD' to mod_core.c
2016-02-10 15:39:04,361 [24630] <command:7>: dispatching PRE_CMD command 'MLSD' to mod_core.c
2016-02-10 15:39:04,361 [24630] <command:7>: dispatching PRE_CMD command 'MLSD' to mod_case.c
2016-02-10 15:39:04,361 [24630] <signal:9>: handling SIGSEGV (signal 11)
2016-02-10 15:39:04,361 [24630] <scoreboard:3>: deleting scoreboard entry
2016-02-10 15:39:04,361 [24630] <lock:9>: attempting to write-lock scoreboard fd 11 entry, offset 32
2016-02-10 15:39:04,361 [24630] <lock:9>: write-lock of scoreboard fd 11 entry, offset 32 succeeded

With configuration:
CaseEngine on
CaseIgnore APPE, CWD, DELE, LIST, MDTM, MKD, MLST, NLST, RETR, RMD, RNFR, RNTO, SIZE, STOR, XCWD, XMKD,  XRMD

MLSD command works as expected.

Cause appears to be the MLSD command without a specified path.

This patch to mod_case.c resolved the issue for me:
Code: [Select]
<
<       /* LIST, NLST, and STAT can send no path arguments.  If that's the
<        * case, we're done.
<        */
<       if (path == NULL) {
<         return PR_DECLINED(cmd);
<       }
<
361a354,361
>   /* LIST, NLST, and STAT (and others) can send no path arguments.  If that's the
>    * case, we're done.
>    */
>   if (path == NULL) {
>     return PR_DECLINED(cmd);
>   }
>
>

Offline cmerriman

  • Regular User
  • **
  • Posts: 37
    • View Profile
Re: mod_case and MLSD
« Reply #1 on: February 11, 2016, 02:15:53 am »
Nevermind - I downloaded from http://www.castaglia.org/proftpd/modules/proftpd-mod-case-0.7.tar.gz instead of getting version 0.8 from github.  Current version does not have the issue.


 

sighted planning