Ignore:
Timestamp:
Jun 25, 2011, 7:14:41 PM (14 years ago)
Author:
Herwig Bauernfeind
Message:

Update Samba 3.3 to 3.3.15 (security update)

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  
    126126        if (dns_state->srv_ref != NULL) {
    127127                mdnsd_conn_fd = DNSServiceRefSockFD(dns_state->srv_ref);
     128                if (mdnsd_conn_fd < 0 || mdnsd_conn_fd >= FD_SETSIZE) {
     129                        return;
     130                }
    128131                FD_SET(mdnsd_conn_fd, listen_set);
    129132                return;
     
    157160
    158161        mdnsd_conn_fd = DNSServiceRefSockFD(dns_state->srv_ref);
     162        if (mdnsd_conn_fd < 0 || mdnsd_conn_fd >= FD_SETSIZE) {
     163                return;
     164        }
    159165        FD_SET(mdnsd_conn_fd, listen_set);
    160166        *maxfd = MAX(*maxfd, mdnsd_conn_fd);
  • branches/samba-3.3.x/source/smbd/oplock.c

    r224 r578  
    242242{
    243243        if (koplocks) {
    244                 return koplocks->notification_fd;
     244                int fd = koplocks->notification_fd;
     245                if (fd < 0 || fd >= FD_SETSIZE) {
     246                        return -1;
     247                }
    245248        }
    246249
  • branches/samba-3.3.x/source/smbd/oplock_irix.c

    r206 r578  
    285285        }
    286286
     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
    287292        oplock_pipe_read = pfd[0];
    288293        oplock_pipe_write = pfd[1];
  • branches/samba-3.3.x/source/smbd/process.c

    r467 r578  
    699699static int select_on_fd(int fd, int maxfd, fd_set *fds)
    700700{
    701         if (fd != -1) {
     701        if (fd != -1 && fd < FD_SETSIZE) {
    702702                FD_SET(fd, fds);
    703703                maxfd = MAX(maxfd, fd);
  • branches/samba-3.3.x/source/smbd/server.c

    r423 r578  
    210210        /* We will abort gracefully when the client or remote system
    211211           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);
    213219       
    214220        /* close our standard file descriptors */
     
    437443                                                        ifss,
    438444                                                        true);
    439                                 if(s == -1) {
     445                                if(s < 0 || s >= FD_SETSIZE) {
     446                                        close(s);
    440447                                        continue;
    441448                                }
     
    517524                                                &ss,
    518525                                                true);
    519                                 if (s == -1) {
     526                                if (s < 0 || s >= FD_SETSIZE) {
    520527                                        continue;
    521528                                }
     
    710717                        socklen_t in_addrlen = sizeof(addr);
    711718                        pid_t child = 0;
     719                        int fd;
    712720
    713721                        s = -1;
     
    722730                        }
    723731
    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)
    727734                                continue;
    728 
    729                         if (smbd_server_fd() == -1) {
     735                        if (fd == -1) {
    730736                                DEBUG(2,("open_sockets_smbd: accept: %s\n",
    731737                                         strerror(errno)));
    732738                                continue;
    733739                        }
     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);
    734747
    735748                        /* Ensure child is set to blocking mode */
Note: See TracChangeset for help on using the changeset viewer.