From 70a33bdf7db34fe4d1ba194cf9ea28c758719b4b Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Wed, 16 Nov 2011 13:57:26 +0100 Subject: Refactor saving sdap entities There was too much code duplication between sdap_save_{user,group,netgroup}. This patch removes the most egregious ones. --- src/providers/ldap/sdap_async.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/providers/ldap/sdap_async.h') diff --git a/src/providers/ldap/sdap_async.h b/src/providers/ldap/sdap_async.h index 4ba2770c..f53af1e0 100644 --- a/src/providers/ldap/sdap_async.h +++ b/src/providers/ldap/sdap_async.h @@ -189,4 +189,25 @@ errno_t sdap_check_aliases(struct sysdb_ctx *sysdb, struct sss_domain_info *dom, struct sdap_options *opts, bool steal_memberships); + +errno_t +sdap_attrs_add_ldap_attr(struct sysdb_attrs *ldap_attrs, + const char *attr_name, + const char *attr_desc, + bool multivalued, + const char *name, + struct sysdb_attrs *attrs); + +#define sdap_attrs_add_string(ldap_attrs, attr_name, attr_desc, name, attrs) \ + sdap_attrs_add_ldap_attr(ldap_attrs, attr_name, attr_desc, \ + false, name, attrs) + +#define sdap_attrs_add_list(ldap_attrs, attr_name, attr_desc, name, attrs) \ + sdap_attrs_add_ldap_attr(ldap_attrs, attr_name, attr_desc, \ + true, name, attrs) + +errno_t sdap_save_all_names(const char *name, + struct sysdb_attrs *ldap_attrs, + struct sysdb_attrs *attrs); + #endif /* _SDAP_ASYNC_H_ */ -- cgit