mirror of
https://github.com/munki/munki.git
synced 2026-05-03 19:10:21 -05:00
Merge branch 'Munki7dev' into custom-sidebar
This commit is contained in:
@@ -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)")
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user