When I submitted a patch for Apache's auth module to make it work
with /etc/passwd, they politely declined it. Apparently, they
had received dozens of submissions like this, but were against
it in principle. Using "system" passwords for Web-based
management is a capital-B Bad Idea, for security reasons, and
many others.
Now, this was some time ago, back when /etc/passwd actually
had "passwords" in it. Most systems now use /etc/shadow
to store the encrypted passwords, which means that the
CGI user cannot actually read this information. Otherwise,
you would have to run your CGI as root, which is an
Exceptionally Bad Idea.
As
wog was kind enough to mention, PAM might give you the
access you require, and I would certainly look into using
this.
Remember, though, that disclosing your system password is
highly dangerous. If, for some reason, a user's password
were captured, and this user happened to have "sudo" access
(a utility to run root-level commands and/or a root shell),
then you are exposing yourself to a world of hurt. All it
would take is one of your admins to log in to your Web page
from a cable modem connection which happened to have a
"sniffer" on it, and your system would be, as
they say, chown'd. As in, no longer yours.
Perhaps if you could describe the nature of your application,
some ways of addressing this particular requirement could be
investigated.