/*
* 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
*/
/*
*/
/*
* SRVSVC service.
*/
#include <strings.h>
#include <libzfs.h>
#include <smbsrv/libmlsvc.h>
/* Size of offset members in mslm_security_descriptor structure */
/*
* This method computes ACL on share path from a share name.
* Return 0 upon success, -1 upon failure.
*/
static int
{
int ret = 0;
if (ret != 0)
return (ret);
return (-1);
return (-1);
}
return (-1);
}
return (ret);
}
/*
* This method sets Security Descriptor on a share path.
*
* Returns:
* ERROR_SUCCESS
* ERROR_NOT_ENOUGH_MEMORY
* ERROR_INVALID_ACL
* ERROR_INVALID_SID
* ERROR_INVALID_SECURITY_DESCR
* ERROR_NONE_MAPPED
* ERROR_INTERNAL_ERROR
* ERROR_PATH_NOT_FOUND
*/
{
int ret = 0;
if (ret != 0)
return (ERROR_PATH_NOT_FOUND);
smb_sd_init(&sd, 0);
if (status != ERROR_SUCCESS) {
smb_sd_term(&sd);
return (status);
}
smb_sd_term(&sd);
return (status);
}
/*
* This method returns a Security Descriptor of a share path in self relative
* format. Call to this function with NULL buffer, returns the size of the
* security descriptor, which can be used to allocate buffer.
*
* Returns:
* ERROR_SUCCESS
* ERROR_NOT_ENOUGH_MEMORY
* ERROR_INVALID_ACL
* ERROR_INVALID_SID
* ERROR_INVALID_SECURITY_DESCR
* ERROR_INVALID_PARAMETER
* ERROR_NONE_MAPPED
* ERROR_INTERNAL_ERROR
* ERROR_PATH_NOT_FOUND
*/
{
int ret = 0;
return (ERROR_INVALID_PARAMETER);
} else {
if (ret != 0)
return (ERROR_PATH_NOT_FOUND);
}
if (status != ERROR_SUCCESS) {
smb_sd_term(&sd);
return (status);
}
smb_sd_term(&sd);
return (status);
}
smb_sd_term(&sd);
return (status);
}
static uint32_t
{
return (ERROR_NOT_ENOUGH_MEMORY);
return (status);
}
/*
* This method converts an ACE from absolute (pointer) to
* self relative (flat buffer) format.
*
* Returns Win32 error codes.
*/
static uint32_t
{
return (ERROR_INVALID_PARAMETER);
return (ERROR_INVALID_PARAMETER);
return (ERROR_SUCCESS);
}
/*
* This method converts an ACL from absolute (pointer) to
* self relative (flat buffer) format.
*
* Returns an initialized mslm_acl structure on success.
* Returns NULL on failure.
*/
static struct mslm_acl *
{
return (NULL);
/*LINTED E_BAD_PTR_CAST_ALIGN*/
return (m_acl);
}
/*
* This method converts Security Descriptor from absolute (pointer) to
* self relative (flat buffer) format.
*
* Returns Win32 error codes.
*/
{
/*LINTED E_BAD_PTR_CAST_ALIGN*/
return (ERROR_INVALID_SECURITY_DESCR);
return (ERROR_NOT_ENOUGH_MEMORY);
}
return (ERROR_NOT_ENOUGH_MEMORY);
}
return (ERROR_INVALID_PARAMETER);
/*LINTED E_BAD_PTR_CAST_ALIGN*/
/*LINTED E_BAD_PTR_CAST_ALIGN*/
if (status != ERROR_SUCCESS)
return (status);
}
}
return (ERROR_INVALID_PARAMETER);
/*LINTED E_BAD_PTR_CAST_ALIGN*/
/*LINTED E_BAD_PTR_CAST_ALIGN*/
if (status != ERROR_SUCCESS)
return (status);
}
}
return (status);
}
/*
* This method converts an ACE from self relative (flat buffer) to
* absolute (pointer) format.
*
* Returns Win32 error codes.
*/
static uint32_t
{
int sid_size = 0;
return (ERROR_INVALID_PARAMETER);
return (ERROR_NOT_ENOUGH_MEMORY);
return (ERROR_SUCCESS);
}
/*
* This method converts an ACL from self relative (flat buffer) to
* absolute (pointer) format.
*
* Returns an initialized smb_acl_t structure on success.
* Returns NULL on failure.
*/
static smb_acl_t *
{
*offset += 2;
return (acl);
}
/*
* This method converts Security Descriptor from self relative (flat buffer) to
* absolute (pointer) format.
*
* Returns Win32 error codes.
*/
static uint32_t
{
return (ERROR_INVALID_SECURITY_DESCR);
/*LINTED E_BAD_PTR_CAST_ALIGN*/
if (msd->offset_owner != 0) {
/*LINTED E_BAD_PTR_CAST_ALIGN*/
return (ERROR_NOT_ENOUGH_MEMORY);
}
if (msd->offset_group != 0) {
/*LINTED E_BAD_PTR_CAST_ALIGN*/
return (ERROR_NOT_ENOUGH_MEMORY);
}
if (msd->offset_sacl != 0) {
return (ERROR_NOT_ENOUGH_MEMORY);
/*LINTED E_BAD_PTR_CAST_ALIGN*/
/*LINTED E_BAD_PTR_CAST_ALIGN*/
if (status != ERROR_SUCCESS)
return (status);
}
}
if (msd->offset_dacl != 0) {
return (ERROR_NOT_ENOUGH_MEMORY);
/*LINTED E_BAD_PTR_CAST_ALIGN*/
/*LINTED E_BAD_PTR_CAST_ALIGN*/
if (status != ERROR_SUCCESS)
return (status);
}
}
return (status);
}
/*
* This method maps NT status codes into Win 32 error codes.
* This method operates on status codes that are related
* to processing of Security Descriptor.
*/
static uint32_t
{
int i;
static struct {
} errmap[] = {
};
}
return (ERROR_INTERNAL_ERROR);
}