@@ -356,9 +356,8 @@ func (m *Manager) UserByID(uid uint32) (types.UserEntry, error) {
356
356
357
357
// AllUsers returns all users.
358
358
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.
362
361
usrs , err := m .cache .AllUsers ()
363
362
if err != nil {
364
363
return nil , err
@@ -399,7 +398,7 @@ func (m *Manager) GroupByID(gid uint32) (types.GroupEntry, error) {
399
398
400
399
// AllGroups returns all groups.
401
400
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.
403
402
grps , err := m .cache .AllGroups ()
404
403
if err != nil {
405
404
return nil , err
@@ -423,7 +422,6 @@ func (m *Manager) ShadowByName(username string) (types.ShadowEntry, error) {
423
422
424
423
// AllShadows returns all shadow entries.
425
424
func (m * Manager ) AllShadows () ([]types.ShadowEntry , error ) {
426
- // TODO: Even less sure if we should return temporary users here.
427
425
usrs , err := m .cache .AllUsers ()
428
426
if err != nil {
429
427
return nil , err
0 commit comments