DUNEX Auth
DUNEX Auth is a native D toolkit to manage POSIX/UNIX authentication
DUNEX Auth supports:
- Reading and manipulating
/etc/passwd
and/etc/shadow
- Comparison and creation of password hashes
- Creation of compatible UNIX salts for
crypt
libcrypt is neccesary for DUNEX Auth to work.
Opening a database
// dunex.auth.passwd
// Open password database read-only.
auto db = PasswdDB.openro();
// Find the entry for the root user
auto entry = db.find("root");
// isInShadow returns true if the password is present in the shadow file
writeln(entry.isInShadow());