Skip to content

Commit

Permalink
Merge pull request #7631 from nextcloud/backport/7585/stable-3.15
Browse files Browse the repository at this point in the history
[stable-3.15] mac-crafter: Close isExecutable command outpipe file handle after use
  • Loading branch information
claucambra authored Dec 10, 2024
2 parents 68db950 + 952a38d commit 179cea1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion admin/osx/mac-crafter/Sources/Utils/Codesign.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ func isExecutable(_ path: String) throws -> Bool {
throw CodeSigningError.failedToCodeSign("Failed to determine if \(path) is an executable.")
}

let outputData = outPipe.fileHandleForReading.readDataToEndOfFile()
let outputFileHandle = outPipe.fileHandleForReading
let outputData = outputFileHandle.readDataToEndOfFile()
try outputFileHandle.close()
let output = String(data: outputData, encoding: .utf8) ?? ""
return output.contains("Mach-O 64-bit executable")
}
Expand Down

0 comments on commit 179cea1

Please sign in to comment.