From owner-svn-src-head@FreeBSD.ORG Thu May 6 00:24:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3EF76106566B; Thu, 6 May 2010 00:24:09 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 2E97C8FC12; Thu, 6 May 2010 00:24: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 o460O8tN008288; Thu, 6 May 2010 00:24:08 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o460O8QE008286; Thu, 6 May 2010 00:24:08 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201005060024.o460O8QE008286@svn.freebsd.org> From: Rick Macklem Date: Thu, 6 May 2010 00:24:08 +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: r207689 - head/usr.sbin/mountd 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: Thu, 06 May 2010 00:24:09 -0000 Author: rmacklem Date: Thu May 6 00:24:08 2010 New Revision: 207689 URL: http://svn.freebsd.org/changeset/base/207689 Log: If the "-alldirs" export option was used for the V4: line, mountd would crash in check_options() since dp == NULL for the V4: line. This patch moves the check for options allowed on the V4: line to ahead of where dp is used to avoid this crash. Reported by: mamalos AT eng.auth.gr MFC after: 1 week Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Wed May 5 22:52:06 2010 (r207688) +++ head/usr.sbin/mountd/mountd.c Thu May 6 00:24:08 2010 (r207689) @@ -2881,16 +2881,16 @@ check_options(dp) syslog(LOG_ERR, "-mask and /masklen are mutually exclusive"); return (1); } - if ((opt_flags & OP_ALLDIRS) && dp->dp_left) { - syslog(LOG_ERR, "-alldirs has multiple directories"); - return (1); - } if (v4root_phase > 0 && (opt_flags & ~(OP_SEC | OP_MASK | OP_NET | OP_HAVEMASK | OP_MASKLEN)) != 0) { syslog(LOG_ERR,"only -sec,-net,-mask options allowed on V4:"); return (1); } + if ((opt_flags & OP_ALLDIRS) && dp->dp_left) { + syslog(LOG_ERR, "-alldirs has multiple directories"); + return (1); + } return (0); }