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;
246 ctx = talloc_get_type(dom->private_data, struct idmap_tdb_context);
248 status = dbwrap_fetch_uint32(ctx->db, HWM_USER, &low_uid);
249 if (!status || low_uid < dom->low_id) {
253 status = dbwrap_fetch_uint32(ctx->db, HWM_GROUP, &low_gid);
254 if (!status || low_gid < dom->low_id) {
258 if (!update_uid && !update_gid) {
262 if (dbwrap_transaction_start(ctx->db) != 0) {
263 DEBUG(0, ("Unable to start upgrade transaction!\n"));
264 return NT_STATUS_INTERNAL_DB_ERROR;
268 ret = dbwrap_store_uint32(ctx->db, HWM_USER, dom->low_id);
270 dbwrap_transaction_cancel(ctx->db);
271 DEBUG(0, ("Unable to initialise user hwm in idmap "
273 return NT_STATUS_INTERNAL_DB_ERROR;
278 ret = dbwrap_store_uint32(ctx->db, HWM_GROUP, dom->low_id);
280 dbwrap_transaction_cancel(ctx->db);
281 DEBUG(0, ("Unable to initialise group hwm in idmap "
283 return NT_STATUS_INTERNAL_DB_ERROR;
287 if (dbwrap_transaction_commit(ctx->db) != 0) {
288 DEBUG(0, ("Unable to commit upgrade transaction!\n"));
289 return NT_STATUS_INTERNAL_DB_ERROR;
295 static NTSTATUS idmap_tdb_open_db(struct idmap_domain *dom)
299 char *tdbfile = NULL;
300 struct db_context *db = NULL;
302 bool config_error = false;
303 struct idmap_tdb_context *ctx;
305 ctx = talloc_get_type(dom->private_data, struct idmap_tdb_context);
308 /* it is already open */
312 /* use our own context here */
313 mem_ctx = talloc_stackframe();
315 /* use the old database if present */
316 tdbfile = state_path("winbindd_idmap.tdb");
318 DEBUG(0, ("Out of memory!\n"));
319 ret = NT_STATUS_NO_MEMORY;
323 DEBUG(10,("Opening tdbfile %s\n", tdbfile ));
325 /* Open idmap repository */
326 db = db_open(mem_ctx, tdbfile, 0, TDB_DEFAULT, O_RDWR | O_CREAT, 0644);
328 DEBUG(0, ("Unable to open idmap database\n"));
329 ret = NT_STATUS_UNSUCCESSFUL;
333 /* check against earlier versions */
334 version = dbwrap_fetch_int32(db, "IDMAP_VERSION");
335 if (version != IDMAP_VERSION) {
337 DEBUG(0,("Upgrade of IDMAP_VERSION from %d to %d is not "
338 "possible with incomplete configuration\n",
339 version, IDMAP_VERSION));
340 ret = NT_STATUS_UNSUCCESSFUL;
343 if (dbwrap_transaction_start(db) != 0) {
344 DEBUG(0, ("Unable to start upgrade transaction!\n"));
345 ret = NT_STATUS_INTERNAL_DB_ERROR;
349 if (!idmap_tdb_upgrade(dom, db)) {
350 dbwrap_transaction_cancel(db);
351 DEBUG(0, ("Unable to open idmap database, it's in an old format, and upgrade failed!\n"));
352 ret = NT_STATUS_INTERNAL_DB_ERROR;
356 if (dbwrap_transaction_commit(db) != 0) {
357 DEBUG(0, ("Unable to commit upgrade transaction!\n"));
358 ret = NT_STATUS_INTERNAL_DB_ERROR;
363 ctx->db = talloc_move(ctx, &db);
365 ret = idmap_tdb_init_hwm(dom);
368 talloc_free(mem_ctx);
372 /**********************************************************************
373 IDMAP ALLOC TDB BACKEND
374 **********************************************************************/
376 /**********************************
378 **********************************/
380 struct idmap_tdb_allocate_id_context {
387 static NTSTATUS idmap_tdb_allocate_id_action(struct db_context *db,
391 struct idmap_tdb_allocate_id_context *state;
395 state = (struct idmap_tdb_allocate_id_context *)private_data;
397 ret2 = dbwrap_fetch_uint32(db, state->hwmkey, &hwm);
399 ret = NT_STATUS_INTERNAL_DB_ERROR;
403 /* check it is in the range */
404 if (hwm > state->high_hwm) {
405 DEBUG(1, ("Fatal Error: %s range full!! (max: %lu)\n",
406 state->hwmtype, (unsigned long)state->high_hwm));
407 ret = NT_STATUS_UNSUCCESSFUL;
411 /* fetch a new id and increment it */
412 ret = dbwrap_trans_change_uint32_atomic(db, state->hwmkey, &hwm, 1);
413 if (!NT_STATUS_IS_OK(ret)) {
414 DEBUG(0, ("Fatal error while fetching a new %s value: %s\n!",
415 state->hwmtype, nt_errstr(ret)));
419 /* recheck it is in the range */
420 if (hwm > state->high_hwm) {
421 DEBUG(1, ("Fatal Error: %s range full!! (max: %lu)\n",
422 state->hwmtype, (unsigned long)state->high_hwm));
423 ret = NT_STATUS_UNSUCCESSFUL;
434 static NTSTATUS idmap_tdb_allocate_id(struct idmap_domain *dom,
442 struct idmap_tdb_allocate_id_context state;
443 struct idmap_tdb_context *ctx;
445 ctx = talloc_get_type(dom->private_data, struct idmap_tdb_context);
447 /* Get current high water mark */
461 DEBUG(2, ("Invalid ID type (0x%x)\n", xid->type));
462 return NT_STATUS_INVALID_PARAMETER;
465 high_hwm = dom->high_id;
468 state.high_hwm = high_hwm;
469 state.hwmtype = hwmtype;
470 state.hwmkey = hwmkey;
472 status = dbwrap_trans_do(ctx->db, idmap_tdb_allocate_id_action,
475 if (NT_STATUS_IS_OK(status)) {
477 DEBUG(10,("New %s = %d\n", hwmtype, state.hwm));
479 DEBUG(1, ("Error allocating a new %s\n", hwmtype));
486 * Allocate a new unix-ID.
487 * For now this is for the default idmap domain only.
488 * Should be extended later on.
490 static NTSTATUS idmap_tdb_get_new_id(struct idmap_domain *dom,
495 if (!strequal(dom->name, "*")) {
496 DEBUG(3, ("idmap_tdb_get_new_id: "
497 "Refusing allocation of a new unixid for domain'%s'. "
498 "Currently only supported for the default "
501 return NT_STATUS_NOT_IMPLEMENTED;
504 ret = idmap_tdb_allocate_id(dom, id);
509 /**********************************************************************
510 IDMAP MAPPING TDB BACKEND
511 **********************************************************************/
513 /*****************************
514 Initialise idmap database.
515 *****************************/
517 static NTSTATUS idmap_tdb_set_mapping(struct idmap_domain *dom,
518 const struct id_map *map);
520 static NTSTATUS idmap_tdb_db_init(struct idmap_domain *dom)
523 struct idmap_tdb_context *ctx;
525 DEBUG(10, ("idmap_tdb_db_init called for domain '%s'\n", dom->name));
527 ctx = talloc_zero(dom, struct idmap_tdb_context);
529 DEBUG(0, ("Out of memory!\n"));
530 return NT_STATUS_NO_MEMORY;
533 /* load backend specific configuration here: */
535 if (strequal(dom->name, "*")) {
540 ctx->rw_ops = talloc_zero(ctx, struct idmap_rw_ops);
541 if (ctx->rw_ops == NULL) {
542 DEBUG(0, ("Out of memory!\n"));
543 ret = NT_STATUS_NO_MEMORY;
547 ctx->rw_ops->get_new_id = idmap_tdb_get_new_id;
548 ctx->rw_ops->set_mapping = idmap_tdb_set_mapping;
550 dom->private_data = ctx;
552 ret = idmap_tdb_open_db(dom);
553 if ( ! NT_STATUS_IS_OK(ret)) {
566 * store a mapping in the database
569 struct idmap_tdb_set_mapping_context {
574 static NTSTATUS idmap_tdb_set_mapping_action(struct db_context *db,
578 struct idmap_tdb_set_mapping_context *state;
580 state = (struct idmap_tdb_set_mapping_context *)private_data;
582 DEBUG(10, ("Storing %s <-> %s map\n", state->ksidstr, state->kidstr));
584 ret = dbwrap_store_bystring(db, state->ksidstr,
585 string_term_tdb_data(state->kidstr),
587 if (!NT_STATUS_IS_OK(ret)) {
588 DEBUG(0, ("Error storing SID -> ID (%s -> %s): %s\n",
589 state->ksidstr, state->kidstr, nt_errstr(ret)));
593 ret = dbwrap_store_bystring(db, state->kidstr,
594 string_term_tdb_data(state->ksidstr),
596 if (!NT_STATUS_IS_OK(ret)) {
597 DEBUG(0, ("Error storing ID -> SID (%s -> %s): %s\n",
598 state->kidstr, state->ksidstr, nt_errstr(ret)));
602 DEBUG(10,("Stored %s <-> %s\n", state->ksidstr, state->kidstr));
609 static NTSTATUS idmap_tdb_set_mapping(struct idmap_domain *dom,
610 const struct id_map *map)
612 struct idmap_tdb_context *ctx;
614 char *ksidstr, *kidstr;
615 struct idmap_tdb_set_mapping_context state;
617 if (!map || !map->sid) {
618 return NT_STATUS_INVALID_PARAMETER;
621 ksidstr = kidstr = NULL;
623 /* TODO: should we filter a set_mapping using low/high filters ? */
625 ctx = talloc_get_type(dom->private_data, struct idmap_tdb_context);
627 switch (map->xid.type) {
630 kidstr = talloc_asprintf(ctx, "UID %lu",
631 (unsigned long)map->xid.id);
635 kidstr = talloc_asprintf(ctx, "GID %lu",
636 (unsigned long)map->xid.id);
640 DEBUG(2, ("INVALID unix ID type: 0x02%x\n", map->xid.type));
641 return NT_STATUS_INVALID_PARAMETER;
644 if (kidstr == NULL) {
645 DEBUG(0, ("ERROR: Out of memory!\n"));
646 ret = NT_STATUS_NO_MEMORY;
650 ksidstr = sid_string_talloc(ctx, map->sid);
651 if (ksidstr == NULL) {
652 DEBUG(0, ("Out of memory!\n"));
653 ret = NT_STATUS_NO_MEMORY;
657 state.ksidstr = ksidstr;
658 state.kidstr = kidstr;
660 ret = dbwrap_trans_do(ctx->db, idmap_tdb_set_mapping_action, &state);
663 talloc_free(ksidstr);
669 * Create a new mapping for an unmapped SID, also allocating a new ID.
670 * This should be run inside a transaction.
673 * Properly integrate this with multi domain idmap config:
674 * Currently, the allocator is default-config only.
676 static NTSTATUS idmap_tdb_new_mapping(struct idmap_domain *dom, struct id_map *map)
679 struct idmap_tdb_context *ctx;
681 ctx = talloc_get_type(dom->private_data, struct idmap_tdb_context);
683 ret = idmap_rw_new_mapping(dom, ctx->rw_ops, map);
689 /**********************************
690 Single id to sid lookup function.
691 **********************************/
693 static NTSTATUS idmap_tdb_id_to_sid(struct idmap_domain *dom, struct id_map *map)
698 struct idmap_tdb_context *ctx;
701 return NT_STATUS_INVALID_PARAMETER;
704 ctx = talloc_get_type(dom->private_data, struct idmap_tdb_context);
706 /* apply filters before checking */
707 if (!idmap_unix_id_is_in_range(map->xid.id, dom)) {
708 DEBUG(5, ("Requested id (%u) out of range (%u - %u). Filtered!\n",
709 map->xid.id, dom->low_id, dom->high_id));
710 return NT_STATUS_NONE_MAPPED;
713 switch (map->xid.type) {
716 keystr = talloc_asprintf(ctx, "UID %lu", (unsigned long)map->xid.id);
720 keystr = talloc_asprintf(ctx, "GID %lu", (unsigned long)map->xid.id);
724 DEBUG(2, ("INVALID unix ID type: 0x02%x\n", map->xid.type));
725 return NT_STATUS_INVALID_PARAMETER;
728 /* final SAFE_FREE safe */
731 if (keystr == NULL) {
732 DEBUG(0, ("Out of memory!\n"));
733 ret = NT_STATUS_NO_MEMORY;
737 DEBUG(10,("Fetching record %s\n", keystr));
739 /* Check if the mapping exists */
740 ret = dbwrap_fetch_bystring(ctx->db, NULL, keystr, &data);
742 if (!NT_STATUS_IS_OK(ret)) {
743 DEBUG(10,("Record %s not found\n", keystr));
744 ret = NT_STATUS_NONE_MAPPED;
748 if (!string_to_sid(map->sid, (const char *)data.dptr)) {
749 DEBUG(10,("INVALID SID (%s) in record %s\n",
750 (const char *)data.dptr, keystr));
751 ret = NT_STATUS_INTERNAL_DB_ERROR;
755 DEBUG(10,("Found record %s -> %s\n", keystr, (const char *)data.dptr));
759 talloc_free(data.dptr);
764 /**********************************
765 Single sid to id lookup function.
766 **********************************/
768 static NTSTATUS idmap_tdb_sid_to_id(struct idmap_domain *dom, struct id_map *map)
773 unsigned long rec_id = 0;
774 struct idmap_tdb_context *ctx;
775 TALLOC_CTX *tmp_ctx = talloc_stackframe();
777 ctx = talloc_get_type(dom->private_data, struct idmap_tdb_context);
779 keystr = sid_string_talloc(tmp_ctx, map->sid);
780 if (keystr == NULL) {
781 DEBUG(0, ("Out of memory!\n"));
782 ret = NT_STATUS_NO_MEMORY;
786 DEBUG(10,("Fetching record %s\n", keystr));
788 /* Check if sid is present in database */
789 ret = dbwrap_fetch_bystring(ctx->db, tmp_ctx, keystr, &data);
790 if (!NT_STATUS_IS_OK(ret)) {
791 DEBUG(10,("Record %s not found\n", keystr));
792 ret = NT_STATUS_NONE_MAPPED;
796 /* What type of record is this ? */
797 if (sscanf((const char *)data.dptr, "UID %lu", &rec_id) == 1) { /* Try a UID record. */
798 map->xid.id = rec_id;
799 map->xid.type = ID_TYPE_UID;
800 DEBUG(10,("Found uid record %s -> %s \n", keystr, (const char *)data.dptr ));
803 } else if (sscanf((const char *)data.dptr, "GID %lu", &rec_id) == 1) { /* Try a GID record. */
804 map->xid.id = rec_id;
805 map->xid.type = ID_TYPE_GID;
806 DEBUG(10,("Found gid record %s -> %s \n", keystr, (const char *)data.dptr ));
809 } else { /* Unknown record type ! */
810 DEBUG(2, ("Found INVALID record %s -> %s\n", keystr, (const char *)data.dptr));
811 ret = NT_STATUS_INTERNAL_DB_ERROR;
815 /* apply filters before returning result */
816 if (!idmap_unix_id_is_in_range(map->xid.id, dom)) {
817 DEBUG(5, ("Requested id (%u) out of range (%u - %u). Filtered!\n",
818 map->xid.id, dom->low_id, dom->high_id));
819 ret = NT_STATUS_NONE_MAPPED;
823 talloc_free(tmp_ctx);
827 /**********************************
828 lookup a set of unix ids.
829 **********************************/
831 static NTSTATUS idmap_tdb_unixids_to_sids(struct idmap_domain *dom, struct id_map **ids)
836 /* initialize the status to avoid suprise */
837 for (i = 0; ids[i]; i++) {
838 ids[i]->status = ID_UNKNOWN;
841 for (i = 0; ids[i]; i++) {
842 ret = idmap_tdb_id_to_sid(dom, ids[i]);
843 if ( ! NT_STATUS_IS_OK(ret)) {
845 /* if it is just a failed mapping continue */
846 if (NT_STATUS_EQUAL(ret, NT_STATUS_NONE_MAPPED)) {
848 /* make sure it is marked as unmapped */
849 ids[i]->status = ID_UNMAPPED;
853 /* some fatal error occurred, return immediately */
857 /* all ok, id is mapped */
858 ids[i]->status = ID_MAPPED;
867 /**********************************
868 lookup a set of sids.
869 **********************************/
871 struct idmap_tdb_sids_to_unixids_context {
872 struct idmap_domain *dom;
874 bool allocate_unmapped;
877 static NTSTATUS idmap_tdb_sids_to_unixids_action(struct db_context *db,
880 struct idmap_tdb_sids_to_unixids_context *state;
882 NTSTATUS ret = NT_STATUS_OK;
884 state = (struct idmap_tdb_sids_to_unixids_context *)private_data;
886 DEBUG(10, ("idmap_tdb_sids_to_unixids_action: "
887 " domain: [%s], allocate: %s\n",
889 state->allocate_unmapped ? "yes" : "no"));
891 for (i = 0; state->ids[i]; i++) {
892 if ((state->ids[i]->status == ID_UNKNOWN) ||
893 /* retry if we could not map in previous run: */
894 (state->ids[i]->status == ID_UNMAPPED))
898 ret2 = idmap_tdb_sid_to_id(state->dom, state->ids[i]);
899 if (!NT_STATUS_IS_OK(ret2)) {
901 /* if it is just a failed mapping, continue */
902 if (NT_STATUS_EQUAL(ret2, NT_STATUS_NONE_MAPPED)) {
904 /* make sure it is marked as unmapped */
905 state->ids[i]->status = ID_UNMAPPED;
906 ret = STATUS_SOME_UNMAPPED;
908 /* some fatal error occurred, return immediately */
913 /* all ok, id is mapped */
914 state->ids[i]->status = ID_MAPPED;
918 if ((state->ids[i]->status == ID_UNMAPPED) &&
919 state->allocate_unmapped)
921 ret = idmap_tdb_new_mapping(state->dom, state->ids[i]);
922 if (!NT_STATUS_IS_OK(ret)) {
932 static NTSTATUS idmap_tdb_sids_to_unixids(struct idmap_domain *dom, struct id_map **ids)
934 struct idmap_tdb_context *ctx;
937 struct idmap_tdb_sids_to_unixids_context state;
939 /* initialize the status to avoid suprise */
940 for (i = 0; ids[i]; i++) {
941 ids[i]->status = ID_UNKNOWN;
944 ctx = talloc_get_type(dom->private_data, struct idmap_tdb_context);
948 state.allocate_unmapped = false;
950 ret = idmap_tdb_sids_to_unixids_action(ctx->db, &state);
952 if (NT_STATUS_EQUAL(ret, STATUS_SOME_UNMAPPED) && !dom->read_only) {
953 state.allocate_unmapped = true;
954 ret = dbwrap_trans_do(ctx->db,
955 idmap_tdb_sids_to_unixids_action,
963 /**********************************
964 Close the idmap tdb instance
965 **********************************/
967 static struct idmap_methods db_methods = {
968 .init = idmap_tdb_db_init,
969 .unixids_to_sids = idmap_tdb_unixids_to_sids,
970 .sids_to_unixids = idmap_tdb_sids_to_unixids,
971 .allocate_id = idmap_tdb_get_new_id,
974 NTSTATUS idmap_tdb_init(void)
976 DEBUG(10, ("calling idmap_tdb_init\n"));
978 return smb_register_idmap(SMB_IDMAP_INTERFACE_VERSION, "tdb", &db_methods);