[SSSD] [RFC] Use of DP_ERR_* codes

Pavel Březina pbrezina at redhat.com
Fri Nov 6 14:51:30 UTC 2015


Hi!

Since we have pretty nice custom error codes, I would like to get rid of 
DP_ERR_* codes. They are practically useless and are adding non-trivial 
complexity to the code.

I did only a quick look so it is possible that I missed something, but 
let's talk about it. We have the following codes:

> #define DP_ERR_OK 0

DP_ERR_OK is usually used in combination with EOK and in most cases it 
is treated as error (or worse not handled at all). There are some 
situations when DP_ERR_OK and !EOK is used, it is mostly in combination 
with PAM error code and access control, but we can handle this with 
custom error codes.

> #define DP_ERR_OFFLINE 1

DP_ERR_OFFLINE means EAGAIN, always. This should be changed to 
ERR_OFFLINE or similar custom error code.

> #define DP_ERR_TIMEOUT 2

This is not used at all.

> #define DP_ERR_FATAL 3

This is other than EOK code and should be avoided.

Having only one error code from sdap operations would simplify code flow 
and make the code less error prone.

In my opinion this should be part of or even prerequisite to ldap 
provider and sdap_id_op refactoring.





More information about the sssd-devel mailing list