/[cvs]/ccvs/src/server.c
ViewVC logotype

Diff of /ccvs/src/server.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.450 by dprice, Mon Oct 3 19:33:45 2005 UTC revision 1.451 by bmurphy, Sun Oct 16 18:17:07 2005 UTC
# Line 109  static char *Pserver_Repos = NULL; Line 109  static char *Pserver_Repos = NULL;
109  # endif /* AUTH_SERVER_SUPPORT */  # endif /* AUTH_SERVER_SUPPORT */
110    
111  # ifdef HAVE_PAM  # ifdef HAVE_PAM
112    #   include <netdb.h> /* getnameinfo */
113  #   if defined(HAVE_SECURITY_PAM_APPL_H)  #   if defined(HAVE_SECURITY_PAM_APPL_H)
114  #     include <security/pam_appl.h>  #     include <security/pam_appl.h>
115  #   elif defined(HAVE_PAM_PAM_APPL_H)  #   elif defined(HAVE_PAM_PAM_APPL_H)
# Line 6891  check_pam_password (char **username, cha Line 6892  check_pam_password (char **username, cha
6892      int retval, err;      int retval, err;
6893      struct pam_conv conv = { cvs_pam_conv, 0 };      struct pam_conv conv = { cvs_pam_conv, 0 };
6894      char *pam_stage = "start";      char *pam_stage = "start";
6895        struct sockaddr peer;
6896        int len;
6897        char host[NI_MAXHOST];
6898    
6899        /* get the client's ip address */
6900        len = sizeof (peer);
6901        if (getpeername (STDIN_FILENO, &peer, &len) < 0)
6902        {
6903            printf ("E Fatal error, aborting.\n\
6904    error %s getpeername failed\n", strerror (errno));
6905            exit (EXIT_FAILURE);
6906        }
6907    
6908        /* convert the ip address to text */
6909        if (getnameinfo(&peer, len, host, NI_MAXHOST,
6910                                NULL, 0, NI_NUMERICHOST) < 0)
6911        {
6912            printf ("E Fatal error, aborting.\n\
6913    error %s getnameinfo failed\n", strerror (errno));
6914            exit (EXIT_FAILURE);
6915        }
6916    
6917      pam_username = *username;      pam_username = *username;
6918      pam_password = password;      pam_password = password;
# Line 6905  check_pam_password (char **username, cha Line 6927  check_pam_password (char **username, cha
6927      }      }
6928    
6929      if (retval == PAM_SUCCESS)      if (retval == PAM_SUCCESS)
6930        {
6931            pam_stage = "set remote host ip";
6932            retval = pam_set_item (pamh, PAM_RHOST, host);
6933        }
6934    
6935        if (retval == PAM_SUCCESS)
6936      {      {
6937          pam_stage = "authenticate";          pam_stage = "authenticate";
6938          retval = pam_authenticate (pamh, 0);          retval = pam_authenticate (pamh, 0);

Legend:
Removed from v.1.450  
changed lines
  Added in v.1.451

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26