/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
/*
* Active Directory Setup RPC interface used by Windows 2000.
*/
#include <synch.h>
#include <strings.h>
#include <stdlib.h>
#include <netdb.h>
#include <smbsrv/libntsvcs.h>
static int dssetup_DsRoleGetPrimaryDomainInfo(void *, ndr_xa_t *);
ndr_xa_t *);
{0}
};
"DSSETUP", /* name */
"Active Directory Setup", /* desc */
"\\lsarpc", /* endpoint */
PIPE_LSASS, /* sec_addr_port */
"3919286a-b10c-11d0-9ba8-00c04fd92ef5", 0, /* abstract */
0, /* no bind_instance_size */
0, /* no bind_req() */
0, /* no unbind_and_close() */
0, /* use generic_call_stub() */
dssetup_stub_table /* stub_table */
};
/*
* dssetup_initialize
*
* This function registers the DSSETUP interface with the RPC runtime
* library. It must be called in order to use either the client side
* or the server side functions.
*/
void
dssetup_initialize(void)
{
(void) ndr_svc_register(&dssetup_service);
}
void
{
(void) mutex_lock(&ds_info_mtx);
(void) mutex_unlock(&ds_info_mtx);
}
/*
* Request for machine role and primary domain information.
*/
static int
{
int security_mode;
} else {
if (security_mode == SMB_SECMODE_DOMAIN)
else
}
if (status != NT_STATUS_SUCCESS) {
} else {
}
return (NDR_DRC_OK);
}
/*
* When the machine role is domain member:
* nt_domain must contain the NetBIOS domain name
* dns_domain must contain the DNS domain name (cannot be NULL)
* forest must contain the forest name (cannot be NULL)
*
* If DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT is set in flags, the domain_guid
* must contain the domain UUID. Otherwise domain_guid is ignored.
*/
static uint32_t
{
(void) mutex_lock(&ds_info_mtx);
/*
* If we don't have the domain GUID, try to get it from a
* domain controller. Otherwise, use local configuration.
*/
(void) dssetup_get_domain_info(&ds_info);
}
sizeof (ndr_uuid_t));
} else {
(void) mutex_unlock(&ds_info_mtx);
return (NT_STATUS_CANT_ACCESS_DOMAIN_INFO);
}
(void) mutex_unlock(&ds_info_mtx);
return (NT_STATUS_CANT_ACCESS_DOMAIN_INFO);
}
(void) smb_strlwr(dns_domain);
}
(void) mutex_unlock(&ds_info_mtx);
return (NT_STATUS_NO_MEMORY);
return (NT_STATUS_SUCCESS);
}
/*
* When the machine role is standalone:
* nt_domain must contain the NetBIOS workgroup name
* dns_domain must be NULL
* forest must be NULL
*
* We don't maintain a domain GUID. When DS_ROLE_PRIMARY_DOMAIN_GUID_PRESENT
* is not set in flags, domain_guid is ignored.
*/
static uint32_t
{
return (NT_STATUS_CANT_ACCESS_DOMAIN_INFO);
return (NT_STATUS_NO_MEMORY);
return (NT_STATUS_SUCCESS);
}