summaryrefslogtreecommitdiff
path: root/network/krb5/patches/2008-002-patch.txt
diff options
context:
space:
mode:
authorTom Canich <tcanich@canich.net>2010-05-12 23:32:21 +0200
committerDavid Somero <xgizzmo@slackbuilds.org>2010-05-12 23:32:21 +0200
commit8631a96ddfe028076b77b0cdd84244faa78eca6b (patch)
tree68ea76f364c6454feae0de6f9d81338c79d013dd /network/krb5/patches/2008-002-patch.txt
parent43858c38016b71d1112b70f70a4c37755140af55 (diff)
downloadslackbuilds-8631a96ddfe028076b77b0cdd84244faa78eca6b.tar.gz
network/krb5: Added to 12.2 repository
Diffstat (limited to 'network/krb5/patches/2008-002-patch.txt')
-rw-r--r--network/krb5/patches/2008-002-patch.txt72
1 files changed, 72 insertions, 0 deletions
diff --git a/network/krb5/patches/2008-002-patch.txt b/network/krb5/patches/2008-002-patch.txt
new file mode 100644
index 0000000000..b2bb46b651
--- /dev/null
+++ b/network/krb5/patches/2008-002-patch.txt
@@ -0,0 +1,72 @@
+--- src/lib/rpc/svc.c (revision 1666)
++++ src/lib/rpc/svc.c (local)
+@@ -109,15 +109,17 @@
+ if (sock < FD_SETSIZE) {
+ xports[sock] = xprt;
+ FD_SET(sock, &svc_fdset);
++ if (sock > svc_maxfd)
++ svc_maxfd = sock;
+ }
+ #else
+ if (sock < NOFILE) {
+ xports[sock] = xprt;
+ svc_fds |= (1 << sock);
++ if (sock > svc_maxfd)
++ svc_maxfd = sock;
+ }
+ #endif /* def FD_SETSIZE */
+- if (sock > svc_maxfd)
+- svc_maxfd = sock;
+ }
+
+ /*
+
+--- src/lib/rpc/svc_tcp.c (revision 1666)
++++ src/lib/rpc/svc_tcp.c (local)
+@@ -54,6 +54,14 @@
+ extern errno;
+ */
+
++#ifndef FD_SETSIZE
++#ifdef NBBY
++#define NOFILE (sizeof(int) * NBBY)
++#else
++#define NOFILE (sizeof(int) * 8)
++#endif
++#endif
++
+ /*
+ * Ops vector for TCP/IP based rpc service handle
+ */
+@@ -215,6 +223,19 @@
+ register SVCXPRT *xprt;
+ register struct tcp_conn *cd;
+
++#ifdef FD_SETSIZE
++ if (fd >= FD_SETSIZE) {
++ (void) fprintf(stderr, "svc_tcp: makefd_xprt: fd too high\n");
++ xprt = NULL;
++ goto done;
++ }
++#else
++ if (fd >= NOFILE) {
++ (void) fprintf(stderr, "svc_tcp: makefd_xprt: fd too high\n");
++ xprt = NULL;
++ goto done;
++ }
++#endif
+ xprt = (SVCXPRT *)mem_alloc(sizeof(SVCXPRT));
+ if (xprt == (SVCXPRT *)NULL) {
+ (void) fprintf(stderr, "svc_tcp: makefd_xprt: out of memory\n");
+@@ -271,6 +292,10 @@
+ * make a new transporter (re-uses xprt)
+ */
+ xprt = makefd_xprt(sock, r->sendsize, r->recvsize);
++ if (xprt == NULL) {
++ close(sock);
++ return (FALSE);
++ }
+ xprt->xp_raddr = addr;
+ xprt->xp_addrlen = len;
+ xprt->xp_laddr = laddr;
+