mlsvc_util.c revision 77191e8775ec29406dec7210fc064d8fd759dd24
/*
* 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
*/
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Utility functions to support the RPC interface library.
*/
#include <stdio.h>
#include <stdarg.h>
#include <strings.h>
#include <unistd.h>
#include <netdb.h>
#include <stdlib.h>
#include <syslog.h>
#include <smbsrv/libsmbns.h>
#include <smbsrv/libmlsvc.h>
#include <smbsrv/libsmbrdr.h>
#include <lsalib.h>
#include <samlib.h>
#include <smbsrv/netrauth.h>
/* Domain join support (using MS-RPC) */
extern int netr_open(char *, char *, mlsvc_handle_t *);
extern int netr_close(mlsvc_handle_t *);
{
"credential chain");
(void) netr_close(&netr_handle);
} else {
}
return (status);
}
/*
* Joins the specified domain by creating a machine account on
* the selected domain controller.
*
* Disconnect any existing connection with the domain controller.
* This will ensure that no stale connection will be used, it will
* also pickup any configuration changes in either side by trying
* to establish a new connection.
*
* Returns NT status codes.
*/
{
int erc;
machine_passwd[0] = '\0';
if (erc == AUTH_USER_GRANT) {
if (mlsvc_ntjoin_support == B_FALSE) {
sizeof (machine_passwd))) == SMB_ADJOIN_SUCCESS) {
} else {
}
} else {
if (status == NT_STATUS_SUCCESS) {
(void) smb_getnetbiosname(machine_passwd,
sizeof (machine_passwd));
(void) smb_strlwr(machine_passwd);
}
}
if (status == NT_STATUS_SUCCESS) {
if (erc != 0) {
"configuration");
return (NT_STATUS_UNSUCCESSFUL);
}
}
} else {
}
return (status);
}
int
mlsvc_ping(const char *server)
{
return (smbrdr_echo(server));
}
void
mlsvc_disconnect(const char *server)
{
}