Subject: [916] commands with anonymous login

From: derek <[email-masked]>
Date: Wed, 14 Dec 1994 16:30:49 +0000 (GMT)

Hi folks,

Ive setup an anonymous login and I need to allow people logged in anonymously
to run tar and compress. Is this possible? How do I do it?

I have looked at ftpconversions but I havent got very far there...the manual
page is a bit sparse.

Thanks,

Derek
---
Derek Harding						        [email-masked]
Product and Software Developer                                  +44 1223 250422
PIPEX (The Public IP Exchange)               http://www.pipex.net/people/derek/

---

From: [email-masked] (KevinTX)
Date: Sun, 18 Dec 1994 14:01:13 -0600 (CST)

> I have looked at ftpconversions but I havent got very far there...the manual

I never have been able to get tar.gz to work.. one or the other works but 
not both together...

I still haven't been able to get my wuftpd 2.4(7) on linux to follow the 
"upload" directive in ftpaccess either.. sigh..

kevin
-- 
  [email-masked]  |    "Ask me no questions, I'll tell you no lies."
 (System Administrator) | Paranoia offers accounts to those desiring Privacy.
  [PGP key by Finger!]  |  <a href="http://www.paranoia.com/">The Server</a>

---

From: Bill Stapleton <[email-masked]>
Date: Mon, 19 Dec 1994 10:06:20 -0600 (CST)

> I never have been able to get tar.gz to work.. one or the other works but 

Here's a potential contribution towards the FAQ, and some code too.  What I
think happens is this:

The "SETPROCTITLE" code destroys the environment, including the PATH,
which makes it hard to find other programs, unless they're in "/bin" which
seems to be searched by default on the machines I've dealt with.  This
causes "tar" to fail in it's attempt to exec "gzip" or whatever.  Now, I
like the "SETPROCTITLE" code, so I added a little snippet of code to set up
a little mini-Environment with a PATH, which gets inherited by "tar", which
enables it to find other programs, as long as they're in the path.

This is my *rough* code, with a compiled-in PATH that works for me, and a
command to change it on the fly.  You probably want to edit this:

*** ftpd.c.ORIG Wed Apr 13 16:17:18 1994
--- newftpd.c   Mon Dec 19 09:34:03 1994
***************
*** 252,257 ****
--- 252,263 ----
  char  ls_short[50];
  struct aclmember *entry = NULL;
  
+ /*wls:*/
+   char *Environ[2];
+   char Path[] = "PATH=/bin:/usr/ucb:/usr/bin:/usr/local/gnu/bin:";
+   char env_path[256];
+   extern char **environ;
+ 
  main(int argc, char **argv, char **envp)
  {
      int addrlen,
***************
*** 507,512 ****
--- 513,529 ----
          exit(0);
      }
      show_banner(220);
+ 
+     /*wls:*/
+     entry = (struct aclmember *) NULL;
+     if (getaclentry("execpath", &entry) && ARG0 && strlen(ARG0) > 0) {
+         strcpy(env_path, ARG0);
+     } else {
+         strcpy(env_path, Path);
+     }
+     Environ[0] = env_path;
+     Environ[1] = 0;
+     environ = Environ;
  
      entry = (struct aclmember *) NULL;
      if (getaclentry("lslong", &entry) && ARG0 && strlen(ARG0) > 0) {

======

Also, what I do with my FTP chroot tree to help me keep things straight is to
put programs in /bin, but also carry along the "real" directory structures,
making symbolic links from the corresponding "real" location back to "/bin",
ie:

	FTP area: /usr/local/gnu/bin/gzip -> ../../../../bin/gzip

So, all FTP programs are in /bin of the FTP area, with an additional link
corresponding to their non-FTP location (ie we normally keep the GNU programs
in /usr/local/gnu/bin in the "real" file system).  This makes the entries in
the "ftpconversions" simpler, I just put the "real" paths in there.

Standard disclaimers here:  Rough, works for me, etc.  Let me know if anybody
uses the code, or if my explanation as to why "tar.gz" doesn't normally work
helps.  I have all of the tar/compress combinations working for both anonymous
and "real" users.  (at least they were the last time I checked :-)

I also have similarly-rough code for DEC Alpha OSF 2/3 which checks passwords
with/without enhanced security if anybody wants that...

Oh, and one more thing:  Merry Christmas!

--
Bill Stapleton				University of Wisconsin - Milwaukee
     [email-masked]		   Client Services Department (CSD)
     uwmcsd4!wls			   Information & Media Technologies