>From f824088d3351258a13ca5390e0061e34348f235f Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Wed, 23 Jan 2013 17:17:38 +0100 Subject: [PATCH 1/2] SYSDB: make the sss_ldb_modify_permissive function public --- src/db/sysdb.h | 4 ++++ src/db/sysdb_ops.c | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/db/sysdb.h b/src/db/sysdb.h index d4af5fa6bb46dfb2656924f319369d495d52a004..5c33ab287319b92f579038f1376328cc6517ff06 100644 --- a/src/db/sysdb.h +++ b/src/db/sysdb.h @@ -482,6 +482,10 @@ int sysdb_get_netgroup_attr(TALLOC_CTX *mem_ctx, * they have to be called within a transaction * See sysdb_transaction_send()/_recv() */ +/* Permissive modify */ +int sss_ldb_modify_permissive(struct ldb_context *ldb, + struct ldb_message *msg); + /* Delete Entry */ int sysdb_delete_entry(struct sysdb_ctx *sysdb, struct ldb_dn *dn, diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c index 46ab64d3913fff43ecf9d1c010ef36bf0cd19feb..0fb8ed49ea16e602179baec4c604cef95c05e7ea 100644 --- a/src/db/sysdb_ops.c +++ b/src/db/sysdb_ops.c @@ -74,8 +74,13 @@ static uint32_t get_attr_as_uint32(struct ldb_message *msg, const char *attr) return l; } -static int sss_ldb_modify_permissive(struct ldb_context *ldb, - struct ldb_message *msg) +/* + * The wrapper around ldb_modify that uses LDB_CONTROL_PERMISSIVE_MODIFY_OID + * so that on adds entries that already exist are skipped and similarly + * entries that are missing are ignored on deletes + */ +int sss_ldb_modify_permissive(struct ldb_context *ldb, + struct ldb_message *msg) { struct ldb_request *req; int ret = EOK; -- 1.8.1