smb_share_doorclnt.c revision da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0
/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* User-space door client for LanMan share management.
*/
#include <syslog.h>
#include <door.h>
#include <fcntl.h>
#include <stdarg.h>
#include <errno.h>
#include <string.h>
#include <strings.h>
#include <smbsrv/lmshare_door.h>
int lmshrd_fildes = -1;
char *lmshrd_desc[] = {
"",
"LmshrdOpenIter",
"LmshrdCloseIter",
"LmshrdIterate",
"LmshrdNumShares",
"LmshrdDelete",
"LmshrdRename",
"LmshrdGetinfo",
"LmshrdAdd",
"LmshrdSetinfo",
"LmshrdExists",
"LmshrdIsSpecial",
"LmshrdIsRestricted",
"LmshrdIsAdmin",
"LmshrdIsValid",
"LmshrdIsDir",
"LmshrdList",
"LmshrdListTrans",
"LmshrdNumTrans",
"N/A",
0
};
/*
* Returns 0 on success. Otherwise, -1.
*/
static int
lmshrd_door_open(int opcode)
{
int rc = 0;
if (lmshrd_fildes == -1 &&
rc = -1;
}
return (rc);
}
/*
* Return 0 upon success. Otherwise, -1.
*/
static int
{
int err;
int rc = -1;
switch (status) {
case LMSHR_DOOR_SRV_SUCCESS:
rc = 0;
break;
case LMSHR_DOOR_SRV_ERROR:
break;
default:
}
if (rc != 0) {
}
return (rc);
}
lmshrd_open_iterator(int mode)
{
char *buf;
unsigned int used;
unsigned int status = 0;
uint64_t lmshr_iter = 0;
int opcode = LMSHR_DOOR_OPEN_ITERATOR;
return (lmshr_iter);
if (!buf)
return (lmshr_iter);
return (lmshr_iter);
}
lmshrd_fildes = -1;
return (lmshr_iter);
}
return (lmshr_iter);
}
return (lmshr_iter);
}
return (lmshr_iter);
}
{
char *buf;
unsigned int used;
unsigned int status = 0;
int opcode = LMSHR_DOOR_CLOSE_ITERATOR;
return (NERR_InternalError);
if (!buf)
return (NERR_InternalError);
return (NERR_InternalError);
}
lmshrd_fildes = -1;
return (NERR_InternalError);
}
return (NERR_InternalError);
}
return (NERR_InternalError);
}
return (NERR_Success);
}
{
char *buf;
unsigned int used;
unsigned int status = 0;
int opcode = LMSHR_DOOR_ITERATE;
return (NERR_InternalError);
if (!buf)
return (NERR_InternalError);
return (NERR_InternalError);
}
lmshrd_fildes = -1;
return (NERR_InternalError);
}
return (NERR_InternalError);
}
return (NERR_InternalError);
}
return (NERR_Success);
}
{
char *buf;
unsigned int used;
int status;
int opcode = LMSHR_DOOR_LIST;
return (NERR_InternalError);
if (!buf)
return (NERR_InternalError);
return (NERR_InternalError);
}
lmshrd_fildes = -1;
return (NERR_InternalError);
}
return (NERR_InternalError);
}
return (NERR_InternalError);
}
return (rc);
}
int
lmshrd_num_shares(void)
{
char *buf;
unsigned int used;
unsigned int status = 0;
int opcode = LMSHR_DOOR_NUM_SHARES;
return (-1);
if (!buf)
return (-1);
return (-1);
}
lmshrd_fildes = -1;
return (-1);
}
return (-1);
}
return (-1);
}
return (num_shares);
}
lmshrd_delete(char *share_name)
{
char *buf;
unsigned int used;
int status;
int opcode = LMSHR_DOOR_DELETE;
return (NERR_InternalError);
if (!buf)
return (NERR_InternalError);
return (NERR_InternalError);
}
lmshrd_fildes = -1;
return (NERR_InternalError);
}
return (NERR_InternalError);
}
return (NERR_InternalError);
}
return (rc);
}
{
char *buf;
unsigned int used;
int status;
int opcode = LMSHR_DOOR_RENAME;
return (NERR_InternalError);
if (!buf)
return (NERR_InternalError);
return (NERR_InternalError);
}
lmshrd_fildes = -1;
return (NERR_InternalError);
}
return (NERR_InternalError);
}
return (NERR_InternalError);
}
return (rc);
}
{
char *buf;
unsigned int used;
int status;
int opcode = LMSHR_DOOR_GETINFO;
return (NERR_InternalError);
if (!buf)
return (NERR_InternalError);
return (NERR_InternalError);
}
lmshrd_fildes = -1;
return (NERR_InternalError);
}
return (NERR_InternalError);
}
return (NERR_InternalError);
}
return (rc);
}
{
char *buf;
unsigned int used;
int status;
int opcode = LMSHR_DOOR_ADD;
return (NERR_InternalError);
if (!buf)
return (NERR_InternalError);
return (NERR_InternalError);
}
lmshrd_fildes = -1;
return (NERR_InternalError);
}
return (NERR_InternalError);
}
return (NERR_InternalError);
}
return (rc);
}
{
char *buf;
unsigned int used;
int status;
int opcode = LMSHR_DOOR_SETINFO;
return (NERR_InternalError);
if (!buf)
return (NERR_InternalError);
return (NERR_InternalError);
}
lmshrd_fildes = -1;
return (NERR_InternalError);
}
return (NERR_InternalError);
}
return (NERR_InternalError);
}
return (rc);
}
static int
{
char *buf;
unsigned int used;
return (NERR_InternalError);
if (!buf)
return (NERR_InternalError);
return (NERR_InternalError);
}
lmshrd_fildes = -1;
return (NERR_InternalError);
}
return (NERR_InternalError);
}
return (NERR_InternalError);
}
return (rc);
}
int
lmshrd_exists(char *share_name)
{
}
int
lmshrd_is_special(char *share_name)
{
}
int
lmshrd_is_restricted(char *share_name)
{
}
int
lmshrd_is_admin(char *share_name)
{
}
int
lmshrd_is_valid(char *share_name)
{
}
int
lmshrd_is_dir(char *path)
{
}
static char *
lmshare_decode_type(unsigned int stype)
{
switch (stype) {
case STYPE_DISKTREE:
return ("Disk");
case STYPE_PRINTQ:
return ("Print Queue");
case STYPE_DEVICE:
return ("Device");
case STYPE_IPC:
return ("IPC");
case STYPE_DFS:
return ("DFS");
case STYPE_SPECIAL:
return ("Special");
default:
return ("Unknown");
};
}
static void
{
if (!si) {
return;
}
}
int
lmshrd_dump_hash(char *logfname)
{
else {
if (fp == 0) {
" cannot create logfile", logfname);
" output will be written on screen");
}
}
}
return (1);
}
}
return (1);
}
while (*si.share_name != 0) {
}
return (1);
}
}
}
return (1);
}
}
return (0);
}