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
18 This program is free software; you can redistribute it and/or modify
19 it under the terms of the GNU General Public License as published by
20 the Free Software Foundation; either version 2 of the License, or
21 (at your option) any later version.
23 This program is distributed in the hope that it will be useful,
24 but WITHOUT ANY WARRANTY; without even the implied warranty of
25 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 GNU General Public License for more details.
28 You should have received a copy of the GNU General Public License
29 along with this program; if not, write to the Free Software
30 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
37 #define DBGC_CLASS DBGC_IDMAP
39 struct idmap_tdb2_context
{
40 struct db_context
*db
;
41 const char *script
; /* script to provide idmaps */
44 /* High water mark keys */
45 #define HWM_GROUP "GROUP HWM"
46 #define HWM_USER "USER HWM"
49 static NTSTATUS
idmap_tdb2_new_mapping(struct idmap_domain
*dom
,
54 * check and initialize high/low water marks in the db
56 static NTSTATUS
idmap_tdb2_init_hwm(struct idmap_domain
*dom
)
59 struct idmap_tdb2_context
*ctx
;
61 ctx
= talloc_get_type(dom
->private_data
, struct idmap_tdb2_context
);
63 /* Create high water marks for group and user id */
65 low_id
= dbwrap_fetch_int32(ctx
->db
, HWM_USER
);
66 if ((low_id
== -1) || (low_id
< dom
->low_id
)) {
67 if (!NT_STATUS_IS_OK(dbwrap_trans_store_int32(
70 DEBUG(0, ("Unable to initialise user hwm in idmap "
72 return NT_STATUS_INTERNAL_DB_ERROR
;
76 low_id
= dbwrap_fetch_int32(ctx
->db
, HWM_GROUP
);
77 if ((low_id
== -1) || (low_id
< dom
->low_id
)) {
78 if (!NT_STATUS_IS_OK(dbwrap_trans_store_int32(
81 DEBUG(0, ("Unable to initialise group hwm in idmap "
83 return NT_STATUS_INTERNAL_DB_ERROR
;
92 open the permanent tdb
94 static NTSTATUS
idmap_tdb2_open_db(struct idmap_domain
*dom
)
97 struct idmap_tdb2_context
*ctx
;
99 ctx
= talloc_get_type(dom
->private_data
, struct idmap_tdb2_context
);
102 /* its already open */
106 db_path
= lp_parm_talloc_string(-1, "tdb", "idmap2.tdb", NULL
);
107 if (db_path
== NULL
) {
108 /* fall back to the private directory, which, despite
109 its name, is usually on shared storage */
110 db_path
= talloc_asprintf(NULL
, "%s/idmap2.tdb", lp_private_dir());
112 NT_STATUS_HAVE_NO_MEMORY(db_path
);
114 /* Open idmap repository */
115 ctx
->db
= db_open(ctx
, db_path
, 0, TDB_DEFAULT
, O_RDWR
|O_CREAT
, 0644);
116 TALLOC_FREE(db_path
);
118 if (ctx
->db
== NULL
) {
119 DEBUG(0, ("Unable to open idmap_tdb2 database '%s'\n",
121 return NT_STATUS_UNSUCCESSFUL
;
124 return idmap_tdb2_init_hwm(dom
);
132 struct idmap_tdb2_allocate_id_context
{
139 static NTSTATUS
idmap_tdb2_allocate_id_action(struct db_context
*db
,
143 struct idmap_tdb2_allocate_id_context
*state
;
146 state
= (struct idmap_tdb2_allocate_id_context
*)private_data
;
148 hwm
= dbwrap_fetch_int32(db
, state
->hwmkey
);
150 ret
= NT_STATUS_INTERNAL_DB_ERROR
;
154 /* check it is in the range */
155 if (hwm
> state
->high_hwm
) {
156 DEBUG(1, ("Fatal Error: %s range full!! (max: %lu)\n",
157 state
->hwmtype
, (unsigned long)state
->high_hwm
));
158 ret
= NT_STATUS_UNSUCCESSFUL
;
162 /* fetch a new id and increment it */
163 ret
= dbwrap_trans_change_uint32_atomic(db
, state
->hwmkey
, &hwm
, 1);
164 if (!NT_STATUS_IS_OK(ret
)) {
165 DEBUG(1, ("Fatal error while fetching a new %s value\n!",
170 /* recheck it is in the range */
171 if (hwm
> state
->high_hwm
) {
172 DEBUG(1, ("Fatal Error: %s range full!! (max: %lu)\n",
173 state
->hwmtype
, (unsigned long)state
->high_hwm
));
174 ret
= NT_STATUS_UNSUCCESSFUL
;
185 static NTSTATUS
idmap_tdb2_allocate_id(struct idmap_domain
*dom
,
193 struct idmap_tdb2_allocate_id_context state
;
194 struct idmap_tdb2_context
*ctx
;
196 status
= idmap_tdb2_open_db(dom
);
197 NT_STATUS_NOT_OK_RETURN(status
);
199 ctx
= talloc_get_type(dom
->private_data
, struct idmap_tdb2_context
);
201 /* Get current high water mark */
215 DEBUG(2, ("Invalid ID type (0x%x)\n", xid
->type
));
216 return NT_STATUS_INVALID_PARAMETER
;
219 high_hwm
= dom
->high_id
;
222 state
.high_hwm
= high_hwm
;
223 state
.hwmtype
= hwmtype
;
224 state
.hwmkey
= hwmkey
;
226 status
= dbwrap_trans_do(ctx
->db
, idmap_tdb2_allocate_id_action
,
229 if (NT_STATUS_IS_OK(status
)) {
231 DEBUG(10,("New %s = %d\n", hwmtype
, state
.hwm
));
233 DEBUG(1, ("Error allocating a new %s\n", hwmtype
));
240 * Allocate a new unix-ID.
241 * For now this is for the default idmap domain only.
242 * Should be extended later on.
244 static NTSTATUS
idmap_tdb2_get_new_id(struct idmap_domain
*dom
,
249 if (!strequal(dom
->name
, "*")) {
250 DEBUG(3, ("idmap_tdb2_get_new_id: "
251 "Refusing creation of mapping for domain'%s'. "
252 "Currently only supported for the default "
255 return NT_STATUS_NOT_IMPLEMENTED
;
258 ret
= idmap_tdb2_allocate_id(dom
, id
);
264 IDMAP MAPPING TDB BACKEND
268 Initialise idmap database.
270 static NTSTATUS
idmap_tdb2_db_init(struct idmap_domain
*dom
,
274 struct idmap_tdb2_context
*ctx
;
277 ctx
= talloc_zero(dom
, struct idmap_tdb2_context
);
279 DEBUG(0, ("Out of memory!\n"));
280 return NT_STATUS_NO_MEMORY
;
283 if (strequal(dom
->name
, "*")) {
284 ctx
->script
= lp_parm_const_string(-1, "idmap", "script", NULL
);
286 DEBUG(1, ("using idmap script '%s'\n", ctx
->script
));
289 char *config_option
= NULL
;
291 config_option
= talloc_asprintf(ctx
, "idmap config %s", dom
->name
);
292 if ( ! config_option
) {
293 DEBUG(0, ("Out of memory!\n"));
294 ret
= NT_STATUS_NO_MEMORY
;
298 ctx
->script
= lp_parm_const_string(-1, config_option
, "script", NULL
);
300 DEBUG(1, ("using idmap script '%s'\n", ctx
->script
));
303 talloc_free(config_option
);
306 dom
->private_data
= ctx
;
308 ret
= idmap_tdb2_open_db(dom
);
309 if (!NT_STATUS_IS_OK(ret
)) {
322 * store a mapping in the database.
325 struct idmap_tdb2_set_mapping_context
{
330 static NTSTATUS
idmap_tdb2_set_mapping_action(struct db_context
*db
,
335 struct idmap_tdb2_set_mapping_context
*state
;
336 TALLOC_CTX
*tmp_ctx
= talloc_stackframe();
338 state
= (struct idmap_tdb2_set_mapping_context
*)private_data
;
340 DEBUG(10, ("Storing %s <-> %s map\n", state
->ksidstr
, state
->kidstr
));
342 /* check wheter sid mapping is already present in db */
343 data
= dbwrap_fetch_bystring(db
, tmp_ctx
, state
->ksidstr
);
345 ret
= NT_STATUS_OBJECT_NAME_COLLISION
;
349 ret
= dbwrap_store_bystring(db
, state
->ksidstr
,
350 string_term_tdb_data(state
->kidstr
),
352 if (!NT_STATUS_IS_OK(ret
)) {
353 DEBUG(0, ("Error storing SID -> ID: %s\n", nt_errstr(ret
)));
357 ret
= dbwrap_store_bystring(db
, state
->kidstr
,
358 string_term_tdb_data(state
->ksidstr
),
360 if (!NT_STATUS_IS_OK(ret
)) {
361 DEBUG(0, ("Error storing ID -> SID: %s\n", nt_errstr(ret
)));
362 /* try to remove the previous stored SID -> ID map */
363 dbwrap_delete_bystring(db
, state
->ksidstr
);
367 DEBUG(10,("Stored %s <-> %s\n", state
->ksidstr
, state
->kidstr
));
370 talloc_free(tmp_ctx
);
374 static NTSTATUS
idmap_tdb2_set_mapping(struct idmap_domain
*dom
, const struct id_map
*map
)
376 struct idmap_tdb2_context
*ctx
;
378 char *ksidstr
, *kidstr
;
379 struct idmap_tdb2_set_mapping_context state
;
381 if (!map
|| !map
->sid
) {
382 return NT_STATUS_INVALID_PARAMETER
;
385 ksidstr
= kidstr
= NULL
;
387 /* TODO: should we filter a set_mapping using low/high filters ? */
389 ctx
= talloc_get_type(dom
->private_data
, struct idmap_tdb2_context
);
391 switch (map
->xid
.type
) {
394 kidstr
= talloc_asprintf(ctx
, "UID %lu", (unsigned long)map
->xid
.id
);
398 kidstr
= talloc_asprintf(ctx
, "GID %lu", (unsigned long)map
->xid
.id
);
402 DEBUG(2, ("INVALID unix ID type: 0x02%x\n", map
->xid
.type
));
403 return NT_STATUS_INVALID_PARAMETER
;
406 if (kidstr
== NULL
) {
407 DEBUG(0, ("ERROR: Out of memory!\n"));
408 ret
= NT_STATUS_NO_MEMORY
;
412 ksidstr
= sid_string_talloc(ctx
, map
->sid
);
413 if (ksidstr
== NULL
) {
414 DEBUG(0, ("Out of memory!\n"));
415 ret
= NT_STATUS_NO_MEMORY
;
419 state
.ksidstr
= ksidstr
;
420 state
.kidstr
= kidstr
;
422 ret
= dbwrap_trans_do(ctx
->db
, idmap_tdb2_set_mapping_action
,
426 talloc_free(ksidstr
);
433 run a script to perform a mapping
435 The script should the following command lines:
441 and should return one of the following as a single line of text
447 static NTSTATUS
idmap_tdb2_script(struct idmap_tdb2_context
*ctx
, struct id_map
*map
,
448 const char *fmt
, ...)
456 cmd
= talloc_asprintf(ctx
, "%s ", ctx
->script
);
457 NT_STATUS_HAVE_NO_MEMORY(cmd
);
460 cmd
= talloc_vasprintf_append(cmd
, fmt
, ap
);
462 NT_STATUS_HAVE_NO_MEMORY(cmd
);
467 return NT_STATUS_NONE_MAPPED
;
470 if (fgets(line
, sizeof(line
)-1, p
) == NULL
) {
472 return NT_STATUS_NONE_MAPPED
;
476 DEBUG(10,("idmap script gave: %s\n", line
));
478 if (sscanf(line
, "UID:%lu", &v
) == 1) {
480 map
->xid
.type
= ID_TYPE_UID
;
481 } else if (sscanf(line
, "GID:%lu", &v
) == 1) {
483 map
->xid
.type
= ID_TYPE_GID
;
484 } else if (strncmp(line
, "SID:S-", 6) == 0) {
485 if (!string_to_sid(map
->sid
, &line
[4])) {
486 DEBUG(0,("Bad SID in '%s' from idmap script %s\n",
488 return NT_STATUS_NONE_MAPPED
;
491 DEBUG(0,("Bad reply '%s' from idmap script %s\n",
493 return NT_STATUS_NONE_MAPPED
;
502 Single id to sid lookup function.
504 static NTSTATUS
idmap_tdb2_id_to_sid(struct idmap_domain
*dom
, struct id_map
*map
)
510 struct idmap_tdb2_context
*ctx
;
514 return NT_STATUS_INVALID_PARAMETER
;
517 status
= idmap_tdb2_open_db(dom
);
518 NT_STATUS_NOT_OK_RETURN(status
);
520 ctx
= talloc_get_type(dom
->private_data
, struct idmap_tdb2_context
);
522 /* apply filters before checking */
523 if (!idmap_unix_id_is_in_range(map
->xid
.id
, dom
)) {
524 DEBUG(5, ("Requested id (%u) out of range (%u - %u). Filtered!\n",
525 map
->xid
.id
, dom
->low_id
, dom
->high_id
));
526 return NT_STATUS_NONE_MAPPED
;
529 switch (map
->xid
.type
) {
532 keystr
= talloc_asprintf(ctx
, "UID %lu", (unsigned long)map
->xid
.id
);
536 keystr
= talloc_asprintf(ctx
, "GID %lu", (unsigned long)map
->xid
.id
);
540 DEBUG(2, ("INVALID unix ID type: 0x02%x\n", map
->xid
.type
));
541 return NT_STATUS_INVALID_PARAMETER
;
544 /* final SAFE_FREE safe */
547 if (keystr
== NULL
) {
548 DEBUG(0, ("Out of memory!\n"));
549 ret
= NT_STATUS_NO_MEMORY
;
553 DEBUG(10,("Fetching record %s\n", keystr
));
555 /* Check if the mapping exists */
556 data
= dbwrap_fetch_bystring(ctx
->db
, keystr
, keystr
);
560 struct idmap_tdb2_set_mapping_context store_state
;
562 DEBUG(10,("Record %s not found\n", keystr
));
563 if (ctx
->script
== NULL
) {
564 ret
= NT_STATUS_NONE_MAPPED
;
568 ret
= idmap_tdb2_script(ctx
, map
, "IDTOSID %s", keystr
);
570 /* store it on shared storage */
571 if (!NT_STATUS_IS_OK(ret
)) {
575 sidstr
= sid_string_talloc(keystr
, map
->sid
);
577 ret
= NT_STATUS_NO_MEMORY
;
581 store_state
.ksidstr
= sidstr
;
582 store_state
.kidstr
= keystr
;
584 ret
= dbwrap_trans_do(ctx
->db
, idmap_tdb2_set_mapping_action
,
589 if (!string_to_sid(map
->sid
, (const char *)data
.dptr
)) {
590 DEBUG(10,("INVALID SID (%s) in record %s\n",
591 (const char *)data
.dptr
, keystr
));
592 ret
= NT_STATUS_INTERNAL_DB_ERROR
;
596 DEBUG(10,("Found record %s -> %s\n", keystr
, (const char *)data
.dptr
));
606 Single sid to id lookup function.
608 static NTSTATUS
idmap_tdb2_sid_to_id(struct idmap_domain
*dom
, struct id_map
*map
)
613 unsigned long rec_id
= 0;
614 struct idmap_tdb2_context
*ctx
;
615 TALLOC_CTX
*tmp_ctx
= talloc_stackframe();
617 ret
= idmap_tdb2_open_db(dom
);
618 NT_STATUS_NOT_OK_RETURN(ret
);
620 ctx
= talloc_get_type(dom
->private_data
, struct idmap_tdb2_context
);
622 keystr
= sid_string_talloc(tmp_ctx
, map
->sid
);
623 if (keystr
== NULL
) {
624 DEBUG(0, ("Out of memory!\n"));
625 ret
= NT_STATUS_NO_MEMORY
;
629 DEBUG(10,("Fetching record %s\n", keystr
));
631 /* Check if sid is present in database */
632 data
= dbwrap_fetch_bystring(ctx
->db
, tmp_ctx
, keystr
);
635 struct idmap_tdb2_set_mapping_context store_state
;
637 DEBUG(10,(__location__
" Record %s not found\n", keystr
));
639 if (ctx
->script
== NULL
) {
640 ret
= NT_STATUS_NONE_MAPPED
;
644 ret
= idmap_tdb2_script(ctx
, map
, "SIDTOID %s", keystr
);
645 /* store it on shared storage */
646 if (!NT_STATUS_IS_OK(ret
)) {
650 /* apply filters before returning result */
651 if (!idmap_unix_id_is_in_range(map
->xid
.id
, dom
)) {
652 DEBUG(5, ("Script returned id (%u) out of range "
653 "(%u - %u). Filtered!\n",
654 map
->xid
.id
, dom
->low_id
, dom
->high_id
));
655 ret
= NT_STATUS_NONE_MAPPED
;
659 idstr
= talloc_asprintf(tmp_ctx
, "%cID %lu",
660 map
->xid
.type
== ID_TYPE_UID
?'U':'G',
661 (unsigned long)map
->xid
.id
);
663 ret
= NT_STATUS_NO_MEMORY
;
667 store_state
.ksidstr
= keystr
;
668 store_state
.kidstr
= idstr
;
670 ret
= dbwrap_trans_do(ctx
->db
, idmap_tdb2_set_mapping_action
,
675 /* What type of record is this ? */
676 if (sscanf((const char *)data
.dptr
, "UID %lu", &rec_id
) == 1) { /* Try a UID record. */
677 map
->xid
.id
= rec_id
;
678 map
->xid
.type
= ID_TYPE_UID
;
679 DEBUG(10,("Found uid record %s -> %s \n", keystr
, (const char *)data
.dptr
));
682 } else if (sscanf((const char *)data
.dptr
, "GID %lu", &rec_id
) == 1) { /* Try a GID record. */
683 map
->xid
.id
= rec_id
;
684 map
->xid
.type
= ID_TYPE_GID
;
685 DEBUG(10,("Found gid record %s -> %s \n", keystr
, (const char *)data
.dptr
));
688 } else { /* Unknown record type ! */
689 DEBUG(2, ("Found INVALID record %s -> %s\n", keystr
, (const char *)data
.dptr
));
690 ret
= NT_STATUS_INTERNAL_DB_ERROR
;
694 /* apply filters before returning result */
695 if (!idmap_unix_id_is_in_range(map
->xid
.id
, dom
)) {
696 DEBUG(5, ("Requested id (%u) out of range (%u - %u). Filtered!\n",
697 map
->xid
.id
, dom
->low_id
, dom
->high_id
));
698 ret
= NT_STATUS_NONE_MAPPED
;
702 talloc_free(tmp_ctx
);
707 lookup a set of unix ids.
709 static NTSTATUS
idmap_tdb2_unixids_to_sids(struct idmap_domain
*dom
, struct id_map
**ids
)
714 /* initialize the status to avoid suprise */
715 for (i
= 0; ids
[i
]; i
++) {
716 ids
[i
]->status
= ID_UNKNOWN
;
719 for (i
= 0; ids
[i
]; i
++) {
720 ret
= idmap_tdb2_id_to_sid(dom
, ids
[i
]);
721 if ( ! NT_STATUS_IS_OK(ret
)) {
723 /* if it is just a failed mapping continue */
724 if (NT_STATUS_EQUAL(ret
, NT_STATUS_NONE_MAPPED
)) {
726 /* make sure it is marked as unmapped */
727 ids
[i
]->status
= ID_UNMAPPED
;
731 /* some fatal error occurred, return immediately */
735 /* all ok, id is mapped */
736 ids
[i
]->status
= ID_MAPPED
;
746 lookup a set of sids.
749 struct idmap_tdb2_sids_to_unixids_context
{
750 struct idmap_domain
*dom
;
752 bool allocate_unmapped
;
755 static NTSTATUS
idmap_tdb2_sids_to_unixids_action(struct db_context
*db
,
758 struct idmap_tdb2_sids_to_unixids_context
*state
;
760 NTSTATUS ret
= NT_STATUS_OK
;
762 state
= (struct idmap_tdb2_sids_to_unixids_context
*)private_data
;
764 DEBUG(10, ("idmap_tdb2_sids_to_unixids_action: "
765 " domain: [%s], allocate: %s\n",
767 state
->allocate_unmapped
? "yes" : "no"));
769 for (i
= 0; state
->ids
[i
]; i
++) {
770 if ((state
->ids
[i
]->status
== ID_UNKNOWN
) ||
771 /* retry if we could not map in previous run: */
772 (state
->ids
[i
]->status
== ID_UNMAPPED
))
776 ret2
= idmap_tdb2_sid_to_id(state
->dom
, state
->ids
[i
]);
777 if (!NT_STATUS_IS_OK(ret2
)) {
779 /* if it is just a failed mapping, continue */
780 if (NT_STATUS_EQUAL(ret2
, NT_STATUS_NONE_MAPPED
)) {
782 /* make sure it is marked as unmapped */
783 state
->ids
[i
]->status
= ID_UNMAPPED
;
784 ret
= STATUS_SOME_UNMAPPED
;
786 /* some fatal error occurred, return immediately */
791 /* all ok, id is mapped */
792 state
->ids
[i
]->status
= ID_MAPPED
;
796 if ((state
->ids
[i
]->status
== ID_UNMAPPED
) &&
797 state
->allocate_unmapped
)
799 ret
= idmap_tdb2_new_mapping(state
->dom
, state
->ids
[i
]);
800 if (!NT_STATUS_IS_OK(ret
)) {
810 static NTSTATUS
idmap_tdb2_sids_to_unixids(struct idmap_domain
*dom
, struct id_map
**ids
)
814 struct idmap_tdb2_sids_to_unixids_context state
;
815 struct idmap_tdb2_context
*ctx
;
817 ctx
= talloc_get_type(dom
->private_data
, struct idmap_tdb2_context
);
819 /* initialize the status to avoid suprise */
820 for (i
= 0; ids
[i
]; i
++) {
821 ids
[i
]->status
= ID_UNKNOWN
;
826 state
.allocate_unmapped
= false;
828 ret
= idmap_tdb2_sids_to_unixids_action(ctx
->db
, &state
);
830 if (NT_STATUS_EQUAL(ret
, STATUS_SOME_UNMAPPED
) && !dom
->read_only
) {
831 state
.allocate_unmapped
= true;
832 ret
= dbwrap_trans_do(ctx
->db
,
833 idmap_tdb2_sids_to_unixids_action
,
842 * Create a new mapping for an unmapped SID, also allocating a new ID.
843 * This should be run inside a transaction.
846 * Properly integrate this with multi domain idmap config:
847 * Currently, the allocator is default-config only.
849 static NTSTATUS
idmap_tdb2_new_mapping(struct idmap_domain
*dom
, struct id_map
*map
)
854 ret
= NT_STATUS_INVALID_PARAMETER
;
858 if ((map
->xid
.type
!= ID_TYPE_UID
) && (map
->xid
.type
!= ID_TYPE_GID
)) {
859 ret
= NT_STATUS_INVALID_PARAMETER
;
863 if (map
->sid
== NULL
) {
864 ret
= NT_STATUS_INVALID_PARAMETER
;
868 ret
= idmap_tdb2_get_new_id(dom
, &map
->xid
);
869 if (!NT_STATUS_IS_OK(ret
)) {
870 DEBUG(3, ("Could not allocate id: %s\n", nt_errstr(ret
)));
874 DEBUG(10, ("Setting mapping: %s <-> %s %lu\n",
875 sid_string_dbg(map
->sid
),
876 (map
->xid
.type
== ID_TYPE_UID
) ? "UID" : "GID",
877 (unsigned long)map
->xid
.id
));
879 map
->status
= ID_MAPPED
;
881 /* store the mapping */
882 ret
= idmap_tdb2_set_mapping(dom
, map
);
883 if (!NT_STATUS_IS_OK(ret
)) {
884 DEBUG(3, ("Could not store the new mapping: %s\n",
893 Close the idmap tdb instance
895 static NTSTATUS
idmap_tdb2_close(struct idmap_domain
*dom
)
897 /* don't do anything */
901 static struct idmap_methods db_methods
= {
902 .init
= idmap_tdb2_db_init
,
903 .unixids_to_sids
= idmap_tdb2_unixids_to_sids
,
904 .sids_to_unixids
= idmap_tdb2_sids_to_unixids
,
905 .allocate_id
= idmap_tdb2_get_new_id
,
906 .close_fn
= idmap_tdb2_close
909 NTSTATUS
idmap_tdb2_init(void)
911 return smb_register_idmap(SMB_IDMAP_INTERFACE_VERSION
, "tdb2", &db_methods
);