mirror of
https://github.com/aljazceru/kata-containers.git
synced 2026-01-06 16:04:26 +01:00
socket: Enforce socket length
A Unix domain socket is limited to 107 usable bytes on Linux. However, not all code creating socket paths was checking for this limits. Created a new `utils.BuildSocketPath()` function (with tests) to encapsulate the logic and updated all code creating sockets to use it. Fixes #268. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
@@ -739,12 +739,17 @@ func (h *hyper) register() error {
|
||||
}
|
||||
defer h.disconnect()
|
||||
|
||||
console, err := h.sandbox.hypervisor.getSandboxConsole(h.sandbox.id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
registerVMOptions := &proxyClient.RegisterVMOptions{
|
||||
Console: h.sandbox.hypervisor.getSandboxConsole(h.sandbox.id),
|
||||
Console: console,
|
||||
NumIOStreams: 0,
|
||||
}
|
||||
|
||||
_, err := h.client.RegisterVM(h.sandbox.id, h.sockets[0].HostPath,
|
||||
_, err = h.client.RegisterVM(h.sandbox.id, h.sockets[0].HostPath,
|
||||
h.sockets[1].HostPath, registerVMOptions)
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user