mirror of
https://github.com/samba-team/samba.git
synced 2025-02-28 01:58:17 +03:00
Remove the "current_user" arg from check_fsp
check_fsp only used the vuid struct member anyway, and this is available in the smb_request structure as well. (This used to be commit 8d364c4c3311b406847158fc37e9208d298cf8ba)
This commit is contained in:
parent
769646efc6
commit
49ca8efa91
@ -10089,9 +10089,9 @@ size_t srvstr_get_path(TALLOC_CTX *ctx,
|
||||
int flags,
|
||||
NTSTATUS *err);
|
||||
bool check_fsp_open(connection_struct *conn, struct smb_request *req,
|
||||
files_struct *fsp, struct current_user *user);
|
||||
files_struct *fsp);
|
||||
bool check_fsp(connection_struct *conn, struct smb_request *req,
|
||||
files_struct *fsp, struct current_user *user);
|
||||
files_struct *fsp);
|
||||
bool fsp_belongs_conn(connection_struct *conn, struct smb_request *req,
|
||||
files_struct *fsp, struct current_user *user);
|
||||
void reply_special(char *inbuf);
|
||||
|
@ -1520,7 +1520,7 @@ static void call_nt_transact_rename(connection_struct *conn,
|
||||
}
|
||||
|
||||
fsp = file_fsp(SVAL(params, 0));
|
||||
if (!check_fsp(conn, req, fsp, ¤t_user)) {
|
||||
if (!check_fsp(conn, req, fsp)) {
|
||||
return;
|
||||
}
|
||||
srvstr_get_path_wcard(ctx, params, req->flags2, &new_name, params+4,
|
||||
|
@ -327,13 +327,13 @@ size_t srvstr_get_path(TALLOC_CTX *ctx,
|
||||
****************************************************************************/
|
||||
|
||||
bool check_fsp_open(connection_struct *conn, struct smb_request *req,
|
||||
files_struct *fsp, struct current_user *user)
|
||||
files_struct *fsp)
|
||||
{
|
||||
if (!(fsp) || !(conn)) {
|
||||
reply_nterror(req, NT_STATUS_INVALID_HANDLE);
|
||||
return False;
|
||||
}
|
||||
if (((conn) != (fsp)->conn) || user->vuid != (fsp)->vuid) {
|
||||
if (((conn) != (fsp)->conn) || req->vuid != (fsp)->vuid) {
|
||||
reply_nterror(req, NT_STATUS_INVALID_HANDLE);
|
||||
return False;
|
||||
}
|
||||
@ -346,9 +346,9 @@ bool check_fsp_open(connection_struct *conn, struct smb_request *req,
|
||||
****************************************************************************/
|
||||
|
||||
bool check_fsp(connection_struct *conn, struct smb_request *req,
|
||||
files_struct *fsp, struct current_user *user)
|
||||
files_struct *fsp)
|
||||
{
|
||||
if (!check_fsp_open(conn, req, fsp, user)) {
|
||||
if (!check_fsp_open(conn, req, fsp)) {
|
||||
return False;
|
||||
}
|
||||
if ((fsp)->is_directory) {
|
||||
@ -2924,7 +2924,7 @@ void reply_lockread(struct smb_request *req)
|
||||
|
||||
fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
|
||||
|
||||
if (!check_fsp(conn, req, fsp, ¤t_user)) {
|
||||
if (!check_fsp(conn, req, fsp)) {
|
||||
END_PROFILE(SMBlockread);
|
||||
return;
|
||||
}
|
||||
@ -3032,7 +3032,7 @@ void reply_read(struct smb_request *req)
|
||||
|
||||
fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
|
||||
|
||||
if (!check_fsp(conn, req, fsp, ¤t_user)) {
|
||||
if (!check_fsp(conn, req, fsp)) {
|
||||
END_PROFILE(SMBread);
|
||||
return;
|
||||
}
|
||||
@ -3287,7 +3287,7 @@ void reply_read_and_X(struct smb_request *req)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!check_fsp(conn, req, fsp, ¤t_user)) {
|
||||
if (!check_fsp(conn, req, fsp)) {
|
||||
END_PROFILE(SMBreadX);
|
||||
return;
|
||||
}
|
||||
@ -3425,7 +3425,7 @@ void reply_writebraw(struct smb_request *req)
|
||||
}
|
||||
|
||||
fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
|
||||
if (!check_fsp(conn, req, fsp, ¤t_user)) {
|
||||
if (!check_fsp(conn, req, fsp)) {
|
||||
error_to_writebrawerr(req);
|
||||
END_PROFILE(SMBwritebraw);
|
||||
return;
|
||||
@ -3631,7 +3631,7 @@ void reply_writeunlock(struct smb_request *req)
|
||||
|
||||
fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
|
||||
|
||||
if (!check_fsp(conn, req, fsp, ¤t_user)) {
|
||||
if (!check_fsp(conn, req, fsp)) {
|
||||
END_PROFILE(SMBwriteunlock);
|
||||
return;
|
||||
}
|
||||
@ -3738,7 +3738,7 @@ void reply_write(struct smb_request *req)
|
||||
|
||||
fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
|
||||
|
||||
if (!check_fsp(conn, req, fsp, ¤t_user)) {
|
||||
if (!check_fsp(conn, req, fsp)) {
|
||||
END_PROFILE(SMBwrite);
|
||||
return;
|
||||
}
|
||||
@ -3968,7 +3968,7 @@ void reply_write_and_X(struct smb_request *req)
|
||||
startpos = IVAL_TO_SMB_OFF_T(req->inbuf,smb_vwv3);
|
||||
write_through = BITSETW(req->inbuf+smb_vwv7,0);
|
||||
|
||||
if (!check_fsp(conn, req, fsp, ¤t_user)) {
|
||||
if (!check_fsp(conn, req, fsp)) {
|
||||
END_PROFILE(SMBwriteX);
|
||||
return;
|
||||
}
|
||||
@ -4087,7 +4087,7 @@ void reply_lseek(struct smb_request *req)
|
||||
|
||||
fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
|
||||
|
||||
if (!check_fsp(conn, req, fsp, ¤t_user)) {
|
||||
if (!check_fsp(conn, req, fsp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -4173,7 +4173,7 @@ void reply_flush(struct smb_request *req)
|
||||
fnum = SVAL(req->inbuf,smb_vwv0);
|
||||
fsp = file_fsp(fnum);
|
||||
|
||||
if ((fnum != 0xFFFF) && !check_fsp(conn, req, fsp, ¤t_user)) {
|
||||
if ((fnum != 0xFFFF) && !check_fsp(conn, req, fsp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -4320,7 +4320,7 @@ void reply_writeclose(struct smb_request *req)
|
||||
|
||||
fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
|
||||
|
||||
if (!check_fsp(conn, req, fsp, ¤t_user)) {
|
||||
if (!check_fsp(conn, req, fsp)) {
|
||||
END_PROFILE(SMBwriteclose);
|
||||
return;
|
||||
}
|
||||
@ -4407,7 +4407,7 @@ void reply_lock(struct smb_request *req)
|
||||
|
||||
fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
|
||||
|
||||
if (!check_fsp(conn, req, fsp, ¤t_user)) {
|
||||
if (!check_fsp(conn, req, fsp)) {
|
||||
END_PROFILE(SMBlock);
|
||||
return;
|
||||
}
|
||||
@ -4466,7 +4466,7 @@ void reply_unlock(struct smb_request *req)
|
||||
|
||||
fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
|
||||
|
||||
if (!check_fsp(conn, req, fsp, ¤t_user)) {
|
||||
if (!check_fsp(conn, req, fsp)) {
|
||||
END_PROFILE(SMBunlock);
|
||||
return;
|
||||
}
|
||||
@ -4650,7 +4650,7 @@ void reply_printclose(struct smb_request *req)
|
||||
|
||||
fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
|
||||
|
||||
if (!check_fsp(conn, req, fsp, ¤t_user)) {
|
||||
if (!check_fsp(conn, req, fsp)) {
|
||||
END_PROFILE(SMBsplclose);
|
||||
return;
|
||||
}
|
||||
@ -4790,7 +4790,7 @@ void reply_printwrite(struct smb_request *req)
|
||||
|
||||
fsp = file_fsp(SVAL(req->inbuf,smb_vwv0));
|
||||
|
||||
if (!check_fsp(conn, req, fsp, ¤t_user)) {
|
||||
if (!check_fsp(conn, req, fsp)) {
|
||||
END_PROFILE(SMBsplwr);
|
||||
return;
|
||||
}
|
||||
@ -6624,7 +6624,7 @@ void reply_lockingX(struct smb_request *req)
|
||||
lock_timeout = IVAL(req->inbuf,smb_vwv4);
|
||||
large_file_format = (locktype & LOCKING_ANDX_LARGE_FILES)?True:False;
|
||||
|
||||
if (!check_fsp(conn, req, fsp, ¤t_user)) {
|
||||
if (!check_fsp(conn, req, fsp)) {
|
||||
END_PROFILE(SMBlockingX);
|
||||
return;
|
||||
}
|
||||
|
@ -3871,7 +3871,7 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
|
||||
}
|
||||
|
||||
/* Initial check for valid fsp ptr. */
|
||||
if (!check_fsp_open(conn, req, fsp, ¤t_user)) {
|
||||
if (!check_fsp_open(conn, req, fsp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -3914,7 +3914,7 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
|
||||
/*
|
||||
* Original code - this is an open file.
|
||||
*/
|
||||
if (!check_fsp(conn, req, fsp, ¤t_user)) {
|
||||
if (!check_fsp(conn, req, fsp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -6568,7 +6568,7 @@ static void call_trans2setfilepathinfo(connection_struct *conn,
|
||||
|
||||
fsp = file_fsp(SVAL(params,0));
|
||||
/* Basic check for non-null fsp. */
|
||||
if (!check_fsp_open(conn, req, fsp, ¤t_user)) {
|
||||
if (!check_fsp_open(conn, req, fsp)) {
|
||||
return;
|
||||
}
|
||||
info_level = SVAL(params,2);
|
||||
@ -6621,7 +6621,7 @@ static void call_trans2setfilepathinfo(connection_struct *conn,
|
||||
/*
|
||||
* Original code - this is an open file.
|
||||
*/
|
||||
if (!check_fsp(conn, req, fsp, ¤t_user)) {
|
||||
if (!check_fsp(conn, req, fsp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user