Skip to content

Commit 406c48e

Browse files
committed
skip "tagged-devices" in userExists check
Currently, the special "tagged-devices" user (which exists for any tagged devices in the tailnet) can own go links. This change permits tagged devices to continue to create go links, but skips over them for ownership checks, allowing any human user can take over ownership. Fixes #37 Signed-off-by: Will Norris <[email protected]>
1 parent 442e344 commit 406c48e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

golink.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,8 @@ func currentUser(r *http.Request) (string, error) {
457457

458458
// userExists returns whether a user exists with the specified login in the current tailnet.
459459
func userExists(ctx context.Context, login string) (bool, error) {
460+
const userTaggedDevices = "tagged-devices" // owner of tagged devices
461+
460462
if devMode() {
461463
// in dev mode, just assume the user exists
462464
return true, nil
@@ -466,6 +468,9 @@ func userExists(ctx context.Context, login string) (bool, error) {
466468
return false, err
467469
}
468470
for _, user := range st.User {
471+
if user.LoginName == userTaggedDevices {
472+
continue
473+
}
469474
if user.LoginName == login {
470475
return true, nil
471476
}

0 commit comments

Comments
 (0)