MCPcopy
hub / github.com/lxc/incus / HandleValid

Method HandleValid

internal/server/seccomp/seccomp.go:2291–2310  ·  view source on GitHub ↗

HandleValid handles a valid seccomp notifier message.

(fd int, siov *Iovec, findPID func(pid int32, s *state.State) (Instance, error))

Source from the content-addressed store, hash-verified

2289
2290// HandleValid handles a valid seccomp notifier message.
2291func (srv *Server) HandleValid(fd int, siov *Iovec, findPID func(pid int32, s *state.State) (Instance, error)) error {
2292 defer siov.PutSeccompIovec()
2293
2294 c, err := findPID(int32(siov.msg.monitor_pid), srv.s)
2295 if err != nil {
2296 _ = siov.SendSeccompIovec(fd, 0, seccompUserNotifFlagContinue)
2297
2298 logger.Errorf("Failed to find container for monitor %d", siov.msg.monitor_pid)
2299 return err
2300 }
2301
2302 errno := srv.handleSyscall(c, siov)
2303
2304 err = siov.SendSeccompIovec(fd, errno, 0)
2305 if err != nil {
2306 return err
2307 }
2308
2309 return nil
2310}
2311
2312// Stop stops a seccomp server.
2313func (srv *Server) Stop() error {

Callers 1

NewSeccompServerFunction · 0.95

Implementers 3

ProtocolSimpleStreamsclient/simplestreams.go
ProtocolIncusclient/incus.go
ProtocolOCIclient/oci.go

Calls 4

handleSyscallMethod · 0.95
ErrorfFunction · 0.92
PutSeccompIovecMethod · 0.80
SendSeccompIovecMethod · 0.80

Tested by

no test coverage detected