[Freeipa-devel] [PATCH] 1058 clear session key

Rob Crittenden rcritten at redhat.com
Wed Oct 3 15:49:52 UTC 2012


Martin Kosek wrote:
> On 10/02/2012 08:23 PM, Rob Crittenden wrote:
>> Clear the host session key when enrolling a client.
>>
>> Make sure dbdir is preserved when a new connection is created.
>>
>> rob
>>
>
> I tested repeatedly installing, uninstalling client and unlike previously, I
> did not receive any NSS initialization error. Other test were also OK for me,
> so generally I agree with the patch.
>
> I just see one potential issue in this section:
>
>
> +                if (current_conn is not None and
> +                  hasattr(current_conn.conn._ServerProxy__transport, 'dbdir')):
> +                    dbdir = current_conn.conn._ServerProxy__transport.dbdir
> +                    self.debug('Using dbdir %s' % dbdir)
>
> If I understand that correctly, dbdir attribute in
> current_conn.conn._ServerProxy__transport may be changed by other thread, i.e.
> I would rather do something like that:
>
> if current_conn is not None:
>      dbdir = getattr(current_conn.conn._ServerProxy__transport, 'dbdir', None)
>      if dbdir is not None:
>          self.debug('Using dbdir %s' % dbdir)
>
> I did not reproduce that, but I'd be afraid that some other thread may remove
> 'dbdir' right after our hasattr check, so the next statement would fail.
>
> Martin

Good idea, can't be too safe.

rob


-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-rcrit-1058-2-client.patch
Type: text/x-diff
Size: 4625 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20121003/dab7ee68/attachment.bin>


More information about the Freeipa-devel mailing list