mirror of
https://github.com/samba-team/samba.git
synced 2025-08-05 12:22:11 +03:00
use talloc_tos in a few more places
(This used to be commit 65dd869bea
)
This commit is contained in:
@ -925,7 +925,7 @@ bool get_delete_on_close_flag(struct file_id id)
|
|||||||
bool result;
|
bool result;
|
||||||
struct share_mode_lock *lck;
|
struct share_mode_lock *lck;
|
||||||
|
|
||||||
if (!(lck = fetch_share_mode_unlocked(NULL, id, NULL, NULL))) {
|
if (!(lck = fetch_share_mode_unlocked(talloc_tos(), id, NULL, NULL))) {
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
result = lck->delete_on_close;
|
result = lck->delete_on_close;
|
||||||
@ -1328,7 +1328,7 @@ bool set_delete_on_close(files_struct *fsp, bool delete_on_close, UNIX_USER_TOKE
|
|||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
|
|
||||||
lck = get_share_mode_lock(NULL, fsp->file_id, NULL, NULL);
|
lck = get_share_mode_lock(talloc_tos(), fsp->file_id, NULL, NULL);
|
||||||
if (lck == NULL) {
|
if (lck == NULL) {
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
|
@ -176,7 +176,7 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
|
|||||||
* This prevents race conditions with the file being created. JRA.
|
* This prevents race conditions with the file being created. JRA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
lck = get_share_mode_lock(NULL, fsp->file_id, NULL, NULL);
|
lck = get_share_mode_lock(talloc_tos(), fsp->file_id, NULL, NULL);
|
||||||
|
|
||||||
if (lck == NULL) {
|
if (lck == NULL) {
|
||||||
DEBUG(0, ("close_remove_share_mode: Could not get share mode "
|
DEBUG(0, ("close_remove_share_mode: Could not get share mode "
|
||||||
@ -441,7 +441,7 @@ static NTSTATUS close_directory(files_struct *fsp, enum file_close_type close_ty
|
|||||||
* reference to a directory also.
|
* reference to a directory also.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
lck = get_share_mode_lock(NULL, fsp->file_id, NULL, NULL);
|
lck = get_share_mode_lock(talloc_tos(), fsp->file_id, NULL, NULL);
|
||||||
|
|
||||||
if (lck == NULL) {
|
if (lck == NULL) {
|
||||||
DEBUG(0, ("close_directory: Could not get share mode lock for %s\n", fsp->fsp_name));
|
DEBUG(0, ("close_directory: Could not get share mode lock for %s\n", fsp->fsp_name));
|
||||||
|
@ -132,7 +132,7 @@ bool claim_connection(connection_struct *conn, const char *name,
|
|||||||
|
|
||||||
DEBUG(5,("claiming [%s]\n", name));
|
DEBUG(5,("claiming [%s]\n", name));
|
||||||
|
|
||||||
if (!(rec = connections_fetch_entry(NULL, conn, name))) {
|
if (!(rec = connections_fetch_entry(talloc_tos(), conn, name))) {
|
||||||
DEBUG(0, ("connections_fetch_entry failed\n"));
|
DEBUG(0, ("connections_fetch_entry failed\n"));
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
|
@ -1221,7 +1221,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
|
|||||||
request_time = pml->request_time;
|
request_time = pml->request_time;
|
||||||
|
|
||||||
/* Remove the deferred open entry under lock. */
|
/* Remove the deferred open entry under lock. */
|
||||||
lck = get_share_mode_lock(NULL, state->id, NULL, NULL);
|
lck = get_share_mode_lock(talloc_tos(), state->id, NULL, NULL);
|
||||||
if (lck == NULL) {
|
if (lck == NULL) {
|
||||||
DEBUG(0, ("could not get share mode lock\n"));
|
DEBUG(0, ("could not get share mode lock\n"));
|
||||||
} else {
|
} else {
|
||||||
@ -1451,7 +1451,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
|
|||||||
if (file_existed) {
|
if (file_existed) {
|
||||||
id = vfs_file_id_from_sbuf(conn, psbuf);
|
id = vfs_file_id_from_sbuf(conn, psbuf);
|
||||||
|
|
||||||
lck = get_share_mode_lock(NULL, id,
|
lck = get_share_mode_lock(talloc_tos(), id,
|
||||||
conn->connectpath,
|
conn->connectpath,
|
||||||
fname);
|
fname);
|
||||||
|
|
||||||
@ -1678,7 +1678,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
|
|||||||
|
|
||||||
id = fsp->file_id;
|
id = fsp->file_id;
|
||||||
|
|
||||||
lck = get_share_mode_lock(NULL, id,
|
lck = get_share_mode_lock(talloc_tos(), id,
|
||||||
conn->connectpath,
|
conn->connectpath,
|
||||||
fname);
|
fname);
|
||||||
|
|
||||||
@ -2212,7 +2212,7 @@ NTSTATUS open_directory(connection_struct *conn,
|
|||||||
|
|
||||||
string_set(&fsp->fsp_name,fname);
|
string_set(&fsp->fsp_name,fname);
|
||||||
|
|
||||||
lck = get_share_mode_lock(NULL, fsp->file_id,
|
lck = get_share_mode_lock(talloc_tos(), fsp->file_id,
|
||||||
conn->connectpath,
|
conn->connectpath,
|
||||||
fname);
|
fname);
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ bool remove_oplock(files_struct *fsp)
|
|||||||
struct share_mode_lock *lck;
|
struct share_mode_lock *lck;
|
||||||
|
|
||||||
/* Remove the oplock flag from the sharemode. */
|
/* Remove the oplock flag from the sharemode. */
|
||||||
lck = get_share_mode_lock(NULL, fsp->file_id, NULL, NULL);
|
lck = get_share_mode_lock(talloc_tos(), fsp->file_id, NULL, NULL);
|
||||||
if (lck == NULL) {
|
if (lck == NULL) {
|
||||||
DEBUG(0,("remove_oplock: failed to lock share entry for "
|
DEBUG(0,("remove_oplock: failed to lock share entry for "
|
||||||
"file %s\n", fsp->fsp_name ));
|
"file %s\n", fsp->fsp_name ));
|
||||||
@ -206,7 +206,7 @@ bool downgrade_oplock(files_struct *fsp)
|
|||||||
bool ret;
|
bool ret;
|
||||||
struct share_mode_lock *lck;
|
struct share_mode_lock *lck;
|
||||||
|
|
||||||
lck = get_share_mode_lock(NULL, fsp->file_id, NULL, NULL);
|
lck = get_share_mode_lock(talloc_tos(), fsp->file_id, NULL, NULL);
|
||||||
if (lck == NULL) {
|
if (lck == NULL) {
|
||||||
DEBUG(0,("downgrade_oplock: failed to lock share entry for "
|
DEBUG(0,("downgrade_oplock: failed to lock share entry for "
|
||||||
"file %s\n", fsp->fsp_name ));
|
"file %s\n", fsp->fsp_name ));
|
||||||
@ -757,7 +757,7 @@ void release_level_2_oplocks_on_change(files_struct *fsp)
|
|||||||
if (!LEVEL_II_OPLOCK_TYPE(fsp->oplock_type))
|
if (!LEVEL_II_OPLOCK_TYPE(fsp->oplock_type))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
lck = get_share_mode_lock(NULL, fsp->file_id, NULL, NULL);
|
lck = get_share_mode_lock(talloc_tos(), fsp->file_id, NULL, NULL);
|
||||||
if (lck == NULL) {
|
if (lck == NULL) {
|
||||||
DEBUG(0,("release_level_2_oplocks_on_change: failed to lock "
|
DEBUG(0,("release_level_2_oplocks_on_change: failed to lock "
|
||||||
"share mode entry for file %s.\n", fsp->fsp_name ));
|
"share mode entry for file %s.\n", fsp->fsp_name ));
|
||||||
|
@ -592,7 +592,8 @@ void reply_tcon_and_X(struct smb_request *req)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (global_encrypted_passwords_negotiated) {
|
if (global_encrypted_passwords_negotiated) {
|
||||||
password = data_blob(smb_buf(req->inbuf),passlen);
|
password = data_blob_talloc(talloc_tos(), smb_buf(req->inbuf),
|
||||||
|
passlen);
|
||||||
if (lp_security() == SEC_SHARE) {
|
if (lp_security() == SEC_SHARE) {
|
||||||
/*
|
/*
|
||||||
* Security = share always has a pad byte
|
* Security = share always has a pad byte
|
||||||
@ -603,7 +604,8 @@ void reply_tcon_and_X(struct smb_request *req)
|
|||||||
p = smb_buf(req->inbuf) + passlen;
|
p = smb_buf(req->inbuf) + passlen;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
password = data_blob(smb_buf(req->inbuf),passlen+1);
|
password = data_blob_talloc(talloc_tos(), smb_buf(req->inbuf),
|
||||||
|
passlen+1);
|
||||||
/* Ensure correct termination */
|
/* Ensure correct termination */
|
||||||
password.data[passlen]=0;
|
password.data[passlen]=0;
|
||||||
p = smb_buf(req->inbuf) + passlen + 1;
|
p = smb_buf(req->inbuf) + passlen + 1;
|
||||||
@ -5508,7 +5510,7 @@ NTSTATUS rename_internals_fsp(connection_struct *conn,
|
|||||||
return NT_STATUS_ACCESS_DENIED;
|
return NT_STATUS_ACCESS_DENIED;
|
||||||
}
|
}
|
||||||
|
|
||||||
lck = get_share_mode_lock(NULL, fsp->file_id, NULL, NULL);
|
lck = get_share_mode_lock(talloc_tos(), fsp->file_id, NULL, NULL);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We have the file open ourselves, so not being able to get the
|
* We have the file open ourselves, so not being able to get the
|
||||||
|
@ -6193,7 +6193,7 @@ static NTSTATUS smb_posix_unlink(connection_struct *conn,
|
|||||||
* non-POSIX opens return SHARING_VIOLATION.
|
* non-POSIX opens return SHARING_VIOLATION.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
lck = get_share_mode_lock(NULL, fsp->file_id, NULL, NULL);
|
lck = get_share_mode_lock(talloc_tos(), fsp->file_id, NULL, NULL);
|
||||||
if (lck == NULL) {
|
if (lck == NULL) {
|
||||||
DEBUG(0, ("smb_posix_unlink: Could not get share mode "
|
DEBUG(0, ("smb_posix_unlink: Could not get share mode "
|
||||||
"lock for file %s\n", fsp->fsp_name));
|
"lock for file %s\n", fsp->fsp_name));
|
||||||
|
Reference in New Issue
Block a user