diff options
author | Jeremy Allison <jra@samba.org> | 2006-07-28 22:42:39 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:38:24 -0500 |
commit | 4ace291278d9a44f5c577bdd3b282c1231e543df (patch) | |
tree | de2d270421bc224cf74758e82740770584733b57 /source/smbd/oplock.c | |
parent | f462daf02c12cfba634f92e681eb23a09e7d0acf (diff) | |
download | samba-4ace291278d9a44f5c577bdd3b282c1231e543df.tar.gz samba-4ace291278d9a44f5c577bdd3b282c1231e543df.tar.xz samba-4ace291278d9a44f5c577bdd3b282c1231e543df.zip |
r17293: After the results from the cluster tests in Germany,
fix the messaging code to call the efficient calls :
save_re_uid()
set_effective_uid(0);
messaging_op
restore_re_uid();
instead of using heavyweight become_root()/unbecome_root()
pairs around all messaging code. Fixup the messaging
code to ensure sec_init() is called (only once) so that non-root
processes still work when sending messages.
This is a lighter weight solution to become_root()/unbecome_root()
(which swaps all the supplemental groups) and should be more
efficient. I will migrate all server code over to using this
(a similar technique should be used in the passdb backend
where needed).
Jeremy.
Diffstat (limited to 'source/smbd/oplock.c')
-rw-r--r-- | source/smbd/oplock.c | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/source/smbd/oplock.c b/source/smbd/oplock.c index 99ce79296fd..d9850ee051c 100644 --- a/source/smbd/oplock.c +++ b/source/smbd/oplock.c @@ -504,13 +504,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(); /* We just send the same message back. */ message_send_pid(src, MSG_SMB_BREAK_RESPONSE, buf, MSG_SMB_SHARE_MODE_ENTRY_SIZE, True); - - unbecome_root(); return; } @@ -529,13 +526,9 @@ static void process_oplock_break_message(int msg_type, struct process_id src, DEBUG(3, ("Already downgraded oplock on 0x%x/%.0f: %s\n", (unsigned int)fsp->dev, (double)fsp->inode, fsp->fsp_name)); - become_root(); - /* We just send the same message back. */ message_send_pid(src, MSG_SMB_BREAK_RESPONSE, buf, MSG_SMB_SHARE_MODE_ENTRY_SIZE, True); - - unbecome_root(); return; } @@ -656,7 +649,6 @@ 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 *e = &fsp->pending_break_messages[i]; char msg[MSG_SMB_SHARE_MODE_ENTRY_SIZE]; @@ -666,7 +658,6 @@ void reply_to_oplock_break_requests(files_struct *fsp) message_send_pid(e->pid, MSG_SMB_BREAK_RESPONSE, msg, MSG_SMB_SHARE_MODE_ENTRY_SIZE, True); } - unbecome_root(); SAFE_FREE(fsp->pending_break_messages); fsp->num_pending_break_messages = 0; @@ -801,10 +792,8 @@ void release_level_2_oplocks_on_change(files_struct *fsp) share_mode_entry_to_message(msg, share_entry); - become_root(); message_send_pid(share_entry->pid, MSG_SMB_ASYNC_LEVEL2_BREAK, msg, MSG_SMB_SHARE_MODE_ENTRY_SIZE, True); - unbecome_root(); } /* We let the message receivers handle removing the oplock state |