Skip to content

Commit

Permalink
vm(qemu): ensure created EFI vars is rw
Browse files Browse the repository at this point in the history
Fixes #6725
  • Loading branch information
osy committed Nov 11, 2024
1 parent acbf2ba commit ed99b74
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Configuration/UTMQemuConfigurationQEMU.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
//

import Foundation
import System

/// Tweaks and advanced QEMU settings.
struct UTMQemuConfigurationQEMU: Codable {
Expand Down Expand Up @@ -189,6 +190,8 @@ extension UTMQemuConfigurationQEMU {
if !fileManager.fileExists(atPath: varsURL.path) {
try await Task.detached {
try FileManager.default.copyItem(at: templateVarsURL, to: varsURL)
let permissions: FilePermissions = [.ownerReadWrite, .groupRead, .otherRead]
try FileManager.default.setAttributes([.posixPermissions: permissions.rawValue], ofItemAtPath: varsURL.path)
}.value
}
efiVarsURL = varsURL
Expand Down

0 comments on commit ed99b74

Please sign in to comment.