From 0c6cee5d656d933100b86b7d58803bdbd549e456 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 18 Aug 1998 23:27:30 +0000 Subject: Update. 1998-08-18 Ulrich Drepper * include/features.h: Define __USE_EXTERN_INLINES for recent enough gcc. * argp/argp.h: Define extern inline functions only if __USE_EXTERN_INLINES is defined. * libio/stdio.h: Likewise. * math/math.h: Likewise. * stdlib/stdlib.h: Likewise. * string/argz.h: Likewise. * sysdeps/generic/bits/sigset.h: Likewise. * sysdeps/unix/sysv/linux/bits/sigset.h: Likewise. * sysdeps/unix/sysv/sysv4/bits/sigset.h: Likewise. * sysdeps/wordsize-32/inttypes.h: Likewise. * sysdeps/wordsize-64/inttypes.h: Likewise. * wcsmbs/wchar.h: Likewise. * sysdeps/generic/bits/glob.c [_LIBC]: Define __stat using __xstat to allow compilation without optimization. 1998-08-14 Thorsten Kukuk * nis/nss_compat/compat-grp.c: Set errno to ENOENT if we have no more entries. * nis/nss_compat/compat-initgroups.c: Likewise. * nis/nss_compat/compat-pwd.c: Likewise. * nis/nss_compat/compat-spwd.c: Likewise. * nis/nss_nis/nis-alias.c: Likewise. * nis/nss_nis/nis-ethers.c: Likewise. * nis/nss_nis/nis-grp.c: Likewise. * nis/nss_nis/nis-hosts.c: Likewise. * nis/nss_nis/nis-initgroups.c: Likewise. * nis/nss_nis/nis-network.c: Likewise. * nis/nss_nis/nis-proto.c: Likewise. * nis/nss_nis/nis-pwd.c: Likewise. * nis/nss_nis/nis-rpc.c: Likewise. * nis/nss_nis/nis-service.c: Likewise. * nis/nss_nis/nis-spwd.c: Likewise. * nis/rpcsvc/yp.h: Generate new without 1024 byte limits. * nis/ypclnt.c: Try binding dir only first time, could be to old. * nis/yp_xdr.c: Remove 1024 byte limit. * nis/ypupdate_xdr.c: Likewise. * nis/nss_nis/nis-publickey.c: Make sure, nobody could send wrong data. --- nis/yp_xdr.c | 386 ++++++++++++++++++++++++++--------------------------------- 1 file changed, 172 insertions(+), 214 deletions(-) (limited to 'nis/yp_xdr.c') diff --git a/nis/yp_xdr.c b/nis/yp_xdr.c index e6477be778..f189169687 100644 --- a/nis/yp_xdr.c +++ b/nis/yp_xdr.c @@ -5,23 +5,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -32,311 +32,269 @@ bool_t xdr_ypstat (XDR *xdrs, ypstat *objp) { - if (!xdr_enum(xdrs, (enum_t *)objp)) - return (FALSE); - return (TRUE); + if (!xdr_enum (xdrs, (enum_t *) objp)) + return FALSE; + return TRUE; } bool_t -xdr_ypxfrstat(XDR *xdrs, ypxfrstat *objp) +xdr_ypxfrstat (XDR *xdrs, ypxfrstat *objp) { - if (!xdr_enum(xdrs, (enum_t *)objp)) { - return (FALSE); - } - return (TRUE); + if (!xdr_enum (xdrs, (enum_t *) objp)) + return FALSE; + return TRUE; } bool_t -xdr_domainname(XDR *xdrs, domainname *objp) +xdr_domainname (XDR *xdrs, domainname *objp) { - if (!xdr_string(xdrs, objp, YPMAXDOMAIN)) { - return (FALSE); - } - return (TRUE); + if (!xdr_string (xdrs, objp, ~0)) + return FALSE; + return TRUE; } bool_t -xdr_mapname(XDR *xdrs, mapname *objp) +xdr_mapname (XDR *xdrs, mapname *objp) { - if (!xdr_string(xdrs, objp, YPMAXMAP)) { - return (FALSE); - } - return (TRUE); + if (!xdr_string (xdrs, objp, ~0)) + return FALSE; + return TRUE; } bool_t -xdr_peername(XDR *xdrs, peername *objp) +xdr_peername (XDR *xdrs, peername *objp) { - if (!xdr_string(xdrs, objp, YPMAXPEER)) { - return (FALSE); - } - return (TRUE); + if (!xdr_string (xdrs, objp, ~0)) + return FALSE; + return TRUE; } bool_t -xdr_keydat(XDR *xdrs, keydat *objp) +xdr_keydat (XDR *xdrs, keydat *objp) { - if (!xdr_bytes(xdrs, (char **)&objp->keydat_val, (u_int *)&objp->keydat_len, YPMAXRECORD)) { - return (FALSE); - } - return (TRUE); + if (!xdr_bytes (xdrs, (char **) &objp->keydat_val, + (u_int *) &objp->keydat_len, ~0)) + return FALSE; + return TRUE; } bool_t -xdr_valdat(XDR *xdrs, valdat *objp) +xdr_valdat (XDR *xdrs, valdat *objp) { - if (!xdr_bytes(xdrs, (char **)&objp->valdat_val, (u_int *)&objp->valdat_len, YPMAXRECORD)) { - return (FALSE); - } - return (TRUE); + if (!xdr_bytes (xdrs, (char **) &objp->valdat_val, + (u_int *) &objp->valdat_len, ~0)) + return FALSE; + return TRUE; } bool_t -xdr_ypmap_parms(XDR *xdrs, ypmap_parms *objp) +xdr_ypmap_parms (XDR *xdrs, ypmap_parms *objp) { - if (!xdr_domainname(xdrs, &objp->domain)) { - return (FALSE); - } - if (!xdr_mapname(xdrs, &objp->map)) { - return (FALSE); - } - if (!xdr_u_int(xdrs, &objp->ordernum)) { - return (FALSE); - } - if (!xdr_peername(xdrs, &objp->peer)) { - return (FALSE); - } - return (TRUE); + if (!xdr_domainname (xdrs, &objp->domain)) + return FALSE; + if (!xdr_mapname (xdrs, &objp->map)) + return FALSE; + if (!xdr_u_int (xdrs, &objp->ordernum)) + return FALSE; + if (!xdr_peername (xdrs, &objp->peer)) + return FALSE; + return TRUE; } bool_t -xdr_ypreq_key(XDR *xdrs, ypreq_key *objp) +xdr_ypreq_key (XDR *xdrs, ypreq_key *objp) { - if (!xdr_domainname(xdrs, &objp->domain)) { - return (FALSE); - } - if (!xdr_mapname(xdrs, &objp->map)) { - return (FALSE); - } - if (!xdr_keydat(xdrs, &objp->key)) { - return (FALSE); - } - return (TRUE); + if (!xdr_domainname (xdrs, &objp->domain)) + return FALSE; + if (!xdr_mapname (xdrs, &objp->map)) + return FALSE; + if (!xdr_keydat (xdrs, &objp->key)) + return FALSE; + return TRUE; } bool_t -xdr_ypreq_nokey(XDR *xdrs, ypreq_nokey *objp) +xdr_ypreq_nokey (XDR *xdrs, ypreq_nokey *objp) { - if (!xdr_domainname(xdrs, &objp->domain)) { - return (FALSE); - } - if (!xdr_mapname(xdrs, &objp->map)) { - return (FALSE); - } - return (TRUE); + if (!xdr_domainname (xdrs, &objp->domain)) + return FALSE; + if (!xdr_mapname (xdrs, &objp->map)) + return FALSE; + return TRUE; } bool_t -xdr_ypreq_xfr(XDR *xdrs, ypreq_xfr *objp) +xdr_ypreq_xfr (XDR *xdrs, ypreq_xfr *objp) { - if (!xdr_ypmap_parms(xdrs, &objp->map_parms)) { - return (FALSE); - } - if (!xdr_u_int(xdrs, &objp->transid)) { - return (FALSE); - } - if (!xdr_u_int(xdrs, &objp->prog)) { - return (FALSE); - } - if (!xdr_u_int(xdrs, &objp->port)) { - return (FALSE); - } - return (TRUE); + if (!xdr_ypmap_parms (xdrs, &objp->map_parms)) + return FALSE; + if (!xdr_u_int (xdrs, &objp->transid)) + return FALSE; + if (!xdr_u_int (xdrs, &objp->prog)) + return FALSE; + if (!xdr_u_int (xdrs, &objp->port)) + return FALSE; + return TRUE; } bool_t -xdr_ypresp_val(XDR *xdrs, ypresp_val *objp) +xdr_ypresp_val (XDR *xdrs, ypresp_val *objp) { - if (!xdr_ypstat(xdrs, &objp->stat)) { - return (FALSE); - } - if (!xdr_valdat(xdrs, &objp->val)) { - return (FALSE); - } - return (TRUE); + if (!xdr_ypstat (xdrs, &objp->stat)) + return FALSE; + if (!xdr_valdat (xdrs, &objp->val)) + return FALSE; + return TRUE; } bool_t -xdr_ypresp_key_val(XDR *xdrs, ypresp_key_val *objp) +xdr_ypresp_key_val (XDR *xdrs, ypresp_key_val *objp) { - if (!xdr_ypstat(xdrs, &objp->stat)) { - return (FALSE); - } - if (!xdr_valdat(xdrs, &objp->val)) { - return (FALSE); - } - if (!xdr_keydat(xdrs, &objp->key)) { - return (FALSE); - } - return (TRUE); + if (!xdr_ypstat (xdrs, &objp->stat)) + return FALSE; + if (!xdr_valdat (xdrs, &objp->val)) + return FALSE; + if (!xdr_keydat (xdrs, &objp->key)) + return FALSE; + return TRUE; } bool_t -xdr_ypresp_master(XDR *xdrs, ypresp_master *objp) +xdr_ypresp_master (XDR *xdrs, ypresp_master *objp) { - if (!xdr_ypstat(xdrs, &objp->stat)) { - return (FALSE); - } - if (!xdr_peername(xdrs, &objp->peer)) { - return (FALSE); - } - return (TRUE); + if (!xdr_ypstat (xdrs, &objp->stat)) + return FALSE; + if (!xdr_peername (xdrs, &objp->peer)) + return FALSE; + return TRUE; } bool_t -xdr_ypresp_order(XDR *xdrs, ypresp_order *objp) +xdr_ypresp_order (XDR *xdrs, ypresp_order *objp) { - if (!xdr_ypstat(xdrs, &objp->stat)) { - return (FALSE); - } - if (!xdr_u_int(xdrs, &objp->ordernum)) { - return (FALSE); - } - return (TRUE); + if (!xdr_ypstat (xdrs, &objp->stat)) + return FALSE; + if (!xdr_u_int (xdrs, &objp->ordernum)) + return FALSE; + return TRUE; } bool_t -xdr_ypresp_all(XDR *xdrs, ypresp_all *objp) +xdr_ypresp_all (XDR *xdrs, ypresp_all *objp) { - if (!xdr_bool(xdrs, &objp->more)) { - return (FALSE); - } - switch (objp->more) { - case TRUE: - if (!xdr_ypresp_key_val(xdrs, &objp->ypresp_all_u.val)) { - return (FALSE); + if (!xdr_bool (xdrs, &objp->more)) + return FALSE; + switch (objp->more) + { + case TRUE: + if (!xdr_ypresp_key_val (xdrs, &objp->ypresp_all_u.val)) + return FALSE; + break; + case FALSE: + break; + default: + return FALSE; } - break; - case FALSE: - break; - default: - return (FALSE); - } - return (TRUE); + return TRUE; } bool_t -xdr_ypresp_xfr(XDR *xdrs, ypresp_xfr *objp) +xdr_ypresp_xfr (XDR *xdrs, ypresp_xfr *objp) { - if (!xdr_u_int(xdrs, &objp->transid)) { - return (FALSE); - } - if (!xdr_ypxfrstat(xdrs, &objp->xfrstat)) { - return (FALSE); - } - return (TRUE); + if (!xdr_u_int (xdrs, &objp->transid)) + return FALSE; + if (!xdr_ypxfrstat (xdrs, &objp->xfrstat)) + return FALSE; + return TRUE; } bool_t -xdr_ypmaplist(XDR *xdrs, ypmaplist *objp) +xdr_ypmaplist (XDR *xdrs, ypmaplist *objp) { - if (!xdr_mapname(xdrs, &objp->map)) { - return (FALSE); - } - if (!xdr_pointer(xdrs, (char **)&objp->next, sizeof(ypmaplist), (xdrproc_t)xdr_ypmaplist)) { - return (FALSE); - } - return (TRUE); + if (!xdr_mapname (xdrs, &objp->map)) + return FALSE; + if (!xdr_pointer (xdrs, (char **) &objp->next, sizeof (ypmaplist), + (xdrproc_t) xdr_ypmaplist)) + return FALSE; + return TRUE; } bool_t -xdr_ypresp_maplist(XDR *xdrs, ypresp_maplist *objp) +xdr_ypresp_maplist (XDR *xdrs, ypresp_maplist *objp) { - if (!xdr_ypstat(xdrs, &objp->stat)) { - return (FALSE); - } - if (!xdr_pointer(xdrs, (char **)&objp->maps, sizeof(ypmaplist), (xdrproc_t)xdr_ypmaplist)) { - return (FALSE); - } - return (TRUE); + if (!xdr_ypstat (xdrs, &objp->stat)) + return FALSE; + if (!xdr_pointer (xdrs, (char **) &objp->maps, sizeof (ypmaplist), + (xdrproc_t) xdr_ypmaplist)) + return FALSE; + return TRUE; } bool_t -xdr_yppush_status(XDR *xdrs, yppush_status *objp) +xdr_yppush_status (XDR *xdrs, yppush_status *objp) { - if (!xdr_enum(xdrs, (enum_t *)objp)) { - return (FALSE); - } - return (TRUE); + if (!xdr_enum (xdrs, (enum_t *) objp)) + return FALSE; + return TRUE; } bool_t -xdr_yppushresp_xfr(XDR *xdrs, yppushresp_xfr *objp) +xdr_yppushresp_xfr (XDR *xdrs, yppushresp_xfr *objp) { - if (!xdr_u_int(xdrs, &objp->transid)) { - return (FALSE); - } - if (!xdr_yppush_status(xdrs, &objp->status)) { - return (FALSE); - } - return (TRUE); + if (!xdr_u_int (xdrs, &objp->transid)) + return FALSE; + if (!xdr_yppush_status (xdrs, &objp->status)) + return FALSE; + return TRUE; } bool_t -xdr_ypbind_resptype(XDR *xdrs, ypbind_resptype *objp) +xdr_ypbind_resptype (XDR *xdrs, ypbind_resptype *objp) { - if (!xdr_enum(xdrs, (enum_t *)objp)) { - return (FALSE); - } - return (TRUE); + if (!xdr_enum (xdrs, (enum_t *) objp)) + return FALSE; + return TRUE; } bool_t -xdr_ypbind_binding(XDR *xdrs, ypbind_binding *objp) +xdr_ypbind_binding (XDR *xdrs, ypbind_binding *objp) { - if (!xdr_opaque(xdrs, objp->ypbind_binding_addr, 4)) { - return (FALSE); - } - if (!xdr_opaque(xdrs, objp->ypbind_binding_port, 2)) { - return (FALSE); - } - return (TRUE); + if (!xdr_opaque (xdrs, objp->ypbind_binding_addr, 4)) + return FALSE; + if (!xdr_opaque (xdrs, objp->ypbind_binding_port, 2)) + return FALSE; + return TRUE; } bool_t -xdr_ypbind_resp(XDR *xdrs, ypbind_resp *objp) +xdr_ypbind_resp (XDR *xdrs, ypbind_resp *objp) { - if (!xdr_ypbind_resptype(xdrs, &objp->ypbind_status)) { - return (FALSE); - } - switch (objp->ypbind_status) { - case YPBIND_FAIL_VAL: - if (!xdr_u_int(xdrs, &objp->ypbind_resp_u.ypbind_error)) { - return (FALSE); - } - break; - case YPBIND_SUCC_VAL: - if (!xdr_ypbind_binding(xdrs, &objp->ypbind_resp_u.ypbind_bindinfo)) { - return (FALSE); + if (!xdr_ypbind_resptype (xdrs, &objp->ypbind_status)) + return FALSE; + switch (objp->ypbind_status) + { + case YPBIND_FAIL_VAL: + if (!xdr_u_int (xdrs, &objp->ypbind_resp_u.ypbind_error)) + return FALSE; + break; + case YPBIND_SUCC_VAL: + if (!xdr_ypbind_binding (xdrs, &objp->ypbind_resp_u.ypbind_bindinfo)) + return FALSE; + break; + default: + return FALSE; } - break; - default: - return (FALSE); - } - return (TRUE); + return TRUE; } bool_t -xdr_ypbind_setdom(XDR *xdrs, ypbind_setdom *objp) +xdr_ypbind_setdom (XDR *xdrs, ypbind_setdom *objp) { - if (!xdr_domainname(xdrs, &objp->ypsetdom_domain)) { - return (FALSE); - } - if (!xdr_ypbind_binding(xdrs, &objp->ypsetdom_binding)) { - return (FALSE); - } - if (!xdr_u_int(xdrs, &objp->ypsetdom_vers)) { - return (FALSE); - } - return (TRUE); + if (!xdr_domainname (xdrs, &objp->ypsetdom_domain)) + return FALSE; + if (!xdr_ypbind_binding (xdrs, &objp->ypsetdom_binding)) + return FALSE; + if (!xdr_u_int (xdrs, &objp->ypsetdom_vers)) + return FALSE; + return TRUE; } -- cgit v1.2.3-65-gdbad