diff options
author | Jeremy Allison <jra@samba.org> | 2001-09-04 19:58:01 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-09-04 19:58:01 +0000 |
commit | 0f676202529cbfead629d2c228b7d5abc2dff7d6 (patch) | |
tree | bc579be04a0412dbbb1d23466ea66e758255a518 /source/smbd/oplock.c | |
parent | c05e79453655abb67fd47a2d3dba88b4c5377e35 (diff) | |
download | samba-0f676202529cbfead629d2c228b7d5abc2dff7d6.tar.gz samba-0f676202529cbfead629d2c228b7d5abc2dff7d6.tar.xz samba-0f676202529cbfead629d2c228b7d5abc2dff7d6.zip |
Fixes to ensure invalid vuids cannot stop oplock breaks.
This may have bearing on the Solaris fcntl spin bug.
Jeremy.
Diffstat (limited to 'source/smbd/oplock.c')
-rw-r--r-- | source/smbd/oplock.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source/smbd/oplock.c b/source/smbd/oplock.c index f841432960b..26d193e2c2a 100644 --- a/source/smbd/oplock.c +++ b/source/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(); |