Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F147202213
D48932.id150924.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
10 KB
Referenced Files
None
Subscribers
None
D48932.id150924.diff
View Options
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
@@ -253,7 +253,7 @@
while ((obj = ucl_iterate_object(top, &it, true))) {
const char *key = ucl_object_key(obj);
- if (!strcmp(key, "debug")) {
+ if (strcmp(key, "debug") == 0) {
if (obj->type == UCL_INT)
conf->conf_debug = ucl_object_toint(obj);
else {
@@ -262,7 +262,7 @@
}
}
- if (!strcmp(key, "timeout")) {
+ if (strcmp(key, "timeout") == 0) {
if (obj->type == UCL_INT)
conf->conf_timeout = ucl_object_toint(obj);
else {
@@ -271,7 +271,7 @@
}
}
- if (!strcmp(key, "maxproc")) {
+ if (strcmp(key, "maxproc") == 0) {
if (obj->type == UCL_INT)
conf->conf_maxproc = ucl_object_toint(obj);
else {
@@ -280,7 +280,7 @@
}
}
- if (!strcmp(key, "pidfile")) {
+ if (strcmp(key, "pidfile") == 0) {
if (obj->type == UCL_STRING)
conf->conf_pidfile_path = strdup(
ucl_object_tostring(obj));
@@ -290,7 +290,7 @@
}
}
- if (!strcmp(key, "isns-server")) {
+ if (strcmp(key, "isns-server") == 0) {
if (obj->type == UCL_ARRAY) {
iter = NULL;
while ((child = ucl_iterate_object(obj, &iter,
@@ -309,7 +309,7 @@
}
}
- if (!strcmp(key, "isns-period")) {
+ if (strcmp(key, "isns-period") == 0) {
if (obj->type == UCL_INT)
conf->conf_isns_period = ucl_object_toint(obj);
else {
@@ -318,7 +318,7 @@
}
}
- if (!strcmp(key, "isns-timeout")) {
+ if (strcmp(key, "isns-timeout") == 0) {
if (obj->type == UCL_INT)
conf->conf_isns_timeout = ucl_object_toint(obj);
else {
@@ -327,7 +327,7 @@
}
}
- if (!strcmp(key, "auth-group")) {
+ if (strcmp(key, "auth-group") == 0) {
if (obj->type == UCL_OBJECT) {
iter = NULL;
while ((child = ucl_iterate_object(obj, &iter, true))) {
@@ -339,7 +339,7 @@
}
}
- if (!strcmp(key, "portal-group")) {
+ if (strcmp(key, "portal-group") == 0) {
if (obj->type == UCL_OBJECT) {
iter = NULL;
while ((child = ucl_iterate_object(obj, &iter, true))) {
@@ -351,7 +351,7 @@
}
}
- if (!strcmp(key, "lun")) {
+ if (strcmp(key, "lun") == 0) {
if (obj->type == UCL_OBJECT) {
iter = NULL;
while ((child = ucl_iterate_object(obj, &iter, true))) {
@@ -369,7 +369,7 @@
while ((obj = ucl_iterate_object(top, &it, true))) {
const char *key = ucl_object_key(obj);
- if (!strcmp(key, "target")) {
+ if (strcmp(key, "target") == 0) {
if (obj->type == UCL_OBJECT) {
iter = NULL;
while ((child = ucl_iterate_object(obj, &iter,
@@ -397,7 +397,7 @@
const ucl_object_t *obj = NULL, *tmp = NULL;
const char *key;
- if (!strcmp(name, "default") &&
+ if (strcmp(name, "default") == 0 &&
conf->conf_default_ag_defined == false) {
auth_group = auth_group_find(conf, name);
conf->conf_default_ag_defined = true;
@@ -411,14 +411,14 @@
while ((obj = ucl_iterate_object(top, &it, true))) {
key = ucl_object_key(obj);
- if (!strcmp(key, "auth-type")) {
+ if (strcmp(key, "auth-type") == 0) {
const char *value = ucl_object_tostring(obj);
if (!auth_group_set_type(auth_group, value))
return (false);
}
- if (!strcmp(key, "chap")) {
+ if (strcmp(key, "chap") == 0) {
if (obj->type != UCL_ARRAY) {
log_warnx("\"chap\" property of "
"auth-group \"%s\" is not an array",
@@ -433,7 +433,7 @@
}
}
- if (!strcmp(key, "chap-mutual")) {
+ if (strcmp(key, "chap-mutual") == 0) {
if (obj->type != UCL_ARRAY) {
log_warnx("\"chap-mutual\" property of "
"auth-group \"%s\" is not an array",
@@ -448,7 +448,7 @@
}
}
- if (!strcmp(key, "initiator-name")) {
+ if (strcmp(key, "initiator-name") == 0) {
if (obj->type != UCL_ARRAY) {
log_warnx("\"initiator-name\" property of "
"auth-group \"%s\" is not an array",
@@ -466,7 +466,7 @@
}
}
- if (!strcmp(key, "initiator-portal")) {
+ if (strcmp(key, "initiator-portal") == 0) {
if (obj->type != UCL_ARRAY) {
log_warnx("\"initiator-portal\" property of "
"auth-group \"%s\" is not an array",
@@ -597,7 +597,7 @@
while ((obj = ucl_iterate_object(top, &it, true))) {
key = ucl_object_key(obj);
- if (!strcmp(key, "discovery-auth-group")) {
+ if (strcmp(key, "discovery-auth-group") == 0) {
portal_group->pg_discovery_auth_group =
auth_group_find(conf, ucl_object_tostring(obj));
if (portal_group->pg_discovery_auth_group == NULL) {
@@ -609,7 +609,7 @@
}
}
- if (!strcmp(key, "discovery-filter")) {
+ if (strcmp(key, "discovery-filter") == 0) {
if (obj->type != UCL_STRING) {
log_warnx("\"discovery-filter\" property of "
"portal-group \"%s\" is not a string",
@@ -622,7 +622,7 @@
return (false);
}
- if (!strcmp(key, "listen")) {
+ if (strcmp(key, "listen") == 0) {
if (obj->type == UCL_STRING) {
if (!portal_group_add_listen(portal_group,
ucl_object_tostring(obj), false))
@@ -644,7 +644,7 @@
}
}
- if (!strcmp(key, "listen-iser")) {
+ if (strcmp(key, "listen-iser") == 0) {
if (obj->type == UCL_STRING) {
if (!portal_group_add_listen(portal_group,
ucl_object_tostring(obj), true))
@@ -666,7 +666,7 @@
}
}
- if (!strcmp(key, "redirect")) {
+ if (strcmp(key, "redirect") == 0) {
if (obj->type != UCL_STRING) {
log_warnx("\"listen\" property of "
"portal-group \"%s\" is not a string",
@@ -679,7 +679,7 @@
return (false);
}
- if (!strcmp(key, "options")) {
+ if (strcmp(key, "options") == 0) {
if (obj->type != UCL_OBJECT) {
log_warnx("\"options\" property of portal group "
"\"%s\" is not an object", portal_group->pg_name);
@@ -695,12 +695,12 @@
}
}
- if (!strcmp(key, "dscp")) {
+ if (strcmp(key, "dscp") == 0) {
if (!uclparse_dscp("portal", portal_group, obj))
return (false);
}
- if (!strcmp(key, "pcp")) {
+ if (strcmp(key, "pcp") == 0) {
if (!uclparse_pcp("portal", portal_group, obj))
return (false);
}
@@ -724,7 +724,7 @@
while ((obj = ucl_iterate_object(top, &it, true))) {
key = ucl_object_key(obj);
- if (!strcmp(key, "alias")) {
+ if (strcmp(key, "alias") == 0) {
if (obj->type != UCL_STRING) {
log_warnx("\"alias\" property of target "
"\"%s\" is not a string", target->t_name);
@@ -734,7 +734,7 @@
target->t_alias = strdup(ucl_object_tostring(obj));
}
- if (!strcmp(key, "auth-group")) {
+ if (strcmp(key, "auth-group") == 0) {
const char *ag;
if (target->t_auth_group != NULL) {
@@ -762,7 +762,7 @@
}
}
- if (!strcmp(key, "auth-type")) {
+ if (strcmp(key, "auth-type") == 0) {
if (target->t_auth_group != NULL) {
if (target->t_auth_group->ag_name != NULL) {
log_warnx("cannot use both auth-group and "
@@ -782,7 +782,7 @@
return (false);
}
- if (!strcmp(key, "chap")) {
+ if (strcmp(key, "chap") == 0) {
if (target->t_auth_group != NULL) {
if (target->t_auth_group->ag_name != NULL) {
log_warnx("cannot use both auth-group "
@@ -801,12 +801,12 @@
return (false);
}
- if (!strcmp(key, "chap-mutual")) {
+ if (strcmp(key, "chap-mutual") == 0) {
if (!uclparse_chap_mutual(target->t_auth_group, obj))
return (false);
}
- if (!strcmp(key, "initiator-name")) {
+ if (strcmp(key, "initiator-name") == 0) {
const struct auth_name *an;
if (target->t_auth_group != NULL) {
@@ -829,7 +829,7 @@
return (false);
}
- if (!strcmp(key, "initiator-portal")) {
+ if (strcmp(key, "initiator-portal") == 0) {
const struct auth_portal *ap;
if (target->t_auth_group != NULL) {
@@ -852,7 +852,7 @@
return (false);
}
- if (!strcmp(key, "portal-group")) {
+ if (strcmp(key, "portal-group") == 0) {
if (obj->type == UCL_OBJECT) {
if (!uclparse_target_portal_group(target, obj))
return (false);
@@ -868,14 +868,14 @@
}
}
- if (!strcmp(key, "port")) {
+ if (strcmp(key, "port") == 0) {
const char *value;
value = ucl_object_tostring(obj);
target->t_pport = strdup(value);
}
- if (!strcmp(key, "redirect")) {
+ if (strcmp(key, "redirect") == 0) {
if (obj->type != UCL_STRING) {
log_warnx("\"redirect\" property of target "
"\"%s\" is not a string", target->t_name);
@@ -887,7 +887,7 @@
return (false);
}
- if (!strcmp(key, "lun")) {
+ if (strcmp(key, "lun") == 0) {
while ((tmp = ucl_iterate_object(obj, &it2, true))) {
if (!uclparse_target_lun(target, tmp))
return (false);
@@ -913,7 +913,7 @@
while ((obj = ucl_iterate_object(top, &it, true))) {
key = ucl_object_key(obj);
- if (!strcmp(key, "backend")) {
+ if (strcmp(key, "backend") == 0) {
if (obj->type != UCL_STRING) {
log_warnx("\"backend\" property of lun "
"\"%s\" is not a string",
@@ -924,7 +924,7 @@
lun_set_backend(lun, ucl_object_tostring(obj));
}
- if (!strcmp(key, "blocksize")) {
+ if (strcmp(key, "blocksize") == 0) {
if (obj->type != UCL_INT) {
log_warnx("\"blocksize\" property of lun "
"\"%s\" is not an integer", lun->l_name);
@@ -934,7 +934,7 @@
lun_set_blocksize(lun, ucl_object_toint(obj));
}
- if (!strcmp(key, "device-id")) {
+ if (strcmp(key, "device-id") == 0) {
if (obj->type != UCL_STRING) {
log_warnx("\"device-id\" property of lun "
"\"%s\" is not an integer", lun->l_name);
@@ -944,7 +944,7 @@
lun_set_device_id(lun, ucl_object_tostring(obj));
}
- if (!strcmp(key, "options")) {
+ if (strcmp(key, "options") == 0) {
if (obj->type != UCL_OBJECT) {
log_warnx("\"options\" property of lun "
"\"%s\" is not an object", lun->l_name);
@@ -960,7 +960,7 @@
}
}
- if (!strcmp(key, "path")) {
+ if (strcmp(key, "path") == 0) {
if (obj->type != UCL_STRING) {
log_warnx("\"path\" property of lun "
"\"%s\" is not a string", lun->l_name);
@@ -970,7 +970,7 @@
lun_set_path(lun, ucl_object_tostring(obj));
}
- if (!strcmp(key, "serial")) {
+ if (strcmp(key, "serial") == 0) {
if (obj->type != UCL_STRING) {
log_warnx("\"serial\" property of lun "
"\"%s\" is not a string", lun->l_name);
@@ -980,7 +980,7 @@
lun_set_serial(lun, ucl_object_tostring(obj));
}
- if (!strcmp(key, "size")) {
+ if (strcmp(key, "size") == 0) {
if (obj->type != UCL_INT) {
log_warnx("\"size\" property of lun "
"\"%s\" is not an integer", lun->l_name);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 10, 2:10 AM (10 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29469319
Default Alt Text
D48932.id150924.diff (10 KB)
Attached To
Mode
D48932: ctld: Use preferred style for evaluating result of strcmp
Attached
Detach File
Event Timeline
Log In to Comment