Comment 1 for bug 422052

Revision history for this message
Martin Pitt (pitti) wrote : Re: Menu should list users if fewer than 6 are on the system

Does this really need to come from gdm? We can certainly add a d-bus call there, but why not just iterate over getpwent() and filter out UIDs < 500 (the system users) and >= 65534 (nobody)? That's more or less what gdm does as well.

In shell, you can do that with

  getent passwd | FS=: awk -F: '($3 >= 500 && $3 < 65534) { print }'

but in C, using getpwent() is more efficient.