Apache HTTPD
Classes | Macros | Functions | Variables
mod_proxy_ftp.c File Reference
#include "mod_proxy.h"
#include "apr_version.h"

Go to the source code of this file.

Classes

struct  proxy_ftp_dir_conf
 
struct  proxy_dir_ctx_t
 

Macros

#define APR_WANT_BYTEFUNC
 
#define AUTODETECT_PWD
 
#define USE_MDTM
 
#define FTP_GLOBBING_CHARS   "*?[{~"
 
#define MAX_LINE_LEN   80
 
#define LS_REG_PATTERN   "^ *([0-9]+) +([^ ]+)$"
 
#define LS_REG_MATCH   3
 

Functions

static void * create_proxy_ftp_dir_config (apr_pool_t *p, char *dummy)
 
static void * merge_proxy_ftp_dir_config (apr_pool_t *p, void *basev, void *addv)
 
static const charset_ftp_list_on_wildcard (cmd_parms *cmd, void *dconf, int flag)
 
static const charset_ftp_escape_wildcards (cmd_parms *cmd, void *dconf, int flag)
 
static const charset_ftp_directory_charset (cmd_parms *cmd, void *dconf, const char *arg)
 
static int decodeenc (char *x)
 
static const charftp_escape_globbingchars (apr_pool_t *p, const char *path, proxy_ftp_dir_conf *dconf)
 
static int ftp_check_globbingchars (const char *path)
 
static int ftp_check_string (const char *x)
 
static apr_status_t ftp_string_read (conn_rec *c, apr_bucket_brigade *bb, char *buff, apr_size_t bufflen, int *eos, apr_size_t *outlen)
 
static int proxy_ftp_canon (request_rec *r, char *url)
 
static int ftp_getrc_msg (conn_rec *ftp_ctrl, apr_bucket_brigade *bb, char *msgbuf, int msglen)
 
static apr_status_t proxy_send_dir_filter (ap_filter_t *f, apr_bucket_brigade *in)
 
static apr_port_t parse_epsv_reply (const char *reply)
 
static int proxy_ftp_command (const char *cmd, request_rec *r, conn_rec *ftp_ctrl, apr_bucket_brigade *bb, char **pmessage)
 
static int ftp_set_TYPE (char xfer_type, request_rec *r, conn_rec *ftp_ctrl, apr_bucket_brigade *bb, char **pmessage)
 
static charftp_get_PWD (request_rec *r, conn_rec *ftp_ctrl, apr_bucket_brigade *bb)
 
static int ftp_unauthorized (request_rec *r, int log_it)
 
static apr_status_t proxy_ftp_cleanup (request_rec *r, proxy_conn_rec *backend)
 
static int ftp_proxyerror (request_rec *r, proxy_conn_rec *conn, int statuscode, const char *message)
 
static int proxy_ftp_handler (request_rec *r, proxy_worker *worker, proxy_server_conf *conf, char *url, const char *proxyhost, apr_port_t proxyport)
 
static void ap_proxy_ftp_register_hook (apr_pool_t *p)
 

Variables

static ap_regex_tls_regex
 
static const command_rec proxy_ftp_cmds []
 
static int *const aplog_module_index = &( proxy_ftp_module.module_index)
 

Macro Definition Documentation

◆ APR_WANT_BYTEFUNC

#define APR_WANT_BYTEFUNC

Definition at line 19 of file mod_proxy_ftp.c.

◆ AUTODETECT_PWD

#define AUTODETECT_PWD

Definition at line 26 of file mod_proxy_ftp.c.

◆ FTP_GLOBBING_CHARS

#define FTP_GLOBBING_CHARS   "*?[{~"

Definition at line 140 of file mod_proxy_ftp.c.

◆ LS_REG_MATCH

#define LS_REG_MATCH   3

Definition at line 446 of file mod_proxy_ftp.c.

◆ LS_REG_PATTERN

#define LS_REG_PATTERN   "^ *([0-9]+) +([^ ]+)$"

Definition at line 445 of file mod_proxy_ftp.c.

◆ MAX_LINE_LEN

#define MAX_LINE_LEN   80

Definition at line 375 of file mod_proxy_ftp.c.

◆ USE_MDTM

#define USE_MDTM

Definition at line 31 of file mod_proxy_ftp.c.

Function Documentation

◆ ap_proxy_ftp_register_hook()

static void ap_proxy_ftp_register_hook ( apr_pool_t p)
static

unused

Definition at line 2083 of file mod_proxy_ftp.c.

◆ create_proxy_ftp_dir_config()

static void * create_proxy_ftp_dir_config ( apr_pool_t p,
char dummy 
)
static

Definition at line 44 of file mod_proxy_ftp.c.

◆ decodeenc()

static int decodeenc ( char x)
static

Definition at line 113 of file mod_proxy_ftp.c.

◆ ftp_check_globbingchars()

static int ftp_check_globbingchars ( const char path)
static

Definition at line 166 of file mod_proxy_ftp.c.

◆ ftp_check_string()

static int ftp_check_string ( const char x)
static

Definition at line 181 of file mod_proxy_ftp.c.

◆ ftp_escape_globbingchars()

static const char * ftp_escape_globbingchars ( apr_pool_t p,
const char path,
proxy_ftp_dir_conf dconf 
)
static

Definition at line 141 of file mod_proxy_ftp.c.

◆ ftp_get_PWD()

static char * ftp_get_PWD ( request_rec r,
conn_rec ftp_ctrl,
apr_bucket_brigade bb 
)
static

Definition at line 888 of file mod_proxy_ftp.c.

◆ ftp_getrc_msg()

static int ftp_getrc_msg ( conn_rec ftp_ctrl,
apr_bucket_brigade bb,
char msgbuf,
int  msglen 
)
static

Definition at line 381 of file mod_proxy_ftp.c.

◆ ftp_proxyerror()

static int ftp_proxyerror ( request_rec r,
proxy_conn_rec conn,
int  statuscode,
const char message 
)
static

Definition at line 958 of file mod_proxy_ftp.c.

◆ ftp_set_TYPE()

static int ftp_set_TYPE ( char  xfer_type,
request_rec r,
conn_rec ftp_ctrl,
apr_bucket_brigade bb,
char **  pmessage 
)
static

Definition at line 851 of file mod_proxy_ftp.c.

◆ ftp_string_read()

static apr_status_t ftp_string_read ( conn_rec c,
apr_bucket_brigade bb,
char buff,
apr_size_t  bufflen,
int eos,
apr_size_t outlen 
)
static

Definition at line 215 of file mod_proxy_ftp.c.

◆ ftp_unauthorized()

static int ftp_unauthorized ( request_rec r,
int  log_it 
)
static

< No proxy

Definition at line 924 of file mod_proxy_ftp.c.

◆ merge_proxy_ftp_dir_config()

static void * merge_proxy_ftp_dir_config ( apr_pool_t p,
void *  basev,
void *  addv 
)
static

Definition at line 56 of file mod_proxy_ftp.c.

◆ parse_epsv_reply()

static apr_port_t parse_epsv_reply ( const char reply)
static

Definition at line 780 of file mod_proxy_ftp.c.

◆ proxy_ftp_canon()

static int proxy_ftp_canon ( request_rec r,
char url 
)
static

< Module declines to handle

< Module has handled this stage.

Definition at line 286 of file mod_proxy_ftp.c.

◆ proxy_ftp_cleanup()

static apr_status_t proxy_ftp_cleanup ( request_rec r,
proxy_conn_rec backend 
)
static

< Module has handled this stage.

Definition at line 947 of file mod_proxy_ftp.c.

◆ proxy_ftp_command()

static int proxy_ftp_command ( const char cmd,
request_rec r,
conn_rec ftp_ctrl,
apr_bucket_brigade bb,
char **  pmessage 
)
static

Definition at line 810 of file mod_proxy_ftp.c.

◆ proxy_ftp_handler()

static int proxy_ftp_handler ( request_rec r,
proxy_worker worker,
proxy_server_conf conf,
char url,
const char proxyhost,
apr_port_t  proxyport 
)
static

< Module declines to handle

< Module declines to handle

RFC 2616: HTTP

< Module has handled this stage.

< Module has handled this stage.

< Module has handled this stage.

< Receive buffer

< For SCTP sockets, this is mapped * to STCP_NODELAY internally.

< Receive buffer

< For SCTP sockets, this is mapped * to STCP_NODELAY internally.

< Reuse addresses

< Module has handled this stage.

< Module has served the response completely * - it's safe to die() with no more output

< Module has handled this stage.

Definition at line 970 of file mod_proxy_ftp.c.

◆ proxy_send_dir_filter()

static apr_status_t proxy_send_dir_filter ( ap_filter_t f,
apr_bucket_brigade in 
)
static

< Reverse proxy

Definition at line 449 of file mod_proxy_ftp.c.

◆ set_ftp_directory_charset()

static const char * set_ftp_directory_charset ( cmd_parms cmd,
void *  dconf,
const char arg 
)
static

Definition at line 101 of file mod_proxy_ftp.c.

◆ set_ftp_escape_wildcards()

static const char * set_ftp_escape_wildcards ( cmd_parms cmd,
void *  dconf,
int  flag 
)
static

Definition at line 91 of file mod_proxy_ftp.c.

◆ set_ftp_list_on_wildcard()

static const char * set_ftp_list_on_wildcard ( cmd_parms cmd,
void *  dconf,
int  flag 
)
static

Definition at line 81 of file mod_proxy_ftp.c.

Variable Documentation

◆ aplog_module_index

int* const aplog_module_index = &( proxy_ftp_module.module_index)
static

Definition at line 2108 of file mod_proxy_ftp.c.

◆ ls_regex

ap_regex_t* ls_regex
static

Definition at line 447 of file mod_proxy_ftp.c.

◆ proxy_ftp_cmds

const command_rec proxy_ftp_cmds[]
static
Initial value:
=
{
{ "ProxyFtpListOnWildcard" , set_ftp_list_on_wildcard , NULL , 128 | 64 , FLAG, "Whether wildcard characters in a path cause mod_proxy_ftp to list the files instead of trying to get them. Defaults to on." },
{ "ProxyFtpEscapeWildcards" , set_ftp_escape_wildcards , NULL , 128 | 64 , FLAG, "Whether the proxy should escape wildcards in paths before sending them to the FTP server. Defaults to on, but most FTP servers will need it turned off if you need to manage paths that contain wildcard characters." },
{ "ProxyFtpDirCharset" , set_ftp_directory_charset , NULL , 128 | 64 , TAKE1, "Define the character set for proxied FTP listings" },
{NULL}
}
@ TAKE1
Definition http_config.h:51
@ FLAG
Definition http_config.h:59
static const char * set_ftp_list_on_wildcard(cmd_parms *cmd, void *dconf, int flag)
static const char * set_ftp_directory_charset(cmd_parms *cmd, void *dconf, const char *arg)
static const char * set_ftp_escape_wildcards(cmd_parms *cmd, void *dconf, int flag)
return NULL
Definition mod_so.c:359

Definition at line 2096 of file mod_proxy_ftp.c.