-
Notifications
You must be signed in to change notification settings - Fork 635
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
Ota/fix sudo issue #1487
Ota/fix sudo issue #1487
Conversation
Co-authored-by: Shubham Divekar <divekarshubham@gmail.com>
* Update OTA PAL include guard names * Add unit test cases for getcwd failing * Add unit test helper functions for getcwd pass/fail
…nto ota/fix_sudo_issue
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.
See comments – also this new code contains 3 copies of essentially identical code to construct a fully-qualified pathname. That should be factored into a static
utility method and reused in this module. This will make the code less complex, more readable, and easier to test.
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.
Pointer handling prior to the call to strncat()
is still wrong - see comments and suggested alternative. Also, getFilePathFromCWD()
needs to return some type of status so that callers know when an error has occurred.
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.
You're still not doing anything in these error cases. The code as written will attempt to open invalid filenames. See comments.
…k-embedded-C into ota/fix_sudo_issue
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.