diff options
| author | Simon J. Gerraty <sjg@FreeBSD.org> | 2014-04-28 07:50:45 +0000 |
|---|---|---|
| committer | Simon J. Gerraty <sjg@FreeBSD.org> | 2014-04-28 07:50:45 +0000 |
| commit | 3b8f08459569bf0faa21473e5cec2491e95c9349 (patch) | |
| tree | 80f45dd81ca716bcd7ca9674581e1fc40b93cd34 /usr.sbin/rpc.lockd | |
| parent | 9d2ab4a62d6733c45958627ac113bdbd818d1e2a (diff) | |
| parent | b2ba55951383498f252746f618d513139da06e8e (diff) | |
Notes
Diffstat (limited to 'usr.sbin/rpc.lockd')
| -rw-r--r-- | usr.sbin/rpc.lockd/kern.c | 7 | ||||
| -rw-r--r-- | usr.sbin/rpc.lockd/lock_proc.c | 186 | ||||
| -rw-r--r-- | usr.sbin/rpc.lockd/lockd.c | 10 | ||||
| -rw-r--r-- | usr.sbin/rpc.lockd/rpc.lockd.8 | 6 |
4 files changed, 52 insertions, 157 deletions
diff --git a/usr.sbin/rpc.lockd/kern.c b/usr.sbin/rpc.lockd/kern.c index 4775ab6af3510..759e1473e6e7c 100644 --- a/usr.sbin/rpc.lockd/kern.c +++ b/usr.sbin/rpc.lockd/kern.c @@ -97,8 +97,7 @@ nfslockdans(int vers, struct lockd_ans *ansp) #define d_args (debug_level > 2) static const char * -from_addr(saddr) - struct sockaddr *saddr; +from_addr(struct sockaddr *saddr) { static char inet_buf[INET6_ADDRSTRLEN]; @@ -231,9 +230,7 @@ err: } void -set_auth(cl, xucred) - CLIENT *cl; - struct xucred *xucred; +set_auth(CLIENT *cl, struct xucred *xucred) { int ngroups; diff --git a/usr.sbin/rpc.lockd/lock_proc.c b/usr.sbin/rpc.lockd/lock_proc.c index 044966486d223..8884ad94811e0 100644 --- a/usr.sbin/rpc.lockd/lock_proc.c +++ b/usr.sbin/rpc.lockd/lock_proc.c @@ -76,9 +76,7 @@ static int addrcmp(struct sockaddr *, struct sockaddr *); * passed in as part of the called procedure specification */ static void -log_from_addr(fun_name, req) - const char *fun_name; - struct svc_req *req; +log_from_addr(const char *fun_name, struct svc_req *req) { struct sockaddr *addr; char hostname_buf[NI_MAXHOST]; @@ -99,8 +97,7 @@ log_from_addr(fun_name, req) * a debug subsystem. */ static void -log_netobj(obj) - netobj *obj; +log_netobj(netobj *obj) { char objvalbuffer[(sizeof(char)*2)*MAX_NETOBJ_SZ+2]; char objascbuffer[sizeof(char)*MAX_NETOBJ_SZ+1]; @@ -161,9 +158,7 @@ static rpcvers_t clnt_cache_vers[CLIENT_CACHE_SIZE]; static int clnt_cache_next_to_use = 0; static int -addrcmp(sa1, sa2) - struct sockaddr *sa1; - struct sockaddr *sa2; +addrcmp(struct sockaddr *sa1, struct sockaddr *sa2) { int len; void *p1, *p2; @@ -190,9 +185,7 @@ addrcmp(sa1, sa2) } CLIENT * -get_client(host_addr, vers) - struct sockaddr *host_addr; - rpcvers_t vers; +get_client(struct sockaddr *host_addr, rpcvers_t vers) { CLIENT *client; struct timeval retry_time, time_now; @@ -327,10 +320,7 @@ get_client(host_addr, vers) * without expecting a result */ void -transmit_result(opcode, result, addr) - int opcode; - nlm_res *result; - struct sockaddr *addr; +transmit_result(int opcode, nlm_res *result, struct sockaddr *addr) { static char dummy; CLIENT *cli; @@ -358,10 +348,7 @@ transmit_result(opcode, result, addr) * without expecting a result */ void -transmit4_result(opcode, result, addr) - int opcode; - nlm4_res *result; - struct sockaddr *addr; +transmit4_result(int opcode, nlm4_res *result, struct sockaddr *addr) { static char dummy; CLIENT *cli; @@ -385,11 +372,8 @@ transmit4_result(opcode, result, addr) /* * converts a struct nlm_lock to struct nlm4_lock */ -static void nlmtonlm4(struct nlm_lock *, struct nlm4_lock *); static void -nlmtonlm4(arg, arg4) - struct nlm_lock *arg; - struct nlm4_lock *arg4; +nlmtonlm4(struct nlm_lock *arg, struct nlm4_lock *arg4) { arg4->caller_name = arg->caller_name; arg4->fh = arg->fh; @@ -432,9 +416,7 @@ nlmtonlm4(arg, arg4) * Notes: */ nlm_testres * -nlm_test_1_svc(arg, rqstp) - nlm_testargs *arg; - struct svc_req *rqstp; +nlm_test_1_svc(nlm_testargs *arg, struct svc_req *rqstp) { static nlm_testres res; struct nlm4_lock arg4; @@ -466,9 +448,7 @@ nlm_test_1_svc(arg, rqstp) } void * -nlm_test_msg_1_svc(arg, rqstp) - nlm_testargs *arg; - struct svc_req *rqstp; +nlm_test_msg_1_svc(nlm_testargs *arg, struct svc_req *rqstp) { nlm_testres res; static char dummy; @@ -523,9 +503,7 @@ nlm_test_msg_1_svc(arg, rqstp) * Notes: *** grace period support missing */ nlm_res * -nlm_lock_1_svc(arg, rqstp) - nlm_lockargs *arg; - struct svc_req *rqstp; +nlm_lock_1_svc(nlm_lockargs *arg, struct svc_req *rqstp) { static nlm_res res; struct nlm4_lockargs arg4; @@ -547,9 +525,7 @@ nlm_lock_1_svc(arg, rqstp) } void * -nlm_lock_msg_1_svc(arg, rqstp) - nlm_lockargs *arg; - struct svc_req *rqstp; +nlm_lock_msg_1_svc(nlm_lockargs *arg, struct svc_req *rqstp) { static nlm_res res; struct nlm4_lockargs arg4; @@ -578,9 +554,7 @@ nlm_lock_msg_1_svc(arg, rqstp) * Notes: */ nlm_res * -nlm_cancel_1_svc(arg, rqstp) - nlm_cancargs *arg; - struct svc_req *rqstp; +nlm_cancel_1_svc(nlm_cancargs *arg, struct svc_req *rqstp) { static nlm_res res; struct nlm4_lock arg4; @@ -602,9 +576,7 @@ nlm_cancel_1_svc(arg, rqstp) } void * -nlm_cancel_msg_1_svc(arg, rqstp) - nlm_cancargs *arg; - struct svc_req *rqstp; +nlm_cancel_msg_1_svc(nlm_cancargs *arg, struct svc_req *rqstp) { static nlm_res res; struct nlm4_lock arg4; @@ -633,9 +605,7 @@ nlm_cancel_msg_1_svc(arg, rqstp) * re-try an unlock that has already succeeded. */ nlm_res * -nlm_unlock_1_svc(arg, rqstp) - nlm_unlockargs *arg; - struct svc_req *rqstp; +nlm_unlock_1_svc(nlm_unlockargs *arg, struct svc_req *rqstp) { static nlm_res res; struct nlm4_lock arg4; @@ -652,9 +622,7 @@ nlm_unlock_1_svc(arg, rqstp) } void * -nlm_unlock_msg_1_svc(arg, rqstp) - nlm_unlockargs *arg; - struct svc_req *rqstp; +nlm_unlock_msg_1_svc(nlm_unlockargs *arg, struct svc_req *rqstp) { static nlm_res res; struct nlm4_lock arg4; @@ -690,9 +658,7 @@ nlm_unlock_msg_1_svc(arg, rqstp) * Notes: */ nlm_res * -nlm_granted_1_svc(arg, rqstp) - nlm_testargs *arg; - struct svc_req *rqstp; +nlm_granted_1_svc(nlm_testargs *arg, struct svc_req *rqstp) { static nlm_res res; @@ -710,9 +676,7 @@ nlm_granted_1_svc(arg, rqstp) } void * -nlm_granted_msg_1_svc(arg, rqstp) - nlm_testargs *arg; - struct svc_req *rqstp; +nlm_granted_msg_1_svc(nlm_testargs *arg, struct svc_req *rqstp) { static nlm_res res; @@ -734,9 +698,7 @@ nlm_granted_msg_1_svc(arg, rqstp) * Returns: Nothing */ void * -nlm_test_res_1_svc(arg, rqstp) - nlm_testres *arg; - struct svc_req *rqstp; +nlm_test_res_1_svc(nlm_testres *arg, struct svc_req *rqstp) { if (debug_level) log_from_addr("nlm_test_res", rqstp); @@ -751,9 +713,7 @@ nlm_test_res_1_svc(arg, rqstp) * Returns: Nothing */ void * -nlm_lock_res_1_svc(arg, rqstp) - nlm_res *arg; - struct svc_req *rqstp; +nlm_lock_res_1_svc(nlm_res *arg, struct svc_req *rqstp) { if (debug_level) log_from_addr("nlm_lock_res", rqstp); @@ -769,9 +729,7 @@ nlm_lock_res_1_svc(arg, rqstp) * Returns: Nothing */ void * -nlm_cancel_res_1_svc(arg, rqstp) - nlm_res *arg __unused; - struct svc_req *rqstp; +nlm_cancel_res_1_svc(nlm_res *arg __unused, struct svc_req *rqstp) { if (debug_level) log_from_addr("nlm_cancel_res", rqstp); @@ -784,9 +742,7 @@ nlm_cancel_res_1_svc(arg, rqstp) * Returns: Nothing */ void * -nlm_unlock_res_1_svc(arg, rqstp) - nlm_res *arg; - struct svc_req *rqstp; +nlm_unlock_res_1_svc(nlm_res *arg, struct svc_req *rqstp) { if (debug_level) log_from_addr("nlm_unlock_res", rqstp); @@ -802,9 +758,7 @@ nlm_unlock_res_1_svc(arg, rqstp) * Returns: Nothing */ void * -nlm_granted_res_1_svc(arg, rqstp) - nlm_res *arg __unused; - struct svc_req *rqstp; +nlm_granted_res_1_svc(nlm_res *arg __unused, struct svc_req *rqstp) { if (debug_level) log_from_addr("nlm_granted_res", rqstp); @@ -827,9 +781,7 @@ nlm_granted_res_1_svc(arg, rqstp) * to retry if required. */ nlm_shareres * -nlm_share_3_svc(arg, rqstp) - nlm_shareargs *arg; - struct svc_req *rqstp; +nlm_share_3_svc(nlm_shareargs *arg, struct svc_req *rqstp) { static nlm_shareres res; @@ -849,9 +801,7 @@ nlm_share_3_svc(arg, rqstp) * Notes: */ nlm_shareres * -nlm_unshare_3_svc(arg, rqstp) - nlm_shareargs *arg; - struct svc_req *rqstp; +nlm_unshare_3_svc(nlm_shareargs *arg, struct svc_req *rqstp) { static nlm_shareres res; @@ -875,9 +825,7 @@ nlm_unshare_3_svc(arg, rqstp) * respond to the statd protocol. */ nlm_res * -nlm_nm_lock_3_svc(arg, rqstp) - nlm_lockargs *arg; - struct svc_req *rqstp; +nlm_nm_lock_3_svc(nlm_lockargs *arg, struct svc_req *rqstp) { static nlm_res res; @@ -901,9 +849,7 @@ nlm_nm_lock_3_svc(arg, rqstp) * using monitored locks. */ void * -nlm_free_all_3_svc(arg, rqstp) - nlm_notify *arg __unused; - struct svc_req *rqstp; +nlm_free_all_3_svc(nlm_notify *arg __unused, struct svc_req *rqstp) { static char dummy; @@ -920,9 +866,7 @@ nlm_free_all_3_svc(arg, rqstp) * Notes: */ nlm4_testres * -nlm4_test_4_svc(arg, rqstp) - nlm4_testargs *arg; - struct svc_req *rqstp; +nlm4_test_4_svc(nlm4_testargs *arg, struct svc_req *rqstp) { static nlm4_testres res; struct nlm4_holder *holder; @@ -968,9 +912,7 @@ nlm4_test_4_svc(arg, rqstp) } void * -nlm4_test_msg_4_svc(arg, rqstp) - nlm4_testargs *arg; - struct svc_req *rqstp; +nlm4_test_msg_4_svc(nlm4_testargs *arg, struct svc_req *rqstp) { nlm4_testres res; static char dummy; @@ -1020,9 +962,7 @@ nlm4_test_msg_4_svc(arg, rqstp) * Notes: *** grace period support missing */ nlm4_res * -nlm4_lock_4_svc(arg, rqstp) - nlm4_lockargs *arg; - struct svc_req *rqstp; +nlm4_lock_4_svc(nlm4_lockargs *arg, struct svc_req *rqstp) { static nlm4_res res; @@ -1056,9 +996,7 @@ nlm4_lock_4_svc(arg, rqstp) } void * -nlm4_lock_msg_4_svc(arg, rqstp) - nlm4_lockargs *arg; - struct svc_req *rqstp; +nlm4_lock_msg_4_svc(nlm4_lockargs *arg, struct svc_req *rqstp) { static nlm4_res res; @@ -1079,9 +1017,7 @@ nlm4_lock_msg_4_svc(arg, rqstp) * Notes: */ nlm4_res * -nlm4_cancel_4_svc(arg, rqstp) - nlm4_cancargs *arg; - struct svc_req *rqstp; +nlm4_cancel_4_svc(nlm4_cancargs *arg, struct svc_req *rqstp) { static nlm4_res res; @@ -1100,9 +1036,7 @@ nlm4_cancel_4_svc(arg, rqstp) } void * -nlm4_cancel_msg_4_svc(arg, rqstp) - nlm4_cancargs *arg; - struct svc_req *rqstp; +nlm4_cancel_msg_4_svc(nlm4_cancargs *arg, struct svc_req *rqstp) { static nlm4_res res; @@ -1128,9 +1062,7 @@ nlm4_cancel_msg_4_svc(arg, rqstp) * re-try an unlock that has already succeeded. */ nlm4_res * -nlm4_unlock_4_svc(arg, rqstp) - nlm4_unlockargs *arg; - struct svc_req *rqstp; +nlm4_unlock_4_svc(nlm4_unlockargs *arg, struct svc_req *rqstp) { static nlm4_res res; @@ -1144,9 +1076,7 @@ nlm4_unlock_4_svc(arg, rqstp) } void * -nlm4_unlock_msg_4_svc(arg, rqstp) - nlm4_unlockargs *arg; - struct svc_req *rqstp; +nlm4_unlock_msg_4_svc(nlm4_unlockargs *arg, struct svc_req *rqstp) { static nlm4_res res; @@ -1179,9 +1109,7 @@ nlm4_unlock_msg_4_svc(arg, rqstp) * Notes: */ nlm4_res * -nlm4_granted_4_svc(arg, rqstp) - nlm4_testargs *arg; - struct svc_req *rqstp; +nlm4_granted_4_svc(nlm4_testargs *arg, struct svc_req *rqstp) { static nlm4_res res; @@ -1199,9 +1127,7 @@ nlm4_granted_4_svc(arg, rqstp) } void * -nlm4_granted_msg_4_svc(arg, rqstp) - nlm4_testargs *arg; - struct svc_req *rqstp; +nlm4_granted_msg_4_svc(nlm4_testargs *arg, struct svc_req *rqstp) { static nlm4_res res; @@ -1222,9 +1148,7 @@ nlm4_granted_msg_4_svc(arg, rqstp) * Returns: Nothing */ void * -nlm4_test_res_4_svc(arg, rqstp) - nlm4_testres *arg; - struct svc_req *rqstp; +nlm4_test_res_4_svc(nlm4_testres *arg, struct svc_req *rqstp) { if (debug_level) log_from_addr("nlm4_test_res", rqstp); @@ -1241,9 +1165,7 @@ nlm4_test_res_4_svc(arg, rqstp) * Returns: Nothing */ void * -nlm4_lock_res_4_svc(arg, rqstp) - nlm4_res *arg; - struct svc_req *rqstp; +nlm4_lock_res_4_svc(nlm4_res *arg, struct svc_req *rqstp) { if (debug_level) log_from_addr("nlm4_lock_res", rqstp); @@ -1259,9 +1181,7 @@ nlm4_lock_res_4_svc(arg, rqstp) * Returns: Nothing */ void * -nlm4_cancel_res_4_svc(arg, rqstp) - nlm4_res *arg __unused; - struct svc_req *rqstp; +nlm4_cancel_res_4_svc(nlm4_res *arg __unused, struct svc_req *rqstp) { if (debug_level) log_from_addr("nlm4_cancel_res", rqstp); @@ -1274,9 +1194,7 @@ nlm4_cancel_res_4_svc(arg, rqstp) * Returns: Nothing */ void * -nlm4_unlock_res_4_svc(arg, rqstp) - nlm4_res *arg __unused; - struct svc_req *rqstp; +nlm4_unlock_res_4_svc(nlm4_res *arg __unused, struct svc_req *rqstp) { if (debug_level) log_from_addr("nlm4_unlock_res", rqstp); @@ -1289,9 +1207,7 @@ nlm4_unlock_res_4_svc(arg, rqstp) * Returns: Nothing */ void * -nlm4_granted_res_4_svc(arg, rqstp) - nlm4_res *arg __unused; - struct svc_req *rqstp; +nlm4_granted_res_4_svc(nlm4_res *arg __unused, struct svc_req *rqstp) { if (debug_level) log_from_addr("nlm4_granted_res", rqstp); @@ -1314,9 +1230,7 @@ nlm4_granted_res_4_svc(arg, rqstp) * to retry if required. */ nlm4_shareres * -nlm4_share_4_svc(arg, rqstp) - nlm4_shareargs *arg; - struct svc_req *rqstp; +nlm4_share_4_svc(nlm4_shareargs *arg, struct svc_req *rqstp) { static nlm4_shareres res; @@ -1336,9 +1250,7 @@ nlm4_share_4_svc(arg, rqstp) * Notes: */ nlm4_shareres * -nlm4_unshare_4_svc(arg, rqstp) - nlm4_shareargs *arg; - struct svc_req *rqstp; +nlm4_unshare_4_svc(nlm4_shareargs *arg, struct svc_req *rqstp) { static nlm4_shareres res; @@ -1362,9 +1274,7 @@ nlm4_unshare_4_svc(arg, rqstp) * respond to the statd protocol. */ nlm4_res * -nlm4_nm_lock_4_svc(arg, rqstp) - nlm4_lockargs *arg; - struct svc_req *rqstp; +nlm4_nm_lock_4_svc(nlm4_lockargs *arg, struct svc_req *rqstp) { static nlm4_res res; @@ -1388,9 +1298,7 @@ nlm4_nm_lock_4_svc(arg, rqstp) * using monitored locks. */ void * -nlm4_free_all_4_svc(arg, rqstp) - struct nlm4_notify *arg __unused; - struct svc_req *rqstp; +nlm4_free_all_4_svc(struct nlm4_notify *arg __unused, struct svc_req *rqstp) { static char dummy; @@ -1405,9 +1313,7 @@ nlm4_free_all_4_svc(arg, rqstp) * Returns: Nothing */ void * -nlm_sm_notify_0_svc(arg, rqstp) - struct nlm_sm_status *arg; - struct svc_req *rqstp __unused; +nlm_sm_notify_0_svc(struct nlm_sm_status *arg, struct svc_req *rqstp __unused) { static char dummy; notify(arg->mon_name, arg->state); diff --git a/usr.sbin/rpc.lockd/lockd.c b/usr.sbin/rpc.lockd/lockd.c index b3402ff20c16b..2974acb6ca4b9 100644 --- a/usr.sbin/rpc.lockd/lockd.c +++ b/usr.sbin/rpc.lockd/lockd.c @@ -101,10 +101,6 @@ static void complete_service(struct netconfig *nconf, char *port_str); static void clearout_service(void); void lookup_addresses(struct netconfig *nconf); void init_nsm(void); -void nlm_prog_0(struct svc_req *, SVCXPRT *); -void nlm_prog_1(struct svc_req *, SVCXPRT *); -void nlm_prog_3(struct svc_req *, SVCXPRT *); -void nlm_prog_4(struct svc_req *, SVCXPRT *); void out_of_mem(void); void usage(void); @@ -228,7 +224,7 @@ main(int argc, char **argv) if (hosts == NULL) out_of_mem(); - hosts[0] = "*"; + hosts[0] = strdup("*"); nhosts = 1; } else { hosts_bak = hosts; @@ -244,7 +240,7 @@ main(int argc, char **argv) hosts = hosts_bak; nhosts += 2; - hosts[nhosts - 2] = "::1"; + hosts[nhosts - 2] = strdup("::1"); } else { hosts_bak = realloc(hosts, (nhosts + 1) * sizeof(char *)); if (hosts_bak == NULL) { @@ -258,7 +254,7 @@ main(int argc, char **argv) hosts = hosts_bak; } } - hosts[nhosts - 1] = "127.0.0.1"; + hosts[nhosts - 1] = strdup("127.0.0.1"); } if (kernel_lockd) { diff --git a/usr.sbin/rpc.lockd/rpc.lockd.8 b/usr.sbin/rpc.lockd/rpc.lockd.8 index 4fabe5d43e53d..763a163ffebe5 100644 --- a/usr.sbin/rpc.lockd/rpc.lockd.8 +++ b/usr.sbin/rpc.lockd/rpc.lockd.8 @@ -11,11 +11,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" |
