ypupdated_server.c (90297) | ypupdated_server.c (90298) |
---|---|
1/* 2 * Copyright (c) 1995, 1996 3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 24 unchanged lines hidden (view full) --- 33 * 34 * Written by Bill Paul <wpaul@ctr.columbia.edu> 35 * Center for Telecommunications Research 36 * Columbia University, New York City 37 */ 38 39#ifndef lint 40static const char rcsid[] = | 1/* 2 * Copyright (c) 1995, 1996 3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 24 unchanged lines hidden (view full) --- 33 * 34 * Written by Bill Paul <wpaul@ctr.columbia.edu> 35 * Center for Telecommunications Research 36 * Columbia University, New York City 37 */ 38 39#ifndef lint 40static const char rcsid[] = |
41 "$FreeBSD: head/usr.sbin/rpc.ypupdated/ypupdated_server.c 90297 2002-02-06 13:30:31Z des $"; | 41 "$FreeBSD: head/usr.sbin/rpc.ypupdated/ypupdated_server.c 90298 2002-02-06 15:26:07Z des $"; |
42#endif /* not lint */ 43 44#include <stdio.h> 45#include <rpc/rpc.h> 46#include <rpc/key_prot.h> 47#include <sys/param.h> 48#include <sys/cdefs.h> 49#include <rpcsvc/yp.h> --- 11 unchanged lines hidden (view full) --- 61 * there's a chance he might stumble onto a valid combination. 62 * We therefore reject any RPCs with a window size larger than a preset 63 * value. 64 */ 65#ifndef WINDOW 66#define WINDOW (60*60) 67#endif 68 | 42#endif /* not lint */ 43 44#include <stdio.h> 45#include <rpc/rpc.h> 46#include <rpc/key_prot.h> 47#include <sys/param.h> 48#include <sys/cdefs.h> 49#include <rpcsvc/yp.h> --- 11 unchanged lines hidden (view full) --- 61 * there's a chance he might stumble onto a valid combination. 62 * We therefore reject any RPCs with a window size larger than a preset 63 * value. 64 */ 65#ifndef WINDOW 66#define WINDOW (60*60) 67#endif 68 |
69static enum auth_stat yp_checkauth(svcreq) 70 struct svc_req *svcreq; | 69static enum auth_stat 70yp_checkauth(struct svc_req *svcreq) |
71{ 72 struct authdes_cred *des_cred; 73 74 switch (svcreq->rq_cred.oa_flavor) { 75 case AUTH_DES: 76 des_cred = (struct authdes_cred *) svcreq->rq_clntcred; 77 if (des_cred->adc_fullname.window > WINDOW) { 78 yp_error("warning: client-specified window size \ --- 9 unchanged lines hidden (view full) --- 88 break; 89 default: 90 yp_error("client used unknown auth flavor"); 91 return(AUTH_REJECTEDCRED); 92 break; 93 } 94} 95 | 71{ 72 struct authdes_cred *des_cred; 73 74 switch (svcreq->rq_cred.oa_flavor) { 75 case AUTH_DES: 76 des_cred = (struct authdes_cred *) svcreq->rq_clntcred; 77 if (des_cred->adc_fullname.window > WINDOW) { 78 yp_error("warning: client-specified window size \ --- 9 unchanged lines hidden (view full) --- 88 break; 89 default: 90 yp_error("client used unknown auth flavor"); 91 return(AUTH_REJECTEDCRED); 92 break; 93 } 94} 95 |
96unsigned int *ypu_change_1_svc(args, svcreq) 97 struct ypupdate_args *args; 98 struct svc_req *svcreq; | 96unsigned int * 97ypu_change_1_svc(struct ypupdate_args *args, struct svc_req *svcreq) |
99{ 100 struct authdes_cred *des_cred; 101 static int res; 102 char *netname; 103 enum auth_stat astat; 104 105 res = 0; 106 --- 16 unchanged lines hidden (view full) --- 123 124 res = ypmap_update(netname, args->mapname, YPOP_CHANGE, 125 args->key.yp_buf_len, args->key.yp_buf_val, 126 args->datum.yp_buf_len, args->datum.yp_buf_val); 127 128 return (&res); 129} 130 | 98{ 99 struct authdes_cred *des_cred; 100 static int res; 101 char *netname; 102 enum auth_stat astat; 103 104 res = 0; 105 --- 16 unchanged lines hidden (view full) --- 122 123 res = ypmap_update(netname, args->mapname, YPOP_CHANGE, 124 args->key.yp_buf_len, args->key.yp_buf_val, 125 args->datum.yp_buf_len, args->datum.yp_buf_val); 126 127 return (&res); 128} 129 |
131unsigned int *ypu_insert_1_svc(args, svcreq) 132 struct ypupdate_args *args; 133 struct svc_req *svcreq; | 130unsigned int * 131ypu_insert_1_svc(struct ypupdate_args *args, struct svc_req *svcreq) |
134{ 135 struct authdes_cred *des_cred; 136 static int res; 137 char *netname; 138 enum auth_stat astat; 139 140 res = 0; 141 --- 16 unchanged lines hidden (view full) --- 158 159 res = ypmap_update(netname, args->mapname, YPOP_INSERT, 160 args->key.yp_buf_len, args->key.yp_buf_val, 161 args->datum.yp_buf_len, args->datum.yp_buf_val); 162 163 return (&res); 164} 165 | 132{ 133 struct authdes_cred *des_cred; 134 static int res; 135 char *netname; 136 enum auth_stat astat; 137 138 res = 0; 139 --- 16 unchanged lines hidden (view full) --- 156 157 res = ypmap_update(netname, args->mapname, YPOP_INSERT, 158 args->key.yp_buf_len, args->key.yp_buf_val, 159 args->datum.yp_buf_len, args->datum.yp_buf_val); 160 161 return (&res); 162} 163 |
166unsigned int *ypu_delete_1_svc(args, svcreq) 167 struct ypdelete_args *args; 168 struct svc_req *svcreq; | 164unsigned int * 165ypu_delete_1_svc(struct ypdelete_args *args, struct svc_req *svcreq) |
169{ 170 struct authdes_cred *des_cred; 171 static int res; 172 char *netname; 173 enum auth_stat astat; 174 175 res = 0; 176 --- 16 unchanged lines hidden (view full) --- 193 194 res = ypmap_update(netname, args->mapname, YPOP_DELETE, 195 args->key.yp_buf_len, args->key.yp_buf_val, 196 0, NULL); 197 198 return (&res); 199} 200 | 166{ 167 struct authdes_cred *des_cred; 168 static int res; 169 char *netname; 170 enum auth_stat astat; 171 172 res = 0; 173 --- 16 unchanged lines hidden (view full) --- 190 191 res = ypmap_update(netname, args->mapname, YPOP_DELETE, 192 args->key.yp_buf_len, args->key.yp_buf_val, 193 0, NULL); 194 195 return (&res); 196} 197 |
201unsigned int *ypu_store_1_svc(args, svcreq) 202 struct ypupdate_args *args; 203 struct svc_req *svcreq; | 198unsigned int * 199ypu_store_1_svc(struct ypupdate_args *args, struct svc_req *svcreq) |
204{ 205 struct authdes_cred *des_cred; 206 static int res; 207 char *netname; 208 enum auth_stat astat; 209 210 res = 0; 211 --- 23 unchanged lines hidden --- | 200{ 201 struct authdes_cred *des_cred; 202 static int res; 203 char *netname; 204 enum auth_stat astat; 205 206 res = 0; 207 --- 23 unchanged lines hidden --- |