Move variable declarations from header to source
[platform/upstream/libtirpc.git] / src / svc.c
index b4a63d0..30f8930 100644 (file)
--- a/src/svc.c
+++ b/src/svc.c
@@ -60,6 +60,9 @@
 
 #define max(a, b) (a > b ? a : b)
 
+SVCXPRT **__svc_xports;
+int __svc_maxrec;
+
 /*
  * The services list
  * Each entry represents a set of procedures (an rpc program).
@@ -77,9 +80,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 +652,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 +664,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;
@@ -704,7 +708,7 @@ svc_getreq_common (fd)
        * If so, then break.
        */
       rwlock_rdlock (&svc_fd_lock);
-      
+
       if (xprt != __svc_xports[fd])
        {
          rwlock_unlock (&svc_fd_lock);
@@ -717,11 +721,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;
        }
     }