*/
#include "config.h"
+#ifdef HAVE_TCP_WRAPPER
+#include "tcpwrapper.h"
+#endif
+
#include <unistd.h>
#include <rpc/rpc.h>
#include "rquota.h"
#include <sys/socket.h>
#include <netinet/in.h>
#include <syslog.h>
+#include <signal.h>
#ifdef __STDC__
#define SIG_PF void(*)(int)
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.
*/
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.
*/
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.");