You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/ipn/ipnauth
Alex Chan 304dabce17 ipn/ipnauth: fix a null pointer panic in GetConnIdentity
When running integration tests on macOS, we get a panic from a nil
pointer dereference when calling `ci.creds.PID()`.

This panic occurs because the `ci.creds != nil` check is insufficient
after a recent refactoring (c45f881) that changed `ci.creds` from a
pointer to the `PeerCreds` interface. Now `ci.creds` always compares as
non-nil, so we enter this block even when the underlying value is nil.

The integration tests fail on macOS when `peercred.Get()` returns the
error `unix.GetsockoptInt: socket is not connected`. This error isn't
new, and the previous code was ignoring it correctly.

Since we trust that `peercred` returns either a usable value or an error,
checking for a nil error is a sufficient and correct gate to prevent the
method call and avoid the panic.

Fixes #17421

Signed-off-by: Alex Chan <alexc@tailscale.com>
3 months ago
..
access.go ipn/ipnauth,util/syspolicy: improve comments 12 months ago
actor.go control/controlclient, ipn: add client audit logging (#14950) 10 months ago
actor_windows.go ipn/ipnauth: implement WindowsActor 11 months ago
ipnauth.go feature/featuretags, all: add build features, use existing ones in more places 4 months ago
ipnauth_omit_unixsocketidentity.go feature/featuretags, all: add build features, use existing ones in more places 4 months ago
ipnauth_unix_creds.go ipn/ipnauth: fix a null pointer panic in GetConnIdentity 3 months ago
ipnauth_windows.go ipn/ipnauth: implement WindowsActor 11 months ago
policy.go util/syspolicy: finish plumbing policyclient, add feature/syspolicy, move global impl 5 months ago
self.go ipn/{ipnauth,ipnlocal,localapi}: make EditPrefs return an error if changing exit node is restricted by policy 6 months ago
test_actor.go ipn/ipn{auth,server}: update ipnauth.Actor to carry a context 11 months ago