Deleted Added
full compact
lock_proc.c (74462) lock_proc.c (75631)
1/* $NetBSD: lock_proc.c,v 1.7 2000/10/11 20:23:56 is Exp $ */
1/* $NetBSD: lock_proc.c,v 1.7 2000/10/11 20:23:56 is Exp $ */
2/* $FreeBSD: head/usr.sbin/rpc.lockd/lock_proc.c 74462 2001-03-19 12:50:13Z alfred $ */
2/* $FreeBSD: head/usr.sbin/rpc.lockd/lock_proc.c 75631 2001-04-17 20:45:23Z alfred $ */
3/*
4 * Copyright (c) 1995
5 * A.R. Gordon (andrew.gordon@net-tel.co.uk). All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright

--- 618 unchanged lines hidden (view full) ---

629 nlm_testargs *arg;
630 struct svc_req *rqstp;
631{
632 static nlm_res res;
633
634 if (debug_level)
635 log_from_addr("nlm_granted", rqstp);
636
3/*
4 * Copyright (c) 1995
5 * A.R. Gordon (andrew.gordon@net-tel.co.uk). All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright

--- 618 unchanged lines hidden (view full) ---

629 nlm_testargs *arg;
630 struct svc_req *rqstp;
631{
632 static nlm_res res;
633
634 if (debug_level)
635 log_from_addr("nlm_granted", rqstp);
636
637 res.stat.stat = lock_answer(arg->alock.svid, &arg->cookie,
638 nlm_granted, NULL, NLM_VERS) == 0 ?
639 nlm_granted : nlm_denied;
640
637 /* copy cookie from arg to result. See comment in nlm_test_1() */
638 res.cookie = arg->cookie;
639
641 /* copy cookie from arg to result. See comment in nlm_test_1() */
642 res.cookie = arg->cookie;
643
640 res.stat.stat = nlm_granted;
641 return (&res);
642}
643
644void *
645nlm_granted_msg_1_svc(arg, rqstp)
646 nlm_testargs *arg;
647 struct svc_req *rqstp;
648{

--- 16 unchanged lines hidden (view full) ---

665 */
666void *
667nlm_test_res_1_svc(arg, rqstp)
668 nlm_testres *arg;
669 struct svc_req *rqstp;
670{
671 if (debug_level)
672 log_from_addr("nlm_test_res", rqstp);
644 return (&res);
645}
646
647void *
648nlm_granted_msg_1_svc(arg, rqstp)
649 nlm_testargs *arg;
650 struct svc_req *rqstp;
651{

--- 16 unchanged lines hidden (view full) ---

668 */
669void *
670nlm_test_res_1_svc(arg, rqstp)
671 nlm_testres *arg;
672 struct svc_req *rqstp;
673{
674 if (debug_level)
675 log_from_addr("nlm_test_res", rqstp);
676 (void)lock_answer(-1, &arg->cookie, arg->stat.stat,
677 &arg->stat.nlm_testrply_u.holder.svid, NLM_VERS);
673 return (NULL);
674}
675
676/* nlm_lock_res ------------------------------------------------------------ */
677/*
678 * Purpose: Accept result from earlier nlm_lock_msg() call
679 * Returns: Nothing
680 */
681void *
682nlm_lock_res_1_svc(arg, rqstp)
683 nlm_res *arg;
684 struct svc_req *rqstp;
685{
686 if (debug_level)
687 log_from_addr("nlm_lock_res", rqstp);
688
678 return (NULL);
679}
680
681/* nlm_lock_res ------------------------------------------------------------ */
682/*
683 * Purpose: Accept result from earlier nlm_lock_msg() call
684 * Returns: Nothing
685 */
686void *
687nlm_lock_res_1_svc(arg, rqstp)
688 nlm_res *arg;
689 struct svc_req *rqstp;
690{
691 if (debug_level)
692 log_from_addr("nlm_lock_res", rqstp);
693
694 (void)lock_answer(-1, &arg->cookie, arg->stat.stat, NULL, NLM_VERS);
695
689 return (NULL);
690}
691
692/* nlm_cancel_res ---------------------------------------------------------- */
693/*
694 * Purpose: Accept result from earlier nlm_cancel_msg() call
695 * Returns: Nothing
696 */

--- 14 unchanged lines hidden (view full) ---

711 */
712void *
713nlm_unlock_res_1_svc(arg, rqstp)
714 nlm_res *arg;
715 struct svc_req *rqstp;
716{
717 if (debug_level)
718 log_from_addr("nlm_unlock_res", rqstp);
696 return (NULL);
697}
698
699/* nlm_cancel_res ---------------------------------------------------------- */
700/*
701 * Purpose: Accept result from earlier nlm_cancel_msg() call
702 * Returns: Nothing
703 */

--- 14 unchanged lines hidden (view full) ---

718 */
719void *
720nlm_unlock_res_1_svc(arg, rqstp)
721 nlm_res *arg;
722 struct svc_req *rqstp;
723{
724 if (debug_level)
725 log_from_addr("nlm_unlock_res", rqstp);
726
727 lock_answer(&arg->cookie, arg->stat.stat, NLM_VERS);
728
719 return (NULL);
720}
721
722/* nlm_granted_res --------------------------------------------------------- */
723/*
724 * Purpose: Accept result from earlier nlm_granted_msg() call
725 * Returns: Nothing
726 */

--- 345 unchanged lines hidden (view full) ---

1072 nlm4_testargs *arg;
1073 struct svc_req *rqstp;
1074{
1075 static nlm4_res res;
1076
1077 if (debug_level)
1078 log_from_addr("nlm4_granted", rqstp);
1079
729 return (NULL);
730}
731
732/* nlm_granted_res --------------------------------------------------------- */
733/*
734 * Purpose: Accept result from earlier nlm_granted_msg() call
735 * Returns: Nothing
736 */

--- 345 unchanged lines hidden (view full) ---

1082 nlm4_testargs *arg;
1083 struct svc_req *rqstp;
1084{
1085 static nlm4_res res;
1086
1087 if (debug_level)
1088 log_from_addr("nlm4_granted", rqstp);
1089
1090 res.stat.stat = lock_answer(arg->alock.svid, &arg->cookie,
1091 nlm4_granted, NULL, NLM_VERS4) == 0 ?
1092 nlm4_granted : nlm4_denied;
1093
1080 /* copy cookie from arg to result. See comment in nlm_test_1() */
1081 res.cookie = arg->cookie;
1082
1094 /* copy cookie from arg to result. See comment in nlm_test_1() */
1095 res.cookie = arg->cookie;
1096
1083 res.stat.stat = nlm4_granted;
1084 return (&res);
1085}
1086
1087void *
1088nlm4_granted_msg_4_svc(arg, rqstp)
1089 nlm4_testargs *arg;
1090 struct svc_req *rqstp;
1091{

--- 16 unchanged lines hidden (view full) ---

1108 */
1109void *
1110nlm4_test_res_4_svc(arg, rqstp)
1111 nlm4_testres *arg;
1112 struct svc_req *rqstp;
1113{
1114 if (debug_level)
1115 log_from_addr("nlm4_test_res", rqstp);
1097 return (&res);
1098}
1099
1100void *
1101nlm4_granted_msg_4_svc(arg, rqstp)
1102 nlm4_testargs *arg;
1103 struct svc_req *rqstp;
1104{

--- 16 unchanged lines hidden (view full) ---

1121 */
1122void *
1123nlm4_test_res_4_svc(arg, rqstp)
1124 nlm4_testres *arg;
1125 struct svc_req *rqstp;
1126{
1127 if (debug_level)
1128 log_from_addr("nlm4_test_res", rqstp);
1129
1130 (void)lock_answer(-1, &arg->cookie, arg->stat.stat,
1131 (int *)&arg->stat.nlm4_testrply_u.holder.svid,
1132 NLM_VERS4);
1116 return (NULL);
1117}
1118
1119/* nlm_lock_res ------------------------------------------------------------ */
1120/*
1121 * Purpose: Accept result from earlier nlm_lock_msg() call
1122 * Returns: Nothing
1123 */
1124void *
1125nlm4_lock_res_4_svc(arg, rqstp)
1126 nlm4_res *arg;
1127 struct svc_req *rqstp;
1128{
1129 if (debug_level)
1130 log_from_addr("nlm4_lock_res", rqstp);
1131
1133 return (NULL);
1134}
1135
1136/* nlm_lock_res ------------------------------------------------------------ */
1137/*
1138 * Purpose: Accept result from earlier nlm_lock_msg() call
1139 * Returns: Nothing
1140 */
1141void *
1142nlm4_lock_res_4_svc(arg, rqstp)
1143 nlm4_res *arg;
1144 struct svc_req *rqstp;
1145{
1146 if (debug_level)
1147 log_from_addr("nlm4_lock_res", rqstp);
1148
1149 (void)lock_answer(-1, &arg->cookie, arg->stat.stat, NULL, NLM_VERS4);
1150
1132 return (NULL);
1133}
1134
1135/* nlm_cancel_res ---------------------------------------------------------- */
1136/*
1137 * Purpose: Accept result from earlier nlm_cancel_msg() call
1138 * Returns: Nothing
1139 */

--- 123 unchanged lines hidden (view full) ---

1263 * Notes: Potential denial of service security problem here - the
1264 * locks to be released are specified by a host name, independent
1265 * of the address from which the request has arrived.
1266 * Should probably be rejected if the named host has been
1267 * using monitored locks.
1268 */
1269void *
1270nlm4_free_all_4_svc(arg, rqstp)
1151 return (NULL);
1152}
1153
1154/* nlm_cancel_res ---------------------------------------------------------- */
1155/*
1156 * Purpose: Accept result from earlier nlm_cancel_msg() call
1157 * Returns: Nothing
1158 */

--- 123 unchanged lines hidden (view full) ---

1282 * Notes: Potential denial of service security problem here - the
1283 * locks to be released are specified by a host name, independent
1284 * of the address from which the request has arrived.
1285 * Should probably be rejected if the named host has been
1286 * using monitored locks.
1287 */
1288void *
1289nlm4_free_all_4_svc(arg, rqstp)
1271 nlm_notify *arg;
1290 struct nlm4_notify *arg;
1272 struct svc_req *rqstp;
1273{
1274 static char dummy;
1275
1276 if (debug_level)
1277 log_from_addr("nlm4_free_all", rqstp);
1278 return (&dummy);
1279}

--- 15 unchanged lines hidden ---
1291 struct svc_req *rqstp;
1292{
1293 static char dummy;
1294
1295 if (debug_level)
1296 log_from_addr("nlm4_free_all", rqstp);
1297 return (&dummy);
1298}

--- 15 unchanged lines hidden ---