[show][barefoot] replace shell=True#2699
Merged
qiluo-msft merged 4 commits intosonic-net:masterfrom Apr 20, 2023
Merged
Conversation
Signed-off-by: maipbui <[email protected]>
qiluo-msft
reviewed
Feb 28, 2023
show/plugins/barefoot.py
Outdated
| r'-maxdepth 1 -type d -name install_\*_profile ' + opts + '| sed ' | ||
| r's%/opt/bfn/install_\\\(.\*\\\)_profile%\\1%', shell=True) | ||
| cmd0 = ['docker', 'exec', '-it', 'syncd', 'find', '/opt/bfn', '-mindepth', '1',\ | ||
| r'-maxdepth', '1', r'-type', 'd', r'-name', r'install_\*_profile', opts] |
Contributor
qiluo-msft
reviewed
Feb 28, 2023
show/plugins/barefoot.py
Outdated
| r'-maxdepth 1 -type d -name install_\*_profile ' + opts + '| sed ' | ||
| r's%/opt/bfn/install_\\\(.\*\\\)_profile%\\1%', shell=True) | ||
| cmd0 = ['docker', 'exec', '-it', 'syncd', 'find', '/opt/bfn', '-mindepth', '1',\ | ||
| r'-maxdepth', '1', r'-type', 'd', r'-name', r'install_\*_profile', opts] |
qiluo-msft
reviewed
Feb 28, 2023
show/plugins/barefoot.py
Outdated
| r'-maxdepth 1 -type d -name install_\*_profile ' + opts + '| sed ' | ||
| r's%/opt/bfn/install_\\\(.\*\\\)_profile%\\1%', shell=True) | ||
| cmd0 = ['docker', 'exec', '-it', 'syncd', 'find', '/opt/bfn', '-mindepth', '1',\ | ||
| r'-maxdepth', '1', r'-type', 'd', r'-name', r'install_\*_profile', opts] |
Signed-off-by: maipbui <[email protected]>
Contributor
Author
|
/azp run Azure.sonic-utilities |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
|
@oleksandrx-kolomeiets Could you help review? |
qiluo-msft
previously approved these changes
Mar 7, 2023
Signed-off-by: maipbui <[email protected]>
Contributor
Author
|
@oleksandrx-kolomeiets could you help review? |
Signed-off-by: Mai Bui <[email protected]>
qiluo-msft
approved these changes
Apr 20, 2023
dprital
added a commit
to dprital/sonic-buildimage
that referenced
this pull request
May 1, 2023
Update sonic-utilities submodule pointer to include the following: * 88ffb16 [config]config reload should generate sysinfo if missing ([sonic-net#2778](sonic-net/sonic-utilities#2778)) * 7443b9e [sonic-package-manager] support extension with multiple YANG modules ([sonic-net#2752](sonic-net/sonic-utilities#2752)) * 522c3a9 [sonic-package-manager] add support for multiple CLI plugin files ([sonic-net#2753](sonic-net/sonic-utilities#2753)) * b38fcfd [show][muxcable] fix RC ([sonic-net#2812](sonic-net/sonic-utilities#2812)) * 7e24463 [chassis]: remote cli commands infra for sonic chassis ([sonic-net#2701](sonic-net/sonic-utilities#2701)) * bee593e [DPB]Fixing typo in config breakout output ([sonic-net#2802](sonic-net/sonic-utilities#2802)) * ada603c [config]Support multi-asic Golden Config override ([sonic-net#2738](sonic-net/sonic-utilities#2738)) * 88a7daa [show][barefoot] replace shell=True ([sonic-net#2699](sonic-net/sonic-utilities#2699)) * 5e99edb [sonic_package_manager] replace shell=True ([sonic-net#2726](sonic-net/sonic-utilities#2726)) * b547bb4 [acl-loader] Only add default deny rule when table is L3 or L3V6 ([sonic-net#2796](sonic-net/sonic-utilities#2796)) Signed-off-by: dprital <[email protected]>
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: maipbui [email protected]
What I did
subprocess()- when using withshell=Trueis dangerous. Using subprocess function without a static string can lead to command injection.How I did it
subprocess()- useshell=Falseinstead, use list of strings Ref: https://semgrep.dev/docs/cheat-sheets/python-command-injection/#mitigationHow to verify it
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)