diff options
author | Gerald Carter <jerry@samba.org> | 2003-09-09 04:07:32 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2003-09-09 04:07:32 +0000 |
commit | 4093bf7ff8c8861cf7b941945ede53a8ec5bb6c8 (patch) | |
tree | dd0a9f32d9933e1f75d919b5083e007d7453f9c4 /source3/include | |
parent | 3d7cb49747a9a7f5cdec0ee05c6270ec3604202f (diff) | |
download | samba-4093bf7ff8c8861cf7b941945ede53a8ec5bb6c8.tar.gz samba-4093bf7ff8c8861cf7b941945ede53a8ec5bb6c8.tar.bz2 samba-4093bf7ff8c8861cf7b941945ede53a8ec5bb6c8.zip |
sync 3.0 into HEAD for the last time
(This used to be commit c17a7dc9a190156a069da3e861c18fd3f81224ad)
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/.cvsignore | 1 | ||||
-rw-r--r-- | source3/include/ads.h | 2 | ||||
-rw-r--r-- | source3/include/charset.h | 87 | ||||
-rw-r--r-- | source3/include/includes.h | 10 | ||||
-rw-r--r-- | source3/include/nameserv.h | 367 | ||||
-rw-r--r-- | source3/include/ntdomain.h | 20 | ||||
-rw-r--r-- | source3/include/ntioctl.h | 19 | ||||
-rw-r--r-- | source3/include/ntlmssp.h | 1 | ||||
-rw-r--r-- | source3/include/ntquotas.h | 2 | ||||
-rw-r--r-- | source3/include/rpc_dce.h | 8 | ||||
-rw-r--r-- | source3/include/rpc_ds.h | 13 | ||||
-rw-r--r-- | source3/include/rpc_lsa.h | 6 | ||||
-rw-r--r-- | source3/include/rpc_samr.h | 14 | ||||
-rwxr-xr-x | source3/include/rpc_spoolss.h | 6 | ||||
-rw-r--r-- | source3/include/safe_string.h | 1 | ||||
-rw-r--r-- | source3/include/secrets.h | 17 | ||||
-rw-r--r-- | source3/include/smb.h | 12 | ||||
-rw-r--r-- | source3/include/smb_macros.h | 6 | ||||
-rw-r--r-- | source3/include/spnego.h | 65 | ||||
-rw-r--r-- | source3/include/trans2.h | 2 | ||||
-rw-r--r-- | source3/include/version.h | 9 | ||||
-rw-r--r-- | source3/include/vfs.h | 9 | ||||
-rw-r--r-- | source3/include/vfs_macros.h | 3 |
23 files changed, 464 insertions, 216 deletions
diff --git a/source3/include/.cvsignore b/source3/include/.cvsignore index bff248727f..7dff121f14 100644 --- a/source3/include/.cvsignore +++ b/source3/include/.cvsignore @@ -4,3 +4,4 @@ stamp-h proto.h wrepld_proto.h config.h.in +version.h diff --git a/source3/include/ads.h b/source3/include/ads.h index 0961c9581c..b85ad21fba 100644 --- a/source3/include/ads.h +++ b/source3/include/ads.h @@ -218,6 +218,6 @@ typedef void **ADS_MODLIST; /* The older versions of heimdal that don't have this define don't seem to use it anyway. I'm told they always use a subkey */ -#ifndef AP_OPTS_USE_SUBKEY +#ifndef HAVE_AP_OPTS_USE_SUBKEY #define AP_OPTS_USE_SUBKEY 0 #endif diff --git a/source3/include/charset.h b/source3/include/charset.h index f999a9cf72..7a9b12ef55 100644 --- a/source3/include/charset.h +++ b/source3/include/charset.h @@ -38,3 +38,90 @@ struct charset_functions { struct charset_functions *prev, *next; }; +/* + * This is auxiliary struct used by source/script/gen-8-bit-gap.sh script + * during generation of an encoding table for charset module + * */ + +struct charset_gap_table { + uint16 start; + uint16 end; + int32 idx; +}; + +/* + * Define stub for charset module which implements 8-bit encoding with gaps. + * Encoding tables for such module should be produced from glibc's CHARMAPs + * using script source/script/gen-8bit-gap.sh + * CHARSETNAME is CAPITALIZED charset name + * + * */ +#define SMB_GENERATE_CHARSET_MODULE_8_BIT_GAP(CHARSETNAME) \ +static size_t CHARSETNAME ## _push(void *cd, char **inbuf, size_t *inbytesleft, \ + char **outbuf, size_t *outbytesleft) \ +{ \ + while (*inbytesleft >= 2 && *outbytesleft >= 1) { \ + int i; \ + int done = 0; \ + \ + uint16 ch = SVAL(*inbuf,0); \ + \ + for (i=0; from_idx[i].start != 0xffff; i++) { \ + if ((from_idx[i].start <= ch) && (from_idx[i].end >= ch)) { \ + ((unsigned char*)(*outbuf))[0] = from_ucs2[from_idx[i].idx+ch]; \ + (*inbytesleft) -= 2; \ + (*outbytesleft) -= 1; \ + (*inbuf) += 2; \ + (*outbuf) += 1; \ + done = 1; \ + break; \ + } \ + } \ + if (!done) { \ + errno = EINVAL; \ + return -1; \ + } \ + \ + } \ + \ + if (*inbytesleft == 1) { \ + errno = EINVAL; \ + return -1; \ + } \ + \ + if (*inbytesleft > 1) { \ + errno = E2BIG; \ + return -1; \ + } \ + \ + return 0; \ +} \ + \ +static size_t CHARSETNAME ## _pull(void *cd, char **inbuf, size_t *inbytesleft, \ + char **outbuf, size_t *outbytesleft) \ +{ \ + while (*inbytesleft >= 1 && *outbytesleft >= 2) { \ + *(uint16*)(*outbuf) = to_ucs2[((unsigned char*)(*inbuf))[0]]; \ + (*inbytesleft) -= 1; \ + (*outbytesleft) -= 2; \ + (*inbuf) += 1; \ + (*outbuf) += 2; \ + } \ + \ + if (*inbytesleft > 0) { \ + errno = E2BIG; \ + return -1; \ + } \ + \ + return 0; \ +} \ + \ +struct charset_functions CHARSETNAME ## _functions = \ + {#CHARSETNAME, CHARSETNAME ## _pull, CHARSETNAME ## _push}; \ + \ +NTSTATUS charset_ ## CHARSETNAME ## _init(void) \ +{ \ + return smb_register_charset(& CHARSETNAME ## _functions); \ +} \ + + diff --git a/source3/include/includes.h b/source3/include/includes.h index eb7f73b9d3..29bb53980f 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -437,6 +437,10 @@ #include <com_err.h> #endif +#if HAVE_SYS_ATTRIBUTES_H +#include <sys/attributes.h> +#endif + #if HAVE_ATTR_XATTR_H #include <attr/xattr.h> #endif @@ -958,10 +962,6 @@ struct smb_ldap_privates; #define SYNC_DNS 1 #endif -#ifndef MAXPATHLEN -#define MAXPATHLEN 256 -#endif - #ifndef SEEK_SET #define SEEK_SET 0 #endif @@ -1278,7 +1278,7 @@ time_t timegm(struct tm *tm); #if defined(HAVE_KRB5) -#ifndef KRB5_SET_REAL_TIME +#ifndef HAVE_KRB5_SET_REAL_TIME krb5_error_code krb5_set_real_time(krb5_context context, int32_t seconds, int32_t microseconds); #endif diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 14561cf44d..1e867d620b 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -176,124 +176,116 @@ enum name_source {LMHOSTS_NAME, REGISTER_NAME, SELF_NAME, DNS_NAME, enum node_type {B_NODE=0, P_NODE=1, M_NODE=2, NBDD_NODE=3}; enum packet_type {NMB_PACKET, DGRAM_PACKET}; -enum master_state -{ - MST_NONE, - MST_POTENTIAL, - MST_BACKUP, - MST_MSB, - MST_BROWSER, - MST_UNBECOMING_MASTER +enum master_state { + MST_NONE, + MST_POTENTIAL, + MST_BACKUP, + MST_MSB, + MST_BROWSER, + MST_UNBECOMING_MASTER }; -enum domain_state -{ - DOMAIN_NONE, - DOMAIN_WAIT, - DOMAIN_MST +enum domain_state { + DOMAIN_NONE, + DOMAIN_WAIT, + DOMAIN_MST }; -enum logon_state -{ - LOGON_NONE, - LOGON_WAIT, - LOGON_SRV +enum logon_state { + LOGON_NONE, + LOGON_WAIT, + LOGON_SRV }; struct subnet_record; -struct nmb_data -{ - uint16 nb_flags; /* Netbios flags. */ - int num_ips; /* Number of ip entries. */ - struct in_addr *ip; /* The ip list for this name. */ +struct nmb_data { + uint16 nb_flags; /* Netbios flags. */ + int num_ips; /* Number of ip entries. */ + struct in_addr *ip; /* The ip list for this name. */ - enum name_source source; /* Where the name came from. */ + enum name_source source; /* Where the name came from. */ - time_t death_time; /* The time the record must be removed (do not remove if 0). */ - time_t refresh_time; /* The time the record should be refreshed. */ + time_t death_time; /* The time the record must be removed (do not remove if 0). */ + time_t refresh_time; /* The time the record should be refreshed. */ - SMB_BIG_UINT id; /* unique id */ - struct in_addr wins_ip; /* the adress of the wins server this record comes from */ + SMB_BIG_UINT id; /* unique id */ + struct in_addr wins_ip; /* the adress of the wins server this record comes from */ - int wins_flags; /* similar to the netbios flags but different ! */ + int wins_flags; /* similar to the netbios flags but different ! */ }; /* This structure represents an entry in a local netbios name list. */ -struct name_record - { - ubi_trNode node[1]; - struct subnet_record *subnet; - struct nmb_name name; /* The netbios name. */ - struct nmb_data data; /* The netbios data. */ - }; +struct name_record { + ubi_trNode node[1]; + struct subnet_record *subnet; + struct nmb_name name; /* The netbios name. */ + struct nmb_data data; /* The netbios data. */ +}; /* Browser cache for synchronising browse lists. */ -struct browse_cache_record - { - ubi_dlNode node[1]; - pstring lmb_name; - pstring work_group; - struct in_addr ip; - time_t sync_time; - time_t death_time; /* The time the record must be removed. */ - }; +struct browse_cache_record { + ubi_dlNode node[1]; + nstring lmb_name; + nstring work_group; + struct in_addr ip; + time_t sync_time; + time_t death_time; /* The time the record must be removed. */ +}; /* This is used to hold the list of servers in my domain, and is contained within lists of domains. */ -struct server_record -{ - struct server_record *next; - struct server_record *prev; +struct server_record { + struct server_record *next; + struct server_record *prev; - struct subnet_record *subnet; + struct subnet_record *subnet; - struct server_info_struct serv; - time_t death_time; + struct server_info_struct serv; + time_t death_time; }; /* A workgroup structure. It contains a list of servers. */ -struct work_record -{ - struct work_record *next; - struct work_record *prev; +struct work_record { + struct work_record *next; + struct work_record *prev; - struct subnet_record *subnet; + struct subnet_record *subnet; - struct server_record *serverlist; + struct server_record *serverlist; - /* Stage of development from non-local-master up to local-master browser. */ - enum master_state mst_state; + /* Stage of development from non-local-master up to local-master browser. */ + enum master_state mst_state; - /* Stage of development from non-domain-master to domain-master browser. */ - enum domain_state dom_state; + /* Stage of development from non-domain-master to domain-master browser. */ + enum domain_state dom_state; - /* Stage of development from non-logon-server to logon server. */ - enum logon_state log_state; + /* Stage of development from non-logon-server to logon server. */ + enum logon_state log_state; - /* Work group info. */ - fstring work_group; - int token; /* Used when communicating with backup browsers. */ - fstring local_master_browser_name; /* Current local master browser. */ + /* Work group info. */ + nstring work_group; + int token; /* Used when communicating with backup browsers. */ + nstring local_master_browser_name; /* Current local master browser. */ - /* Announce info. */ - time_t lastannounce_time; - int announce_interval; - BOOL needannounce; + /* Announce info. */ + time_t lastannounce_time; + int announce_interval; + BOOL needannounce; - /* Timeout time for this workgroup. 0 means permanent. */ - time_t death_time; + /* Timeout time for this workgroup. 0 means permanent. */ + time_t death_time; - /* Election info */ - BOOL RunningElection; - BOOL needelection; - int ElectionCount; - uint32 ElectionCriterion; + /* Election info */ + BOOL RunningElection; + BOOL needelection; + int ElectionCount; + uint32 ElectionCriterion; - /* Domain master browser info. Used for efficient syncs. */ - struct nmb_name dmb_name; - struct in_addr dmb_addr; + /* Domain master browser info. Used for efficient syncs. */ + struct nmb_name dmb_name; + struct in_addr dmb_addr; }; /* typedefs needed to define copy & free functions for userdata. */ @@ -305,10 +297,10 @@ typedef void (*userdata_free_fn)(struct userdata_struct *); /* Structure to define any userdata passed around. */ struct userdata_struct { - userdata_copy_fn copy_fn; - userdata_free_fn free_fn; - unsigned int userdata_len; - char data[16]; /* 16 is to ensure alignment/padding on all systems */ + userdata_copy_fn copy_fn; + userdata_free_fn free_fn; + unsigned int userdata_len; + char data[16]; /* 16 is to ensure alignment/padding on all systems */ }; struct response_record; @@ -382,33 +374,32 @@ typedef void (*node_status_fail_function)( struct subnet_record *, /* Initiated name queries are recorded in this list to track any responses. */ -struct response_record -{ - struct response_record *next; - struct response_record *prev; +struct response_record { + struct response_record *next; + struct response_record *prev; - uint16 response_id; + uint16 response_id; - /* Callbacks for packets received or not. */ - response_function resp_fn; - timeout_response_function timeout_fn; + /* Callbacks for packets received or not. */ + response_function resp_fn; + timeout_response_function timeout_fn; - /* Callbacks for the request succeeding or not. */ - success_function success_fn; - fail_function fail_fn; + /* Callbacks for the request succeeding or not. */ + success_function success_fn; + fail_function fail_fn; - struct packet_struct *packet; + struct packet_struct *packet; - struct userdata_struct *userdata; + struct userdata_struct *userdata; - int num_msgs; + int num_msgs; - time_t repeat_time; - time_t repeat_interval; - int repeat_count; + time_t repeat_time; + time_t repeat_interval; + int repeat_count; - /* Recursion protection. */ - BOOL in_expiration_processing; + /* Recursion protection. */ + BOOL in_expiration_processing; }; /* A subnet structure. It contains a list of workgroups and netbios names. */ @@ -420,42 +411,41 @@ struct response_record */ enum subnet_type { - NORMAL_SUBNET = 0, /* Subnet listed in interfaces list. */ - UNICAST_SUBNET = 1, /* Subnet for unicast packets. */ - REMOTE_BROADCAST_SUBNET = 2, /* Subnet for remote broadcasts. */ - WINS_SERVER_SUBNET = 3 /* Only created if we are a WINS server. */ + NORMAL_SUBNET = 0, /* Subnet listed in interfaces list. */ + UNICAST_SUBNET = 1, /* Subnet for unicast packets. */ + REMOTE_BROADCAST_SUBNET = 2, /* Subnet for remote broadcasts. */ + WINS_SERVER_SUBNET = 3 /* Only created if we are a WINS server. */ }; -struct subnet_record -{ - struct subnet_record *next; - struct subnet_record *prev; +struct subnet_record { + struct subnet_record *next; + struct subnet_record *prev; - char *subnet_name; /* For Debug identification. */ - enum subnet_type type; /* To catagorize the subnet. */ + char *subnet_name; /* For Debug identification. */ + enum subnet_type type; /* To catagorize the subnet. */ - struct work_record *workgrouplist; /* List of workgroups. */ - ubi_trRoot namelist[1]; /* List of netbios names. */ - struct response_record *responselist; /* List of responses expected. */ + struct work_record *workgrouplist; /* List of workgroups. */ + ubi_trRoot namelist[1]; /* List of netbios names. */ + struct response_record *responselist; /* List of responses expected. */ - BOOL namelist_changed; - BOOL work_changed; + BOOL namelist_changed; + BOOL work_changed; - struct in_addr bcast_ip; - struct in_addr mask_ip; - struct in_addr myip; - int nmb_sock; /* socket to listen for unicast 137. */ - int dgram_sock; /* socket to listen for unicast 138. */ + struct in_addr bcast_ip; + struct in_addr mask_ip; + struct in_addr myip; + int nmb_sock; /* socket to listen for unicast 137. */ + int dgram_sock; /* socket to listen for unicast 138. */ }; /* A resource record. */ struct res_rec { - struct nmb_name rr_name; - int rr_type; - int rr_class; - int ttl; - int rdlength; - char rdata[MAX_DGRAM_SIZE]; + struct nmb_name rr_name; + int rr_type; + int rr_class; + int ttl; + int rdlength; + char rdata[MAX_DGRAM_SIZE]; }; /* Define these so we can pass info back to caller of name_query */ @@ -467,35 +457,34 @@ struct res_rec { #define NM_FLAGS_B 0x01 /* Broadcast */ /* An nmb packet. */ -struct nmb_packet -{ - struct { - int name_trn_id; - int opcode; - BOOL response; - struct { - BOOL bcast; - BOOL recursion_available; - BOOL recursion_desired; - BOOL trunc; - BOOL authoritative; - } nm_flags; - int rcode; - int qdcount; - int ancount; - int nscount; - int arcount; - } header; - - struct { - struct nmb_name question_name; - int question_type; - int question_class; - } question; - - struct res_rec *answers; - struct res_rec *nsrecs; - struct res_rec *additional; +struct nmb_packet { + struct { + int name_trn_id; + int opcode; + BOOL response; + struct { + BOOL bcast; + BOOL recursion_available; + BOOL recursion_desired; + BOOL trunc; + BOOL authoritative; + } nm_flags; + int rcode; + int qdcount; + int ancount; + int nscount; + int arcount; + } header; + + struct { + struct nmb_name question_name; + int question_type; + int question_class; + } question; + + struct res_rec *answers; + struct res_rec *nsrecs; + struct res_rec *additional; }; /* msg_type field options - from rfc1002. */ @@ -511,23 +500,23 @@ struct nmb_packet /* A datagram - this normally contains SMB data in the data[] array. */ struct dgram_packet { - struct { - int msg_type; - struct { - enum node_type node_type; - BOOL first; - BOOL more; - } flags; - int dgm_id; - struct in_addr source_ip; - int source_port; - int dgm_length; - int packet_offset; - } header; - struct nmb_name source_name; - struct nmb_name dest_name; - int datasize; - char data[MAX_DGRAM_SIZE]; + struct { + int msg_type; + struct { + enum node_type node_type; + BOOL first; + BOOL more; + } flags; + int dgm_id; + struct in_addr source_ip; + int source_port; + int dgm_length; + int packet_offset; + } header; + struct nmb_name source_name; + struct nmb_name dest_name; + int datasize; + char data[MAX_DGRAM_SIZE]; }; /* Define a structure used to queue packets. This will be a linked @@ -535,18 +524,18 @@ struct dgram_packet { struct packet_struct { - struct packet_struct *next; - struct packet_struct *prev; - BOOL locked; - struct in_addr ip; - int port; - int fd; - time_t timestamp; - enum packet_type packet_type; - union { - struct nmb_packet nmb; - struct dgram_packet dgram; - } packet; + struct packet_struct *next; + struct packet_struct *prev; + BOOL locked; + struct in_addr ip; + int port; + int fd; + time_t timestamp; + enum packet_type packet_type; + union { + struct nmb_packet nmb; + struct dgram_packet dgram; + } packet; }; /* NETLOGON opcodes */ diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index b6ab4fd0c5..ccbc190c59 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -165,10 +165,21 @@ struct dcinfo }; +typedef struct pipe_rpc_fns { + + struct pipe_rpc_fns *next, *prev; + + /* RPC function table associated with the current rpc_bind (associated by context) */ + + struct api_struct *cmds; + int n_cmds; + uint32 context_id; + +} PIPE_RPC_FNS; + /* * DCE/RPC-specific samba-internal-specific handling of data on * NamedPipes. - * */ typedef struct pipes_struct @@ -180,7 +191,12 @@ typedef struct pipes_struct fstring name; fstring pipe_srv_name; - + + /* linked list of rpc dispatch tables associated + with the open rpc contexts */ + + PIPE_RPC_FNS *contexts; + RPC_HDR hdr; /* Incoming RPC header. */ RPC_HDR_REQ hdr_req; /* Incoming request header. */ diff --git a/source3/include/ntioctl.h b/source3/include/ntioctl.h index 17791fde18..9814c88e5e 100644 --- a/source3/include/ntioctl.h +++ b/source3/include/ntioctl.h @@ -23,6 +23,8 @@ we only need the sparse flag */ +#ifndef _NTIOCTL_H +#define _NTIOCTL_H /* IOCTL information */ /* List of ioctl function codes that look to be of interest to remote clients like this. */ @@ -53,6 +55,8 @@ #define FSCTL_SIS_COPYFILE 0x00090100 #define FSCTL_SIS_LINK_FILES 0x0009C104 +#define FSCTL_GET_SHADOW_COPY_DATA 0x00144064 /* KJC -- Shadow Copy information */ + #if 0 #define FSCTL_SECURITY_ID_CHECK #define FSCTL_DISMOUNT_VOLUME @@ -66,3 +70,18 @@ #define IO_REPARSE_TAG_MOUNT_POINT 0xA0000003 #define IO_REPARSE_TAG_HSM 0xC0000004 #define IO_REPARSE_TAG_SIS 0x80000007 + + +/* For FSCTL_GET_SHADOW_COPY_DATA ...*/ +typedef char SHADOW_COPY_LABEL[25]; + +typedef struct shadow_copy_data { + TALLOC_CTX *mem_ctx; + /* Total number of shadow volumes currently mounted */ + uint32 num_volumes; + /* Concatenated list of labels */ + SHADOW_COPY_LABEL *labels; +} SHADOW_COPY_DATA; + + +#endif /* _NTIOCTL_H */ diff --git a/source3/include/ntlmssp.h b/source3/include/ntlmssp.h index 562e4853cc..f1b1bc25e4 100644 --- a/source3/include/ntlmssp.h +++ b/source3/include/ntlmssp.h @@ -100,6 +100,7 @@ typedef struct ntlmssp_client_state char *domain; char *workstation; char *password; + char *server_domain; const char *(*get_global_myname)(void); const char *(*get_domain)(void); diff --git a/source3/include/ntquotas.h b/source3/include/ntquotas.h index 1425e59bb8..dac1173770 100644 --- a/source3/include/ntquotas.h +++ b/source3/include/ntquotas.h @@ -72,7 +72,7 @@ typedef struct _SMB_NTQUOTA_STRUCT { SMB_BIG_UINT usedspace; SMB_BIG_UINT softlim; SMB_BIG_UINT hardlim; - enum SMB_QUOTA_TYPE qflags; + uint32 qflags; DOM_SID sid; } SMB_NTQUOTA_STRUCT; diff --git a/source3/include/rpc_dce.h b/source3/include/rpc_dce.h index dc82f45368..2e4a418bb7 100644 --- a/source3/include/rpc_dce.h +++ b/source3/include/rpc_dce.h @@ -78,8 +78,8 @@ enum netsec_direction #define AUTH_PIPE_NETSEC 0x0008 /* Maximum PDU fragment size. */ -#define MAX_PDU_FRAG_LEN 0x1630 -/* #define MAX_PDU_FRAG_LEN 0x10b8 this is what w2k sets */ +/* #define MAX_PDU_FRAG_LEN 0x1630 this is what wnt sets */ +#define MAX_PDU_FRAG_LEN 0x10b8 /* this is what w2k sets */ /* * Actual structure of a DCE UUID @@ -136,8 +136,8 @@ typedef struct rpc_hdr_info typedef struct rpc_hdr_req_info { uint32 alloc_hint; /* allocation hint - data size (bytes) minus header and tail. */ - uint16 context_id; /* 0 - presentation context identifier */ - uint16 opnum; /* opnum */ + uint16 context_id; /* presentation context identifier */ + uint16 opnum; /* opnum */ } RPC_HDR_REQ; diff --git a/source3/include/rpc_ds.h b/source3/include/rpc_ds.h index 7350fdba1f..e2622be532 100644 --- a/source3/include/rpc_ds.h +++ b/source3/include/rpc_ds.h @@ -27,6 +27,7 @@ /* Opcodes available on PIPE_LSARPC_DS */ #define DS_GETPRIMDOMINFO 0x00 +#define DS_NOP 0xFF /* no op -- placeholder */ /* Opcodes available on PIPE_NETLOGON */ @@ -35,11 +36,23 @@ /* macros for RPC's */ +/* DSROLE_PRIMARY_DOMAIN_INFO_BASIC */ + +/* flags */ + #define DSROLE_PRIMARY_DS_RUNNING 0x00000001 #define DSROLE_PRIMARY_DS_MIXED_MODE 0x00000002 #define DSROLE_UPGRADE_IN_PROGRESS 0x00000004 #define DSROLE_PRIMARY_DOMAIN_GUID_PRESENT 0x01000000 +/* machine role */ + +#define DSROLE_STANDALONE_SRV 2 +#define DSROLE_DOMAIN_MEMBER_SRV 3 +#define DSROLE_BDC 4 +#define DSROLE_PDC 5 + + typedef struct { uint16 machine_role; diff --git a/source3/include/rpc_lsa.h b/source3/include/rpc_lsa.h index 135fd76d6c..fa49d76c88 100644 --- a/source3/include/rpc_lsa.h +++ b/source3/include/rpc_lsa.h @@ -27,6 +27,12 @@ /* Opcodes available on PIPE_LSARPC */ +#if 0 /* UNIMPLEMENTED */ + +#define LSA_LOOKUPSIDS2 0x39 + +#endif + #define LSA_CLOSE 0x00 #define LSA_DELETE 0x01 #define LSA_ENUM_PRIVS 0x02 diff --git a/source3/include/rpc_samr.h b/source3/include/rpc_samr.h index 8ec274176a..4d9ad0b2e1 100644 --- a/source3/include/rpc_samr.h +++ b/source3/include/rpc_samr.h @@ -127,7 +127,7 @@ SamrTestPrivateFunctionsUser #define SAMR_UNKNOWN_2a 0x2a #define SAMR_UNKNOWN_2b 0x2b #define SAMR_GET_USRDOM_PWINFO 0x2c -#define SAMR_UNKNOWN_2D 0x2d +#define SAMR_REMOVE_USER_FOREIGN_DOMAIN 0x2d #define SAMR_UNKNOWN_2E 0x2e /* looks like an alias for SAMR_QUERY_DOMAIN_INFO */ #define SAMR_UNKNOWN_2f 0x2f #define SAMR_QUERY_DISPINFO3 0x30 /* Alias for SAMR_QUERY_DISPINFO @@ -1786,21 +1786,21 @@ typedef struct r_samr_chgpasswd_user_info } SAMR_R_CHGPASSWD_USER; -/* SAMR_Q_UNKNOWN_2D */ -typedef struct q_samr_unknown_2d_info +/* SAMR_Q_REMOVE_USER_FOREIGN_DOMAIN */ +typedef struct q_samr_remove_user_foreign_domain_info { POLICY_HND dom_pol; /* policy handle */ DOM_SID2 sid; /* SID */ -} SAMR_Q_UNKNOWN_2D; +} SAMR_Q_REMOVE_USER_FOREIGN_DOMAIN; -/* SAMR_R_UNKNOWN_2D - probably an open */ -typedef struct r_samr_unknown_2d_info +/* SAMR_R_REMOVE_USER_FOREIGN_DOMAIN */ +typedef struct r_samr_remove_user_foreign_domain_info { NTSTATUS status; /* return status */ -} SAMR_R_UNKNOWN_2D; +} SAMR_R_REMOVE_USER_FOREIGN_DOMAIN; diff --git a/source3/include/rpc_spoolss.h b/source3/include/rpc_spoolss.h index c2e3d92787..f96b4fa96a 100755 --- a/source3/include/rpc_spoolss.h +++ b/source3/include/rpc_spoolss.h @@ -1302,6 +1302,12 @@ typedef struct s_port_info_2 } PORT_INFO_2; +/* Port Type bits */ +#define PORT_TYPE_WRITE 0x0001 +#define PORT_TYPE_READ 0x0002 +#define PORT_TYPE_REDIRECTED 0x0004 +#define PORT_TYPE_NET_ATTACHED 0x0008 + typedef struct spool_q_enumports { uint32 name_ptr; diff --git a/source3/include/safe_string.h b/source3/include/safe_string.h index 6656f4f6bb..07578b2424 100644 --- a/source3/include/safe_string.h +++ b/source3/include/safe_string.h @@ -124,6 +124,7 @@ size_t __unsafe_string_function_usage_here_char__(void); #define pstrcat(d,s) safe_strcat((d), (s),sizeof(pstring)-1) #define fstrcpy(d,s) safe_strcpy((d),(s),sizeof(fstring)-1) #define fstrcat(d,s) safe_strcat((d),(s),sizeof(fstring)-1) +#define nstrcpy(d,s) safe_strcpy((d), (s),sizeof(nstring)-1) /* the addition of the DEVELOPER checks in safe_strcpy means we must * update a lot of code. To make this a little easier here are some diff --git a/source3/include/secrets.h b/source3/include/secrets.h index dacfef26ea..cb4fbd043a 100644 --- a/source3/include/secrets.h +++ b/source3/include/secrets.h @@ -77,5 +77,22 @@ typedef struct trustdom { DOM_SID sid; } TRUSTDOM; +/* + * Format of an OpenAFS keyfile + */ + +#define SECRETS_AFS_MAXKEYS 8 + +struct afs_key { + uint32 kvno; + char key[8]; +}; + +struct afs_keyfile { + uint32 nkeys; + struct afs_key entry[SECRETS_AFS_MAXKEYS]; +}; + +#define SECRETS_AFS_KEYFILE "SECRETS/AFS_KEYFILE" #endif /* _SECRETS_H */ diff --git a/source3/include/smb.h b/source3/include/smb.h index deeb61034d..8c6f47f23f 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -390,7 +390,9 @@ typedef struct files_struct SMB_OFF_T pos; SMB_BIG_UINT size; SMB_BIG_UINT initial_allocation_size; /* Faked up initial allocation on disk. */ + SMB_BIG_UINT position_information; mode_t mode; + uint16 file_pid; uint16 vuid; write_bmpx_struct *wbmpx_ptr; write_cache *wcp; @@ -1482,17 +1484,19 @@ struct cnotify_fns { #include "smb_macros.h" +typedef char nstring[16]; + /* A netbios name structure. */ struct nmb_name { - char name[17]; - char scope[64]; - unsigned int name_type; + nstring name; + char scope[64]; + unsigned int name_type; }; /* A netbios node status array element. */ struct node_status { - char name[16]; + nstring name; unsigned char type; unsigned char flags; }; diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index 21ccdf295c..178fd9c358 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -77,6 +77,12 @@ #define OPEN_CONN(conn) ((conn) && (conn)->open) #define IS_IPC(conn) ((conn) && (conn)->ipc) #define IS_PRINT(conn) ((conn) && (conn)->printer) +#define FSP_BELONGS_CONN(fsp,conn) do {\ + extern struct current_user current_user;\ + if (!((fsp) && (conn) && ((conn)==(fsp)->conn) && (current_user.vuid==(fsp)->vuid))) \ + return(ERROR_DOS(ERRDOS,ERRbadfid));\ + } while(0) + #define FNUM_OK(fsp,c) (OPEN_FSP(fsp) && (c)==(fsp)->conn && current_user.vuid==(fsp)->vuid) #define CHECK_FSP(fsp,conn) do {\ diff --git a/source3/include/spnego.h b/source3/include/spnego.h new file mode 100644 index 0000000000..b6492ee3c8 --- /dev/null +++ b/source3/include/spnego.h @@ -0,0 +1,65 @@ +/* + Unix SMB/CIFS implementation. + + RFC2478 Compliant SPNEGO implementation + + Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2003 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef SAMBA_SPNEGO_H +#define SAMBA_SPNEGO_H + +#define SPNEGO_DELEG_FLAG 0x01 +#define SPNEGO_MUTUAL_FLAG 0x02 +#define SPNEGO_REPLAY_FLAG 0x04 +#define SPNEGO_SEQUENCE_FLAG 0x08 +#define SPNEGO_ANON_FLAG 0x10 +#define SPNEGO_CONF_FLAG 0x20 +#define SPNEGO_INTEG_FLAG 0x40 +#define SPNEGO_REQ_FLAG 0x80 + +#define SPNEGO_NEG_TOKEN_INIT 0 +#define SPNEGO_NEG_TOKEN_TARG 1 + +typedef enum _spnego_negResult { + SPNEGO_ACCEPT_COMPLETED = 0, + SPNEGO_ACCEPT_INCOMPLETE = 1, + SPNEGO_REJECT = 2 +} negResult_t; + +typedef struct spnego_negTokenInit { + const char **mechTypes; + int reqFlags; + DATA_BLOB mechToken; + DATA_BLOB mechListMIC; +} negTokenInit_t; + +typedef struct spnego_negTokenTarg { + uint8 negResult; + const char *supportedMech; + DATA_BLOB responseToken; + DATA_BLOB mechListMIC; +} negTokenTarg_t; + +typedef struct spnego_spnego { + int type; + negTokenInit_t negTokenInit; + negTokenTarg_t negTokenTarg; +} SPNEGO_DATA; + +#endif diff --git a/source3/include/trans2.h b/source3/include/trans2.h index eb5b1bc79f..168e647721 100644 --- a/source3/include/trans2.h +++ b/source3/include/trans2.h @@ -230,6 +230,8 @@ Byte offset Type name description #define SMB_FIND_FILE_FULL_DIRECTORY_INFO 0x102 #define SMB_FIND_FILE_NAMES_INFO 0x103 #define SMB_FIND_FILE_BOTH_DIRECTORY_INFO 0x104 +#define SMB_FIND_FILE_LEVEL_261 0x105 +#define SMB_FIND_FILE_LEVEL_262 0x106 #define SMB_SET_FILE_BASIC_INFO 0x101 #define SMB_SET_FILE_DISPOSITION_INFO 0x102 diff --git a/source3/include/version.h b/source3/include/version.h index 68bc140daf..51e8c408e6 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1,8 @@ -#define VERSION "3.0.0rc1" +/* Autogenerated by script/mkversion.sh */ +#define SAMBA_VERSION_MAJOR 3 +#define SAMBA_VERSION_MINOR 0 +#define SAMBA_VERSION_RELEASE 1 +#define SAMBA_VERSION_PRE_RELEASE 1 +#define SAMBA_VERSION_IS_CVS_SNAPSHOT 1 +#define SAMBA_VERSION_OFFICIAL_STRING "CVS 3.0.1pre1" +#define SAMBA_VERSION_STRING samba_version_string() diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 452f4dc23b..dd489702aa 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -50,8 +50,8 @@ /* Changed to version 6 for the new module system, fixed cascading and quota functions. --metze */ /* Changed to version 7 to include the get_nt_acl info parameter. JRA. */ /* Changed to version 8 includes EA calls. JRA. */ - -#define SMB_VFS_INTERFACE_VERSION 8 +/* Changed to version 9 to include the get_shadow_data call. --metze */ +#define SMB_VFS_INTERFACE_VERSION 9 /* to bug old modules witch are trying to compile with the old functions */ @@ -91,6 +91,8 @@ typedef enum _vfs_op_type { SMB_VFS_OP_DISK_FREE, SMB_VFS_OP_GET_QUOTA, SMB_VFS_OP_SET_QUOTA, + SMB_VFS_OP_GET_SHADOW_COPY_DATA, + /* Directory operations */ @@ -196,6 +198,7 @@ struct vfs_ops { SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize); int (*get_quota)(struct vfs_handle_struct *handle, struct connection_struct *conn, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt); int (*set_quota)(struct vfs_handle_struct *handle, struct connection_struct *conn, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt); + int (*get_shadow_copy_data)(struct vfs_handle_struct *handle, struct files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, BOOL labels); /* Directory operations */ @@ -293,6 +296,7 @@ struct vfs_ops { struct vfs_handle_struct *disk_free; struct vfs_handle_struct *get_quota; struct vfs_handle_struct *set_quota; + struct vfs_handle_struct *get_shadow_copy_data; /* Directory operations */ @@ -379,6 +383,7 @@ struct vfs_ops { struct vfs_handle_struct *setxattr; struct vfs_handle_struct *lsetxattr; struct vfs_handle_struct *fsetxattr; + } handles; }; diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index fdbc1516e3..c4f63c352e 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -33,6 +33,7 @@ #define SMB_VFS_DISK_FREE(conn, path, small_query, bsize, dfree ,dsize) ((conn)->vfs.ops.disk_free((conn)->vfs.handles.disk_free, (conn), (path), (small_query), (bsize), (dfree), (dsize))) #define SMB_VFS_GET_QUOTA(conn, qtype, id, qt) ((conn)->vfs.ops.get_quota((conn)->vfs.handles.get_quota, (conn), (qtype), (id), (qt))) #define SMB_VFS_SET_QUOTA(conn, qtype, id, qt) ((conn)->vfs.ops.set_quota((conn)->vfs.handles.set_quota, (conn), (qtype), (id), (qt))) +#define SMB_VFS_GET_SHADOW_COPY_DATA(fsp,shadow_copy_data,labels) ((fsp)->conn->vfs.ops.get_shadow_copy_data((fsp)->conn->vfs.handles.get_shadow_copy_data,(fsp),(shadow_copy_data),(labels))) /* Directory operations */ #define SMB_VFS_OPENDIR(conn, fname) ((conn)->vfs.ops.opendir((conn)->vfs.handles.opendir, (conn), (fname))) @@ -128,6 +129,7 @@ #define SMB_VFS_OPAQUE_DISK_FREE(conn, path, small_query, bsize, dfree ,dsize) ((conn)->vfs_opaque.ops.disk_free((conn)->vfs_opaque.handles.disk_free, (conn), (path), (small_query), (bsize), (dfree), (dsize))) #define SMB_VFS_OPAQUE_GET_QUOTA(conn, qtype, id, qt) ((conn)->vfs_opaque.ops.get_quota((conn)->vfs_opaque.handles.get_quota, (conn), (qtype), (id), (qt))) #define SMB_VFS_OPAQUE_SET_QUOTA(conn, qtype, id, qt) ((conn)->vfs_opaque.ops.set_quota((conn)->vfs_opaque.handles.set_quota, (conn), (qtype), (id), (qt))) +#define SMB_VFS_OPAQUE_GET_SHADOW_COPY_DATA(fsp,shadow_copy_data,labels) ((fsp)->conn->vfs_opaque.ops.get_shadow_copy_data((fsp)->conn->vfs_opaque.handles.get_shadow_copy_data,(fsp),(shadow_copy_data),(labels))) /* Directory operations */ #define SMB_VFS_OPAQUE_OPENDIR(conn, fname) ((conn)->vfs_opaque.ops.opendir((conn)->vfs_opaque.handles.opendir, (conn), (fname))) @@ -223,6 +225,7 @@ #define SMB_VFS_NEXT_DISK_FREE(handle, conn, path, small_query, bsize, dfree ,dsize) ((handle)->vfs_next.ops.disk_free((handle)->vfs_next.handles.disk_free, (conn), (path), (small_query), (bsize), (dfree), (dsize))) #define SMB_VFS_NEXT_GET_QUOTA(handle, conn, qtype, id, qt) ((handle)->vfs_next.ops.get_quota((handle)->vfs_next.handles.get_quota, (conn), (qtype), (id), (qt))) #define SMB_VFS_NEXT_SET_QUOTA(handle, conn, qtype, id, qt) ((handle)->vfs_next.ops.set_quota((handle)->vfs_next.handles.set_quota, (conn), (qtype), (id), (qt))) +#define SMB_VFS_NEXT_GET_SHADOW_COPY_DATA(handle, fsp, shadow_copy_data ,labels) ((handle)->vfs_next.ops.get_shadow_copy_data((handle)->vfs_next.handles.get_shadow_copy_data,(fsp),(shadow_copy_data),(labels))) /* Directory operations */ #define SMB_VFS_NEXT_OPENDIR(handle, conn, fname) ((handle)->vfs_next.ops.opendir((handle)->vfs_next.handles.opendir, (conn), (fname))) |