mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-04 18:13:44 +00:00
lanscaping: don't link osuser package
-rwxr-xr-x@ 1 bradfitz staff 9921858 Jan 11 14:10 /Users/bradfitz/bin/tailscaled.min -rwxr-xr-x@ 1 bradfitz staff 9830552 Jan 11 14:10 /Users/bradfitz/bin/tailscaled.minlinux Change-Id: Ia2d71e8a92e7df47d9c84f06833a481cb6b83039 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
e4fdbc3ff1
commit
c781951fdd
@ -102,7 +102,6 @@ tailscale.com/cmd/tailscaled dependencies: (generated by github.com/tailscale/de
|
||||
tailscale.com/util/multierr from tailscale.com/cmd/tailscaled+
|
||||
tailscale.com/util/must from tailscale.com/util/zstdframe
|
||||
tailscale.com/util/nocasemaps from tailscale.com/types/ipproto
|
||||
tailscale.com/util/osuser from tailscale.com/ipn/ipnlocal+
|
||||
tailscale.com/util/rands from tailscale.com/ipn/ipnlocal+
|
||||
tailscale.com/util/set from tailscale.com/control/controlclient+
|
||||
tailscale.com/util/singleflight from tailscale.com/control/controlclient
|
||||
|
@ -71,7 +71,6 @@ import (
|
||||
"tailscale.com/util/goroutines"
|
||||
"tailscale.com/util/mak"
|
||||
"tailscale.com/util/multierr"
|
||||
"tailscale.com/util/osuser"
|
||||
"tailscale.com/util/rands"
|
||||
"tailscale.com/util/set"
|
||||
"tailscale.com/util/slicesx"
|
||||
@ -4217,16 +4216,7 @@ func (b *LocalBackend) operatorUserName() string {
|
||||
// OperatorUserID returns the current pref's OperatorUser's ID (in
|
||||
// os/user.User.Uid string form), or the empty string if none.
|
||||
func (b *LocalBackend) OperatorUserID() string {
|
||||
opUserName := b.operatorUserName()
|
||||
if opUserName == "" {
|
||||
return ""
|
||||
}
|
||||
u, err := osuser.LookupByUsername(opUserName)
|
||||
if err != nil {
|
||||
b.logf("error looking up operator %q uid: %v", opUserName, err)
|
||||
return ""
|
||||
}
|
||||
return u.Uid
|
||||
return "0"
|
||||
}
|
||||
|
||||
// TestOnlyPublicKeys returns the current machine and node public
|
||||
|
@ -14,7 +14,6 @@ import (
|
||||
"tailscale.com/ipn/ipnauth"
|
||||
"tailscale.com/types/logger"
|
||||
"tailscale.com/util/ctxkey"
|
||||
"tailscale.com/util/osuser"
|
||||
"tailscale.com/version"
|
||||
)
|
||||
|
||||
@ -95,11 +94,7 @@ func (a *actor) Username() (string, error) {
|
||||
defer tok.Close()
|
||||
return tok.Username()
|
||||
case "darwin", "linux", "illumos", "solaris":
|
||||
u, err := osuser.LookupByUID("root")
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("lookup user: %w", err)
|
||||
}
|
||||
return u.Username, nil
|
||||
return "root", nil
|
||||
default:
|
||||
return "", errors.New("unsupported OS")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user