Skip to content

Commit f3df417

Browse files
committed
fix: correctly escape tags and connection names
1 parent 41e85ce commit f3df417

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

app.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,7 @@ def add_(self, _):
11311131
if socks_proxy_port and not FormValidator.validate_port_with_alert(socks_proxy_port, "SOCKS Proxy Port"):
11321132
return
11331133

1134-
cmd = f"add-connection {tag} {host} {socks_proxy_port}"
1134+
cmd = f"add-connection \"{tag}\" {host} {socks_proxy_port}"
11351135
output, returncode = run_susops(cmd)
11361136
if returncode == 0:
11371137
alert_foreground("Success", output)
@@ -1166,7 +1166,7 @@ def add_(self, _):
11661166
if not FormValidator.validate_empty_with_alert(host, "Host"):
11671167
return
11681168

1169-
cmd = f"-c {connection} add {host}"
1169+
cmd = f"-c \"{connection}\" add {host}"
11701170
output, returncode = run_susops(cmd)
11711171
if returncode == 0:
11721172
alert_foreground("Success", output + "\nPlease re-apply your browser proxy settings.")
@@ -1192,7 +1192,7 @@ def add_(self, _):
11921192
if not FormValidator.validate_port_with_alert(remote_port, "Remote Port"):
11931193
return
11941194

1195-
cmd = f"-c {connection} add -l {local_port} {remote_port} \"{tag}\""
1195+
cmd = f"-c \"{connection}\" add -l {local_port} {remote_port} \"{tag}\""
11961196
output, returncode = run_susops(cmd)
11971197
if returncode == 0:
11981198
susops_app.show_restart_dialog("Success", output)
@@ -1216,7 +1216,7 @@ def add_(self, _):
12161216
if not FormValidator.validate_port_with_alert(local_port, "Local Port"):
12171217
return
12181218

1219-
cmd = f"-c {connection} add -r {remote_port} {local_port} \"{tag}\""
1219+
cmd = f"-c \"{connection}\" add -r {remote_port} {local_port} \"{tag}\""
12201220
output, returncode = run_susops(cmd)
12211221
if returncode == 0:
12221222
susops_app.show_restart_dialog("Success", output)

susops-cli

0 commit comments

Comments
 (0)