diff options
Diffstat (limited to 'src/rpcb_svc.c')
-rw-r--r-- | src/rpcb_svc.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/rpcb_svc.c b/src/rpcb_svc.c index 0514ba5..e350f85 100644 --- a/src/rpcb_svc.c +++ b/src/rpcb_svc.c @@ -75,6 +75,7 @@ rpcb_service_3(struct svc_req *rqstp, SVCXPRT *transp) char *result; xdrproc_t xdr_argument, xdr_result; void *(*local) __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t)); + rpcprog_t setprog = 0; rpcbs_procinfo(RPCBVERS_3_STAT, rqstp->rq_proc); @@ -88,7 +89,7 @@ rpcb_service_3(struct svc_req *rqstp, SVCXPRT *transp) fprintf(stderr, "RPCBPROC_NULL\n"); #endif /* This call just logs, no actual checks */ - check_access(transp, rqstp->rq_proc, NULL, RPCBVERS); + check_access(transp, rqstp->rq_proc, 0, RPCBVERS); (void) svc_sendreply(transp, (xdrproc_t)xdr_void, (char *)NULL); return; @@ -166,7 +167,13 @@ rpcb_service_3(struct svc_req *rqstp, SVCXPRT *transp) (void) fprintf(stderr, "rpcbind: could not decode\n"); return; } - if (!check_access(transp, rqstp->rq_proc, &argument, RPCBVERS)) { + + if (rqstp->rq_proc == RPCBPROC_SET + || rqstp->rq_proc == RPCBPROC_UNSET + || rqstp->rq_proc == RPCBPROC_GETADDR) + setprog = argument.rpcbproc_set_3_arg.r_prog; + + if (!check_access(transp, rqstp->rq_proc, setprog, RPCBVERS)) { svcerr_weakauth(transp); goto done; } |