From nobody@FreeBSD.org  Thu Oct  7 15:58:57 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 0FD8916A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  7 Oct 2004 15:58:57 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 0599443D41
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  7 Oct 2004 15:58:57 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i97Fwujt080864
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 7 Oct 2004 15:58:56 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.11/8.12.11/Submit) id i97Fwu6M080862;
	Thu, 7 Oct 2004 15:58:56 GMT
	(envelope-from nobody)
Message-Id: <200410071558.i97Fwu6M080862@www.freebsd.org>
Date: Thu, 7 Oct 2004 15:58:56 GMT
From: Don <drick@edigic.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: in ftpd, SITE command is case sensative when trying to use chmod...SITE CHMOD 777 as.jpg will give invalid command, when in lowercase it works...99% windows ftp clients use all caps so it doesn't work.
X-Send-Pr-Version: www-2.3

>Number:         72425
>Category:       bin
>Synopsis:       ftpd SITE command case sensitivity
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    yar
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 07 16:00:48 GMT 2004
>Closed-Date:    Fri Oct 22 11:12:14 GMT 2004
>Last-Modified:  Fri Oct 22 11:20:22 GMT 2004
>Originator:     Don
>Release:        4.10
>Organization:
wiscap
>Environment:
FreeBSD edigic.com 4.10-RELEASE-p3 FreeBSD 4.10-RELEASE-p3 #6: Fri Sep 24 23:30:47 CDT 2004     drick@edigic.com:/usr/obj/usr/src/sys/EDIGIC  i386

>Description:

 In ftpd, SITE command is case sensative when trying to use chmod...
 SITE CHMOD 777 as.jpg will give invalid command, when in lowercase it works...
 99% windows ftp clients use all caps so it doesn't work.
 
 had other users try on other 4.10 boxs same issue.
>How-To-Repeat:
      230 User drick logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> SITE CHMOD 777 as.jpg
?Invalid command.
ftp> site chmod 777 as.jpg
200 CHMOD command successful.
ftp>
>Fix:
      fix the case sensativity issue?
>Release-Note:
>Audit-Trail:

From: Ryan Sommers <ryans@gamersimpact.com>
To: freebsd-gnats-submit@FreeBSD.org, drick@edigic.com
Cc:  
Subject: Re: bin/72425: ftpd SITE command case sensitivity
Date: Thu, 07 Oct 2004 23:07:54 -0500

 This is actually not a bug in ftpd:
 
 (root@blue)~:telnet 192.168.0.2 21
 Trying 192.168.0.2...
 Connected to blue.
 Escape character is '^]'.
 220 blue FTP server (Version 6.00LS) ready.
 USER ryans
 331 Password required for ryans.
 PASS **********
 230 User ryans logged in.
 pwd
 257 "/usr/home/ryans" is current directory.
 PWD
 257 "/usr/home/ryans" is current directory.
 SITE
 500 'SITE': command not understood.
 SITE CHMOD 777 dump.log
 200 CHMOD command successful.
 site chmod 777 dump.log
 200 CHMOD command successful.
 ^]
 telnet> close
 Connection closed.
 
 Instead, this is, a 'feature'(or bug), of the ftp client. The following 
 patch should fix the ftp client though. I haven't tested it, so if 
 someone imports it might want to be sure it compiles first.
 
 Index: main.c
 ===================================================================
 RCS file: /home/ncvs/src/contrib/lukemftp/src/main.c,v
 retrieving revision 1.1.1.5
 diff -u -r1.1.1.5 main.c
 --- main.c      3 Nov 2003 17:12:05 -0000       1.1.1.5
 +++ main.c      8 Oct 2004 04:06:30 -0000
 @@ -114,6 +114,7 @@
  #include <sys/types.h>
  #include <sys/socket.h>
 
 +#include <ctype.h>
  #include <err.h>
  #include <errno.h>
  #include <netdb.h>
 @@ -724,7 +725,7 @@
         nmatches = 0;
         found = 0;
         for (c = cmdtab; (p = c->c_name) != NULL; c++) {
 -               for (q = name; *q == *p++; q++)
 +               for (q = name; toupper(*q) == toupper(*p++); q++)
                         if (*q == 0)            /* exact match? */
                                 return (c);
                 if (!*q) {                      /* the name was a prefix */
 
 -- 
 Ryan Sommers
 ryans@gamersimpact.com
 

From: Ryan Sommers <ryans@gamersimpact.com>
To: freebsd-gnats-submit@FreeBSD.org, drick@edigic.com
Cc:  
Subject: Re: bin/72425: ftpd SITE command case sensitivity
Date: Thu, 07 Oct 2004 23:11:23 -0500

 Hit the submit button too fast... Those should be calls to tolower().
 
 -- 
 Ryan Sommers
 ryans@gamersimpact.com
 

From: Yar Tikhiy <yar@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org, drick@edigic.com
Cc: ryans@gamersimpact.com
Subject: Re: bin/72425: ftpd SITE command case sensitivity
Date: Mon, 18 Oct 2004 00:44:09 +0400

 In my opinion, the problem described in this PR isn't of ftpd(8)
 or ftp(1).  I'm afraid that it isn't a problem at all.  On the one
 hand, ftpd(8) groks well any case in commands to it since the FTP
 specification defines the protocol be case insensitive:
 
 %%%
 
 site chmod 444 preader.c
 200 CHMOD command successful.
 SITE CHMOD 111 preader.c
 200 CHMOD command successful.
 sItE ChMoD 644 preader.c
 200 CHMOD command successful.
 
 %%%
 
 On the other hand, ftp(1) is case sensitive by design, being in
 this aspect in line with any well-tempered Unix application.  I'm
 inclined to close this PR because I see no case sensitivity issue
 found regarding ftpd(8) or ftp(1).  Would you mind if I did so?
 
 -- 
 Yar
Responsible-Changed-From-To: freebsd-bugs->yar 
Responsible-Changed-By: yar 
Responsible-Changed-When: Mon Oct 18 13:29:03 GMT 2004 
Responsible-Changed-Why:  
So I can keep an eye on this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=72425 

From: Yar Tikhiy <yar@freebsd.org>
To: Don Rick <drick@edigic.com>
Cc: bug-followup@freebsd.org
Subject: Re: bin/72425: ftpd SITE command case sensitivity
Date: Thu, 21 Oct 2004 08:14:04 +0400

 On Wed, Oct 20, 2004 at 02:52:30PM -0500, Don Rick wrote:
 > why will windows clients not work at all then, and they post it in all 
 > caps? (except filename)
 
 Which Windows clients do not work?  Please give more details when
 reporting problems.
 
 -- 
 Yar

From: Yar Tikhiy <yar@freebsd.org>
To: Don Rick <drick@edigic.com>
Cc: bug-followup@freebsd.org
Subject: Re: bin/72425: ftpd SITE command case sensitivity
Date: Thu, 21 Oct 2004 15:29:46 +0400

 On Thu, Oct 21, 2004 at 06:05:44AM -0500, Don Rick wrote:
 > I could not find a windows client that could work, so try anyone you would 
 > like, and neither could #freebsd on undernet, they all agree w/me.
 
 Since the only Windows GUI FTP client I have installed, MSIE 6.0,
 can change file permissions without problem, I cannot confirm your
 statement about no client working.  Please list some specific clients
 that won't work.
 
 -- 
 Yar
State-Changed-From-To: open->closed 
State-Changed-By: yar 
State-Changed-When: Fri Oct 22 11:10:48 GMT 2004 
State-Changed-Why:  
The problem hasn't been confirmed to exist. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=72425 

From: Yar Tikhiy <yar@freebsd.org>
To: Don Rick <drick@edigic.com>
Cc: bug-followup@freebsd.org
Subject: Re: bin/72425: ftpd SITE command case sensitivity
Date: Fri, 22 Oct 2004 15:10:20 +0400

 On Thu, Oct 21, 2004 at 06:56:23AM -0500, Don Rick wrote:
 > ws ftp, filezilla, smartftp, etc...basically anything that was specifically 
 > used for ftp'ing?
 
 I did't want to infect my Windows box with spyware, so I tried
 filezilla only, and it worked like a charm:
 
 	Command:	SITE CHMOD 600 /usr/home/yar/file.txt
 	Response:	200 CHMOD command successful.
 
 I'm afraid the problem has nothing to do with ftpd(8).  Please review
 your local configuration.
 
 -- 
 Yar
>Unformatted:
