summaryrefslogtreecommitdiff
path: root/source3/winbindd/idmap_tdb.c
diff options
context:
space:
mode:
authorSteven Danneman <steven.danneman@isilon.com>2008-10-27 23:37:55 -0700
committerSteven Danneman <steven.danneman@isilon.com>2008-11-18 16:04:04 -0800
commit00c6271d5cbbfe808b81906d5be2b328e4f25b30 (patch)
treec6ce249e7596290249e8efd3577cd28c12d0d9be /source3/winbindd/idmap_tdb.c
parent041c5cf3b5a2fba6ad49e049601b626d5b04ac3e (diff)
downloadsamba-00c6271d5cbbfe808b81906d5be2b328e4f25b30.tar.gz
samba-00c6271d5cbbfe808b81906d5be2b328e4f25b30.tar.bz2
samba-00c6271d5cbbfe808b81906d5be2b328e4f25b30.zip
Added ability to remove id mappings in wbinfo and libwbclient.
The idmap_tdb backend already provides an interface to remove existing id mappings. This commit plumbs that ability up through, winbindd, libwbclient, and wbinfo. Added new winbindd command: WINBINDD_REMOVE_MAPPING Added new libwbclient interfaces: wbcRemoveUidMapping() and wbcRemoveGidMapping() Added new wbinfo options: --remove-uid-mapping --remove-gid-mapping Increased libwbclient version to 0.2 Increased winbind interface version to 20
Diffstat (limited to 'source3/winbindd/idmap_tdb.c')
-rw-r--r--source3/winbindd/idmap_tdb.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/source3/winbindd/idmap_tdb.c b/source3/winbindd/idmap_tdb.c
index f9d3a9fbff..7c4de5f6fb 100644
--- a/source3/winbindd/idmap_tdb.c
+++ b/source3/winbindd/idmap_tdb.c
@@ -875,8 +875,13 @@ static NTSTATUS idmap_tdb_set_mapping(struct idmap_domain *dom, const struct id_
ksid = string_term_tdb_data(ksidstr);
/* *DELETE* previous mappings if any.
- * This is done both SID and [U|G]ID passed in */
-
+ * This is done for both the SID and [U|G]ID passed in */
+
+ /* NOTE: We should lock both the ksid and kid records here, before
+ * making modifications. However, because tdb_chainlock() is a
+ * blocking call we could create an unrecoverable deadlock, so for now
+ * we only lock the ksid record. */
+
/* Lock the record for this SID. */
if (tdb_chainlock(ctx->tdb, ksid) != 0) {
DEBUG(10,("Failed to lock record %s. Error %s\n",
@@ -981,6 +986,11 @@ static NTSTATUS idmap_tdb_remove_mapping(struct idmap_domain *dom, const struct
ksid = string_term_tdb_data(ksidstr);
kid = string_term_tdb_data(kidstr);
+ /* NOTE: We should lock both the ksid and kid records here, before
+ * making modifications. However, because tdb_chainlock() is a
+ * blocking call we could create an unrecoverable deadlock, so for now
+ * we only lock the ksid record. */
+
/* Lock the record for this SID. */
if (tdb_chainlock(ctx->tdb, ksid) != 0) {
DEBUG(10,("Failed to lock record %s. Error %s\n",