diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index becf99f1cdb..7ef16632062 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -538,7 +538,7 @@ jobs: python-version: "3.10.15" source: "onedir" environment: nightly - sign-macos-packages: true + sign-macos-packages: false sign-windows-packages: false secrets: inherit @@ -556,7 +556,7 @@ jobs: python-version: "3.10.15" source: "src" environment: nightly - sign-macos-packages: true + sign-macos-packages: false sign-windows-packages: false secrets: inherit build-ci-deps: diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index eb7574c950f..f99a4d5fab7 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -520,7 +520,7 @@ jobs: python-version: "3.10.15" source: "onedir" environment: staging - sign-macos-packages: true + sign-macos-packages: false sign-windows-packages: ${{ inputs.sign-windows-packages }} secrets: inherit @@ -538,7 +538,7 @@ jobs: python-version: "3.10.15" source: "src" environment: staging - sign-macos-packages: true + sign-macos-packages: false sign-windows-packages: ${{ inputs.sign-windows-packages }} secrets: inherit build-ci-deps: diff --git a/.github/workflows/templates/build-packages.yml.jinja b/.github/workflows/templates/build-packages.yml.jinja index 745bcc3c9ca..e2ae278a044 100644 --- a/.github/workflows/templates/build-packages.yml.jinja +++ b/.github/workflows/templates/build-packages.yml.jinja @@ -19,7 +19,7 @@ source: "<{ backend }>" <%- if gh_environment != "ci" %> environment: <{ gh_environment }> - sign-macos-packages: true + sign-macos-packages: false sign-windows-packages: <% if gh_environment == 'nightly' -%> false <%- else -%> ${{ inputs.sign-windows-packages }} <%- endif %> secrets: inherit <%- endif %> diff --git a/changelog/66955.fixed.md b/changelog/66955.fixed.md new file mode 100644 index 00000000000..d45b8f650a7 --- /dev/null +++ b/changelog/66955.fixed.md @@ -0,0 +1 @@ +Allow for secure-boot efivars directory having SecureBoot-xxx files, not directories with a data file diff --git a/salt/grains/extra.py b/salt/grains/extra.py index b030d6fc869..c89185caa0a 100644 --- a/salt/grains/extra.py +++ b/salt/grains/extra.py @@ -66,7 +66,10 @@ def config(): def __secure_boot(efivars_dir): """Detect if secure-boot is enabled.""" enabled = False - sboot = glob.glob(os.path.join(efivars_dir, "SecureBoot-*/data")) + if "efivars" == os.path.basename(efivars_dir): + sboot = glob.glob(os.path.join(efivars_dir, "SecureBoot-*")) + else: + sboot = glob.glob(os.path.join(efivars_dir, "SecureBoot-*/data")) if len(sboot) == 1: # The minion is usually running as a privileged user, but is # not the case for the master. Seems that the master can also @@ -79,6 +82,17 @@ def __secure_boot(efivars_dir): return enabled +def get_secure_boot_path(): + """ + Provide paths for secure boot directories and files + """ + efivars_path = next( + filter(os.path.exists, ["/sys/firmware/efi/efivars", "/sys/firmware/efi/vars"]), + None, + ) + return efivars_path + + def uefi(): """Populate UEFI grains.""" if salt.utils.platform.is_freebsd(): @@ -89,18 +103,11 @@ def uefi(): "efi-secure-boot": False, } else: - # Works on Linux and Apple ? - efivars_dir = next( - filter( - os.path.exists, ["/sys/firmware/efi/efivars", "/sys/firmware/efi/vars"] - ), - None, - ) + efivars_dir = get_secure_boot_path() grains = { "efi": bool(efivars_dir), "efi-secure-boot": __secure_boot(efivars_dir) if efivars_dir else False, } - return grains diff --git a/tests/pytests/unit/grains/test_secure_boot.py b/tests/pytests/unit/grains/test_secure_boot.py new file mode 100644 index 00000000000..f56f413beca --- /dev/null +++ b/tests/pytests/unit/grains/test_secure_boot.py @@ -0,0 +1,129 @@ +""" + :codeauthor: :email:`David Murphy