2 Unix SMB/CIFS implementation.
4 idmap TDB2 backend, used for clustered Samba setups.
6 This uses dbwrap to access tdb files. The location can be set
7 using tdb:idmap2.tdb =" in smb.conf
9 Copyright (C) Andrew Tridgell 2007
11 This is heavily based upon idmap_tdb.c, which is:
13 Copyright (C) Tim Potter 2000
14 Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2003
15 Copyright (C) Jeremy Allison 2006
16 Copyright (C) Simo Sorce 2003-2006
17 Copyright (C) Michael Adam 2009-2010
19 This program is free software; you can redistribute it and/or modify
20 it under the terms of the GNU General Public License as published by
21 the Free Software Foundation; either version 2 of the License, or
22 (at your option) any later version.
24 This program is distributed in the hope that it will be useful,
25 but WITHOUT ANY WARRANTY; without even the implied warranty of
26 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 GNU General Public License for more details.
29 You should have received a copy of the GNU General Public License
30 along with this program; if not, write to the Free Software
31 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
41 #define DBGC_CLASS DBGC_IDMAP
43 struct idmap_tdb2_context
{
44 struct db_context
*db
;
45 const char *script
; /* script to provide idmaps */
46 struct idmap_rw_ops
*rw_ops
;
49 /* High water mark keys */
50 #define HWM_GROUP "GROUP HWM"
51 #define HWM_USER "USER HWM"
55 * check and initialize high/low water marks in the db
57 static NTSTATUS
idmap_tdb2_init_hwm(struct idmap_domain
*dom
)
60 struct idmap_tdb2_context
*ctx
;
62 ctx
= talloc_get_type(dom
->private_data
, struct idmap_tdb2_context
);
64 /* Create high water marks for group and user id */
66 low_id
= dbwrap_fetch_int32(ctx
->db
, HWM_USER
);
67 if ((low_id
== -1) || (low_id
< dom
->low_id
)) {
68 if (!NT_STATUS_IS_OK(dbwrap_trans_store_int32(
71 DEBUG(0, ("Unable to initialise user hwm in idmap "
73 return NT_STATUS_INTERNAL_DB_ERROR
;
77 low_id
= dbwrap_fetch_int32(ctx
->db
, HWM_GROUP
);
78 if ((low_id
== -1) || (low_id
< dom
->low_id
)) {
79 if (!NT_STATUS_IS_OK(dbwrap_trans_store_int32(
82 DEBUG(0, ("Unable to initialise group hwm in idmap "
84 return NT_STATUS_INTERNAL_DB_ERROR
;
93 open the permanent tdb
95 static NTSTATUS
idmap_tdb2_open_db(struct idmap_domain
*dom
)
98 struct idmap_tdb2_context
*ctx
;
100 ctx
= talloc_get_type(dom
->private_data
, struct idmap_tdb2_context
);
103 /* its already open */
107 db_path
= lp_parm_talloc_string(-1, "tdb", "idmap2.tdb", NULL
);
108 if (db_path
== NULL
) {
109 /* fall back to the private directory, which, despite
110 its name, is usually on shared storage */
111 db_path
= talloc_asprintf(NULL
, "%s/idmap2.tdb", lp_private_dir());
113 NT_STATUS_HAVE_NO_MEMORY(db_path
);
115 /* Open idmap repository */
116 ctx
->db
= db_open(ctx
, db_path
, 0, TDB_DEFAULT
, O_RDWR
|O_CREAT
, 0644);
117 TALLOC_FREE(db_path
);
119 if (ctx
->db
== NULL
) {
120 DEBUG(0, ("Unable to open idmap_tdb2 database '%s'\n",
122 return NT_STATUS_UNSUCCESSFUL
;
125 return idmap_tdb2_init_hwm(dom
);
133 struct idmap_tdb2_allocate_id_context
{
140 static NTSTATUS
idmap_tdb2_allocate_id_action(struct db_context
*db
,
144 struct idmap_tdb2_allocate_id_context
*state
;
147 state
= (struct idmap_tdb2_allocate_id_context
*)private_data
;
149 hwm
= dbwrap_fetch_int32(db
, state
->hwmkey
);
151 ret
= NT_STATUS_INTERNAL_DB_ERROR
;
155 /* check it is in the range */
156 if (hwm
> state
->high_hwm
) {
157 DEBUG(1, ("Fatal Error: %s range full!! (max: %lu)\n",
158 state
->hwmtype
, (unsigned long)state
->high_hwm
));
159 ret
= NT_STATUS_UNSUCCESSFUL
;
163 /* fetch a new id and increment it */
164 ret
= dbwrap_trans_change_uint32_atomic(db
, state
->hwmkey
, &hwm
, 1);
165 if (!NT_STATUS_IS_OK(ret
)) {
166 DEBUG(1, ("Fatal error while fetching a new %s value\n!",
171 /* recheck it is in the range */
172 if (hwm
> state
->high_hwm
) {
173 DEBUG(1, ("Fatal Error: %s range full!! (max: %lu)\n",
174 state
->hwmtype
, (unsigned long)state
->high_hwm
));
175 ret
= NT_STATUS_UNSUCCESSFUL
;
186 static NTSTATUS
idmap_tdb2_allocate_id(struct idmap_domain
*dom
,
194 struct idmap_tdb2_allocate_id_context state
;
195 struct idmap_tdb2_context
*ctx
;
197 status
= idmap_tdb2_open_db(dom
);
198 NT_STATUS_NOT_OK_RETURN(status
);
200 ctx
= talloc_get_type(dom
->private_data
, struct idmap_tdb2_context
);
202 /* Get current high water mark */
216 DEBUG(2, ("Invalid ID type (0x%x)\n", xid
->type
));
217 return NT_STATUS_INVALID_PARAMETER
;
220 high_hwm
= dom
->high_id
;
223 state
.high_hwm
= high_hwm
;
224 state
.hwmtype
= hwmtype
;
225 state
.hwmkey
= hwmkey
;
227 status
= dbwrap_trans_do(ctx
->db
, idmap_tdb2_allocate_id_action
,
230 if (NT_STATUS_IS_OK(status
)) {
232 DEBUG(10,("New %s = %d\n", hwmtype
, state
.hwm
));
234 DEBUG(1, ("Error allocating a new %s\n", hwmtype
));
241 * Allocate a new unix-ID.
242 * For now this is for the default idmap domain only.
243 * Should be extended later on.
245 static NTSTATUS
idmap_tdb2_get_new_id(struct idmap_domain
*dom
,
250 if (!strequal(dom
->name
, "*")) {
251 DEBUG(3, ("idmap_tdb2_get_new_id: "
252 "Refusing creation of mapping for domain'%s'. "
253 "Currently only supported for the default "
256 return NT_STATUS_NOT_IMPLEMENTED
;
259 ret
= idmap_tdb2_allocate_id(dom
, id
);
265 IDMAP MAPPING TDB BACKEND
268 static NTSTATUS
idmap_tdb2_set_mapping(struct idmap_domain
*dom
,
269 const struct id_map
*map
);
272 Initialise idmap database.
274 static NTSTATUS
idmap_tdb2_db_init(struct idmap_domain
*dom
,
278 struct idmap_tdb2_context
*ctx
;
280 ctx
= talloc_zero(dom
, struct idmap_tdb2_context
);
282 DEBUG(0, ("Out of memory!\n"));
283 return NT_STATUS_NO_MEMORY
;
286 if (strequal(dom
->name
, "*")) {
287 ctx
->script
= lp_parm_const_string(-1, "idmap", "script", NULL
);
289 DEBUG(1, ("using idmap script '%s'\n", ctx
->script
));
292 char *config_option
= NULL
;
294 config_option
= talloc_asprintf(ctx
, "idmap config %s", dom
->name
);
295 if ( ! config_option
) {
296 DEBUG(0, ("Out of memory!\n"));
297 ret
= NT_STATUS_NO_MEMORY
;
301 ctx
->script
= lp_parm_const_string(-1, config_option
, "script", NULL
);
303 DEBUG(1, ("using idmap script '%s'\n", ctx
->script
));
306 talloc_free(config_option
);
309 ctx
->rw_ops
= talloc_zero(ctx
, struct idmap_rw_ops
);
310 if (ctx
->rw_ops
== NULL
) {
311 DEBUG(0, ("Out of memory!\n"));
312 ret
= NT_STATUS_NO_MEMORY
;
316 ctx
->rw_ops
->get_new_id
= idmap_tdb2_get_new_id
;
317 ctx
->rw_ops
->set_mapping
= idmap_tdb2_set_mapping
;
319 dom
->private_data
= ctx
;
321 ret
= idmap_tdb2_open_db(dom
);
322 if (!NT_STATUS_IS_OK(ret
)) {
335 * store a mapping in the database.
338 struct idmap_tdb2_set_mapping_context
{
343 static NTSTATUS
idmap_tdb2_set_mapping_action(struct db_context
*db
,
348 struct idmap_tdb2_set_mapping_context
*state
;
349 TALLOC_CTX
*tmp_ctx
= talloc_stackframe();
351 state
= (struct idmap_tdb2_set_mapping_context
*)private_data
;
353 DEBUG(10, ("Storing %s <-> %s map\n", state
->ksidstr
, state
->kidstr
));
355 /* check wheter sid mapping is already present in db */
356 data
= dbwrap_fetch_bystring(db
, tmp_ctx
, state
->ksidstr
);
358 ret
= NT_STATUS_OBJECT_NAME_COLLISION
;
362 ret
= dbwrap_store_bystring(db
, state
->ksidstr
,
363 string_term_tdb_data(state
->kidstr
),
365 if (!NT_STATUS_IS_OK(ret
)) {
366 DEBUG(0, ("Error storing SID -> ID: %s\n", nt_errstr(ret
)));
370 ret
= dbwrap_store_bystring(db
, state
->kidstr
,
371 string_term_tdb_data(state
->ksidstr
),
373 if (!NT_STATUS_IS_OK(ret
)) {
374 DEBUG(0, ("Error storing ID -> SID: %s\n", nt_errstr(ret
)));
375 /* try to remove the previous stored SID -> ID map */
376 dbwrap_delete_bystring(db
, state
->ksidstr
);
380 DEBUG(10,("Stored %s <-> %s\n", state
->ksidstr
, state
->kidstr
));
383 talloc_free(tmp_ctx
);
387 static NTSTATUS
idmap_tdb2_set_mapping(struct idmap_domain
*dom
, const struct id_map
*map
)
389 struct idmap_tdb2_context
*ctx
;
391 char *ksidstr
, *kidstr
;
392 struct idmap_tdb2_set_mapping_context state
;
394 if (!map
|| !map
->sid
) {
395 return NT_STATUS_INVALID_PARAMETER
;
398 ksidstr
= kidstr
= NULL
;
400 /* TODO: should we filter a set_mapping using low/high filters ? */
402 ctx
= talloc_get_type(dom
->private_data
, struct idmap_tdb2_context
);
404 switch (map
->xid
.type
) {
407 kidstr
= talloc_asprintf(ctx
, "UID %lu", (unsigned long)map
->xid
.id
);
411 kidstr
= talloc_asprintf(ctx
, "GID %lu", (unsigned long)map
->xid
.id
);
415 DEBUG(2, ("INVALID unix ID type: 0x02%x\n", map
->xid
.type
));
416 return NT_STATUS_INVALID_PARAMETER
;
419 if (kidstr
== NULL
) {
420 DEBUG(0, ("ERROR: Out of memory!\n"));
421 ret
= NT_STATUS_NO_MEMORY
;
425 ksidstr
= sid_string_talloc(ctx
, map
->sid
);
426 if (ksidstr
== NULL
) {
427 DEBUG(0, ("Out of memory!\n"));
428 ret
= NT_STATUS_NO_MEMORY
;
432 state
.ksidstr
= ksidstr
;
433 state
.kidstr
= kidstr
;
435 ret
= dbwrap_trans_do(ctx
->db
, idmap_tdb2_set_mapping_action
,
439 talloc_free(ksidstr
);
445 * Create a new mapping for an unmapped SID, also allocating a new ID.
446 * This should be run inside a transaction.
449 * Properly integrate this with multi domain idmap config:
450 * Currently, the allocator is default-config only.
452 static NTSTATUS
idmap_tdb2_new_mapping(struct idmap_domain
*dom
, struct id_map
*map
)
455 struct idmap_tdb2_context
*ctx
;
457 ctx
= talloc_get_type(dom
->private_data
, struct idmap_tdb2_context
);
459 ret
= idmap_rw_new_mapping(dom
, ctx
->rw_ops
, map
);
466 run a script to perform a mapping
468 The script should the following command lines:
474 and should return one of the following as a single line of text
480 static NTSTATUS
idmap_tdb2_script(struct idmap_tdb2_context
*ctx
, struct id_map
*map
,
481 const char *fmt
, ...)
489 cmd
= talloc_asprintf(ctx
, "%s ", ctx
->script
);
490 NT_STATUS_HAVE_NO_MEMORY(cmd
);
493 cmd
= talloc_vasprintf_append(cmd
, fmt
, ap
);
495 NT_STATUS_HAVE_NO_MEMORY(cmd
);
500 return NT_STATUS_NONE_MAPPED
;
503 if (fgets(line
, sizeof(line
)-1, p
) == NULL
) {
505 return NT_STATUS_NONE_MAPPED
;
509 DEBUG(10,("idmap script gave: %s\n", line
));
511 if (sscanf(line
, "UID:%lu", &v
) == 1) {
513 map
->xid
.type
= ID_TYPE_UID
;
514 } else if (sscanf(line
, "GID:%lu", &v
) == 1) {
516 map
->xid
.type
= ID_TYPE_GID
;
517 } else if (strncmp(line
, "SID:S-", 6) == 0) {
518 if (!string_to_sid(map
->sid
, &line
[4])) {
519 DEBUG(0,("Bad SID in '%s' from idmap script %s\n",
521 return NT_STATUS_NONE_MAPPED
;
524 DEBUG(0,("Bad reply '%s' from idmap script %s\n",
526 return NT_STATUS_NONE_MAPPED
;
535 Single id to sid lookup function.
537 static NTSTATUS
idmap_tdb2_id_to_sid(struct idmap_domain
*dom
, struct id_map
*map
)
543 struct idmap_tdb2_context
*ctx
;
547 return NT_STATUS_INVALID_PARAMETER
;
550 status
= idmap_tdb2_open_db(dom
);
551 NT_STATUS_NOT_OK_RETURN(status
);
553 ctx
= talloc_get_type(dom
->private_data
, struct idmap_tdb2_context
);
555 /* apply filters before checking */
556 if (!idmap_unix_id_is_in_range(map
->xid
.id
, dom
)) {
557 DEBUG(5, ("Requested id (%u) out of range (%u - %u). Filtered!\n",
558 map
->xid
.id
, dom
->low_id
, dom
->high_id
));
559 return NT_STATUS_NONE_MAPPED
;
562 switch (map
->xid
.type
) {
565 keystr
= talloc_asprintf(ctx
, "UID %lu", (unsigned long)map
->xid
.id
);
569 keystr
= talloc_asprintf(ctx
, "GID %lu", (unsigned long)map
->xid
.id
);
573 DEBUG(2, ("INVALID unix ID type: 0x02%x\n", map
->xid
.type
));
574 return NT_STATUS_INVALID_PARAMETER
;
577 /* final SAFE_FREE safe */
580 if (keystr
== NULL
) {
581 DEBUG(0, ("Out of memory!\n"));
582 ret
= NT_STATUS_NO_MEMORY
;
586 DEBUG(10,("Fetching record %s\n", keystr
));
588 /* Check if the mapping exists */
589 data
= dbwrap_fetch_bystring(ctx
->db
, keystr
, keystr
);
593 struct idmap_tdb2_set_mapping_context store_state
;
595 DEBUG(10,("Record %s not found\n", keystr
));
596 if (ctx
->script
== NULL
) {
597 ret
= NT_STATUS_NONE_MAPPED
;
601 ret
= idmap_tdb2_script(ctx
, map
, "IDTOSID %s", keystr
);
603 /* store it on shared storage */
604 if (!NT_STATUS_IS_OK(ret
)) {
608 sidstr
= sid_string_talloc(keystr
, map
->sid
);
610 ret
= NT_STATUS_NO_MEMORY
;
614 store_state
.ksidstr
= sidstr
;
615 store_state
.kidstr
= keystr
;
617 ret
= dbwrap_trans_do(ctx
->db
, idmap_tdb2_set_mapping_action
,
622 if (!string_to_sid(map
->sid
, (const char *)data
.dptr
)) {
623 DEBUG(10,("INVALID SID (%s) in record %s\n",
624 (const char *)data
.dptr
, keystr
));
625 ret
= NT_STATUS_INTERNAL_DB_ERROR
;
629 DEBUG(10,("Found record %s -> %s\n", keystr
, (const char *)data
.dptr
));
639 Single sid to id lookup function.
641 static NTSTATUS
idmap_tdb2_sid_to_id(struct idmap_domain
*dom
, struct id_map
*map
)
646 unsigned long rec_id
= 0;
647 struct idmap_tdb2_context
*ctx
;
648 TALLOC_CTX
*tmp_ctx
= talloc_stackframe();
650 ret
= idmap_tdb2_open_db(dom
);
651 NT_STATUS_NOT_OK_RETURN(ret
);
653 ctx
= talloc_get_type(dom
->private_data
, struct idmap_tdb2_context
);
655 keystr
= sid_string_talloc(tmp_ctx
, map
->sid
);
656 if (keystr
== NULL
) {
657 DEBUG(0, ("Out of memory!\n"));
658 ret
= NT_STATUS_NO_MEMORY
;
662 DEBUG(10,("Fetching record %s\n", keystr
));
664 /* Check if sid is present in database */
665 data
= dbwrap_fetch_bystring(ctx
->db
, tmp_ctx
, keystr
);
668 struct idmap_tdb2_set_mapping_context store_state
;
670 DEBUG(10,(__location__
" Record %s not found\n", keystr
));
672 if (ctx
->script
== NULL
) {
673 ret
= NT_STATUS_NONE_MAPPED
;
677 ret
= idmap_tdb2_script(ctx
, map
, "SIDTOID %s", keystr
);
678 /* store it on shared storage */
679 if (!NT_STATUS_IS_OK(ret
)) {
683 /* apply filters before returning result */
684 if (!idmap_unix_id_is_in_range(map
->xid
.id
, dom
)) {
685 DEBUG(5, ("Script returned id (%u) out of range "
686 "(%u - %u). Filtered!\n",
687 map
->xid
.id
, dom
->low_id
, dom
->high_id
));
688 ret
= NT_STATUS_NONE_MAPPED
;
692 idstr
= talloc_asprintf(tmp_ctx
, "%cID %lu",
693 map
->xid
.type
== ID_TYPE_UID
?'U':'G',
694 (unsigned long)map
->xid
.id
);
696 ret
= NT_STATUS_NO_MEMORY
;
700 store_state
.ksidstr
= keystr
;
701 store_state
.kidstr
= idstr
;
703 ret
= dbwrap_trans_do(ctx
->db
, idmap_tdb2_set_mapping_action
,
708 /* What type of record is this ? */
709 if (sscanf((const char *)data
.dptr
, "UID %lu", &rec_id
) == 1) { /* Try a UID record. */
710 map
->xid
.id
= rec_id
;
711 map
->xid
.type
= ID_TYPE_UID
;
712 DEBUG(10,("Found uid record %s -> %s \n", keystr
, (const char *)data
.dptr
));
715 } else if (sscanf((const char *)data
.dptr
, "GID %lu", &rec_id
) == 1) { /* Try a GID record. */
716 map
->xid
.id
= rec_id
;
717 map
->xid
.type
= ID_TYPE_GID
;
718 DEBUG(10,("Found gid record %s -> %s \n", keystr
, (const char *)data
.dptr
));
721 } else { /* Unknown record type ! */
722 DEBUG(2, ("Found INVALID record %s -> %s\n", keystr
, (const char *)data
.dptr
));
723 ret
= NT_STATUS_INTERNAL_DB_ERROR
;
727 /* apply filters before returning result */
728 if (!idmap_unix_id_is_in_range(map
->xid
.id
, dom
)) {
729 DEBUG(5, ("Requested id (%u) out of range (%u - %u). Filtered!\n",
730 map
->xid
.id
, dom
->low_id
, dom
->high_id
));
731 ret
= NT_STATUS_NONE_MAPPED
;
735 talloc_free(tmp_ctx
);
740 lookup a set of unix ids.
742 static NTSTATUS
idmap_tdb2_unixids_to_sids(struct idmap_domain
*dom
, struct id_map
**ids
)
747 /* initialize the status to avoid suprise */
748 for (i
= 0; ids
[i
]; i
++) {
749 ids
[i
]->status
= ID_UNKNOWN
;
752 for (i
= 0; ids
[i
]; i
++) {
753 ret
= idmap_tdb2_id_to_sid(dom
, ids
[i
]);
754 if ( ! NT_STATUS_IS_OK(ret
)) {
756 /* if it is just a failed mapping continue */
757 if (NT_STATUS_EQUAL(ret
, NT_STATUS_NONE_MAPPED
)) {
759 /* make sure it is marked as unmapped */
760 ids
[i
]->status
= ID_UNMAPPED
;
764 /* some fatal error occurred, return immediately */
768 /* all ok, id is mapped */
769 ids
[i
]->status
= ID_MAPPED
;
779 lookup a set of sids.
782 struct idmap_tdb2_sids_to_unixids_context
{
783 struct idmap_domain
*dom
;
785 bool allocate_unmapped
;
788 static NTSTATUS
idmap_tdb2_sids_to_unixids_action(struct db_context
*db
,
791 struct idmap_tdb2_sids_to_unixids_context
*state
;
793 NTSTATUS ret
= NT_STATUS_OK
;
795 state
= (struct idmap_tdb2_sids_to_unixids_context
*)private_data
;
797 DEBUG(10, ("idmap_tdb2_sids_to_unixids_action: "
798 " domain: [%s], allocate: %s\n",
800 state
->allocate_unmapped
? "yes" : "no"));
802 for (i
= 0; state
->ids
[i
]; i
++) {
803 if ((state
->ids
[i
]->status
== ID_UNKNOWN
) ||
804 /* retry if we could not map in previous run: */
805 (state
->ids
[i
]->status
== ID_UNMAPPED
))
809 ret2
= idmap_tdb2_sid_to_id(state
->dom
, state
->ids
[i
]);
810 if (!NT_STATUS_IS_OK(ret2
)) {
812 /* if it is just a failed mapping, continue */
813 if (NT_STATUS_EQUAL(ret2
, NT_STATUS_NONE_MAPPED
)) {
815 /* make sure it is marked as unmapped */
816 state
->ids
[i
]->status
= ID_UNMAPPED
;
817 ret
= STATUS_SOME_UNMAPPED
;
819 /* some fatal error occurred, return immediately */
824 /* all ok, id is mapped */
825 state
->ids
[i
]->status
= ID_MAPPED
;
829 if ((state
->ids
[i
]->status
== ID_UNMAPPED
) &&
830 state
->allocate_unmapped
)
832 ret
= idmap_tdb2_new_mapping(state
->dom
, state
->ids
[i
]);
833 if (!NT_STATUS_IS_OK(ret
)) {
843 static NTSTATUS
idmap_tdb2_sids_to_unixids(struct idmap_domain
*dom
, struct id_map
**ids
)
847 struct idmap_tdb2_sids_to_unixids_context state
;
848 struct idmap_tdb2_context
*ctx
;
850 ctx
= talloc_get_type(dom
->private_data
, struct idmap_tdb2_context
);
852 /* initialize the status to avoid suprise */
853 for (i
= 0; ids
[i
]; i
++) {
854 ids
[i
]->status
= ID_UNKNOWN
;
859 state
.allocate_unmapped
= false;
861 ret
= idmap_tdb2_sids_to_unixids_action(ctx
->db
, &state
);
863 if (NT_STATUS_EQUAL(ret
, STATUS_SOME_UNMAPPED
) && !dom
->read_only
) {
864 state
.allocate_unmapped
= true;
865 ret
= dbwrap_trans_do(ctx
->db
,
866 idmap_tdb2_sids_to_unixids_action
,
875 Close the idmap tdb instance
877 static NTSTATUS
idmap_tdb2_close(struct idmap_domain
*dom
)
879 /* don't do anything */
883 static struct idmap_methods db_methods
= {
884 .init
= idmap_tdb2_db_init
,
885 .unixids_to_sids
= idmap_tdb2_unixids_to_sids
,
886 .sids_to_unixids
= idmap_tdb2_sids_to_unixids
,
887 .allocate_id
= idmap_tdb2_get_new_id
,
888 .close_fn
= idmap_tdb2_close
891 NTSTATUS
idmap_tdb2_init(void)
893 return smb_register_idmap(SMB_IDMAP_INTERFACE_VERSION
, "tdb2", &db_methods
);