From: Claudio Cambra Date: Thu, 21 Nov 2024 08:24:52 +0000 (+0800) Subject: Do not treat bundles as executables in codesign check X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~5^2~27^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=da581e2b0e426830f7c0106dc1ee1b68cf5762ba;p=nextcloud-desktop.git Do not treat bundles as executables in codesign check Signed-off-by: Claudio Cambra --- diff --git a/admin/osx/mac-crafter/Sources/Utils/Codesign.swift b/admin/osx/mac-crafter/Sources/Utils/Codesign.swift index a2b961eb8..139a1e802 100644 --- a/admin/osx/mac-crafter/Sources/Utils/Codesign.swift +++ b/admin/osx/mac-crafter/Sources/Utils/Codesign.swift @@ -33,7 +33,10 @@ func isAppExtension(_ path: String) -> Bool { } func isExecutable(_ path: String) -> Bool { - FileManager.default.isExecutableFile(atPath: path) + let fm = FileManager.default + var isDir: ObjCBool = false + let exists = fm.fileExists(atPath: path, isDirectory: &isDir) + return fm.isExecutableFile(atPath: path) && !isDir.boolValue && exists } func codesign(identity: String, path: String, options: String = defaultCodesignOptions) throws {