summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-04-08 19:21:41 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:56:32 -0500
commitf0fea42a755eb9f30a2a0ac6cd68c523f7cb469f (patch)
treee21c9ce76fd08f0f961b41361cdab69251f8478e /source3
parent43710a45e8308afac43d8ad1bf6f1aab05a77bb9 (diff)
downloadsamba-f0fea42a755eb9f30a2a0ac6cd68c523f7cb469f.tar.gz
samba-f0fea42a755eb9f30a2a0ac6cd68c523f7cb469f.tar.bz2
samba-f0fea42a755eb9f30a2a0ac6cd68c523f7cb469f.zip
r6252: Re-order position of become_root() to allow directory to be
read first. Jeremy. (This used to be commit 9fa32282ebe78c3ecd433e8ece600881774560b7)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/oplock.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index e6af12cd81..9b8df98fd5 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -805,7 +805,6 @@ static BOOL oplock_break(SMB_DEV_T dev, SMB_INO_T inode, unsigned long file_id,
saved_user_conn = current_user.conn;
saved_vuid = current_user.vuid;
saved_fsp_conn = fsp->conn;
- change_to_root_user();
/*
* Initialize saved_dir to something sensible: vfs_GetWd may not work well
* for root: the directory may be NFS-mounted and exported with root_squash
@@ -816,6 +815,10 @@ static BOOL oplock_break(SMB_DEV_T dev, SMB_INO_T inode, unsigned long file_id,
/* Save the chain fnum. */
file_chain_save();
+ pstrcpy(file_name, fsp->fsp_name);
+
+ change_to_root_user();
+
/*
* From Charles Hoch <hoch@exemplary.com>. If the break processing
* code closes the file (as it often does), then the fsp pointer here
@@ -823,8 +826,6 @@ static BOOL oplock_break(SMB_DEV_T dev, SMB_INO_T inode, unsigned long file_id,
* around the loop.
*/
- pstrcpy(file_name, fsp->fsp_name);
-
while((fsp = initial_break_processing(dev, inode, file_id)) &&
OPEN_FSP(fsp) && EXCLUSIVE_OPLOCK_TYPE(fsp->oplock_type)) {
if(receive_smb(smbd_server_fd(),inbuf, timeout) == False) {