Ignore:
Timestamp:
May 24, 2009, 7:17:10 AM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update Samba 3.3 to 3.3.1

Location:
branches/samba-3.3.x/source/lib
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.3.x/source/lib/ctdbd_conn.c

    r206 r221  
    11711171
    11721172/*
     1173   This is used to canonicalize a ctdb_sock_addr structure.
     1174*/
     1175static void smbd_ctdb_canonicalize_ip(const struct sockaddr_storage *in,
     1176                                      struct sockaddr_storage *out)
     1177{
     1178        memcpy(out, in, sizeof (*out));
     1179
     1180#ifdef HAVE_IPV6
     1181        if (in->ss_family == AF_INET6) {
     1182                const char prefix[12] = { 0,0,0,0,0,0,0,0,0,0,0xff,0xff };
     1183                const struct sockaddr_in6 *in6 = (struct sockaddr_in6 *)in;
     1184                struct sockaddr_in *out4 = (struct sockaddr_in *)out;
     1185                if (memcmp(&in6->sin6_addr, prefix, 12) == 0) {
     1186                        memset(out, 0, sizeof(*out));
     1187#ifdef HAVE_SOCK_SIN_LEN
     1188                        out4->sin_len = sizeof(*out);
     1189#endif
     1190                        out4->sin_family = AF_INET;
     1191                        out4->sin_port   = in6->sin6_port;
     1192                        memcpy(&out4->sin_addr, &in6->sin6_addr.s6_addr32[3], 4);
     1193                }
     1194        }
     1195#endif
     1196}
     1197
     1198/*
    11731199 * Register us as a server for a particular tcp connection
    11741200 */
    11751201
    11761202NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn,
    1177                             const struct sockaddr_storage *server,
    1178                             const struct sockaddr_storage *client,
     1203                            const struct sockaddr_storage *_server,
     1204                            const struct sockaddr_storage *_client,
    11791205                            void (*release_ip_handler)(const char *ip_addr,
    11801206                                                       void *private_data),
    11811207                            void *private_data)
    11821208{
    1183         struct sockaddr *sock = (struct sockaddr *)client;
    11841209        /*
    11851210         * we still use ctdb_control_tcp for ipv4
     
    11881213         */
    11891214        struct ctdb_control_tcp p4;
    1190 #ifdef HAVE_IPV6
     1215#ifdef HAVE_STRUCT_CTDB_CONTROL_TCP_ADDR
    11911216        struct ctdb_control_tcp_addr p;
    11921217#endif
    11931218        TDB_DATA data;
    11941219        NTSTATUS status;
     1220        struct sockaddr_storage client;
     1221        struct sockaddr_storage server;
    11951222
    11961223        /*
     
    11991226        SMB_ASSERT(conn->release_ip_handler == NULL);
    12001227
    1201         switch (sock->sa_family) {
     1228        smbd_ctdb_canonicalize_ip(_client, &client);
     1229        smbd_ctdb_canonicalize_ip(_server, &server);
     1230
     1231        switch (client.ss_family) {
    12021232        case AF_INET:
    1203                 p4.dest = *(struct sockaddr_in *)server;
    1204                 p4.src = *(struct sockaddr_in *)client;
     1233                p4.dest = *(struct sockaddr_in *)&server;
     1234                p4.src = *(struct sockaddr_in *)&client;
    12051235                data.dptr = (uint8_t *)&p4;
    12061236                data.dsize = sizeof(p4);
    12071237                break;
    1208 #ifdef HAVE_IPV6
     1238#ifdef HAVE_STRUCT_CTDB_CONTROL_TCP_ADDR
    12091239        case AF_INET6:
    1210                 p.dest.ip6 = *(struct sockaddr_in6 *)server;
    1211                 p.src.ip6 = *(struct sockaddr_in6 *)client;
     1240                p.dest.ip6 = *(struct sockaddr_in6 *)&server;
     1241                p.src.ip6 = *(struct sockaddr_in6 *)&client;
    12121242                data.dptr = (uint8_t *)&p;
    12131243                data.dsize = sizeof(p);
  • branches/samba-3.3.x/source/lib/events.c

    r206 r221  
    219219                int selrtn, fd_set *read_fds, fd_set *write_fds)
    220220{
    221         bool fired = False;
    222         struct fd_event *fde, *next;
    223 
    224         /* Run all events that are pending, not just one (as we
    225            did previously. */
    226 
    227         while (event_ctx->timed_events) {
    228                 struct timeval now;
    229                 GetTimeOfDay(&now);
    230 
    231                 if (timeval_compare(
    232                             &now, &event_ctx->timed_events->when) < 0) {
    233                         /* Nothing to do yet */
    234                         DEBUG(11, ("run_events: Nothing to do\n"));
    235                         break;
    236                 }
     221        struct fd_event *fde;
     222        struct timeval now;
     223
     224        GetTimeOfDay(&now);
     225
     226        if ((event_ctx->timed_events != NULL)
     227            && (timeval_compare(&now, &event_ctx->timed_events->when) >= 0)) {
    237228
    238229                DEBUG(10, ("Running event \"%s\" %lx\n",
     
    245236                        event_ctx->timed_events->private_data);
    246237
    247                 fired = True;
    248         }
    249 
    250         if (fired) {
    251                 /*
    252                  * We might have changed the socket status during the timed
    253                  * events, return to run select again.
    254                  */
    255                 return True;
     238                return true;
    256239        }
    257240
     
    260243                 * No fd ready
    261244                 */
    262                 return fired;
    263         }
    264 
    265         for (fde = event_ctx->fd_events; fde; fde = next) {
     245                return false;
     246        }
     247
     248        for (fde = event_ctx->fd_events; fde; fde = fde->next) {
    266249                uint16 flags = 0;
    267250
    268                 next = fde->next;
    269251                if (FD_ISSET(fde->fd, read_fds)) flags |= EVENT_FD_READ;
    270252                if (FD_ISSET(fde->fd, write_fds)) flags |= EVENT_FD_WRITE;
     
    272254                if (flags & fde->flags) {
    273255                        fde->handler(event_ctx, fde, flags, fde->private_data);
    274                         fired = True;
    275                 }
    276         }
    277 
    278         return fired;
     256                        return true;
     257                }
     258        }
     259
     260        return false;
    279261}
    280262
  • branches/samba-3.3.x/source/lib/interface.c

    r206 r221  
    152152
    153153/****************************************************************************
    154  Return a pointer to the in_addr of the first IPv4 interface.
     154 Return a pointer to the in_addr of the first IPv4 interface that's
     155 not 0.0.0.0.
    155156**************************************************************************/
    156157
     
    160161
    161162        for (i=local_interfaces;i ;i=i->next) {
    162                 if (i->ip.ss_family == AF_INET) {
     163                if ((i->ip.ss_family == AF_INET) &&
     164                    (!is_zero_ip_v4(((struct sockaddr_in *)&i->ip)->sin_addr)))
     165                {
    163166                        break;
    164167                }
  • branches/samba-3.3.x/source/lib/ldap_debug_handler.c

    r206 r221  
    2020#include "includes.h"
    2121
    22 #if HAVE_LDAP
    23 
     22#if defined(HAVE_LDAP) && defined(HAVE_LBER_LOG_PRINT_FN)
    2423static void samba_ldap_log_print_fn(LDAP_CONST char *data)
    2524{
    2625        DEBUG(lp_ldap_debug_threshold(), ("[LDAP] %s", data));
    2726}
    28 
    2927#endif
    3028
  • branches/samba-3.3.x/source/lib/replace/getifaddrs.c

    r206 r221  
    8585        int fd, i, n;
    8686        struct ifreq *ifr=NULL;
    87         struct in_addr ipaddr;
    88         struct in_addr nmask;
    89         char *iname;
    9087        struct ifaddrs *curif;
    9188        struct ifaddrs *lastif = NULL;
     
    165162        int fd, i, n;
    166163        struct ifreq *ifr=NULL;
    167         struct in_addr ipaddr;
    168         struct in_addr nmask;
    169         char *iname;
    170164        struct ifaddrs *curif;
    171165        struct ifaddrs *lastif = NULL;
     
    266260        struct ifconf ifc;
    267261        struct ifreq *ifr=NULL;
    268         struct in_addr ipaddr;
    269         struct in_addr nmask;
    270         char *iname;
    271262        struct ifaddrs *curif;
    272263        struct ifaddrs *lastif = NULL;
  • branches/samba-3.3.x/source/lib/replace/libreplace_ld.m4

    r206 r221  
    293293                        LIB_PATH_VAR=LD_LIBRARY_PATH
    294294                ;;
    295                 *netbsd*)
     295                *bsd*)
    296296                        LIB_PATH_VAR=LD_LIBRARY_PATH
    297297                ;;
  • branches/samba-3.3.x/source/lib/replace/libreplace_network.m4

    r206 r221  
    88
    99AC_CHECK_HEADERS(sys/socket.h netinet/in.h netdb.h arpa/inet.h)
    10 AC_CHECK_HEADERS(netinet/ip.h netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
     10AC_CHECK_HEADERS(netinet/in_systm.h)
     11AC_CHECK_HEADERS([netinet/ip.h], [], [], [#ifdef HAVE_NETINET_IN_H
     12#include <netinet/in.h>
     13#endif
     14#ifdef HAVE_NETINET_IN_SYSTM_H
     15#include <netinet/in_systm.h>
     16#endif])
     17AC_CHECK_HEADERS(netinet/tcp.h netinet/in_ip.h)
    1118AC_CHECK_HEADERS(sys/sockio.h sys/un.h)
    1219
     
    347354#include <sys/types.h>
    348355#include <netdb.h>
     356#include <netinet/in.h>
    349357                ],
    350358                [
  • branches/samba-3.3.x/source/lib/smbldap.c

    r206 r221  
    582582int smb_ldap_start_tls(LDAP *ldap_struct, int version)
    583583{
     584#ifdef LDAP_OPT_X_TLS
    584585        int rc;
     586#endif
    585587       
    586588        if (lp_ldap_ssl() != LDAP_SSL_START_TLS) {
  • branches/samba-3.3.x/source/lib/system.c

    r206 r221  
    22722272{
    22732273        ssize_t len = 0;
    2274         int stop = 0;
    22752274        DIR *dirp;
    22762275        struct dirent *de;
     
    23442343        int filedes = openat(fildes, path, oflag, mode);
    23452344        if (filedes == -1) {
    2346                 DEBUG(10,("openat FAILED: fd: %s, path: %s, errno: %s\n",filedes,path,strerror(errno)));
     2345                DEBUG(10,("openat FAILED: fd: %d, path: %s, errno: %s\n",filedes,path,strerror(errno)));
    23472346                if (errno == EINVAL) {
    23482347                        errno = ENOTSUP;
  • branches/samba-3.3.x/source/lib/time.c

    r206 r221  
    904904        ret.tv_nsec = pst->st_atimensec;
    905905        return ret;
     906#elif defined(HAVE_STAT_ST_ATIME_N)
     907        struct timespec ret;
     908        ret.tv_sec = pst->st_atime;
     909        ret.tv_nsec = pst->st_atime_n;
     910        return ret;
     911#elif defined(HAVE_STAT_ST_UATIME)
     912        struct timespec ret;
     913        ret.tv_sec = pst->st_atime;
     914        ret.tv_nsec = pst->st_uatime * 1000;
     915        return ret;
     916#elif defined(HAVE_STAT_ST_ATIMESPEC)
     917        return pst->st_atimespec;
    906918#else
    907919#error  CONFIGURE_ERROR_IN_DETECTING_TIMESPEC_IN_STAT
     
    920932#elif defined(HAVE_STAT_ST_ATIMENSEC)
    921933        pst->st_atime = ts.tv_sec;
    922         pst->st_atimensec = ts.tv_nsec
     934        pst->st_atimensec = ts.tv_nsec;
     935#elif defined(HAVE_STAT_ST_ATIME_N)
     936        pst->st_atime = ts.tv_sec;
     937        pst->st_atime_n = ts.tv_nsec;
     938#elif defined(HAVE_STAT_ST_UATIME)
     939        pst->st_atime = ts.tv_sec;
     940        pst->st_uatime = ts.tv_nsec / 1000;
     941#elif defined(HAVE_STAT_ST_ATIMESPEC)
     942        pst->st_atimespec = ts;
    923943#else
    924944#error  CONFIGURE_ERROR_IN_DETECTING_TIMESPEC_IN_STAT
     
    944964        ret.tv_nsec = pst->st_mtimensec;
    945965        return ret;
     966#elif defined(HAVE_STAT_ST_MTIME_N)
     967        struct timespec ret;
     968        ret.tv_sec = pst->st_mtime;
     969        ret.tv_nsec = pst->st_mtime_n;
     970        return ret;
     971#elif defined(HAVE_STAT_ST_UMTIME)
     972        struct timespec ret;
     973        ret.tv_sec = pst->st_mtime;
     974        ret.tv_nsec = pst->st_umtime * 1000;
     975        return ret;
     976#elif defined(HAVE_STAT_ST_MTIMESPEC)
     977        return pst->st_mtimespec;
    946978#else
    947979#error  CONFIGURE_ERROR_IN_DETECTING_TIMESPEC_IN_STAT
     
    960992#elif defined(HAVE_STAT_ST_MTIMENSEC)
    961993        pst->st_mtime = ts.tv_sec;
    962         pst->st_mtimensec = ts.tv_nsec
     994        pst->st_mtimensec = ts.tv_nsec;
     995#elif defined(HAVE_STAT_ST_MTIME_N)
     996        pst->st_mtime = ts.tv_sec;
     997        pst->st_mtime_n = ts.tv_nsec;
     998#elif defined(HAVE_STAT_ST_UMTIME)
     999        pst->st_mtime = ts.tv_sec;
     1000        pst->st_umtime = ts.tv_nsec / 1000;
     1001#elif defined(HAVE_STAT_ST_MTIMESPEC)
     1002        pst->st_mtimespec = ts;
    9631003#else
    9641004#error  CONFIGURE_ERROR_IN_DETECTING_TIMESPEC_IN_STAT
     
    9841024        ret.tv_nsec = pst->st_ctimensec;
    9851025        return ret;
     1026#elif defined(HAVE_STAT_ST_CTIME_N)
     1027        struct timespec ret;
     1028        ret.tv_sec = pst->st_ctime;
     1029        ret.tv_nsec = pst->st_ctime_n;
     1030        return ret;
     1031#elif defined(HAVE_STAT_ST_UCTIME)
     1032        struct timespec ret;
     1033        ret.tv_sec = pst->st_ctime;
     1034        ret.tv_nsec = pst->st_uctime * 1000;
     1035        return ret;
     1036#elif defined(HAVE_STAT_ST_CTIMESPEC)
     1037        return pst->st_ctimespec;
    9861038#else
    9871039#error  CONFIGURE_ERROR_IN_DETECTING_TIMESPEC_IN_STAT
     
    10001052#elif defined(HAVE_STAT_ST_CTIMENSEC)
    10011053        pst->st_ctime = ts.tv_sec;
    1002         pst->st_ctimensec = ts.tv_nsec
     1054        pst->st_ctimensec = ts.tv_nsec;
     1055#elif defined(HAVE_STAT_ST_CTIME_N)
     1056        pst->st_ctime = ts.tv_sec;
     1057        pst->st_ctime_n = ts.tv_nsec;
     1058#elif defined(HAVE_STAT_ST_UCTIME)
     1059        pst->st_ctime = ts.tv_sec;
     1060        pst->st_uctime = ts.tv_nsec / 1000;
     1061#elif defined(HAVE_STAT_ST_CTIMESPEC)
     1062        pst->st_ctimespec = ts;
    10031063#else
    10041064#error  CONFIGURE_ERROR_IN_DETECTING_TIMESPEC_IN_STAT
  • branches/samba-3.3.x/source/lib/util_file.c

    r206 r221  
    102102****************************************************************************/
    103103
    104 static char *file_pload(char *syscmd, size_t *size)
     104static char *file_pload(const char *syscmd, size_t *size)
    105105{
    106106        int fd, n;
     
    352352****************************************************************************/
    353353
    354 char **file_lines_pload(char *syscmd, int *numlines)
     354char **file_lines_pload(const char *syscmd, int *numlines)
    355355{
    356356        char *p;
  • branches/samba-3.3.x/source/lib/util_seaccess.c

    r206 r221  
    150150
    151151/*
    152   the main entry point for access checking.
     152  The main entry point for access checking. If returning ACCESS_DENIED
     153  this function returns the denied bits in the uint32_t pointed
     154  to by the access_granted pointer.
    153155*/
    154156NTSTATUS se_access_check(const struct security_descriptor *sd,
     
    239241done:
    240242        if (bits_remaining != 0) {
     243                *access_granted = bits_remaining;
    241244                return NT_STATUS_ACCESS_DENIED;
    242245        }
  • branches/samba-3.3.x/source/lib/util_tdb.c

    r206 r221  
    10981098        /* parent */
    10991099
    1100         DEBUG(10, ("tdb_validate: fork succeeded, child PID = %d\n",child_pid));
     1100        DEBUG(10, ("tdb_validate: fork succeeded, child PID = %u\n",
     1101                (unsigned int)child_pid));
    11011102
    11021103        DEBUG(10, ("tdb_validate: waiting for child to finish...\n"));
     
    11141115        if (wait_pid != child_pid) {
    11151116                DEBUG(1, ("tdb_validate: waitpid returned pid %d, "
    1116                           "but %d was expected\n", wait_pid, child_pid));
     1117                          "but %u was expected\n", wait_pid,
     1118                        (unsigned int)child_pid));
    11171119                goto done;
    11181120        }
Note: See TracChangeset for help on using the changeset viewer.