[SSSD] [PATCHES] krb5: new option krb5_map_user

Pavel Reichl preichl at redhat.com
Thu Apr 30 12:13:04 UTC 2015



On 04/30/2015 02:02 PM, Lukas Slebodnik wrote:
> On (30/04/15 13:45), Pavel Reichl wrote:
>> On 04/29/2015 07:00 PM, Lukas Slebodnik wrote:
>>> On (29/04/15 12:21), Pavel Reichl wrote:
>>>> Hello,
>>>>
>>>> please see attached patches, thanks!
>>> >From e824d4aa1051bf405243deb06cef1e05ed3ffd25 Mon Sep 17 00:00:00 2001
>>>> From: Pavel Reichl <preichl at redhat.com>
>>>> Date: Fri, 27 Feb 2015 11:37:50 -0500
>>>> Subject: [PATCH 1/3] krb5: new option krb5_map_user
>>>>
>>>> New option `krb5_map_user` providing mapping of ID provider names to
>>>> Kerberos principals.
>>>>
>>>> Resolves:
>>>> https://fedorahosted.org/sssd/ticket/2509
>>>> ---
>>>> src/config/SSSDConfig/__init__.py.in     |   1 +
>>>> src/config/SSSDConfigTest.py             |   9 ++-
>>>> src/config/etc/sssd.api.d/sssd-ad.conf   |   1 +
>>>> src/config/etc/sssd.api.d/sssd-ipa.conf  |   1 +
>>>> src/config/etc/sssd.api.d/sssd-krb5.conf |   1 +
>>>> src/man/sssd-krb5.5.xml                  |  26 ++++++++
>>>> src/providers/ad/ad_opts.h               |   1 +
>>>> src/providers/ipa/ipa_opts.h             |   1 +
>>>> src/providers/krb5/krb5_access.c         |   4 +-
>>>> src/providers/krb5/krb5_auth.c           |  40 +++++++++++-
>>>> src/providers/krb5/krb5_auth.h           |   2 +
>>>> src/providers/krb5/krb5_common.h         |   9 +++
>>>> src/providers/krb5/krb5_init_shared.c    | 101 +++++++++++++++++++++++++++++++
>>>> src/providers/krb5/krb5_opts.h           |   1 +
>>>> src/util/util.c                          |  56 +++++++++++++++++
>>>> src/util/util.h                          |   6 ++
>>>> 16 files changed, 254 insertions(+), 6 deletions(-)
>>>>
>>>> diff --git a/src/util/util.c b/src/util/util.c
>>>> index 613c559bb2002686c7833642d0946e46e5a9b5d6..a3da6c51d2b92a529b03632a26b6e07569b5da77 100644
>>>> --- a/src/util/util.c
>>>> +++ b/src/util/util.c
>>>> @@ -30,6 +30,62 @@
>>>> #include "util/util.h"
>>>> #include "util/sss_utf8.h"
>>>>
>>>> +errno_t split_str(TALLOC_CTX *mem_ctx,
>>>> +                  const char delimiter,
>>>> +                  char *str,
>>>> +                  char **_first,
>>>> +                  char **_second)
>>>> +{
>>> Why do we need new function split_str?
>>> We already have function split_on_separator.
>> split_on_separator() does super set of split_str(),
> Agree
>
>> code is IMO better with split_str() which is sufficient here.
> IMHO it is just premature optimization.
It's not about speed or memory usage, its about code readability. 
Interface of split_str() is simpler.  Only point to discussion I see is 
that I could probably use split_on_separator() to implement split_str().

Functionality of split_str()  in actually not new. It's used in many 
places ad hoc as part of other functions.
>
> Did you do performance testing?
> How much faster is function split_str?
>
> I'm sorry I cannot see a reason for two function with the same functionality.
not same as you agreed
> It make sense to "optimize" only if you have performance results
> and function is called very often.
>
> So please reuse existing function unless all previous statements are true.
No.
>
> LS
> _______________________________________________
> sssd-devel mailing list
> sssd-devel at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/sssd-devel




More information about the sssd-devel mailing list