From owner-freebsd-bugs Fri Sep 22 23: 0: 9 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 2393B37B423 for ; Fri, 22 Sep 2000 23:00:02 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id XAA34313; Fri, 22 Sep 2000 23:00:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: by hub.freebsd.org (Postfix, from userid 32767) id 46D4B37B422; Fri, 22 Sep 2000 22:56:38 -0700 (PDT) Message-Id: <20000923055638.46D4B37B422@hub.freebsd.org> Date: Fri, 22 Sep 2000 22:56:38 -0700 (PDT) From: djhill@novagate.net To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: misc/21494: ftpd doesn't count Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 21494 >Category: misc >Synopsis: ftpd doesn't count >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Sep 22 23:00:01 PDT 2000 >Closed-Date: >Last-Modified: >Originator: David Hill >Release: 4.1 >Organization: >Environment: FreeBSD beast.hill.hom 4.1-STABLE FreeBSD 4.1-STABLE #5: Thu Sep 14 17:00:50 EDT 2000 root@beast.hill.hom:/usr/src/sys/compile/BEAST i386 >Description: When adding a user to /etc/ftpchroot without hitting enter at the end (does not at \n), ftpd will fail to check the username. Ok, maybe I am being picky, but when I had to add only one username to /etc/ftpchroot, and it wasn't working, I finally remembered to hit enter. A patch is available below (could it hurt it add it?) >How-To-Repeat: add a user to /etc/ftpchroot without hitting enter at the end. >Fix: --- ftpd.c.orig Wed Sep 20 05:57:57 2000 +++ ftpd.c Sat Sep 23 01:53:33 2000 @@ -977,7 +977,7 @@ if ((fd = fopen(fname, "r")) != NULL) { while (!found && fgets(line, sizeof(line), fd) != NULL) - if ((p = strchr(line, '\n')) != NULL) { + if (((p = strchr(line, '\n')) != NULL) || (p = strchr(line, '\0')) != NULL) { *p = '\0'; if (line[0] == '#') continue; >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message