Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F140141049
D48938.id150827.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D48938.id150827.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
@@ -197,6 +197,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(target,
+ ucl_object_tostring(obj), NULL));
+
+ if (obj->type != UCL_OBJECT) {
+ log_warnx("portal-group section in target \"%s\" must be "
+ "an object or string", target->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 "
@@ -890,11 +904,6 @@
}
if (strcmp(key, "portal-group") == 0) {
- if (obj->type == UCL_OBJECT) {
- if (!uclparse_target_portal_group(target, obj))
- return (false);
- }
-
if (obj->type == UCL_ARRAY) {
while ((tmp = ucl_iterate_object(obj, &it2,
true))) {
@@ -902,6 +911,9 @@
tmp))
return (false);
}
+ } else {
+ if (!uclparse_target_portal_group(target, obj))
+ return (false);
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 21, 6:47 PM (12 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27119320
Default Alt Text
D48938.id150827.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