smbd_door_ops.c revision fe1c642d06e14b412cd83ae2179303186ab08972
/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* SMBd door operations
*/
#include <stdlib.h>
#include <synch.h>
#include <strings.h>
#include <smbsrv/smb_common_door.h>
#include <smbsrv/smb_token.h>
#include <smbsrv/libmlsvc.h>
#include <smbsrv/libsmbns.h>
#include "smbd.h"
size_t *, int *);
/* SMB daemon's door operation table */
{
smb_dop_user_auth_logon, /* SMB_DR_USER_AUTH_LOGON */
smb_dop_user_nonauth_logon, /* SMB_DR_USER_NONAUTH_LOGON */
smb_dop_user_auth_logoff, /* SMB_DR_USER_AUTH_LOGOFF */
smb_dop_lookup_sid, /* SMB_DR_LOOKUP_SID */
smb_dop_lookup_name, /* SMB_DR_LOOKUP_NAME */
smb_dop_join, /* SMB_DR_JOIN */
smb_dop_get_dcinfo, /* SMB_DR_GET_DCINFO */
smb_dop_vss_get_count, /* SMB_DR_VSS_GET_COUNT */
smb_dop_vss_get_snapshots, /* SMB_DR_VSS_GET_SNAPSHOTS */
smb_dop_vss_map_gmttoken, /* SMB_DR_VSS_MAP_GMTTOKEN */
smb_dop_ads_find_host /* SMB_DR_ADS_FIND_HOST */
};
/*ARGSUSED*/
static char *
{
char *buf;
*rbufsize = 0;
return (NULL);
}
*rbufsize = 0;
return (NULL);
}
*err = SMB_DR_OP_SUCCESS;
return (buf);
}
/*ARGSUSED*/
static char *
{
char *buf;
*rbufsize = 0;
return (NULL);
}
*rbufsize = 0;
return (NULL);
}
*err = SMB_DR_OP_SUCCESS;
return (buf);
}
/*
* smb_dr_is_valid_opcode
*
* Validates the given door opcode.
*/
int
{
if (opcode < 0 ||
return (-1);
else
return (0);
}
/*
* Obtains an access token on successful user authentication.
*/
/*ARGSUSED*/
static char *
{
char *buf;
*rbufsize = 0;
*err = 0;
return (NULL);
}
if (!token) {
return (NULL);
}
}
return (buf);
}
/*ARGSUSED*/
static char *
{
char buf[MAXNAMELEN];
*err = SMB_DR_OP_SUCCESS;
*rbufsize = 0;
return (NULL);
}
else
else
}
*rbufsize = 0;
}
return (rbuf);
}
/*ARGSUSED*/
static char *
{
*err = SMB_DR_OP_SUCCESS;
*rbufsize = 0;
return (NULL);
}
else
}
*rbufsize = 0;
}
return (rbuf);
}
/*ARGSUSED*/
static char *
{
*err = SMB_DR_OP_SUCCESS;
*rbufsize = 0;
!= 0) {
return (NULL);
}
*rbufsize = 0;
}
return (rbuf);
}
/*ARGSUSED*/
static char *
{
*err = SMB_DR_OP_SUCCESS;
*rbufsize = 0;
if (!smb_domain_getinfo(&dxi)) {
return (NULL);
}
*rbufsize = 0;
}
return (rbuf);
}
/*
* This routine returns the number of snapshots for a dataset
*/
/*ARGSUSED*/
static char *
{
char *path;
*err = SMB_DR_OP_SUCCESS;
*rbufsize = 0;
return (NULL);
}
}
}
return (rbuf);
}
/*
* This routine returns the count and list of snapshots.
* The list is in the Microsoft @GMT token format.
*/
/*ARGSUSED*/
static char *
{
uint_t i;
*err = SMB_DR_OP_SUCCESS;
*rbufsize = 0;
xdr_smb_dr_get_gmttokens_t, &request) != 0) {
return (NULL);
}
sizeof (char *));
sizeof (char *));
return (NULL);
}
}
if (*gmtp)
gmtp++;
}
return (rbuf);
}
/*
* This routine returns the snapshot name of the snapshot
* that matches path of the pathname of the dataset and
* the @GMT token.
*/
/*ARGSUSED*/
static char *
{
char *snapname;
*err = SMB_DR_OP_SUCCESS;
*rbufsize = 0;
&request) != 0) {
return (NULL);
}
return (NULL);
}
snapname) != 0)) {
*snapname = '\0';
}
*rbufsize = 0;
}
return (rbuf);
}
/*ARGSUSED*/
static char *
{
char *hostname;
*err = SMB_DR_OP_SUCCESS;
*rbufsize = 0;
/* Decode */
return (NULL);
}
hostname = "";
else
/* Encode the result and return */
*rbufsize = 0;
}
return (rbuf);
}