Changeset 135 for branches/samba-3.0/source
- Timestamp:
- May 29, 2008, 11:30:31 AM (17 years ago)
- Location:
- branches/samba-3.0/source
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.0/source/VERSION
r134 r135 26 26 SAMBA_VERSION_MAJOR=3 27 27 SAMBA_VERSION_MINOR=0 28 SAMBA_VERSION_RELEASE= 2928 SAMBA_VERSION_RELEASE=30 29 29 30 30 ######################################################## -
branches/samba-3.0/source/client/client.c
r124 r135 3627 3627 */ 3628 3628 if (FD_ISSET(cli->fd,&fds)) { 3629 if (!receive_smb(cli->fd,cli->inbuf, 0)) {3629 if (!receive_smb(cli->fd,cli->inbuf,cli->bufsize,0)) { 3630 3630 DEBUG(0, ("Read from server failed, maybe it closed the " 3631 3631 "connection\n")); -
branches/samba-3.0/source/client/smbctool.c
r22 r135 3305 3305 */ 3306 3306 if (FD_ISSET(cli->fd,&fds)) { 3307 receive_smb(cli->fd,cli->inbuf, 0);3307 receive_smb(cli->fd,cli->inbuf,cli->bufsize,0); 3308 3308 goto again; 3309 3309 } -
branches/samba-3.0/source/include/version.h
r134 r135 2 2 #define SAMBA_VERSION_MAJOR 3 3 3 #define SAMBA_VERSION_MINOR 0 4 #define SAMBA_VERSION_RELEASE 295 #define SAMBA_VERSION_OFFICIAL_STRING "3.0. 29"4 #define SAMBA_VERSION_RELEASE 30 5 #define SAMBA_VERSION_OFFICIAL_STRING "3.0.30" 6 6 #define SAMBA_VERSION_STRING samba_version_string() -
branches/samba-3.0/source/lib/util_sock.c
r30 r135 697 697 698 698 /**************************************************************************** 699 Read an smb from a fd. Note that the buffer *MUST* be of size 700 BUFFER_SIZE+SAFETY_MARGIN. 699 Read an smb from a fd. 701 700 The timeout is in milliseconds. 702 701 This function will return on receipt of a session keepalive packet. … … 704 703 ****************************************************************************/ 705 704 706 BOOL receive_smb_raw(int fd, char *buffer, unsigned int timeout)705 BOOL receive_smb_raw(int fd, char *buffer, size_t buflen, unsigned int timeout) 707 706 { 708 707 ssize_t len,ret; … … 725 724 } 726 725 727 /* 728 * A WRITEX with CAP_LARGE_WRITEX can be 64k worth of data plus 65 bytes 729 * of header. Don't print the error if this fits.... JRA. 730 */ 731 732 if (len > (BUFFER_SIZE + LARGE_WRITEX_HDR_SIZE)) { 726 if (len > buflen) { 733 727 DEBUG(0,("Invalid packet length! (%lu bytes).\n",(unsigned long)len)); 734 if (len > BUFFER_SIZE + (SAFETY_MARGIN/2)) { 735 736 /* 737 * Correct fix. smb_read_error may have already been 738 * set. Only set it here if not already set. Global 739 * variables still suck :-). JRA. 740 */ 741 742 if (smb_read_error == 0) 743 smb_read_error = READ_ERROR; 744 return False; 745 } 728 729 /* 730 * smb_read_error may have already been 731 * set. Only set it here if not already set. Global 732 * variables still suck :-). JRA. 733 */ 734 735 if (smb_read_error == 0) 736 smb_read_error = READ_ERROR; 737 return False; 746 738 } 747 739 … … 773 765 ****************************************************************************/ 774 766 775 BOOL receive_smb(int fd, char *buffer, unsigned int timeout)776 { 777 if (!receive_smb_raw(fd, buffer, timeout)) {767 BOOL receive_smb(int fd, char *buffer, size_t buflen, unsigned int timeout) 768 { 769 if (!receive_smb_raw(fd, buffer, buflen, timeout)) { 778 770 return False; 779 771 } -
branches/samba-3.0/source/libsmb/clientgen.c
r30 r135 45 45 46 46 /**************************************************************************** 47 Read an smb from a fd ignoring all keepalive packets. Note that the buffer 48 *MUST* be of size BUFFER_SIZE+SAFETY_MARGIN. 47 Read an smb from a fd ignoring all keepalive packets. 49 48 The timeout is in milliseconds 50 49 … … 55 54 ****************************************************************************/ 56 55 57 static BOOL client_receive_smb(int fd,char *buffer, unsigned int timeout)56 static BOOL client_receive_smb(int fd,char *buffer, size_t bufsize, unsigned int timeout) 58 57 { 59 58 BOOL ret; 60 59 61 60 for(;;) { 62 ret = receive_smb_raw(fd, buffer, timeout);61 ret = receive_smb_raw(fd, buffer, bufsize, timeout); 63 62 64 63 if (!ret) { … … 89 88 90 89 again: 91 ret = client_receive_smb(cli->fd,cli->inbuf, cli->timeout);90 ret = client_receive_smb(cli->fd,cli->inbuf, cli->bufsize, cli->timeout); 92 91 93 92 if (ret) { -
branches/samba-3.0/source/smbd/process.c
r30 r135 522 522 } 523 523 524 return receive_smb(smbd_server_fd(), buffer, 0); 524 return receive_smb(smbd_server_fd(), buffer, 525 BUFFER_SIZE + LARGE_WRITEX_HDR_SIZE, 0); 525 526 } 526 527 -
branches/samba-3.0/source/utils/smbfilter.c
r1 r135 141 141 142 142 if (c != -1 && FD_ISSET(c, &fds)) { 143 if (!receive_smb(c, packet, 0)) {143 if (!receive_smb(c, packet, BUFFER_SIZE, 0)) { 144 144 d_printf("client closed connection\n"); 145 145 exit(0); … … 152 152 } 153 153 if (s != -1 && FD_ISSET(s, &fds)) { 154 if (!receive_smb(s, packet, 0)) {154 if (!receive_smb(s, packet, BUFFER_SIZE, 0)) { 155 155 d_printf("server closed connection\n"); 156 156 exit(0);
Note:
See TracChangeset
for help on using the changeset viewer.