Add login test program
So... it essentially mimics what /etc/shadow does. This might be easier than LDAP.
I was going to just use debian's login system, but realised some things:
POSIX C has a bunch of helpful functions that essentially parse /etc/passwd and provide a structure with all the relevant fields, like "pw_passwd".
Of course, the "pw_passwd" entry is always empty... because someone realised that storing hashes of passwords in /etc/passwd was not great :P
So /etc/passwd actually has no password information and is world readable, but /etc/shadow has everything (and is root readable only).
There are no wrapper functions for /etc/shadow because... user space programs aren't really meant to run as root.
Essentially linux was designed so that non-root programs can't fuck about with shell accounts. If you want to fuck about with shell accounts
you have to run as root and manually implement the parsing of /etc/shadow.
But I figured there was nothing stopping us from just making our own "shadow" file with hashed passwords.
That way people don't even need shell accounts. Well... the administrator needs to modify the file somehow...
LDAP probably gives more flexibility. It's probably better. Although it's also bloated.
To test the program, use the login "sonic" and the password "HEDGEHOG" (or something else to test failure).
UCC git Repository :: git.ucc.asn.au