Subject: SunOS 4.1.1 wu-ftpd-2.4 nfs mounted uploads

From: [email-masked] (Andrew H. Evans)
Date: Mon, 20 Nov 1995 16:28:26 -0500

Folks -

I have wu-ftpd-2.4 running on SunOS 4.1.1.  Everything is fine until
I NFS mount a partition under an upload directory.  The files intended
to land there pass OK according to the client (successful upload messages)
but the directory ends up with a zero-length file with the chown/chmod
performed as prescribed in ftpaccess.  If I umount that NFS dir and upload
direct to local disk, it works fine.

Has anyone seen this? Fixes?  I scanned the archives without success.
Thanks in advance!

- Andy

 ========================================================================
     Andrew Evans                           Computer Science Department
  Computer Specialist                       University of New Hampshire
    [email-masked]                                Durham, NH 03824
 ========================================================================

---

From: Pete Glassenbury <[email-masked]>
Date: Wed, 22 Nov 1995 11:19:48 +1300

> 
 >   > 	- can write as root to the NFS disk (so is allowed by exports)
 > Can you write as user "ftp" to the NFS disk?

 You can write as any user to the directory directly. I just mentioned root
 because that has the added problem if you don't export the disk with root 
 access.

 > 
 >   >  The problem is in the wu-ftpd as far as I can tell -- root can write to
 >   >  the NFS directory but can't going through wu-ftpd
 > Yes, but wu-ftpd does not have root permissions at that point.  The directory 
 > must be writable by user 'ftp' (either through ownership, or in the case of 
 > the typical 'incoming/upload' directory through world writability).
 > 
 > This is what I use on my Solaris2.4 system:
 > 
 > upload  /usr/spool/ftp  /pub/incoming           yes root   users   0640 nodirs
 > 
 > drwxrwx-wx   2 root     users        512 Nov 21 03:48 incoming

 This is what I use to get around the fact that it can't write through NFS.
 (Through wu-ftpd, THE ONLY USER you can have in the access is ftp - NO OTHER
 user will work)

 upload  /usr/local/cosc/etc/ftp  /incoming     yes     ftp    staff  0000 nodirs

 drwx-wx-wt  2 root     daemon        512 Nov 22 11:03 incoming/

As have said before --- This ONLY occurs with NFS --- I have the same directory
mounted on our NFS server (not similar setup -- Exactly the same partition and
files). When I set the owner/group/mode to root/users/0640 as you have, it
worked on the server with local disk and produced an error when the
same disk was mounted on our internet machine. 

Almost as though the way the files are put in the incoming directory is changed
or incorrect for NFS mounted partitions. ??

Anyway the Hack I have gets around it because we don't have that much incoming
but it would be annoying for someone who got a lot (because a privilaged person
is the only one able to access the files once they have arrived)

Has anyone else got - an NFS mounted ftp partion AND,
		    - owner/group/mode to root/users/0640 AND
		    - SunOS 4.x AND
		    - it WORKS

Pete
Peter Glassenbury   ([email-masked])
Dept. of Computer Science, University of Canterbury, Christchurch, New Zealand

---

From: Yanming PENG <[email-masked]>
Date: Tue, 21 Nov 95 23:53:26 WET

> same disk was mounted on our internet machine. 
Check your /etc/exports, it should has similar line:
/dir/for/ftp	-root=your.host.name

Otherwise, wuftpd'UID is "nobody" and will fail to chown and chmod. Make
change if necessary. Then kill the mountd and nfsd and restart them.
man exports for more detail descriptions about exports options.
BTW, the -root option sometimes called "no_root_squash" on other OS.

> Has anyone else got - an NFS mounted ftp partion AND,

If you follow above instructions correctly, you will be one who has done it.

--
Yanming PENG Email: [email-masked] http://peng.mech.kuleuven.ac.be
Tel.32-16-322516 | The trouble with doing something right the first time is |
Fax:32-16-322987 | that nobody appreciates how difficult it was.            |

---

From: Pete Glassenbury <[email-masked]>
Date: Wed, 22 Nov 1995 13:00:37 +1300

> /dir/for/ftp	-root=your.host.name
 This has already been done -- otherwise when writing as root in a normal shell
 would fail -- for the reasons you say below. The -root option IS set up correctly.

 > If you follow above instructions correctly, you will be one who has done it.
 Those instructions were followed carefully and Nope - Still doesn't work.

 Pete

---

From: Pete Glassenbury <[email-masked]>
Date: Thu, 23 Nov 1995 09:54:26 +1300

> > >  > to land there pass OK according to the client (successful upload messages
 > > >  > performed as prescribed in ftpaccess.  If I umount that NFS dir and uploa
 > > > 	- Works fine with a local disk
 > The NFS partition is exported correctly, even tried the root= directive.

 Ok -- Finally there is someone else that is having the same problem
 (I was beginning to feel it was just me)

 This is EXACTLY the same problem -- 
 Yanming PENG <[email-masked]> was helping me diagnose
 things yesterday and after copying a few binaries temporarily to the 
 ~ftp/bin directory I could do
	chroot ~ftp bin/chown root incoming/fred

	And it worked the way it should !!
 so it seems like root can chown and do things ok on the disk through
 the chroot

 We are running Beta6 but I didn't see anything in the docs of Beta7
 that might fix it -- probably worth a go though...

 Anyone have any other ideas??

Pete