muddleftpd-track
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Muddleftpd-track] [Patch #647] adds basic scripting support (preup,post


From: nobody
Subject: [Muddleftpd-track] [Patch #647] adds basic scripting support (preup,postup,dirname,postdel)
Date: Mon, 11 Nov 2002 14:30:49 -0500

Patch #647 has been updated. 

Project: 
Category: addon
Status: Open
Summary: adds basic scripting support (preup,postup,dirname,postdel)

Follow-Ups:

Date: 2002-Nov-11 19:45
By: mcree

Comment:
i'm lame to savannah... 8)
-------------------------------------------------------

Date: 2002-Nov-11 20:30
By: mcree

Comment:
Basically this patch adds scripting support for the most important scriptable 
ftp events: uploading, removing files and directory creation. Scripts get the 
most significant environmental conditions (filename, current user, rootdir, 
vserver name, client address) trough commandline parameters.

There are 4 new configuration options for vservers:

# pre-up: executes script upon STOR command. 
# can deny access via returning errorcode of 1 
# otherwise must exit with 0
preupscript /path/to/executable
# post-up: executes script upon 'transfer done'. 
# can remove uploaded file by returning errorcode of 1
# otherwise must exit with 0
postupscript /path/to/executable
# post-del: executes script after DELE command.
postdelscript /path/to/executable
# dir-name: executes script upon MKDIR command. 
# can deny access via returning errorcode of 1
# otherwise must exit with 0
dirnamescript /path/to/executable

the commandline parameters passed to the scripts are the following:
1. filename with full path (relative to chroot see bellow) [dangerous 
characters escaped in order to prevent shell expansion or other misbehaviour]
2. users root directory [dirname is escaped too]
3. current username (user's login name)
4. current groupname
5. remote host's ip (dotted quad format)
6. remote host's name
7. current vserver section name (from configfile)

The scripts are run trough the system() call.

Remember: when you use chrooting (muddleftpd is running with full privileges), 
scripts must be executable in the chroot jail. To achieve this you may need to 
create /lib, /bin and other sysdirs and fill them with the necessary libs and 
executables (you'll need /bin/sh for sure... 8)

This patch was a must for me, so i must had it done... only glftpd 
(www.glftpd.org) allows this kind of scripting, but it's closed-source and 
breaks things here or there... muddleftpd is clean and has a better conceptual 
architecture... so keep it up... and i hope that other's will find my code 
usefull too...

-------------------------------------------------------

-------------------------------------------------------
For more info, visit:

http://savannah.nongnu.org/patch/?func=detailpatch&patch_id=647&group_id=3025




reply via email to

[Prev in Thread] Current Thread [Next in Thread]