Subject: Continued problems getting on-the-fly tar/compress to work

From: "W. James Showalter" <[email-masked]>
Date: Mon, 25 Mar 1996 13:45:38 -0500 (EST)

This is a follow-up of the message I sent a couple of days ago. I
apologize for its length but I see no other way to get the info across. I
still can't get the conversions to work.  In fact, one would think the
conversions are being ignored except that I have put debug statements in
to verify they are being parsed.  My platform is a SPARC 5 running SunOS
4.1.4. I had no compilation problems and practically everything works as
advertised. 

My conversion file is the one provided with the distribution.  The only 
difference is the location of the commands (mine are /usr/local/lib).

Here are the first two lines of my conversion file.

 :.Z: : :/usr/local/bin/gzip -d -c %s:T_REG|T_ASCII:O_UNCOMPRESS:UNCOMPRESS
 : : :.Z:/usr/local/bin/compress -c %s:T_REG:O_COMPRESS:COMPRESS

Since my ftpaccess file is short, I am including it here: 

-------START OF FTPACCESS-------------

class   everyone   real,anonymous,guest  *

limit   everyone   10   Any              /etc/msgs/msg.dead

readme  README*    login
readme  README*    cwd=*

message /usr/local/lib/ftpd/welcome.msg  login  
message /.msgs/welcome.msg	    login 
message .message                cwd=*    

compress        yes             everyone
tar             yes             everyone 

log commands real,anonymous,guest
log transfers anonymous,real inbound,outbound

passwd-check 	rfc822		warn
shutdown /etc/shutmsg

email [email-masked]

---------------END OF FTPACCESS---------------------------

The appropriate executables are in /usr/local/bin and
/home/ftp/usr/local/bin.  Ckconfig reports okay.  I am assuming that when
I issue the following command: 
  
        get foo foo.Z
    	    or
        get foo.Z foo

that compress or gzip is supposed to do its thing prior to tranferring the
file. I have tried various type negotiations but I still can't get this to
work for any user (real or otherwise). 

I am compiling using gcc version 2.7.0. And the arguments to compress, gzip,
and tar have been verified to be correct.

Again, any help would be most appreciated.

Many thanks,
Jim

---

From: Alex Gadget McColl <[email-masked]>
Date: Mon, 25 Mar 1996 12:39:17 -0700 (MST)

Hi James,
I too am in EXACTLY the same boat. 
I too am on SunOS 4.1.4 with GCC 2.7...
My executables are in ~ftp/bin but aside from that all is the same...
I even tried changing my /usr/local/etc/ftpconversions file to call
a shell script 'test' that it never called... I did have to change 
the ftpd.c code to enable compression..... on the following line
   212
   213  /* allowed on-the-fly file manipulations (compress, tar) */
   214  int mangleopts = 1;
   215
My default value for 'mangleopts' was 0, I changed it to 1

did you do that?

That still didn't help me... then I included ~ftp/usr/lib/ld.so
and                                                       libc.so.1.9.2*  
and                                                       libdl.so.1.0*

in the hopes that this was that chroot problem mentioned... and that didn't
help so I then decided to build static versions of gtar ('tar') and gzip...
and mine still doesn't work either...

If you figure this thing out first... please let me know.

Here is my test script that I mentioned:
*** Begin ~ftp/bin/testi ***
#!/bin/csh
set date = `date`
echo "testi accessed: $date" > /dev/console
echo $date > /usr/local/etc/testi.date
*** end of ~ftp/bin/testi ***

*** Begin of /usr/local/etc/ftpconversions ***
 :.Z:  :  :/bin/testi -d -c %s:T_REG|T_ASCII:O_UNCOMPRESS:UNCOMPRESS
 :   : :.Z:/bin/testi -c %s:T_REG:O_COMPRESS:COMPRESS
 :.gz: :  :/bin/testi -cd %s:T_REG|T_ASCII:O_UNCOMPRESS:GUNZIP
 :   : :.gz:/bin/testi -9 -c %s:T_REG:O_COMPRESS:GZIP
 :   : :.tar:/bin/testi -c -f - %s:T_REG|T_DIR:O_TAR:TAR
 :   : :.tar.Z:/bin/testi -c -Z -f - %s:T_REG|T_DIR:O_COMPRESS|O_TAR:TAR+COMPRE
SS
 :   : :.tar.gz:/bin/testi -c -z -f - %s:T_REG|T_DIR:O_COMPRESS|O_TAR:TAR+GZIP
*** Endo of /usr/local/etc/ftpconversions ***

I have since also tried the original ftpconversions (in the wu-ftpd example
directory... and it didn't work either)... I don't think it's even accessing
any of the commands in /usr/local/etc/ftpconversions... because my 
testi never ran.

% 
% 
% This is a follow-up of the message I sent a couple of days ago. I
% apologize for its length but I see no other way to get the info across. I
% still can't get the conversions to work.  In fact, one would think the
% conversions are being ignored except that I have put debug statements in
% to verify they are being parsed.  My platform is a SPARC 5 running SunOS
% 4.1.4. I had no compilation problems and practically everything works as
% advertised. 
% 
% My conversion file is the one provided with the distribution.  The only 
% difference is the location of the commands (mine are /usr/local/lib).
% 
% Here are the first two lines of my conversion file.
% 
%  :.Z: : :/usr/local/bin/gzip -d -c %s:T_REG|T_ASCII:O_UNCOMPRESS:UNCOMPRESS
%  : : :.Z:/usr/local/bin/compress -c %s:T_REG:O_COMPRESS:COMPRESS
% 
% Since my ftpaccess file is short, I am including it here: 
% 
% -------START OF FTPACCESS-------------
% 
% class   everyone   real,anonymous,guest  *
% 
% limit   everyone   10   Any              /etc/msgs/msg.dead
% 
% readme  README*    login
% readme  README*    cwd=*
% 
% message /usr/local/lib/ftpd/welcome.msg  login  
% message /.msgs/welcome.msg	    login 
% message .message                cwd=*    
% 
% compress        yes             everyone
% tar             yes             everyone 
% 
% 
% log commands real,anonymous,guest
% log transfers anonymous,real inbound,outbound
% 
% passwd-check 	rfc822		warn
% shutdown /etc/shutmsg
% 
% email [email-masked]
% 
% ---------------END OF FTPACCESS---------------------------
% 
% The appropriate executables are in /usr/local/bin and
% /home/ftp/usr/local/bin.  Ckconfig reports okay.  I am assuming that when
% I issue the following command: 
%   
%         get foo foo.Z
%     	    or
%         get foo.Z foo
% 
% that compress or gzip is supposed to do its thing prior to tranferring the
% file. I have tried various type negotiations but I still can't get this to
% work for any user (real or otherwise). 
% 
% I am compiling using gcc version 2.7.0. And the arguments to compress, gzip,
% and tar have been verified to be correct.
% 
% Again, any help would be most appreciated.
% 
% Many thanks,
% Jim
%  
% 
% 
% 

Alex.

  ****************************************************************************
  * Alex McColl - Network System Administrator		[email-masked] *
  * Colorado Center for Astrodynamics Research	        Work  (303) 492-1308 *
  * University of Colorado at Boulder		        FAX   (303) 492-2825 *
  * Campus Box 431				  	Pager (303) 465-7556 *
  * Boulder, Colorado 80309-0431			Home  (303) 443-4665 *
  * http://kurgan.colorado.edu/personnel/professionals/mccollh               *
  ****************************************************************************

---

From: Riku Saikkonen <[email-masked]>
Date: Mon, 25 Mar 1996 22:17:43 +0200 (EET)

>that compress or gzip is supposed to do its thing prior to tranferring the

Well, no, actually. That only does filename conversion in the FTP client
(for 'get foo foo.Z' the client gets foo and saves it on disk as foo.Z) (or
at least standard Unix FTP clients work this way). You need to `get foo' if
you have foo.Z in the FTP directory, or `get foo.Z' if you have foo and want
it compressed.

-- 
-=- Rjs -=- [email-masked] - http://isil.lloke.dna.fi/rjs/

---

From: "W. James Showalter" <[email-masked]>
Date: Mon, 25 Mar 1996 15:41:42 -0500 (EST)

Well, that was the problem.  Things work as advertised.  I guess I
just had it in my mind to specify both names as a trigger to do
the conversions.  Having read the man page several times it still
didn't occur to me to specify a file which "wasn't there."

Thanks,
Jim