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

rbd: validate pool and snap name optionals #13836

Merged
merged 1 commit into from Apr 6, 2017

Conversation

Projects
None yet
3 participants
@gaurav36
Contributor

gaurav36 commented Mar 7, 2017

Currently when user create snapshot by providing --snap argument
in command line than rbd CLI does not validating snapshot name
to ensure that it should not contain "@" or "/" character.

Fix is to add validation logic for validating "@" or "/" character.

Fixes: http://tracker.ceph.com/issues/14535

Reported-by: Jason Dillaman dillaman@redhat.com
Signed-off-by: Gaurav Kumar Garg garg.gaurav52@gmail.com

@dillaman

This comment has been minimized.

Contributor

dillaman commented Mar 8, 2017

@gaurav36 Looks like a good start -- now just need to validate the pool name in get_pool_image_snapshot_names when in SPEC_VALIDATION_FULL mode. Looks like there are a couple other (newer) places that decode pool optionals as well that would need to be (optionally) verified.

@dillaman dillaman changed the title from rbd: rbd CLI should validate snap name optionals to rbd: validate pool and snap name optionals Mar 9, 2017

@gaurav36

This comment has been minimized.

Contributor

gaurav36 commented Mar 9, 2017

@dillaman Thanks, Done in new updated PR

@@ -328,6 +328,9 @@ int get_pool_image_snapshot_names(const po::variables_map &vm,
SnapshotPresence snapshot_presence,
SpecValidation spec_validation,
bool image_required) {
int r;
boost::regex pattern;

This comment has been minimized.

@dillaman

dillaman Mar 13, 2017

Contributor

Nit: keep variables in the tightest possible scope

SnapshotPresence snapshot_presence) {
SnapshotPresence snapshot_presence,
SpecValidation spec_validation) {
boost::regex pattern;

This comment has been minimized.

@dillaman

dillaman Mar 13, 2017

Contributor

Nit: keep variables to tightest possible scope

This comment has been minimized.

@gaurav36

gaurav36 Mar 14, 2017

Contributor

@dillaman Done (both places) in updated PR.

rbd: rbd CLI should validate snap name optionals
Currently when user create snapshot by providing --snap argument
in command line than rbd CLI does not validating snapshot name
to ensure that it should not contain "@" or "/" character.

Fix is to add validation logic for validating "@" or "/" character.

Fixes: http://tracker.ceph.com/issues/14535

Reported-by: Jason Dillaman <dillaman@redhat.com>
Signed-off-by: Gaurav Kumar Garg <garg.gaurav52@gmail.com>
@dillaman

lgtm

@dillaman dillaman added the needs-qa label Mar 15, 2017

@dillaman dillaman merged commit d271e8c into ceph:master Apr 6, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment