Subject: wuftp

From: Alan Neiman <[email-masked]>
Date: Tue, 23 Feb 1999 08:42:20 -0700 (MST)

Is there anyway to do some kind of login script when a user logs into a wu-ftp 
server.  We want to setup quotas, and would like to notify the user how much 
space they have available when they log in.

thanks

Alan Neiman
[email-masked]
Unix System Administrator
Information Handling Services
--------------------------------------------------------------

               ** 1997 & 1998 World Champions **

17 & 2 -- Simply The Best -- The Broncos -- The Denver Broncos

               ** 1997 & 1998 World Champions **

--------------------------------------------------------------

---

From: Gregory A Lundberg <[email-masked]>
Date: Tue, 23 Feb 1999 10:58:58 -0500 (EST)

On Tue, 23 Feb 1999, Alan Neiman wrote:

> Is there anyway to do some kind of login script when a user logs into
> a wu-ftp server.  We want to setup quotas, and would like to notify
> the user how much space they have available when they log in.

You'll need the daemon with quota support compiled in.

Just create a login message file for the users showing the quotas.

Automounting will probably require hacking the daemon source code.  I've
heard of some places doing it.  I presume they either have everything
mounted or have hacked the daemon to do it.

Interesting thought though .. *scribbles notes in his TODO*

-- 

Gregory A Lundberg              Senior Partner, VRnet Company
1441 Elmdale Drive              [email-masked]
Kettering, OH 45409-1615 USA    1-800-809-2195

---

From: [email-masked]
Date: Tue, 23 Feb 1999 11:12:06 -0500 (EST)

Has a patch been issued for wu-ftpd(18), or is there a new released
version that fixes the recently announced security hole? I found the fix
for RedHat linux, but need to address this on our Solaris boxes as well...

TIA,

--Duncan

---

From: Eilon Gishri <[email-masked]>
Date: Tue, 23 Feb 1999 18:31:40 +0200

> mounted or have hacked the daemon to do it.
If you're referring to NFS, I've played with RPC to support rquotad not
long ago but haven't had time to release anything to the public. I'll
try to do something useful about it this week and have something ready
with your VR patches next week.

I currently have access to AIX 4.x, BSDI 2.x, Digital Unix, SunOS, Solaris,
Linux and Irix. If you have anything abnormally (i.e doesn't use mnttab)
please let me know about it so I'll be able to add support for it too.

-- 
Eilon Gishri					[email-masked]
Security Consultant				Office: +972-3-6406723
Israel Inter University Computation Center	Fax:	+972-3-6409118
  /* On a matter of national security */	Home:	+972-3-5078671

---

From: Alex Yu <[email-masked]>
Date: Tue, 23 Feb 1999 11:53:05 -0500

>server.  We want to setup quotas, and would like to notify the user how much 

i don't think so.  either modify the source or get glftpd (www.glftpd.com).

alex

---

From: Gregory A Lundberg <[email-masked]>
Date: Tue, 23 Feb 1999 12:11:28 -0500 (EST)

On Tue, 23 Feb 1999, Alex Yu wrote:

> >the user how much

*sigh* RTFM

If you follow CERT advisories, you've upgraded.  If you've upgraded, your
ftpaccess manpage says:

message <path> {<when> {<class> ...}}

Define a file with <path> such that ftpd will display the contents of the
file to the user login time or upon using the change working directory
command.  The <when> parameter may be "LOGIN" or "CWD=<dir>".  If <when>
is "CWD=<dir>", <dir> specifies the new default directory which will
trigger the notification.

The optional <class> specification allows the message to be displayed only
to members of a particular class. More than one class may be specified.

There can be "magic cookies" in the readme file which cause the ftp server
to replace the cookie with a specified text string:

    %T      local time (form Thu Nov 15 17:12:42 1990)
    %F      free space in partition of CWD (kbytes)
            [not supported on all systems]
    %C      current working directory
    %E      the maintainer's email address as defined in ftpaccess
    %R      remote host name
    %L      local host name
    %u      username as determined via RFC931 authentication
    %U      username given at login time
    %M      maximum allowed number of users in this class
    %N      current number of users in this class
    %B      absolute limit on disk blocks allocated
    %b      preferred limit on disk blocks
    %Q      current block count
    %I      maximum number of allocated inodes (+1)
    %i      preferred inode limit
    %q      current number of allocated inodes
    %H      time limit for excessive disk use
    %h      time limit for excessive files

The message will only be displayed once to avoid annoying the user.
Remember that when MESSAGEs are triggered by an anonymous FTP user, the
<path> must be relative to the base of the anonymous FTP directory tree.

-- 

The last 8 magic cookies are what he wants.

This handles his request to display the quotas.  If he needs to
automagically mount the user's home during login, it shouldn't be too hard
to hack into src/ftpd.c to put the needed code into pass() once the user
has authenticated and prior to chroot'ing if the user is a guest.

Automatic unmounting may be a problem, though.  Which may explain why
nobody's talked about doing this .. it's probably easier to mount all the
homes all the time and not worry about it.

--