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(a)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.
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.
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.
LS