[SSSD] [PATCH] krb5 tgt renewal: fix usage of ldb_dn_get_component_val()

Sumit Bose sbose at redhat.com
Wed Dec 19 17:43:51 UTC 2012


Hi,

which this patch Kerberos ticket renewal after reboot should work again.

bye,
Sumit
-------------- next part --------------
From 9a82919e0f480dcdbac17865b371d9c565a3445e Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose at redhat.com>
Date: Wed, 19 Dec 2012 18:37:32 +0100
Subject: [PATCH] krb5 tgt renewal: fix usage of ldb_dn_get_component_val()

For some reason I was under the impression that the DN components are
counted backwards in libldb. This patch corrects this.
---
 src/providers/krb5/krb5_renew_tgt.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/providers/krb5/krb5_renew_tgt.c b/src/providers/krb5/krb5_renew_tgt.c
index ccb7e6a..b5eee69 100644
--- a/src/providers/krb5/krb5_renew_tgt.c
+++ b/src/providers/krb5/krb5_renew_tgt.c
@@ -423,11 +423,11 @@ static errno_t check_ccache_files(struct renew_tgt_ctx *renew_tgt_ctx)
             continue;
         }
 
-        /* The DNs of users in sysdb ends with ...,cn=domain.name,cn=sysdb, so
-         * the value of the component before the last (index 1) is the domain
-         * name. */
+        /* The DNs of users in sysdb looks like
+         * name=username,cn=users,cn=domain.name,cn=sysdb
+         * the value of the third component (index 2) is the domain name. */
 
-        user_dom_val = ldb_dn_get_component_val(msgs[c]->dn, 1);
+        user_dom_val = ldb_dn_get_component_val(msgs[c]->dn, 2);
         if (user_dom_val == NULL) {
             DEBUG(SSSDBG_OP_FAILURE, ("Invalid user DN [%s].\n",
                                       ldb_dn_get_linearized(msgs[c]->dn)));
-- 
1.7.7.6



More information about the sssd-devel mailing list