From nobody@www.freebsd.org  Fri Jun  7 09:30:38 2002
Return-Path: <nobody@www.freebsd.org>
Received: from nwww.freebsd.org (www.FreeBSD.org [216.136.204.117])
	by hub.freebsd.org (Postfix) with ESMTP id 54B0737B407
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  7 Jun 2002 09:30:38 -0700 (PDT)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by nwww.freebsd.org (8.12.2/8.12.2) with ESMTP id g57GUYhG031795
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 7 Jun 2002 09:30:34 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.2/8.12.2/Submit) id g57GUYVE031794;
	Fri, 7 Jun 2002 09:30:34 -0700 (PDT)
Message-Id: <200206071630.g57GUYVE031794@www.freebsd.org>
Date: Fri, 7 Jun 2002 09:30:34 -0700 (PDT)
From: Peter da Silva <peter@abbnm.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: FTP anonymous user can create directories
X-Send-Pr-Version: www-1.0

>Number:         38987
>Category:       misc
>Synopsis:       FTP anonymous user can create directories
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 07 09:40:01 PDT 2002
>Closed-Date:    Sun Jun 30 19:30:43 PDT 2002
>Last-Modified:  Sun Jun 30 19:30:43 PDT 2002
>Originator:     Peter da Silva
>Release:        FreeBSD 4.4-Release
>Organization:
ABB Network Management
>Environment:
FreeBSD foyer.abbnm.com 4.4-RELEASE FreeBSD 4.4-RELEASE #0: Thu Apr 25 03:46:49 CDT 2002     root@foyer.abbnm.com:/usr/src/sys/compile/FOYER  i386
>Description:
anonymous user can make directories under incoming and use ftp server as dropbox for warez.
>How-To-Repeat:
ftp localhost
Username: ftp
Password: me@here
ftp> cd pub/incoming
ftp> mkdir dropbox

>Fix:
This should probably be made a command line option. I know "this web form should not be used to submit code as plain text", but the patch is straightforward:

*** ftpd.c.orig Fri Jun  7 06:40:00 2002
--- ftpd.c      Fri Jun  7 06:40:25 2002
***************
*** 2187,2193 ****
  {
  
        LOGCMD("mkdir", name);
!       if (mkdir(name, 0777) < 0)
                perror_reply(550, name);
        else
                reply(257, "MKD command successful.");
--- 2187,2195 ----
  {
  
        LOGCMD("mkdir", name);
!       if (guest)
!               reply(550, "%s: permission denied", name);
!       else if (mkdir(name, 0777) < 0)
                perror_reply(550, name);
        else
                reply(257, "MKD command successful.");

>Release-Note:
>Audit-Trail:

From: Andrew <andrew@ugh.net.au>
To: freebsd-gnats-submit@FreeBSD.org, <peter@abbnm.com>
Cc:  
Subject: Re: misc/38987: FTP anonymous user can create directories
Date: Mon, 10 Jun 2002 03:20:20 +1000 (EST)

 Isn't this just a problem with your configuration? If you don't want
 anonymous users to be able to create directories then change the
 permissions on incoming.
 
 Have I misunderstood?
 
 Andrew
 
State-Changed-From-To: open->closed 
State-Changed-By: mdodd 
State-Changed-When: Sun Jun 30 19:30:25 PDT 2002 
State-Changed-Why:  
Committed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=38987 
>Unformatted:
