glibc/glibc-rh892777.patch
Patsy Franklin 675e8a4266 Resolves: #892777 #952799
- Increase limits on xdr name and record requests (#892777).
  - Consistently MANGLE/DEMANGLE init_fct, end_fct and btow_fct (#952799).
(cherry picked from commit 7f654232b1)

Conflicts:
	glibc.spec
2013-04-24 14:58:46 -04:00

62 lines
1.7 KiB
Diff

diff -Nrup a/nis/yp_xdr.c b/nis/yp_xdr.c
--- a/nis/yp_xdr.c 2012-12-24 22:02:13.000000000 -0500
+++ b/nis/yp_xdr.c 2013-04-17 15:26:50.168999686 -0400
@@ -32,6 +32,14 @@
#include <rpcsvc/yp.h>
#include <rpcsvc/ypclnt.h>
+/* The specification suggests 1024 as a maximum length of all fields,
+ but current linux systems usually don't use any limits. So, to stay
+ as much compatible as possible with recent linux systems we choose
+ limits large enough to avoid problems. */
+
+#define XDRMAXNAME 1024
+#define XDRMAXRECORD 16 * 1024 * 1024
+
bool_t
xdr_ypstat (XDR *xdrs, ypstat *objp)
{
@@ -49,21 +57,21 @@ libnsl_hidden_def (xdr_ypxfrstat)
bool_t
xdr_domainname (XDR *xdrs, domainname *objp)
{
- return xdr_string (xdrs, objp, YPMAXDOMAIN);
+ return xdr_string (xdrs, objp, XDRMAXNAME);
}
libnsl_hidden_def (xdr_domainname)
bool_t
xdr_mapname (XDR *xdrs, mapname *objp)
{
- return xdr_string (xdrs, objp, YPMAXMAP);
+ return xdr_string (xdrs, objp, XDRMAXNAME);
}
libnsl_hidden_def (xdr_mapname)
bool_t
xdr_peername (XDR *xdrs, peername *objp)
{
- return xdr_string (xdrs, objp, YPMAXPEER);
+ return xdr_string (xdrs, objp, XDRMAXNAME);
}
libnsl_hidden_def (xdr_peername)
@@ -71,7 +79,7 @@ bool_t
xdr_keydat (XDR *xdrs, keydat *objp)
{
return xdr_bytes (xdrs, (char **) &objp->keydat_val,
- (u_int *) &objp->keydat_len, YPMAXRECORD);
+ (u_int *) &objp->keydat_len, XDRMAXRECORD);
}
libnsl_hidden_def (xdr_keydat)
@@ -79,7 +87,7 @@ bool_t
xdr_valdat (XDR *xdrs, valdat *objp)
{
return xdr_bytes (xdrs, (char **) &objp->valdat_val,
- (u_int *) &objp->valdat_len, YPMAXRECORD);
+ (u_int *) &objp->valdat_len, XDRMAXRECORD);
}
libnsl_hidden_def (xdr_valdat)