/*
* This file and its contents are supplied under the terms of the
* Common Development and Distribution License ("CDDL"), version 1.0.
* You may only use this file in accordance with the terms of version
* 1.0 of the CDDL.
*
* A full copy of the text of the CDDL should have accompanied this
* source. A copy of the CDDL is also available via the Internet at
*/
/*
* Copyright 2014 Nexenta Systems, Inc. All rights reserved.
*/
/*
* Dispatch function for SMB2_QUERY_INFO
*
* [MS-FSCC 2.4] If a file system does not support ...
* an Information Classs, NT_STATUS_INVALID_PARAMETER...
*/
#include <smbsrv/smb2_kproto.h>
#include <smbsrv/smb_fsops.h>
{
/*
* Which attributes do we need from the FS?
*/
switch (qi->qi_InfoClass) {
case FileBasicInformation:
mask = SMB_AT_BASIC;
break;
case FileStandardInformation:
break;
case FileInternalInformation:
break;
case FileAllInformation:
mask = SMB_AT_ALL;
break;
case FileNameInformation:
break;
break;
case FileStreamInformation:
break;
break;
default:
break;
}
if (mask & SMB_AT_ALL) {
if (status)
return (status);
}
if (getstd) {
if (status)
return (status);
}
if (getname) {
if (status)
return (status);
}
switch (qi->qi_InfoClass) {
case FileBasicInformation:
break;
case FileStandardInformation:
break;
case FileInternalInformation:
break;
case FileEaInformation:
break;
case FileAccessInformation:
break;
case FileNameInformation:
break;
case FilePositionInformation:
break;
case FileFullEaInformation:
break;
case FileModeInformation:
break;
case FileAlignmentInformation:
break;
case FileAllInformation:
break;
break;
case FileStreamInformation:
break;
case FilePipeInformation:
break;
case FilePipeLocalInformation:
break;
break;
break;
break;
break;
default:
break;
}
return (status);
}
/*
* FileAllInformation
*
* This returns a concatenation of:
* FileBasicInformation
* FileStandardInformation
* FileInternalInformation
* FileEaInformation
* FilePositionInformation
* FileModeInformation
* FileAlignmentInformation
* FileNameInformation
*/
static uint32_t
{
if (status)
return (status);
if (status)
return (status);
if (status)
return (status);
if (status)
return (status);
if (status)
return (status);
if (status)
return (status);
if (status)
return (status);
if (status)
return (status);
return (0);
}
/*
* FileBasicInformation
* See also:
* case SMB_QUERY_FILE_BASIC_INFO:
* case SMB_FILE_BASIC_INFORMATION:
*/
static uint32_t
{
(void) smb_mbc_encodef(
0); /* reserved */ /* l */
return (0);
}
/*
* FileStandardInformation
* See also:
* SMB_QUERY_FILE_STANDARD_INFO
* SMB_FILE_STANDARD_INFORMATION
*/
static uint32_t
{
(void) smb_mbc_encodef(
0); /* reserved */ /* w */
return (0);
}
/*
* FileInternalInformation
* See also:
* SMB_FILE_INTERNAL_INFORMATION
*/
static uint32_t
{
(void) smb_mbc_encodef(
return (0);
}
/*
* FileEaInformation
* See also:
* SMB_QUERY_FILE_EA_INFO
* SMB_FILE_EA_INFORMATION
*/
static uint32_t
{
(void) smb_mbc_encodef(
return (0);
}
/*
* FileFullEaInformation
* We could put EAs in a named stream...
*/
/* ARGSUSED */
static uint32_t
{
return (NT_STATUS_NO_EAS_ON_FILE);
}
/*
* FileAccessInformation
*/
static uint32_t
{
(void) smb_mbc_encodef(
return (0);
}
/*
* FileNameInformation
* See also:
* SMB_QUERY_FILE_NAME_INFO
* SMB_FILE_NAME_INFORMATION
*/
static uint32_t
{
(void) smb_mbc_encodef(
0, /* FileIndex (l) */
return (0);
}
/*
* FilePositionInformation
*/
static uint32_t
{
(void) smb_mbc_encodef(
return (0);
}
/*
* FileModeInformation [MS-FSA 2.4.24]
* XXX: These mode flags are supposed to be on the open handle,
* XXX: or I think so. Not yet... (just put zero for now)
*/
static uint32_t
{
(void) smb_mbc_encodef(
return (0);
}
/*
* FileAlignmentInformation
*/
static uint32_t
{
(void) smb_mbc_encodef(
return (0);
}
/*
* FileAlternateNameInformation
* See also:
* SMB_QUERY_FILE_ALT_NAME_INFO
* SMB_FILE_ALT_NAME_INFORMATION
*/
static uint32_t
{
return (NT_STATUS_OBJECT_NAME_NOT_FOUND);
return (NT_STATUS_OBJECT_NAME_NOT_FOUND);
/* fill in qi->qi_shortname */
(void) smb_mbc_encodef(
qi->qi_shortname);
return (0);
}
/*
* FileStreamInformation
*/
static uint32_t
{
(void) smb_mbc_encodef(
return (0);
}
return (status);
}
/*
* FilePipeInformation
*/
static uint32_t
{
case SMB_FTYPE_BYTE_PIPE:
pipe_mode = 0; /* FILE_PIPE_BYTE_STREAM_MODE */
break;
case SMB_FTYPE_MESG_PIPE:
break;
case SMB_FTYPE_DISK:
case SMB_FTYPE_PRINTER:
default:
return (NT_STATUS_INVALID_PARAMETER);
}
nonblock = 0; /* XXX todo: Get this from the pipe handle. */
(void) smb_mbc_encodef(
return (0);
}
/*
* FilePipeLocalInformation
*/
/* ARGSUSED */
static uint32_t
{
return (NT_STATUS_INVALID_PARAMETER); /* XXX todo */
}
/*
* FilePipeRemoteInformation
*/
/* ARGSUSED */
static uint32_t
{
return (NT_STATUS_INVALID_PARAMETER); /* XXX todo */
}
/*
* FileCompressionInformation
* XXX: For now, just say "not compressed".
*/
static uint32_t
{
(void) smb_mbc_encodef(
CompressionFormat); /* w */
return (0);
}
/*
* FileNetworkOpenInformation
*/
static uint32_t
{
(void) smb_mbc_encodef(
0); /* reserved */ /* l */
return (0);
}
/*
* FileAttributeTagInformation
*
* If dattr includes FILE_ATTRIBUTE_REPARSE_POINT, the
* second dword should be the reparse tag. Otherwise
* the tag value should be set to zero.
* We don't support reparse points, so we set the tag
* to zero.
*/
static uint32_t
{
(void) smb_mbc_encodef(
return (0);
}