[SSSD] [PATCH] COLLECTION Copy collection flat with concatenated names

Stephen Gallagher sgallagh at redhat.com
Tue Sep 8 10:56:46 UTC 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 09/07/2009 10:05 AM, Jakub Hrozek wrote:
> On 09/05/2009 02:32 AM, Dmitri Pal wrote:
>> See patch comment.
>> This patch most likely will not apply cleanly without my previous ELAPI
>> patches.
>> So far it is 4 th pending patch.
>> More to come.
> 
> In general, I think the patch is OK. Some comments, though:
> 
> * col_copy_traverse_handler got pretty long, one function now accounts
> for more that 200 lines doing different things, esp. with different copy
> mode handling. Maybe it would be more readable if it was split into
> smaller ones?
> 
> * the copy mode could be made unsigned (or even enum copy_mode {...}),
> you wouldn't have to test for mode<0
> 
> * if you really need assigning const* to non-const*, can you just use
> something like the discard_const_p macro in server/util/util.h, I think
> it's way better that memcpy-ing the memory
> 
> 	Jakub

I think I prefer Dmitri's approach here, actually. name_to_use is not
under Dmitri's control (unless I'm misreading the patch), so it's
theoretically possible for the owner of that memory to change its
contents underneath you. If you're going to need that data to remain
constant and trustworthy further on in the code (e.g. used for
comparisons), you need to copy its current state.
_______________________________________________
sssd-devel mailing list
sssd-devel at lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/sssd-devel

- -- 
Stephen Gallagher
RHCE 804006346421761

Looking to carve out IT costs?
www.redhat.com/carveoutcosts/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkqmOGkACgkQeiVVYja6o6PJaQCeK5w8DxkaQIqwgkovfB4N8+ye
VisAnifuUxLIzMEHkcx5zhh7fl6xZ7W/
=e6rl
-----END PGP SIGNATURE-----



More information about the sssd-devel mailing list