Ignore:
Timestamp:
Nov 27, 2012, 4:43:17 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.0

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source3/include/smb.h

    r480 r745  
    2828
    2929/* logged when starting the various Samba daemons */
    30 #define COPYRIGHT_STARTUP_MESSAGE       "Copyright Andrew Tridgell and the Samba Team 1992-2010"
     30#define COPYRIGHT_STARTUP_MESSAGE       "Copyright Andrew Tridgell and the Samba Team 1992-2011"
    3131
    3232
     
    6868/* how long to wait for secondary SMB packets (milli-seconds) */
    6969#define SMB_SECONDARY_WAIT (60*1000)
    70 
    71 /* Debugging stuff */
    72 #include "debug.h"
    7370
    7471/* this defines the error codes that receive_smb can put in smb_read_error */
     
    8784#define DIR_STRUCT_SIZE 43
    8885
    89 /* these define the attribute byte as seen by DOS */
    90 #define aRONLY (1L<<0)          /* 0x01 */
    91 #define aHIDDEN (1L<<1)         /* 0x02 */
    92 #define aSYSTEM (1L<<2)         /* 0x04 */
    93 #define aVOLID (1L<<3)          /* 0x08 */
    94 #define aDIR (1L<<4)            /* 0x10 */
    95 #define aARCH (1L<<5)           /* 0x20 */
    96 
    9786/* deny modes */
    9887#define DENY_DOS 0
     
    138127#define OPENX_FILE_FAIL_IF_NOT_EXIST 0
    139128
    140 #include "../libcli/util/doserr.h"
    141 
    142129typedef union unid_t {
    143130        uid_t uid;
     
    145132} unid_t;
    146133
    147 /*
    148  * SMB UCS2 (16-bit unicode) internal type.
    149  * smb_ucs2_t is *always* in little endian format.
    150  */
    151 
    152 #ifdef WORDS_BIGENDIAN
    153 #define UCS2_SHIFT 8
    154 #else
    155 #define UCS2_SHIFT 0
    156 #endif
    157 
    158 /* turn a 7 bit character into a ucs2 character */
    159 #define UCS2_CHAR(c) ((c) << UCS2_SHIFT)
    160 
    161 /* return an ascii version of a ucs2 character */
    162 #define UCS2_TO_CHAR(c) (((c) >> UCS2_SHIFT) & 0xff)
    163 
    164 /* Copy into a smb_ucs2_t from a possibly unaligned buffer. Return the copied smb_ucs2_t */
    165 #define COPY_UCS2_CHAR(dest,src) (((unsigned char *)(dest))[0] = ((unsigned char *)(src))[0],\
    166                                 ((unsigned char *)(dest))[1] = ((unsigned char *)(src))[1], (dest))
    167 
    168134/* pipe string names */
    169 #define PIPE_LANMAN   "\\PIPE\\LANMAN"
    170 
    171 #define MAX_HOURS_LEN 32
    172135
    173136#ifndef MAXSUBAUTHS
     
    177140#define SID_MAX_SIZE ((size_t)(8+(MAXSUBAUTHS*4)))
    178141
    179 #define LOOKUP_NAME_NONE                0x00000000
    180 #define LOOKUP_NAME_ISOLATED             0x00000001  /* Look up unqualified names */
    181 #define LOOKUP_NAME_REMOTE               0x00000002  /* Ask others */
    182 #define LOOKUP_NAME_GROUP                0x00000004  /* (unused) This is a NASTY hack for
    183                                                         valid users = @foo where foo also
    184                                                         exists in as user. */
    185 #define LOOKUP_NAME_NO_NSS               0x00000008  /* no NSS calls to avoid
    186                                                         winbind recursions */
    187 #define LOOKUP_NAME_BUILTIN             0x00000010 /* builtin names */
    188 #define LOOKUP_NAME_WKN                 0x00000020 /* well known names */
    189 #define LOOKUP_NAME_DOMAIN              0x00000040 /* only lookup own domain */
    190 #define LOOKUP_NAME_LOCAL               (LOOKUP_NAME_ISOLATED\
    191                                         |LOOKUP_NAME_BUILTIN\
    192                                         |LOOKUP_NAME_WKN\
    193                                         |LOOKUP_NAME_DOMAIN)
    194 #define LOOKUP_NAME_ALL                 (LOOKUP_NAME_ISOLATED\
    195                                         |LOOKUP_NAME_REMOTE\
    196                                         |LOOKUP_NAME_BUILTIN\
    197                                         |LOOKUP_NAME_WKN\
    198                                         |LOOKUP_NAME_DOMAIN)
    199 
    200 /**
    201  * @brief Security Identifier
    202  *
    203  * @sa http://msdn.microsoft.com/library/default.asp?url=/library/en-us/security/accctrl_38yn.asp
    204  **/
    205 typedef struct dom_sid DOM_SID;
    206 
    207 enum id_mapping {
    208         ID_UNKNOWN = 0,
    209         ID_MAPPED,
    210         ID_UNMAPPED,
    211         ID_EXPIRED
    212 };
    213 
    214 enum id_type {
    215         ID_TYPE_NOT_SPECIFIED = 0,
    216         ID_TYPE_UID,
    217         ID_TYPE_GID
    218 };
    219 
    220 struct unixid {
    221         uint32_t id;
    222         enum id_type type;
    223 };
    224 
    225 struct id_map {
    226         DOM_SID *sid;
    227         struct unixid xid;
    228         enum id_mapping status;
    229 };
    230 
    231 #include "librpc/gen_ndr/misc.h"
    232142#include "librpc/gen_ndr/security.h"
    233 #include "librpc/ndr/libndr.h"
    234 #include "librpc/gen_ndr/lsa.h"
    235 #include "librpc/gen_ndr/dfs.h"
    236 #include "librpc/gen_ndr/winreg.h"
    237 #include "librpc/gen_ndr/initshutdown.h"
    238 #include "librpc/gen_ndr/eventlog.h"
    239 #include "librpc/gen_ndr/srvsvc.h"
    240 #include "librpc/gen_ndr/wkssvc.h"
    241 #include "librpc/gen_ndr/echo.h"
    242 #include "librpc/gen_ndr/svcctl.h"
    243 #include "librpc/gen_ndr/netlogon.h"
    244 #include "librpc/gen_ndr/samr.h"
    245 #include "librpc/gen_ndr/dssetup.h"
    246 #include "librpc/gen_ndr/epmapper.h"
    247 #include "librpc/gen_ndr/libnet_join.h"
    248 #include "librpc/gen_ndr/krb5pac.h"
    249 #include "librpc/gen_ndr/ntsvcs.h"
    250 #include "librpc/gen_ndr/nbt.h"
    251 #include "librpc/gen_ndr/drsuapi.h"
    252 #include "librpc/gen_ndr/drsblobs.h"
    253 #include "librpc/gen_ndr/spoolss.h"
    254 #include "librpc/gen_ndr/dcerpc.h"
    255 #include "librpc/gen_ndr/ndr_dcerpc.h"
    256 #include "librpc/gen_ndr/ntlmssp.h"
    257 
    258 struct lsa_dom_info {
    259         bool valid;
    260         DOM_SID sid;
    261         const char *name;
    262         int num_idxs;
    263         int *idxs;
    264 };
    265 
    266 struct lsa_name_info {
    267         uint32 rid;
    268         enum lsa_SidType type;
    269         const char *name;
    270         int dom_idx;
    271 };
    272 
    273 /* Some well-known SIDs */
    274 extern const DOM_SID global_sid_World_Domain;
    275 extern const DOM_SID global_sid_World;
    276 extern const DOM_SID global_sid_Creator_Owner_Domain;
    277 extern const DOM_SID global_sid_NT_Authority;
    278 extern const DOM_SID global_sid_System;
    279 extern const DOM_SID global_sid_NULL;
    280 extern const DOM_SID global_sid_Authenticated_Users;
    281 extern const DOM_SID global_sid_Network;
    282 extern const DOM_SID global_sid_Creator_Owner;
    283 extern const DOM_SID global_sid_Creator_Group;
    284 extern const DOM_SID global_sid_Anonymous;
    285 extern const DOM_SID global_sid_Builtin;
    286 extern const DOM_SID global_sid_Builtin_Administrators;
    287 extern const DOM_SID global_sid_Builtin_Users;
    288 extern const DOM_SID global_sid_Builtin_Guests;
    289 extern const DOM_SID global_sid_Builtin_Power_Users;
    290 extern const DOM_SID global_sid_Builtin_Account_Operators;
    291 extern const DOM_SID global_sid_Builtin_Server_Operators;
    292 extern const DOM_SID global_sid_Builtin_Print_Operators;
    293 extern const DOM_SID global_sid_Builtin_Backup_Operators;
    294 extern const DOM_SID global_sid_Builtin_Replicator;
    295 extern const DOM_SID global_sid_Builtin_PreWin2kAccess;
    296 extern const DOM_SID global_sid_Unix_Users;
    297 extern const DOM_SID global_sid_Unix_Groups;
    298143
    299144/*
     
    310155#define PRIMARY_GROUP_SID_INDEX 1
    311156
    312 typedef struct nt_user_token {
    313         size_t num_sids;
    314         DOM_SID *user_sids;
    315         SE_PRIV privileges;
    316 } NT_USER_TOKEN;
    317 
    318 typedef struct unix_user_token {
    319         uid_t uid;
    320         gid_t gid;
    321         size_t ngroups;
    322         gid_t *groups;
    323 } UNIX_USER_TOKEN;
    324 
    325 /* 32 bit time (sec) since 01jan1970 - cifs6.txt, section 3.5, page 30 */
    326 typedef struct time_info {
    327         uint32 time;
    328 } UTIME;
    329 
    330157typedef struct write_cache {
    331158        SMB_OFF_T file_size;
     
    336163} write_cache;
    337164
    338 #include "fake_file.h"
    339 
    340165struct fd_handle {
    341166        size_t ref_count;
     
    345170        uint32 private_options; /* NT Create options, but we only look at
    346171                                 * NTCREATEX_OPTIONS_PRIVATE_DENY_DOS and
    347                                  * NTCREATEX_OPTIONS_PRIVATE_DENY_FCB (Except
     172                                 * NTCREATEX_OPTIONS_PRIVATE_DENY_FCB and
     173                                 * NTCREATEX_OPTIONS_PRIVATE_DELETE_ON_CLOSE
    348174                                 * for print files *only*, where
    349175                                 * DELETE_ON_CLOSE is not stored in the share
     
    357183struct uuid;
    358184struct named_mutex;
    359 struct pcap_cache;
    360185struct wb_context;
    361186struct rpc_cli_smbd_conn;
     
    411236};
    412237
     238struct print_file_data {
     239        char *svcname;
     240        char *docname;
     241        char *filename;
     242        struct policy_handle handle;
     243        uint32_t jobid;
     244        uint16 rap_jobid;
     245};
     246
    413247typedef struct files_struct {
    414248        struct files_struct *next, *prev;
     
    417251        struct fd_handle *fh;
    418252        unsigned int num_smb_operations;
    419         uint16 rap_print_jobid;
    420253        struct file_id file_id;
    421254        uint64_t initial_allocation_size; /* Faked up initial allocation on disk. */
     
    446279        bool can_read;
    447280        bool can_write;
    448         bool print_file;
    449281        bool modified;
    450282        bool is_directory;
     
    454286        bool delete_on_close;
    455287        bool posix_open;
     288        bool is_sparse;
    456289        struct smb_filename *fsp_name;
     290        uint32_t name_hash;             /* Jenkins hash of full pathname. */
    457291
    458292        struct vfs_fsp_data *vfs_extension;
     
    472306
    473307        struct dptr_struct *dptr;
     308
     309        /* if not NULL, means this is a print file */
     310        struct print_file_data *print_file;
     311
    474312} files_struct;
    475313
     
    477315#include "sysquotas.h"
    478316
     317struct client_address {
     318        char addr[INET6_ADDRSTRLEN];
     319        const char *name;
     320};
     321
    479322struct vuid_cache_entry {
    480         struct auth_serversupplied_info *server_info;
     323        struct auth_serversupplied_info *session_info;
    481324        uint16_t vuid;
    482325        bool read_only;
    483         bool admin_user;
    484326};
    485327
     
    497339        struct trans_state *next, *prev;
    498340        uint16 vuid;
    499         uint16 mid;
     341        uint64_t mid;
    500342
    501343        uint32 max_param_return;
     
    567409        bool ipc;
    568410        bool read_only; /* Attributes for the current user of the share. */
    569         bool admin_user; /* Attributes for the current user of the share. */
     411        uint32_t share_access;
    570412        /* Does this filesystem honor
    571413           sub second timestamps on files
     
    581423         * on the vuid using this tid, this might change per SMB request.
    582424         */
    583         struct auth_serversupplied_info *server_info;
     425        struct auth_serversupplied_info *session_info;
    584426
    585427        /*
     
    588430         */
    589431        gid_t force_group_gid;
    590 
    591         char client_address[INET6_ADDRSTRLEN]; /* String version of client IP address. */
    592432
    593433        uint16 vuid; /* vuid of user who *opened* this connection, or UID_FIELD_INVALID */
     
    619459        struct trans_state *pending_trans;
    620460        struct notify_context *notify_ctx;
     461
     462        struct rpc_pipe_client *spoolss_pipe;
     463
    621464} connection_struct;
    622465
     
    624467        connection_struct *conn;
    625468        uint16 vuid;
    626         UNIX_USER_TOKEN ut;
    627         NT_USER_TOKEN *nt_user_token;
    628 };
    629 
     469        struct security_unix_token ut;
     470        struct security_token *nt_user_token;
     471};
     472
     473struct smbd_smb2_request;
    630474
    631475struct smb_request {
     
    633477        uint16 flags2;
    634478        uint16 smbpid;
    635         uint16 mid;
     479        uint64_t mid; /* For compatibility with SMB2. */
    636480        uint32_t seqnum;
    637481        uint16 vuid;
     
    657501        bool encrypted;
    658502        connection_struct *conn;
     503        struct smbd_server_connection *sconn;
    659504        struct smb_perfcount_data pcd;
    660505
     
    675520
    676521        bool done;
     522
     523        /*
     524         * Back pointer to smb2 request.
     525         */
     526        struct smbd_smb2_request *smb2req;
    677527};
    678528
     
    687537        fstring domain; /* domain that the client specified */
    688538} userdom_struct;
    689 
    690 /* Extra fields above "LPQ_PRINTING" are used to map extra NT status codes. */
    691 
    692 enum {LPQ_QUEUED=0,LPQ_PAUSED,LPQ_SPOOLING,LPQ_PRINTING,LPQ_ERROR,LPQ_DELETING,
    693       LPQ_OFFLINE,LPQ_PAPEROUT,LPQ_PRINTED,LPQ_DELETED,LPQ_BLOCKED,LPQ_USER_INTERVENTION};
    694 
    695 typedef struct _print_queue_struct {
    696         int job;                /* normally the UNIX jobid -- see note in
    697                                    printing.c:traverse_fn_delete() */
    698         int size;
    699         int page_count;
    700         int status;
    701         int priority;
    702         time_t time;
    703         fstring fs_user;
    704         fstring fs_file;
    705 } print_queue_struct;
    706 
    707 enum {LPSTAT_OK, LPSTAT_STOPPED, LPSTAT_ERROR};
    708 
    709 typedef struct {
    710         fstring message;
    711         int qcount;
    712         int status;
    713 }  print_status_struct;
    714539
    715540/* used for server information: client, nameserv and ipc */
     
    747572#define SHARE_MODE_FLAG_POSIX_OPEN      0x1
    748573
     574#include "librpc/gen_ndr/server_id.h"
     575
    749576/* struct returned by get_share_modes */
    750577struct share_mode_entry {
    751578        struct server_id pid;
    752         uint16 op_mid;
     579        uint64_t op_mid;        /* For compatibility with SMB2 opens. */
    753580        uint16 op_type;
    754581        uint32 access_mask;             /* NTCreateX access bits (FILE_READ_DATA etc.) */
     
    763590        uint32 uid;             /* uid of file opener. */
    764591        uint16 flags;           /* See SHARE_MODE_XX above. */
     592        uint32_t name_hash;             /* Jenkins hash of full pathname. */
    765593};
    766594
     
    769597Offset  Data                    length.
    7705980       struct server_id pid    4
    771 4       uint16 op_mid           2
    772 6       uint16 op_type          2
    773 8       uint32 access_mask      4
    774 12      uint32 share_access     4
    775 16      uint32 private_options  4
    776 20      uint32 time sec         4
    777 24      uint32 time usec        4
    778 28      uint64 dev              8 bytes
    779 36      uint64 inode            8 bytes
    780 44      uint64 extid            8 bytes
    781 52      unsigned long file_id   4 bytes
    782 56      uint32 uid              4 bytes
    783 60      uint16 flags            2 bytes
    784 62
     5994       uint16 op_mid           8
     60012      uint16 op_type          2
     60114      uint32 access_mask      4
     60218      uint32 share_access     4
     60322      uint32 private_options  4
     60426      uint32 time sec         4
     60530      uint32 time usec        4
     60634      uint64 dev              8 bytes
     60742      uint64 inode            8 bytes
     60850      uint64 extid            8 bytes
     60958      unsigned long file_id   4 bytes
     61062      uint32 uid              4 bytes
     61166      uint16 flags            2 bytes
     61268      uint32 name_hash        4 bytes
     61372
    785614
    786615*/
    787 #ifdef CLUSTER_SUPPORT
    788 #define MSG_SMB_SHARE_MODE_ENTRY_SIZE 66
    789 #else
    790 #define MSG_SMB_SHARE_MODE_ENTRY_SIZE 62
    791 #endif
     616
     617#define OP_BREAK_MSG_PID_OFFSET 0
     618#define OP_BREAK_MSG_MID_OFFSET 4
     619#define OP_BREAK_MSG_OP_TYPE_OFFSET 12
     620#define OP_BREAK_MSG_ACCESS_MASK_OFFSET 14
     621#define OP_BREAK_MSG_SHARE_ACCESS_OFFSET 18
     622#define OP_BREAK_MSG_PRIV_OFFSET 22
     623#define OP_BREAK_MSG_TIME_SEC_OFFSET 26
     624#define OP_BREAK_MSG_TIME_USEC_OFFSET 30
     625#define OP_BREAK_MSG_DEV_OFFSET 34
     626#define OP_BREAK_MSG_INO_OFFSET 42
     627#define OP_BREAK_MSG_EXTID_OFFSET 50
     628#define OP_BREAK_MSG_FILE_ID_OFFSET 58
     629#define OP_BREAK_MSG_UID_OFFSET 62
     630#define OP_BREAK_MSG_FLAGS_OFFSET 66
     631#define OP_BREAK_MSG_NAME_HASH_OFFSET 68
     632
     633#define OP_BREAK_MSG_VNN_OFFSET 72
     634#define MSG_SMB_SHARE_MODE_ENTRY_SIZE 76
     635
     636struct delete_token_list {
     637        struct delete_token_list *next, *prev;
     638        uint32_t name_hash;
     639        struct security_unix_token *delete_token;
     640};
    792641
    793642struct share_mode_lock {
     
    798647        int num_share_modes;
    799648        struct share_mode_entry *share_modes;
    800         UNIX_USER_TOKEN *delete_token;
    801         bool delete_on_close;
     649        struct delete_token_list *delete_tokens;
    802650        struct timespec old_write_time;
    803651        struct timespec changed_write_time;
     
    816664                struct {
    817665                        int num_share_mode_entries;
    818                         bool delete_on_close;
    819666                        struct timespec old_write_time;
    820667                        struct timespec changed_write_time;
    821                         uint32 delete_token_size; /* Only valid if either of
    822                                                      the two previous fields
    823                                                      are True. */
     668                        uint32 num_delete_token_entries;
    824669                } s;
    825670                struct share_mode_entry dummy; /* Needed for alignment. */
    826671        } u;
    827672        /* The following four entries are implicit
    828            struct share_mode_entry modes[num_share_mode_entries];
    829            char unix_token[delete_token_size] (divisible by 4).
    830            char share_name[];
    831            char file_name[];
     673
     674           (1) struct share_mode_entry modes[num_share_mode_entries];
     675
     676           (2) A num_delete_token_entries of structs {
     677                uint32_t len_delete_token;
     678                char unix_token[len_delete_token] (divisible by 4).
     679           };
     680
     681           (3) char share_name[];
     682           (4) char file_name[];
    832683        */
    833684};
    834 
    835 /* Used to store pipe open records for NetFileEnum() */
    836 
    837 struct pipe_open_rec {
    838         struct server_id pid;
    839         uid_t uid;
    840         int pnum;
    841         fstring name;
    842 };
    843 
    844685
    845686#define NT_HASH_LEN 16
    846687#define LM_HASH_LEN 16
    847 
    848 /* Password history contants. */
    849 #define PW_HISTORY_SALT_LEN 16
    850 #define SALTED_MD5_HASH_LEN 16
    851 #define PW_HISTORY_ENTRY_LEN (PW_HISTORY_SALT_LEN+SALTED_MD5_HASH_LEN)
    852 #define MAX_PW_HISTORY_LEN 24
    853 
    854 /*
    855  * Flags for local user manipulation.
    856  */
    857 
    858 #define LOCAL_ADD_USER 0x1
    859 #define LOCAL_DELETE_USER 0x2
    860 #define LOCAL_DISABLE_USER 0x4
    861 #define LOCAL_ENABLE_USER 0x8
    862 #define LOCAL_TRUST_ACCOUNT 0x10
    863 #define LOCAL_SET_NO_PASSWORD 0x20
    864 #define LOCAL_SET_PASSWORD 0x40
    865 #define LOCAL_SET_LDAP_ADMIN_PW 0x80
    866 #define LOCAL_INTERDOM_ACCOUNT 0x100
    867 #define LOCAL_AM_ROOT 0x200  /* Act as root */
    868688
    869689/* key and data in the connections database - used in smbstatus and smbd */
     
    884704        char machine[FSTRING_LEN];
    885705        time_t start;
    886         uint32 bcast_msg_flags;
     706
     707        /*
     708         * This field used to hold the msg_flags. For compatibility reasons,
     709         * keep the data structure in the tdb file the same.
     710         */
     711        uint32 unused_compatitibility_field;
    887712};
    888713
     
    932757#define FLAG_DOS_STRING 0x4000 /* convert from UNIX to DOS codepage when reading this string. */
    933758#define FLAG_META       0x8000 /* A meta directive - not a real parameter */
     759#define FLAG_CMDLINE    0x10000 /* option has been overridden */
    934760
    935761struct bitmap {
     
    12061032#define PIPE_START_MESSAGE 0x8
    12071033
    1208 /* File Specific access rights */
    1209 #define FILE_READ_DATA        0x00000001
    1210 #define FILE_WRITE_DATA       0x00000002
    1211 #define FILE_APPEND_DATA      0x00000004
    1212 #define FILE_READ_EA          0x00000008 /* File and directory */
    1213 #define FILE_WRITE_EA         0x00000010 /* File and directory */
    1214 #define FILE_EXECUTE          0x00000020
    1215 #define FILE_DELETE_CHILD     0x00000040
    1216 #define FILE_READ_ATTRIBUTES  0x00000080
    1217 #define FILE_WRITE_ATTRIBUTES 0x00000100
    1218 
    1219 #define FILE_ALL_ACCESS       0x000001FF
    1220 
    1221 /* Directory specific access rights */
    1222 #define FILE_LIST_DIRECTORY   0x00000001
    1223 #define FILE_ADD_FILE         0x00000002
    1224 #define FILE_ADD_SUBDIRECTORY 0x00000004
    1225 #define FILE_TRAVERSE         0x00000020
    1226 #define FILE_DELETE_CHILD     0x00000040
    1227 
    12281034/* the desired access to use when opening a pipe */
    12291035#define DESIRED_ACCESS_PIPE 0x2019f
    12301036 
    1231 /* Generic access masks & rights. */
    1232 #define DELETE_ACCESS        0x00010000 /* (1L<<16) */
    1233 #define READ_CONTROL_ACCESS  0x00020000 /* (1L<<17) */
    1234 #define WRITE_DAC_ACCESS     0x00040000 /* (1L<<18) */
    1235 #define WRITE_OWNER_ACCESS   0x00080000 /* (1L<<19) */
    1236 #define SYNCHRONIZE_ACCESS   0x00100000 /* (1L<<20) */
    1237 
    1238 #define SYSTEM_SECURITY_ACCESS 0x01000000 /* (1L<<24) */
    1239 #define MAXIMUM_ALLOWED_ACCESS 0x02000000 /* (1L<<25) */
    1240 #define GENERIC_ALL_ACCESS     0x10000000 /* (1<<28) */
    1241 #define GENERIC_EXECUTE_ACCESS 0x20000000 /* (1<<29) */
    1242 #define GENERIC_WRITE_ACCESS   0x40000000 /* (1<<30) */
    1243 #define GENERIC_READ_ACCESS    ((unsigned)0x80000000) /* (((unsigned)1)<<31) */
    1244 
    1245 /* Mapping of generic access rights for files to specific rights. */
    1246 
    1247 /* This maps to 0x1F01FF */
    1248 #define FILE_GENERIC_ALL (STANDARD_RIGHTS_REQUIRED_ACCESS|\
    1249                           SYNCHRONIZE_ACCESS|\
    1250                           FILE_ALL_ACCESS)
    1251 
    1252 /* This maps to 0x120089 */
    1253 #define FILE_GENERIC_READ (STANDARD_RIGHTS_READ_ACCESS|\
    1254                            FILE_READ_DATA|\
    1255                            FILE_READ_ATTRIBUTES|\
    1256                            FILE_READ_EA|\
    1257                            SYNCHRONIZE_ACCESS)
    1258 
    1259 /* This maps to 0x120116 */
    1260 #define FILE_GENERIC_WRITE (STD_RIGHT_READ_CONTROL_ACCESS|\
    1261                             FILE_WRITE_DATA|\
    1262                             FILE_WRITE_ATTRIBUTES|\
    1263                             FILE_WRITE_EA|\
    1264                             FILE_APPEND_DATA|\
    1265                             SYNCHRONIZE_ACCESS)
    1266 
    1267 #define FILE_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE_ACCESS|\
    1268                               FILE_READ_ATTRIBUTES|\
    1269                               FILE_EXECUTE|\
    1270                               SYNCHRONIZE_ACCESS)
    1271 
    1272 /* Share specific rights. */
    1273 #define SHARE_ALL_ACCESS      FILE_GENERIC_ALL
    1274 #define SHARE_READ_ONLY       (FILE_GENERIC_READ|FILE_EXECUTE)
    1275 
    12761037/* Mapping of access rights to UNIX perms. */
    12771038#define UNIX_ACCESS_RWX         FILE_GENERIC_ALL
     
    13191080#define FILE_ATTRIBUTE_HIDDEN           0x002L
    13201081#define FILE_ATTRIBUTE_SYSTEM           0x004L
     1082#define FILE_ATTRIBUTE_VOLUME           0x008L
    13211083#define FILE_ATTRIBUTE_DIRECTORY        0x010L
    13221084#define FILE_ATTRIBUTE_ARCHIVE          0x020L
     
    13291091#define FILE_ATTRIBUTE_NONINDEXED       0x2000L
    13301092#define FILE_ATTRIBUTE_ENCRYPTED        0x4000L
    1331 #define SAMBA_ATTRIBUTES_MASK           0x7F
     1093#define SAMBA_ATTRIBUTES_MASK           (FILE_ATTRIBUTE_READONLY|\
     1094                                        FILE_ATTRIBUTE_HIDDEN|\
     1095                                        FILE_ATTRIBUTE_SYSTEM|\
     1096                                        FILE_ATTRIBUTE_DIRECTORY|\
     1097                                        FILE_ATTRIBUTE_ARCHIVE)
    13321098
    13331099/* Flags - combined with attributes. */
     
    13761142/*
    13771143 * Private create options used by the ntcreatex processing code. From Samba4.
    1378  * We reuse some ignored flags for private use.
    1379  */
    1380 #define NTCREATEX_OPTIONS_PRIVATE_DENY_DOS     0x00010000
    1381 #define NTCREATEX_OPTIONS_PRIVATE_DENY_FCB     0x00020000
     1144 * We reuse some ignored flags for private use. Passed in the private_flags
     1145 * argument.
     1146 */
     1147#define NTCREATEX_OPTIONS_PRIVATE_DENY_DOS     0x0001
     1148#define NTCREATEX_OPTIONS_PRIVATE_DENY_FCB     0x0002
    13821149
    13831150/* Private options for streams support */
    1384 #define NTCREATEX_OPTIONS_PRIVATE_STREAM_DELETE 0x00040000
     1151#define NTCREATEX_OPTIONS_PRIVATE_STREAM_DELETE 0x0004
     1152
     1153/* Private options for printer support */
     1154#define NTCREATEX_OPTIONS_PRIVATE_DELETE_ON_CLOSE 0x0008
    13851155
    13861156/* Responses when opening a file. */
     
    14731243#endif
    14741244
    1475 #ifndef SIGNAL_CAST
    1476 #define SIGNAL_CAST (RETSIGTYPE (*)(int))
    1477 #endif
    1478 
    14791245#ifndef SELECT_CAST
    14801246#define SELECT_CAST
     
    15851351};
    15861352
    1587 /* LDAP schema types */
    1588 enum schema_types {SCHEMA_COMPAT, SCHEMA_AD, SCHEMA_SAMBA};
    1589 
    15901353/* LDAP SSL options */
    15911354enum ldap_ssl_types {LDAP_SSL_OFF, LDAP_SSL_START_TLS};
     
    15931356/* LDAP PASSWD SYNC methods */
    15941357enum ldap_passwd_sync_types {LDAP_PASSWD_SYNC_ON, LDAP_PASSWD_SYNC_OFF, LDAP_PASSWD_SYNC_ONLY};
     1358
     1359/*
     1360 * This should be under the HAVE_KRB5 flag but since they're used
     1361 * in lp_kerberos_method(), they ned to be always available
     1362 * If you add any entries to KERBEROS_VERIFY defines, please modify USE.*KEYTAB macros
     1363 * so they remain accurate.
     1364 */
     1365
     1366#define KERBEROS_VERIFY_SECRETS 0
     1367#define KERBEROS_VERIFY_SYSTEM_KEYTAB 1
     1368#define KERBEROS_VERIFY_DEDICATED_KEYTAB 2
     1369#define KERBEROS_VERIFY_SECRETS_AND_KEYTAB 3
    15951370
    15961371/* Remote architectures we know about. */
    15971372enum remote_arch_types {RA_UNKNOWN, RA_WFWG, RA_OS2, RA_WIN95, RA_WINNT,
    15981373                        RA_WIN2K, RA_WINXP, RA_WIN2K3, RA_VISTA,
    1599                         RA_SAMBA, RA_CIFSFS, RA_WINXP64};
     1374                        RA_SAMBA, RA_CIFSFS, RA_WINXP64, RA_OSX};
    16001375
    16011376/* case handling */
     
    17921567
    17931568/* A netbios node status array element. */
    1794 typedef struct node_status_ {
     1569struct node_status {
    17951570        nstring name;
    17961571        unsigned char type;
    17971572        unsigned char flags;
    1798 } NODE_STATUS_STRUCT;
     1573};
    17991574
    18001575/* The extra info from a NetBIOS node status query */
     
    18121587        int homes_snum;
    18131588
    1814         struct auth_serversupplied_info *server_info;
     1589        struct auth_serversupplied_info *session_info;
    18151590
    18161591        struct auth_ntlmssp_state *auth_ntlmssp_state;
     
    18251600
    18261601/*
    1827  * Size of new password account encoding string.  This is enough space to
    1828  * hold 11 ACB characters, plus the surrounding [] and a terminating null.
    1829  * Do not change unless you are adding new ACB bits!
    1830  */
    1831 
    1832 #define NEW_PW_FORMAT_SPACE_PADDED_LEN 14
    1833 
    1834 /*
    18351602   Do you want session setups at user level security with a invalid
    18361603   password to be rejected or allowed in as guest? WinNT rejects them
     
    18651632
    18661633#define DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH 14
    1867 
    1868 #include "popt_common.h"
    18691634
    18701635#define PORT_NONE       0
     
    18791644        unsigned port;
    18801645};
    1881 
    1882 /* Special name type used to cause a _kerberos DNS lookup. */
    1883 #define KDC_NAME_TYPE 0xDCDC
    18841646
    18851647struct ea_struct {
     
    19021664/* Prefix for xattrs storing streams. */
    19031665#define SAMBA_XATTR_MARKER "user.SAMBA_STREAMS"
    1904 
    1905 #define UUID_SIZE 16
    1906 
    1907 #define UUID_FLAT_SIZE 16
    1908 typedef struct uuid_flat {
    1909         uint8 info[UUID_FLAT_SIZE];
    1910 } UUID_FLAT;
    19111666
    19121667/* map readonly options */
     
    19261681                USERSHARE_PATH_NOT_ALLOWED,
    19271682                USERSHARE_PATH_NOT_DIRECTORY,
    1928                 USERSHARE_POSIX_ERR
     1683                USERSHARE_POSIX_ERR,
     1684                USERSHARE_MALFORMED_SHARENAME_DEF,
     1685                USERSHARE_BAD_SHARENAME
    19291686};
    19301687
     
    19751732};
    19761733
     1734/* Used to keep track of deferred opens. */
     1735struct deferred_open_record;
     1736
     1737/* Client-side offline caching policy types */
     1738#define CSC_POLICY_MANUAL 0
     1739#define CSC_POLICY_DOCUMENTS 1
     1740#define CSC_POLICY_PROGRAMS 2
     1741#define CSC_POLICY_DISABLE 3
     1742
     1743/* Used inside aio code. */
     1744struct aio_extra;
     1745
     1746/*
     1747 * Reasons for cache flush.
     1748 */
     1749
     1750enum flush_reason_enum {
     1751    SEEK_FLUSH,
     1752    READ_FLUSH,
     1753    WRITE_FLUSH,
     1754    READRAW_FLUSH,
     1755    OPLOCK_RELEASE_FLUSH,
     1756    CLOSE_FLUSH,
     1757    SYNC_FLUSH,
     1758    SIZECHANGE_FLUSH,
     1759    /* NUM_FLUSH_REASONS must remain the last value in the enumeration. */
     1760    NUM_FLUSH_REASONS};
     1761
    19771762#endif /* _SMB_H */
Note: See TracChangeset for help on using the changeset viewer.