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.
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.