[SSSD] [PATCH] Use keytab to select etypes for krb5_get_init_creds_keytab()

Jakub Hrozek jhrozek at redhat.com
Mon May 7 13:38:47 UTC 2012


On Mon, May 07, 2012 at 02:37:00PM +0200, Stef Walter wrote:
> On 05/07/2012 02:12 PM, Jakub Hrozek wrote:
> > I only have two comments related to code style:
> > 
> > +    TALLOC_CTX *memctx;
> > +    int n_etype_list;
> > +
> > +    memctx = talloc_new (NULL);
> > 
> > We usually call such memory context tmp_ctx so that it's clear it's a
> > short-lived context used only inside this function.
> > 
> > +        krb5_get_init_creds_opt_set_etype_list (&options, etype_list,
> >                                                ^^^
> > We don't use a space between a function name and the arguments list.
> 
> Thanks. Fixed. Attached.
> 
> Stef
> 

I missed one more thing, the second tmp_ctx used in
sss_krb5_read_etypes_for_keytab should have been allocated on top of
NULL, not memctx.

Ack, but please squash in the attached one liner before pushing.
-------------- next part --------------
>From f1b476e25122e07b712eaea4996e5ea06e9dd1a5 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek at redhat.com>
Date: Mon, 7 May 2012 15:05:07 +0200
Subject: [PATCH] Allocate the tmp_ctx on NULL

---
 src/util/sss_krb5.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/util/sss_krb5.c b/src/util/sss_krb5.c
index 432c1d4a31c82cc5f114fc751d7f81bf2b31a6d2..a59afb26e8a5211ae731df5d64d9f2010f5c896d 100644
--- a/src/util/sss_krb5.c
+++ b/src/util/sss_krb5.c
@@ -1045,7 +1045,7 @@ sss_krb5_read_etypes_for_keytab(TALLOC_CTX *mem_ctx,
     int count = 0;
     int ret;
 
-    tmp_ctx = talloc_new(mem_ctx);
+    tmp_ctx = talloc_new(NULL);
     if (!tmp_ctx) return ENOMEM;
 
     ret = krb5_kt_start_seq_get(context, keytab, &cursor);
-- 
1.7.7.6



More information about the sssd-devel mailing list