Ignore:
Timestamp:
Nov 24, 2016, 1:14:11 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/include/includes.h

    r740 r988  
    2323#include "../replace/replace.h"
    2424
    25 #if _SAMBA_BUILD_ == 4
    26 # undef _SAMBA_BUILD_
    27 # define _SAMBA_BUILD_ 3
    28 #endif
    29 
    3025/* make sure we have included the correct config.h */
    3126#ifndef NO_CONFIG_H /* for some tests */
     
    143138#endif
    144139
    145 /* mutually exclusive (SuSE 8.2) */
    146 #if HAVE_ATTR_XATTR_H
    147 #include <attr/xattr.h>
    148 #elif HAVE_SYS_XATTR_H
    149 #include <sys/xattr.h>
    150 #endif
    151 
    152 #ifdef HAVE_SYS_EA_H
    153 #include <sys/ea.h>
    154 #endif
    155 
    156 #ifdef HAVE_SYS_EXTATTR_H
    157 #include <sys/extattr.h>
    158 #endif
    159 
    160140#ifdef HAVE_SYS_UIO_H
    161141#include <sys/uio.h>
     
    168148#if HAVE_NETGROUP_H
    169149#include <netgroup.h>
    170 #endif
    171 
    172 #if defined(HAVE_AIO_H) && defined(WITH_AIO)
    173 #include <aio.h>
    174150#endif
    175151
     
    202178
    203179/*
    204    Samba needs type definitions for int16, int32, uint16 and uint32.
    205 
    206    Normally these are signed and unsigned 16 and 32 bit integers, but
    207    they actually only need to be at least 16 and 32 bits
    208    respectively. Thus if your word size is 8 bytes just defining them
    209    as signed and unsigned int will work.
    210 */
    211 
    212 #ifndef uint8
    213 #define uint8 uint8_t
    214 #endif
    215 
    216 #if !defined(int16) && !defined(HAVE_INT16_FROM_RPC_RPC_H)
    217 #  define int16 int16_t
    218    /* needed to work around compile issue on HP-UX 11.x */
    219 #  define _INT16        1
    220 #endif
    221 
    222 /*
    223  * Note we duplicate the size tests in the unsigned
    224  * case as int16 may be a typedef from rpc/rpc.h
    225  */
    226 
    227 
    228 #if !defined(uint16) && !defined(HAVE_UINT16_FROM_RPC_RPC_H)
    229 #  define uint16 uint16_t
    230 #endif
    231 
    232 #if !defined(int32) && !defined(HAVE_INT32_FROM_RPC_RPC_H)
    233 #  define int32 int32_t
    234 #  ifndef _INT32
    235      /* needed to work around compile issue on HP-UX 11.x */
    236 #    define _INT32      1
    237 #  endif
    238 #endif
    239 
    240 /*
    241  * Note we duplicate the size tests in the unsigned
    242  * case as int32 may be a typedef from rpc/rpc.h
    243  */
    244 
    245 #if !defined(uint32) && !defined(HAVE_UINT32_FROM_RPC_RPC_H)
    246 #  define uint32 uint32_t
    247 #endif
    248 
    249 /*
    250  * check for 8 byte long long
    251  */
    252 
    253 #if !defined(uint64)
    254 #  define uint64 uint64_t
    255 #endif
    256 
    257 #if !defined(int64)
    258 #  define int64 int64_t
    259 #endif
    260 
    261 
    262 /*
    263180 * Types for devices, inodes and offsets.
    264181 */
    265182
    266183#ifndef SMB_DEV_T
    267 #  if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_DEV64_T)
    268 #    define SMB_DEV_T dev64_t
    269 #  else
    270 #    define SMB_DEV_T dev_t
    271 #  endif
     184# define SMB_DEV_T dev_t
    272185#endif
    273186
    274187#ifndef LARGE_SMB_DEV_T
    275 #  if (defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_DEV64_T)) || (defined(SIZEOF_DEV_T) && (SIZEOF_DEV_T == 8))
     188#  if (defined(SIZEOF_DEV_T) && (SIZEOF_DEV_T == 8))
    276189#    define LARGE_SMB_DEV_T 1
    277190#  endif
     
    291204
    292205#ifndef SMB_INO_T
    293 #  if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_INO64_T)
    294 #    define SMB_INO_T ino64_t
    295 #  else
    296206#    define SMB_INO_T ino_t
    297 #  endif
    298207#endif
    299208
    300209#ifndef LARGE_SMB_INO_T
    301 #  if (defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_INO64_T)) || (defined(SIZEOF_INO_T) && (SIZEOF_INO_T == 8))
     210#  if (defined(SIZEOF_INO_T) && (SIZEOF_INO_T == 8))
    302211#    define LARGE_SMB_INO_T 1
    303212#  endif
     
    312221#endif
    313222
    314 #ifndef SMB_OFF_T
    315 #  if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_OFF64_T)
    316 #    define SMB_OFF_T off64_t
    317 #  else
    318 #    define SMB_OFF_T off_t
    319 #  endif
    320 #endif
    321 
    322223/* TODO: remove this macros */
    323224#define SBIG_UINT(p, ofs, v) SBVAL(p, ofs, v)
     
    328229typedef uint64_t br_off;
    329230
    330 #define SMB_OFF_T_BITS (sizeof(SMB_OFF_T)*8)
     231#define SMB_OFF_T_BITS (sizeof(off_t)*8)
    331232
    332233/*
     
    335236 */
    336237
    337 #ifndef LARGE_SMB_OFF_T
    338 #  if (defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_OFF64_T)) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8))
    339 #    define LARGE_SMB_OFF_T 1
    340 #  endif
    341 #endif
    342 
    343 #ifdef LARGE_SMB_OFF_T
    344238#define SOFF_T(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,(v)>>32))
    345239#define SOFF_T_R(p, ofs, v) (SIVAL(p,(ofs)+4,(v)&0xFFFFFFFF), SIVAL(p,ofs,(v)>>32))
    346 #define IVAL_TO_SMB_OFF_T(buf,off) ((SMB_OFF_T)(( ((uint64_t)(IVAL((buf),(off)))) & ((uint64_t)0xFFFFFFFF) )))
    347 #else
    348 #define SOFF_T(p, ofs, v) (SIVAL(p,ofs,v),SIVAL(p,(ofs)+4,0))
    349 #define SOFF_T_R(p, ofs, v) (SIVAL(p,(ofs)+4,v),SIVAL(p,ofs,0))
    350 #define IVAL_TO_SMB_OFF_T(buf,off) ((SMB_OFF_T)(( ((uint32)(IVAL((buf),(off)))) & 0xFFFFFFFF )))
    351 #endif
    352 
    353 #ifndef HAVE_BLKSIZE_T
    354 /* This is mainly for HP/UX which defines st_blksize as long */
    355 typedef long blksize_t;
    356 #endif
    357 
    358 #ifndef HAVE_BLKCNT_T
    359 /* This is mainly for HP/UX which doesn't have blkcnt_t */
    360 typedef long blkcnt_t;
    361 #endif
     240#define IVAL_TO_SMB_OFF_T(buf,off) ((off_t)(( ((uint64_t)(IVAL((buf),(off)))) & ((uint64_t)0xFFFFFFFF) )))
    362241
    363242/*
     
    385264        uint32_t        st_ex_flags;
    386265        uint32_t        st_ex_mask;
    387 
    388         /*
    389          * Add space for VFS internal extensions. The initial user of this
    390          * would be the onefs modules, passing the snapid from the stat calls
    391          * to the file_id_create call. Maybe we'll have to expand this later,
    392          * but the core of Samba should never look at this field.
    393          */
    394         uint64_t vfs_private;
    395266};
    396267
    397268typedef struct stat_ex SMB_STRUCT_STAT;
    398 
    399 /*
    400  * Type for dirent structure.
    401  */
    402 
    403 #ifndef SMB_STRUCT_DIRENT
    404 #  if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_DIRENT64)
    405 #    define SMB_STRUCT_DIRENT struct dirent64
    406 #  else
    407 #    define SMB_STRUCT_DIRENT struct dirent
    408 #  endif
    409 #endif
    410 
    411 /*
    412  * Type for DIR structure.
    413  */
    414 
    415 #ifndef SMB_STRUCT_DIR
    416 #  if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_DIR64)
    417 #    define SMB_STRUCT_DIR DIR64
    418 #  else
    419 #    define SMB_STRUCT_DIR DIR
    420 #  endif
    421 #endif
    422 
    423 /*
    424  * Defines for 64 bit fcntl locks.
    425  */
    426 
    427 #ifndef SMB_STRUCT_FLOCK
    428 #  if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_FLOCK64) && defined(HAVE_OFF64_T)
    429 #    define SMB_STRUCT_FLOCK struct flock64
    430 #  else
    431 #    define SMB_STRUCT_FLOCK struct flock
    432 #  endif
    433 #endif
    434 
    435 #ifndef SMB_F_SETLKW
    436 #  if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_FLOCK64) && defined(HAVE_OFF64_T)
    437 #    define SMB_F_SETLKW F_SETLKW64
    438 #  else
    439 #    define SMB_F_SETLKW F_SETLKW
    440 #  endif
    441 #endif
    442 
    443 #ifndef SMB_F_SETLK
    444 #  if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_FLOCK64) && defined(HAVE_OFF64_T)
    445 #    define SMB_F_SETLK F_SETLK64
    446 #  else
    447 #    define SMB_F_SETLK F_SETLK
    448 #  endif
    449 #endif
    450 
    451 #ifndef SMB_F_GETLK
    452 #  if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_FLOCK64) && defined(HAVE_OFF64_T)
    453 #    define SMB_F_GETLK F_GETLK64
    454 #  else
    455 #    define SMB_F_GETLK F_GETLK
    456 #  endif
    457 #endif
    458 
    459 /*
    460  * Type for aiocb structure.
    461  */
    462 
    463 #ifndef SMB_STRUCT_AIOCB
    464 #  if defined(WITH_AIO)
    465 #    if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_AIOCB64)
    466 #      define SMB_STRUCT_AIOCB struct aiocb64
    467 #    else
    468 #      define SMB_STRUCT_AIOCB struct aiocb
    469 #    endif
    470 #  else
    471 #    define SMB_STRUCT_AIOCB int /* AIO not being used but we still need the define.... */
    472 #  endif
    473 #endif
    474269
    475270enum timestamp_set_resolution {
     
    503298#endif
    504299
     300/* debug.h need to be included before samba_util.h for the macro SMB_ASSERT */
     301#include "../lib/util/debug.h"
     302
    505303/* Lists, trees, caching, database... */
    506 #include "../lib/util/util.h"
     304#include "../lib/util/samba_util.h"
    507305#include "../lib/util/util_net.h"
    508306#include "../lib/util/xfile.h"
     
    518316#include "../lib/util/data_blob.h"
    519317#include "../lib/util/time.h"
    520 #include "../lib/util/debug.h"
    521318#include "../lib/util/debug_s3.h"
    522319
     
    524321#include "../libcli/util/error.h"
    525322#include "../lib/util/charset/charset.h"
    526 #include "dynconfig.h"
     323#include "dynconfig/dynconfig.h"
    527324#include "locking.h"
    528325#include "smb_perfcount.h"
     
    530327#include "../lib/util/byteorder.h"
    531328
    532 #include "module.h"
     329#include "../lib/util/samba_modules.h"
    533330#include "../lib/util/talloc_stack.h"
    534331#include "../lib/util/smb_threads.h"
    535332#include "../lib/util/smb_threads_internal.h"
    536333
     334/* samba_setXXid functions. */
     335#include "../lib/util/setid.h"
     336
    537337/***** prototypes *****/
    538338#ifndef NO_PROTO_H
     
    540340#endif
    541341
     342#include "lib/param/loadparm.h"
     343
    542344/* String routines */
    543345
     
    553355#endif
    554356
    555 #if defined(HAVE_PUTPRPWNAM) && defined(AUTH_CLEARTEXT_SEG_CHARS)
    556 #define OSF1_ENH_SEC 1
    557 #endif
    558357
    559358#if defined(HAVE_CRYPT16) && defined(HAVE_GETAUTHUID)
     
    580379
    581380#define MAX_SEC_CTX_DEPTH 8    /* Maximum number of security contexts */
    582 
    583 
    584 #ifdef GLIBC_HACK_FCNTL64
    585 /* this is a gross hack. 64 bit locking is completely screwed up on
    586    i386 Linux in glibc 2.1.95 (which ships with RedHat 7.0). This hack
    587    "fixes" the problem with the current 2.4.0test kernels
    588 */
    589 #define fcntl fcntl64
    590 #undef F_SETLKW
    591 #undef F_SETLK
    592 #define F_SETLK 13
    593 #define F_SETLKW 14
    594 #endif
    595381
    596382
     
    604390
    605391/* PRINTFLIKE2 */
    606 void sys_adminlog(int priority, const char *format_str, ...) PRINTF_ATTRIBUTE(2,3);
    607 
    608 /* PRINTFLIKE2 */
    609392int fstr_sprintf(fstring s, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3);
    610 
    611 int d_vfprintf(FILE *f, const char *format, va_list ap) PRINTF_ATTRIBUTE(2,0);
    612393
    613394int smb_xvasprintf(char **ptr, const char *format, va_list ap) PRINTF_ATTRIBUTE(2,0);
     
    624405#endif
    625406
    626 #ifndef XATTR_CREATE
    627 #define XATTR_CREATE  0x1       /* set value, fail if attr already exists */
    628 #endif
    629 
    630 #ifndef XATTR_REPLACE
    631 #define XATTR_REPLACE 0x2       /* set value, fail if attr does not exist */
    632 #endif
    633 
    634407#ifdef TRUE
    635408#undef TRUE
     
    649422#endif
    650423
    651 #ifndef CONST_DISCARD
    652 #define CONST_DISCARD(type, ptr)      ((type) ((void *) (ptr)))
    653 #endif
    654 
    655 void smb_panic( const char *why ) _NORETURN_;
    656424void dump_core(void) _NORETURN_;
    657425void exit_server(const char *const reason) _NORETURN_;
    658426void exit_server_cleanly(const char *const reason) _NORETURN_;
    659 void exit_server_fault(void) _NORETURN_;
    660 
    661 /* samba3 doesn't use uwrap yet */
    662 #define uwrap_enabled() 0
    663427
    664428#define BASE_RID (0x000003E8L)
Note: See TracChangeset for help on using the changeset viewer.