/*
* 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 2013 Nexenta Systems, Inc. All rights reserved.
*/
/*
* 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>
/*
* 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) {
}
}
{
int rc;
return (SDRC_ERROR);
}
return (SDRC_ERROR);
}
if (op->rootdirfid == 0) {
} else {
return (SDRC_ERROR);
}
}
if (status != NT_STATUS_SUCCESS) {
return (SDRC_ERROR);
}
/*
* NB: after the above smb_common_open() success,
* we have a handle allocated (sr->fid_ofile).
* If we don't return success, we must close it.
*/
case STYPE_DISKTREE:
case STYPE_PRINTQ:
if (rc != 0) {
goto errout;
}
0, /* EaErrorOffset */
DirFlag);
break;
case STYPE_IPC:
0,
0, /* EaErrorOffset */
0x1000LL,
0LL,
0);
break;
default:
goto errout;
}
return (SDRC_SUCCESS);
smb_ofile_close(of, 0);
return (SDRC_ERROR);
}