Imported Upstream version 0.2.5
[platform/upstream/libtirpc.git] / src / svc.c
index b4a63d0..8afd15d 100644 (file)
--- a/src/svc.c
+++ b/src/svc.c
@@ -77,9 +77,6 @@ static struct svc_callout
 
 extern rwlock_t svc_lock;
 extern rwlock_t svc_fd_lock;
-#ifdef HAVE_LIBGSSAPI
-extern struct svc_auth_ops svc_auth_gss_ops;
-#endif
 
 static struct svc_callout *svc_find (rpcprog_t, rpcvers_t,
                                     struct svc_callout **, char *);
@@ -652,6 +649,7 @@ svc_getreq_common (fd)
     {
       if (SVC_RECV (xprt, &msg))
        {
+         bool_t no_dispatch;
 
          /* now find the exported program and call it */
          struct svc_callout *s;
@@ -663,11 +661,14 @@ svc_getreq_common (fd)
          r.rq_proc = msg.rm_call.cb_proc;
          r.rq_cred = msg.rm_call.cb_cred;
          /* first authenticate the message */
-         if ((why = _authenticate (&r, &msg)) != AUTH_OK)
+         why = _gss_authenticate(&r, &msg, &no_dispatch);
+         if (why != AUTH_OK)
            {
              svcerr_auth (xprt, why);
              goto call_done;
            }
+         if (no_dispatch)
+           goto call_done;
          /* now match message with a registered service */
          prog_found = FALSE;
          low_vers = (rpcvers_t) - 1L;
@@ -717,11 +718,9 @@ svc_getreq_common (fd)
          SVC_DESTROY (xprt);
          break;
        }
-    else if ((xprt->xp_auth != NULL) 
-#ifdef HAVE_LIBGSSAPI
-               && (xprt->xp_auth->svc_ah_ops != &svc_auth_gss_ops)
-#endif
-       ) {
+    else if ((xprt->xp_auth != NULL) &&
+            (xprt->xp_auth->svc_ah_private == NULL))
+       {
          xprt->xp_auth = NULL;
        }
     }