From owner-svn-src-head@FreeBSD.ORG Tue Jan 4 00:11:09 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E62D9106566C; Tue, 4 Jan 2011 00:11:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D5A298FC17; Tue, 4 Jan 2011 00:11:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p040B9YO010635; Tue, 4 Jan 2011 00:11:09 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p040B9Er010633; Tue, 4 Jan 2011 00:11:09 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201101040011.p040B9Er010633@svn.freebsd.org> From: Ed Maste Date: Tue, 4 Jan 2011 00:11:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216943 - head/libexec/ftpd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 00:11:10 -0000 Author: emaste Date: Tue Jan 4 00:11:09 2011 New Revision: 216943 URL: http://svn.freebsd.org/changeset/base/216943 Log: Handle failure from ftpd_popen in statfilecmd(). Reviewed by: attilio MFC after: 1 week Modified: head/libexec/ftpd/ftpd.c Modified: head/libexec/ftpd/ftpd.c ============================================================================== --- head/libexec/ftpd/ftpd.c Tue Jan 4 00:10:29 2011 (r216942) +++ head/libexec/ftpd/ftpd.c Tue Jan 4 00:11:09 2011 (r216943) @@ -2350,6 +2350,10 @@ statfilecmd(char *filename) code = lstat(filename, &st) == 0 && S_ISDIR(st.st_mode) ? 212 : 213; (void)snprintf(line, sizeof(line), _PATH_LS " -lgA %s", filename); fin = ftpd_popen(line, "r"); + if (fin == NULL) { + perror_reply(551, filename); + return; + } lreply(code, "Status of %s:", filename); atstart = 1; while ((c = getc(fin)) != EOF) {