[prev in list] [next in list] [prev in thread] [next in thread]
List: proftpd-committers
Subject: [ProFTPD-committers] CVS: proftpd/modules mod_xfer.c,1.199,1.200
From: TJ Saunders <castaglia () users ! sourceforge ! net>
Date: 2006-05-25 15:44:17
Message-ID: E1FjI0X-0001hZ-0f () sc8-pr-cvs1 ! sourceforge ! net
[Download RAW message or body]
Update of /cvsroot/proftp/proftpd/modules
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6522/modules
Modified Files:
mod_xfer.c
Log Message:
Bug#2775 - Support for DisplayFileTransfer directive.
Index: mod_xfer.c
===================================================================
RCS file: /cvsroot/proftp/proftpd/modules/mod_xfer.c,v
retrieving revision 1.199
retrieving revision 1.200
diff -u -r1.199 -r1.200
--- mod_xfer.c 15 May 2006 16:32:32 -0000 1.199
+++ mod_xfer.c 25 May 2006 15:44:14 -0000 1.200
@@ -1180,12 +1180,27 @@
return HANDLED(cmd);
}
+MODRET xfer_post_xfer(cmd_rec *cmd) {
+ char *display = get_param_ptr(main_server->conf, "DisplayFileTransfer",
+ FALSE);
+
+ if (display) {
+ if (pr_display_file(display, session.vwd, R_226) < 0) {
+ pr_log_debug(DEBUG3, "error displaying '%s': %s", display,
+ strerror(errno));
+ }
+ }
+
+ return DECLINED(cmd);
+}
+
/* xfer_post_stou() is a POST_CMD handler that changes the mode of the
* STOU file from 0600, which is what mkstemp() makes it, to 0666,
* the default for files uploaded via STOR. This is to prevent users
* from being surprised.
*/
MODRET xfer_post_stou(cmd_rec *cmd) {
+ char *display;
/* This is the same mode as used in src/fs.c. Should probably be
* available as a macro.
@@ -1199,7 +1214,15 @@
strerror(errno));
}
- return HANDLED(cmd);
+ display = get_param_ptr(main_server->conf, "DisplayFileTransfer", FALSE);
+ if (display) {
+ if (pr_display_file(display, session.vwd, R_226) < 0) {
+ pr_log_debug(DEBUG3, "error displaying '%s': %s", display,
+ strerror(errno));
+ }
+ }
+
+ return DECLINED(cmd);
}
/* xfer_pre_appe() is the PRE_CMD handler for the APPE command, which
@@ -2058,6 +2081,15 @@
return HANDLED(cmd);
}
+/* usage: DisplayFileTransfer path */
+MODRET set_displayfiletransfer(cmd_rec *cmd) {
+ CHECK_ARGS(cmd, 1);
+ CHECK_CONF(cmd, CONF_ROOT|CONF_VIRTUAL|CONF_GLOBAL);
+
+ (void) add_config_param_str(cmd->argv[0], 1, cmd->argv[1]);
+ return HANDLED(cmd);
+}
+
MODRET set_hiddenstores(cmd_rec *cmd) {
int bool = -1;
config_rec *c = NULL;
@@ -2543,6 +2575,7 @@
{ "AllowRetrieveRestart", set_allowrestart, NULL },
{ "AllowStoreRestart", set_allowrestart, NULL },
{ "DeleteAbortedStores", set_deleteabortedstores, NULL },
+ { "DisplayFileTransfer", set_displayfiletransfer, NULL },
{ "HiddenStores", set_hiddenstores, NULL },
{ "MaxRetrieveFileSize", set_maxfilesize, NULL },
{ "MaxStoreFileSize", set_maxfilesize, NULL },
@@ -2584,7 +2617,9 @@
{ LOG_CMD_ERR, C_APPE,G_NONE, xfer_err_cleanup, FALSE, FALSE },
{ CMD, C_ABOR, G_NONE, xfer_abor, TRUE, TRUE, CL_MISC },
{ CMD, C_REST, G_NONE, xfer_rest, TRUE, FALSE, CL_MISC },
- { POST_CMD,C_PROT, G_NONE, xfer_post_prot,FALSE, FALSE },
+ { POST_CMD,C_PROT, G_NONE, xfer_post_prot, FALSE, FALSE },
+ { POST_CMD,C_RETR, G_NONE, xfer_post_xfer, FALSE, FALSE },
+ { POST_CMD,C_STOR, G_NONE, xfer_post_xfer, FALSE, FALSE },
{ 0, NULL }
};
-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
ProFTPD Committers Mailing List
proftpd-committers@proftpd.org
https://lists.sourceforge.net/lists/listinfo/proftp-committers
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic