Merge branch 'Munki7dev' into custom-sidebar

This commit is contained in:
Greg Neagle
2025-07-11 17:24:05 -07:00
2 changed files with 3 additions and 10 deletions
+2
View File
@@ -120,6 +120,8 @@ func getConditions() async -> PlistDict {
}
do {
let _ = try await runExternalScript(itemPath, timeout: 60)
} catch let ProcessError.error(description) {
display.error(description)
} catch {
display.error("Error while running \(itemPath): \(error.localizedDescription)")
}
+1 -10
View File
@@ -191,16 +191,7 @@ func verifyFileOnlyWritableByMunkiAndRoot(_ path: String) throws {
/// Verifies path is executable
func verifyExecutable(_ path: String) throws {
let filemanager = FileManager.default
var attributes: NSDictionary
do {
attributes = try filemanager.attributesOfItem(atPath: path) as NSDictionary
} catch {
throw ExternalScriptError.statusError(
detail: "\(path): could not get filesystem attributes")
}
let mode = attributes.filePosixPermissions()
if Int32(mode) & X_OK == 0 {
if !FileManager.default.isExecutableFile(atPath: path) {
throw ExternalScriptError.statusError(
detail: "\(path) is not executable")
}