diff options
author | Volker Lendecke <vlendec@samba.org> | 2005-12-24 21:06:41 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:05:56 -0500 |
commit | 67706697c5d8302e0d05d179de90c219531db8c7 (patch) | |
tree | c8b815a3b18e53352e202962b9c85fd965bec19e /source3 | |
parent | 3e80ef29a60373a443668357f63ad6f7fda6dab2 (diff) | |
download | samba-67706697c5d8302e0d05d179de90c219531db8c7.tar.gz samba-67706697c5d8302e0d05d179de90c219531db8c7.tar.bz2 samba-67706697c5d8302e0d05d179de90c219531db8c7.zip |
r12460: Fixes for bug 3349
(This used to be commit 040eda6bf0517204d5650702eea7e1d1c5eeb3d5)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/close.c | 2 | ||||
-rw-r--r-- | source3/smbd/open.c | 8 | ||||
-rw-r--r-- | source3/smbd/oplock.c | 8 |
3 files changed, 16 insertions, 2 deletions
diff --git a/source3/smbd/close.c b/source3/smbd/close.c index 407c607838..f834869935 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -130,8 +130,10 @@ static void notify_deferred_opens(struct share_mode_lock *lck) */ schedule_deferred_open_smb_message(e->op_mid); } else { + become_root(); message_send_pid(e->pid, MSG_SMB_OPEN_RETRY, e, sizeof(*e), True); + unbecome_root(); } } } diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 7621ee001d..e6c749fab9 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -682,11 +682,15 @@ static BOOL delay_for_oplocks(struct share_mode_lock *lck, files_struct *fsp) } if (delay_it) { + BOOL ret; DEBUG(10, ("Sending break request to PID %s\n", procid_str_static(&exclusive->pid))); exclusive->op_mid = get_current_mid(); - if (!message_send_pid(exclusive->pid, MSG_SMB_BREAK_REQUEST, - exclusive, sizeof(*exclusive), True)) { + become_root(); + ret = message_send_pid(exclusive->pid, MSG_SMB_BREAK_REQUEST, + exclusive, sizeof(*exclusive), True); + unbecome_root(); + if (!ret) { DEBUG(3, ("Could not send oplock break message\n")); } file_free(fsp); diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index f6c97c3df4..54e7da11af 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -398,8 +398,10 @@ static void process_oplock_break_message(int msg_type, struct process_id src, * get to process this message, we have closed the file. Reply * with 'ok, oplock broken' */ DEBUG(3, ("Did not find fsp\n")); + become_root(); message_send_pid(src, MSG_SMB_BREAK_RESPONSE, msg, sizeof(*msg), True); + unbecome_root(); return; } @@ -418,8 +420,10 @@ static void process_oplock_break_message(int msg_type, struct process_id src, DEBUG(3, ("Already downgraded oplock on %.0f/%.0f: %s\n", (double)fsp->dev, (double)fsp->inode, fsp->fsp_name)); + become_root(); message_send_pid(src, MSG_SMB_BREAK_RESPONSE, msg, sizeof(*msg), True); + unbecome_root(); return; } @@ -545,11 +549,13 @@ void reply_to_oplock_break_requests(files_struct *fsp) { int i; + become_root(); for (i=0; i<fsp->num_pending_break_messages; i++) { struct share_mode_entry *msg = &fsp->pending_break_messages[i]; message_send_pid(msg->pid, MSG_SMB_BREAK_RESPONSE, msg, sizeof(*msg), True); } + unbecome_root(); SAFE_FREE(fsp->pending_break_messages); fsp->num_pending_break_messages = 0; @@ -686,8 +692,10 @@ void release_level_2_oplocks_on_change(files_struct *fsp) abort(); } + become_root(); message_send_pid(share_entry->pid, MSG_SMB_ASYNC_LEVEL2_BREAK, share_entry, sizeof(*share_entry), True); + unbecome_root(); } remove_all_share_oplocks(lck, fsp); |