summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2014-11-22 17:52:33 +0000
committertrasz <trasz@FreeBSD.org>2014-11-22 17:52:33 +0000
commit4844d3d80c8de3c262758e8a5a45fc15a19ede8d (patch)
tree0f90ebb7d3ba2e3e37d24c545f84d80214c5a0da /usr.sbin
parent38906efd97180afd70fe77b5667a01b821c77e25 (diff)
downloadFreeBSD-src-4844d3d80c8de3c262758e8a5a45fc15a19ede8d.zip
FreeBSD-src-4844d3d80c8de3c262758e8a5a45fc15a19ede8d.tar.gz
MFC r273465:
Fix ctld(8) to not show the "auth-group <name> not assigned to any target" warning for auth-groups assigned to a portal-group. Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ctld/ctld.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/usr.sbin/ctld/ctld.c b/usr.sbin/ctld/ctld.c
index a8a7a110..c8ca4a9 100644
--- a/usr.sbin/ctld/ctld.c
+++ b/usr.sbin/ctld/ctld.c
@@ -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) {
OpenPOWER on IntegriCloud