MCPcopy Create free account
hub / github.com/PasarGuard/node / wrapPermissionDeniedError

Function wrapPermissionDeniedError

backend/wireguard/manager.go:61–73  ·  view source on GitHub ↗
(action string, err error)

Source from the content-addressed store, hash-verified

59}
60
61func wrapPermissionDeniedError(action string, err error) error {
62 if err == nil {
63 return nil
64 }
65 if errors.Is(err, syscall.EPERM) || errors.Is(err, syscall.EACCES) {
66 return fmt.Errorf(
67 "%s: permission denied; WireGuard requires CAP_NET_ADMIN and kernel support on the host (if running in Docker, add NET_ADMIN and ensure the wireguard kernel module is available on the host): %w",
68 action,
69 err,
70 )
71 }
72 return err
73}
74
75// Manager handles WireGuard interface management using wgctrl
76type Manager struct {

Callers 2

InitializeWithPeersMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected