mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Close isExecutable command outpipe file handle after use
Prevents exhaustion of fds Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
fb78b0fb0c
commit
582beeec6c
@ -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")
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user