Ignore:
Timestamp:
May 27, 2009, 11:39:15 AM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update 3.2 branch to 3.2.9

Location:
branches/samba-3.2.x/source/lib
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.2.x/source/lib/dbwrap.c

    r133 r233  
    4343}
    4444
     45bool db_is_local(const char *name)
     46{
     47#ifdef CLUSTER_SUPPORT
     48        const char *sockname = lp_ctdbd_socket();
     49
     50        if(!sockname || !*sockname) {
     51                sockname = CTDB_PATH;
     52        }
     53
     54        if (lp_clustering() && socket_exist(sockname)) {
     55                const char *partname;
     56                /* ctdb only wants the file part of the name */
     57                partname = strrchr(name, '/');
     58                if (partname) {
     59                        partname++;
     60                } else {
     61                        partname = name;
     62                }
     63                /* allow ctdb for individual databases to be disabled */
     64                if (lp_parm_bool(-1, "ctdb", partname, True)) {
     65                        return false;
     66                }
     67        }
     68#endif
     69        return true;
     70}
     71
    4572/**
    4673 * If you need transaction support use db_open_trans()
  • branches/samba-3.2.x/source/lib/interface.c

    r228 r233  
    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.2.x/source/lib/interfaces.c

    r133 r233  
    1919*/
    2020
    21 
    22 /* working out the interfaces for a OS is an incredibly non-portable
    23    thing. We have several possible implementations below, and autoconf
    24    tries each of them to see what works
    25 
    26    Note that this file does _not_ include includes.h. That is so this code
    27    can be called directly from the autoconf tests. That also means
    28    this code cannot use any of the normal Samba debug stuff or defines.
    29    This is standalone code.
    30 
    31 */
    32 
    33 #ifndef AUTOCONF_TEST
    34 #include "config.h"
    35 #endif
    36 
    37 #include <unistd.h>
    38 #include <stdio.h>
    39 #include <sys/types.h>
    40 #include <netdb.h>
    41 #include <sys/ioctl.h>
    42 #include <netdb.h>
    43 #include <sys/ioctl.h>
    44 #include <sys/time.h>
    45 #include <sys/socket.h>
    46 #include <netinet/in.h>
    47 #include <arpa/inet.h>
    48 
    49 #ifdef HAVE_IFADDRS_H
    50 #include <ifaddrs.h>
    51 #endif
    52 
    53 #ifdef HAVE_SYS_TIME_H
    54 #include <sys/time.h>
    55 #endif
    56 
    57 #ifndef SIOCGIFCONF
    58 #ifdef HAVE_SYS_SOCKIO_H
    59 #include <sys/sockio.h>
    60 #endif
    61 #endif
    62 
    63 #ifdef HAVE_STDLIB_H
    64 #include <stdlib.h>
    65 #endif
    66 
    67 #ifdef HAVE_STRING_H
    68 #include <string.h>
    69 #endif
    70 
    71 #ifdef HAVE_STRINGS_H
    72 #include <strings.h>
    73 #endif
    74 
    75 #ifdef __COMPAR_FN_T
    76 #define QSORT_CAST (__compar_fn_t)
    77 #endif
    78 
    79 #ifndef QSORT_CAST
    80 #define QSORT_CAST (int (*)(const void *, const void *))
    81 #endif
    82 
    83 #ifdef HAVE_NET_IF_H
    84 #include <net/if.h>
    85 #endif
    86 
    87 #define SOCKET_WRAPPER_NOT_REPLACE
    88 #include "interfaces.h"
    89 #include "lib/replace/replace.h"
    90 
    91 /****************************************************************************
    92  Utility functions.
    93 ****************************************************************************/
     21#include "includes.h"
    9422
    9523/****************************************************************************
  • branches/samba-3.2.x/source/lib/messages.c

    r133 r233  
    279279
    280280        for (cb = msg_ctx->callbacks; cb != NULL; cb = cb->next) {
    281                 if (cb->msg_type == msg_type) {
     281                /* we allow a second registration of the same message
     282                   type if it has a different private pointer. This is
     283                   needed in, for example, the internal notify code,
     284                   which creates a new notify context for each tree
     285                   connect, and expects to receive messages to each of
     286                   them. */
     287                if (cb->msg_type == msg_type && private_data == cb->private_data) {
     288                        DEBUG(5,("Overriding messaging pointer for type %u - private_data=%p\n",
     289                                  (unsigned)msg_type, private_data));
    282290                        cb->fn = fn;
    283291                        cb->private_data = private_data;
     
    310318                if ((cb->msg_type == msg_type)
    311319                    && (cb->private_data == private_data)) {
     320                        DEBUG(5,("Deregistering messaging pointer for type %u - private_data=%p\n",
     321                                  (unsigned)msg_type, private_data));
    312322                        DLIST_REMOVE(ctx->callbacks, cb);
    313323                        TALLOC_FREE(cb);
     
    355365                        cb->fn(msg_ctx, cb->private_data, rec->msg_type,
    356366                               rec->src, &rec->buf);
    357                         return;
     367                        /* we continue looking for matching messages
     368                           after finding one. This matters for
     369                           subsystems like the internal notify code
     370                           which register more than one handler for
     371                           the same message type */
    358372                }
    359373        }
  • branches/samba-3.2.x/source/lib/netapi/user.c

    r133 r233  
    900900        NTSTATUS status;
    901901        WERROR werr;
     902        WERROR werr_tmp;
     903
     904        *r->out.entries_read = 0;
    902905
    903906        ZERO_STRUCT(connect_handle);
     
    993996                                               &returned_size,
    994997                                               &info);
    995         if (!NT_STATUS_IS_OK(status)) {
    996                 werr = ntstatus_to_werror(status);
    997                 goto done;
    998         }
    999 
    1000         werr = convert_samr_dispinfo_to_NET_DISPLAY(ctx, &info,
    1001                                                     r->in.level,
    1002                                                     r->out.entries_read,
    1003                                                     r->out.buffer);
     998        werr = ntstatus_to_werror(status);
     999        if (NT_STATUS_IS_ERR(status)) {
     1000                goto done;
     1001        }
     1002
     1003        werr_tmp = convert_samr_dispinfo_to_NET_DISPLAY(ctx, &info,
     1004                                                        r->in.level,
     1005                                                        r->out.entries_read,
     1006                                                        r->out.buffer);
     1007        if (!W_ERROR_IS_OK(werr_tmp)) {
     1008                werr = werr_tmp;
     1009        }
    10041010 done:
    10051011        if (!cli) {
  • branches/samba-3.2.x/source/lib/replace/libreplace_ld.m4

    r136 r233  
    293293                        LIB_PATH_VAR=LD_LIBRARY_PATH
    294294                ;;
    295                 *netbsd*)
     295                *bsd*)
    296296                        LIB_PATH_VAR=LD_LIBRARY_PATH
    297297                ;;
  • branches/samba-3.2.x/source/lib/util.c

    r232 r233  
    10581058        }
    10591059
     1060        if (ev_ctx) {
     1061                event_context_reinit(ev_ctx);
     1062        }
     1063
    10601064        if (msg_ctx) {
    10611065                /*
     
    10691073                        return false;
    10701074                }
    1071         }
    1072 
    1073         if (ev_ctx) {
    1074                 event_context_reinit(ev_ctx);
    10751075        }
    10761076
Note: See TracChangeset for help on using the changeset viewer.