www.ProFTPD.de

ProFTPD => ProFTPD - SFV Checker => Thema gestartet von: gnomito am 24. Mai 2004, 19:15:57



Titel: Call external script with sfv checker ?
Beitrag von: gnomito am 24. Mai 2004, 19:15:57
Hi,  

i need help with sfv checker:

I'd like to use sfv checker to call an external script everytime a file is uploaded to the ftp server. The server only accepts .jpg files. All users are banned to their respective user dirs (DefaultRoot ~). First  i tried to use mod_exec, but unfortunately their are some problems with DefaultRoot ~. So it comes to sfv checker.

I just installed sfv checker on my system (Suse 9.0 / ProftpD  1.2.9). Everything seems to work fine. Then i changed the ftpsvcheck.pl script with the following entry:

system("/opt/blabla/thconvert.sh ".$filename);

thconvert.sh is a shell script invoking ImageMagick's 'convert'  with a given filename (absolute path to file) and a definite size for resizing the jpeg.

But this doesn't work. Doesn anybody know what's wrong here. ?

Thx for your help.


Titel: Re: Call external script with sfv checker ?
Beitrag von: stonki am 24. Mai 2004, 19:52:49
Zitat von: "gnomito"
Hi,  

i need help with sfv checker:

I'd like to use sfv checker to call an external script everytime a file is uploaded to the ftp server. The server only accepts .jpg files. All users are banned to their respective user dirs (DefaultRoot ~). First  i tried to use mod_exec, but unfortunately their are some problems with DefaultRoot ~. So it comes to sfv checker.

I just installed sfv checker on my system (Suse 9.0 / ProftpD  1.2.9). Everything seems to work fine. Then i changed the ftpsvcheck.pl script with the following entry:

system("/opt/blabla/thconvert.sh ".$filename);

thconvert.sh is a shell script invoking ImageMagick's 'convert'  with a given filename (absolute path to file) and a definite size for resizing the jpeg.

But this doesn't work. Doesn anybody know what's wrong here. ?

Thx for your help.


you may also consider to use mod_exec in combination with mod_vroot. See www.castaglia.org for more details..


Titel: Re: Call external script with sfv checker ?
Beitrag von: Gnomito am 28. Mai 2004, 14:12:05
Zitat von: "stonki"
you may also consider to use mod_exec in combination with mod_vroot. See www.castaglia.org for more details..


Hi Stonki,

thx for your reply, but unfortunately the sources of mod_exec and mod_vroot on www.castaglia.org are released for different versions of Proftpd. Thus it was not possible to compile reasonably both packages at the same time / version of proftpd. Do you know where to get a version of mod_exec for proftp 1.2.9 ? Because i'm using proftpd on a production system I prefer to use v1.2.9 'til release 1.2.10 is 'stable'.

Thanks. Your help would be very appreciated.


Titel: Re: Call external script with sfv checker ?
Beitrag von: Anonymous am 28. Mai 2004, 14:46:02
I already found an older version (0.7) of mod_exec on my backup. But now Proftpd seems to forget about mod_vroot:

cluster2:/etc/proftpd # /etc/init.d/proftpd start
Starting ProFTPD  - Fatal: VRootOptions: : unknown ExecOption: 'AllowSymlinks'
startproc:  exit status of parent of /usr/local/sbin/proftpd: 1  failed

Some global settings in proftpd.conf:

VRootEnine on
VRootOptions AllowSymlinks
ExecEngine on

[/code]


Titel: Re: Call external script with sfv checker ?
Beitrag von: Anonymous am 28. Mai 2004, 14:49:08
:D  :D
VRootOptions AllowSymlinks  -> VRootOptions allowSymlinks


Titel: Re: Call external script with sfv checker ?
Beitrag von: stonki am 28. Mai 2004, 14:53:56
mod_exec for 1.2.9rc2 or later:
http://castaglia.proftpd.de/proftpd/modules/proftpd-mod-exec-0.7.tar.gz

mod_vroot for 1.2.9rc2 or later:
http://castaglia.proftpd.de/proftpd/modules/proftpd-mod-vroot-0.6rc1.tar.gz


Titel: Re: Call external script with sfv checker ?
Beitrag von: TL am 31. Mai 2004, 22:50:35
Zitat von: "gnomito"
Hi,  

i need help with sfv checker:

I'd like to use sfv checker to call an external script everytime a file is uploaded to the ftp server. The server only accepts .jpg files. All users are banned to their respective user dirs (DefaultRoot ~). First  i tried to use mod_exec, but unfortunately their are some problems with DefaultRoot ~. So it comes to sfv checker.

I just installed sfv checker on my system (Suse 9.0 / ProftpD  1.2.9). Everything seems to work fine. Then i changed the ftpsvcheck.pl script with the following entry:

system("/opt/blabla/thconvert.sh ".$filename);

thconvert.sh is a shell script invoking ImageMagick's 'convert'  with a given filename (absolute path to file) and a definite size for resizing the jpeg.

But this doesn't work. Doesn anybody know what's wrong here. ?

Thx for your help.


Sorry for the late reply, I was on vacation  8)

This would be the correct script:
Code:
#!/usr/bin/perl
if (@ARGV != 1)
{
  print("Usage: ftpsfvcheck.pl filename\n");
  exit(-1);
}
system("/opt/blabla/thconvert.sh " . @ARGV[0]);
exit(0);

Hope this helps...