X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Frquotad%2Frquota_svc.c;h=f55c192762bf3aab0975994a05896f2f691e94cc;hp=81b692845e2da0e6e39524a7238b537ce53ac085;hb=5591654c71e7e2e5959c8718a7e880516b9081e8;hpb=764e46f5c5fe1a6e376f4cd350424f33afc9e838 diff --git a/utils/rquotad/rquota_svc.c b/utils/rquotad/rquota_svc.c index 81b6928..f55c192 100644 --- a/utils/rquotad/rquota_svc.c +++ b/utils/rquotad/rquota_svc.c @@ -34,6 +34,7 @@ #include #include #include +#include #ifdef __STDC__ #define SIG_PF void(*)(int) @@ -66,7 +67,7 @@ static void rquotaprog_1(struct svc_req *rqstp, register SVCXPRT *transp) #ifdef HAVE_TCP_WRAPPER /* remote host authorization check */ if (!check_default("rquotad", svc_getcaller(transp), - rqstp->rq_proc, (u_long) 0)) { + rqstp->rq_proc, RQUOTAPROG)) { svcerr_auth (transp, AUTH_FAILED); return; } @@ -138,6 +139,15 @@ static void rquotaprog_2(struct svc_req *rqstp, register SVCXPRT *transp) xdrproc_t xdr_argument, xdr_result; char *(*local)(char *, struct svc_req *); +#ifdef HAVE_TCP_WRAPPER + /* remote host authorization check */ + if (!check_default("rquotad", svc_getcaller(transp), + rqstp->rq_proc, RQUOTAPROG)) { + svcerr_auth (transp, AUTH_FAILED); + return; + } +#endif + /* * Don't bother authentication for NULLPROC. */ @@ -203,6 +213,9 @@ int main(int argc, char **argv) openlog("rquota", LOG_PID, LOG_DAEMON); + /* WARNING: the following works on Linux and SysV, but not BSD! */ + signal(SIGCHLD, SIG_IGN); + transp = svcudp_create(RPC_ANYSOCK); if (transp == NULL) { syslog(LOG_ERR, "cannot create udp service.");