[krb5/f21] ksu: avoid breaking when the default_ccache_name is underconfigured

Nalin Dahyabhai nalin at fedoraproject.org
Mon Sep 8 22:57:36 UTC 2014


commit 3ddf4129ea4980c7568f4c3b7cc8b5df594e26ad
Author: Nalin Dahyabhai <nalin at redhat.com>
Date:   Mon Sep 8 18:47:21 2014 -0400

    ksu: avoid breaking when the default_ccache_name is underconfigured
    
    - ksu: pull in fix from pull #206 to avoid breakage when the
      default_ccache_name doesn't include a cache type as a prefix

 krb5-1.12-ksu-untyped-default-ccache-name.patch |   46 +++++++++++++++++++++++
 krb5.spec                                       |    4 ++
 2 files changed, 50 insertions(+), 0 deletions(-)
---
diff --git a/krb5-1.12-ksu-untyped-default-ccache-name.patch b/krb5-1.12-ksu-untyped-default-ccache-name.patch
new file mode 100644
index 0000000..4e1f835
--- /dev/null
+++ b/krb5-1.12-ksu-untyped-default-ccache-name.patch
@@ -0,0 +1,46 @@
+commit bda574576a5a2d0613fecf12d820e0adcbedf95c
+Author: Nalin Dahyabhai <nalin at redhat.com>
+Date:   Mon Sep 8 13:15:40 2014 -0400
+
+    In ksu, handle typeless default_ccache_name values
+    
+    When a configured or compiled-in default ccache name doesn't contain a
+    cache type and ':' as a prefix, add one to the writeable value that we
+    construct when we go to look it up.  This lets the rest of the
+    application always assume that it'll be there.
+    
+    [ghudson at mit.edu: minor style changes]
+    
+    ticket: 8007 (new)
+    target_version: 1.13
+    tags: pullup
+
+diff --git a/src/clients/ksu/main.c b/src/clients/ksu/main.c
+index 47fa820..622c36a 100644
+--- a/src/clients/ksu/main.c
++++ b/src/clients/ksu/main.c
+@@ -819,7 +819,7 @@ get_configured_defccname(krb5_context context, char **target_out)
+ {
+     krb5_error_code retval;
+     const char *defname;
+-    char *target;
++    char *target = NULL;
+ 
+     *target_out = NULL;
+ 
+@@ -838,7 +838,14 @@ get_configured_defccname(krb5_context context, char **target_out)
+     }
+ 
+     defname = krb5_cc_default_name(context);
+-    target = (defname == NULL) ? NULL : strdup(defname);
++    if (defname != NULL) {
++        if (strchr(defname, ':') != NULL) {
++            target = strdup(defname);
++        } else {
++            if (asprintf(&target, "FILE:%s", defname) < 0)
++                target = NULL;
++        }
++    }
+     if (target == NULL) {
+         com_err(prog_name, ENOMEM, _("while determining target ccache name"));
+         return ENOMEM;
diff --git a/krb5.spec b/krb5.spec
index f80730d..cb2382f 100644
--- a/krb5.spec
+++ b/krb5.spec
@@ -125,6 +125,7 @@ Patch313: 0012-Add-a-simple-KDC-proxy-test-server.patch
 Patch314: 0013-Add-tests-for-MS-KKDCP-client-support.patch
 Patch315: krb5-1.12ish-tls-plugins.patch
 Patch316: krb5-1.12-nodelete-plugins.patch
+Patch317: krb5-1.12-ksu-untyped-default-ccache-name.patch
 
 License: MIT
 URL: http://web.mit.edu/kerberos/www/
@@ -352,6 +353,7 @@ ln NOTICE LICENSE
 %patch314 -p1 -b .Add-tests-for-MS-KKDCP-client-support
 %patch315 -p1 -b .tls-plugins
 %patch316 -p1 -b .nodelete-plugins
+%patch317 -p1 -b .ksu-untyped-default-ccache-name
 chmod u+x src/util/paste-kdcproxy.py
 
 %patch1 -p1 -b .pwdch-fast
@@ -1067,6 +1069,8 @@ exit 0
 %changelog
 * Mon Sep  8 2014 Nalin Dahyabhai <nalin at redhat.com> - 1.12.2-8
 - fix the problem where the %%license file has been a dangling symlink
+- ksu: pull in fix from pull #206 to avoid breakage when the
+  default_ccache_name doesn't include a cache type as a prefix
 
 * Sat Sep  6 2014 Nalin Dahyabhai <nalin at redhat.com> - 1.12.2-7
 - pull in patch from master to load plugins with RTLD_NODELETE, when


More information about the scm-commits mailing list