Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove TODO comments #781

Merged
merged 1 commit into from
Feb 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions internal/users/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,8 @@ func (m *Manager) UserByID(uid uint32) (types.UserEntry, error) {

// AllUsers returns all users.
func (m *Manager) AllUsers() ([]types.UserEntry, error) {
// TODO: I'm not sure if we should return temporary users here. On the one hand, they are usually not interesting to
// the user and would clutter the output of `getent passwd`. On the other hand, it might be surprising that some
// users are not returned by `getent passwd` and some apps might rely on all users being returned.
// We don't return temporary users here, because they are not interesting to the user and would clutter the output
// of `getent passwd`. Other tools should check `getpwnam`/`getpwuid` to check for conflicts, like `useradd` does.
usrs, err := m.cache.AllUsers()
if err != nil {
return nil, err
Expand Down Expand Up @@ -399,7 +398,7 @@ func (m *Manager) GroupByID(gid uint32) (types.GroupEntry, error) {

// AllGroups returns all groups.
func (m *Manager) AllGroups() ([]types.GroupEntry, error) {
// TODO: Same as for AllUsers, we might want to return temporary groups here.
// Same as in AllUsers, we don't return temporary groups here.
grps, err := m.cache.AllGroups()
if err != nil {
return nil, err
Expand All @@ -423,7 +422,6 @@ func (m *Manager) ShadowByName(username string) (types.ShadowEntry, error) {

// AllShadows returns all shadow entries.
func (m *Manager) AllShadows() ([]types.ShadowEntry, error) {
// TODO: Even less sure if we should return temporary users here.
usrs, err := m.cache.AllUsers()
if err != nil {
return nil, err
Expand Down
Loading