Skip to content

Commit

Permalink
Treat bad records as EOF.
Browse files Browse the repository at this point in the history
This helps when the disk is full, and rlm_detail writes a partial record.
  • Loading branch information
alandekok committed May 4, 2010
1 parent 5037647 commit 73fe431
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/modules/frs_detail/frs_detail.c
Expand Up @@ -731,7 +731,16 @@ int detail_recv(rad_listen_t *listener,
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
Expand Down

0 comments on commit 73fe431

Please sign in to comment.