Changeset 578 for branches/samba-3.3.x/source/smbd
- Timestamp:
- Jun 25, 2011, 7:14:41 PM (14 years ago)
- Location:
- branches/samba-3.3.x/source/smbd
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.3.x/source/smbd/dnsregister.c
r370 r578 126 126 if (dns_state->srv_ref != NULL) { 127 127 mdnsd_conn_fd = DNSServiceRefSockFD(dns_state->srv_ref); 128 if (mdnsd_conn_fd < 0 || mdnsd_conn_fd >= FD_SETSIZE) { 129 return; 130 } 128 131 FD_SET(mdnsd_conn_fd, listen_set); 129 132 return; … … 157 160 158 161 mdnsd_conn_fd = DNSServiceRefSockFD(dns_state->srv_ref); 162 if (mdnsd_conn_fd < 0 || mdnsd_conn_fd >= FD_SETSIZE) { 163 return; 164 } 159 165 FD_SET(mdnsd_conn_fd, listen_set); 160 166 *maxfd = MAX(*maxfd, mdnsd_conn_fd); -
branches/samba-3.3.x/source/smbd/oplock.c
r224 r578 242 242 { 243 243 if (koplocks) { 244 return koplocks->notification_fd; 244 int fd = koplocks->notification_fd; 245 if (fd < 0 || fd >= FD_SETSIZE) { 246 return -1; 247 } 245 248 } 246 249 -
branches/samba-3.3.x/source/smbd/oplock_irix.c
r206 r578 285 285 } 286 286 287 if (pfd[0] < 0 || pfd[0] >= FD_SETSIZE) { 288 DEBUG(0,("setup_kernel_oplock_pipe: fd out of range.\n")); 289 return False; 290 } 291 287 292 oplock_pipe_read = pfd[0]; 288 293 oplock_pipe_write = pfd[1]; -
branches/samba-3.3.x/source/smbd/process.c
r467 r578 699 699 static int select_on_fd(int fd, int maxfd, fd_set *fds) 700 700 { 701 if (fd != -1 ) {701 if (fd != -1 && fd < FD_SETSIZE) { 702 702 FD_SET(fd, fds); 703 703 maxfd = MAX(maxfd, fd); -
branches/samba-3.3.x/source/smbd/server.c
r423 r578 210 210 /* We will abort gracefully when the client or remote system 211 211 goes away */ 212 smbd_set_server_fd(dup(0)); 212 int fd = dup(0); 213 214 if (fd < 0 || fd >= FD_SETSIZE) { 215 return false; 216 } 217 218 smbd_set_server_fd(fd); 213 219 214 220 /* close our standard file descriptors */ … … 437 443 ifss, 438 444 true); 439 if(s == -1) { 445 if(s < 0 || s >= FD_SETSIZE) { 446 close(s); 440 447 continue; 441 448 } … … 517 524 &ss, 518 525 true); 519 if (s == -1) {526 if (s < 0 || s >= FD_SETSIZE) { 520 527 continue; 521 528 } … … 710 717 socklen_t in_addrlen = sizeof(addr); 711 718 pid_t child = 0; 719 int fd; 712 720 713 721 s = -1; … … 722 730 } 723 731 724 smbd_set_server_fd(accept(s,&addr,&in_addrlen)); 725 726 if (smbd_server_fd() == -1 && errno == EINTR) 732 fd = accept(s,&addr,&in_addrlen); 733 if (fd == -1 && errno == EINTR) 727 734 continue; 728 729 if (smbd_server_fd() == -1) { 735 if (fd == -1) { 730 736 DEBUG(2,("open_sockets_smbd: accept: %s\n", 731 737 strerror(errno))); 732 738 continue; 733 739 } 740 if (fd < 0 || fd >= FD_SETSIZE) { 741 DEBUG(2,("open_sockets_smbd: bad fd %d\n", 742 fd )); 743 continue; 744 } 745 746 smbd_set_server_fd(fd); 734 747 735 748 /* Ensure child is set to blocking mode */
Note:
See TracChangeset
for help on using the changeset viewer.