Subject: RE: Trigger of an executable upon file send complete

From: Simon Bennett <[email-masked]>
Date: Wed, 30 Sep 1998 10:43:10 +1000

I'm doing just this - mind you I'm patching the source code to do it.

I'm currently modifying BeroFTPD because it's all ANSI 'C' (which makes
the code a *lot* easier to read) and builds with autoconf - but it can
probably be made to VR patched wu.

What are your requirements?  Same exe?  Exe based on file?  Different
exe depending on sucess or failure of transfer?
 
> Hi,
> 
> does anyone know of how I can assign specific jobs to be executed
> immediately after a file has been successfully (or 
> unsuccessfully) sent???
> 
> apart from polling for those files which is such a waste of CPU
> cycles......
> 
> vic
> 
>

---

From: Gregory A Lundberg <[email-masked]>
Date: Tue, 29 Sep 1998 21:00:24 -0400 (EDT)

> I'm doing just this - mind you I'm patching the source code to do it.

No other way.

> I'm currently modifying BeroFTPD because it's all ANSI 'C' (which
> makes the code a *lot* easier to read) and builds with autoconf - but
> it can probably be made to VR patched wu.
> 

I'd like to suggest the following syntax:

onupload [success|failure|-] <fileglob> <uid> <gid> <exename> [<parameters> ...]

Where:

[success|failure|-] optional parameter, only execute if success or
failure, or anytime.  The - is to avoid confusing the option with a file
named 'success' or 'failure'

<fileglob> required, pass to fnmatch, execute if !fnmatch .. only when
matched.

<uid> and <gid> required, the user/group to execute the program as.

<exename> required, the name of a program in /bin .. no PATH, it must
be in /bin

[<parameters>] optional, command-line parameters to pass to the program.
The special parameter %F receives the name of the uploaded file.

-- 

Gregory A Lundberg		Senior Partner, VRnet Company
1441 Elmdale Drive              [email-masked]
Kettering, OH 45409-1615 USA    1-800-809-2195

---

From: Bob Luckin <[email-masked]>
Date: Wed, 30 Sep 98 12:53:59 CDT

Gregory said :-
> <uid> and <gid> required, the user/group to execute the program as.

In addition to being able to force it to run with a known specific uig/gid,
you also need to allow the ability to run as the current user and/or group
(whoever it may be), especially on sites where real users are allowed.
I guess you could use a "-" to specify this, similar to your proposal for
the success/failure option.  Or you could use "%U" and "%G", similar to your
"%F" proposal for the upload file name...

I'm not really fussy about how you specify it, but you do need to allow
this option.

And following on from this, some site admins will probably want to be able
to specify - for each onupload line - which users or classes of users
that feature should be applied to, so that anyone else uploading the file
does not trigger the execution of the program.

The most flexible way of doing this is probably to supply a regexp (which
may be quite complex) which indicates which userids and/or groupids the
command applies to.  (Including a form which says apply it for everyone
_except_ those which match the regexp.)

Hmm...  I'm glad I don't need this feature at the moment !

Cheers, Bob
-- 
Bob Luckin    [email-masked]    "Many hands make a heavy arm"
                             [http://www.dhc.net/luckin/cgi-bin/misfortune.cgi]