2 Unix SMB/CIFS implementation.
6 Copyright (C) Tim Potter 2000
7 Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2003
8 Copyright (C) Jeremy Allison 2006
9 Copyright (C) Simo Sorce 2003-2006
10 Copyright (C) Michael Adam 2009-2010
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 3 of the License, or
15 (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program. If not, see <http://www.gnu.org/licenses/>.
27 #include "system/filesys.h"
31 #include "dbwrap/dbwrap.h"
32 #include "dbwrap/dbwrap_open.h"
33 #include "../libcli/security/security.h"
37 #define DBGC_CLASS DBGC_IDMAP
39 /* idmap version determines auto-conversion - this is the database
40 structure version specifier. */
42 #define IDMAP_VERSION 2
44 struct idmap_tdb_context {
45 struct db_context *db;
46 struct idmap_rw_ops *rw_ops;
49 /* High water mark keys */
50 #define HWM_GROUP "GROUP HWM"
51 #define HWM_USER "USER HWM"
53 struct convert_fn_state {
54 struct db_context *db;
58 /*****************************************************************************
59 For idmap conversion: convert one record to new format
60 Ancient versions (eg 2.2.3a) of winbindd_idmap.tdb mapped DOMAINNAME/rid
62 *****************************************************************************/
63 static int convert_fn(struct db_record *rec, void *private_data)
65 struct winbindd_domain *domain;
75 struct convert_fn_state *s = (struct convert_fn_state *)private_data;
77 key = dbwrap_record_get_key(rec);
79 DEBUG(10,("Converting %s\n", (const char *)key.dptr));
81 p = strchr((const char *)key.dptr, '/');
86 fstrcpy(dom_name, (const char *)key.dptr);
89 domain = find_domain_from_name(dom_name);
91 /* We must delete the old record. */
92 DEBUG(0,("Unable to find domain %s\n", dom_name ));
93 DEBUG(0,("deleting record %s\n", (const char *)key.dptr ));
95 status = dbwrap_record_delete(rec);
96 if (!NT_STATUS_IS_OK(status)) {
97 DEBUG(0, ("Unable to delete record %s:%s\n",
98 (const char *)key.dptr,
109 sid_compose(&sid, &domain->sid, rid);
111 sid_to_fstring(keystr, &sid);
112 key2 = string_term_tdb_data(keystr);
114 value = dbwrap_record_get_value(rec);
116 status = dbwrap_store(s->db, key2, value, TDB_INSERT);
117 if (!NT_STATUS_IS_OK(status)) {
118 DEBUG(0,("Unable to add record %s:%s\n",
119 (const char *)key2.dptr,
125 status = dbwrap_store(s->db, value, key2, TDB_REPLACE);
126 if (!NT_STATUS_IS_OK(status)) {
127 DEBUG(0,("Unable to update record %s:%s\n",
128 (const char *)value.dptr,
134 status = dbwrap_record_delete(rec);
135 if (!NT_STATUS_IS_OK(status)) {
136 DEBUG(0,("Unable to delete record %s:%s\n",
137 (const char *)key.dptr,
146 /*****************************************************************************
147 Convert the idmap database from an older version.
148 *****************************************************************************/
150 static bool idmap_tdb_upgrade(struct idmap_domain *dom, struct db_context *db)
153 bool bigendianheader;
154 struct convert_fn_state s;
158 /* If we are bigendian, tdb is bigendian if NOT converted. */
161 unsigned char small[2];
164 if (u.small[0] == 0x01)
165 bigendianheader = !(dbwrap_get_flags(db) & TDB_CONVERT);
167 assert(u.small[0] == 0x02);
168 bigendianheader = (dbwrap_get_flags(db) & TDB_CONVERT);
171 bigendianheader = (dbwrap_get_flags(db) & TDB_BIGENDIAN) ? True : False;
173 DEBUG(0, ("Upgrading winbindd_idmap.tdb from an old version\n"));
175 vers = dbwrap_fetch_int32(db, "IDMAP_VERSION");
177 if (((vers == -1) && bigendianheader) || (IREV(vers) == IDMAP_VERSION)) {
178 /* Arrggghh ! Bytereversed or old big-endian - make order independent ! */
180 * high and low records were created on a
181 * big endian machine and will need byte-reversing.
186 wm = dbwrap_fetch_int32(db, HWM_USER);
194 if (dbwrap_store_int32(db, HWM_USER, wm) == -1) {
195 DEBUG(0, ("Unable to byteswap user hwm in idmap database\n"));
199 wm = dbwrap_fetch_int32(db, HWM_GROUP);
206 if (dbwrap_store_int32(db, HWM_GROUP, wm) == -1) {
207 DEBUG(0, ("Unable to byteswap group hwm in idmap database\n"));
215 /* the old format stored as DOMAIN/rid - now we store the SID direct */
216 status = dbwrap_traverse(db, convert_fn, &s, NULL);
218 if (!NT_STATUS_IS_OK(status)) {
219 DEBUG(0, ("Database traverse failed during conversion\n"));
224 DEBUG(0, ("Problem during conversion\n"));
228 if (dbwrap_store_int32(db, "IDMAP_VERSION", IDMAP_VERSION) == -1) {
229 DEBUG(0, ("Unable to store idmap version in database\n"));
236 static NTSTATUS idmap_tdb_init_hwm(struct idmap_domain *dom)
241 bool update_uid = false;
242 bool update_gid = false;
243 struct idmap_tdb_context *ctx;
245 ctx = talloc_get_type(dom->private_data, struct idmap_tdb_context);
247 low_uid = dbwrap_fetch_int32(ctx->db, HWM_USER);
248 if (low_uid == -1 || low_uid < dom->low_id) {
252 low_gid = dbwrap_fetch_int32(ctx->db, HWM_GROUP);
253 if (low_gid == -1 || low_gid < dom->low_id) {
257 if (!update_uid && !update_gid) {
261 if (dbwrap_transaction_start(ctx->db) != 0) {
262 DEBUG(0, ("Unable to start upgrade transaction!\n"));
263 return NT_STATUS_INTERNAL_DB_ERROR;
267 ret = dbwrap_store_int32(ctx->db, HWM_USER, dom->low_id);
269 dbwrap_transaction_cancel(ctx->db);
270 DEBUG(0, ("Unable to initialise user hwm in idmap "
272 return NT_STATUS_INTERNAL_DB_ERROR;
277 ret = dbwrap_store_int32(ctx->db, HWM_GROUP, dom->low_id);
279 dbwrap_transaction_cancel(ctx->db);
280 DEBUG(0, ("Unable to initialise group hwm in idmap "
282 return NT_STATUS_INTERNAL_DB_ERROR;
286 if (dbwrap_transaction_commit(ctx->db) != 0) {
287 DEBUG(0, ("Unable to commit upgrade transaction!\n"));
288 return NT_STATUS_INTERNAL_DB_ERROR;
294 static NTSTATUS idmap_tdb_open_db(struct idmap_domain *dom)
298 char *tdbfile = NULL;
299 struct db_context *db = NULL;
301 bool config_error = false;
302 struct idmap_tdb_context *ctx;
304 ctx = talloc_get_type(dom->private_data, struct idmap_tdb_context);
307 /* it is already open */
311 /* use our own context here */
312 mem_ctx = talloc_stackframe();
314 /* use the old database if present */
315 tdbfile = state_path("winbindd_idmap.tdb");
317 DEBUG(0, ("Out of memory!\n"));
318 ret = NT_STATUS_NO_MEMORY;
322 DEBUG(10,("Opening tdbfile %s\n", tdbfile ));
324 /* Open idmap repository */
325 db = db_open(mem_ctx, tdbfile, 0, TDB_DEFAULT, O_RDWR | O_CREAT, 0644);
327 DEBUG(0, ("Unable to open idmap database\n"));
328 ret = NT_STATUS_UNSUCCESSFUL;
332 /* check against earlier versions */
333 version = dbwrap_fetch_int32(db, "IDMAP_VERSION");
334 if (version != IDMAP_VERSION) {
336 DEBUG(0,("Upgrade of IDMAP_VERSION from %d to %d is not "
337 "possible with incomplete configuration\n",
338 version, IDMAP_VERSION));
339 ret = NT_STATUS_UNSUCCESSFUL;
342 if (dbwrap_transaction_start(db) != 0) {
343 DEBUG(0, ("Unable to start upgrade transaction!\n"));
344 ret = NT_STATUS_INTERNAL_DB_ERROR;
348 if (!idmap_tdb_upgrade(dom, db)) {
349 dbwrap_transaction_cancel(db);
350 DEBUG(0, ("Unable to open idmap database, it's in an old format, and upgrade failed!\n"));
351 ret = NT_STATUS_INTERNAL_DB_ERROR;
355 if (dbwrap_transaction_commit(db) != 0) {
356 DEBUG(0, ("Unable to commit upgrade transaction!\n"));
357 ret = NT_STATUS_INTERNAL_DB_ERROR;
362 ctx->db = talloc_move(ctx, &db);
364 ret = idmap_tdb_init_hwm(dom);
367 talloc_free(mem_ctx);
371 /**********************************************************************
372 IDMAP ALLOC TDB BACKEND
373 **********************************************************************/
375 /**********************************
377 **********************************/
379 struct idmap_tdb_allocate_id_context {
386 static NTSTATUS idmap_tdb_allocate_id_action(struct db_context *db,
390 struct idmap_tdb_allocate_id_context *state;
393 state = (struct idmap_tdb_allocate_id_context *)private_data;
395 hwm = dbwrap_fetch_int32(db, state->hwmkey);
397 ret = NT_STATUS_INTERNAL_DB_ERROR;
401 /* check it is in the range */
402 if (hwm > state->high_hwm) {
403 DEBUG(1, ("Fatal Error: %s range full!! (max: %lu)\n",
404 state->hwmtype, (unsigned long)state->high_hwm));
405 ret = NT_STATUS_UNSUCCESSFUL;
409 /* fetch a new id and increment it */
410 ret = dbwrap_trans_change_uint32_atomic(db, state->hwmkey, &hwm, 1);
411 if (!NT_STATUS_IS_OK(ret)) {
412 DEBUG(0, ("Fatal error while fetching a new %s value: %s\n!",
413 state->hwmtype, nt_errstr(ret)));
417 /* recheck it is in the range */
418 if (hwm > state->high_hwm) {
419 DEBUG(1, ("Fatal Error: %s range full!! (max: %lu)\n",
420 state->hwmtype, (unsigned long)state->high_hwm));
421 ret = NT_STATUS_UNSUCCESSFUL;
432 static NTSTATUS idmap_tdb_allocate_id(struct idmap_domain *dom,
440 struct idmap_tdb_allocate_id_context state;
441 struct idmap_tdb_context *ctx;
443 ctx = talloc_get_type(dom->private_data, struct idmap_tdb_context);
445 /* Get current high water mark */
459 DEBUG(2, ("Invalid ID type (0x%x)\n", xid->type));
460 return NT_STATUS_INVALID_PARAMETER;
463 high_hwm = dom->high_id;
466 state.high_hwm = high_hwm;
467 state.hwmtype = hwmtype;
468 state.hwmkey = hwmkey;
470 status = dbwrap_trans_do(ctx->db, idmap_tdb_allocate_id_action,
473 if (NT_STATUS_IS_OK(status)) {
475 DEBUG(10,("New %s = %d\n", hwmtype, state.hwm));
477 DEBUG(1, ("Error allocating a new %s\n", hwmtype));
484 * Allocate a new unix-ID.
485 * For now this is for the default idmap domain only.
486 * Should be extended later on.
488 static NTSTATUS idmap_tdb_get_new_id(struct idmap_domain *dom,
493 if (!strequal(dom->name, "*")) {
494 DEBUG(3, ("idmap_tdb_get_new_id: "
495 "Refusing allocation of a new unixid for domain'%s'. "
496 "Currently only supported for the default "
499 return NT_STATUS_NOT_IMPLEMENTED;
502 ret = idmap_tdb_allocate_id(dom, id);
507 /**********************************************************************
508 IDMAP MAPPING TDB BACKEND
509 **********************************************************************/
511 /*****************************
512 Initialise idmap database.
513 *****************************/
515 static NTSTATUS idmap_tdb_set_mapping(struct idmap_domain *dom,
516 const struct id_map *map);
518 static NTSTATUS idmap_tdb_db_init(struct idmap_domain *dom)
521 struct idmap_tdb_context *ctx;
523 DEBUG(10, ("idmap_tdb_db_init called for domain '%s'\n", dom->name));
525 ctx = talloc_zero(dom, struct idmap_tdb_context);
527 DEBUG(0, ("Out of memory!\n"));
528 return NT_STATUS_NO_MEMORY;
531 /* load backend specific configuration here: */
533 if (strequal(dom->name, "*")) {
538 ctx->rw_ops = talloc_zero(ctx, struct idmap_rw_ops);
539 if (ctx->rw_ops == NULL) {
540 DEBUG(0, ("Out of memory!\n"));
541 ret = NT_STATUS_NO_MEMORY;
545 ctx->rw_ops->get_new_id = idmap_tdb_get_new_id;
546 ctx->rw_ops->set_mapping = idmap_tdb_set_mapping;
548 dom->private_data = ctx;
550 ret = idmap_tdb_open_db(dom);
551 if ( ! NT_STATUS_IS_OK(ret)) {
564 * store a mapping in the database
567 struct idmap_tdb_set_mapping_context {
572 static NTSTATUS idmap_tdb_set_mapping_action(struct db_context *db,
576 struct idmap_tdb_set_mapping_context *state;
578 state = (struct idmap_tdb_set_mapping_context *)private_data;
580 DEBUG(10, ("Storing %s <-> %s map\n", state->ksidstr, state->kidstr));
582 ret = dbwrap_store_bystring(db, state->ksidstr,
583 string_term_tdb_data(state->kidstr),
585 if (!NT_STATUS_IS_OK(ret)) {
586 DEBUG(0, ("Error storing SID -> ID (%s -> %s): %s\n",
587 state->ksidstr, state->kidstr, nt_errstr(ret)));
591 ret = dbwrap_store_bystring(db, state->kidstr,
592 string_term_tdb_data(state->ksidstr),
594 if (!NT_STATUS_IS_OK(ret)) {
595 DEBUG(0, ("Error storing ID -> SID (%s -> %s): %s\n",
596 state->kidstr, state->ksidstr, nt_errstr(ret)));
600 DEBUG(10,("Stored %s <-> %s\n", state->ksidstr, state->kidstr));
607 static NTSTATUS idmap_tdb_set_mapping(struct idmap_domain *dom,
608 const struct id_map *map)
610 struct idmap_tdb_context *ctx;
612 char *ksidstr, *kidstr;
613 struct idmap_tdb_set_mapping_context state;
615 if (!map || !map->sid) {
616 return NT_STATUS_INVALID_PARAMETER;
619 ksidstr = kidstr = NULL;
621 /* TODO: should we filter a set_mapping using low/high filters ? */
623 ctx = talloc_get_type(dom->private_data, struct idmap_tdb_context);
625 switch (map->xid.type) {
628 kidstr = talloc_asprintf(ctx, "UID %lu",
629 (unsigned long)map->xid.id);
633 kidstr = talloc_asprintf(ctx, "GID %lu",
634 (unsigned long)map->xid.id);
638 DEBUG(2, ("INVALID unix ID type: 0x02%x\n", map->xid.type));
639 return NT_STATUS_INVALID_PARAMETER;
642 if (kidstr == NULL) {
643 DEBUG(0, ("ERROR: Out of memory!\n"));
644 ret = NT_STATUS_NO_MEMORY;
648 ksidstr = sid_string_talloc(ctx, map->sid);
649 if (ksidstr == NULL) {
650 DEBUG(0, ("Out of memory!\n"));
651 ret = NT_STATUS_NO_MEMORY;
655 state.ksidstr = ksidstr;
656 state.kidstr = kidstr;
658 ret = dbwrap_trans_do(ctx->db, idmap_tdb_set_mapping_action, &state);
661 talloc_free(ksidstr);
667 * Create a new mapping for an unmapped SID, also allocating a new ID.
668 * This should be run inside a transaction.
671 * Properly integrate this with multi domain idmap config:
672 * Currently, the allocator is default-config only.
674 static NTSTATUS idmap_tdb_new_mapping(struct idmap_domain *dom, struct id_map *map)
677 struct idmap_tdb_context *ctx;
679 ctx = talloc_get_type(dom->private_data, struct idmap_tdb_context);
681 ret = idmap_rw_new_mapping(dom, ctx->rw_ops, map);
687 /**********************************
688 Single id to sid lookup function.
689 **********************************/
691 static NTSTATUS idmap_tdb_id_to_sid(struct idmap_domain *dom, struct id_map *map)
696 struct idmap_tdb_context *ctx;
699 return NT_STATUS_INVALID_PARAMETER;
702 ctx = talloc_get_type(dom->private_data, struct idmap_tdb_context);
704 /* apply filters before checking */
705 if (!idmap_unix_id_is_in_range(map->xid.id, dom)) {
706 DEBUG(5, ("Requested id (%u) out of range (%u - %u). Filtered!\n",
707 map->xid.id, dom->low_id, dom->high_id));
708 return NT_STATUS_NONE_MAPPED;
711 switch (map->xid.type) {
714 keystr = talloc_asprintf(ctx, "UID %lu", (unsigned long)map->xid.id);
718 keystr = talloc_asprintf(ctx, "GID %lu", (unsigned long)map->xid.id);
722 DEBUG(2, ("INVALID unix ID type: 0x02%x\n", map->xid.type));
723 return NT_STATUS_INVALID_PARAMETER;
726 /* final SAFE_FREE safe */
729 if (keystr == NULL) {
730 DEBUG(0, ("Out of memory!\n"));
731 ret = NT_STATUS_NO_MEMORY;
735 DEBUG(10,("Fetching record %s\n", keystr));
737 /* Check if the mapping exists */
738 ret = dbwrap_fetch_bystring(ctx->db, NULL, keystr, &data);
740 if (!NT_STATUS_IS_OK(ret)) {
741 DEBUG(10,("Record %s not found\n", keystr));
742 ret = NT_STATUS_NONE_MAPPED;
746 if (!string_to_sid(map->sid, (const char *)data.dptr)) {
747 DEBUG(10,("INVALID SID (%s) in record %s\n",
748 (const char *)data.dptr, keystr));
749 ret = NT_STATUS_INTERNAL_DB_ERROR;
753 DEBUG(10,("Found record %s -> %s\n", keystr, (const char *)data.dptr));
757 talloc_free(data.dptr);
762 /**********************************
763 Single sid to id lookup function.
764 **********************************/
766 static NTSTATUS idmap_tdb_sid_to_id(struct idmap_domain *dom, struct id_map *map)
771 unsigned long rec_id = 0;
772 struct idmap_tdb_context *ctx;
773 TALLOC_CTX *tmp_ctx = talloc_stackframe();
775 ctx = talloc_get_type(dom->private_data, struct idmap_tdb_context);
777 keystr = sid_string_talloc(tmp_ctx, map->sid);
778 if (keystr == NULL) {
779 DEBUG(0, ("Out of memory!\n"));
780 ret = NT_STATUS_NO_MEMORY;
784 DEBUG(10,("Fetching record %s\n", keystr));
786 /* Check if sid is present in database */
787 ret = dbwrap_fetch_bystring(ctx->db, tmp_ctx, keystr, &data);
788 if (!NT_STATUS_IS_OK(ret)) {
789 DEBUG(10,("Record %s not found\n", keystr));
790 ret = NT_STATUS_NONE_MAPPED;
794 /* What type of record is this ? */
795 if (sscanf((const char *)data.dptr, "UID %lu", &rec_id) == 1) { /* Try a UID record. */
796 map->xid.id = rec_id;
797 map->xid.type = ID_TYPE_UID;
798 DEBUG(10,("Found uid record %s -> %s \n", keystr, (const char *)data.dptr ));
801 } else if (sscanf((const char *)data.dptr, "GID %lu", &rec_id) == 1) { /* Try a GID record. */
802 map->xid.id = rec_id;
803 map->xid.type = ID_TYPE_GID;
804 DEBUG(10,("Found gid record %s -> %s \n", keystr, (const char *)data.dptr ));
807 } else { /* Unknown record type ! */
808 DEBUG(2, ("Found INVALID record %s -> %s\n", keystr, (const char *)data.dptr));
809 ret = NT_STATUS_INTERNAL_DB_ERROR;
813 /* apply filters before returning result */
814 if (!idmap_unix_id_is_in_range(map->xid.id, dom)) {
815 DEBUG(5, ("Requested id (%u) out of range (%u - %u). Filtered!\n",
816 map->xid.id, dom->low_id, dom->high_id));
817 ret = NT_STATUS_NONE_MAPPED;
821 talloc_free(tmp_ctx);
825 /**********************************
826 lookup a set of unix ids.
827 **********************************/
829 static NTSTATUS idmap_tdb_unixids_to_sids(struct idmap_domain *dom, struct id_map **ids)
834 /* initialize the status to avoid suprise */
835 for (i = 0; ids[i]; i++) {
836 ids[i]->status = ID_UNKNOWN;
839 for (i = 0; ids[i]; i++) {
840 ret = idmap_tdb_id_to_sid(dom, ids[i]);
841 if ( ! NT_STATUS_IS_OK(ret)) {
843 /* if it is just a failed mapping continue */
844 if (NT_STATUS_EQUAL(ret, NT_STATUS_NONE_MAPPED)) {
846 /* make sure it is marked as unmapped */
847 ids[i]->status = ID_UNMAPPED;
851 /* some fatal error occurred, return immediately */
855 /* all ok, id is mapped */
856 ids[i]->status = ID_MAPPED;
865 /**********************************
866 lookup a set of sids.
867 **********************************/
869 struct idmap_tdb_sids_to_unixids_context {
870 struct idmap_domain *dom;
872 bool allocate_unmapped;
875 static NTSTATUS idmap_tdb_sids_to_unixids_action(struct db_context *db,
878 struct idmap_tdb_sids_to_unixids_context *state;
880 NTSTATUS ret = NT_STATUS_OK;
882 state = (struct idmap_tdb_sids_to_unixids_context *)private_data;
884 DEBUG(10, ("idmap_tdb_sids_to_unixids_action: "
885 " domain: [%s], allocate: %s\n",
887 state->allocate_unmapped ? "yes" : "no"));
889 for (i = 0; state->ids[i]; i++) {
890 if ((state->ids[i]->status == ID_UNKNOWN) ||
891 /* retry if we could not map in previous run: */
892 (state->ids[i]->status == ID_UNMAPPED))
896 ret2 = idmap_tdb_sid_to_id(state->dom, state->ids[i]);
897 if (!NT_STATUS_IS_OK(ret2)) {
899 /* if it is just a failed mapping, continue */
900 if (NT_STATUS_EQUAL(ret2, NT_STATUS_NONE_MAPPED)) {
902 /* make sure it is marked as unmapped */
903 state->ids[i]->status = ID_UNMAPPED;
904 ret = STATUS_SOME_UNMAPPED;
906 /* some fatal error occurred, return immediately */
911 /* all ok, id is mapped */
912 state->ids[i]->status = ID_MAPPED;
916 if ((state->ids[i]->status == ID_UNMAPPED) &&
917 state->allocate_unmapped)
919 ret = idmap_tdb_new_mapping(state->dom, state->ids[i]);
920 if (!NT_STATUS_IS_OK(ret)) {
930 static NTSTATUS idmap_tdb_sids_to_unixids(struct idmap_domain *dom, struct id_map **ids)
932 struct idmap_tdb_context *ctx;
935 struct idmap_tdb_sids_to_unixids_context state;
937 /* initialize the status to avoid suprise */
938 for (i = 0; ids[i]; i++) {
939 ids[i]->status = ID_UNKNOWN;
942 ctx = talloc_get_type(dom->private_data, struct idmap_tdb_context);
946 state.allocate_unmapped = false;
948 ret = idmap_tdb_sids_to_unixids_action(ctx->db, &state);
950 if (NT_STATUS_EQUAL(ret, STATUS_SOME_UNMAPPED) && !dom->read_only) {
951 state.allocate_unmapped = true;
952 ret = dbwrap_trans_do(ctx->db,
953 idmap_tdb_sids_to_unixids_action,
961 /**********************************
962 Close the idmap tdb instance
963 **********************************/
965 static struct idmap_methods db_methods = {
966 .init = idmap_tdb_db_init,
967 .unixids_to_sids = idmap_tdb_unixids_to_sids,
968 .sids_to_unixids = idmap_tdb_sids_to_unixids,
969 .allocate_id = idmap_tdb_get_new_id,
972 NTSTATUS idmap_tdb_init(void)
974 DEBUG(10, ("calling idmap_tdb_init\n"));
976 return smb_register_idmap(SMB_IDMAP_INTERFACE_VERSION, "tdb", &db_methods);