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.
38 #define DBGC_CLASS DBGC_IDMAP
40 struct idmap_tdb2_context
{
41 struct db_context
*db
;
42 const char *script
; /* script to provide idmaps */
45 /* High water mark keys */
46 #define HWM_GROUP "GROUP HWM"
47 #define HWM_USER "USER HWM"
51 * check and initialize high/low water marks in the db
53 static NTSTATUS
idmap_tdb2_init_hwm(struct idmap_domain
*dom
)
56 struct idmap_tdb2_context
*ctx
;
58 ctx
= talloc_get_type(dom
->private_data
, struct idmap_tdb2_context
);
60 /* Create high water marks for group and user id */
62 low_id
= dbwrap_fetch_int32(ctx
->db
, HWM_USER
);
63 if ((low_id
== -1) || (low_id
< dom
->low_id
)) {
64 if (!NT_STATUS_IS_OK(dbwrap_trans_store_int32(
67 DEBUG(0, ("Unable to initialise user hwm in idmap "
69 return NT_STATUS_INTERNAL_DB_ERROR
;
73 low_id
= dbwrap_fetch_int32(ctx
->db
, HWM_GROUP
);
74 if ((low_id
== -1) || (low_id
< dom
->low_id
)) {
75 if (!NT_STATUS_IS_OK(dbwrap_trans_store_int32(
78 DEBUG(0, ("Unable to initialise group hwm in idmap "
80 return NT_STATUS_INTERNAL_DB_ERROR
;
89 open the permanent tdb
91 static NTSTATUS
idmap_tdb2_open_db(struct idmap_domain
*dom
)
94 struct idmap_tdb2_context
*ctx
;
96 ctx
= talloc_get_type(dom
->private_data
, struct idmap_tdb2_context
);
99 /* its already open */
103 db_path
= lp_parm_talloc_string(-1, "tdb", "idmap2.tdb", NULL
);
104 if (db_path
== NULL
) {
105 /* fall back to the private directory, which, despite
106 its name, is usually on shared storage */
107 db_path
= talloc_asprintf(NULL
, "%s/idmap2.tdb", lp_private_dir());
109 NT_STATUS_HAVE_NO_MEMORY(db_path
);
111 /* Open idmap repository */
112 ctx
->db
= db_open(ctx
, db_path
, 0, TDB_DEFAULT
, O_RDWR
|O_CREAT
, 0644);
113 TALLOC_FREE(db_path
);
115 if (ctx
->db
== NULL
) {
116 DEBUG(0, ("Unable to open idmap_tdb2 database '%s'\n",
118 return NT_STATUS_UNSUCCESSFUL
;
121 return idmap_tdb2_init_hwm(dom
);
129 struct idmap_tdb2_allocate_id_context
{
136 static NTSTATUS
idmap_tdb2_allocate_id_action(struct db_context
*db
,
140 struct idmap_tdb2_allocate_id_context
*state
;
143 state
= (struct idmap_tdb2_allocate_id_context
*)private_data
;
145 hwm
= dbwrap_fetch_int32(db
, state
->hwmkey
);
147 ret
= NT_STATUS_INTERNAL_DB_ERROR
;
151 /* check it is in the range */
152 if (hwm
> state
->high_hwm
) {
153 DEBUG(1, ("Fatal Error: %s range full!! (max: %lu)\n",
154 state
->hwmtype
, (unsigned long)state
->high_hwm
));
155 ret
= NT_STATUS_UNSUCCESSFUL
;
159 /* fetch a new id and increment it */
160 ret
= dbwrap_trans_change_uint32_atomic(db
, state
->hwmkey
, &hwm
, 1);
161 if (!NT_STATUS_IS_OK(ret
)) {
162 DEBUG(1, ("Fatal error while fetching a new %s value\n!",
167 /* recheck it is in the range */
168 if (hwm
> state
->high_hwm
) {
169 DEBUG(1, ("Fatal Error: %s range full!! (max: %lu)\n",
170 state
->hwmtype
, (unsigned long)state
->high_hwm
));
171 ret
= NT_STATUS_UNSUCCESSFUL
;
182 static NTSTATUS
idmap_tdb2_allocate_id(struct idmap_domain
*dom
,
190 struct idmap_tdb2_allocate_id_context state
;
191 struct idmap_tdb2_context
*ctx
;
193 status
= idmap_tdb2_open_db(dom
);
194 NT_STATUS_NOT_OK_RETURN(status
);
196 ctx
= talloc_get_type(dom
->private_data
, struct idmap_tdb2_context
);
198 /* Get current high water mark */
212 DEBUG(2, ("Invalid ID type (0x%x)\n", xid
->type
));
213 return NT_STATUS_INVALID_PARAMETER
;
216 high_hwm
= dom
->high_id
;
219 state
.high_hwm
= high_hwm
;
220 state
.hwmtype
= hwmtype
;
221 state
.hwmkey
= hwmkey
;
223 status
= dbwrap_trans_do(ctx
->db
, idmap_tdb2_allocate_id_action
,
226 if (NT_STATUS_IS_OK(status
)) {
228 DEBUG(10,("New %s = %d\n", hwmtype
, state
.hwm
));
230 DEBUG(1, ("Error allocating a new %s\n", hwmtype
));
237 * Allocate a new unix-ID.
238 * For now this is for the default idmap domain only.
239 * Should be extended later on.
241 static NTSTATUS
idmap_tdb2_get_new_id(struct idmap_domain
*dom
,
246 if (!strequal(dom
->name
, "*")) {
247 DEBUG(3, ("idmap_tdb2_get_new_id: "
248 "Refusing creation of mapping for domain'%s'. "
249 "Currently only supported for the default "
252 return NT_STATUS_NOT_IMPLEMENTED
;
255 ret
= idmap_tdb2_allocate_id(dom
, id
);
261 IDMAP MAPPING TDB BACKEND
265 Initialise idmap database.
267 static NTSTATUS
idmap_tdb2_db_init(struct idmap_domain
*dom
,
271 struct idmap_tdb2_context
*ctx
;
273 ctx
= talloc_zero(dom
, struct idmap_tdb2_context
);
275 DEBUG(0, ("Out of memory!\n"));
276 return NT_STATUS_NO_MEMORY
;
279 if (strequal(dom
->name
, "*")) {
280 ctx
->script
= lp_parm_const_string(-1, "idmap", "script", NULL
);
282 DEBUG(1, ("using idmap script '%s'\n", ctx
->script
));
285 char *config_option
= NULL
;
287 config_option
= talloc_asprintf(ctx
, "idmap config %s", dom
->name
);
288 if ( ! config_option
) {
289 DEBUG(0, ("Out of memory!\n"));
290 ret
= NT_STATUS_NO_MEMORY
;
294 ctx
->script
= lp_parm_const_string(-1, config_option
, "script", NULL
);
296 DEBUG(1, ("using idmap script '%s'\n", ctx
->script
));
299 talloc_free(config_option
);
302 dom
->private_data
= ctx
;
304 ret
= idmap_tdb2_open_db(dom
);
305 if (!NT_STATUS_IS_OK(ret
)) {
318 * store a mapping in the database.
321 struct idmap_tdb2_set_mapping_context
{
326 static NTSTATUS
idmap_tdb2_set_mapping_action(struct db_context
*db
,
331 struct idmap_tdb2_set_mapping_context
*state
;
332 TALLOC_CTX
*tmp_ctx
= talloc_stackframe();
334 state
= (struct idmap_tdb2_set_mapping_context
*)private_data
;
336 DEBUG(10, ("Storing %s <-> %s map\n", state
->ksidstr
, state
->kidstr
));
338 /* check wheter sid mapping is already present in db */
339 data
= dbwrap_fetch_bystring(db
, tmp_ctx
, state
->ksidstr
);
341 ret
= NT_STATUS_OBJECT_NAME_COLLISION
;
345 ret
= dbwrap_store_bystring(db
, state
->ksidstr
,
346 string_term_tdb_data(state
->kidstr
),
348 if (!NT_STATUS_IS_OK(ret
)) {
349 DEBUG(0, ("Error storing SID -> ID: %s\n", nt_errstr(ret
)));
353 ret
= dbwrap_store_bystring(db
, state
->kidstr
,
354 string_term_tdb_data(state
->ksidstr
),
356 if (!NT_STATUS_IS_OK(ret
)) {
357 DEBUG(0, ("Error storing ID -> SID: %s\n", nt_errstr(ret
)));
358 /* try to remove the previous stored SID -> ID map */
359 dbwrap_delete_bystring(db
, state
->ksidstr
);
363 DEBUG(10,("Stored %s <-> %s\n", state
->ksidstr
, state
->kidstr
));
366 talloc_free(tmp_ctx
);
370 static NTSTATUS
idmap_tdb2_set_mapping(struct idmap_domain
*dom
, const struct id_map
*map
)
372 struct idmap_tdb2_context
*ctx
;
374 char *ksidstr
, *kidstr
;
375 struct idmap_tdb2_set_mapping_context state
;
377 if (!map
|| !map
->sid
) {
378 return NT_STATUS_INVALID_PARAMETER
;
381 ksidstr
= kidstr
= NULL
;
383 /* TODO: should we filter a set_mapping using low/high filters ? */
385 ctx
= talloc_get_type(dom
->private_data
, struct idmap_tdb2_context
);
387 switch (map
->xid
.type
) {
390 kidstr
= talloc_asprintf(ctx
, "UID %lu", (unsigned long)map
->xid
.id
);
394 kidstr
= talloc_asprintf(ctx
, "GID %lu", (unsigned long)map
->xid
.id
);
398 DEBUG(2, ("INVALID unix ID type: 0x02%x\n", map
->xid
.type
));
399 return NT_STATUS_INVALID_PARAMETER
;
402 if (kidstr
== NULL
) {
403 DEBUG(0, ("ERROR: Out of memory!\n"));
404 ret
= NT_STATUS_NO_MEMORY
;
408 ksidstr
= sid_string_talloc(ctx
, map
->sid
);
409 if (ksidstr
== NULL
) {
410 DEBUG(0, ("Out of memory!\n"));
411 ret
= NT_STATUS_NO_MEMORY
;
415 state
.ksidstr
= ksidstr
;
416 state
.kidstr
= kidstr
;
418 ret
= dbwrap_trans_do(ctx
->db
, idmap_tdb2_set_mapping_action
,
422 talloc_free(ksidstr
);
428 * Create a new mapping for an unmapped SID, also allocating a new ID.
429 * This should be run inside a transaction.
432 * Properly integrate this with multi domain idmap config:
433 * Currently, the allocator is default-config only.
435 static NTSTATUS
idmap_tdb2_new_mapping(struct idmap_domain
*dom
, struct id_map
*map
)
440 ret
= NT_STATUS_INVALID_PARAMETER
;
444 if ((map
->xid
.type
!= ID_TYPE_UID
) && (map
->xid
.type
!= ID_TYPE_GID
)) {
445 ret
= NT_STATUS_INVALID_PARAMETER
;
449 if (map
->sid
== NULL
) {
450 ret
= NT_STATUS_INVALID_PARAMETER
;
454 ret
= idmap_tdb2_get_new_id(dom
, &map
->xid
);
455 if (!NT_STATUS_IS_OK(ret
)) {
456 DEBUG(3, ("Could not allocate id: %s\n", nt_errstr(ret
)));
460 DEBUG(10, ("Setting mapping: %s <-> %s %lu\n",
461 sid_string_dbg(map
->sid
),
462 (map
->xid
.type
== ID_TYPE_UID
) ? "UID" : "GID",
463 (unsigned long)map
->xid
.id
));
465 map
->status
= ID_MAPPED
;
467 /* store the mapping */
468 ret
= idmap_tdb2_set_mapping(dom
, map
);
469 if (!NT_STATUS_IS_OK(ret
)) {
470 DEBUG(3, ("Could not store the new mapping: %s\n",
480 run a script to perform a mapping
482 The script should the following command lines:
488 and should return one of the following as a single line of text
494 static NTSTATUS
idmap_tdb2_script(struct idmap_tdb2_context
*ctx
, struct id_map
*map
,
495 const char *fmt
, ...)
503 cmd
= talloc_asprintf(ctx
, "%s ", ctx
->script
);
504 NT_STATUS_HAVE_NO_MEMORY(cmd
);
507 cmd
= talloc_vasprintf_append(cmd
, fmt
, ap
);
509 NT_STATUS_HAVE_NO_MEMORY(cmd
);
514 return NT_STATUS_NONE_MAPPED
;
517 if (fgets(line
, sizeof(line
)-1, p
) == NULL
) {
519 return NT_STATUS_NONE_MAPPED
;
523 DEBUG(10,("idmap script gave: %s\n", line
));
525 if (sscanf(line
, "UID:%lu", &v
) == 1) {
527 map
->xid
.type
= ID_TYPE_UID
;
528 } else if (sscanf(line
, "GID:%lu", &v
) == 1) {
530 map
->xid
.type
= ID_TYPE_GID
;
531 } else if (strncmp(line
, "SID:S-", 6) == 0) {
532 if (!string_to_sid(map
->sid
, &line
[4])) {
533 DEBUG(0,("Bad SID in '%s' from idmap script %s\n",
535 return NT_STATUS_NONE_MAPPED
;
538 DEBUG(0,("Bad reply '%s' from idmap script %s\n",
540 return NT_STATUS_NONE_MAPPED
;
549 Single id to sid lookup function.
551 static NTSTATUS
idmap_tdb2_id_to_sid(struct idmap_domain
*dom
, struct id_map
*map
)
557 struct idmap_tdb2_context
*ctx
;
561 return NT_STATUS_INVALID_PARAMETER
;
564 status
= idmap_tdb2_open_db(dom
);
565 NT_STATUS_NOT_OK_RETURN(status
);
567 ctx
= talloc_get_type(dom
->private_data
, struct idmap_tdb2_context
);
569 /* apply filters before checking */
570 if (!idmap_unix_id_is_in_range(map
->xid
.id
, dom
)) {
571 DEBUG(5, ("Requested id (%u) out of range (%u - %u). Filtered!\n",
572 map
->xid
.id
, dom
->low_id
, dom
->high_id
));
573 return NT_STATUS_NONE_MAPPED
;
576 switch (map
->xid
.type
) {
579 keystr
= talloc_asprintf(ctx
, "UID %lu", (unsigned long)map
->xid
.id
);
583 keystr
= talloc_asprintf(ctx
, "GID %lu", (unsigned long)map
->xid
.id
);
587 DEBUG(2, ("INVALID unix ID type: 0x02%x\n", map
->xid
.type
));
588 return NT_STATUS_INVALID_PARAMETER
;
591 /* final SAFE_FREE safe */
594 if (keystr
== NULL
) {
595 DEBUG(0, ("Out of memory!\n"));
596 ret
= NT_STATUS_NO_MEMORY
;
600 DEBUG(10,("Fetching record %s\n", keystr
));
602 /* Check if the mapping exists */
603 data
= dbwrap_fetch_bystring(ctx
->db
, keystr
, keystr
);
607 struct idmap_tdb2_set_mapping_context store_state
;
609 DEBUG(10,("Record %s not found\n", keystr
));
610 if (ctx
->script
== NULL
) {
611 ret
= NT_STATUS_NONE_MAPPED
;
615 ret
= idmap_tdb2_script(ctx
, map
, "IDTOSID %s", keystr
);
617 /* store it on shared storage */
618 if (!NT_STATUS_IS_OK(ret
)) {
622 sidstr
= sid_string_talloc(keystr
, map
->sid
);
624 ret
= NT_STATUS_NO_MEMORY
;
628 store_state
.ksidstr
= sidstr
;
629 store_state
.kidstr
= keystr
;
631 ret
= dbwrap_trans_do(ctx
->db
, idmap_tdb2_set_mapping_action
,
636 if (!string_to_sid(map
->sid
, (const char *)data
.dptr
)) {
637 DEBUG(10,("INVALID SID (%s) in record %s\n",
638 (const char *)data
.dptr
, keystr
));
639 ret
= NT_STATUS_INTERNAL_DB_ERROR
;
643 DEBUG(10,("Found record %s -> %s\n", keystr
, (const char *)data
.dptr
));
653 Single sid to id lookup function.
655 static NTSTATUS
idmap_tdb2_sid_to_id(struct idmap_domain
*dom
, struct id_map
*map
)
660 unsigned long rec_id
= 0;
661 struct idmap_tdb2_context
*ctx
;
662 TALLOC_CTX
*tmp_ctx
= talloc_stackframe();
664 ret
= idmap_tdb2_open_db(dom
);
665 NT_STATUS_NOT_OK_RETURN(ret
);
667 ctx
= talloc_get_type(dom
->private_data
, struct idmap_tdb2_context
);
669 keystr
= sid_string_talloc(tmp_ctx
, map
->sid
);
670 if (keystr
== NULL
) {
671 DEBUG(0, ("Out of memory!\n"));
672 ret
= NT_STATUS_NO_MEMORY
;
676 DEBUG(10,("Fetching record %s\n", keystr
));
678 /* Check if sid is present in database */
679 data
= dbwrap_fetch_bystring(ctx
->db
, tmp_ctx
, keystr
);
682 struct idmap_tdb2_set_mapping_context store_state
;
684 DEBUG(10,(__location__
" Record %s not found\n", keystr
));
686 if (ctx
->script
== NULL
) {
687 ret
= NT_STATUS_NONE_MAPPED
;
691 ret
= idmap_tdb2_script(ctx
, map
, "SIDTOID %s", keystr
);
692 /* store it on shared storage */
693 if (!NT_STATUS_IS_OK(ret
)) {
697 /* apply filters before returning result */
698 if (!idmap_unix_id_is_in_range(map
->xid
.id
, dom
)) {
699 DEBUG(5, ("Script returned id (%u) out of range "
700 "(%u - %u). Filtered!\n",
701 map
->xid
.id
, dom
->low_id
, dom
->high_id
));
702 ret
= NT_STATUS_NONE_MAPPED
;
706 idstr
= talloc_asprintf(tmp_ctx
, "%cID %lu",
707 map
->xid
.type
== ID_TYPE_UID
?'U':'G',
708 (unsigned long)map
->xid
.id
);
710 ret
= NT_STATUS_NO_MEMORY
;
714 store_state
.ksidstr
= keystr
;
715 store_state
.kidstr
= idstr
;
717 ret
= dbwrap_trans_do(ctx
->db
, idmap_tdb2_set_mapping_action
,
722 /* What type of record is this ? */
723 if (sscanf((const char *)data
.dptr
, "UID %lu", &rec_id
) == 1) { /* Try a UID record. */
724 map
->xid
.id
= rec_id
;
725 map
->xid
.type
= ID_TYPE_UID
;
726 DEBUG(10,("Found uid record %s -> %s \n", keystr
, (const char *)data
.dptr
));
729 } else if (sscanf((const char *)data
.dptr
, "GID %lu", &rec_id
) == 1) { /* Try a GID record. */
730 map
->xid
.id
= rec_id
;
731 map
->xid
.type
= ID_TYPE_GID
;
732 DEBUG(10,("Found gid record %s -> %s \n", keystr
, (const char *)data
.dptr
));
735 } else { /* Unknown record type ! */
736 DEBUG(2, ("Found INVALID record %s -> %s\n", keystr
, (const char *)data
.dptr
));
737 ret
= NT_STATUS_INTERNAL_DB_ERROR
;
741 /* apply filters before returning result */
742 if (!idmap_unix_id_is_in_range(map
->xid
.id
, dom
)) {
743 DEBUG(5, ("Requested id (%u) out of range (%u - %u). Filtered!\n",
744 map
->xid
.id
, dom
->low_id
, dom
->high_id
));
745 ret
= NT_STATUS_NONE_MAPPED
;
749 talloc_free(tmp_ctx
);
754 lookup a set of unix ids.
756 static NTSTATUS
idmap_tdb2_unixids_to_sids(struct idmap_domain
*dom
, struct id_map
**ids
)
761 /* initialize the status to avoid suprise */
762 for (i
= 0; ids
[i
]; i
++) {
763 ids
[i
]->status
= ID_UNKNOWN
;
766 for (i
= 0; ids
[i
]; i
++) {
767 ret
= idmap_tdb2_id_to_sid(dom
, ids
[i
]);
768 if ( ! NT_STATUS_IS_OK(ret
)) {
770 /* if it is just a failed mapping continue */
771 if (NT_STATUS_EQUAL(ret
, NT_STATUS_NONE_MAPPED
)) {
773 /* make sure it is marked as unmapped */
774 ids
[i
]->status
= ID_UNMAPPED
;
778 /* some fatal error occurred, return immediately */
782 /* all ok, id is mapped */
783 ids
[i
]->status
= ID_MAPPED
;
793 lookup a set of sids.
796 struct idmap_tdb2_sids_to_unixids_context
{
797 struct idmap_domain
*dom
;
799 bool allocate_unmapped
;
802 static NTSTATUS
idmap_tdb2_sids_to_unixids_action(struct db_context
*db
,
805 struct idmap_tdb2_sids_to_unixids_context
*state
;
807 NTSTATUS ret
= NT_STATUS_OK
;
809 state
= (struct idmap_tdb2_sids_to_unixids_context
*)private_data
;
811 DEBUG(10, ("idmap_tdb2_sids_to_unixids_action: "
812 " domain: [%s], allocate: %s\n",
814 state
->allocate_unmapped
? "yes" : "no"));
816 for (i
= 0; state
->ids
[i
]; i
++) {
817 if ((state
->ids
[i
]->status
== ID_UNKNOWN
) ||
818 /* retry if we could not map in previous run: */
819 (state
->ids
[i
]->status
== ID_UNMAPPED
))
823 ret2
= idmap_tdb2_sid_to_id(state
->dom
, state
->ids
[i
]);
824 if (!NT_STATUS_IS_OK(ret2
)) {
826 /* if it is just a failed mapping, continue */
827 if (NT_STATUS_EQUAL(ret2
, NT_STATUS_NONE_MAPPED
)) {
829 /* make sure it is marked as unmapped */
830 state
->ids
[i
]->status
= ID_UNMAPPED
;
831 ret
= STATUS_SOME_UNMAPPED
;
833 /* some fatal error occurred, return immediately */
838 /* all ok, id is mapped */
839 state
->ids
[i
]->status
= ID_MAPPED
;
843 if ((state
->ids
[i
]->status
== ID_UNMAPPED
) &&
844 state
->allocate_unmapped
)
846 ret
= idmap_tdb2_new_mapping(state
->dom
, state
->ids
[i
]);
847 if (!NT_STATUS_IS_OK(ret
)) {
857 static NTSTATUS
idmap_tdb2_sids_to_unixids(struct idmap_domain
*dom
, struct id_map
**ids
)
861 struct idmap_tdb2_sids_to_unixids_context state
;
862 struct idmap_tdb2_context
*ctx
;
864 ctx
= talloc_get_type(dom
->private_data
, struct idmap_tdb2_context
);
866 /* initialize the status to avoid suprise */
867 for (i
= 0; ids
[i
]; i
++) {
868 ids
[i
]->status
= ID_UNKNOWN
;
873 state
.allocate_unmapped
= false;
875 ret
= idmap_tdb2_sids_to_unixids_action(ctx
->db
, &state
);
877 if (NT_STATUS_EQUAL(ret
, STATUS_SOME_UNMAPPED
) && !dom
->read_only
) {
878 state
.allocate_unmapped
= true;
879 ret
= dbwrap_trans_do(ctx
->db
,
880 idmap_tdb2_sids_to_unixids_action
,
889 Close the idmap tdb instance
891 static NTSTATUS
idmap_tdb2_close(struct idmap_domain
*dom
)
893 /* don't do anything */
897 static struct idmap_methods db_methods
= {
898 .init
= idmap_tdb2_db_init
,
899 .unixids_to_sids
= idmap_tdb2_unixids_to_sids
,
900 .sids_to_unixids
= idmap_tdb2_sids_to_unixids
,
901 .allocate_id
= idmap_tdb2_get_new_id
,
902 .close_fn
= idmap_tdb2_close
905 NTSTATUS
idmap_tdb2_init(void)
907 return smb_register_idmap(SMB_IDMAP_INTERFACE_VERSION
, "tdb2", &db_methods
);