title: How to check login credentials in linux when not running as root?
body: <p>I have written a cgi-bin application in C that runs in a browser and allows the user to open an interactive shell and view &amp; edit files on a Linux machine. It runs as the standard apache "www-data" user. I just added a login screen to it where the user types in their name and password (in a form) but I cannot authenticate the user using <strong>getspnam</strong> since this function only works when running as root.</p>
  
  <p>What options do I have to check the login credentials of a user when not running as root?</p>
  
  <p>PS: In my interactive shell I can type "su root" and then type in my password and it does elevate to root fine so it obviously can be done interactively.</p>