2 * idmap_ad: map between Active Directory and RFC 2307 or "Services for Unix" (SFU) Accounts
4 * Unix SMB/CIFS implementation.
6 * Winbind ADS backend functions
8 * Copyright (C) Andrew Tridgell 2001
9 * Copyright (C) Andrew Bartlett <abartlet@samba.org> 2003
10 * Copyright (C) Gerald (Jerry) Carter 2004-2007
11 * Copyright (C) Luke Howard 2001-2004
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
31 #define DBGC_CLASS DBGC_IDMAP
33 #define WINBIND_CCACHE_NAME "MEMORY:winbind_ccache"
35 #define IDMAP_AD_MAX_IDS 30
36 #define CHECK_ALLOC_DONE(mem) do { \
38 DEBUG(0, ("Out of memory!\n")); \
39 ret = NT_STATUS_NO_MEMORY; \
44 struct idmap_ad_context
{
45 uint32_t filter_low_id
;
46 uint32_t filter_high_id
;
49 NTSTATUS
init_module(void);
51 static ADS_STRUCT
*ad_idmap_ads
= NULL
;
52 static struct posix_schema
*ad_schema
= NULL
;
53 static enum wb_posix_mapping ad_map_type
= WB_POSIX_MAP_UNKNOWN
;
55 /************************************************************************
56 ***********************************************************************/
58 static ADS_STRUCT
*ad_idmap_cached_connection_internal(void)
66 if (ad_idmap_ads
!= NULL
) {
69 time_t now
= time(NULL
);
73 expire
= MIN(ads
->auth
.tgt_expire
, ads
->auth
.tgs_expire
);
75 /* check for a valid structure */
76 DEBUG(7, ("Current tickets expire in %d seconds (at %d, time is now %d)\n",
77 (uint32
)expire
-(uint32
)now
, (uint32
) expire
, (uint32
) now
));
79 if ( ads
->config
.realm
&& (expire
> time(NULL
))) {
82 /* we own this ADS_STRUCT so make sure it goes away */
83 DEBUG(7,("Deleting expired krb5 credential cache\n"));
86 ads_kdestroy(WINBIND_CCACHE_NAME
);
88 TALLOC_FREE( ad_schema
);
93 /* we don't want this to affect the users ccache */
94 setenv("KRB5CCNAME", WINBIND_CCACHE_NAME
, 1);
97 if ( (ads
= ads_init(lp_realm(), lp_workgroup(), NULL
)) == NULL
) {
98 DEBUG(1,("ads_init failed\n"));
102 /* the machine acct password might have change - fetch it every time */
103 SAFE_FREE(ads
->auth
.password
);
104 ads
->auth
.password
= secrets_fetch_machine_password(lp_workgroup(), NULL
, NULL
);
106 SAFE_FREE(ads
->auth
.realm
);
107 ads
->auth
.realm
= SMB_STRDUP(lp_realm());
109 /* setup server affinity */
111 get_dc_name( NULL
, ads
->auth
.realm
, dc_name
, &dc_ip
);
113 status
= ads_connect(ads
);
114 if (!ADS_ERR_OK(status
)) {
115 DEBUG(1, ("ad_idmap_init: failed to connect to AD\n"));
120 ads
->is_mine
= False
;
127 /************************************************************************
128 ***********************************************************************/
130 static ADS_STRUCT
*ad_idmap_cached_connection(void)
132 ADS_STRUCT
*ads
= ad_idmap_cached_connection_internal();
137 /* if we have a valid ADS_STRUCT and the schema model is
138 defined, then we can return here. */
143 /* Otherwise, set the schema model */
145 if ( (ad_map_type
== WB_POSIX_MAP_SFU
) ||
146 (ad_map_type
== WB_POSIX_MAP_RFC2307
) )
148 ADS_STATUS schema_status
;
150 schema_status
= ads_check_posix_schema_mapping( NULL
, ads
, ad_map_type
, &ad_schema
);
151 if ( !ADS_ERR_OK(schema_status
) ) {
152 DEBUG(2,("ad_idmap_cached_connection: Failed to obtain schema details!\n"));
160 /************************************************************************
161 ***********************************************************************/
163 static NTSTATUS
idmap_ad_initialize(struct idmap_domain
*dom
)
165 struct idmap_ad_context
*ctx
;
167 const char *range
= NULL
;
168 const char *schema_mode
= NULL
;
170 if ( (ctx
= talloc_zero(dom
, struct idmap_ad_context
)) == NULL
) {
171 DEBUG(0, ("Out of memory!\n"));
172 return NT_STATUS_NO_MEMORY
;
175 if ( (config_option
= talloc_asprintf(ctx
, "idmap config %s", dom
->name
)) == NULL
) {
176 DEBUG(0, ("Out of memory!\n"));
178 return NT_STATUS_NO_MEMORY
;
182 range
= lp_parm_const_string(-1, config_option
, "range", NULL
);
183 if (range
&& range
[0]) {
184 if ((sscanf(range
, "%u - %u", &ctx
->filter_low_id
, &ctx
->filter_high_id
) != 2) ||
185 (ctx
->filter_low_id
> ctx
->filter_high_id
)) {
186 DEBUG(1, ("ERROR: invalid filter range [%s]", range
));
187 ctx
->filter_low_id
= 0;
188 ctx
->filter_high_id
= 0;
193 if ( ad_map_type
== WB_POSIX_MAP_UNKNOWN
)
194 ad_map_type
= WB_POSIX_MAP_RFC2307
;
195 schema_mode
= lp_parm_const_string(-1, config_option
, "schema_mode", NULL
);
196 if ( schema_mode
&& schema_mode
[0] ) {
197 if ( strequal(schema_mode
, "sfu") )
198 ad_map_type
= WB_POSIX_MAP_SFU
;
199 else if ( strequal(schema_mode
, "rfc2307" ) )
200 ad_map_type
= WB_POSIX_MAP_RFC2307
;
202 DEBUG(0,("idmap_ad_initialize: Unknown schema_mode (%s)\n",
206 dom
->private_data
= ctx
;
207 dom
->initialized
= True
;
209 talloc_free(config_option
);
214 /************************************************************************
215 Search up to IDMAP_AD_MAX_IDS entries in maps for a match.
216 ***********************************************************************/
218 static struct id_map
*find_map_by_id(struct id_map
**maps
, enum id_type type
, uint32_t id
)
222 for (i
= 0; maps
[i
] && i
<IDMAP_AD_MAX_IDS
; i
++) {
223 if ((maps
[i
]->xid
.type
== type
) && (maps
[i
]->xid
.id
== id
)) {
231 /************************************************************************
232 Search up to IDMAP_AD_MAX_IDS entries in maps for a match
233 ***********************************************************************/
235 static struct id_map
*find_map_by_sid(struct id_map
**maps
, DOM_SID
*sid
)
239 for (i
= 0; maps
[i
] && i
<IDMAP_AD_MAX_IDS
; i
++) {
240 if (sid_equal(maps
[i
]->sid
, sid
)) {
248 /************************************************************************
249 ***********************************************************************/
251 static NTSTATUS
idmap_ad_unixids_to_sids(struct idmap_domain
*dom
, struct id_map
**ids
)
255 struct idmap_ad_context
*ctx
;
258 const char *attrs
[] = { "sAMAccountType",
260 NULL
, /* uidnumber */
261 NULL
, /* gidnumber */
263 LDAPMessage
*res
= NULL
;
264 LDAPMessage
*entry
= NULL
;
270 char *u_filter
= NULL
;
271 char *g_filter
= NULL
;
273 /* Only do query if we are online */
274 if (idmap_is_offline()) {
275 return NT_STATUS_FILE_IS_OFFLINE
;
278 /* Initilization my have been deferred because we were offline */
279 if ( ! dom
->initialized
) {
280 ret
= idmap_ad_initialize(dom
);
281 if ( ! NT_STATUS_IS_OK(ret
)) {
286 ctx
= talloc_get_type(dom
->private_data
, struct idmap_ad_context
);
288 if ( (memctx
= talloc_new(ctx
)) == NULL
) {
289 DEBUG(0, ("Out of memory!\n"));
290 return NT_STATUS_NO_MEMORY
;
293 if ( (ads
= ad_idmap_cached_connection()) == NULL
) {
294 DEBUG(1, ("ADS uninitialized\n"));
295 ret
= NT_STATUS_UNSUCCESSFUL
;
299 attrs
[2] = ad_schema
->posix_uidnumber_attr
;
300 attrs
[3] = ad_schema
->posix_gidnumber_attr
;
304 for (i
= 0; (i
< IDMAP_AD_MAX_IDS
) && ids
[idx
]; i
++, idx
++) {
305 switch (ids
[idx
]->xid
.type
) {
308 u_filter
= talloc_asprintf(memctx
, "(&(|"
309 "(sAMAccountType=%d)"
310 "(sAMAccountType=%d)"
311 "(sAMAccountType=%d))(|",
312 ATYPE_NORMAL_ACCOUNT
,
313 ATYPE_WORKSTATION_TRUST
,
314 ATYPE_INTERDOMAIN_TRUST
);
316 u_filter
= talloc_asprintf_append(u_filter
, "(%s=%lu)",
317 ad_schema
->posix_uidnumber_attr
,
318 (unsigned long)ids
[idx
]->xid
.id
);
319 CHECK_ALLOC_DONE(u_filter
);
324 g_filter
= talloc_asprintf(memctx
, "(&(|"
325 "(sAMAccountType=%d)"
326 "(sAMAccountType=%d))(|",
327 ATYPE_SECURITY_GLOBAL_GROUP
,
328 ATYPE_SECURITY_LOCAL_GROUP
);
330 g_filter
= talloc_asprintf_append(g_filter
, "(%s=%lu)",
331 ad_schema
->posix_gidnumber_attr
,
332 (unsigned long)ids
[idx
]->xid
.id
);
333 CHECK_ALLOC_DONE(g_filter
);
337 DEBUG(3, ("Error: mapping requested but Unknown ID type\n"));
338 ids
[idx
]->status
= ID_UNKNOWN
;
342 filter
= talloc_asprintf(memctx
, "(|");
343 CHECK_ALLOC_DONE(filter
);
345 filter
= talloc_asprintf_append(filter
, "%s))", u_filter
);
346 CHECK_ALLOC_DONE(filter
);
347 TALLOC_FREE(u_filter
);
350 filter
= talloc_asprintf_append(filter
, "%s))", g_filter
);
351 CHECK_ALLOC_DONE(filter
);
352 TALLOC_FREE(g_filter
);
354 filter
= talloc_asprintf_append(filter
, ")");
355 CHECK_ALLOC_DONE(filter
);
357 rc
= ads_search_retry(ads
, &res
, filter
, attrs
);
358 if (!ADS_ERR_OK(rc
)) {
359 DEBUG(1, ("ERROR: ads search returned: %s\n", ads_errstr(rc
)));
360 ret
= NT_STATUS_UNSUCCESSFUL
;
364 if ( (count
= ads_count_replies(ads
, res
)) == 0 ) {
365 DEBUG(10, ("No IDs found\n"));
369 for (i
= 0; (i
< count
) && entry
; i
++) {
376 if (i
== 0) { /* first entry */
377 entry
= ads_first_entry(ads
, entry
);
378 } else { /* following ones */
379 entry
= ads_next_entry(ads
, entry
);
383 DEBUG(2, ("ERROR: Unable to fetch ldap entries from results\n"));
387 /* first check if the SID is present */
388 if (!ads_pull_sid(ads
, entry
, "objectSid", &sid
)) {
389 DEBUG(2, ("Could not retrieve SID from entry\n"));
394 if (!ads_pull_uint32(ads
, entry
, "sAMAccountType", &atype
)) {
395 DEBUG(1, ("could not get SAM account type\n"));
399 switch (atype
& 0xF0000000) {
400 case ATYPE_SECURITY_GLOBAL_GROUP
:
401 case ATYPE_SECURITY_LOCAL_GROUP
:
404 case ATYPE_NORMAL_ACCOUNT
:
405 case ATYPE_WORKSTATION_TRUST
:
406 case ATYPE_INTERDOMAIN_TRUST
:
410 DEBUG(1, ("unrecognized SAM account type %08x\n", atype
));
414 if (!ads_pull_uint32(ads
, entry
, (type
==ID_TYPE_UID
) ?
415 ad_schema
->posix_uidnumber_attr
:
416 ad_schema
->posix_gidnumber_attr
,
419 DEBUG(1, ("Could not get unix ID\n"));
424 (ctx
->filter_low_id
&& (id
< ctx
->filter_low_id
)) ||
425 (ctx
->filter_high_id
&& (id
> ctx
->filter_high_id
))) {
426 DEBUG(5, ("Requested id (%u) out of range (%u - %u). Filtered!\n",
427 id
, ctx
->filter_low_id
, ctx
->filter_high_id
));
431 map
= find_map_by_id(&ids
[bidx
], type
, id
);
433 DEBUG(2, ("WARNING: couldn't match result with requested ID\n"));
437 sid_copy(map
->sid
, &sid
);
440 map
->status
= ID_MAPPED
;
442 DEBUG(10, ("Mapped %s -> %lu (%d)\n",
443 sid_string_static(map
->sid
),
444 (unsigned long)map
->xid
.id
,
449 ads_msgfree(ads
, res
);
452 if (ids
[idx
]) { /* still some values to map */
458 /* mark all unknown/expired ones as unmapped */
459 for (i
= 0; ids
[i
]; i
++) {
460 if (ids
[i
]->status
!= ID_MAPPED
)
461 ids
[i
]->status
= ID_UNMAPPED
;
469 /************************************************************************
470 ***********************************************************************/
472 static NTSTATUS
idmap_ad_sids_to_unixids(struct idmap_domain
*dom
, struct id_map
**ids
)
476 struct idmap_ad_context
*ctx
;
479 const char *attrs
[] = { "sAMAccountType",
481 NULL
, /* attr_uidnumber */
482 NULL
, /* attr_gidnumber */
484 LDAPMessage
*res
= NULL
;
485 LDAPMessage
*entry
= NULL
;
493 /* Only do query if we are online */
494 if (idmap_is_offline()) {
495 return NT_STATUS_FILE_IS_OFFLINE
;
498 /* Initilization my have been deferred because we were offline */
499 if ( ! dom
->initialized
) {
500 ret
= idmap_ad_initialize(dom
);
501 if ( ! NT_STATUS_IS_OK(ret
)) {
506 ctx
= talloc_get_type(dom
->private_data
, struct idmap_ad_context
);
508 if ( (memctx
= talloc_new(ctx
)) == NULL
) {
509 DEBUG(0, ("Out of memory!\n"));
510 return NT_STATUS_NO_MEMORY
;
513 if ( (ads
= ad_idmap_cached_connection()) == NULL
) {
514 DEBUG(1, ("ADS uninitialized\n"));
515 ret
= NT_STATUS_UNSUCCESSFUL
;
519 attrs
[2] = ad_schema
->posix_uidnumber_attr
;
520 attrs
[3] = ad_schema
->posix_gidnumber_attr
;
523 filter
= talloc_asprintf(memctx
, "(&(|"
524 "(sAMAccountType=%d)(sAMAccountType=%d)(sAMAccountType=%d)" /* user account types */
525 "(sAMAccountType=%d)(sAMAccountType=%d)" /* group account types */
527 ATYPE_NORMAL_ACCOUNT
, ATYPE_WORKSTATION_TRUST
, ATYPE_INTERDOMAIN_TRUST
,
528 ATYPE_SECURITY_GLOBAL_GROUP
, ATYPE_SECURITY_LOCAL_GROUP
);
530 CHECK_ALLOC_DONE(filter
);
533 for (i
= 0; (i
< IDMAP_AD_MAX_IDS
) && ids
[idx
]; i
++, idx
++) {
535 sidstr
= sid_binstring(ids
[idx
]->sid
);
536 filter
= talloc_asprintf_append(filter
, "(objectSid=%s)", sidstr
);
539 CHECK_ALLOC_DONE(filter
);
541 filter
= talloc_asprintf_append(filter
, "))");
542 CHECK_ALLOC_DONE(filter
);
543 DEBUG(10, ("Filter: [%s]\n", filter
));
545 rc
= ads_search_retry(ads
, &res
, filter
, attrs
);
546 if (!ADS_ERR_OK(rc
)) {
547 DEBUG(1, ("ERROR: ads search returned: %s\n", ads_errstr(rc
)));
548 ret
= NT_STATUS_UNSUCCESSFUL
;
552 if ( (count
= ads_count_replies(ads
, res
)) == 0 ) {
553 DEBUG(10, ("No IDs found\n"));
557 for (i
= 0; (i
< count
) && entry
; i
++) {
564 if (i
== 0) { /* first entry */
565 entry
= ads_first_entry(ads
, entry
);
566 } else { /* following ones */
567 entry
= ads_next_entry(ads
, entry
);
571 DEBUG(2, ("ERROR: Unable to fetch ldap entries from results\n"));
575 /* first check if the SID is present */
576 if (!ads_pull_sid(ads
, entry
, "objectSid", &sid
)) {
577 DEBUG(2, ("Could not retrieve SID from entry\n"));
581 map
= find_map_by_sid(&ids
[bidx
], &sid
);
583 DEBUG(2, ("WARNING: couldn't match result with requested SID\n"));
588 if (!ads_pull_uint32(ads
, entry
, "sAMAccountType", &atype
)) {
589 DEBUG(1, ("could not get SAM account type\n"));
593 switch (atype
& 0xF0000000) {
594 case ATYPE_SECURITY_GLOBAL_GROUP
:
595 case ATYPE_SECURITY_LOCAL_GROUP
:
598 case ATYPE_NORMAL_ACCOUNT
:
599 case ATYPE_WORKSTATION_TRUST
:
600 case ATYPE_INTERDOMAIN_TRUST
:
604 DEBUG(1, ("unrecognized SAM account type %08x\n", atype
));
608 if (!ads_pull_uint32(ads
, entry
, (type
==ID_TYPE_UID
) ?
609 ad_schema
->posix_uidnumber_attr
:
610 ad_schema
->posix_gidnumber_attr
,
613 DEBUG(1, ("Could not get unix ID\n"));
617 (ctx
->filter_low_id
&& (id
< ctx
->filter_low_id
)) ||
618 (ctx
->filter_high_id
&& (id
> ctx
->filter_high_id
))) {
619 DEBUG(5, ("Requested id (%u) out of range (%u - %u). Filtered!\n",
620 id
, ctx
->filter_low_id
, ctx
->filter_high_id
));
625 map
->xid
.type
= type
;
627 map
->status
= ID_MAPPED
;
629 DEBUG(10, ("Mapped %s -> %lu (%d)\n",
630 sid_string_static(map
->sid
),
631 (unsigned long)map
->xid
.id
,
636 ads_msgfree(ads
, res
);
639 if (ids
[idx
]) { /* still some values to map */
645 /* mark all unknwoni/expired ones as unmapped */
646 for (i
= 0; ids
[i
]; i
++) {
647 if (ids
[i
]->status
!= ID_MAPPED
)
648 ids
[i
]->status
= ID_UNMAPPED
;
656 /************************************************************************
657 ***********************************************************************/
659 static NTSTATUS
idmap_ad_close(struct idmap_domain
*dom
)
661 ADS_STRUCT
*ads
= ad_idmap_ads
;
664 /* we own this ADS_STRUCT so make sure it goes away */
670 TALLOC_FREE( ad_schema
);
676 * nss_info_{sfu,rfc2307}
679 /************************************************************************
680 Initialize the {sfu,rfc2307} state
681 ***********************************************************************/
683 static NTSTATUS
nss_sfu_init( struct nss_domain_entry
*e
)
685 /* Sanity check if we have previously been called with a
686 different schema model */
688 if ( (ad_map_type
!= WB_POSIX_MAP_UNKNOWN
) &&
689 (ad_map_type
!= WB_POSIX_MAP_SFU
) )
691 DEBUG(0,("nss_sfu_init: Posix Map type has already been set. "
692 "Mixed schema models not supported!\n"));
693 return NT_STATUS_NOT_SUPPORTED
;
696 ad_map_type
= WB_POSIX_MAP_SFU
;
701 static NTSTATUS
nss_rfc2307_init( struct nss_domain_entry
*e
)
703 /* Sanity check if we have previously been called with a
704 different schema model */
706 if ( (ad_map_type
!= WB_POSIX_MAP_UNKNOWN
) &&
707 (ad_map_type
!= WB_POSIX_MAP_RFC2307
) )
709 DEBUG(0,("nss_rfc2307_init: Posix Map type has already been set. "
710 "Mixed schema models not supported!\n"));
711 return NT_STATUS_NOT_SUPPORTED
;
714 ad_map_type
= WB_POSIX_MAP_RFC2307
;
720 /************************************************************************
721 ***********************************************************************/
722 static NTSTATUS
nss_ad_get_info( struct nss_domain_entry
*e
,
732 ADS_STRUCT
*ads_internal
= NULL
;
734 /* Only do query if we are online */
735 if (idmap_is_offline()) {
736 return NT_STATUS_FILE_IS_OFFLINE
;
739 /* We are assuming that the internal ADS_STRUCT is for the
740 same forest as the incoming *ads pointer */
742 ads_internal
= ad_idmap_cached_connection();
744 if ( !ads_internal
|| !ad_schema
)
745 return NT_STATUS_OBJECT_NAME_NOT_FOUND
;
747 if ( !homedir
|| !shell
|| !gecos
)
748 return NT_STATUS_INVALID_PARAMETER
;
750 *homedir
= ads_pull_string( ads
, ctx
, msg
, ad_schema
->posix_homedir_attr
);
751 *shell
= ads_pull_string( ads
, ctx
, msg
, ad_schema
->posix_shell_attr
);
752 *gecos
= ads_pull_string( ads
, ctx
, msg
, ad_schema
->posix_gecos_attr
);
755 if ( !ads_pull_uint32(ads
, msg
, ad_schema
->posix_gidnumber_attr
, gid
) )
762 /************************************************************************
763 ***********************************************************************/
765 static NTSTATUS
nss_ad_close( void )
767 /* nothing to do. All memory is free()'d by the idmap close_fn() */
772 /************************************************************************
773 Function dispatch tables for the idmap and nss plugins
774 ***********************************************************************/
776 static struct idmap_methods ad_methods
= {
777 .init
= idmap_ad_initialize
,
778 .unixids_to_sids
= idmap_ad_unixids_to_sids
,
779 .sids_to_unixids
= idmap_ad_sids_to_unixids
,
780 .close_fn
= idmap_ad_close
783 /* The SFU and RFC2307 NSS plugins share everything but the init
784 function which sets the intended schema model to use */
786 static struct nss_info_methods nss_rfc2307_methods
= {
787 .init
= nss_rfc2307_init
,
788 .get_nss_info
= nss_ad_get_info
,
789 .close_fn
= nss_ad_close
792 static struct nss_info_methods nss_sfu_methods
= {
793 .init
= nss_sfu_init
,
794 .get_nss_info
= nss_ad_get_info
,
795 .close_fn
= nss_ad_close
799 /************************************************************************
800 Initialize the plugins
801 ***********************************************************************/
803 NTSTATUS
idmap_ad_init(void)
805 static NTSTATUS status_idmap_ad
= NT_STATUS_UNSUCCESSFUL
;
806 static NTSTATUS status_nss_rfc2307
= NT_STATUS_UNSUCCESSFUL
;
807 static NTSTATUS status_nss_sfu
= NT_STATUS_UNSUCCESSFUL
;
809 /* Always register the AD method first in order to get the
810 idmap_domain interface called */
812 if ( !NT_STATUS_IS_OK(status_idmap_ad
) ) {
813 status_idmap_ad
= smb_register_idmap(SMB_IDMAP_INTERFACE_VERSION
,
815 if ( !NT_STATUS_IS_OK(status_idmap_ad
) )
816 return status_idmap_ad
;
819 if ( !NT_STATUS_IS_OK( status_nss_rfc2307
) ) {
820 status_nss_rfc2307
= smb_register_idmap_nss(SMB_NSS_INFO_INTERFACE_VERSION
,
821 "rfc2307", &nss_rfc2307_methods
);
822 if ( !NT_STATUS_IS_OK(status_nss_rfc2307
) )
823 return status_nss_rfc2307
;
826 if ( !NT_STATUS_IS_OK( status_nss_sfu
) ) {
827 status_nss_sfu
= smb_register_idmap_nss(SMB_NSS_INFO_INTERFACE_VERSION
,
828 "sfu", &nss_sfu_methods
);
829 if ( !NT_STATUS_IS_OK(status_nss_sfu
) )
830 return status_nss_sfu
;