daemon: update node commands to make use of shlex.quote for shell=True commands
This commit is contained in:
parent
9c265ab283
commit
60a48c7084
1 changed files with 2 additions and 1 deletions
|
@ -3,6 +3,7 @@ Defines the base logic for nodes used within core.
|
||||||
"""
|
"""
|
||||||
import abc
|
import abc
|
||||||
import logging
|
import logging
|
||||||
|
import shlex
|
||||||
import shutil
|
import shutil
|
||||||
import threading
|
import threading
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
|
@ -702,7 +703,7 @@ class CoreNode(CoreNodeBase):
|
||||||
:return: node command
|
:return: node command
|
||||||
"""
|
"""
|
||||||
if shell:
|
if shell:
|
||||||
args = f'{BASH} -c "{args}"'
|
args = f"{BASH} -c {shlex.quote(args)}"
|
||||||
return f"{VCMD} -c {self.ctrlchnlname} -- {args}"
|
return f"{VCMD} -c {self.ctrlchnlname} -- {args}"
|
||||||
|
|
||||||
def cmd(self, args: str, wait: bool = True, shell: bool = False) -> str:
|
def cmd(self, args: str, wait: bool = True, shell: bool = False) -> str:
|
||||||
|
|
Loading…
Reference in a new issue