-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding rcutils_to_native_path function #119
Conversation
1d499b6
to
95ad53f
Compare
src/filesystem.c
Outdated
const char * delimiter = "\\"; | ||
#else | ||
const char * delimiter = "/"; | ||
#endif // _WIN32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we should duplicate this in every function using it.
Is it possible to define those at the top of the file to something like RCUTILS_PATH_DELIMITER
and reuse it in all functions using it instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The top of the header file or the c file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don't plan on exporting it to users (which I think we don't have a need for right now) I'd say yeah put it in the c file for now.
Sorry maybe that was unclear, I meant creating a macro with
|
7c17ae1
to
7319110
Compare
fixed |
I'm not sure about the name of the function. |
I'd suggest keeping this minimalistic, as having |
I agree keeping this patch scoped to only do what we need 👍, my remark was not to increase the featureset on this PR but more about picking the right naming to not confuse users as of what the function is doing. I think |
@ruffsl adding tests for this made me wondering. The conversion is currently done only one way |
@mikaelarguedas , that sounds something like the reverse of normcase. A possible case could be to infer the node's FQN if given only the node's secure root, but that sounds like a poor idea given in most contexts the FQN is already know, and it would be a hard assumption that node's secure directory is within a secure root structure. On that last hard assumption note, touching on ros2/sros2#69 (comment) I'd like to eventually add something like Maybe somewhere else in rcl might have use for something like |
This is very SROS 2 specific. As this package provides c utilities independent of any ROS concept I was mostly trying to have naming and behavior that is intuitive for users regardless of the project they use this function in. I think it's fair to say that people will mostly operate on forward slash separated path to start with. It's unclear to me what name is most appropriate so let's leave it as is for now 👍
I agree that the FQDN should be provided by rcl and not inferred 👍
Yeah this would be a good use case to support
I'm less sure about this one, While it offers flexibility, I think it leads to a path of favoring relaxed security and cross-talk. |
On the user written permission level, true. But to really address the issue of cross-talk, I think restricting read access to the security artifacts using something like linux security modules to harden the file system or Trusted Execution Environment (TEE). Given the secure root directory can be controlled by shell environment already, I don't see much of a difference in permitting the same shell environment to be explicit in the exact secure node path as well. Also for cases where only authentication is needed; signing, renewing and revoking a limited number certificates for a whole robot would certainly be more tractable than have to revoke each certificate/private-key for every ROS2 node on a compromised robot. Users might also want to use sets of permission/certs that align with the system layers (e.g. using a defense-in-depth strategy) rather than aligning to ROS2 namespace concepts, e.g. all ECU related nodes on a single ECU board use the one/only cert allocated to that trusted device. I could start on new PR to add |
814f69f
to
2fadf3b
Compare
This looks OK to me. I'm going to run CI on this (along with ros2/rcl#300) to see how we fare: |
Oh, all of the builds are failing, probably because this (and ros2/rcl#300) need a rebase (there have been some internal API changes recently). @ruffsl , mind doing the rebase? |
2fadf3b
to
c46ebc4
Compare
@clalancette , I just now rebased both #119 and ros2/rcl#300 , please retry tests. |
@clalancette , it looks like in the day or so since last rebase, ros2/rcl#322 was just merged. I've rebased again, so you may want to cancel the rest of the tests and restart the job. If you happen to retrigger the jobs after a day or so, you may want to check if the branches need rebasing just before. |
Thanks. Here is another try: |
@ruffsl We are getting closer :). It looks like cpplint doesn't like the use of |
c46ebc4
to
cca2353
Compare
Well, I think turing complete https://www.geeksforgeeks.org/why-strcpy-and-strncpy-are-not-safe-to-use/ Rebased, please trigger again with ready. |
There is |
Awesome, looks like all tests above are passing! 🎉 |
Relates to: ros2/sros2#68 (comment)