Skip to content

Commit b0c5187

Browse files
authored
Remove TODO comments (#781)
2 parents c6cdb8a + d5a7f56 commit b0c5187

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

internal/users/manager.go

+3-5
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,8 @@ func (m *Manager) UserByID(uid uint32) (types.UserEntry, error) {
356356

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

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

424423
// AllShadows returns all shadow entries.
425424
func (m *Manager) AllShadows() ([]types.ShadowEntry, error) {
426-
// TODO: Even less sure if we should return temporary users here.
427425
usrs, err := m.cache.AllUsers()
428426
if err != nil {
429427
return nil, err

0 commit comments

Comments
 (0)