Apparently there is a function (getpwnam) that given a username, will return the appropriate entry in
/etc/passwd with the other details for that user (shell, uid, gid, etc.).
However, I have no idea how to get that function working with the shadow password file (
/etc/shadow). Is this possible? If it helps, the application will be running as