summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1997-11-28 03:30:24 +0000
committerAndrew Tridgell <tridge@samba.org>1997-11-28 03:30:24 +0000
commit0da20e0aecbf3e59bdc649c489a18832403dc9b2 (patch)
tree6182f1efe2fb6af10c77c0c060cb13b1a5a1cf74
parent2245da4ad6674aa373e3057c661f5bc0315e191f (diff)
downloadsamba-0da20e0aecbf3e59bdc649c489a18832403dc9b2.tar.gz
samba-0da20e0aecbf3e59bdc649c489a18832403dc9b2.tar.xz
samba-0da20e0aecbf3e59bdc649c489a18832403dc9b2.zip
fixed a very nasty oplock bug. We could send oplock break requests on
files that aren't open if the file happened to close while the oplock was in transit. We would end up sending a oplock break request on another random file (actually the open file that happened to have the highest fnum). Then we wouldn't get a response, so smbd would keep sending and would actually flood the net with an infinite number of oplock break requests!
-rw-r--r--source/smbd/server.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/smbd/server.c b/source/smbd/server.c
index 3f4f6c70347..8a52ddef69f 100644
--- a/source/smbd/server.c
+++ b/source/smbd/server.c
@@ -2795,11 +2795,12 @@ global_oplocks_open = %d\n", timestring(), dev, inode, global_oplocks_open));
{
if(OPEN_FNUM(fnum))
{
- fsp = &Files[fnum];
if((fsp->fd_ptr->dev == dev) && (fsp->fd_ptr->inode == inode) &&
(fsp->open_time.tv_sec == tval->tv_sec) &&
- (fsp->open_time.tv_usec == tval->tv_usec))
- break;
+ (fsp->open_time.tv_usec == tval->tv_usec)) {
+ fsp = &Files[fnum];
+ break;
+ }
}
}