From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Oct 9 18:50:17 2005 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4580216A41F for ; Sun, 9 Oct 2005 18:50:17 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 914BD43D49 for ; Sun, 9 Oct 2005 18:50:16 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j99IoGHb000280 for ; Sun, 9 Oct 2005 18:50:16 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j99IoGFM000279; Sun, 9 Oct 2005 18:50:16 GMT (envelope-from gnats) Resent-Date: Sun, 9 Oct 2005 18:50:16 GMT Resent-Message-Id: <200510091850.j99IoGFM000279@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Pavel Gubin Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A8BCF16A41F for ; Sun, 9 Oct 2005 18:43:18 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id F05D443D45 for ; Sun, 9 Oct 2005 18:43:17 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j99IhHo3042710 for ; Sun, 9 Oct 2005 18:43:17 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id j99IhHdi042709; Sun, 9 Oct 2005 18:43:17 GMT (envelope-from nobody) Message-Id: <200510091843.j99IhHdi042709@www.freebsd.org> Date: Sun, 9 Oct 2005 18:43:17 GMT From: Pavel Gubin To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Cc: Subject: ports/87174: vsftpd gots caught in an endless loop while parsing erroneous config AND stdin is e.g. /dev/null X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Oct 2005 18:50:17 -0000 >Number: 87174 >Category: ports >Synopsis: vsftpd gots caught in an endless loop while parsing erroneous config AND stdin is e.g. /dev/null >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Oct 09 18:50:16 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Pavel Gubin >Release: 4.10, 4.11, 5.4 >Organization: TUSUR >Environment: >Description: When vsftpd tries to report config error, and stdin is detached from controlling terminal, it gots caught in an endless loop because it uses die() (utility.c) to report an error condition, which in turn calls bug() (DIE_DEBUG defined by default), bug() calls vsf_sysutil_activate_noblock() which fails to set nonblocking mode when /dev/null is opened as fd=0, calls again die() etc., until the program eats up ann vertual memory and gots killes by the system. >How-To-Repeat: Make a vsftpd.conf with syntax error, then feed it to vsftpd: /usr/local/libexec/vsftpd vsftpd.conf Fix: Put a file named patch-utility into files/ subdir of vsftpd port, rebuild and reinstall: patch-utility --- utility.c.orig Fri Jul 2 18:26:30 2004 +++ utility.c Mon Oct 10 01:19:02 2005 @@ -33,6 +33,10 @@ void bug(const char* p_text) { + static int inside_bug = 0; + if (inside_bug) + vsf_sysutil_exit(1); + inside_bug++; /* Rats. Try and write the reason to the network for diagnostics */ vsf_sysutil_activate_noblock(VSFTP_COMMAND_FD); (void) vsf_sysutil_write_loop(VSFTP_COMMAND_FD, "500 OOPS: ", 10); >Release-Note: >Audit-Trail: >Unformatted: