smb_rename.c revision a90cf9f29973990687fa61de9f1f6ea22e924e40
/*
* 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.
*/
#include <smbsrv/smb_kproto.h>
#include <smbsrv/smb_fsops.h>
/*
* NT_RENAME InformationLevels:
*
* SMB_NT_RENAME_MOVE_CLUSTER_INFO Server returns invalid parameter.
* SMB_NT_RENAME_SET_LINK_INFO Create a hard link to a file.
* SMB_NT_RENAME_RENAME_FILE In-place rename of a file.
* SMB_NT_RENAME_MOVE_FILE Move (rename) a file.
*/
#define SMB_NT_RENAME_MOVE_CLUSTER_INFO 0x0102
#define SMB_NT_RENAME_SET_LINK_INFO 0x0103
#define SMB_NT_RENAME_RENAME_FILE 0x0104
#define SMB_NT_RENAME_MOVE_FILE 0x0105
/*
* smb_com_rename
*
* Rename a file. Files OldFileName must exist and NewFileName must not.
* Both pathnames must be relative to the Tid specified in the request.
* Open files may be renamed.
*
* Multiple files may be renamed in response to a single request as Rename
* File supports wildcards in the file name (last component of the path).
* NOTE: we don't support rename with wildcards.
*
* SearchAttributes indicates the attributes that the target file(s) must
* have. If SearchAttributes is zero then only normal files are renamed.
* If the system file or hidden attributes are specified then the rename
* is inclusive - both the specified type(s) of files and normal files are
* renamed.
*/
{
int rc;
}
}
void
{
}
{
return (SDRC_ERROR);
}
return (SDRC_ERROR);
}
if (status != 0) {
return (SDRC_ERROR);
}
(void) smbsr_encode_empty_result(sr);
return (SDRC_SUCCESS);
}
/*
* smb_com_nt_rename
*
* Rename a file. Files OldFileName must exist and NewFileName must not.
* Both pathnames must be relative to the Tid specified in the request.
* Open files may be renamed.
*
* SearchAttributes indicates the attributes that the target file(s) must
* have. If SearchAttributes is zero then only normal files are renamed.
* If the system file or hidden attributes are specified then the rename
* is inclusive - both the specified type(s) of files and normal files are
* renamed.
*/
{
int rc;
if (rc == 0) {
}
}
void
{
}
{
return (SDRC_ERROR);
}
return (SDRC_ERROR);
}
return (SDRC_ERROR);
}
break;
case SMB_NT_RENAME_MOVE_FILE:
break;
break;
default:
break;
}
if (status != 0) {
return (SDRC_ERROR);
}
(void) smbsr_encode_empty_result(sr);
return (SDRC_SUCCESS);
}
/*
* smb_nt_transact_rename
*
* Windows servers return SUCCESS without renaming file.
* The only check required is to check that the handle (fid) is valid.
*/
{
return (SDRC_ERROR);
return (SDRC_ERROR);
}
return (SDRC_SUCCESS);
}