From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 17:27:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6128C7A9; Tue, 10 Dec 2013 17:27:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4D7641F20; Tue, 10 Dec 2013 17:27:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAHRCbR036895; Tue, 10 Dec 2013 17:27:12 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAHRC79036894; Tue, 10 Dec 2013 17:27:12 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201312101727.rBAHRC79036894@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 10 Dec 2013 17:27:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259182 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 17:27:12 -0000 Author: trasz Date: Tue Dec 10 17:27:11 2013 New Revision: 259182 URL: http://svnweb.freebsd.org/changeset/base/259182 Log: Fix handling for empty auth-groups. Without it, ctld child process would either exit on assertion, or, if assertions are not enabled, fail to authenticate the target. MFC after: 2 days Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/login.c Modified: head/usr.sbin/ctld/login.c ============================================================================== --- head/usr.sbin/ctld/login.c Tue Dec 10 17:26:52 2013 (r259181) +++ head/usr.sbin/ctld/login.c Tue Dec 10 17:27:11 2013 (r259182) @@ -1007,6 +1007,14 @@ login(struct connection *conn) return; } + if (ag->ag_type == AG_TYPE_UNKNOWN) { + /* + * This can happen with empty auth-group. + */ + login_send_error(request, 0x02, 0x01); + log_errx(1, "auth-group type not set, denying access"); + } + log_debugx("CHAP authentication required"); auth_method = keys_find(request_keys, "AuthMethod");