Unix Authentication Module
Overview
This is a module I created for an internal intranet project which allows users to authenticate to Drupal against the local /etc/passwd database or NIS domain of the web server a site runs on.
The site uses Drupal's distributed authentication system, and on your first login you are given a profile on the site. The module will also check your group membership and can be configured to assign your user to Drupal roles based on this.
It works by making use of helper scripts written in Perl which perform the actual checks. I can't recall all my reasons, but I believe I couldn't find any PHP libs to perform the tasks entirely within PHP. For a start, you need root to check shadow details, which is why the helper scripts need to be SUID root.
This module was written and tested for use on a Solaris 8 box, so isn't expected to work (or fail gracefully) on anything other than that without a little work. For a start, Solaris uses crypt based hashing whereas I think md5 is more common under Linux.
There are 4.6, 4.7 and 5.x versions which I've adapted as I've upgraded our site.
Drawbacks
One of the main issues I encountered was the fact that password changing fields would remain even when logged in using a distributed authentication. If set, then this would override the distributed auth and essentially turn it into a local account.
In the 5.x module I've used hook_form_alter to disable this. I don't know if this was available in earlier versions, but I never found it myself and it wasn't suggested when I asked for helo, so it wasn't implemented in the 4.x versions.
If you're trying to get this to work on another platform and would like my assistance feel free to get in touch via the contact form or internal PM.
Download
unixauth-4.7.x-1.x-dev.tar.gz
unixauth-4.6.x-1.x-dev.tar.gz
unixauth-5.x-dev.tar.gz