X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=utils%2Fmountd%2Fmount_dispatch.c;h=199fcece4f4682fb51e27dff87e42847b2096a47;hb=9ccfe0fa5a43dfc4453b09e328565a6c8f999fe4;hp=cee19810476d1270918934c4e2c826887a89aab6;hpb=8b7ad01b14df1e7529b9ba8a1ea17df0d6004ef9;p=nfs-utils.git diff --git a/utils/mountd/mount_dispatch.c b/utils/mountd/mount_dispatch.c index cee1981..199fcec 100644 --- a/utils/mountd/mount_dispatch.c +++ b/utils/mountd/mount_dispatch.c @@ -4,7 +4,13 @@ * Copyright (C) 1995 Olaf Kirch */ -#include "config.h" +#ifdef HAVE_CONFIG_H +#include +#endif + +#ifdef HAVE_TCP_WRAPPER +#include "tcpwrapper.h" +#endif #include "mountd.h" #include "rpcmisc.h" @@ -64,6 +70,16 @@ mount_dispatch(struct svc_req *rqstp, SVCXPRT *transp) { union mountd_arguments argument; union mountd_results result; +#ifdef HAVE_TCP_WRAPPER + struct sockaddr_in *sin = nfs_getrpccaller_in(transp); + + /* remote host authorization check */ + if (sin->sin_family == AF_INET && + !check_default("mountd", sin, rqstp->rq_proc, MOUNTPROG)) { + svcerr_auth (transp, AUTH_FAILED); + return; + } +#endif rpc_dispatch(rqstp, transp, dtable, number_of(dtable), &argument, &result);