summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap/sdap_async.h
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2011-11-16 13:57:26 +0100
committerStephen Gallagher <sgallagh@redhat.com>2011-12-16 14:46:16 -0500
commit70a33bdf7db34fe4d1ba194cf9ea28c758719b4b (patch)
tree4f93e18380fe1ca2d41fca0b5c8fb9d8b77ee781 /src/providers/ldap/sdap_async.h
parentb3b42c49656e192787a983aaa8b9ec744ba4cb9d (diff)
downloadsssd-70a33bdf7db34fe4d1ba194cf9ea28c758719b4b.tar.gz
sssd-70a33bdf7db34fe4d1ba194cf9ea28c758719b4b.tar.xz
sssd-70a33bdf7db34fe4d1ba194cf9ea28c758719b4b.zip
Refactor saving sdap entities
There was too much code duplication between sdap_save_{user,group,netgroup}. This patch removes the most egregious ones.
Diffstat (limited to 'src/providers/ldap/sdap_async.h')
-rw-r--r--src/providers/ldap/sdap_async.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/providers/ldap/sdap_async.h b/src/providers/ldap/sdap_async.h
index 4ba2770c9..f53af1e01 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_ */