Skip to content

Commit

Permalink
Remove redundant inst->name arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Jan 14, 2016
1 parent 2ef09a4 commit 150b916
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 22 deletions.
4 changes: 1 addition & 3 deletions src/modules/rlm_csv/rlm_csv.c
Expand Up @@ -279,9 +279,7 @@ static int mod_bootstrap(CONF_SECTION *conf, void *instance)
char buffer[8192];

inst->name = cf_section_name2(conf);
if (!inst->name) {
inst->name = cf_section_name1(conf);
}
if (!inst->name) inst->name = cf_section_name1(conf);

if (inst->delimiter[1]) {
cf_log_err_cs(conf, "'delimiter' must be one character long");
Expand Down
4 changes: 1 addition & 3 deletions src/modules/rlm_detail/rlm_detail.c
Expand Up @@ -120,9 +120,7 @@ static int mod_instantiate(CONF_SECTION *conf, void *instance)
CONF_SECTION *cs;

inst->name = cf_section_name2(conf);
if (!inst->name) {
inst->name = cf_section_name1(conf);
}
if (!inst->name) inst->name = cf_section_name1(conf);

/*
* Escape filenames only if asked.
Expand Down
3 changes: 1 addition & 2 deletions src/modules/rlm_otp/rlm_otp.c
Expand Up @@ -110,8 +110,7 @@ static int mod_instantiate(CONF_SECTION *conf, void *instance)

if (inst->mschap_mppe_types != 2) {
inst->mschap_mppe_types = 2;
WARN("Invalid value for "
"mschap_mppe_bits, using default of 2");
WARN("Invalid value for mschap_mppe_bits, using default of 2");
}

/* set the instance name (for use with authorize()) */
Expand Down
4 changes: 1 addition & 3 deletions src/modules/rlm_unbound/rlm_unbound.c
Expand Up @@ -400,9 +400,7 @@ static int mod_bootstrap(CONF_SECTION *conf, void *instance)
rlm_unbound_t *inst = instance;

inst->name = cf_section_name2(conf);
if (!inst->name) {
inst->name = cf_section_name1(conf);
}
if (!inst->name) inst->name = cf_section_name1(conf);

if (inst->timeout > 10000) {
cf_log_err_cs(conf, "timeout must be 0 to 10000");
Expand Down
4 changes: 1 addition & 3 deletions src/modules/rlm_unix/rlm_unix.c
Expand Up @@ -133,9 +133,7 @@ static int mod_bootstrap(CONF_SECTION *conf, void *instance)
fr_dict_attr_t const *group_da, *user_name_da;

inst->name = cf_section_name2(conf);
if (!inst->name) {
inst->name = cf_section_name1(conf);
}
if (!inst->name) inst->name = cf_section_name1(conf);

group_da = fr_dict_attr_by_num(NULL, 0, PW_GROUP);
if (!group_da) {
Expand Down
14 changes: 6 additions & 8 deletions src/modules/rlm_yubikey/validate.c
Expand Up @@ -45,7 +45,7 @@ static void *mod_conn_create(TALLOC_CTX *ctx, void *instance, UNUSED struct time

status = ykclient_handle_init(inst->ykc, &yandle);
if (status != YKCLIENT_OK) {
ERROR("%s", inst->name, ykclient_strerror(status));
ERROR("%s", ykclient_strerror(status));

return NULL;
}
Expand All @@ -66,25 +66,23 @@ int rlm_yubikey_ykclient_init(CONF_SECTION *conf, rlm_yubikey_t *inst)
int count = 0;

if (!inst->client_id) {
ERROR("validation.client_id must be set (to a valid id) when validation is enabled",
inst->name);
ERROR("validation.client_id must be set (to a valid id) when validation is enabled");

return -1;
}

if (!inst->api_key || !*inst->api_key || is_zero(inst->api_key)) {
ERROR("validation.api_key must be set (to a valid key) when validation is enabled",
inst->name);
ERROR("validation.api_key must be set (to a valid key) when validation is enabled");

return -1;
}

DEBUG("Initialising ykclient", inst->name);
DEBUG("Initialising ykclient");

status = ykclient_global_init();
if (status != YKCLIENT_OK) {
yk_error:
ERROR("%s", ykclient_strerror(status), inst->name);
ERROR("%s", ykclient_strerror(status));

return -1;
}
Expand Down Expand Up @@ -127,7 +125,7 @@ int rlm_yubikey_ykclient_init(CONF_SECTION *conf, rlm_yubikey_t *inst)
init:
status = ykclient_set_client_b64(inst->ykc, inst->client_id, inst->api_key);
if (status != YKCLIENT_OK) {
ERROR("%s", ykclient_strerror(status), inst->name);
ERROR("%s", ykclient_strerror(status));

return -1;
}
Expand Down

0 comments on commit 150b916

Please sign in to comment.