From owner-svn-src-stable@FreeBSD.ORG Sat Nov 22 17:52:34 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C27A6703; Sat, 22 Nov 2014 17:52:34 +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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 948DCE53; Sat, 22 Nov 2014 17:52:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAMHqYWH000828; Sat, 22 Nov 2014 17:52:34 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAMHqY8q000827; Sat, 22 Nov 2014 17:52:34 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411221752.sAMHqY8q000827@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 22 Nov 2014 17:52:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274871 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 17:52:34 -0000 Author: trasz Date: Sat Nov 22 17:52:33 2014 New Revision: 274871 URL: https://svnweb.freebsd.org/changeset/base/274871 Log: MFC r273465: Fix ctld(8) to not show the "auth-group not assigned to any target" warning for auth-groups assigned to a portal-group. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/ctld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Sat Nov 22 17:50:14 2014 (r274870) +++ stable/10/usr.sbin/ctld/ctld.c Sat Nov 22 17:52:33 2014 (r274871) @@ -1164,7 +1164,7 @@ conf_verify(struct conf *conf) struct portal_group *pg; struct target *targ; struct lun *lun; - bool found_lun; + bool found; int error; if (conf->conf_pidfile_path == NULL) @@ -1181,14 +1181,14 @@ conf_verify(struct conf *conf) "default"); assert(targ->t_portal_group != NULL); } - found_lun = false; + found = false; TAILQ_FOREACH(lun, &targ->t_luns, l_next) { error = conf_verify_lun(lun); if (error != 0) return (error); - found_lun = true; + found = true; } - if (!found_lun) { + if (!found) { log_warnx("no LUNs defined for target \"%s\"", targ->t_name); } @@ -1219,11 +1219,20 @@ conf_verify(struct conf *conf) else assert(ag->ag_target == NULL); + found = false; TAILQ_FOREACH(targ, &conf->conf_targets, t_next) { - if (targ->t_auth_group == ag) + if (targ->t_auth_group == ag) { + found = true; break; + } + } + TAILQ_FOREACH(pg, &conf->conf_portal_groups, pg_next) { + if (pg->pg_discovery_auth_group == ag) { + found = true; + break; + } } - if (targ == NULL && ag->ag_name != NULL && + if (!found && ag->ag_name != NULL && strcmp(ag->ag_name, "default") != 0 && strcmp(ag->ag_name, "no-authentication") != 0 && strcmp(ag->ag_name, "no-access") != 0) {