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.
35 #include "system/filesys.h"
40 #include "../libcli/security/dom_sid.h"
44 #define DBGC_CLASS DBGC_IDMAP
46 struct idmap_tdb2_context
{
47 struct db_context
*db
;
48 const char *script
; /* script to provide idmaps */
49 struct idmap_rw_ops
*rw_ops
;
52 /* High water mark keys */
53 #define HWM_GROUP "GROUP HWM"
54 #define HWM_USER "USER HWM"
58 * check and initialize high/low water marks in the db
60 static NTSTATUS
idmap_tdb2_init_hwm(struct idmap_domain
*dom
)
64 struct idmap_tdb2_context
*ctx
;
66 ctx
= talloc_get_type(dom
->private_data
, struct idmap_tdb2_context
);
68 /* Create high water marks for group and user id */
70 low_id
= dbwrap_fetch_int32(ctx
->db
, HWM_USER
);
71 if ((low_id
== -1) || (low_id
< dom
->low_id
)) {
72 status
= dbwrap_trans_store_int32(ctx
->db
, HWM_USER
,
74 if (!NT_STATUS_IS_OK(status
)) {
75 DEBUG(0, ("Unable to initialise user hwm in idmap "
76 "database: %s\n", nt_errstr(status
)));
77 return NT_STATUS_INTERNAL_DB_ERROR
;
81 low_id
= dbwrap_fetch_int32(ctx
->db
, HWM_GROUP
);
82 if ((low_id
== -1) || (low_id
< dom
->low_id
)) {
83 status
= dbwrap_trans_store_int32(ctx
->db
, HWM_GROUP
,
85 if (!NT_STATUS_IS_OK(status
)) {
86 DEBUG(0, ("Unable to initialise group hwm in idmap "
87 "database: %s\n", nt_errstr(status
)));
88 return NT_STATUS_INTERNAL_DB_ERROR
;
97 open the permanent tdb
99 static NTSTATUS
idmap_tdb2_open_db(struct idmap_domain
*dom
)
102 struct idmap_tdb2_context
*ctx
;
104 ctx
= talloc_get_type(dom
->private_data
, struct idmap_tdb2_context
);
107 /* its already open */
111 db_path
= lp_parm_talloc_string(-1, "tdb", "idmap2.tdb", NULL
);
112 if (db_path
== NULL
) {
113 /* fall back to the private directory */
114 db_path
= talloc_asprintf(NULL
, "%s/idmap2.tdb", lp_private_dir());
116 NT_STATUS_HAVE_NO_MEMORY(db_path
);
118 /* Open idmap repository */
119 ctx
->db
= db_open(ctx
, db_path
, 0, TDB_DEFAULT
, O_RDWR
|O_CREAT
, 0644);
120 TALLOC_FREE(db_path
);
122 if (ctx
->db
== NULL
) {
123 DEBUG(0, ("Unable to open idmap_tdb2 database '%s'\n",
125 return NT_STATUS_UNSUCCESSFUL
;
128 return idmap_tdb2_init_hwm(dom
);
136 struct idmap_tdb2_allocate_id_context
{
143 static NTSTATUS
idmap_tdb2_allocate_id_action(struct db_context
*db
,
147 struct idmap_tdb2_allocate_id_context
*state
;
150 state
= (struct idmap_tdb2_allocate_id_context
*)private_data
;
152 hwm
= dbwrap_fetch_int32(db
, state
->hwmkey
);
154 ret
= NT_STATUS_INTERNAL_DB_ERROR
;
158 /* check it is in the range */
159 if (hwm
> state
->high_hwm
) {
160 DEBUG(1, ("Fatal Error: %s range full!! (max: %lu)\n",
161 state
->hwmtype
, (unsigned long)state
->high_hwm
));
162 ret
= NT_STATUS_UNSUCCESSFUL
;
166 /* fetch a new id and increment it */
167 ret
= dbwrap_trans_change_uint32_atomic(db
, state
->hwmkey
, &hwm
, 1);
168 if (!NT_STATUS_IS_OK(ret
)) {
169 DEBUG(1, ("Fatal error while fetching a new %s value\n!",
174 /* recheck it is in the range */
175 if (hwm
> state
->high_hwm
) {
176 DEBUG(1, ("Fatal Error: %s range full!! (max: %lu)\n",
177 state
->hwmtype
, (unsigned long)state
->high_hwm
));
178 ret
= NT_STATUS_UNSUCCESSFUL
;
189 static NTSTATUS
idmap_tdb2_allocate_id(struct idmap_domain
*dom
,
197 struct idmap_tdb2_allocate_id_context state
;
198 struct idmap_tdb2_context
*ctx
;
200 status
= idmap_tdb2_open_db(dom
);
201 NT_STATUS_NOT_OK_RETURN(status
);
203 ctx
= talloc_get_type(dom
->private_data
, struct idmap_tdb2_context
);
205 /* Get current high water mark */
219 DEBUG(2, ("Invalid ID type (0x%x)\n", xid
->type
));
220 return NT_STATUS_INVALID_PARAMETER
;
223 high_hwm
= dom
->high_id
;
226 state
.high_hwm
= high_hwm
;
227 state
.hwmtype
= hwmtype
;
228 state
.hwmkey
= hwmkey
;
230 status
= dbwrap_trans_do(ctx
->db
, idmap_tdb2_allocate_id_action
,
233 if (NT_STATUS_IS_OK(status
)) {
235 DEBUG(10,("New %s = %d\n", hwmtype
, state
.hwm
));
237 DEBUG(1, ("Error allocating a new %s\n", hwmtype
));
244 * Allocate a new unix-ID.
245 * For now this is for the default idmap domain only.
246 * Should be extended later on.
248 static NTSTATUS
idmap_tdb2_get_new_id(struct idmap_domain
*dom
,
253 if (!strequal(dom
->name
, "*")) {
254 DEBUG(3, ("idmap_tdb2_get_new_id: "
255 "Refusing creation of mapping for domain'%s'. "
256 "Currently only supported for the default "
259 return NT_STATUS_NOT_IMPLEMENTED
;
262 ret
= idmap_tdb2_allocate_id(dom
, id
);
268 IDMAP MAPPING TDB BACKEND
271 static NTSTATUS
idmap_tdb2_set_mapping(struct idmap_domain
*dom
,
272 const struct id_map
*map
);
275 Initialise idmap database.
277 static NTSTATUS
idmap_tdb2_db_init(struct idmap_domain
*dom
)
280 struct idmap_tdb2_context
*ctx
;
281 char *config_option
= NULL
;
282 const char * idmap_script
= NULL
;
284 ctx
= talloc_zero(dom
, struct idmap_tdb2_context
);
286 DEBUG(0, ("Out of memory!\n"));
287 return NT_STATUS_NO_MEMORY
;
290 config_option
= talloc_asprintf(ctx
, "idmap config %s", dom
->name
);
291 if (config_option
== NULL
) {
292 DEBUG(0, ("Out of memory!\n"));
293 ret
= NT_STATUS_NO_MEMORY
;
296 ctx
->script
= lp_parm_const_string(-1, config_option
, "script", "NULL");
297 talloc_free(config_option
);
299 idmap_script
= lp_parm_const_string(-1, "idmap", "script", NULL
);
300 if (idmap_script
!= NULL
) {
301 DEBUG(0, ("Warning: 'idmap:script' is deprecated. "
302 " Please use 'idmap config * : script' instead!\n"));
305 if (strequal(dom
->name
, "*") && ctx
->script
== NULL
) {
306 /* fall back to idmap:script for backwards compatibility */
307 ctx
->script
= idmap_script
;
311 DEBUG(1, ("using idmap script '%s'\n", ctx
->script
));
314 ctx
->rw_ops
= talloc_zero(ctx
, struct idmap_rw_ops
);
315 if (ctx
->rw_ops
== NULL
) {
316 DEBUG(0, ("Out of memory!\n"));
317 ret
= NT_STATUS_NO_MEMORY
;
321 ctx
->rw_ops
->get_new_id
= idmap_tdb2_get_new_id
;
322 ctx
->rw_ops
->set_mapping
= idmap_tdb2_set_mapping
;
324 dom
->private_data
= ctx
;
326 ret
= idmap_tdb2_open_db(dom
);
327 if (!NT_STATUS_IS_OK(ret
)) {
340 * store a mapping in the database.
343 struct idmap_tdb2_set_mapping_context
{
348 static NTSTATUS
idmap_tdb2_set_mapping_action(struct db_context
*db
,
353 struct idmap_tdb2_set_mapping_context
*state
;
354 TALLOC_CTX
*tmp_ctx
= talloc_stackframe();
356 state
= (struct idmap_tdb2_set_mapping_context
*)private_data
;
358 DEBUG(10, ("Storing %s <-> %s map\n", state
->ksidstr
, state
->kidstr
));
360 /* check wheter sid mapping is already present in db */
361 data
= dbwrap_fetch_bystring(db
, tmp_ctx
, state
->ksidstr
);
363 ret
= NT_STATUS_OBJECT_NAME_COLLISION
;
367 ret
= dbwrap_store_bystring(db
, state
->ksidstr
,
368 string_term_tdb_data(state
->kidstr
),
370 if (!NT_STATUS_IS_OK(ret
)) {
371 DEBUG(0, ("Error storing SID -> ID: %s\n", nt_errstr(ret
)));
375 ret
= dbwrap_store_bystring(db
, state
->kidstr
,
376 string_term_tdb_data(state
->ksidstr
),
378 if (!NT_STATUS_IS_OK(ret
)) {
379 DEBUG(0, ("Error storing ID -> SID: %s\n", nt_errstr(ret
)));
380 /* try to remove the previous stored SID -> ID map */
381 dbwrap_delete_bystring(db
, state
->ksidstr
);
385 DEBUG(10,("Stored %s <-> %s\n", state
->ksidstr
, state
->kidstr
));
388 talloc_free(tmp_ctx
);
392 static NTSTATUS
idmap_tdb2_set_mapping(struct idmap_domain
*dom
, const struct id_map
*map
)
394 struct idmap_tdb2_context
*ctx
;
396 char *ksidstr
, *kidstr
;
397 struct idmap_tdb2_set_mapping_context state
;
399 if (!map
|| !map
->sid
) {
400 return NT_STATUS_INVALID_PARAMETER
;
403 ksidstr
= kidstr
= NULL
;
405 /* TODO: should we filter a set_mapping using low/high filters ? */
407 ctx
= talloc_get_type(dom
->private_data
, struct idmap_tdb2_context
);
409 switch (map
->xid
.type
) {
412 kidstr
= talloc_asprintf(ctx
, "UID %lu", (unsigned long)map
->xid
.id
);
416 kidstr
= talloc_asprintf(ctx
, "GID %lu", (unsigned long)map
->xid
.id
);
420 DEBUG(2, ("INVALID unix ID type: 0x02%x\n", map
->xid
.type
));
421 return NT_STATUS_INVALID_PARAMETER
;
424 if (kidstr
== NULL
) {
425 DEBUG(0, ("ERROR: Out of memory!\n"));
426 ret
= NT_STATUS_NO_MEMORY
;
430 ksidstr
= sid_string_talloc(ctx
, map
->sid
);
431 if (ksidstr
== NULL
) {
432 DEBUG(0, ("Out of memory!\n"));
433 ret
= NT_STATUS_NO_MEMORY
;
437 state
.ksidstr
= ksidstr
;
438 state
.kidstr
= kidstr
;
440 ret
= dbwrap_trans_do(ctx
->db
, idmap_tdb2_set_mapping_action
,
444 talloc_free(ksidstr
);
450 * Create a new mapping for an unmapped SID, also allocating a new ID.
451 * This should be run inside a transaction.
454 * Properly integrate this with multi domain idmap config:
455 * Currently, the allocator is default-config only.
457 static NTSTATUS
idmap_tdb2_new_mapping(struct idmap_domain
*dom
, struct id_map
*map
)
460 struct idmap_tdb2_context
*ctx
;
462 ctx
= talloc_get_type(dom
->private_data
, struct idmap_tdb2_context
);
464 ret
= idmap_rw_new_mapping(dom
, ctx
->rw_ops
, map
);
471 run a script to perform a mapping
473 The script should the following command lines:
479 and should return one of the following as a single line of text
485 static NTSTATUS
idmap_tdb2_script(struct idmap_tdb2_context
*ctx
, struct id_map
*map
,
486 const char *fmt
, ...)
494 cmd
= talloc_asprintf(ctx
, "%s ", ctx
->script
);
495 NT_STATUS_HAVE_NO_MEMORY(cmd
);
498 cmd
= talloc_vasprintf_append(cmd
, fmt
, ap
);
500 NT_STATUS_HAVE_NO_MEMORY(cmd
);
505 return NT_STATUS_NONE_MAPPED
;
508 if (fgets(line
, sizeof(line
)-1, p
) == NULL
) {
510 return NT_STATUS_NONE_MAPPED
;
514 DEBUG(10,("idmap script gave: %s\n", line
));
516 if (sscanf(line
, "UID:%lu", &v
) == 1) {
518 map
->xid
.type
= ID_TYPE_UID
;
519 } else if (sscanf(line
, "GID:%lu", &v
) == 1) {
521 map
->xid
.type
= ID_TYPE_GID
;
522 } else if (strncmp(line
, "SID:S-", 6) == 0) {
523 if (!string_to_sid(map
->sid
, &line
[4])) {
524 DEBUG(0,("Bad SID in '%s' from idmap script %s\n",
526 return NT_STATUS_NONE_MAPPED
;
529 DEBUG(0,("Bad reply '%s' from idmap script %s\n",
531 return NT_STATUS_NONE_MAPPED
;
540 Single id to sid lookup function.
542 static NTSTATUS
idmap_tdb2_id_to_sid(struct idmap_domain
*dom
, struct id_map
*map
)
548 struct idmap_tdb2_context
*ctx
;
552 return NT_STATUS_INVALID_PARAMETER
;
555 status
= idmap_tdb2_open_db(dom
);
556 NT_STATUS_NOT_OK_RETURN(status
);
558 ctx
= talloc_get_type(dom
->private_data
, struct idmap_tdb2_context
);
560 /* apply filters before checking */
561 if (!idmap_unix_id_is_in_range(map
->xid
.id
, dom
)) {
562 DEBUG(5, ("Requested id (%u) out of range (%u - %u). Filtered!\n",
563 map
->xid
.id
, dom
->low_id
, dom
->high_id
));
564 return NT_STATUS_NONE_MAPPED
;
567 switch (map
->xid
.type
) {
570 keystr
= talloc_asprintf(ctx
, "UID %lu", (unsigned long)map
->xid
.id
);
574 keystr
= talloc_asprintf(ctx
, "GID %lu", (unsigned long)map
->xid
.id
);
578 DEBUG(2, ("INVALID unix ID type: 0x02%x\n", map
->xid
.type
));
579 return NT_STATUS_INVALID_PARAMETER
;
582 if (keystr
== NULL
) {
583 DEBUG(0, ("Out of memory!\n"));
584 ret
= NT_STATUS_NO_MEMORY
;
588 DEBUG(10,("Fetching record %s\n", keystr
));
590 /* Check if the mapping exists */
591 data
= dbwrap_fetch_bystring(ctx
->db
, keystr
, keystr
);
595 struct idmap_tdb2_set_mapping_context store_state
;
597 DEBUG(10,("Record %s not found\n", keystr
));
598 if (ctx
->script
== NULL
) {
599 ret
= NT_STATUS_NONE_MAPPED
;
603 ret
= idmap_tdb2_script(ctx
, map
, "IDTOSID %s", keystr
);
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 if (!NT_STATUS_IS_OK(ret
)) {
682 /* apply filters before returning result */
683 if (!idmap_unix_id_is_in_range(map
->xid
.id
, dom
)) {
684 DEBUG(5, ("Script returned id (%u) out of range "
685 "(%u - %u). Filtered!\n",
686 map
->xid
.id
, dom
->low_id
, dom
->high_id
));
687 ret
= NT_STATUS_NONE_MAPPED
;
691 idstr
= talloc_asprintf(tmp_ctx
, "%cID %lu",
692 map
->xid
.type
== ID_TYPE_UID
?'U':'G',
693 (unsigned long)map
->xid
.id
);
695 ret
= NT_STATUS_NO_MEMORY
;
699 store_state
.ksidstr
= keystr
;
700 store_state
.kidstr
= idstr
;
702 ret
= dbwrap_trans_do(ctx
->db
, idmap_tdb2_set_mapping_action
,
707 /* What type of record is this ? */
708 if (sscanf((const char *)data
.dptr
, "UID %lu", &rec_id
) == 1) { /* Try a UID record. */
709 map
->xid
.id
= rec_id
;
710 map
->xid
.type
= ID_TYPE_UID
;
711 DEBUG(10,("Found uid record %s -> %s \n", keystr
, (const char *)data
.dptr
));
714 } else if (sscanf((const char *)data
.dptr
, "GID %lu", &rec_id
) == 1) { /* Try a GID record. */
715 map
->xid
.id
= rec_id
;
716 map
->xid
.type
= ID_TYPE_GID
;
717 DEBUG(10,("Found gid record %s -> %s \n", keystr
, (const char *)data
.dptr
));
720 } else { /* Unknown record type ! */
721 DEBUG(2, ("Found INVALID record %s -> %s\n", keystr
, (const char *)data
.dptr
));
722 ret
= NT_STATUS_INTERNAL_DB_ERROR
;
726 /* apply filters before returning result */
727 if (!idmap_unix_id_is_in_range(map
->xid
.id
, dom
)) {
728 DEBUG(5, ("Requested id (%u) out of range (%u - %u). Filtered!\n",
729 map
->xid
.id
, dom
->low_id
, dom
->high_id
));
730 ret
= NT_STATUS_NONE_MAPPED
;
734 talloc_free(tmp_ctx
);
739 lookup a set of unix ids.
741 static NTSTATUS
idmap_tdb2_unixids_to_sids(struct idmap_domain
*dom
, struct id_map
**ids
)
746 /* initialize the status to avoid suprise */
747 for (i
= 0; ids
[i
]; i
++) {
748 ids
[i
]->status
= ID_UNKNOWN
;
751 for (i
= 0; ids
[i
]; i
++) {
752 ret
= idmap_tdb2_id_to_sid(dom
, ids
[i
]);
753 if ( ! NT_STATUS_IS_OK(ret
)) {
755 /* if it is just a failed mapping continue */
756 if (NT_STATUS_EQUAL(ret
, NT_STATUS_NONE_MAPPED
)) {
758 /* make sure it is marked as unmapped */
759 ids
[i
]->status
= ID_UNMAPPED
;
763 /* some fatal error occurred, return immediately */
767 /* all ok, id is mapped */
768 ids
[i
]->status
= ID_MAPPED
;
778 lookup a set of sids.
781 struct idmap_tdb2_sids_to_unixids_context
{
782 struct idmap_domain
*dom
;
784 bool allocate_unmapped
;
787 static NTSTATUS
idmap_tdb2_sids_to_unixids_action(struct db_context
*db
,
790 struct idmap_tdb2_sids_to_unixids_context
*state
;
792 NTSTATUS ret
= NT_STATUS_OK
;
794 state
= (struct idmap_tdb2_sids_to_unixids_context
*)private_data
;
796 DEBUG(10, ("idmap_tdb2_sids_to_unixids_action: "
797 " domain: [%s], allocate: %s\n",
799 state
->allocate_unmapped
? "yes" : "no"));
801 for (i
= 0; state
->ids
[i
]; i
++) {
802 if ((state
->ids
[i
]->status
== ID_UNKNOWN
) ||
803 /* retry if we could not map in previous run: */
804 (state
->ids
[i
]->status
== ID_UNMAPPED
))
808 ret2
= idmap_tdb2_sid_to_id(state
->dom
, state
->ids
[i
]);
809 if (!NT_STATUS_IS_OK(ret2
)) {
811 /* if it is just a failed mapping, continue */
812 if (NT_STATUS_EQUAL(ret2
, NT_STATUS_NONE_MAPPED
)) {
814 /* make sure it is marked as unmapped */
815 state
->ids
[i
]->status
= ID_UNMAPPED
;
816 ret
= STATUS_SOME_UNMAPPED
;
818 /* some fatal error occurred, return immediately */
823 /* all ok, id is mapped */
824 state
->ids
[i
]->status
= ID_MAPPED
;
828 if ((state
->ids
[i
]->status
== ID_UNMAPPED
) &&
829 state
->allocate_unmapped
)
831 ret
= idmap_tdb2_new_mapping(state
->dom
, state
->ids
[i
]);
832 if (!NT_STATUS_IS_OK(ret
)) {
842 static NTSTATUS
idmap_tdb2_sids_to_unixids(struct idmap_domain
*dom
, struct id_map
**ids
)
846 struct idmap_tdb2_sids_to_unixids_context state
;
847 struct idmap_tdb2_context
*ctx
;
849 ctx
= talloc_get_type(dom
->private_data
, struct idmap_tdb2_context
);
851 /* initialize the status to avoid suprise */
852 for (i
= 0; ids
[i
]; i
++) {
853 ids
[i
]->status
= ID_UNKNOWN
;
858 state
.allocate_unmapped
= false;
860 ret
= idmap_tdb2_sids_to_unixids_action(ctx
->db
, &state
);
862 if (NT_STATUS_EQUAL(ret
, STATUS_SOME_UNMAPPED
) && !dom
->read_only
) {
863 state
.allocate_unmapped
= true;
864 ret
= dbwrap_trans_do(ctx
->db
,
865 idmap_tdb2_sids_to_unixids_action
,
873 static struct idmap_methods db_methods
= {
874 .init
= idmap_tdb2_db_init
,
875 .unixids_to_sids
= idmap_tdb2_unixids_to_sids
,
876 .sids_to_unixids
= idmap_tdb2_sids_to_unixids
,
877 .allocate_id
= idmap_tdb2_get_new_id
880 NTSTATUS
idmap_tdb2_init(void)
882 return smb_register_idmap(SMB_IDMAP_INTERFACE_VERSION
, "tdb2", &db_methods
);