2 * Copyright (C) 1995, 1997-1999 Jeffrey A. Uphoff
10 #include <arpa/inet.h>
15 extern void my_svc_exit (void);
19 * Services SM_SIMU_CRASH requests.
22 sm_simu_crash_1_svc (void *argp, struct svc_req *rqstp)
24 static char *result = NULL;
26 #ifdef RESTRICTED_STATD
27 struct in_addr caller;
29 /* 1. Reject anyone not calling from 127.0.0.1.
30 * Ignore the my_name specified by the caller, and
31 * use "127.0.0.1" instead.
33 caller = svc_getcaller(rqstp->rq_xprt)->sin_addr;
34 if (caller.s_addr != htonl(INADDR_LOOPBACK)) {
36 "Call to statd from non-local host %s",
40 if (ntohs(svc_getcaller(rqstp->rq_xprt)->sin_port) >= 1024) {
42 "Call to statd-simu-crash from unprivileged port\n");
46 note (N_WARNING, "*** SIMULATING CRASH! ***");
52 #ifdef RESTRICTED_STATD
55 return ((void *)&result);