Changeset 591 for vendor/current/source3


Ignore:
Timestamp:
Jul 1, 2011, 9:17:44 AM (14 years ago)
Author:
Herwig Bauernfeind
Message:

Samba 3.5: Update vendor to version 3.5.7

Location:
vendor/current/source3
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/VERSION

    r587 r591  
    2626SAMBA_VERSION_MAJOR=3
    2727SAMBA_VERSION_MINOR=5
    28 SAMBA_VERSION_RELEASE=6
     28SAMBA_VERSION_RELEASE=7
    2929
    3030########################################################
  • vendor/current/source3/client/client.c

    r414 r591  
    44214421 again:
    44224422
    4423         if (cli->fd == -1)
     4423        if (cli->fd < 0 || cli->fd >= FD_SETSIZE) {
     4424                errno = EBADF;
    44244425                return;
     4426        }
    44254427
    44264428        FD_ZERO(&fds);
  • vendor/current/source3/client/dnsbrowse.c

    r414 r591  
    8080                if (fdset != NULL) {
    8181                        TALLOC_FREE(fdset);
     82                }
     83
     84                if (mdnsfd < 0 || mdnsfd >= FD_SETSIZE) {
     85                        errno = EBADF;
     86                        break;
    8287                }
    8388
     
    182187                }
    183188
     189                if (mdnsfd < 0 || mdnsfd >= FD_SETSIZE) {
     190                        errno = EBADF;
     191                        TALLOC_FREE(ctx);
     192                        return 1;
     193                }
     194
    184195                fdsetsz = howmany(mdnsfd + 1, NFDBITS) * sizeof(fd_mask);
    185196                fdset = TALLOC_ZERO(ctx, fdsetsz);
  • vendor/current/source3/include/version.h

    r587 r591  
    22#define SAMBA_VERSION_MAJOR 3
    33#define SAMBA_VERSION_MINOR 5
    4 #define SAMBA_VERSION_RELEASE 6
    5 #define SAMBA_VERSION_OFFICIAL_STRING "3.5.6"
     4#define SAMBA_VERSION_RELEASE 7
     5#define SAMBA_VERSION_OFFICIAL_STRING "3.5.7"
    66#ifdef SAMBA_VERSION_VENDOR_FUNCTION
    77#  define SAMBA_VERSION_STRING SAMBA_VERSION_VENDOR_FUNCTION
  • vendor/current/source3/lib/events.c

    r427 r591  
    5656
    5757        for (fde = ev->fd_events; fde; fde = fde->next) {
     58                if (fde->fd < 0 || fde->fd >= FD_SETSIZE) {
     59                        /* We ignore here, as it shouldn't be
     60                           possible to add an invalid fde->fd
     61                           but we don't want FD_SET to see an
     62                           invalid fd. */
     63                        continue;
     64                }
     65
    5866                if (fde->flags & EVENT_FD_READ) {
    5967                        FD_SET(fde->fd, read_fds);
  • vendor/current/source3/lib/g_lock.c

    r453 r591  
    392392                        FD_ZERO(r_fds);
    393393                        max_fd = ctdbd_conn_get_fd(conn);
    394                         FD_SET(max_fd, r_fds);
     394                        if (max_fd >= 0 && max_fd < FD_SETSIZE) {
     395                                FD_SET(max_fd, r_fds);
     396                        }
    395397                }
    396398#endif
  • vendor/current/source3/lib/packet.c

    r414 r591  
    108108        fd_set r_fds;
    109109
     110        if (ctx->fd < 0 || ctx->fd >= FD_SETSIZE) {
     111                errno = EBADF;
     112                return map_nt_error_from_unix(errno);
     113        }
     114
    110115        FD_ZERO(&r_fds);
    111116        FD_SET(ctx->fd, &r_fds);
  • vendor/current/source3/lib/readline.c

    r414 r591  
    9292                timeout.tv_usec = 0;
    9393
     94                if (fd < 0 || fd >= FD_SETSIZE) {
     95                        errno = EBADF;
     96                        break;
     97                }
     98
    9499                FD_ZERO(&fds);
    95100                FD_SET(fd,&fds);
  • vendor/current/source3/lib/select.c

    r414 r591  
    7676                }
    7777
     78                if (select_pipe[0] < 0 || select_pipe[0] >= FD_SETSIZE) {
     79                        DEBUG(0, ("sys_select: bad fd\n"));
     80                        if (readfds != NULL)
     81                                FD_ZERO(readfds);
     82                        if (writefds != NULL)
     83                                FD_ZERO(writefds);
     84                        if (errorfds != NULL)
     85                                FD_ZERO(errorfds);
     86                        errno = EBADF;
     87                        return -1;
     88                }
    7889                /*
    7990                 * These next two lines seem to fix a bug with the Linux
     
    102113                FD_ZERO(readfds2);
    103114        }
     115
    104116        FD_SET(select_pipe[0], readfds2);
    105117
  • vendor/current/source3/lib/util_sock.c

    r414 r591  
    496496
    497497        for (nread=0; nread < mincnt; ) {
     498                if (fd < 0 || fd >= FD_SETSIZE) {
     499                        errno = EBADF;
     500                        return map_nt_error_from_unix(EBADF);
     501                }
     502
    498503                FD_ZERO(&fds);
    499504                FD_SET(fd,&fds);
     
    12361241        for (i=0; i<num_addrs; i++) {
    12371242                sockets[i] = socket(addrs[i].ss_family, SOCK_STREAM, 0);
    1238                 if (sockets[i] < 0)
     1243                if (sockets[i] < 0 || sockets[i] >= FD_SETSIZE)
    12391244                        goto done;
    12401245                set_blocking(sockets[i], false);
     
    12851290
    12861291        for (i=0; i<num_addrs; i++) {
    1287                 if (sockets[i] == -1)
     1292                if (sockets[i] < 0 || sockets[i] >= FD_SETSIZE) {
     1293                        /* This cannot happen - ignore if so. */
    12881294                        continue;
     1295                }
    12891296                FD_SET(sockets[i], &wr_fds);
    12901297                FD_SET(sockets[i], &r_fds);
     
    13061313        for (i=0; i<num_addrs; i++) {
    13071314
    1308                 if (sockets[i] == -1)
     1315                if (sockets[i] < 0 || sockets[i] >= FD_SETSIZE) {
     1316                        /* This cannot happen - ignore if so. */
    13091317                        continue;
     1318                }
    13101319
    13111320                /* Stevens, Network Programming says that if there's a
  • vendor/current/source3/libaddns/dnssock.c

    r414 r591  
    220220                int fd_ready;
    221221               
     222                if (fd < 0 || fd >= FD_SETSIZE) {
     223                        /* read timeout */
     224                        return ERROR_DNS_SOCKET_ERROR;
     225                }
     226
    222227                FD_ZERO( &rfds );
    223228                FD_SET( fd, &rfds );
  • vendor/current/source3/libsmb/nmblib.c

    r587 r591  
    10951095        int ret;
    10961096
     1097        if (fd < 0 || fd >= FD_SETSIZE) {
     1098                errno = EBADF;
     1099                return NULL;
     1100        }
     1101
    10971102        FD_ZERO(&fds);
    10981103        FD_SET(fd,&fds);
  • vendor/current/source3/nmbd/nmbd_packets.c

    r414 r591  
    16971697        count *= 4;
    16981698
    1699         if(count > FD_SETSIZE) {
     1699        if(count >= FD_SETSIZE) {
    17001700                DEBUG(0,("create_listen_fdset: Too many file descriptors needed (%d). We can \
    17011701only use %d.\n", count, FD_SETSIZE));
     
    17131713
    17141714        /* Add in the lp_socket_address() interface on 137. */
     1715        if (ClientNMB < 0 || ClientNMB >= FD_SETSIZE) {
     1716                errno = EBADF;
     1717                SAFE_FREE(pset);
     1718                return True;
     1719        }
     1720
    17151721        FD_SET(ClientNMB,pset);
    17161722        sock_array[num++] = ClientNMB;
     
    17221728        /* Add in the 137 sockets on all the interfaces. */
    17231729        for (subrec = FIRST_SUBNET; subrec; subrec = NEXT_SUBNET_EXCLUDING_UNICAST(subrec)) {
     1730                if (subrec->nmb_sock < 0 || subrec->nmb_sock >= FD_SETSIZE) {
     1731                        /* We have to ignore sockets outside FD_SETSIZE. */
     1732                        continue;
     1733                }
    17241734                FD_SET(subrec->nmb_sock,pset);
    17251735                sock_array[num++] = subrec->nmb_sock;
    17261736                *maxfd = MAX( *maxfd, subrec->nmb_sock);
    17271737
     1738                if (subrec->nmb_bcast < 0 || subrec->nmb_bcast >= FD_SETSIZE) {
     1739                        /* We have to ignore sockets outside FD_SETSIZE. */
     1740                        continue;
     1741                }
    17281742                sock_array[num++] = subrec->nmb_bcast;
    1729                 if (subrec->nmb_bcast != -1) {
    1730                         FD_SET(subrec->nmb_bcast,pset);
    1731                         *maxfd = MAX( *maxfd, subrec->nmb_bcast);
    1732                 }
     1743                FD_SET(subrec->nmb_bcast,pset);
     1744                *maxfd = MAX( *maxfd, subrec->nmb_bcast);
    17331745        }
    17341746
    17351747        /* Add in the lp_socket_address() interface on 138. */
     1748        if (ClientDGRAM < 0 || ClientDGRAM >= FD_SETSIZE) {
     1749                errno = EBADF;
     1750                SAFE_FREE(pset);
     1751                return True;
     1752        }
    17361753        FD_SET(ClientDGRAM,pset);
    17371754        sock_array[num++] = ClientDGRAM;
     
    17431760        /* Add in the 138 sockets on all the interfaces. */
    17441761        for (subrec = FIRST_SUBNET; subrec; subrec = NEXT_SUBNET_EXCLUDING_UNICAST(subrec)) {
     1762                if (subrec->dgram_sock < 0 || subrec->dgram_sock >= FD_SETSIZE) {
     1763                        /* We have to ignore sockets outside FD_SETSIZE. */
     1764                        continue;
     1765                }
    17451766                FD_SET(subrec->dgram_sock,pset);
    17461767                sock_array[num++] = subrec->dgram_sock;
    17471768                *maxfd = MAX( *maxfd, subrec->dgram_sock);
    17481769
     1770                if (subrec->dgram_bcast < 0 || subrec->dgram_bcast >= FD_SETSIZE) {
     1771                        /* We have to ignore sockets outside FD_SETSIZE. */
     1772                        continue;
     1773                }
    17491774                sock_array[num++] = subrec->dgram_bcast;
    17501775                if (subrec->dgram_bcast != -1) {
     
    18771902#ifndef SYNC_DNS
    18781903        dns_fd = asyncdns_fd();
    1879         if (dns_fd != -1) {
     1904        if (dns_fd >= 0 && dns_fd < FD_SETSIZE) {
    18801905                FD_SET(dns_fd, &r_fds);
    18811906                maxfd = MAX( maxfd, dns_fd);
  • vendor/current/source3/utils/smbfilter.c

    r587 r591  
    194194               
    195195                FD_ZERO(&fds);
    196                 if (s != -1) FD_SET(s, &fds);
    197                 if (c != -1) FD_SET(c, &fds);
     196                if (s >= 0 && s < FD_SETSIZE) FD_SET(s, &fds);
     197                if (c >= 0 && c < FD_SETSIZE) FD_SET(c, &fds);
    198198
    199199                num = sys_select_intr(MAX(s+1, c+1),&fds,NULL,NULL,NULL);
     
    268268               
    269269                FD_ZERO(&fds);
     270                if (s < 0 || s >= FD_SETSIZE) {
     271                        break;
     272                }
    270273                FD_SET(s, &fds);
    271274
  • vendor/current/source3/winbindd/winbindd_dual.c

    r478 r591  
    14611461                FD_ZERO(&r_fds);
    14621462                FD_ZERO(&w_fds);
     1463
     1464                if (state.sock < 0 || state.sock >= FD_SETSIZE) {
     1465                        TALLOC_FREE(frame);
     1466                        perror("EBADF");
     1467                        _exit(1);
     1468                }
     1469
    14631470                FD_SET(state.sock, &r_fds);
    14641471                maxfd = state.sock;
Note: See TracChangeset for help on using the changeset viewer.