while (!emptyPair(pair)) {
VALUE_PAIR* vp = pairmake(pair->key, pair->value, T_OP_SET);
- pairadd(vps, vp);
+ if (vp != NULL) {
+ pairadd(vps, vp);
+ ++count;
+ }
++pair;
- ++count;
}
return count;
size_t count = 0;
count += toVPS(result.modify, &request->config_items);
+ pairfree(&request->reply->vps);
count += toVPS(result.reply, &request->reply->vps);
deletePairs(result.modify);
bzero(res[pos].key, sizeof(res[0].key));
bzero(res[pos].value, sizeof(res[0].value));
strncpy(res[pos].key, pairs->name, sizeof(res[0].key));
- vp_prints_value(res[pos].value, sizeof(res[0].value), pairs, 0);
+ vp_prints_value(res[pos].value, sizeof(res[0].value), (VALUE_PAIR*)pairs, 0);
++pos;
pairs = pairs->next;
}
return res;
}
+static int toRLMCode(int code)
+{
+ switch (code)
+ {
+ case STG_REJECT: return RLM_MODULE_REJECT;
+ case STG_FAIL: return RLM_MODULE_FAIL;
+ case STG_OK: return RLM_MODULE_OK;
+ case STG_HANDLED: return RLM_MODULE_HANDLED;
+ case STG_INVALID: return RLM_MODULE_INVALID;
+ case STG_USERLOCK: return RLM_MODULE_USERLOCK;
+ case STG_NOTFOUND: return RLM_MODULE_NOTFOUND;
+ case STG_NOOP: return RLM_MODULE_NOOP;
+ case STG_UPDATED: return RLM_MODULE_UPDATED;
+ }
+ return RLM_MODULE_REJECT;
+}
+
/*
* Do any per-module initialization that is separate to each
* configured instance of the module. e.g. set up connections
if (count)
return RLM_MODULE_UPDATED;
- return RLM_MODULE_NOOP;
+ return toRLMCode(result.returnCode);
}
/*
if (count)
return RLM_MODULE_UPDATED;
- return RLM_MODULE_NOOP;
+ return toRLMCode(result.returnCode);
}
/*
if (count)
return RLM_MODULE_UPDATED;
- return RLM_MODULE_NOOP;
+ return toRLMCode(result.returnCode);
}
/*
if (count)
return RLM_MODULE_UPDATED;
- return RLM_MODULE_OK;
+ return toRLMCode(result.returnCode);
}
/*
if (count)
return RLM_MODULE_UPDATED;
- return RLM_MODULE_NOOP;
+ return toRLMCode(result.returnCode);
}
static int stg_detach(void* instance)
module_t rlm_stg = {
RLM_MODULE_INIT,
"stg",
- RLM_TYPE_THREAD_SAFE, /* type */
+ RLM_TYPE_THREAD_UNSAFE, /* type */
stg_instantiate, /* instantiation */
stg_detach, /* detach */
{