Skip to content

Conversation

@lkebulad
Copy link
Contributor

@lkebulad lkebulad commented Feb 26, 2025

Checklist (Please check before submitting)

Describe the contribution
Modified the creation of temporary filenames in function CF_CFDP_R_Init() to have the name of the file be defined as the concatenation of the source entity ID and the sequence number to avoid filename conflicts.

Fixes issue #334

Testing performed

  1. git clone cFS repo
  2. cd cFS
  3. git submodule init
  4. git submodule update
  5. git clone CF repo into cFS/apps directory
  6. rename CF to cf
  7. git submodule init
  8. git submodule update
  9. go back to cFS directory
  10. cp cfe/cmake/Makefile.sample Makefile
  11. cp -r cfe/cmake/sample_defs sample_defs
  12. In "sample_defs/targets.cmake", add cf to this line to make it look like this: list(APPEND MISSION_GLOBAL_APPLIST sample_app sample_lib cf)
  13. make SIMULATION=native ENABLE_UNIT_TESTS=true BUILDTYPE=debug OMIT_DEPRECATED=true prep
  14. in "sample_defs/cpu1_cfe_es_startup.scr" add cf to first line line this:
    CFE_APP, cf, CF_AppMain, CF, 80, 16384, 0x0, 0;
  15. make install
  16. make test

Expected behavior changes
Temporary filenames created via CF_CFDP_R_Init() should now have filenames be a concatenation of their source entity ID and sequence number

System(s) tested on
Ubuntu 20.04.6

Contributor Info - All information REQUIRED for consideration of pull request
Lukas Kebuladze, GSFC

@dzbaker dzbaker linked an issue Feb 27, 2025 that may be closed by this pull request
2 tasks
@dzbaker dzbaker merged commit d7a8028 into nasa:main Feb 27, 2025
15 of 16 checks passed
Comment on lines -578 to +580
snprintf(txn->history->fnames.dst_filename, sizeof(txn->history->fnames.dst_filename) - 1, "%.*s/%lu.tmp",
CF_FILENAME_MAX_PATH - 1, CF_AppData.config_table->tmp_dir, (unsigned long)txn->history->seq_num);
snprintf(txn->history->fnames.dst_filename, sizeof(txn->history->fnames.dst_filename) - 1, "%.*s/%lu:%lu.tmp",
CF_FILENAME_MAX_PATH - 1, CF_AppData.config_table->tmp_dir,
(unsigned long)txn->history->src_eid, (unsigned long)txn->history->seq_num);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this colon is causing issues for some platforms (vxworks).
There was a suggestion to use an underscore (_) instead.
Working to find a path to update this.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Temporary files possible filename conflict

3 participants