mirror of
https://github.com/apple/container.git
synced 2026-09-28 01:46:25 -04:00
Validate container ID from XPC requests (#1956)
Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
This commit is contained in:
@@ -70,7 +70,10 @@ extension Application {
|
||||
progress.start()
|
||||
|
||||
let id = Utility.createContainerID(name: self.managementFlags.name)
|
||||
try Utility.validEntityName(id)
|
||||
|
||||
guard ManagedContainer.nameValid(id) else {
|
||||
throw ContainerizationError(.invalidArgument, message: "container ID \(id) is not a valid container ID")
|
||||
}
|
||||
|
||||
let ck = try await Utility.containerConfigFromFlags(
|
||||
id: id,
|
||||
|
||||
@@ -80,7 +80,9 @@ extension Application {
|
||||
}
|
||||
progress.start()
|
||||
|
||||
try Utility.validEntityName(id)
|
||||
guard ManagedContainer.nameValid(id) else {
|
||||
throw ContainerizationError(.invalidArgument, message: "container ID \(id) is not a valid container ID")
|
||||
}
|
||||
|
||||
// Check if container with id already exists.
|
||||
let client = ContainerClient()
|
||||
|
||||
Reference in New Issue
Block a user