smb_api_door_calls.c revision 7f667e74610492ddbce8ce60f52ece95d2401949
/*
* 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.
*/
/*
* Door calls invoked by CLIs to obtain various SMB door service provided
* by SMB daemon.
*/
#include <fcntl.h>
#include <syslog.h>
#include <string.h>
#include <strings.h>
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
#include <smbsrv/wintypes.h>
#include <smbsrv/smb_door_svc.h>
#include <smbsrv/smb_common_door.h>
/*
* This function will return information on the connected users
* starting at the given offset.
*
* At most 50 users (i.e. SMB_DR_MAX_USER) will be returned via this
* function. Multiple calls might be needed to obtain all connected
* users.
*
* smb_dr_ulist_free must be called to free memory allocated for the
* account and workstation fields of each user in the returned list.
*/
int
{
char *buf;
int rc = -1;
int fd;
return (-1);
return (-1);
}
}
return (rc);
}
/*
* smb_lookup_sid
*
* Tries to get the account name associated with the given SID
* The mapping is requested to be performed by smbd via a door
* call. If no account name can be found the string format of
* the SID will be returned as the name.
*
* The passed namebuf should be big enough to hold the string
* format of a SID.
*/
int
{
char *buf;
int opcode = SMB_DR_LOOKUP_SID;
int fd;
if (!smb_sid_isvalid(sid))
return (NT_STATUS_INVALID_SID);
/* returning string SID */
return (NT_STATUS_SUCCESS);
}
/* returning string SID */
return (NT_STATUS_SUCCESS);
}
}
if (name) {
if (*name != '\0')
}
return (NT_STATUS_SUCCESS);
}
/*
* smb_lookup_name
*
* Tries to get the SID associated with the given account name
* The mapping is requested to be performed by smbd via a door
* call. If no SID can be found NT_STATUS_NONE_MAPPED is returned.
*/
int
{
char *buf;
int opcode = SMB_DR_LOOKUP_NAME;
char *p;
int fd;
if (*name == '\0')
return (NT_STATUS_NONE_MAPPED);
return (NT_STATUS_INTERNAL_ERROR);
return (NT_STATUS_INTERNAL_ERROR);
}
}
return (NT_STATUS_INTERNAL_ERROR);
if (p == NULL) {
return (NT_STATUS_NONE_MAPPED);
}
*p++ = '\0';
return (NT_STATUS_SUCCESS);
}
{
char *buf;
int opcode = SMB_DR_JOIN;
return (NT_STATUS_INVALID_PARAMETER);
return (NT_STATUS_INTERNAL_ERROR);
return (NT_STATUS_INTERNAL_ERROR);
}
if (rc != 0)
} else {
}
return (status);
}
/*
* Gets information about the Domain Controller in the joined resource domain.
*
* Returns: NT_STATUS_SUCCESS if the successful in getting
* domain information.
*/
{
char *buf;
int opcode = SMB_DR_GET_DCINFO;
int fd;
struct hostent *h;
int error_num;
*namebuf = '\0';
return (NT_STATUS_INTERNAL_ERROR);
return (NT_STATUS_INTERNAL_ERROR);
}
}
if (srvname) {
} else {
freehostent(h);
}
}
return (NT_STATUS_SUCCESS);
}
{
return (FALSE);
return (FALSE);
return (FALSE);
return (FALSE);
return (TRUE);
}