This helps when the disk is full, and rlm_detail writes a partial record.
alloc_packet:
data->tries++;
- rad_assert(data->state == STATE_QUEUED);
+ /*
+ * The writer doesn't check that the record was
+ * completely written. If the disk is full, this can
+ * result in a truncated record. When that happens,
+ * treat it as EOF.
+ */
+ if (data->state != STATE_QUEUED) {
+ radlog(L_ERR, "Truncated record: treating it as EOF for detail file %s", data->filename_work);
+ goto cleanup;
+ }
/*
* We're done reading the file, but we didn't read