From d401b30b5f93340cc44dece225e5b296679e0878 Mon Sep 17 00:00:00 2001 From: Robbie Harwood Date: Thu, 8 Nov 2018 11:22:27 -0500 Subject: [PATCH] Fix spurious errors from kcmio_unix_socket_write Resolves: #1645912 --- ...-errors-from-kcmio_unix_socket_write.patch | 44 +++++++++++++++++++ krb5.spec | 7 ++- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 Fix-spurious-errors-from-kcmio_unix_socket_write.patch diff --git a/Fix-spurious-errors-from-kcmio_unix_socket_write.patch b/Fix-spurious-errors-from-kcmio_unix_socket_write.patch new file mode 100644 index 0000000..c98ea73 --- /dev/null +++ b/Fix-spurious-errors-from-kcmio_unix_socket_write.patch @@ -0,0 +1,44 @@ +From 9fb4942026ba77ae51a9fa3623c62a07328e3bd5 Mon Sep 17 00:00:00 2001 +From: Robbie Harwood +Date: Mon, 5 Nov 2018 13:49:52 -0500 +Subject: [PATCH] Fix spurious errors from kcmio_unix_socket_write + +Commit 33634a940166d0b21c3105bab8dcf5550fbbd678 accidentally changed +the return value from kcmio_unix_socket_write to be the result of the +write call. Most commonly this resulted in it returning 8, which led +to many commands failing with "Exec format error". + +ticket: 8758 (new) +tags: pullup +target_version: 1.17-next + +(cherry picked from commit 3e76ea104cdaf22c4537833b203f8aeed1691f18) +--- + src/lib/krb5/ccache/cc_kcm.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/src/lib/krb5/ccache/cc_kcm.c b/src/lib/krb5/ccache/cc_kcm.c +index 2b9f82e32..092ab7daf 100644 +--- a/src/lib/krb5/ccache/cc_kcm.c ++++ b/src/lib/krb5/ccache/cc_kcm.c +@@ -308,8 +308,9 @@ kcmio_unix_socket_write(krb5_context context, struct kcmio *io, void *request, + + for (;;) { + ret = krb5int_net_writev(context, io->fd, sg, 2); +- if (ret < 0) +- ret = errno; ++ if (ret >= 0) ++ return 0; ++ ret = errno; + if (ret != EPIPE || reconnected) + return ret; + +@@ -327,8 +328,6 @@ kcmio_unix_socket_write(krb5_context context, struct kcmio *io, void *request, + return ret; + reconnected = TRUE; + } +- +- return ret; + } + + /* Read a KCM reply: 4-byte big-endian length, 4-byte big-endian status code, diff --git a/krb5.spec b/krb5.spec index 7cbc883..d33b85a 100644 --- a/krb5.spec +++ b/krb5.spec @@ -18,7 +18,7 @@ Summary: The Kerberos network authentication system Name: krb5 Version: 1.17 # for prerelease, should be e.g., 0.% {prerelease}.1% { ?dist } (without spaces) -Release: 0.beta1.1%{?dist} +Release: 1.beta1.1%{?dist} # lookaside-cached sources; two downloads and a build artifact Source0: https://web.mit.edu/kerberos/dist/krb5/1.16/krb5-%{version}%{prerelease}.tar.gz @@ -61,6 +61,7 @@ Patch34: krb5-1.9-debuginfo.patch Patch35: krb5-1.11-run_user_0.patch Patch36: krb5-1.11-kpasswdtest.patch Patch86: In-FIPS-mode-add-plaintext-fallback-for-RC4-usages-a.patch +Patch87: Fix-spurious-errors-from-kcmio_unix_socket_write.patch License: MIT URL: http://web.mit.edu/kerberos/www/ @@ -708,6 +709,10 @@ exit 0 %{_libdir}/libkadm5srv_mit.so.* %changelog +* Thu Nov 08 2018 Robbie Harwood - 1.17-1 +- Fix spurious errors from kcmio_unix_socket_write +- Resolves: #1645912 + * Thu Nov 01 2018 Robbie Harwood - 1.17-0.beta2.1 - New upstream beta release