/*
* 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>
/*
* smb_nt_transact_query_quota
*
* This method allows the client to retrieve quota information from
* the server. The result of the call is returned to the client in the
* Data part of the transaction response.
*
* On entry, the 'TotalParameterCount' field must be equal to 16, and the
* client parameter block must be encoded with the following parameters:
*
* Request Description
* ========================== ==================================
* WORD fid SMB file identifier of the target directory
* BYTE ReturnSingleEntry A boolean indicating whether to return
* a single entry (TRUE) or multiple entries (FALSE).
* BYTE RestartScan A boolean indicating whether to continue from
* the previous request (FALSE) or restart a new
* sequence (TRUE).
* DWORD SidListLength The length, in bytes, of the SidList in the
* data block or 0 if there is no SidList.
* DWORD StartSidLength If SidListLength is 0 (i.e. there is no SidList
* in the data block), then this is either:
* 1) the (non-zero) length in bytes of the
* StartSid in the parameter buffer, or
* 2) if 0, there is no StartSid in the
* parameter buffer, in which case, all SIDs
* are to be enumerated as if they were
* passed in the SidList.
* Otherwise, StartSidLength is ignored.
* DWORD StartSidOffset The offset, in bytes, to the StartSid in the
* parameter block (if one exists).
*
* One of SidListLength and StartSidLength must be 0.
*
* An SMB_COM_NT_TRANSACTION response is sent in reply when the request
* is successful. The 'TotalParameterCount' is set to 4, and the parameter
* block in the server response contains a 32-bit unsigned integer
* indicating the length, in bytes, of the returned quota information.
* The 'TotalDataCount' is set to indicate the length of the data buffer,
* and the data buffer contains the following quota information:
*
* Data Block Encoding Description
* ================================== =================================
* ULONG NextEntryOffset; Offset to start of next entry from
* start of this entry, or 0 for the
* final entry
* ULONG SidLength; Length (bytes) of SID
* SMB_TIME ChangeTime; Time that the quota was last changed
* LARGE_INTEGER QuotaUsed; Amount of quota (bytes) used by user
* LARGE_INTEGER QuotaThreshold; Quota warning limit (bytes) for user
* LARGE_INTEGER QuotaLimit; The quota limit (bytes) for this user
* USHORT Sid; Search handle
*/
{
return (SDRC_ERROR);
}
return (SDRC_ERROR);
}
return (SDRC_ERROR);
}
if ((sidlistlen != 0) && (startsidlen != 0)) {
return (SDRC_ERROR);
}
return (SDRC_ERROR);
}
return (SDRC_ERROR);
}
return (SDRC_ERROR);
}
if (sidlistlen != 0)
else if (startsidlen != 0)
else
if (status == NT_STATUS_SUCCESS) {
} else {
if (status == NT_STATUS_SUCCESS) {
&xa->rep_data_mb,
}
}
}
if (status != NT_STATUS_SUCCESS) {
if (status == NT_STATUS_NO_MORE_ENTRIES) {
} else {
}
}
}
/*
* smb_nt_transact_set_quota
*
* This method allows the client to set quota information on the server.
* The result status of the call is returned to the client in the
* 'status' field of the SMB response header.
*
* On entry, the 'TotalParameterCount' field must be equal to 2, and the
* client parameter block must be encoded with the following parameters:
*
* Data Block Encoding Description
* ================================== =================================
* ULONG NextEntryOffset; Offset to start of next entry from
* start of this entry, or 0 for the
* final entry
* ULONG SidLength; Length (bytes) of SID
* SMB_TIME ChangeTime; Time that the quota was last changed
* LARGE_INTEGER QuotaUsed; Amount of quota (bytes) used by user
* LARGE_INTEGER QuotaThreshold; Quota warning limit (bytes) for user
* LARGE_INTEGER QuotaLimit; The quota limit (bytes) for this user
* VARIABLE Sid; Security identifier of the user
*
* An SMB_COM_NT_TRANSACTION response is sent in reply when the request
* is successful. The 'TotalParameterCount' and the 'TotalDataCount' are set
* to 0, and the parameter block 'Status' field in the server SMB response
* header contains a 32-bit unsigned integer indicating the result status
* (NT_STATUS_SUCCESS if successful).
*
* Only users with Admin privileges (i.e. of the BUILTIN/Administrators
* group) will be allowed to set quotas.
*/
{
char *root_path;
return (SDRC_ERROR);
}
return (-1);
}
return (SDRC_ERROR);
}
return (SDRC_ERROR);
}
return (SDRC_ERROR);
}
return (SDRC_ERROR);
}
return (SDRC_ERROR);
}
if (status == NT_STATUS_SUCCESS) {
} else {
}
}
if (status != NT_STATUS_SUCCESS) {
return (SDRC_ERROR);
}
return (SDRC_SUCCESS);
}