[SSSD] [PATCH] Fix python HBAC bindings for python <= 2.4

Jakub Hrozek jhrozek at redhat.com
Wed Jul 13 08:45:13 UTC 2011


On 07/12/2011 04:40 PM, Alexander Bokovoy wrote:
> Hi Jakub,
> 
> (sorry for breaking the thread, I forgot to subscribe to the list 
> earlier and thus got no reference to the thread).
> 
> I would NACK the patch. Few issues:
> 
> 1. char *str_concat_sequence(PyObject *seq, char *delim) use is always 
> with constant delim, it would make sense to change the signature to 
> follow it.
> 

Fixed in patch #1

> 2. discard_const_p() for Python 2.4 is a bit too wide use as it weakens 
> 2.6 (and 3.0) API usage. What if you make a simple wrapper on top of 
> discard_const_p() that is ident to it for 2.4 but returns the actual 
> value without type conversion for other cases.
> 
> Something like this:
> #if PYTHON_2_4
> #define sss_py_const_p(type, value) discard_const_p(type, (value))
> #else
> #define sss_py_const_p(type, value) (value)
> #endif
> 

Fixed in patch #2

> 3. hbac_rule_set_enabled() currently is too strict, it accepts only 
> Python's boolean. In FreeIPA LDAP backend returned values are strings so 
> we'll have to build up a wrapper on top of pyhbac. What about be more 
> flexible and accepting what FreeIPA's Bool parameter type accepts:
>   ('truths', frozenset, frozenset([1, u'1', u'true', u'TRUE'])),
>   ('falsehoods', frozenset, frozenset([0, u'0', u'false', u'FALSE']))
> 

Fixed in patch #1

> This would be needed only for setter, getter would always give out PyBool.
> 
> Please split the patch into two -- compatibility fixes and API improvements.
> 

Done. Thank you for the review. New patches are attached.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fixes-for-python-HBAC-bindings.patch
Type: text/x-patch
Size: 8028 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20110713/2702d0f9/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Fix-python-HBAC-bindings-for-python-2.4.patch
Type: text/x-patch
Size: 26622 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20110713/2702d0f9/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20110713/2702d0f9/attachment.sig>


More information about the sssd-devel mailing list