smb_set_information.c revision 2c2961f8403049d948b9f3e6c35d6488b6b7e1aa
/*
* 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.
*/
/*
* SMB: set_information
*
* This message is sent to change the information about a file.
*
* Client Request Description
* ================================== =================================
*
* UCHAR WordCount; Count of parameter words = 8
* USHORT FileAttributes; Attributes of the file
* UTIME LastWriteTime; Time of last write
* USHORT Reserved [5]; Reserved (must be 0)
* USHORT ByteCount; Count of data bytes; min = 2
* UCHAR BufferFormat; 0x04
* STRING FileName[]; File name
*
* FileName is the fully qualified name of the file relative to the Tid.
*
* Support of all parameters is optional. A server which does not
* implement one of the parameters will ignore that field. If the
* LastWriteTime field contain zero then the file's time is not changed.
*
* Server Response Description
* ================================== =================================
*
* UCHAR WordCount; Count of parameter words = 0
* USHORT ByteCount; Count of data bytes = 0
*
*/
#include <smbsrv/smb_incl.h>
#include <smbsrv/smb_fsops.h>
{
return (SDRC_SUCCESS);
}
void
{
}
{
int rc;
unsigned short dattr;
char *path;
char *name;
(void) smbsr_encode_empty_result(sr);
return (SDRC_SUCCESS);
}
return (SDRC_ERROR);
}
return (SDRC_ERROR);
}
if (rc != 0) {
return (SDRC_ERROR);
}
if (rc != 0) {
return (SDRC_ERROR);
}
/*
* It is not valid to set FILE_ATTRIBUTE_DIRECTORY if the
* target is not a directory.
*/
if ((dattr & FILE_ATTRIBUTE_DIRECTORY) &&
return (SDRC_ERROR);
}
/*
* for the benefit of attribute setting later on
*/
B_FALSE);
}
/*
* For compatibility with Windows Servers, if the specified
* attributes have ONLY FILE_ATTRIBUTE_NORMAL set do NOT change
* the file's attributes.
* Note - this is different from TRANS2_SET_PATH/FILE_INFORMATION
*/
if (dattr != FILE_ATTRIBUTE_NORMAL)
/*
* The behaviour when the time field is set to -1
* is not documented but is generally treated like 0,
* meaning that that server file system assigned value
* need not be changed.
*/
}
if (rc) {
return (SDRC_ERROR);
}
}