smb_nt_transact_create.c revision 037cac007b685e7ea79f6ef7e8e62bfd342a4d56
/*
* 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.
*/
/*
* This command is used to create or open a file or directory, when EAs
* or an SD must be applied to the file. The functionality is similar
* to SmbNtCreateAndx with the option to supply extended attributes or
* a security descriptor.
*
* Note: we don't decode the extended attributes because we don't
* support them at this time.
*/
#include <smbsrv/smb_kproto.h>
#include <smbsrv/smb_fsops.h>
#include <smbsrv/ntstatus.h>
#include <smbsrv/ntaccess.h>
#include <smbsrv/doserror.h>
/*
* smb_nt_transact_create
*
* This command is used to create or open a file or directory, when EAs
* or an SD must be applied to the file. The request parameter block
* encoding, data block encoding and output parameter block encoding are
* described in CIFS section 4.2.2.
*
* The format of the command is SmbNtTransact but it is basically the same
* as SmbNtCreateAndx with the option to supply extended attributes or a
* security descriptor. For information not defined in CIFS section 4.2.2
* see section 4.2.1 (NT_CREATE_ANDX).
*/
{
int rc;
sr,
&op->rootdirfid,
&op->desired_access,
&op->share_access,
&op->create_options,
&sd_len,
&EaLength,
if (rc == 0) {
if (NameLength == 0) {
} else if (NameLength >= MAXPATHLEN) {
rc = -1;
} else {
}
}
else
}
if (sd_len) {
if (status != NT_STATUS_SUCCESS) {
return (SDRC_ERROR);
}
} else {
}
struct open_param *, op);
}
void
{
if (sd) {
}
}
{
return (SDRC_ERROR);
}
return (SDRC_ERROR);
}
if (op->rootdirfid == 0) {
} else {
return (SDRC_ERROR);
}
}
if (status != NT_STATUS_SUCCESS)
return (SDRC_ERROR);
switch (op->op_oplock_level) {
case SMB_OPLOCK_EXCLUSIVE:
OplockLevel = 1;
break;
case SMB_OPLOCK_BATCH:
OplockLevel = 2;
break;
case SMB_OPLOCK_LEVEL_II:
OplockLevel = 3;
break;
case SMB_OPLOCK_NONE:
default:
OplockLevel = 0;
break;
}
return (SDRC_ERROR);
}
0, /* EaErrorOffset */
DirFlag);
} else {
/* Named PIPE */
0,
0, /* EaErrorOffset */
0x1000LL,
0LL,
0);
}
return (SDRC_SUCCESS);
}