]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Fix check_ssh_injection in cinder/utils
authorgit-harry <git-harry@live.co.uk>
Mon, 1 Dec 2014 13:26:40 +0000 (13:26 +0000)
committergit-harry <git-harry@live.co.uk>
Mon, 1 Dec 2014 13:55:40 +0000 (13:55 +0000)
commit78d9c0366b08c64f39930c2375d6622041fc8abe
treeafbd03f4e8a4f42f2e922e11cb5ff5b757b37be8
parent408c764f4fac26dee250d6c48454aab930b18b2a
Fix check_ssh_injection in cinder/utils

check_ssh_injection is used to prevent commands being modified using
specially constructed strings containing special characters.

The function includes a loop over the special characters to compare
them against each arg. If the special character is the same as the arg
it gets ignored.

This commit modifies this part of the function so that args that are
exactly equal to one of the special characters will cause an exception
to be raised.

Change-Id: I3a61e995ea41fc0324b5cb60e3c96e3d9dc56637
Closes-Bug: #1398002
cinder/tests/test_utils.py
cinder/utils.py