1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

s3: smbd: Move reply_findclose() from trans2.c to smb1_reply.c

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Mulder <dmulder@suse.com>
This commit is contained in:
Jeremy Allison 2022-04-04 19:48:25 -07:00
parent 97136a7a8a
commit 481b7bfd29
4 changed files with 45 additions and 45 deletions

View File

@ -1108,7 +1108,6 @@ NTSTATUS smb_set_file_time(connection_struct *conn,
struct smb_filename *smb_fname,
struct smb_file_time *ft,
bool setting_write_time);
void reply_findclose(struct smb_request *req);
void reply_findnclose(struct smb_request *req);
enum perm_type {

View File

@ -6641,3 +6641,47 @@ void reply_getattrE(struct smb_request *req)
END_PROFILE(SMBgetattrE);
return;
}
/****************************************************************************
Reply to a SMBfindclose (stop trans2 directory search).
****************************************************************************/
void reply_findclose(struct smb_request *req)
{
int dptr_num;
struct smbd_server_connection *sconn = req->sconn;
files_struct *fsp = NULL;
START_PROFILE(SMBfindclose);
if (req->wct < 1) {
reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
END_PROFILE(SMBfindclose);
return;
}
dptr_num = SVALS(req->vwv+0, 0);
DEBUG(3,("reply_findclose, dptr_num = %d\n", dptr_num));
/*
* OS/2 seems to use -1 to indicate "close all directories"
* This has to mean on this specific connection struct.
*/
if (dptr_num == -1) {
dptr_closecnum(req->conn);
} else {
fsp = dptr_fetch_lanman2_fsp(sconn, dptr_num);
dptr_num = -1;
if (fsp != NULL) {
close_file_free(NULL, &fsp, NORMAL_CLOSE);
}
}
reply_outbuf(req, 0, 0);
DEBUG(3,("SMBfindclose dptr_num = %d\n", dptr_num));
END_PROFILE(SMBfindclose);
return;
}

View File

@ -76,3 +76,4 @@ void reply_setattrE(struct smb_request *req);
void reply_writebmpx(struct smb_request *req);
void reply_writebs(struct smb_request *req);
void reply_getattrE(struct smb_request *req);
void reply_findclose(struct smb_request *req);

View File

@ -6947,50 +6947,6 @@ NTSTATUS smbd_do_setfilepathinfo(connection_struct *conn,
return NT_STATUS_OK;
}
/****************************************************************************
Reply to a SMBfindclose (stop trans2 directory search).
****************************************************************************/
void reply_findclose(struct smb_request *req)
{
int dptr_num;
struct smbd_server_connection *sconn = req->sconn;
files_struct *fsp = NULL;
START_PROFILE(SMBfindclose);
if (req->wct < 1) {
reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
END_PROFILE(SMBfindclose);
return;
}
dptr_num = SVALS(req->vwv+0, 0);
DEBUG(3,("reply_findclose, dptr_num = %d\n", dptr_num));
/*
* OS/2 seems to use -1 to indicate "close all directories"
* This has to mean on this specific connection struct.
*/
if (dptr_num == -1) {
dptr_closecnum(req->conn);
} else {
fsp = dptr_fetch_lanman2_fsp(sconn, dptr_num);
dptr_num = -1;
if (fsp != NULL) {
close_file_free(NULL, &fsp, NORMAL_CLOSE);
}
}
reply_outbuf(req, 0, 0);
DEBUG(3,("SMBfindclose dptr_num = %d\n", dptr_num));
END_PROFILE(SMBfindclose);
return;
}
/****************************************************************************
Reply to a SMBfindnclose (stop FINDNOTIFYFIRST directory search).
****************************************************************************/