chore(format): swiftformat host env and exec approvals (#31115)

This commit is contained in:
Vincent Koc
2026-03-01 17:00:17 -08:00
committed by GitHub
parent 81d600d55e
commit ac3e1e769b
3 changed files with 10 additions and 6 deletions

View File

@@ -535,7 +535,9 @@ enum ExecApprovalsStore {
[.posixPermissions: self.secureStateDirPermissions],
ofItemAtPath: url.path)
} catch {
self.logger.warning("exec approvals state dir permission hardening failed: \(error.localizedDescription, privacy: .public)")
self.logger
.warning(
"exec approvals state dir permission hardening failed: \(error.localizedDescription, privacy: .public)")
}
}

View File

@@ -686,7 +686,8 @@ private final class ExecApprovalsSocketServer: @unchecked Sendable {
do {
try ExecApprovalsSocketPathGuard.removeExistingSocket(at: self.socketPath)
} catch {
self.logger.warning("exec approvals socket cleanup failed: \(error.localizedDescription, privacy: .public)")
self.logger
.warning("exec approvals socket cleanup failed: \(error.localizedDescription, privacy: .public)")
}
}
}
@@ -726,7 +727,8 @@ private final class ExecApprovalsSocketServer: @unchecked Sendable {
try ExecApprovalsSocketPathGuard.hardenParentDirectory(for: self.socketPath)
try ExecApprovalsSocketPathGuard.removeExistingSocket(at: self.socketPath)
} catch {
self.logger.error("exec approvals socket path hardening failed: \(error.localizedDescription, privacy: .public)")
self.logger
.error("exec approvals socket path hardening failed: \(error.localizedDescription, privacy: .public)")
close(fd)
return -1
}

View File

@@ -22,17 +22,17 @@ enum HostEnvSecurityPolicy {
"PS4",
"GCONV_PATH",
"IFS",
"SSLKEYLOGFILE"
"SSLKEYLOGFILE",
]
static let blockedOverrideKeys: Set<String> = [
"HOME",
"ZDOTDIR"
"ZDOTDIR",
]
static let blockedPrefixes: [String] = [
"DYLD_",
"LD_",
"BASH_FUNC_"
"BASH_FUNC_",
]
}