CF icon indicating copy to clipboard operation
CF copied to clipboard

Temporary files possible filename conflict

Open hugormluis opened this issue 3 years ago • 0 comments

Checklist (Please check before submitting)

  • [x] I reviewed the Contributing Guide.
  • [x] I performed a cursory search to see if the bug report is relevant, not redundant, nor in conflict with other tickets.

Describe the bug The temporary filenames are created based on the sequence number in the PDU (in the CF_CFDP_R_Init()).

Imagine that two different CFDP entities are sending a PDU with the same sequence number (which can happen since this number is managed by each CFDP entity and it can be the same) to the same CFDP destination entity. For instance, the sequence number in this case is 'x'. For the first PDU the CF app would create the x.tmp file and store it in the temporary folder. Upon arriving the second PDU the CF app would also create a x.tmp file and then would store it in the temporary folder. This would create a conflict.

Wouldn't it be better if the temporary filename is the concatenation of the source entity ID and the sequence number? This would guarantee that each temporary file would be unique since each sequence number is unique for each entity ID.

hugormluis avatar Oct 14 '22 10:10 hugormluis