diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index 3f3f0e54e71..f6d10badb29 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -912,8 +912,6 @@ bool disk_quotas(connection_struct *conn, struct smb_filename *fname, /* The following definitions come from smbd/reply.c */ -bool check_fsp_ntquota_handle(connection_struct *conn, struct smb_request *req, - files_struct *fsp); void reply_special(struct smbXsrv_connection *xconn, char *inbuf, size_t inbuf_size); void reply_tcon(struct smb_request *req); void reply_tcon_and_X(struct smb_request *req); @@ -1036,6 +1034,8 @@ bool check_fsp_open(connection_struct *conn, struct smb_request *req, files_struct *fsp); bool check_fsp(connection_struct *conn, struct smb_request *req, files_struct *fsp); +bool check_fsp_ntquota_handle(connection_struct *conn, struct smb_request *req, + files_struct *fsp); /* The following definitions come from smbd/seal.c */ diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 5147c602b95..b304202c36e 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -53,37 +53,6 @@ #include "source3/printing/rap_jobid.h" #include "source3/lib/substitute.h" -/**************************************************************************** - Check if we have a correct fsp pointing to a quota fake file. Replacement for - the CHECK_NTQUOTA_HANDLE_OK macro. -****************************************************************************/ - -bool check_fsp_ntquota_handle(connection_struct *conn, struct smb_request *req, - files_struct *fsp) -{ - if (!check_fsp_open(conn, req, fsp)) { - return false; - } - - if (fsp->fsp_flags.is_directory) { - return false; - } - - if (fsp->fake_file_handle == NULL) { - return false; - } - - if (fsp->fake_file_handle->type != FAKE_FILE_TYPE_QUOTA) { - return false; - } - - if (fsp->fake_file_handle->private_data == NULL) { - return false; - } - - return true; -} - /**************************************************************************** Return the port number we've bound to on a socket. ****************************************************************************/ diff --git a/source3/smbd/smb2_reply.c b/source3/smbd/smb2_reply.c index f42aa0e48c0..8cfbde2dd45 100644 --- a/source3/smbd/smb2_reply.c +++ b/source3/smbd/smb2_reply.c @@ -430,3 +430,34 @@ bool check_fsp(connection_struct *conn, struct smb_request *req, fsp->num_smb_operations++; return True; } + +/**************************************************************************** + Check if we have a correct fsp pointing to a quota fake file. Replacement for + the CHECK_NTQUOTA_HANDLE_OK macro. +****************************************************************************/ + +bool check_fsp_ntquota_handle(connection_struct *conn, struct smb_request *req, + files_struct *fsp) +{ + if (!check_fsp_open(conn, req, fsp)) { + return false; + } + + if (fsp->fsp_flags.is_directory) { + return false; + } + + if (fsp->fake_file_handle == NULL) { + return false; + } + + if (fsp->fake_file_handle->type != FAKE_FILE_TYPE_QUOTA) { + return false; + } + + if (fsp->fake_file_handle->private_data == NULL) { + return false; + } + + return true; +}