Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145334143
D48938.1777664219.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D48938.1777664219.diff
View Options
diff --git a/usr.sbin/ctld/ctl.conf.5 b/usr.sbin/ctld/ctl.conf.5
--- a/usr.sbin/ctld/ctl.conf.5
+++ b/usr.sbin/ctld/ctl.conf.5
@@ -567,7 +567,7 @@
"iqn.2012-06.com.example:target1" {
auth-group = ag0
- portal-group { name = pg0 }
+ portal-group = pg0
lun = [
{ number = 0, name = example_1 },
{
diff --git a/usr.sbin/ctld/uclparse.c b/usr.sbin/ctld/uclparse.c
--- a/usr.sbin/ctld/uclparse.c
+++ b/usr.sbin/ctld/uclparse.c
@@ -191,6 +191,20 @@
const ucl_object_t *portal_group, *auth_group;
const char *ag_name;
+ /*
+ * If the value is a single string, assume it is a
+ * portal-group name.
+ */
+ if (obj->type == UCL_STRING)
+ return (target_add_portal_group(ucl_object_tostring(obj),
+ NULL));
+
+ if (obj->type != UCL_OBJECT) {
+ log_warnx("portal-group section in target \"%s\" must be "
+ "an object or string", t_name);
+ return (false);
+ }
+
portal_group = ucl_object_find_key(obj, "name");
if (!portal_group || portal_group->type != UCL_STRING) {
log_warnx("portal-group section in target \"%s\" is missing "
@@ -884,11 +898,6 @@
}
if (strcmp(key, "portal-group") == 0) {
- if (obj->type == UCL_OBJECT) {
- if (!uclparse_target_portal_group(name, obj))
- goto fail;
- }
-
if (obj->type == UCL_ARRAY) {
while ((tmp = ucl_iterate_object(obj, &it2,
true))) {
@@ -896,6 +905,9 @@
tmp))
goto fail;
}
+ } else {
+ if (!uclparse_target_portal_group(name, obj))
+ goto fail;
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, May 1, 7:36 PM (7 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28532569
Default Alt Text
D48938.1777664219.diff (1 KB)
Attached To
Mode
D48938: ctld: Permit targets to use a string for portal-groups in UCL
Attached
Detach File
Event Timeline
Log In to Comment