3e961a6
*** process_request.c.orig	2011-11-08 14:20:50.000000000 +0100
3e961a6
--- process_request.c	2011-11-08 17:15:21.000000000 +0100
3e961a6
***************
3e961a6
*** 539,564 ****
3e961a6
  
3e961a6
      if (ENABLE_TRUSTED_AUTH == TRUE )
3e961a6
        rc = 0;  /* bypass the authentication of the user--trust the client completely */
3e961a6
!     else if(munge_on)
3e961a6
        {
3e961a6
!       /* If munge_on is true we will validate the connection now */
3e961a6
!       if ( request->rq_type == PBS_BATCH_AltAuthenUser)
3e961a6
          {
3e961a6
!         rc = req_altauthenuser(request);
3e961a6
!         if (rc == PBSE_NONE)
3e961a6
            {
3e961a6
!           conn_credent[sfds].timestamp = time_now;
3e961a6
!           svr_conn[sfds].cn_authen = PBS_NET_CONN_AUTHENTICATED;
3e961a6
            }
3e961a6
          return;
3e961a6
          }
3e961a6
        else
3e961a6
!         {
3e961a6
!         rc = authenticate_user(request, &conn_credent[sfds]);
3e961a6
!         }
3e961a6
        }
3e961a6
-     else if (svr_conn[sfds].cn_authen != PBS_NET_CONN_AUTHENTICATED)
3e961a6
-       rc = PBSE_BADCRED;
3e961a6
      else
3e961a6
        rc = authenticate_user(request, &conn_credent[sfds]);
3e961a6
  
3e961a6
--- 539,562 ----
3e961a6
  
3e961a6
      if (ENABLE_TRUSTED_AUTH == TRUE )
3e961a6
        rc = 0;  /* bypass the authentication of the user--trust the client completely */
3e961a6
!     else if (svr_conn[sfds].cn_authen != PBS_NET_CONN_AUTHENTICATED)
3e961a6
        {
3e961a6
!       if (munge_on && request->rq_type == PBS_BATCH_AltAuthenUser)
3e961a6
          {
3e961a6
!         /* If munge_on is true do the validation request now */
3e961a6
!         if (request->rq_ind.rq_authen.rq_port !=  svr_conn[sfds].cn_port)
3e961a6
!           {
3e961a6
!           req_reject(PBSE_IVALREQ, 0, request, NULL, "Unexpected request to authenticate an alternate connection");
3e961a6
!           }
3e961a6
!         else
3e961a6
            {
3e961a6
!           req_altauthenuser(request);
3e961a6
            }
3e961a6
          return;
3e961a6
          }
3e961a6
        else
3e961a6
!         rc = PBSE_BADCRED;
3e961a6
        }
3e961a6
      else
3e961a6
        rc = authenticate_user(request, &conn_credent[sfds]);
3e961a6
  
3e961a6
***************
3e961a6
*** 1032,1038 ****
3e961a6
        break;
3e961a6
  
3e961a6
      case PBS_BATCH_AltAuthenUser:
3e961a6
! 
3e961a6
        break;
3e961a6
  
3e961a6
      case PBS_BATCH_JobObit:
3e961a6
--- 1030,1036 ----
3e961a6
        break;
3e961a6
  
3e961a6
      case PBS_BATCH_AltAuthenUser:
3e961a6
!       req_reject(PBSE_IVALREQ, 0, request, NULL, "Unexpected request to authenticate at this point");
3e961a6
        break;
3e961a6
  
3e961a6
      case PBS_BATCH_JobObit:
3e961a6
*** req_getcred.c.orig	2011-11-08 17:27:36.000000000 +0100
3e961a6
--- req_getcred.c	2011-11-08 17:20:18.000000000 +0100
3e961a6
***************
3e961a6
*** 365,371 ****
3e961a6
  	  /* Something went wrong. We will have to depend on the parent
3e961a6
  	     to let everyone know */
3e961a6
  	  close(fd_pipe[1]);
3e961a6
! 	  exit(0);
3e961a6
  	  
3e961a6
  	  }
3e961a6
  
3e961a6
--- 365,371 ----
3e961a6
  	  /* Something went wrong. We will have to depend on the parent
3e961a6
  	     to let everyone know */
3e961a6
  	  close(fd_pipe[1]);
3e961a6
! 	  _exit(0);
3e961a6
  	  
3e961a6
  	  }
3e961a6
  
3e961a6
***************
3e961a6
*** 453,459 ****
3e961a6
  
3e961a6
    for (s = 0;s < PBS_NET_MAX_CONNECTIONS;++s)
3e961a6
      {
3e961a6
!     if (preq->rq_ind.rq_authen.rq_port != svr_conn[s].cn_port)
3e961a6
        {
3e961a6
        continue;
3e961a6
        }
3e961a6
--- 453,460 ----
3e961a6
  
3e961a6
    for (s = 0;s < PBS_NET_MAX_CONNECTIONS;++s)
3e961a6
      {
3e961a6
!     if (preq->rq_ind.rq_authen.rq_port != svr_conn[s].cn_port || 
3e961a6
!              svr_conn[preq->rq_conn].cn_addr != svr_conn[s].cn_addr)
3e961a6
        {
3e961a6
        continue;
3e961a6
        }