]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/mountd/mount_dispatch.c
Use 65534 for anon uid/gid rather than -2
[nfs-utils.git] / utils / mountd / mount_dispatch.c
index cee19810476d1270918934c4e2c826887a89aab6..f00c0c59316fe30454f1f3edb819e44b0748c46a 100644 (file)
@@ -4,7 +4,13 @@
  * Copyright (C) 1995 Olaf Kirch <okir@monad.swb.de>
  */
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef HAVE_TCP_WRAPPER
+#include "tcpwrapper.h"
+#endif
 
 #include "mountd.h"
 #include "rpcmisc.h"
@@ -65,6 +71,15 @@ mount_dispatch(struct svc_req *rqstp, SVCXPRT *transp)
        union mountd_arguments  argument;
        union mountd_results    result;
 
+#ifdef HAVE_TCP_WRAPPER
+       /* remote host authorization check */
+       if (!check_default("mountd", svc_getcaller(transp),
+                          rqstp->rq_proc, MOUNTPROG)) {
+               svcerr_auth (transp, AUTH_FAILED);
+               return;
+       }
+#endif
+
        rpc_dispatch(rqstp, transp, dtable, number_of(dtable),
                        &argument, &result);
 }