# Attributes marked as '=' are added to reply_items instead
# of default configure_itmes
#
-# Attributse marked as '~' are added to request_items
+# Attributes marked as '~' are added to request_items
#
# Field marked as ',' may contain a comma separated list
# of attributes.
#
-# hashsize - hashtable size. If 0 or not specified records are not
-# stored in memory and file is read on every request.
-# This configuration is *not* recommended, as it can be
-# very slow. The "passwd" module reloads its configuration
-# on HUP, so setting "hashsize = 0" is unnecessary.
+# hashsize - hashtable size. Setting it to 0 is no longer permitted
+# A future version of the server will have the module
+# automatically determine the hash size. Having it set
+# manually should not be necessary.
#
# allowmultiplekeys - if many records for a key are allowed
#
return -1;
}
if(!inst->filename || *inst->filename == '\0' || !inst->format || *inst->format == '\0') {
- radlog(L_ERR, "rlm_passwd: cann't find passwd file and/or format in configuration");
+ radlog(L_ERR, "rlm_passwd: can't find passwd file and/or format in configuration");
+ free(inst);
return -1;
}
+
+ if (inst->hashsize == 0) {
+ radlog(L_ERR, "rlm_passwd: hashsize=0 is no longer permitted as it will break the server.");
+ free(inst);
+ return -1;
+ }
+
lf=strdup(inst->format);
if ( lf == NULL) {
radlog(L_ERR, "rlm_passwd: memory allocation failed for lf");
+ free(inst);
return -1;
}
memset(lf, 0, strlen(inst->format));