Changeset 860 for vendor/current/lib


Ignore:
Timestamp:
May 12, 2014, 8:58:38 PM (11 years ago)
Author:
Silvan Scherrer
Message:

Samba 3.6: updated vendor to latest version

Location:
vendor/current/lib
Files:
4 added
16 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/lib/addns/dnsgss.c

    r740 r860  
    165165                        struct dns_buffer *buf;
    166166                        struct dns_tkey_record *tkey;
     167                        struct dns_rrec *tkey_answer = NULL;
     168                        uint16_t i;
    167169
    168170                        err = dns_receive(mem_ctx, conn, &buf);
     
    175177                         * TODO: Compare id and keyname
    176178                         */
    177                        
    178                         if ((resp->num_additionals != 1) ||
    179                             (resp->num_answers == 0) ||
    180                             (resp->answers[0]->type != QTYPE_TKEY)) {
     179
     180                        for (i=0; i < resp->num_answers; i++) {
     181                                if (resp->answers[i]->type != QTYPE_TKEY) {
     182                                        continue;
     183                                }
     184
     185                                tkey_answer = resp->answers[i];
     186                        }
     187
     188                        if (tkey_answer == NULL) {
    181189                                err = ERROR_DNS_INVALID_MESSAGE;
    182190                                goto error;
  • vendor/current/lib/async_req/async_sock.c

    r746 r860  
    636636        }
    637637
     638        if (total + more < total) {
     639                tevent_req_error(req, EMSGSIZE);
     640                return;
     641        }
     642
    638643        tmp = talloc_realloc(state, state->buf, uint8_t, total+more);
    639644        if (tevent_req_nomem(tmp, req)) {
  • vendor/current/lib/replace/getifaddrs.c

    r740 r860  
    55   Copyright (C) Jeremy Allison 2007
    66   Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007
    7    
    8    This program is free software; you can redistribute it and/or modify
    9    it under the terms of the GNU General Public License as published by
    10    the Free Software Foundation; either version 3 of the License, or
    11    (at your option) any later version.
    12    
    13    This program is distributed in the hope that it will be useful,
     7
     8     ** NOTE! The following LGPL license applies to the replace
     9     ** library. This does NOT imply that all of Samba is released
     10     ** under the LGPL
     11
     12   This library is free software; you can redistribute it and/or
     13   modify it under the terms of the GNU Lesser General Public
     14   License as published by the Free Software Foundation; either
     15   version 3 of the License, or (at your option) any later version.
     16
     17   This library is distributed in the hope that it will be useful,
    1418   but WITHOUT ANY WARRANTY; without even the implied warranty of
    15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16    GNU General Public License for more details.
    17    
    18    You should have received a copy of the GNU General Public License
    19    along with this program.  If not, see <http://www.gnu.org/licenses/>.
     19   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     20   Library General Public License for more details.
     21
     22   You should have received a copy of the GNU Lesser General Public
     23   License along with this library; if not, see <http://www.gnu.org/licenses/>.
    2024*/
    2125
  • vendor/current/lib/replace/libreplace.m4

    r740 r860  
    6767
    6868AC_CHECK_HEADERS(stdbool.h stdint.h sys/select.h)
    69 AC_CHECK_HEADERS(setjmp.h utime.h)
     69AC_CHECK_HEADERS(setjmp.h utime.h sys/wait.h)
    7070
    7171LIBREPLACE_PROVIDE_HEADER([stdint.h])
     
    106106AC_CHECK_HEADERS(stropts.h)
    107107AC_CHECK_HEADERS(unix.h)
     108AC_CHECK_HEADERS(sys/ucontext.h)
    108109
    109110AC_CHECK_FUNCS(seteuid setresuid setegid setresgid chroot bzero strerror strerror_r)
     
    267268
    268269
     270dnl Check if the C compiler understands volatile (it should, being ANSI).
     271AC_CACHE_CHECK([that the C compiler understands volatile],libreplace_cv_volatile, [
     272        AC_TRY_COMPILE([#include <sys/types.h>],[volatile int i = 0],
     273                libreplace_cv_volatile=yes,libreplace_cv_volatile=no)])
     274if test x"$libreplace_cv_volatile" = x"yes"; then
     275        AC_DEFINE(HAVE_VOLATILE, 1, [Whether the C compiler understands volatile])
     276fi
     277
     278m4_include(system/config.m4)
     279
    269280AC_CACHE_CHECK([for O_DIRECT flag to open(2)],libreplace_cv_HAVE_OPEN_O_DIRECT,[
    270281AC_TRY_COMPILE([
     
    278289    AC_DEFINE(HAVE_OPEN_O_DIRECT,1,[Whether the open(2) accepts O_DIRECT])
    279290fi
    280 
    281 
    282 dnl Check if the C compiler understands volatile (it should, being ANSI).
    283 AC_CACHE_CHECK([that the C compiler understands volatile],libreplace_cv_volatile, [
    284         AC_TRY_COMPILE([#include <sys/types.h>],[volatile int i = 0],
    285                 libreplace_cv_volatile=yes,libreplace_cv_volatile=no)])
    286 if test x"$libreplace_cv_volatile" = x"yes"; then
    287         AC_DEFINE(HAVE_VOLATILE, 1, [Whether the C compiler understands volatile])
    288 fi
    289 
    290 m4_include(system/config.m4)
    291291
    292292m4_include(dlfcn.m4)
     
    325325if test x"$libreplace_cv_struct_timespec" = x"yes"; then
    326326   AC_DEFINE(HAVE_STRUCT_TIMESPEC,1,[Whether we have struct timespec])
     327fi
     328
     329AC_CACHE_CHECK([for ucontext_t type],libreplace_cv_ucontext_t, [
     330    AC_TRY_COMPILE([
     331#include <signal.h>
     332#if HAVE_SYS_UCONTEXT_H
     333#include <sys/ucontext.h>
     334# endif
     335],[ucontext_t uc; sigaddset(&uc.uc_sigmask, SIGUSR1);],
     336    libreplace_cv_ucontext_t=yes,libreplace_cv_ucontext_t=no)])
     337if test x"$libreplace_cv_ucontext_t" = x"yes"; then
     338    AC_DEFINE(HAVE_UCONTEXT_T,1,[Whether we have ucontext_t])
    327339fi
    328340
  • vendor/current/lib/replace/libreplace_macros.m4

    r740 r860  
    299299        ])
    300300)
    301 AS_IF([test $AS_TR_SH([ac_cv_c_prototype_$1]) = yes],[$3],[$4])
     301AS_IF([eval test $AS_TR_SH([ac_cv_c_prototype_$1]) = yes],[$3],[$4])
    302302])
    303303
  • vendor/current/lib/replace/replace.c

    r740 r860  
    751751#endif
    752752
    753 #ifndef HAVE_VDPRINTF
     753#if !defined(HAVE_VDPRINTF) || !defined(HAVE_C99_VSNPRINTF)
    754754int rep_vdprintf(int fd, const char *format, va_list ap)
    755755{
     
    768768#endif
    769769
    770 #ifndef HAVE_DPRINTF
     770#if !defined(HAVE_DPRINTF) || !defined(HAVE_C99_VSNPRINTF)
    771771int rep_dprintf(int fd, const char *format, ...)
    772772{
  • vendor/current/lib/replace/replace.h

    r746 r860  
    356356#endif
    357357
    358 #ifndef HAVE_VDPRINTF
    359 #define vdprintf rep_vdprintf
    360 int rep_vdprintf(int fd, const char *format, va_list ap);
    361 #endif
    362 
    363 #ifndef HAVE_DPRINTF
    364 #define dprintf rep_dprintf
    365 int rep_dprintf(int fd, const char *format, ...);
    366 #endif
    367 
    368358#ifndef PRINTF_ATTRIBUTE
    369359#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
     
    386376#endif
    387377
    388 #ifndef HAVE_VASPRINTF
     378#if !defined(HAVE_VDPRINTF) || !defined(HAVE_C99_VSNPRINTF)
     379#define vdprintf rep_vdprintf
     380int rep_vdprintf(int fd, const char *format, va_list ap) PRINTF_ATTRIBUTE(2,0);
     381#endif
     382
     383#if !defined(HAVE_DPRINTF) || !defined(HAVE_C99_VSNPRINTF)
     384#define dprintf rep_dprintf
     385int rep_dprintf(int fd, const char *format, ...) PRINTF_ATTRIBUTE(2,3);
     386#endif
     387
     388#if !defined(HAVE_VASPRINTF) || !defined(HAVE_C99_VSNPRINTF)
    389389#define vasprintf rep_vasprintf
    390390int rep_vasprintf(char **ptr, const char *format, va_list ap) PRINTF_ATTRIBUTE(2,0);
     
    401401#endif
    402402
    403 #ifndef HAVE_ASPRINTF
     403#if !defined(HAVE_ASPRINTF) || !defined(HAVE_C99_VSNPRINTF)
    404404#define asprintf rep_asprintf
    405405int rep_asprintf(char **,const char *, ...) PRINTF_ATTRIBUTE(2,3);
     406#endif
     407
     408#if !defined(HAVE_C99_VSNPRINTF)
     409#ifdef REPLACE_BROKEN_PRINTF
     410/*
     411 * We do not redefine printf by default
     412 * as it breaks the build if system headers
     413 * use __attribute__((format(printf, 3, 0)))
     414 * instead of __attribute__((format(__printf__, 3, 0)))
     415 */
     416#define printf rep_printf
     417#endif
     418int rep_printf(const char *, ...) PRINTF_ATTRIBUTE(1,2);
     419#endif
     420
     421#if !defined(HAVE_C99_VSNPRINTF)
     422#define fprintf rep_fprintf
     423int rep_fprintf(FILE *stream, const char *, ...) PRINTF_ATTRIBUTE(2,3);
    406424#endif
    407425
  • vendor/current/lib/replace/snprintf.c

    r414 r860  
    11881188}
    11891189
    1190  int vsnprintf (char *str, size_t count, const char *fmt, va_list args)
     1190 int rep_vsnprintf (char *str, size_t count, const char *fmt, va_list args)
    11911191{
    11921192        return dopr(str, count, fmt, args);
     
    12011201 */
    12021202#if !defined(HAVE_SNPRINTF) || !defined(HAVE_C99_VSNPRINTF)
    1203  int snprintf(char *str,size_t count,const char *fmt,...)
     1203 int rep_snprintf(char *str,size_t count,const char *fmt,...)
    12041204{
    12051205        size_t ret;
     
    12141214
    12151215#ifndef HAVE_C99_VSNPRINTF
    1216  int printf(const char *fmt, ...)
     1216 int rep_printf(const char *fmt, ...)
    12171217{
    12181218        va_list ap;
     
    12351235
    12361236#ifndef HAVE_C99_VSNPRINTF
    1237  int fprintf(FILE *stream, const char *fmt, ...)
     1237 int rep_fprintf(FILE *stream, const char *fmt, ...)
    12381238{
    12391239        va_list ap;
     
    12571257#endif
    12581258
    1259 #ifndef HAVE_VASPRINTF
    1260  int vasprintf(char **ptr, const char *format, va_list ap)
     1259#if !defined(HAVE_VASPRINTF) || !defined(HAVE_C99_VSNPRINTF)
     1260 int rep_vasprintf(char **ptr, const char *format, va_list ap)
    12611261{
    12621262        int ret;
     
    12791279#endif
    12801280
    1281 
    1282 #ifndef HAVE_ASPRINTF
    1283  int asprintf(char **ptr, const char *format, ...)
     1281#if !defined(HAVE_ASPRINTF) || !defined(HAVE_C99_VSNPRINTF)
     1282 int rep_asprintf(char **ptr, const char *format, ...)
    12841283{
    12851284        va_list ap;
  • vendor/current/lib/replace/socket.c

    r414 r860  
    66 * Copyright (C) Michael Adam <obnox@samba.org> 2008
    77 *
    8  * This program is free software; you can redistribute it and/or modify
    9  * it under the terms of the GNU General Public License as published by
    10  * the Free Software Foundation; either version 3 of the License, or
    11  * (at your option) any later version.
     8 *   ** NOTE! The following LGPL license applies to the replace
     9 *   ** library. This does NOT imply that all of Samba is released
     10 *   ** under the LGPL
    1211 *
    13  * This program is distributed in the hope that it will be useful,
     12 * This library is free software; you can redistribute it and/or
     13 * modify it under the terms of the GNU Lesser General Public
     14 * License as published by the Free Software Foundation; either
     15 * version 3 of the License, or (at your option) any later version.
     16 *
     17 * This library is distributed in the hope that it will be useful,
    1418 * but WITHOUT ANY WARRANTY; without even the implied warranty of
    15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16  * GNU General Public License for more details.
     19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     20 * Library General Public License for more details.
    1721 *
    18  * You should have received a copy of the GNU General Public License
    19  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
     22 * You should have received a copy of the GNU Lesser General Public
     23 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
    2024 */
    2125
  • vendor/current/lib/replace/system/wait.h

    r740 r860  
    4141#endif
    4242
     43#ifdef HAVE_SYS_UCONTEXT_H
     44#include <sys/ucontext.h>
     45#endif
     46
    4347#if !defined(HAVE_SIG_ATOMIC_T_TYPE)
    4448typedef int sig_atomic_t;
  • vendor/current/lib/replace/test/getifaddrs.c

    r414 r860  
    66 * Copyright (C) Michael Adam <obnox@samba.org> 2008
    77 *
    8  *  This program is free software; you can redistribute it and/or modify
    9  *  it under the terms of the GNU General Public License as published by
    10  *  the Free Software Foundation; either version 3 of the License, or
    11  *  (at your option) any later version.
     8 *   ** NOTE! The following LGPL license applies to the replace
     9 *   ** library. This does NOT imply that all of Samba is released
     10 *   ** under the LGPL
    1211 *
    13  *  This program is distributed in the hope that it will be useful,
    14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16  *  GNU General Public License for more details.
     12 * This library is free software; you can redistribute it and/or
     13 * modify it under the terms of the GNU Lesser General Public
     14 * License as published by the Free Software Foundation; either
     15 * version 3 of the License, or (at your option) any later version.
    1716 *
    18  *  You should have received a copy of the GNU General Public License
    19  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
     17 * This library is distributed in the hope that it will be useful,
     18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     20 * Library General Public License for more details.
     21 *
     22 * You should have received a copy of the GNU Lesser General Public
     23 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
    2024 */
    2125
  • vendor/current/lib/tevent/tevent_signal.c

    r740 r860  
    123123                /* we've filled the info array - block this signal until
    124124                   these ones are delivered */
     125#ifdef HAVE_UCONTEXT_T
     126                /*
     127                 * This is the only way for this to work.
     128                 * By default signum is blocked inside this
     129                 * signal handler using a temporary mask,
     130                 * but what we really need to do now is
     131                 * block it in the callers mask, so it
     132                 * stays blocked when the temporary signal
     133                 * handler mask is replaced when we return
     134                 * from here. The callers mask can be found
     135                 * in the ucontext_t passed in as the
     136                 * void *uctx argument.
     137                 */
     138                ucontext_t *ucp = (ucontext_t *)uctx;
     139                sigaddset(&ucp->uc_sigmask, signum);
     140#else
     141                /*
     142                 * WARNING !!! WARNING !!!!
     143                 *
     144                 * This code doesn't work.
     145                 * By default signum is blocked inside this
     146                 * signal handler, but calling sigprocmask
     147                 * modifies the temporary signal mask being
     148                 * used *inside* this handler, which will be
     149                 * replaced by the callers signal mask once
     150                 * we return from here. See Samba
     151                 * bug #9550 for details.
     152                 */
    125153                sigset_t set;
    126154                sigemptyset(&set);
    127155                sigaddset(&set, signum);
    128156                sigprocmask(SIG_BLOCK, &set, NULL);
     157#endif
    129158                TEVENT_SIG_INCREMENT(sig_state->sig_blocked[signum]);
    130159        }
  • vendor/current/lib/tsocket/tsocket.h

    r740 r860  
    627627char *tsocket_address_unix_path(const struct tsocket_address *addr,
    628628                                TALLOC_CTX *mem_ctx);
     629
     630/**
     631 * @brief Request a syscall optimization for tdgram_recvfrom_send()
     632 *
     633 * This function is only used to reduce the amount of syscalls and
     634 * optimize performance. You should only use this if you know
     635 * what you're doing.
     636 *
     637 * The optimization is off by default.
     638 *
     639 * @param[in]  dgram    The tdgram_context of a bsd socket, if this
     640 *                      not a bsd socket the function does nothing.
     641 *
     642 * @param[in]  on       The boolean value to turn the optimization on and off.
     643 *
     644 * @return              The old boolean value.
     645 *
     646 * @see tdgram_recvfrom_send()
     647 */
     648bool tdgram_bsd_optimize_recvfrom(struct tdgram_context *dgram,
     649                                  bool on);
    629650
    630651#ifdef DOXYGEN
     
    688709        _tdgram_unix_socket(local, remote, mem_ctx, dgram, __location__)
    689710#endif
     711
     712/**
     713 * @brief Request a syscall optimization for tstream_readv_send()
     714 *
     715 * This function is only used to reduce the amount of syscalls and
     716 * optimize performance. You should only use this if you know
     717 * what you're doing.
     718 *
     719 * The optimization is off by default.
     720 *
     721 * @param[in]  stream   The tstream_context of a bsd socket, if this
     722 *                      not a bsd socket the function does nothing.
     723 *
     724 * @param[in]  on       The boolean value to turn the optimization on and off.
     725 *
     726 * @return              The old boolean value.
     727 *
     728 * @see tstream_readv_send()
     729 */
     730bool tstream_bsd_optimize_readv(struct tstream_context *stream,
     731                                bool on);
    690732
    691733/**
  • vendor/current/lib/tsocket/tsocket_bsd.c

    r740 r860  
    655655        void *event_ptr;
    656656        struct tevent_fd *fde;
     657        bool optimize_recvfrom;
    657658
    658659        void *readable_private;
     
    661662        void (*writeable_handler)(void *private_data);
    662663};
     664
     665bool tdgram_bsd_optimize_recvfrom(struct tdgram_context *dgram,
     666                                  bool on)
     667{
     668        struct tdgram_bsd *bsds =
     669                talloc_get_type(_tdgram_context_data(dgram),
     670                struct tdgram_bsd);
     671        bool old;
     672
     673        if (bsds == NULL) {
     674                /* not a bsd socket */
     675                return false;
     676        }
     677
     678        old = bsds->optimize_recvfrom;
     679        bsds->optimize_recvfrom = on;
     680
     681        return old;
     682}
    663683
    664684static void tdgram_bsd_fde_handler(struct tevent_context *ev,
     
    838858        }
    839859
     860
    840861        /*
    841862         * this is a fast path, not waiting for the
     
    843864         * about 10%-20% performance in benchmark tests.
    844865         */
    845         tdgram_bsd_recvfrom_handler(req);
    846         if (!tevent_req_is_in_progress(req)) {
    847                 goto post;
     866        if (bsds->optimize_recvfrom) {
     867                /*
     868                 * We only do the optimization on
     869                 * recvfrom if the caller asked for it.
     870                 *
     871                 * This is needed because in most cases
     872                 * we preferr to flush send buffers before
     873                 * receiving incoming requests.
     874                 */
     875                tdgram_bsd_recvfrom_handler(req);
     876                if (!tevent_req_is_in_progress(req)) {
     877                        goto post;
     878                }
    848879        }
    849880
     
    14011432        void *event_ptr;
    14021433        struct tevent_fd *fde;
     1434        bool optimize_readv;
    14031435
    14041436        void *readable_private;
     
    14071439        void (*writeable_handler)(void *private_data);
    14081440};
     1441
     1442bool tstream_bsd_optimize_readv(struct tstream_context *stream,
     1443                                bool on)
     1444{
     1445        struct tstream_bsd *bsds =
     1446                talloc_get_type(_tstream_context_data(stream),
     1447                struct tstream_bsd);
     1448        bool old;
     1449
     1450        if (bsds == NULL) {
     1451                /* not a bsd socket */
     1452                return false;
     1453        }
     1454
     1455        old = bsds->optimize_readv;
     1456        bsds->optimize_readv = on;
     1457
     1458        return old;
     1459}
    14091460
    14101461static void tstream_bsd_fde_handler(struct tevent_context *ev,
     
    16201671         * about 10%-20% performance in benchmark tests.
    16211672         */
    1622         tstream_bsd_readv_handler(req);
    1623         if (!tevent_req_is_in_progress(req)) {
    1624                 goto post;
     1673        if (bsds->optimize_readv) {
     1674                /*
     1675                 * We only do the optimization on
     1676                 * readv if the caller asked for it.
     1677                 *
     1678                 * This is needed because in most cases
     1679                 * we preferr to flush send buffers before
     1680                 * receiving incoming requests.
     1681                 */
     1682                tstream_bsd_readv_handler(req);
     1683                if (!tevent_req_is_in_progress(req)) {
     1684                        goto post;
     1685                }
    16251686        }
    16261687
  • vendor/current/lib/tsocket/tsocket_helpers.c

    r478 r860  
    213213        size_t i;
    214214        struct tevent_req *subreq;
     215        bool optimize = false;
     216        bool save_optimize = false;
     217
     218        if (state->count > 0) {
     219                /*
     220                 * This is not the first time we asked for a vector,
     221                 * which means parts of the pdu already arrived.
     222                 *
     223                 * In this case it make sense to enable
     224                 * a syscall/performance optimization if the
     225                 * low level tstream implementation supports it.
     226                 */
     227                optimize = true;
     228        }
    215229
    216230        TALLOC_FREE(state->vector);
     
    256270        }
    257271
     272        if (optimize) {
     273                /*
     274                 * If the low level stream is a bsd socket
     275                 * we will get syscall optimization.
     276                 *
     277                 * If it is not a bsd socket
     278                 * tstream_bsd_optimize_readv() just returns.
     279                 */
     280                save_optimize = tstream_bsd_optimize_readv(state->caller.stream,
     281                                                           true);
     282        }
    258283        subreq = tstream_readv_send(state,
    259284                                    state->caller.ev,
     
    261286                                    state->vector,
    262287                                    state->count);
     288        if (optimize) {
     289                tstream_bsd_optimize_readv(state->caller.stream,
     290                                           save_optimize);
     291        }
    263292        if (tevent_req_nomem(subreq, req)) {
    264293                return;
  • vendor/current/lib/util/debug.c

    r746 r860  
    954954                                 sizeof(header_str) -1 - hs_len,
    955955                                 ", class=%s",
    956                                  default_classname_table[cls]);
     956                                 classname_table[cls]);
    957957                }
    958958
Note: See TracChangeset for help on using the changeset viewer.