Skip to content

Commit c35a7f0

Browse files
authored
Plugin/CodeQL: Linux fixes (#364)
## Description Fixes #363 1. Removes assignment to `suffix` (which does not have a setter) 2. Adds owner execution permission to files in the CodeQL CLI ext dep - [ ] Impacts functionality? - **Functionality** - Does the change ultimately impact how firmware functions? - Examples: Add a new library, publish a new PPI, update an algorithm, ... - [ ] Impacts security? - **Security** - Does the change have a direct security impact on an application, flow, or firmware? - Examples: Crypto algorithm change, buffer overflow fix, parameter validation improvement, ... - [ ] Breaking change? - **Breaking change** - Will anyone consuming this change experience a break in build or boot behavior? - Examples: Add a new library class, move a module to a different repo, call a function in a new library class in a pre-existing module, ... - [ ] Includes tests? - **Tests** - Does the change include any explicit test code? - Examples: Unit tests, integration tests, robot tests, ... - [ ] Includes documentation? - **Documentation** - Does the change contain explicit documentation additions outside direct code modifications (and comments)? - Examples: Update readme file, add feature readme file, link to documentation on an a separate Web page, ... ## How This Was Tested Test in TianoCore [Fedora 37 Dev container](https://github.com/tianocore/containers/pkgs/container/containers%2Ffedora-37-dev) `3b3eb8f`. ## Integration Instructions Use this change if using the CodeQL plugin on Linux hosts. Signed-off-by: Michael Kubacki <[email protected]>
1 parent 4ed99b5 commit c35a7f0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

.pytool/Plugin/CodeQL/CodeQlBuildPlugin.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# SPDX-License-Identifier: BSD-2-Clause-Patent
77
##
88

9+
import glob
910
import logging
1011
import os
1112
import stat
@@ -99,7 +100,7 @@ def do_pre_build(self, builder: UefiBuilder) -> int:
99100
self.codeql_cmd_path = self.codeql_cmd_path.parent / (
100101
self.codeql_cmd_path.name + '.bat')
101102
elif GetHostInfo().os == "Linux":
102-
self.codeql_cmd_path.suffix = self.codeql_cmd_path.parent / (
103+
self.codeql_cmd_path = self.codeql_cmd_path.parent / (
103104
self.codeql_cmd_path.name + '.sh')
104105
codeql_build_cmd += f"#!/bin/bash{os.linesep * 2}"
105106
codeql_build_cmd += "build " + build_params
@@ -110,6 +111,9 @@ def do_pre_build(self, builder: UefiBuilder) -> int:
110111
if GetHostInfo().os == "Linux":
111112
os.chmod(self.codeql_cmd_path,
112113
os.stat(self.codeql_cmd_path).st_mode | stat.S_IEXEC)
114+
for f in glob.glob(os.path.join(
115+
os.path.dirname(self.codeql_path), '**/*'), recursive=True):
116+
os.chmod(f, os.stat(f).st_mode | stat.S_IEXEC)
113117

114118
codeql_params = (f'database create {self.codeql_db_path} '
115119
f'--language=cpp '

0 commit comments

Comments
 (0)