*** modules/mod_core.c.orig Fri Sep 1 13:39:30 2000 --- modules/mod_core.c Fri Sep 1 05:57:37 2000 *************** *** 36,41 **** --- 36,47 ---- #include #endif + #define STRICT_PASV_MODE + #ifdef STRICT_PASV_MODE + #define STRICT_PASV_PORT_START 8010 + #define STRICT_PASV_PORT_END 8020 + #endif + /* This is declared static to this module because it's not needed, * except for the HELP command. */ *************** *** 1657,1662 **** --- 1663,1672 ---- unsigned char u[2]; } port; + #ifdef STRICT_PASV_MODE + int useport; + #endif + CHECK_CMD_ARGS(cmd, 1); /* If we already have a passive listen data connection open, *************** *** 1668,1675 **** session.d = NULL; } ! session.d = inet_create_connection(session.pool,NULL,-1, session.c->local_ipaddr,INPORT_ANY,FALSE); if(!session.d) return ERROR_MSG(cmd,R_425, --- 1678,1700 ---- session.d = NULL; } ! #ifdef STRICT_PASV_MODE ! ! for(useport=STRICT_PASV_PORT_START;useport<=STRICT_PASV_PORT_END;useport++){ ! session.d = inet_create_connection(session.pool,NULL,-1, ! session.c->local_ipaddr,useport,FALSE); ! ! if(session.d) ! break; ! } ! ! #else ! ! session.d = inet_create_connection(session.pool,NULL,-1, session.c->local_ipaddr,INPORT_ANY,FALSE); + + #endif + if(!session.d) return ERROR_MSG(cmd,R_425,