summaryrefslogtreecommitdiffstats
path: root/source/smbd/trans2.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1996-10-05 10:41:13 +0000
committerAndrew Tridgell <tridge@samba.org>1996-10-05 10:41:13 +0000
commitea472b7217b7693627a13a7b1e428a0a6a3d8755 (patch)
tree6be6d7819605ea8e6dfbb07108f170990b43cc7f /source/smbd/trans2.c
parent1303132113b24a3e84dd76efe1c664e0dffe5013 (diff)
downloadsamba-ea472b7217b7693627a13a7b1e428a0a6a3d8755.tar.gz
samba-ea472b7217b7693627a13a7b1e428a0a6a3d8755.tar.xz
samba-ea472b7217b7693627a13a7b1e428a0a6a3d8755.zip
I have fixed quite a few important bugs in this commit.
Luke, can you take special note of the bug fixes to nmbd so you can propogate them to your new code. - rewrote the code that used to use fromhost(). We now call gethostbyaddr() only if necessary and a maximum of once per connection. Calling gethostbyaddr() causes problems on some systems so avoiding it if possible is a good thing :-) - added the "fake oplocks" option. See the docs in smb.conf(5) and Speed.txt - fixed a serious bug in nmbd where it would try a DNS lookup on FIND_SELF queries. This caused a lot of unnecessary (and incorrect) DNS lookups to happen. FIND_SELF queries should only go to the internal name tables. - don't set FIND_SELF for name queries if we are a wins proxy, as we are supposed to be answering queries for other hosts. - fixed a bug in nmbd which had "if (search | FIND_LOCAL)" instead of "if (search & FIND_LOCAL)". Luke, this was in nameservreply.c - the above 3 bugs together meant that DNS queries were being cached, but the cache wasn't being used, so every query was going to DNS, no wonder nmbd has been chewing so much CPU time! Another side effect was that queries on names in lmhosts weren't being answered for bcast queries with "wins proxy" set. - ignore the maxxmit for seconday session setups (see CIFS spec) - close user opened files in a uLogoffX for user level security (see CIFS spec) - added uid into the files struct to support the above change
Diffstat (limited to 'source/smbd/trans2.c')
-rw-r--r--source/smbd/trans2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/smbd/trans2.c b/source/smbd/trans2.c
index 9b5419010e2..53af9acbf53 100644
--- a/source/smbd/trans2.c
+++ b/source/smbd/trans2.c
@@ -163,6 +163,7 @@ static int call_trans2open(char *inbuf, char *outbuf, int bufsize, int cnum,
char *params = *pparams;
int16 open_mode = SVAL(params, 2);
int16 open_attr = SVAL(params,6);
+ BOOL oplock_request = BITSETW(params,1);
#if 0
BOOL return_additional_info = BITSETW(params,0);
int16 open_sattr = SVAL(params, 4);
@@ -232,6 +233,10 @@ static int call_trans2open(char *inbuf, char *outbuf, int bufsize, int cnum,
SIVAL(params,8, size);
SSVAL(params,12,rmode);
+ if (oplock_request && lp_fake_oplocks(SNUM(cnum))) {
+ smb_action |= (1<<15);
+ }
+
SSVAL(params,18,smb_action);
SIVAL(params,20,inode);