Skip to content
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

Sanitize bagfile splitting CLI input #226

Merged

Conversation

prajakta-gokhale
Copy link

As per discussion on #212, moving bagfile splitting CLI input validation to SequentialWriter and storage_interfaces.

Closes https://github.com/ros-security/aws-roadmap/issues/6.

Signed-off-by: Prajakta Gokhale prajaktg@amazon.com

Signed-off-by: Prajakta Gokhale <prajaktg@amazon.com>
Signed-off-by: Prajakta Gokhale <prajaktg@amazon.com>
@prajakta-gokhale
Copy link
Author

@Karsten1987 please take a look. Thanks!

@@ -37,6 +37,8 @@ class ROSBAG2_STORAGE_PUBLIC ReadWriteInterface
uint64_t get_bagfile_size() const override = 0;

std::string get_storage_identifier() const override = 0;

virtual uint64_t get_minimum_split_file_size() const = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I personally think we should have a more general function such as validate_storage_options() which allows to validate all possible storage options. That makes it a bit easier to extend the functionality later on if more options are added in the future wo/ adding a new function to the interface for each of them.

Copy link
Author

@prajakta-gokhale prajakta-gokhale Dec 14, 2019

Choose a reason for hiding this comment

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

I believe that would be a responsibility of writer and not the individual storage_interfaces. It can be extended by adding new validation if new storage_options get added in future, with corresponding changes if needed in storage_interfaces. @Karsten1987 what do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I am okay with this for now in order to push this feature forward. But I think we should address this more generally latest when different storage options come into the game, such as splitting by time or such.

Copy link
Collaborator

@Karsten1987 Karsten1987 left a comment

Choose a reason for hiding this comment

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

lgtm with green CI

@zmichaels11
Copy link
Contributor

@ros2/aws-oncall - please run this CI job
Gist: https://gist.githubusercontent.com/zmichaels11/897a9501d703608aaf0f604dc20ffd17/raw/a282529ed8ea28ec198f11422ddafbf78998a522/ros2.repos
BUILD args: --packages-up-to rosbag2 rosbag2_storage rosbag2_storage_default_plugins
TEST args: --packages-select rosbag2 rosbag2_storage rosbag2_storage_default_plugins
Job: ci_launcher

@dabonnie
Copy link
Contributor

dabonnie commented Jan 3, 2020

@ros2/aws-oncall - please run this CI job
Gist: https://gist.githubusercontent.com/zmichaels11/897a9501d703608aaf0f604dc20ffd17/raw/a282529ed8ea28ec198f11422ddafbf78998a522/ros2.repos
BUILD args: --packages-up-to rosbag2 rosbag2_storage rosbag2_storage_default_plugins
TEST args: --packages-select rosbag2 rosbag2_storage rosbag2_storage_default_plugins
Job: ci_launcher

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@prajakta-gokhale prajakta-gokhale merged commit cbb9fd7 into ros2:master Jan 3, 2020
@zmichaels11 zmichaels11 deleted the splitting/input-validation branch January 6, 2020 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants