diff options
| author | Andrew Lytvynov <awly@tailscale.com> | 2026-04-24 15:53:27 -0700 |
|---|---|---|
| committer | Andrew Lytvynov <awly@tailscale.com> | 2026-04-24 15:53:27 -0700 |
| commit | 4d91c36b9ce0228c1a348088d761d8f213e06287 (patch) | |
| tree | e0f0fd0f9cbfbc131b7c456cabf4809f8c15cf94 /util/pidowner/pidowner_linux.go | |
| parent | 1b40911611b37947bdc905dec30b2914af540920 (diff) | |
| download | tailscale-awly/deadcode-pidowner.tar.xz tailscale-awly/deadcode-pidowner.zip | |
util/pidowner: remove unused packageawly/deadcode-pidowner
Added in 2020, this appears to be unused.
Updates #cleanup
Diffstat (limited to 'util/pidowner/pidowner_linux.go')
| -rw-r--r-- | util/pidowner/pidowner_linux.go | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/util/pidowner/pidowner_linux.go b/util/pidowner/pidowner_linux.go deleted file mode 100644 index f3f5cd97d..000000000 --- a/util/pidowner/pidowner_linux.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Tailscale Inc & contributors -// SPDX-License-Identifier: BSD-3-Clause - -package pidowner - -import ( - "fmt" - "os" - "strings" - - "tailscale.com/util/lineiter" -) - -func ownerOfPID(pid int) (userID string, err error) { - file := fmt.Sprintf("/proc/%d/status", pid) - for lr := range lineiter.File(file) { - line, err := lr.Value() - if err != nil { - if os.IsNotExist(err) { - return "", ErrProcessNotFound - } - return "", err - } - if len(line) < 4 || string(line[:4]) != "Uid:" { - continue - } - f := strings.Fields(string(line)) - if len(f) >= 2 { - userID = f[1] // real userid - } - } - if userID == "" { - return "", fmt.Errorf("missing Uid line in %s", file) - } - return userID, nil -} |
