diff options
author | Jeremy Allison <jra@samba.org> | 1997-12-20 10:52:00 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1997-12-20 10:52:00 +0000 |
commit | d57c055478a34b9c4a0fc7ba90d20f510d0df797 (patch) | |
tree | bef7a501594b6a12942ea0b29d9d64ac1b97a9fa /source3 | |
parent | 7b3369283c89f8114ae60c3d9d50737b35ba0c08 (diff) | |
download | samba-d57c055478a34b9c4a0fc7ba90d20f510d0df797.tar.gz samba-d57c055478a34b9c4a0fc7ba90d20f510d0df797.tar.bz2 samba-d57c055478a34b9c4a0fc7ba90d20f510d0df797.zip |
loadparm.c: Added fix for veto oplock files bug from Charles Hoch <hoch@hplcgh.hpl.hp.com>
server.c, util.c: Added fix for oplock break requests blocking due to server being
blocked in read call. Bug found by Charles Hoch <hoch@hplcgh.hpl.hp.com>.
Jeremy.
(This used to be commit 209f894fdbcfbf7a7952b6228342b86e088a9582)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/lib/util.c | 18 | ||||
-rw-r--r-- | source3/param/loadparm.c | 2 | ||||
-rw-r--r-- | source3/smbd/server.c | 9 |
3 files changed, 18 insertions, 11 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c index 58560bd227..41ea593ae5 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -2268,10 +2268,7 @@ int read_smb_length(int fd,char *inbuf,int timeout) msg_type = CVAL(buffer,0); if (msg_type == 0x85) - { - DEBUG(5,("Got keepalive packet\n")); - ok = False; - } + DEBUG(5,("Got keepalive packet\n")); } DEBUG(10,("got smb length of %d\n",len)); @@ -2295,7 +2292,7 @@ BOOL receive_smb(int fd,char *buffer, int timeout) bzero(buffer,smb_size + 100); len = read_smb_length(fd,buffer,timeout); - if (len == -1) + if (len < 0) return(False); if (len > BUFFER_SIZE) { @@ -2304,12 +2301,13 @@ BOOL receive_smb(int fd,char *buffer, int timeout) exit(1); } - ret = read_data(fd,buffer+4,len); - if (ret != len) { - smb_read_error = READ_ERROR; - return False; + if(len > 0) { + ret = read_data(fd,buffer+4,len); + if (ret != len) { + smb_read_error = READ_ERROR; + return False; + } } - return(True); } diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b2a016d8a5..61a14c9249 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -993,7 +993,7 @@ FN_LOCAL_STRING(lp_volume,volume) FN_LOCAL_STRING(lp_mangled_map,szMangledMap) FN_LOCAL_STRING(lp_veto_files,szVetoFiles) FN_LOCAL_STRING(lp_hide_files,szHideFiles) -FN_LOCAL_STRING(lp_veto_oplocks,szVetoFiles) +FN_LOCAL_STRING(lp_veto_oplocks,szVetoOplockFiles) FN_LOCAL_STRING(lp_driverlocation,szPrinterDriverLocation) FN_LOCAL_BOOL(lp_alternate_permissions,bAlternatePerm) diff --git a/source3/smbd/server.c b/source3/smbd/server.c index bf66e1ca4b..76a9fb272a 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -2595,6 +2595,8 @@ static void process_smb(char *inbuf, char *outbuf) if (msg_type == 0) show_msg(inbuf); + else if(msg_type == 0x85) + return; /* Keepalive packet. */ nread = construct_reply(inbuf,outbuf,nread,max_send); @@ -3142,6 +3144,13 @@ BOOL receive_next_smb(int smbfd, int oplockfd, char *inbuf, int bufsize, int tim process_local_message(oplock_sock, inbuf, bufsize); continue; } + + if(ret && (CVAL(inbuf,0) == 0x85)) + { + /* Keepalive packet. */ + got_smb = False; + } + } while(ret && !got_smb); |