smb_nt_transact_create.c revision faa1795a28a5c712eed6d0a3f84d98c368a316c6
/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* 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,
&Flags,
&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 {
}
}
if (Flags) {
if (Flags & NT_CREATE_FLAG_REQUEST_OPLOCK) {
else
}
}
if (sd_len) {
if (status != NT_STATUS_SUCCESS) {
return (SDRC_ERROR);
}
} else {
}
struct open_param *, op);
}
void
{
}
{
return (SDRC_ERROR);
}
if (op->rootdirfid == 0) {
} else {
return (SDRC_ERROR);
}
}
if (status != NT_STATUS_SUCCESS)
return (SDRC_ERROR);
case MYF_EXCLUSIVE_OPLOCK :
OplockLevel = 1;
break;
case MYF_BATCH_OPLOCK :
OplockLevel = 2;
break;
case MYF_LEVEL_II_OPLOCK :
OplockLevel = 3;
break;
case MYF_OPLOCK_NONE :
default:
OplockLevel = 0;
break;
}
/*
* Set up the directory flag and ensure that
* we don't return a stale file size.
*/
DirFlag = 1;
} else {
DirFlag = 0;
}
0, /* EaErrorOffset */
DirFlag);
} else {
/* Named PIPE */
0,
0, /* EaErrorOffset */
0LL,
0LL,
0LL,
0LL,
0x1000LL,
0LL,
0);
}
return (SDRC_SUCCESS);
}