Skip to content

Commit f40e481

Browse files
Fix tool 'semgrep' warning for security reason.
Signed-off-by: Clark Lee <[email protected]>
1 parent 71a7e69 commit f40e481

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sonic-pit/pit-sysdiag/src/function.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ def convert_unicode(input):
3838

3939

4040
def run_command(cmd):
41-
proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
41+
proc = subprocess.Popen(cmd, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
4242
out, err = proc.communicate()
4343
if err and proc.returncode != 0:
4444
return proc.returncode, err
4545
return 0, out.decode().rstrip('\n')
4646

4747

4848
def restful_command(cmd):
49-
url = "http://240.1.1.1:8080/api/hw/rawcmd"
49+
url = "https://240.1.1.1:8080/api/hw/rawcmd"
5050
data = json.dumps({
5151
"Command" : cmd
5252
})

0 commit comments

Comments
 (0)