/*
* 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 2015 Nexenta Systems, Inc. All rights reserved.
*/
/*
* There used to be a "redirector" library, which has been replaced,
* leaving only the "glue" functions in this file that adapt this
* library to the interface provided by libsmbfs.
*/
#include <errno.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include <priv.h>
#include <netsmb/smbfs_api.h>
#include <smbsrv/libmlsvc.h>
#include <libsmbrdr.h>
#include <mlsvc.h>
#include <assert.h>
void
smbrdr_initialize(void)
{
(void) smb_lib_init();
}
/*
* mlsvc_disconnect
*
* Disconnects the session with given server.
* The new conection manager is smart enough
* so that we don't need this to do anything.
*/
/* ARGSUSED */
void
{
}
/*
* smbrdr_logon
*
* I'm not sure this really needs to do anything, but for now
* let's go ahead and authenticate here so this can return a
* status reflecting the outcome of authentication.
*
* If this successfully builds an smb_ctx, it just frees it.
* The driver retains sessions for a little while after the
* last reference goes away, so the session created here will
* usually still exist when the next call to smbrdr_ctx_new
* asks for this server+user (immediately after this returns),
* and only one session setup will go over the wire.
*/
int
{
int err;
if (err == 0)
return (err);
}
void
{
}
/*
* Setup a new SMB client context.
*
* Get the SMB server's configuration stuff and
* store it in the new client context object.
*/
int
{
if (server[0] == '\0')
return (NT_STATUS_INTERNAL_ERROR);
return (NT_STATUS_NO_MEMORY);
/*
* Set server, share, domain, user
* (in the ctx handle).
*/
/*
* Set auth. info (hash) and type.
*/
if (user[0] == '\0') {
} else {
if (lmcl <= 2) {
/* Send NTLM */
} else {
/* Send NTLMv2 */
}
}
/*
* Do lookup, connect, session setup, tree connect.
*/
goto errout;
}
goto errout;
}
goto errout;
}
/* Success! */
return (0);
return (err);
}