Skip to content

Conversation

@EulalieCoevoet
Copy link
Contributor

Used to open the file where a node or component is implemented or instantiate (see SofaComplianceRobotics/SofaGLFW#92)


By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

@alxbilger alxbilger added the pr: status to review To notify reviewers to review this pull-request label Nov 29, 2025
@hugtalbot hugtalbot added pr: enhancement About a possible enhancement pr: status wip Development in the pull-request is still in progress and removed pr: status to review To notify reviewers to review this pull-request labels Dec 4, 2025
success = true;
#elif defined(__APPLE__)
const std::string command = "open \"" + filename + "\"";
if (std::system(command.c_str()) == 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

std::system() is not safe ; as a user could call this function with an input crafted to do malicious things...
So the solution would be to sanitize the inputs or the best solution is to use fork() and execvp() (for linux at least.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see, sorry I didn't know it was bad practice to use std::system. I'll make the changes for both macOS and linux.

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

Labels

pr: enhancement About a possible enhancement pr: status wip Development in the pull-request is still in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants