<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 02/01/2013 06:32 AM, Pavel Březina wrote:
    <blockquote cite="mid:510BA7DF.7020200@redhat.com" type="cite">On
      01/31/2013 08:07 PM, Jakub Hrozek wrote:
      <br>
      <blockquote type="cite">On Thu, Jan 31, 2013 at 11:52:53AM +0100,
        Pavel Březina wrote:
        <br>
        <blockquote type="cite"><a class="moz-txt-link-freetext" href="https://fedorahosted.org/sssd/ticket/1795">https://fedorahosted.org/sssd/ticket/1795</a>
          <br>
        </blockquote>
        <br>
        <blockquote type="cite"> From
          aba6be77012e2c4f741d78e887f9524b869b78ae Mon Sep 17 00:00:00
          2001
          <br>
          From: =?UTF-8?q?Pavel=20B=C5=99ezina?=
          <a class="moz-txt-link-rfc2396E" href="mailto:pbrezina@redhat.com">&lt;pbrezina@redhat.com&gt;</a>
          <br>
          Date: Thu, 31 Jan 2013 11:21:06 +0100
          <br>
          Subject: [PATCH 1/2] util: add replace_char() function
          <br>
          <br>
          Replace all occurrences of character in string with other
          character.
          <br>
        </blockquote>
        <br>
        Please add a unit test for new utility functions. I know that
        this is
        <br>
        a trivial C function, but in general I think we should start to
        be far
        <br>
        stricter especially with new code now that we are not rushing
        for a deadline.
        <br>
      </blockquote>
      <br>
      No, thank you.
      <br>
      <br>
      <br>
      Just kidding :-) I switched to the condition below, which is not
      generic enough to create a separate utility function.
      <br>
      <br>
      <blockquote type="cite">
        <br>
        I would also say that we should be even more defensive because
        currently
        <br>
        the libkrb5 code only allows these file names (see valid_name()
        function
        <br>
        in src/util/profile/prof_parse.c):
        <br>
        <br>
        if (!isalnum((unsigned char)*p) &amp;&amp; *p != '-' &amp;&amp;
        *p != '_')
        <br>
           return invalid;
        <br>
        <br>
        So in my opinion we should replace any character that doesn't
        match the
        <br>
        above. Dot would be the typical case, but I don't think we
        guarantee
        <br>
        that other weird characters don't appear in the domain name.
        Debugging
        <br>
        why the file didn't load would then be very hard.
        <br>
      </blockquote>
      <br>
      I tried $ and @ characters in addition to dot and we fail to
      initialize
      <br>
      D-Bus with those characters present. They must be escaped to be
      used in
      <br>
      D-Bus.
      <br>
      <br>
    </blockquote>
    <br>
    I suggest we create a ticket for the SSSD to add validation to the
    code that reads config from the file. The validation would make sure
    that names of the domains would not create dups once converted. I do
    not think such check belongs to ding-libs but I see how such check
    can be easily implemented in the code that Ondra is currently
    refactoring.<br>
    I can easily see how I can solve it using libcollection. It would be
    cheaper and faster than using dhash as number of domains is expected
    to be low.<br>
    <br>
    <blockquote cite="mid:510BA7DF.7020200@redhat.com" type="cite">
      <blockquote type="cite">Maybe make it clear with the function name
        that the replace is not done
        <br>
        in-place?
        <br>
        <br>
        <blockquote type="cite">+{
          <br>
          +    char *str = NULL;
          <br>
          +    char *pos = NULL;
          <br>
          +
          <br>
        </blockquote>
        <br>
        You don't need to initialize the pointers here as they are
        assigned on
        <br>
        the next line..
        <br>
      </blockquote>
      <br>
      I know. It is my habit to always initialize variables (except
      ret).
      <br>
      <br>
      New patch is attached.
      <br>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
sssd-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sssd-devel@lists.fedorahosted.org">sssd-devel@lists.fedorahosted.org</a>
<a class="moz-txt-link-freetext" href="https://lists.fedorahosted.org/mailman/listinfo/sssd-devel">https://lists.fedorahosted.org/mailman/listinfo/sssd-devel</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Thank you,
Dmitri Pal

Sr. Engineering Manager for IdM portfolio
Red Hat Inc.


-------------------------------
Looking to carve out IT costs?
<a class="moz-txt-link-abbreviated" href="http://www.redhat.com/carveoutcosts/">www.redhat.com/carveoutcosts/</a>


</pre>
  </body>
</html>