Skip to content

Commit

Permalink
Security sanitization to silence some linters
Browse files Browse the repository at this point in the history
  • Loading branch information
Dervish13 committed Sep 18, 2024
1 parent dc05110 commit 46412ec
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/make_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def generate_makefile(self):

# Set Jijna2 environment and variables
j2_env = jinja2.Environment(
autoescape=jinja2.select_autoescape(None),
loader=jinja2.FileSystemLoader(searchpath=str(template_dir))
)
j2_env.filters["dirname"] = self.dirname
Expand Down Expand Up @@ -97,12 +98,12 @@ def generate_makefile(self):

def run_ssh_cmd(self, cmd):
"""Formats the SSH command to use when building on remote hosts."""
ssh_cmd = f"ssh {self.args.username}@{self.args.host} '{cmd}'"
ssh_cmd = ['ssh', f'{self.args.username}@{self.args.host}', f'"{cmd}"']
return subprocess.call(ssh_cmd, shell=True)

def run_scp_cmd(self, src, dst, recurse=False):
"""Formats the SCP command to use when copying over the built package."""
scp_cmd = f"scp {'-r' if recurse else ''} {src} {dst}"
scp_cmd = ['scp', '-r' if recurse else '', src, dst]
return subprocess.call(scp_cmd, shell=True)

def build_package(self, pkg_dir):
Expand Down

0 comments on commit 46412ec

Please sign in to comment.