svn commit: samba r12460 - branches/SAMBA_3_0/source/smbd
trunk/source/smbd
vlendec at samba.org
vlendec at samba.org
Sat Dec 24 21:06:42 GMT 2005
Author: vlendec
Date: 2005-12-24 21:06:41 +0000 (Sat, 24 Dec 2005)
New Revision: 12460
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=12460
Log:
Fixes for bug 3349
Modified:
branches/SAMBA_3_0/source/smbd/close.c
branches/SAMBA_3_0/source/smbd/open.c
branches/SAMBA_3_0/source/smbd/oplock.c
trunk/source/smbd/close.c
trunk/source/smbd/open.c
trunk/source/smbd/oplock.c
Changeset:
Modified: branches/SAMBA_3_0/source/smbd/close.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/close.c 2005-12-23 21:55:26 UTC (rev 12459)
+++ branches/SAMBA_3_0/source/smbd/close.c 2005-12-24 21:06:41 UTC (rev 12460)
@@ -130,8 +130,10 @@
*/
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();
}
}
}
Modified: branches/SAMBA_3_0/source/smbd/open.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/open.c 2005-12-23 21:55:26 UTC (rev 12459)
+++ branches/SAMBA_3_0/source/smbd/open.c 2005-12-24 21:06:41 UTC (rev 12460)
@@ -682,11 +682,15 @@
}
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);
Modified: branches/SAMBA_3_0/source/smbd/oplock.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/oplock.c 2005-12-23 21:55:26 UTC (rev 12459)
+++ branches/SAMBA_3_0/source/smbd/oplock.c 2005-12-24 21:06:41 UTC (rev 12460)
@@ -398,8 +398,10 @@
* 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 @@
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 @@
{
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 @@
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);
Modified: trunk/source/smbd/close.c
===================================================================
--- trunk/source/smbd/close.c 2005-12-23 21:55:26 UTC (rev 12459)
+++ trunk/source/smbd/close.c 2005-12-24 21:06:41 UTC (rev 12460)
@@ -130,8 +130,10 @@
*/
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();
}
}
}
Modified: trunk/source/smbd/open.c
===================================================================
--- trunk/source/smbd/open.c 2005-12-23 21:55:26 UTC (rev 12459)
+++ trunk/source/smbd/open.c 2005-12-24 21:06:41 UTC (rev 12460)
@@ -683,11 +683,15 @@
}
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);
Modified: trunk/source/smbd/oplock.c
===================================================================
--- trunk/source/smbd/oplock.c 2005-12-23 21:55:26 UTC (rev 12459)
+++ trunk/source/smbd/oplock.c 2005-12-24 21:06:41 UTC (rev 12460)
@@ -398,8 +398,10 @@
* 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 @@
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 @@
{
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 @@
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);
More information about the samba-cvs
mailing list