summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-09-04 19:58:01 +0000
committerJeremy Allison <jra@samba.org>2001-09-04 19:58:01 +0000
commit15472c4ee7a8cf78c352ce56b48868762d68f95a (patch)
tree40e281b427d21f141163e442be9faa781a72547f
parent7e75921e24dc1cca934bc5e4350137292a2f2112 (diff)
downloadsamba-15472c4ee7a8cf78c352ce56b48868762d68f95a.tar.gz
samba-15472c4ee7a8cf78c352ce56b48868762d68f95a.tar.bz2
samba-15472c4ee7a8cf78c352ce56b48868762d68f95a.zip
Fixes to ensure invalid vuids cannot stop oplock breaks.
This may have bearing on the Solaris fcntl spin bug. Jeremy. (This used to be commit 0f676202529cbfead629d2c228b7d5abc2dff7d6)
-rw-r--r--source3/smbd/oplock.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index f841432960..26d193e2c2 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -630,7 +630,8 @@ static BOOL oplock_break(SMB_DEV_T dev, SMB_INO_T inode, struct timeval *tval, B
time_t start_time;
BOOL shutdown_server = False;
BOOL oplock_timeout = False;
- connection_struct *saved_conn;
+ connection_struct *saved_user_conn;
+ connection_struct *saved_fsp_conn;
int saved_vuid;
pstring saved_dir;
int timeout = (OPLOCK_BREAK_TIMEOUT * 1000);
@@ -734,9 +735,10 @@ static BOOL oplock_break(SMB_DEV_T dev, SMB_INO_T inode, struct timeval *tval, B
* Save the information we need to re-become the
* user, then unbecome the user whilst we're doing this.
*/
- saved_conn = fsp->conn;
+ saved_user_conn = current_user.conn;
saved_vuid = current_user.vuid;
- vfs_GetWd(saved_conn,saved_dir);
+ saved_fsp_conn = fsp->conn;
+ vfs_GetWd(saved_fsp_conn,saved_dir);
unbecome_user();
/* Save the chain fnum. */
file_chain_save();
@@ -810,7 +812,7 @@ static BOOL oplock_break(SMB_DEV_T dev, SMB_INO_T inode, struct timeval *tval, B
* Go back to being the user who requested the oplock
* break.
*/
- if(!become_user(saved_conn, saved_vuid))
+ if((saved_user_conn != NULL) && (saved_vuid != UID_FIELD_INVALID) && !become_user(saved_user_conn, saved_vuid))
{
DEBUG( 0, ( "oplock_break: unable to re-become user!" ) );
DEBUGADD( 0, ( "Shutting down server\n" ) );
@@ -818,7 +820,7 @@ static BOOL oplock_break(SMB_DEV_T dev, SMB_INO_T inode, struct timeval *tval, B
exit_server("unable to re-become user");
}
/* Including the directory. */
- vfs_ChDir(saved_conn,saved_dir);
+ vfs_ChDir(saved_fsp_conn,saved_dir);
/* Restore the chain fnum. */
file_chain_restore();