X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fstatd%2Fstatd.c;h=6da2ab283d145284d2f919e7c3ec3faf35933463;hp=ea985e6877d12f19cb83a702d805e5c68d217605;hb=27a49079b03316eebcbc74197b73988b01b58ecc;hpb=5835b1eec5a1f1e463c0762c510c6643fa2bff62 diff --git a/utils/statd/statd.c b/utils/statd/statd.c index ea985e6..6da2ab2 100644 --- a/utils/statd/statd.c +++ b/utils/statd/statd.c @@ -75,7 +75,6 @@ static struct option longopts[] = }; extern void sm_prog_1 (struct svc_req *, register SVCXPRT *); -extern int statd_get_socket(void); static void load_state_number(void); #ifdef SIMULATIONS @@ -89,9 +88,11 @@ extern void simulator (int, char **); static void sm_prog_1_wrapper (struct svc_req *rqstp, register SVCXPRT *transp) { + struct sockaddr_in *sin = nfs_getrpccaller_in(transp); + /* remote host authorization check */ - if (!check_default("statd", svc_getcaller(transp), - rqstp->rq_proc, SM_PROG)) { + if (sin->sin_family == AF_INET && + !check_default("statd", sin, rqstp->rq_proc, SM_PROG)) { svcerr_auth (transp, AUTH_FAILED); return; } @@ -477,7 +478,8 @@ int main (int argc, char **argv) } /* Make sure we have a privilege port for calling into the kernel */ - statd_get_socket(); + if (statd_get_socket() < 0) + exit(1); /* If sm-notify didn't take all the state files, load * state information into our notify-list so we can