Subject: Re: Very strange, inconsistent, behavior

From: [email-masked] (Andrew P. Schwalb)
Date: Wed, 17 Jul 1996 08:17:21 -0400

I had a similar problem on my Solaris 2.5 box.  It was solved by getting all the 
right shared libs in the ~/ftp/usr/lib.  Or get the statically compiled ls. the 
ls would work but the dir command would not.  The dir command must be issued by 
some clients for long listings (netscape). To prove this log in with a client 
that is 'working' and do a dir instead of an ls and see if it fails.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0- 
Andrew P. Schwalb - Staff Engineer	(352) 687-5377
Lockheed Martin Ocala Operations	[email-masked]
RASSP Program

---

From: Rusty <[email-masked]>
Date: Wed, 17 Jul 1996 14:12:10 -0500 (CDT)

My problem is:
% ftp ftp
[edit, logged in as anonymous]
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
[edit]
drwx-wx-wt   2 root      wheel     512 Jul 16 12:04 in.coming
[...]
ftp> cd in.coming
250 CWD command successful.
ftp> put blah
local: blah remote: blah
200 PORT command successful.
553 Could not determine cwdir: Permission denied.

/etc % grep upload ftpaccess
# specify the upload directory information
upload  /usr/opt/anonftp    *             yes
upload  /usr/opt/anonftp    /in.coming    yes     root   staff  0600 nodirs
upload  /usr/opt/anonftp    /bin          no
upload  /usr/opt/anonftp    /etc          no

% grep ftp /etc/passwd
ftp:*:301:300:Anonymous FTP:/usr/opt/anonftp:/bin/true
% uname -a
BSD/OS oxywhite.interaccess.com 2.1 BSDI BSD/OS 2.1 Kernel #7: Fri May 24
17:17:10 CDT 1996     @:/usr/src/sys/compile/DELLGXMT  i386

Any help would be extremely appreciated, to the point of shipping you
really good beer.  This has been driving me nuts, and has our customers who
want an ftp directory for uploads (that isn't going to instantly become a
warez site) breathing down my neck.

Thanks,
-Rusty

Unix Services Administrator   -   InterAccess Co.
"I live life on the edge...     I really should drink less caffeine." -Me
"If you don't receive this e-mail call Central Services immediately." -Jay K
MooseHead SLED   sled.moosehead.com 4000   http://www.moosehead.com/

---

From: Michael Brennen <[email-masked]>
Date: Wed, 17 Jul 1996 16:05:14 -0500 (CDT)

> 553 Could not determine cwdir: Permission denied.

As I suggested before, rename "in.coming" to "incoming".  Take the "." out
of the name and change ftpaccess to match.  The above error is returned as
the result of a failed call to realpath() in extensions.c.  A glance at
realpath() source shows that dots in the filename are skipped, which
probably is the cause of the above error.  I didn't try to duplicate your
results. 

Don't hack the source to take out the "." check unless you fully
understand the risks involved.  These kinds of checks went in over a long
time and after many security holes.

   -- Michael

---

From: Rusty <[email-masked]>
Date: Wed, 17 Jul 1996 23:22:22 -0500 (CDT)

> As I suggested before, rename "in.coming" to "incoming".  Take the "." out

This did not solve the problem either.  I was using this directory as an
example, but the name is irrellevant.  The directory is now named: 'inming'
and the same error occurrs.  (I can't use the name incoming as our stupid
sales department sold a directory with that name to a customer *blah*.)

# grep upload ftpaccess
# specify the upload directory information
upload     *             yes
upload     /inming       yes     root    staff  0600 nodirs
upload     /bin          no
upload     /etc          no

ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
total 292
[edit]
drwx-wx-wt   2 root      wheel     512 Jul 16 12:04 inming
[edit]
ftp> cd inming
250 CWD command successful.
ftp> put temp.pl
local: temp.pl remote: temp.pl
200 PORT command successful.
553 Could not determine cwdir: Permission denied.

-Rusty

---

From: Michael Brennen <[email-masked]>
Date: Wed, 17 Jul 1996 23:37:52 -0500 (CDT)

> upload     /inming       yes     root    staff  0600 nodirs

Put the absolute path to the ftp root directory in between the 'upload'
keyword and the relative path from the ftp root.  A couple of examples are
below. Does that fix it? 

upload  /ftp/root/dir     *             no
upload  /ftp/root/dir     /incoming     yes     root    daemon  0400

   -- Michael

---

From: Rusty <[email-masked]>
Date: Thu, 18 Jul 1996 12:52:22 -0500 (CDT)

> upload  /ftp/root/dir     /incoming     yes     root    daemon  0400

That's how I started.  (Yes I switched it back to make sure.)  Same error.
I did notice that upon trying to recompile the source there is a realpath.c
module that defines a function realpath().  This conflicts with an existing
declaration of realpath() in /usr/include/stdlib.h:158.  I'm starting to
wonder if the BSD/OS 2.1 built in realpath() function was used instead of
the one included with wu-ftpd.

Anyone have any experience with BSDi and making anonftp and unreadble
directories work properly?

-Rusty

---

From: [email-masked] (Bill Campbell)
Date: Thu, 18 Jul 1996 11:16:46 -0700 (PDT)

>That's how I started.  (Yes I switched it back to make sure.)  Same error.

Do you have a -a in your ftp startup in /etc/inetd.conf?  This is the
most common error that causes problems like this since it doesn't read
the ftpaccess file at all.

Speaking of upload commands relating to virtual domains.  I would like
to see somthing like a :include: capability in the virtual address
that allows different ftpaccess files for each virtual domain.  I
find that the upload syntax specifying the root of the anon-ftp user
in the system /etc/password file rather useless because it means that
all virtual directories must be under the base ftp directory or the
upload command doesn't work.  It would seem to me that this path
should be the path of the virtual root rather than the /etc/passwd
entry for the ftp user.

Bill
--
INTERNET:   [email-masked]  Bill Campbell; Celestial Systems, Inc.
UUCP:               camco!bill  PO Box 820; 2835 82nd Avenue S.E. S-100
FAX:            (206) 232-9186  Mercer Island, WA 98040-0820; (206) 236-1676
URL: http://www.celestial.com/

The very powerful and the very stupid have one thing in common.
Instead of altering their views to fit the facts, they alter the facts
to fit their views ... which can be very uncomfortable if you happen to
be one of the facts that needs altering.
                -- Doctor Who, "Face of Evil"