-
Notifications
You must be signed in to change notification settings - Fork 79
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
Dollar sign escape #185
base: master
Are you sure you want to change the base?
Dollar sign escape #185
Conversation
could you please meld the commits into one for a better review. you should also add testcase(s) for issues/enhancements that are not yet covered by a testcase. thanks |
3ffed98
to
acca683
Compare
I have checked the Codacy Static Code Analysis reports. It has conflict with using hard coded password and Popen function from the subprocess library. But I wanted to emulate the same behavior as Ipmitool class. Can we ignore the reports and merge it? |
we can configure codacy to ignore tests, e.g. https://docs.codacy.com/repositories-configure/codacy-configuration-file/#ignore-files |
IPMI commands get executed in a separate shell where the combination "status" has its own behavior. In our case, Popen starts a new shell, for example by running /bin/bash, and when the BMC password contains the combination above it gets replaced to "bin/bash" (in this case the combination holds the last executed command as a string). I have added a method to Session class that will escape the dollar sign and test function. Such behavior is expected with other signs (like combination "^_") but I didn't find it critical for them. Signed-off-by: Evloev Sayfuddin <[email protected]>
acca683
to
a4859d1
Compare
I can't configure codacy by myself, I will wait for you to skip it. |
@hthiery Hi!) Is there any update on this PR? |
I just see that calling ipmitool with popen and Using e.g.: So I think we should change |
Ok. I will look into it) |
IPMI commands get executed in a separate shell where the combination "status" has its own behavior. In our case,
Popen starts a new shell, for example by running /bin/bash, and when the BMC password contains the combination
above it gets replaced to "bin/bash" (in this case the combination holds the last executed command as a string).
I have added a method to Session class that will escape the dollar sign. Such behavior is expected with other signs
(like combination "^_") but I didn't find it critical.