]> Cypherpunks.ru repositories - gostls13.git/commit
os/user: lookup Linux users and groups via systemd userdb
authorAnanth Bhaskararaman <antsub@gmail.com>
Wed, 22 Mar 2023 05:37:43 +0000 (05:37 +0000)
committerGopher Robot <gobot@golang.org>
Thu, 23 Mar 2023 17:32:05 +0000 (17:32 +0000)
commit1596d71255f3c19a27600e751592079dae46bf40
tree2318c54a9adeb3ae7105d422b0422b2e113011c6
parent0aa14fca8c639c9ceba264dbf0d82bd53306aeaa
os/user: lookup Linux users and groups via systemd userdb

Fetch usernames and groups via systemd userdb if available.
Otherwise fall back to parsing /etc/passwd, etc.

Fixes #38810

Co-authored-by: Michael Stapelberg <stapelberg@google.com>
Change-Id: Iff6ffc54feec6b6cec241b89e362c2285c8c0454
GitHub-Last-Rev: 1a627cc9a18063f5d274bb96113947cd4d952e5a
GitHub-Pull-Request: golang/go#57458
Reviewed-on: https://go-review.googlesource.com/c/go/+/459455
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
src/os/user/listgroups_unix.go
src/os/user/lookup_unix.go
src/os/user/user.go
src/os/user/userdbclient.go [new file with mode: 0644]
src/os/user/userdbclient_linux.go [new file with mode: 0644]
src/os/user/userdbclient_linux_test.go [new file with mode: 0644]
src/os/user/userdbclient_stub.go [new file with mode: 0644]