X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=utils%2Fstatd%2Fstatd.c;h=6da2ab283d145284d2f919e7c3ec3faf35933463;hb=515695dc49c168a2e4c5f3ad93004c1b13e27c68;hp=8337b64b993918fb8704daeb49cae711447779d3;hpb=dda3455d8b96a7b078bc00c113e1af15ed421d5b;p=nfs-utils.git diff --git a/utils/statd/statd.c b/utils/statd/statd.c index 8337b64..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; } @@ -148,7 +149,7 @@ static void log_modes(void) * help the occasional admin. */ static void -usage() +usage(void) { fprintf(stderr,"usage: %s [options]\n", name_p); fprintf(stderr," -h, -?, --help Print this help screen.\n"); @@ -445,7 +446,7 @@ int main (int argc, char **argv) /* Child. */ - log_init (name_p,version_p); + log_init (/*name_p,version_p*/); log_modes(); @@ -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