Use "default" as default discovery-auth-group, instead of "no-access".

It doesn't change visible behaviour, as previously auth-group "default"
wasn't redefinable, so by default access was always denied.

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Edward Tomasz Napierala 2014-02-11 11:31:08 +00:00
parent affb88f5a2
commit ccb1f04d95
2 changed files with 7 additions and 4 deletions

View File

@ -131,9 +131,11 @@ The following statements are available at the portal-group level:
.It Ic discovery-auth-group Aq Ar name .It Ic discovery-auth-group Aq Ar name
Assigns previously defined authentication group to that portal group, Assigns previously defined authentication group to that portal group,
to be used for target discovery. to be used for target discovery.
By default, the discovery will be denied. By default, portal groups that do not specify their own auth settings,
A special auth-group, "no-authentication", may be used to allow for discovery using clauses such as "chap" or "initiator-name", are assigned
without authentication. predefined auth-group "default", which denies discovery.
Another predefined auth-group, "no-authentication", may be used
to permit discovery without authentication.
.It Ic listen Aq Ar address .It Ic listen Aq Ar address
Specifies IPv4 or IPv6 address and port to listen on for incoming connections. Specifies IPv4 or IPv6 address and port to listen on for incoming connections.
.It Ic listen-iser Aq Ar address .It Ic listen-iser Aq Ar address

View File

@ -1132,7 +1132,7 @@ conf_verify(struct conf *conf)
assert(pg->pg_name != NULL); assert(pg->pg_name != NULL);
if (pg->pg_discovery_auth_group == NULL) { if (pg->pg_discovery_auth_group == NULL) {
pg->pg_discovery_auth_group = pg->pg_discovery_auth_group =
auth_group_find(conf, "no-access"); auth_group_find(conf, "default");
assert(pg->pg_discovery_auth_group != NULL); assert(pg->pg_discovery_auth_group != NULL);
} }
@ -1159,6 +1159,7 @@ conf_verify(struct conf *conf)
break; break;
} }
if (targ == NULL && ag->ag_name != NULL && if (targ == NULL && ag->ag_name != NULL &&
strcmp(ag->ag_name, "default") != 0 &&
strcmp(ag->ag_name, "no-authentication") != 0 && strcmp(ag->ag_name, "no-authentication") != 0 &&
strcmp(ag->ag_name, "no-access") != 0) { strcmp(ag->ag_name, "no-access") != 0) {
log_warnx("auth-group \"%s\" not assigned " log_warnx("auth-group \"%s\" not assigned "