[krb5] revise Filip's patch so that it more closely mimics the select() path

Nalin Dahyabhai nalin at fedoraproject.org
Mon Sep 10 22:51:35 UTC 2012


commit 3e1f3982d49e45853822329e45df82293e38fe95
Author: Nalin Dahyabhai <nalin at dahyabhai.net>
Date:   Mon Sep 10 18:47:48 2012 -0400

    revise Filip's patch so that it more closely mimics the select() path

 krb5-1.10.3-timeout_over.patch |   25 ++++++++++++++-----------
 krb5.spec                      |    8 ++++----
 2 files changed, 18 insertions(+), 15 deletions(-)
---
diff --git a/krb5-1.10.3-timeout_over.patch b/krb5-1.10.3-timeout_over.patch
index 98c9e1d..138dc74 100644
--- a/krb5-1.10.3-timeout_over.patch
+++ b/krb5-1.10.3-timeout_over.patch
@@ -1,14 +1,17 @@
-Filip Krska's patch to abort the current pass after poll() returns when
-we've given it an indefinite timeout.
+When wrapping poll(), if we compute a negative timeout, just return a
+no-results status, as the krb5int_cm_call_select() wrapper for select()
+does.  Based on a patch by Filip Krska.
 
 --- krb5/src/lib/krb5/os/sendto_kdc.c
 +++ krb5/src/lib/krb5/os/sendto_kdc.c
-@@ -529,6 +529,8 @@ cm_select_or_poll(const struct select_st
-     *out = *in;
-     *sret = poll(out->fds, out->nfds, timeout);
-     e = SOCKET_ERRNO;
-+    if (timeout < 0)
-+        return e;
-     return (*sret < 0) ? e : 0;
- #else
-     /* Use the select wrapper from cm.c. */
+@@ -523,6 +523,10 @@ cm_select_or_poll(const struct select_st
+             return e;
+         timeout = (in->end_time.tv_sec - now.tv_sec) * 1000 +
+             (in->end_time.tv_usec - now.tv_usec) / 1000;
++        if (timeout < 0) {
++            *sret = 0;
++            return 0;
++        }
+     }
+     /* We don't need a separate copy of the selstate for poll, but use one
+      * anyone for consistency with the select wrapper. */
diff --git a/krb5.spec b/krb5.spec
index 0b915e7..a929402 100644
--- a/krb5.spec
+++ b/krb5.spec
@@ -852,11 +852,11 @@ exit 0
 %{_sbindir}/uuserver
 
 %changelog
-* Fri Sep  6 2012 Nalin Dahyabhai <nalin at redhat.com> 1.10.3-5
-- add patch from Filip Krska to abort a transmit attempt when we've given
-  poll() a negative timeout (#838548)
+* Mon Sep 10 2012 Nalin Dahyabhai <nalin at redhat.com> 1.10.3-5
+- add patch based on one from Filip Krska to not call poll() with a negative
+  timeout when the caller's intent is for us to just stop calling it (#838548)
 
-* Fri Sep  6 2012 Nalin Dahyabhai <nalin at redhat.com>
+* Fri Sep  7 2012 Nalin Dahyabhai <nalin at redhat.com>
 - on EL6, conflict with libsmbclient before 3.5.10-124, which is when it
   stopped linking with a symbol which we no longer export (#771687)
 - pull up patch for RT#7063, in which not noticing a prompt for a long


More information about the scm-commits mailing list