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

[system-health] Remove subprocess with shell=True #12572

Merged
merged 2 commits into from
Nov 2, 2022

Conversation

maipbui
Copy link
Contributor

@maipbui maipbui commented Nov 1, 2022

Signed-off-by: maipbui [email protected]

Why I did it

subprocess is used with shell=True, which is very dangerous for shell injection.

How I did it

remove shell=True, use shell=False

How to verify it

Pass UT
Manual test

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205

Description for the changelog

Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

Signed-off-by: maipbui <[email protected]>
@maipbui maipbui requested a review from qiluo-msft November 1, 2022 21:47
assert not output

output = utils.run_command('ls')

Choose a reason for hiding this comment

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

Library

qiluo-msft pushed a commit that referenced this pull request Jan 25, 2023
mlok-nokia pushed a commit to mlok-nokia/sonic-buildimage that referenced this pull request Jan 26, 2023
mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Feb 6, 2023
mssonicbld pushed a commit that referenced this pull request Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants