diff options
author | Gerald Carter <jerry@samba.org> | 2007-02-28 14:35:26 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2007-02-28 14:35:26 +0000 |
commit | 80236f0d60ce013134c1ed5422d148e541f70a4f (patch) | |
tree | f71326fa71c0323e6b5d87b75b289d0608480f87 /source/include | |
parent | f05f5dce39b11e937fb19270b7bcc888582edf35 (diff) | |
download | samba-80236f0d60ce013134c1ed5422d148e541f70a4f.tar.gz samba-80236f0d60ce013134c1ed5422d148e541f70a4f.tar.xz samba-80236f0d60ce013134c1ed5422d148e541f70a4f.zip |
r21585: Start syncing the monster that will become 3.0.25pre1
Still todo:
* release notes
* few minor outstanding patches
* additional idmap man pages
Diffstat (limited to 'source/include')
60 files changed, 2103 insertions, 1906 deletions
diff --git a/source/include/ads.h b/source/include/ads.h index 0ef84b48058..29df0d2f353 100644 --- a/source/include/ads.h +++ b/source/include/ads.h @@ -1,3 +1,5 @@ +#ifndef _INCLUDE_ADS_H_ +#define _INCLUDE_ADS_H_ /* header for ads (active directory) library routines @@ -13,7 +15,11 @@ enum wb_posix_mapping { }; typedef struct { +#ifdef HAVE_LDAP + LDAP *ld; +#else void *ld; /* the active ldap structure */ +#endif struct in_addr ldap_ip; /* the ip of the active connection, if any */ time_t last_attempt; /* last attempt to reconnect */ int ldap_port; @@ -36,29 +42,35 @@ typedef struct { char *kdc_server; unsigned flags; int time_offset; - time_t expire; + time_t tgt_expire; + time_t tgs_expire; time_t renewable; } auth; /* info derived from the servers config */ struct { + uint32 flags; /* cldap flags identifying the services. */ char *realm; char *bind_path; char *ldap_server_name; + char *server_site_name; + char *client_site_name; time_t current_time; + int tried_closest_dc; } config; +} ADS_STRUCT; - /* info derived from the servers schema */ - struct { - enum wb_posix_mapping map_type; - char *posix_homedir_attr; - char *posix_shell_attr; - char *posix_uidnumber_attr; - char *posix_gidnumber_attr; - char *posix_gecos_attr; - } schema; +/* used to remember the names of the posix attributes in AD */ +/* see the rfc2307 & sfu nss backends */ + +struct posix_schema { + char *posix_homedir_attr; + char *posix_shell_attr; + char *posix_uidnumber_attr; + char *posix_gidnumber_attr; + char *posix_gecos_attr; +}; -} ADS_STRUCT; /* there are 5 possible types of errors the ads subsystem can produce */ enum ads_error_type {ENUM_ADS_ERROR_KRB5, ENUM_ADS_ERROR_GSS, @@ -309,3 +321,4 @@ typedef struct { int val; int critical; } ads_control; +#endif diff --git a/source/include/ads_cldap.h b/source/include/ads_cldap.h index 65feb072e0f..fd227c895db 100644 --- a/source/include/ads_cldap.h +++ b/source/include/ads_cldap.h @@ -19,6 +19,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#ifndef _INCLUDE_ADS_CLDAP_H_ +#define _INCLUDE_ADS_CLDAP_H_ + #define MAX_DNS_LABEL 255 + 1 struct cldap_netlogon_reply { @@ -35,8 +38,8 @@ struct cldap_netlogon_reply { char unk[MAX_DNS_LABEL]; char user_name[MAX_DNS_LABEL]; - char site_name[MAX_DNS_LABEL]; - char site_name_2[MAX_DNS_LABEL]; + char server_site_name[MAX_DNS_LABEL]; + char client_site_name[MAX_DNS_LABEL]; uint32 version; uint16 lmnt_token; @@ -55,4 +58,4 @@ struct cldap_netlogon_reply { #define ADS_GOOD_TIMESERV 0x00000200 /* DC has hardware clock (and running time) */ #define ADS_NDNC 0x00000400 /* DomainName is non-domain NC serviced by LDAP server */ - +#endif /* _INCLUDE_CLDAP_H_ */ diff --git a/source/include/ads_dns.h b/source/include/ads_dns.h index fed886523f1..6c3430e21b0 100644 --- a/source/include/ads_dns.h +++ b/source/include/ads_dns.h @@ -48,8 +48,14 @@ struct dns_rr_srv { uint16 weight; uint16 port; size_t num_ips; - struct in_addr *ips; /* support multi-homed hosts */ + struct in_addr *ips; /* support multi-homed hosts */ +}; + +/* NS records */ +struct dns_rr_ns { + const char *hostname; + struct in_addr ip; }; diff --git a/source/include/ads_protos.h b/source/include/ads_protos.h new file mode 100644 index 00000000000..b5f323774d3 --- /dev/null +++ b/source/include/ads_protos.h @@ -0,0 +1,95 @@ +/* + * Prototypes for ads + */ + +void ads_msgfree(ADS_STRUCT *ads, LDAPMessage *msg); +char *ads_get_dn(ADS_STRUCT *ads, LDAPMessage *msg); +char *ads_get_dn_canonical(ADS_STRUCT *ads, LDAPMessage *msg); + +char *ads_pull_string(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, LDAPMessage *msg, + const char *field); +char **ads_pull_strings(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, + LDAPMessage *msg, const char *field, + size_t *num_values); +char **ads_pull_strings_range(ADS_STRUCT *ads, + TALLOC_CTX *mem_ctx, + LDAPMessage *msg, const char *field, + char **current_strings, + const char **next_attribute, + size_t *num_strings, + BOOL *more_strings); +BOOL ads_pull_uint32(ADS_STRUCT *ads, LDAPMessage *msg, const char *field, + uint32 *v); +BOOL ads_pull_guid(ADS_STRUCT *ads, LDAPMessage *msg, struct GUID *guid); +BOOL ads_pull_sid(ADS_STRUCT *ads, LDAPMessage *msg, const char *field, + DOM_SID *sid); +int ads_pull_sids(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, + LDAPMessage *msg, const char *field, DOM_SID **sids); +BOOL ads_pull_sd(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, + LDAPMessage *msg, const char *field, SEC_DESC **sd); +char *ads_pull_username(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, + LDAPMessage *msg); +int ads_pull_sids_from_extendeddn(ADS_STRUCT *ads, + TALLOC_CTX *mem_ctx, + LDAPMessage *msg, + const char *field, + enum ads_extended_dn_flags flags, + DOM_SID **sids); + +ADS_STATUS ads_find_machine_acct(ADS_STRUCT *ads, LDAPMessage **res, + const char *machine); +ADS_STATUS ads_find_printer_on_server(ADS_STRUCT *ads, LDAPMessage **res, + const char *printer, + const char *servername); +ADS_STATUS ads_find_printers(ADS_STRUCT *ads, LDAPMessage **res); +ADS_STATUS ads_find_user_acct(ADS_STRUCT *ads, LDAPMessage **res, + const char *user); + +ADS_STATUS ads_do_search(ADS_STRUCT *ads, const char *bind_path, int scope, + const char *expr, + const char **attrs, LDAPMessage **res); +ADS_STATUS ads_search(ADS_STRUCT *ads, LDAPMessage **res, + const char *expr, const char **attrs); +ADS_STATUS ads_search_dn(ADS_STRUCT *ads, LDAPMessage **res, + const char *dn, const char **attrs); +ADS_STATUS ads_do_search_all_args(ADS_STRUCT *ads, const char *bind_path, + int scope, const char *expr, + const char **attrs, void *args, + LDAPMessage **res); +ADS_STATUS ads_do_search_all(ADS_STRUCT *ads, const char *bind_path, + int scope, const char *expr, + const char **attrs, LDAPMessage **res); +ADS_STATUS ads_do_search_retry(ADS_STRUCT *ads, const char *bind_path, + int scope, + const char *expr, + const char **attrs, LDAPMessage **res); +ADS_STATUS ads_do_search_retry_args(ADS_STRUCT *ads, const char *bind_path, + int scope, const char *expr, + const char **attrs, void *args, + LDAPMessage **res); +ADS_STATUS ads_search_retry(ADS_STRUCT *ads, LDAPMessage **res, + const char *expr, const char **attrs); +ADS_STATUS ads_search_retry_dn(ADS_STRUCT *ads, LDAPMessage **res, + const char *dn, + const char **attrs); +ADS_STATUS ads_search_retry_extended_dn(ADS_STRUCT *ads, LDAPMessage **res, + const char *dn, + const char **attrs, + enum ads_extended_dn_flags flags); +ADS_STATUS ads_search_retry_sid(ADS_STRUCT *ads, LDAPMessage **res, + const DOM_SID *sid, + const char **attrs); + + +LDAPMessage *ads_first_entry(ADS_STRUCT *ads, LDAPMessage *res); +LDAPMessage *ads_next_entry(ADS_STRUCT *ads, LDAPMessage *res); +void ads_process_results(ADS_STRUCT *ads, LDAPMessage *res, + BOOL(*fn)(char *, void **, void *), + void *data_area); +void ads_dump(ADS_STRUCT *ads, LDAPMessage *res); + +ADS_STATUS ads_parse_gpo(ADS_STRUCT *ads, + TALLOC_CTX *mem_ctx, + LDAPMessage *res, + const char *gpo_dn, + struct GROUP_POLICY_OBJECT *gpo); diff --git a/source/include/adt_tree.h b/source/include/adt_tree.h index 51b6fb1c88b..a053013a9bc 100644 --- a/source/include/adt_tree.h +++ b/source/include/adt_tree.h @@ -21,9 +21,9 @@ #ifndef ADT_TREE_H #define ADT_TREE_H -#ifndef _BOOL +#ifndef _UPPER_BOOL typedef int BOOL; -#define _BOOL +#define _UPPER_BOOL #endif diff --git a/source/include/charset.h b/source/include/charset.h index c5d03a62e89..5ac8d17486f 100644 --- a/source/include/charset.h +++ b/source/include/charset.h @@ -20,9 +20,9 @@ */ /* this defines the charset types used in samba */ -typedef enum {CH_UCS2=0, CH_UNIX=1, CH_DISPLAY=2, CH_DOS=3, CH_UTF8=4} charset_t; +typedef enum {CH_UTF16LE=0, CH_UTF16=0, CH_UNIX=1, CH_DISPLAY=2, CH_DOS=3, CH_UTF8=4, CH_UTF16BE=5} charset_t; -#define NUM_CHARSETS 5 +#define NUM_CHARSETS 6 /* * for each charset we have a function that pushes from that charset to a ucs2 @@ -119,6 +119,7 @@ static size_t CHARSETNAME ## _pull(void *cd, const char **inbuf, size_t *inbytes struct charset_functions CHARSETNAME ## _functions = \ {#CHARSETNAME, CHARSETNAME ## _pull, CHARSETNAME ## _push}; \ \ +NTSTATUS charset_ ## CHARSETNAME ## _init(void); \ NTSTATUS charset_ ## CHARSETNAME ## _init(void) \ { \ return smb_register_charset(& CHARSETNAME ## _functions); \ diff --git a/source/include/client.h b/source/include/client.h index c6d7b162fcd..dc266995c62 100644 --- a/source/include/client.h +++ b/source/include/client.h @@ -41,9 +41,9 @@ typedef struct file_info uid_t uid; gid_t gid; /* these times are normally kept in GMT */ - time_t mtime; - time_t atime; - time_t ctime; + struct timespec mtime_ts; + struct timespec atime_ts; + struct timespec ctime_ts; pstring name; pstring dir; char short_name[13*3]; /* the *3 is to cope with multi-byte */ @@ -171,14 +171,10 @@ struct cli_state { BOOL force_dos_errors; BOOL case_sensitive; /* False by default. */ - - /* was this structure allocated by cli_initialise? If so, then - free in cli_shutdown() */ - BOOL allocated; }; #define CLI_FULL_CONNECTION_DONT_SPNEGO 0x0001 #define CLI_FULL_CONNECTION_USE_KERBEROS 0x0002 -#define CLI_FULL_CONNECTION_ANNONYMOUS_FALLBACK 0x0004 +#define CLI_FULL_CONNECTION_ANONYMOUS_FALLBACK 0x0004 #endif /* _CLIENT_H */ diff --git a/source/include/core.h b/source/include/core.h new file mode 100644 index 00000000000..1f9ddb8b3c5 --- /dev/null +++ b/source/include/core.h @@ -0,0 +1,3 @@ +/* dummy file to deal with pidl autogenerated ndr files */ + +#include "nterr.h" diff --git a/source/include/core/nterr.h b/source/include/core/nterr.h new file mode 100644 index 00000000000..c56735e7723 --- /dev/null +++ b/source/include/core/nterr.h @@ -0,0 +1 @@ +#include "includes.h" diff --git a/source/include/dcerpc.h b/source/include/dcerpc.h new file mode 100644 index 00000000000..d7652628944 --- /dev/null +++ b/source/include/dcerpc.h @@ -0,0 +1,40 @@ +/* unused. Stub to make the pidl generated NDR parsers compile */ + +/* + this is used to find pointers to calls +*/ +struct dcerpc_interface_call { + const char *name; + size_t struct_size; + ndr_push_flags_fn_t ndr_push; + ndr_pull_flags_fn_t ndr_pull; + ndr_print_function_t ndr_print; + BOOL async; +}; + +struct dcerpc_endpoint_list { + uint32_t count; + const char * const *names; +}; + +struct dcerpc_authservice_list { + uint32_t count; + const char * const *names; +}; + +struct dcerpc_interface_table { + const char *name; + struct dcerpc_syntax_id syntax_id; + const char *helpstring; + uint32_t num_calls; + const struct dcerpc_interface_call *calls; + const struct dcerpc_endpoint_list *endpoints; + const struct dcerpc_authservice_list *authservices; +}; + +struct dcerpc_interface_list { + struct dcerpc_interface_list *prev, *next; + const struct dcerpc_interface_table *table; +}; + + diff --git a/source/include/dlinklist.h b/source/include/dlinklist.h index daec7640e40..e590bc3e7ee 100644 --- a/source/include/dlinklist.h +++ b/source/include/dlinklist.h @@ -21,10 +21,13 @@ /* To use these macros you must have a structure containing a next and prev pointer */ +#ifndef _DLINKLIST_H +#define _DLINKLIST_H + /* hook into the front of the list */ #define DLIST_ADD(list, p) \ -{ \ +do { \ if (!(list)) { \ (list) = (p); \ (p)->next = (p)->prev = NULL; \ @@ -34,11 +37,11 @@ (p)->prev = NULL; \ (list) = (p); \ }\ -} +} while (0) /* remove an element from a list - element doesn't have to be in list. */ #define DLIST_REMOVE(list, p) \ -{ \ +do { \ if ((p) == (list)) { \ (list) = (p)->next; \ if (list) (list)->prev = NULL; \ @@ -47,28 +50,29 @@ if ((p)->next) (p)->next->prev = (p)->prev; \ } \ if ((p) != (list)) (p)->next = (p)->prev = NULL; \ -} +} while (0) /* promote an element to the top of the list */ #define DLIST_PROMOTE(list, p) \ -{ \ - DLIST_REMOVE(list, p) \ - DLIST_ADD(list, p) \ -} +do { \ + DLIST_REMOVE(list, p); \ + DLIST_ADD(list, p); \ +} while (0) -/* hook into the end of the list - needs a tmp pointer */ -#define DLIST_ADD_END(list, p, tmp) \ -{ \ +/* hook into the end of the list - needs the entry type */ +#define DLIST_ADD_END(list, p, type) \ +do { \ if (!(list)) { \ (list) = (p); \ (p)->next = (p)->prev = NULL; \ } else { \ - for ((tmp) = (list); (tmp)->next; (tmp) = (tmp)->next) ; \ - (tmp)->next = (p); \ + type tmp; \ + for (tmp = (list); tmp->next; tmp = tmp->next) ; \ + tmp->next = (p); \ (p)->next = NULL; \ - (p)->prev = (tmp); \ + (p)->prev = tmp; \ } \ -} +} while (0) /* insert 'p' after the given element 'el' in a list. If el is NULL then this is the same as a DLIST_ADD() */ @@ -84,9 +88,27 @@ do { \ }\ } while (0) -/* demote an element to the top of the list, needs a tmp pointer */ +/* demote an element to the end of the list, needs a tmp pointer */ #define DLIST_DEMOTE(list, p, tmp) \ -{ \ - DLIST_REMOVE(list, p) \ - DLIST_ADD_END(list, p, tmp) \ -} +do { \ + DLIST_REMOVE(list, p); \ + DLIST_ADD_END(list, p, tmp); \ +} while (0) + +/* concatenate two lists - putting all elements of the 2nd list at the + end of the first list */ +#define DLIST_CONCATENATE(list1, list2, type) \ +do { \ + if (!(list1)) { \ + (list1) = (list2); \ + } else { \ + type tmp; \ + for (tmp = (list1); tmp->next; tmp = tmp->next) ; \ + tmp->next = (list2); \ + if (list2) { \ + (list2)->prev = tmp; \ + } \ + } \ +} while (0) + +#endif /* _DLINKLIST_H */ diff --git a/source/include/event.h b/source/include/event.h index fdb990678db..ce687eca6d6 100644 --- a/source/include/event.h +++ b/source/include/event.h @@ -19,13 +19,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -struct timed_event { - struct timed_event *next, *prev; - struct timeval when; - const char *event_name; - void (*handler)(struct timed_event *te, - const struct timeval *now, - void *private_data); - void *private_data; -}; +/* bits for file descriptor event flags */ +#define EVENT_FD_READ 1 +#define EVENT_FD_WRITE 2 diff --git a/source/include/gpo.h b/source/include/gpo.h index 65c96c31e6b..c3ae20dd20b 100644 --- a/source/include/gpo.h +++ b/source/include/gpo.h @@ -20,11 +20,11 @@ enum GPO_LINK_TYPE { - GP_LINK_UNKOWN, - GP_LINK_MACHINE, - GP_LINK_SITE, - GP_LINK_DOMAIN, - GP_LINK_OU + GP_LINK_UNKOWN = 0, + GP_LINK_MACHINE = 1, + GP_LINK_SITE = 2, + GP_LINK_DOMAIN = 3, + GP_LINK_OU = 4 }; /* GPO_OPTIONS */ @@ -35,11 +35,12 @@ enum GPO_LINK_TYPE { #define GPO_LIST_FLAG_MACHINE 0x00000001 #define GPO_LIST_FLAG_SITEONLY 0x00000002 +#define GPO_VERSION_USER(x) (x >> 16) +#define GPO_VERSION_MACHINE(x) (x & 0xffff) + struct GROUP_POLICY_OBJECT { uint32 options; /* GPFLAGS_* */ uint32 version; - uint16 version_user; - uint16 version_machine; const char *ds_path; const char *file_sys_path; const char *display_name; @@ -62,8 +63,8 @@ struct GROUP_POLICY_OBJECT { /* 'gPOptions', maybe a bitmask as well */ enum GPO_INHERIT { - GPOPTIONS_INHERIT, - GPOPTIONS_BLOCK_INHERITANCE + GPOPTIONS_INHERIT = 0, + GPOPTIONS_BLOCK_INHERITANCE = 1 }; /* 'flags' in a 'groupPolicyContainer' object */ @@ -89,3 +90,6 @@ struct GP_EXT { char **snapins; char **snapins_guid; }; + +#define GPO_CACHE_DIR "gpo_cache" +#define GPT_INI "GPT.INI" diff --git a/source/include/idmap.h b/source/include/idmap.h index 474982f2926..80bd541a23f 100644 --- a/source/include/idmap.h +++ b/source/include/idmap.h @@ -24,37 +24,56 @@ Boston, MA 02111-1307, USA. */ -/* idmap version determines auto-conversion */ -#define IDMAP_VERSION 2 +/* idmap version determines auto-conversion - this is the database + structure version specifier. */ -#define SMB_IDMAP_INTERFACE_VERSION 2 +#define IDMAP_VERSION 2 +/* The interface version specifier. + Updated to 3 for enum types by JRA. */ -#define ID_EMPTY 0x00 -#define ID_USERID 0x01 -#define ID_GROUPID 0x02 -#define ID_OTHER 0x04 +/* Updated to 4, completely new interface, SSS */ -#define ID_TYPEMASK 0x0f +#define SMB_IDMAP_INTERFACE_VERSION 4 -#define ID_QUERY_ONLY 0x10 -#define ID_CACHE_ONLY 0x20 +struct idmap_domain { + const char *name; + BOOL default_domain; + BOOL readonly; + void *private_data; + struct idmap_methods *methods; +}; /* Filled out by IDMAP backends */ struct idmap_methods { /* Called when backend is first loaded */ - NTSTATUS (*init)( char *params ); + NTSTATUS (*init)(struct idmap_domain *dom, const char *compat_params); + + NTSTATUS (*unixids_to_sids)(struct idmap_domain *dom, struct id_map **ids); + NTSTATUS (*sids_to_unixids)(struct idmap_domain *dom, struct id_map **ids); + NTSTATUS (*set_mapping)(struct idmap_domain *dom, const struct id_map *map); + NTSTATUS (*remove_mapping)(struct idmap_domain *dom, const struct id_map *map); - NTSTATUS (*allocate_id)(unid_t *id, int id_type); - NTSTATUS (*get_sid_from_id)(DOM_SID *sid, unid_t id, int id_type); - NTSTATUS (*get_id_from_sid)(unid_t *id, int *id_type, const DOM_SID *sid); - NTSTATUS (*set_mapping)(const DOM_SID *sid, unid_t id, int id_type); + /* Called to dump backends data */ + /* NOTE: caller must use talloc_free to free maps when done */ + NTSTATUS (*dump_data)(struct idmap_domain *dom, struct id_map **maps, int *num_maps); /* Called when backend is unloaded */ - NTSTATUS (*close_fn)(void); + NTSTATUS (*close_fn)(struct idmap_domain *dom); +}; + +struct idmap_alloc_methods { - /* Called to dump backend status */ - void (*status)(void); + /* Called when backend is first loaded */ + NTSTATUS (*init)(const char *compat_params); + + NTSTATUS (*allocate_id)(struct unixid *id); + NTSTATUS (*get_id_hwm)(struct unixid *id); + NTSTATUS (*set_id_hwm)(struct unixid *id); + + /* Called when backend is unloaded */ + NTSTATUS (*close_fn)(void); }; + #endif /* _IDMAP_H_ */ diff --git a/source/include/includes.h b/source/include/includes.h index 0d456a7ce48..34b9c36c8ac 100644 --- a/source/include/includes.h +++ b/source/include/includes.h @@ -26,9 +26,15 @@ #undef SIZEOF_LONG #endif +#include "lib/replace/replace.h" + +/* make sure we have included the correct config.h */ #ifndef NO_CONFIG_H /* for some tests */ -#include "config.h" +#ifndef CONFIG_H_IS_FROM_SAMBA +#error "make sure you have removed all config.h files from standalone builds!" +#error "the included config.h isn't from samba!" #endif +#endif /* NO_CONFIG_H */ /* only do the C++ reserved word check when we compile to include --with-developer since too many systems @@ -66,14 +72,12 @@ #undef HAVE_TERMIOS_H #endif -#if (__GNUC__ >= 3 ) && (__GNUC_MINOR__ >= 1 ) -/** Use gcc attribute to check printf fns. a1 is the 1-based index of - * the parameter containing the format, and a2 the index of the first - * argument. Note that some gcc 2.x versions don't handle this - * properly **/ -#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2))) +#ifndef _PUBLIC_ +#ifdef HAVE_VISIBILITY_ATTR +# define _PUBLIC_ __attribute__((visibility("default"))) #else -#define PRINTF_ATTRIBUTE(a1, a2) +# define _PUBLIC_ +#endif #endif #if defined(__GNUC__) && !defined(__cplusplus) @@ -95,281 +99,22 @@ #endif #endif /* RELIANTUNIX */ -#include <sys/types.h> - -#ifdef HAVE_STDINT_H -#include <stdint.h> -#endif - -#ifdef TIME_WITH_SYS_TIME -#include <sys/time.h> -#include <time.h> -#else -#ifdef HAVE_SYS_TIME_H -#include <sys/time.h> -#else -#include <time.h> -#endif -#endif - -#ifdef HAVE_SYS_RESOURCE_H -#include <sys/resource.h> -#endif - -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif - -#include <stdio.h> -#include <stddef.h> - -#ifdef HAVE_SYS_PARAM_H -#include <sys/param.h> -#endif - -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif - -#ifdef HAVE_SYS_SOCKET_H -#include <sys/socket.h> -#endif - -#ifdef HAVE_UNIXSOCKET -#include <sys/un.h> -#endif - -#ifdef HAVE_SYS_SYSCALL_H -#include <sys/syscall.h> -#elif HAVE_SYSCALL_H -#include <syscall.h> -#endif - -#ifdef HAVE_STRING_H -#include <string.h> -#endif - -#ifdef HAVE_STRINGS_H -#include <strings.h> -#endif - -#ifdef HAVE_MEMORY_H -#include <memory.h> -#endif - -#ifdef HAVE_MALLOC_H -#include <malloc.h> -#endif - -#ifdef HAVE_FCNTL_H -#include <fcntl.h> -#else -#ifdef HAVE_SYS_FCNTL_H -#include <sys/fcntl.h> -#endif -#endif - -#include <sys/stat.h> - -#ifdef HAVE_LIMITS_H -#include <limits.h> -#endif - -#ifdef HAVE_SYS_IOCTL_H -#include <sys/ioctl.h> -#endif - -#ifdef HAVE_SYS_FILIO_H -#include <sys/filio.h> -#endif - -#include <signal.h> - -#ifdef HAVE_SYS_WAIT_H -#include <sys/wait.h> -#endif -#ifdef HAVE_CTYPE_H -#include <ctype.h> -#endif -#ifdef HAVE_GRP_H -#include <grp.h> -#endif -#ifdef HAVE_SYS_PRIV_H -#include <sys/priv.h> -#endif -#ifdef HAVE_SYS_ID_H -#include <sys/id.h> -#endif - -#include <errno.h> - -#ifdef HAVE_UTIME_H -#include <utime.h> -#endif - -#ifdef HAVE_SYS_SELECT_H -#include <sys/select.h> -#endif - -#ifdef HAVE_SYS_MODE_H -/* apparently AIX needs this for S_ISLNK */ -#ifndef S_ISLNK -#include <sys/mode.h> -#endif -#endif - -#ifdef HAVE_GLOB_H -#include <glob.h> -#endif - -#include <pwd.h> - -#ifdef HAVE_STDARG_H -#include <stdarg.h> -#else -#include <varargs.h> -#endif - -#include <netinet/in.h> -#include <arpa/inet.h> -#include <netdb.h> - -#ifdef HAVE_SYSLOG_H -#include <syslog.h> -#else -#ifdef HAVE_SYS_SYSLOG_H -#include <sys/syslog.h> -#endif -#endif - -#include <sys/file.h> - -#ifdef HAVE_NETINET_TCP_H -#include <netinet/tcp.h> -#endif - -/* - * The next three defines are needed to access the IPTOS_* options - * on some systems. - */ - -#ifdef HAVE_NETINET_IN_SYSTM_H -#include <netinet/in_systm.h> -#endif - -#ifdef HAVE_NETINET_IN_IP_H -#include <netinet/in_ip.h> -#endif - -#ifdef HAVE_NETINET_IP_H -#include <netinet/ip.h> -#endif - -#if defined(HAVE_TERMIOS_H) -/* POSIX terminal handling. */ -#include <termios.h> -#elif defined(HAVE_TERMIO_H) -/* Older SYSV terminal handling - don't use if we can avoid it. */ -#include <termio.h> -#elif defined(HAVE_SYS_TERMIO_H) -/* Older SYSV terminal handling - don't use if we can avoid it. */ -#include <sys/termio.h> -#endif - -#if HAVE_DIRENT_H -# include <dirent.h> -# define NAMLEN(dirent) strlen((dirent)->d_name) -#else -# define dirent direct -# define NAMLEN(dirent) (dirent)->d_namlen -# if HAVE_SYS_NDIR_H -# include <sys/ndir.h> -# endif -# if HAVE_SYS_DIR_H -# include <sys/dir.h> -# endif -# if HAVE_NDIR_H -# include <ndir.h> -# endif -#endif - -#ifdef HAVE_SYS_MMAN_H -#include <sys/mman.h> -#endif - -#ifdef HAVE_NET_IF_H -#include <net/if.h> -#endif - - -#ifdef HAVE_SYS_MOUNT_H -#include <sys/mount.h> -#endif - -#ifdef HAVE_SYS_VFS_H -#include <sys/vfs.h> -#endif - -#ifdef HAVE_SYS_ACL_H -#include <sys/acl.h> -#endif - -#ifdef HAVE_SYS_FS_S5PARAM_H -#include <sys/fs/s5param.h> -#endif - -#if defined (HAVE_SYS_FILSYS_H) && !defined (_CRAY) -#include <sys/filsys.h> -#endif - -#ifdef HAVE_SYS_STATFS_H -# include <sys/statfs.h> -#endif - -#ifdef HAVE_DUSTAT_H -#include <sys/dustat.h> -#endif - -#ifdef HAVE_SYS_STATVFS_H -#include <sys/statvfs.h> -#endif - -#ifdef HAVE_SHADOW_H -/* - * HP-UX 11.X has TCP_NODELAY and TCP_MAXSEG defined in <netinet/tcp.h> which - * was included above. However <rpc/rpc.h> includes <sys/xti.h> which defines - * them again without checking if they already exsist. This generates - * two "Redefinition of macro" warnings for every single .c file that is - * compiled. - */ -#if defined(HPUX) && defined(TCP_NODELAY) -#undef TCP_NODELAY -#endif -#if defined(HPUX) && defined(TCP_MAXSEG) -#undef TCP_MAXSEG -#endif -#include <shadow.h> -#endif - -#ifdef HAVE_GETPWANAM -#include <sys/label.h> -#include <sys/audit.h> -#include <pwdadj.h> -#endif - -#ifdef HAVE_SYS_SECURITY_H -#include <sys/security.h> -#include <prot.h> -#define PASSWORD_LENGTH 16 -#endif /* HAVE_SYS_SECURITY_H */ - -#ifdef HAVE_STROPTS_H -#include <stropts.h> -#endif - -#ifdef HAVE_POLL_H -#include <poll.h> -#endif +#include "system/capability.h" +#include "system/dir.h" +#include "system/filesys.h" +#include "system/glob.h" +#include "system/iconv.h" +#include "system/locale.h" +#include "system/network.h" +#include "system/passwd.h" +#include "system/printing.h" +#include "system/readline.h" +#include "system/select.h" +#include "system/shmem.h" +#include "system/syslog.h" +#include "system/terminal.h" +#include "system/time.h" +#include "system/wait.h" #if defined(HAVE_RPC_RPC_H) /* @@ -420,26 +165,6 @@ #endif #endif /* HAVE_NETGROUP */ -#if defined(HAVE_SYS_IPC_H) -#include <sys/ipc.h> -#endif /* HAVE_SYS_IPC_H */ - -#if defined(HAVE_SYS_SHM_H) -#include <sys/shm.h> -#endif /* HAVE_SYS_SHM_H */ - -#ifdef HAVE_NATIVE_ICONV -#ifdef HAVE_ICONV -#include <iconv.h> -#endif -#ifdef HAVE_GICONV -#include <giconv.h> -#endif -#ifdef HAVE_BICONV -#include <biconv.h> -#endif -#endif - #if HAVE_KRB5_H #include <krb5.h> #else @@ -510,10 +235,6 @@ #include <sys/uio.h> #endif -#if HAVE_LOCALE_H -#include <locale.h> -#endif - #if HAVE_LANGINFO_H #include <langinfo.h> #endif @@ -881,13 +602,9 @@ struct timespec { #define MAX(a,b) ((a)>(b)?(a):(b)) #endif -#ifndef HAVE_STRERROR -extern char *sys_errlist[]; -#define strerror(i) sys_errlist[i] -#endif - -#ifndef HAVE_ERRNO_DECL -extern int errno; +#ifndef _UPPER_BOOL +typedef int BOOL; +#define _UPPER_BOOL #endif #ifdef HAVE_BROKEN_GETGROUPS @@ -900,11 +617,6 @@ extern int errno; #define NGROUPS_MAX 32 /* Guess... */ #endif -#ifdef SOCKET_WRAPPER -#define SOCKET_WRAPPER_REPLACE -#include "include/socket_wrapper.h" -#endif - /* Our own pstrings and fstrings */ #include "pstring.h" @@ -912,17 +624,18 @@ extern int errno; #include "xfile.h" #include "intl.h" #include "dlinklist.h" -#include "tdb/tdb.h" -#include "tdb/spinlock.h" -#include "tdb/tdbutil.h" +#include "tdb.h" +#include "util_tdb.h" +#include "tdbback.h" -#include "talloc.h" +#include "lib/talloc/talloc.h" /* And a little extension. Abort on type mismatch */ #define talloc_get_type_abort(ptr, type) \ (type *)talloc_check_name_abort(ptr, #type) #include "nt_status.h" #include "ads.h" +#include "gpo.h" #include "ads_dns.h" #include "interfaces.h" #include "trans2.h" @@ -935,6 +648,7 @@ extern int errno; #include "debugparse.h" #include "version.h" #include "privileges.h" +#include "locking.h" #include "smb.h" #include "ads_cldap.h" #include "nameserv.h" @@ -962,7 +676,6 @@ extern int errno; #include "rpc_reg.h" #include "rpc_samr.h" #include "rpc_srvsvc.h" -#include "rpc_wkssvc.h" #include "rpc_spoolss.h" #include "rpc_eventlog.h" #include "rpc_dfs.h" @@ -971,14 +684,11 @@ extern int errno; #include "rpc_shutdown.h" #include "rpc_perfcount.h" #include "rpc_perfcount_defs.h" +#include "librpc/gen_ndr/notify.h" #include "nt_printing.h" #include "idmap.h" #include "client.h" -#ifdef WITH_SMBWRAPPER -#include "smbw.h" -#endif - #include "session.h" #include "asn_1.h" #include "popt.h" @@ -1062,11 +772,17 @@ enum flush_reason_enum { /* NUM_FLUSH_REASONS must remain the last value in the enumeration. */ NUM_FLUSH_REASONS}; +#include "nss_info.h" + /***** automatically generated prototypes *****/ #ifndef NO_PROTO_H #include "proto.h" #endif +#ifdef HAVE_LDAP +#include "ads_protos.h" +#endif + /* We need this after proto.h to reference GetTimeOfDay(). */ #include "smbprofile.h" @@ -1128,10 +844,6 @@ enum flush_reason_enum { #define PASSWORD_LENGTH 8 #endif -#ifdef REPLACE_INET_NTOA -#define inet_ntoa rep_inet_ntoa -#endif - #ifndef HAVE_PIPE #define SYNC_DNS 1 #endif @@ -1160,58 +872,6 @@ enum flush_reason_enum { #define ULTRIX_AUTH 1 #endif -#ifndef HAVE_STRDUP -char *strdup(const char *s); -#endif - -#ifndef HAVE_STRNDUP -char *strndup(const char *s, size_t size); -#endif - -#ifndef HAVE_MEMMOVE -void *memmove(void *dest,const void *src,int size); -#endif - -#ifndef HAVE_INITGROUPS -int initgroups(char *name,gid_t id); -#endif - -#ifndef HAVE_RENAME -int rename(const char *zfrom, const char *zto); -#endif - -#ifndef HAVE_MKTIME -time_t mktime(struct tm *t); -#endif - -#ifndef HAVE_STRLCPY -size_t strlcpy(char *d, const char *s, size_t bufsize); -#endif - -#ifndef HAVE_STRLCAT -size_t strlcat(char *d, const char *s, size_t bufsize); -#endif - -#ifndef HAVE_FTRUNCATE -int ftruncate(int f,long l); -#endif - -#ifndef HAVE_STRNDUP -char *strndup(const char *s, size_t n); -#endif - -#ifndef HAVE_STRNLEN -size_t strnlen(const char *s, size_t n); -#endif - -#ifndef HAVE_STRTOUL -unsigned long strtoul(const char *nptr, char **endptr, int base); -#endif - -#ifndef HAVE_SETENV -int setenv(const char *name, const char *value, int overwrite); -#endif - #if (defined(USE_SETRESUID) && !defined(HAVE_SETRESUID_DECL)) /* stupid glibc */ int setresuid(uid_t ruid, uid_t euid, uid_t suid); @@ -1219,13 +879,6 @@ int setresuid(uid_t ruid, uid_t euid, uid_t suid); #if (defined(USE_SETRESUID) && !defined(HAVE_SETRESGID_DECL)) int setresgid(gid_t rgid, gid_t egid, gid_t sgid); #endif -#ifndef HAVE_VASPRINTF_DECL -int vasprintf(char **ptr, const char *format, va_list ap); -#endif - -#ifdef REPLACE_GETPASS -#define getpass(prompt) getsmbpass((prompt)) -#endif /* * Some older systems seem not to have MAXHOSTNAMELEN @@ -1255,12 +908,6 @@ int vasprintf(char **ptr, const char *format, va_list ap); #define DEFAULT_SOCKET_OPTIONS "" #endif -/* Load header file for dynamic linking stuff */ - -#ifdef HAVE_DLFCN_H -#include <dlfcn.h> -#endif - /* dmalloc -- free heap debugger (dmalloc.org). This should be near * the *bottom* of include files so as not to conflict. */ #ifdef ENABLE_DMALLOC @@ -1399,28 +1046,6 @@ int fdprintf(int , const char *, ...) PRINTF_ATTRIBUTE(2,3); int d_printf(const char *, ...) PRINTF_ATTRIBUTE(1,2); /*PRINTFLIKE2 */ int d_fprintf(FILE *f, const char *, ...) PRINTF_ATTRIBUTE(2,3); -#ifndef HAVE_SNPRINTF_DECL -/*PRINTFLIKE3 */ -int snprintf(char *,size_t ,const char *, ...) PRINTF_ATTRIBUTE(3,4); -#endif -#ifndef HAVE_ASPRINTF_DECL -/*PRINTFLIKE2 */ -int asprintf(char **,const char *, ...) PRINTF_ATTRIBUTE(2,3); -#endif - -/* Fix prototype problem with non-C99 compliant snprintf implementations, esp - HPUX 11. Don't change the sense of this #if statement. Read the comments - in lib/snprint.c if you think you need to. See also bugzilla bug 174. */ - -#if !defined(HAVE_SNPRINTF) || !defined(HAVE_C99_VSNPRINTF) -#define snprintf smb_snprintf -#define vsnprintf smb_vsnprintf - -/* PRINTFLIKE3 */ -int smb_snprintf(char *str,size_t count,const char *fmt,...); -int smb_vsnprintf (char *str, size_t count, const char *fmt, va_list args); - -#endif /* PRINTFLIKE2 */ void sys_adminlog(int priority, const char *format_str, ...) PRINTF_ATTRIBUTE(2,3); @@ -1450,14 +1075,6 @@ int smb_xvasprintf(char **ptr, const char *format, va_list ap) PRINTF_ATTRIBUTE( #endif #endif -#ifndef HAVE_VSYSLOG -void vsyslog (int facility_priority, const char *format, va_list arglist); -#endif - -#ifndef HAVE_TIMEGM -time_t timegm(struct tm *tm); -#endif - /* * Veritas File System. Often in addition to native. * Quotas different. @@ -1492,6 +1109,14 @@ krb5_error_code krb5_auth_con_setuseruserkey(krb5_context context, krb5_auth_con void krb5_free_unparsed_name(krb5_context ctx, char *val); #endif +/* Stub out initialize_krb5_error_table since it is not present in all + * Kerberos implementations. If it's not present, it's not necessary to + * call it. + */ +#ifndef HAVE_INITIALIZE_KRB5_ERROR_TABLE +#define initialize_krb5_error_table() +#endif + /* Samba wrapper function for krb5 functionality. */ void setup_kaddr( krb5_address *pkaddr, struct sockaddr *paddr); int create_kerberos_key_from_string(krb5_context context, krb5_principal host_princ, krb5_data *password, krb5_keyblock *key, krb5_enctype enctype); @@ -1500,7 +1125,6 @@ BOOL get_auth_data_from_tkt(TALLOC_CTX *mem_ctx, DATA_BLOB *auth_data, krb5_tick krb5_const_principal get_principal_from_tkt(krb5_ticket *tkt); krb5_error_code krb5_locate_kdc(krb5_context ctx, const krb5_data *realm, struct sockaddr **addr_pp, int *naddrs, int get_masters); krb5_error_code get_kerberos_allowed_etypes(krb5_context context, krb5_enctype **enctypes); -void free_kerberos_etypes(krb5_context context, krb5_enctype *enctypes); BOOL get_krb5_smb_session_key(krb5_context context, krb5_auth_context auth_context, DATA_BLOB *session_key, BOOL remote); krb5_error_code smb_krb5_kt_free_entry(krb5_context context, krb5_keytab_entry *kt_entry); krb5_principal kerberos_fetch_salt_princ_for_host_princ(krb5_context context, krb5_principal host_princ, int enctype); @@ -1544,7 +1168,7 @@ BOOL smb_krb5_principal_compare_any_realm(krb5_context context, krb5_const_principal princ1, krb5_const_principal princ2); int cli_krb5_get_ticket(const char *principal, time_t time_offset, - DATA_BLOB *ticket, DATA_BLOB *session_key_krb5, uint32 extra_ap_opts, const char *ccname); + DATA_BLOB *ticket, DATA_BLOB *session_key_krb5, uint32 extra_ap_opts, const char *ccname, time_t *tgs_expire); PAC_LOGON_INFO *get_logon_info_from_pac(PAC_DATA *pac_data); krb5_error_code smb_krb5_renew_ticket(const char *ccache_string, const char *client_string, const char *service_string, time_t *new_start_time); krb5_error_code kpasswd_err_to_krb5_err(krb5_error_code res_code); @@ -1555,6 +1179,8 @@ krb5_error_code nt_status_to_krb5(NTSTATUS nt_status); void smb_krb5_free_error(krb5_context context, krb5_error *krberror); krb5_error_code handle_krberror_packet(krb5_context context, krb5_data *packet); +void krb5_get_init_creds_opt_free(krb5_get_init_creds_opt *opt); +krb5_error_code krb5_get_init_creds_opt_alloc(krb5_context context, krb5_get_init_creds_opt **opt); #endif /* HAVE_KRB5 */ diff --git a/source/include/libmsrpc.h b/source/include/libmsrpc.h index 36bae441775..7b28d313336 100644 --- a/source/include/libmsrpc.h +++ b/source/include/libmsrpc.h @@ -704,7 +704,7 @@ struct LsaQueryInfoPolicy { char *forest_name; /**remote server's domain guid*/ - struct uuid *domain_guid; + struct GUID *domain_guid; /**remote server's domain SID*/ DOM_SID *domain_sid; diff --git a/source/include/libsmb_internal.h b/source/include/libsmb_internal.h index 5aca12554f3..41f72d5fb3d 100644 --- a/source/include/libsmb_internal.h +++ b/source/include/libsmb_internal.h @@ -10,7 +10,7 @@ struct _SMBCSRV { - struct cli_state cli; + struct cli_state *cli; dev_t dev; BOOL no_pathinfo; BOOL no_pathinfo2; @@ -81,6 +81,21 @@ struct smbc_internal_data { BOOL _debug_stderr; /* + * Support "Create Time" in get/set with the *xattr() functions, if + * true. This replaces the dos attribute strings C_TIME, A_TIME and + * M_TIME with CHANGE_TIME, ACCESS_TIME and WRITE_TIME, and adds + * CREATE_TIME. Default is FALSE, i.e. to use the old-style shorter + * names and to not support CREATE time, for backward compatibility. + */ + BOOL _full_time_names; + + /* + * The share mode of a file being opened. To match POSIX semantics + * (and maintain backward compatibility), DENY_NONE is the default. + */ + smbc_share_mode _share_mode; + + /* * Authentication function which includes the context. This will be * used if set; otherwise context->callbacks.auth_fn() will be used. */ diff --git a/source/include/libsmbclient.h b/source/include/libsmbclient.h index ba92259f701..45f2a41b088 100644 --- a/source/include/libsmbclient.h +++ b/source/include/libsmbclient.h @@ -141,6 +141,20 @@ struct smbc_dirent #define SMBC_DOS_MODE_DIRECTORY 0x10 #define SMBC_DOS_MODE_ARCHIVE 0x20 +/* + * Valid values for the option "open_share_mode", when calling + * smbc_option_set() + */ +typedef enum smbc_share_mode +{ + SMBC_SHAREMODE_DENY_DOS = 0, + SMBC_SHAREMODE_DENY_ALL = 1, + SMBC_SHAREMODE_DENY_WRITE = 2, + SMBC_SHAREMODE_DENY_READ = 3, + SMBC_SHAREMODE_DENY_NONE = 4, + SMBC_SHAREMODE_DENY_FCB = 7 +} smbc_share_mode; + #ifndef ENOATTR # define ENOATTR ENOENT /* No such attribute */ @@ -635,7 +649,7 @@ int smbc_free_context(SMBCCTX * context, int shutdown_ctx); void smbc_option_set(SMBCCTX *context, char *option_name, - void *option_value); + ... /* option_value */); /* * Retrieve the current value of an option * diff --git a/source/include/local.h b/source/include/local.h index fb931976362..6d32f4fe6e9 100644 --- a/source/include/local.h +++ b/source/include/local.h @@ -247,4 +247,7 @@ /* Default hash size for the winbindd cache. */ #define WINBINDD_CACHE_TDB_DEFAULT_HASH_SIZE 5000 +/* Windows minimum lock resolution timeout in ms */ +#define WINDOWS_MINIMUM_LOCK_TIMEOUT_MS 200 + #endif diff --git a/source/include/locking.h b/source/include/locking.h new file mode 100644 index 00000000000..4b3b10d7367 --- /dev/null +++ b/source/include/locking.h @@ -0,0 +1,89 @@ +/* + Unix SMB/CIFS implementation. + SMB parameters and setup, plus a whole lot more. + + Copyright (C) Jeremy Allison 2006 + + 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 _LOCKING_H +#define _LOCKING_H + +/* passed to br lock code - the UNLOCK_LOCK should never be stored into the tdb + and is used in calculating POSIX unlock ranges only. We differentiate between + PENDING read and write locks to allow posix lock downgrades to trigger a lock + re-evaluation. */ + +enum brl_type {READ_LOCK, WRITE_LOCK, PENDING_READ_LOCK, PENDING_WRITE_LOCK, UNLOCK_LOCK}; +enum brl_flavour {WINDOWS_LOCK = 0, POSIX_LOCK = 1}; + +#define IS_PENDING_LOCK(type) ((type) == PENDING_READ_LOCK || (type) == PENDING_WRITE_LOCK) + +/* This contains elements that differentiate locks. The smbpid is a + client supplied pid, and is essentially the locking context for + this client */ + +struct lock_context { + uint32 smbpid; + uint16 tid; + struct process_id pid; +}; + +/* The key used in the brlock database. */ + +struct lock_key { + SMB_DEV_T device; + SMB_INO_T inode; +}; + +struct files_struct; + +struct byte_range_lock { + struct files_struct *fsp; + unsigned int num_locks; + BOOL modified; + BOOL read_only; + struct lock_key key; + void *lock_data; +}; + +#define BRLOCK_FN_CAST() \ + void (*)(SMB_DEV_T dev, SMB_INO_T ino, struct process_id pid, \ + enum brl_type lock_type, \ + enum brl_flavour lock_flav, \ + br_off start, br_off size) + +#define BRLOCK_FN(fn) \ + void (*fn)(SMB_DEV_T dev, SMB_INO_T ino, struct process_id pid, \ + enum brl_type lock_type, \ + enum brl_flavour lock_flav, \ + br_off start, br_off size) + +/* Internal structure in brlock.tdb. + The data in brlock records is an unsorted linear array of these + records. It is unnecessary to store the count as tdb provides the + size of the record */ + +struct lock_struct { + struct lock_context context; + br_off start; + br_off size; + uint16 fnum; + enum brl_type lock_type; + enum brl_flavour lock_flav; +}; + +#endif /* _LOCKING_H_ */ diff --git a/source/include/mangle.h b/source/include/mangle.h index 2bdef4ad646..3d19ef9ed4f 100644 --- a/source/include/mangle.h +++ b/source/include/mangle.h @@ -6,9 +6,13 @@ struct mangle_fns { void (*reset)(void); - BOOL (*is_mangled)(const char *s, int snum); - BOOL (*is_8_3)(const char *fname, BOOL check_case, BOOL allow_wildcards, int snum); - BOOL (*check_cache)(char *s, size_t maxlen, int snum); - void (*name_map)(char *OutName, BOOL need83, BOOL cache83, int default_case, int snum); + BOOL (*is_mangled)(const char *s, const struct share_params *p); + BOOL (*is_8_3)(const char *fname, BOOL check_case, BOOL allow_wildcards, + const struct share_params *p); + BOOL (*check_cache)(char *s, size_t maxlen, + const struct share_params *p); + void (*name_map)(char *OutName, BOOL need83, BOOL cache83, + int default_case, + const struct share_params *p); }; #endif /* _MANGLE_H_ */ diff --git a/source/include/mapping.h b/source/include/mapping.h index fdaa2b04532..8ba784e98c8 100644 --- a/source/include/mapping.h +++ b/source/include/mapping.h @@ -26,7 +26,7 @@ typedef struct _GROUP_MAP { struct pdb_methods *methods; gid_t gid; DOM_SID sid; - enum SID_NAME_USE sid_name_use; + enum lsa_SidType sid_name_use; fstring nt_name; fstring comment; } GROUP_MAP; diff --git a/source/include/messages.h b/source/include/messages.h index e246123ea9f..7cd0e023487 100644 --- a/source/include/messages.h +++ b/source/include/messages.h @@ -70,6 +70,13 @@ #define MSG_SMB_KERNEL_BREAK 3010 #define MSG_SMB_FILE_RENAME 3011 #define MSG_SMB_INJECT_FAULT 3012 +#define MSG_SMB_BLOCKING_LOCK_CANCEL 3013 +#define MSG_SMB_NOTIFY 3014 +#define MSG_SMB_STAT_CACHE_DELETE 3015 +/* + * Samba4 compatibility + */ +#define MSG_PVFS_NOTIFY 3016 /* winbind messages */ #define MSG_WINBIND_FINISHED 4001 @@ -77,6 +84,8 @@ #define MSG_WINBIND_ONLINE 4003 #define MSG_WINBIND_OFFLINE 4004 #define MSG_WINBIND_ONLINESTATUS 4005 +#define MSG_WINBIND_TRY_TO_GO_ONLINE 4006 +#define MSG_WINBIND_FAILED_TO_GO_ONLINE 4007 /* Flags to classify messages - used in message_send_all() */ /* Sender will filter by flag. */ @@ -91,4 +100,12 @@ struct process_id { pid_t pid; }; +/* + * Samba4 API compatibility layer + */ + +struct server_id { + struct process_id id; +}; + #endif diff --git a/source/include/msdfs.h b/source/include/msdfs.h index e9fef5430ed..4e3487de0f4 100644 --- a/source/include/msdfs.h +++ b/source/include/msdfs.h @@ -71,6 +71,12 @@ struct dfs_path { return ERROR_BOTH(NT_STATUS_PATH_NOT_COVERED, \ ERRSRV, ERRbadpath);; } +#define RESOLVE_DFSPATH_STATUS(name, conn, inbuf, outbuf) \ +{ if ((SVAL(inbuf,smb_flg2) & FLAGS2_DFS_PATHNAMES) && \ + lp_host_msdfs() && lp_msdfs_root(SNUM(conn)) && \ + dfs_redirect(name, conn, False)) \ + return NT_STATUS_PATH_NOT_COVERED;; } + #define RESOLVE_DFSPATH_WCARD(name, conn, inbuf, outbuf) \ { if ((SVAL(inbuf,smb_flg2) & FLAGS2_DFS_PATHNAMES) && \ lp_host_msdfs() && lp_msdfs_root(SNUM(conn)) && \ diff --git a/source/include/ndr.h b/source/include/ndr.h new file mode 100644 index 00000000000..a416866ef25 --- /dev/null +++ b/source/include/ndr.h @@ -0,0 +1 @@ +/* dummy file to deal with pidl autogenerated ndr files */ diff --git a/source/include/nss_info.h b/source/include/nss_info.h new file mode 100644 index 00000000000..50e5e8182a1 --- /dev/null +++ b/source/include/nss_info.h @@ -0,0 +1,92 @@ +/* + Unix SMB/CIFS implementation. + Idmap NSS headers + + Copyright (C) Gerald Carter 2006 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#ifndef _IDMAP_NSS_H +#define _IDMAP_NSS_H + +#ifndef HAVE_LDAP +# ifndef LDAPMessage +# define LDAPMessage void +# endif +#endif + +/* The interface version specifier */ + +#define SMB_NSS_INFO_INTERFACE_VERSION 1 + +/* List of available backends. All backends must + register themselves */ + +struct nss_function_entry { + struct nss_function_entry *prev, *next; + + const char *name; + struct nss_info_methods *methods; +}; + +/* List of configured domains. Each domain points + back to its configured backend. */ + +struct nss_domain_entry { + struct nss_domain_entry *prev, *next; + + const char *domain; + + NTSTATUS init_status; + struct nss_function_entry *backend; + + /* hold state on a per domain basis */ + + void *state; +}; + +/* API */ + +struct nss_info_methods { + NTSTATUS (*init)( struct nss_domain_entry *e ); + NTSTATUS (*get_nss_info)( struct nss_domain_entry *e, + const DOM_SID *sid, + TALLOC_CTX *ctx, + ADS_STRUCT *ads, LDAPMessage *msg, + char **homedir, char **shell, char **gecos, gid_t *p_gid); + NTSTATUS (*close_fn)( void ); +}; + + +/* The following definitions come from nsswitch/nss_info.c */ + +NTSTATUS smb_register_idmap_nss(int version, + const char *name, + struct nss_info_methods *methods); + +NTSTATUS nss_init( const char **nss_list ); + +NTSTATUS nss_get_info( const char *domain, const DOM_SID *user_sid, + TALLOC_CTX *ctx, + ADS_STRUCT *ads, LDAPMessage *msg, + char **homedir, char **shell, char **gecos, + gid_t *p_gid); + +NTSTATUS nss_close( const char *parameters ); + +#endif /* _IDMAP_NSS_H_ */ + diff --git a/source/include/nt_status.h b/source/include/nt_status.h index 14c83eba4b3..471ac47927a 100644 --- a/source/include/nt_status.h +++ b/source/include/nt_status.h @@ -45,9 +45,9 @@ typedef uint32 NTSTATUS; #endif #if defined(HAVE_IMMEDIATE_STRUCTURES) -typedef struct {uint32 v;} WERROR; +typedef struct {uint32 w;} WERROR; #define W_ERROR(x) ((WERROR) { x }) -#define W_ERROR_V(x) ((x).v) +#define W_ERROR_V(x) ((x).w) #else typedef uint32 WERROR; #define W_ERROR(x) (x) @@ -56,7 +56,6 @@ typedef uint32 WERROR; #define NT_STATUS_IS_OK(x) (NT_STATUS_V(x) == 0) #define NT_STATUS_IS_ERR(x) ((NT_STATUS_V(x) & 0xc0000000) == 0xc0000000) -#define NT_STATUS_IS_INVALID(x) (NT_STATUS_V(x) == 0xFFFFFFFF) #define NT_STATUS_EQUAL(x,y) (NT_STATUS_V(x) == NT_STATUS_V(y)) #define W_ERROR_IS_OK(x) (W_ERROR_V(x) == 0) #define W_ERROR_EQUAL(x,y) (W_ERROR_V(x) == W_ERROR_V(y)) @@ -67,4 +66,39 @@ typedef uint32 WERROR; }\ } while (0) +#define NT_STATUS_NOT_OK_RETURN(x) do { \ + if (!NT_STATUS_IS_OK(x)) {\ + return x;\ + }\ +} while (0) + +/* The top byte in an NTSTATUS code is used as a type field. + * Windows only uses value 0xC0 as an indicator for an NT error + * and 0x00 for success. + * So we can use the type field to store other types of error codes + * inside the three lower bytes. + * NB: The system error codes (errno) are not integrated via a type of + * their own but are mapped to genuine NT error codes via + * map_nt_error_from_unix() */ + +#define NT_STATUS_TYPE(status) ((NT_STATUS_V(status) & 0xFF000000) >> 24) + +#define NT_STATUS_TYPE_DOS 0xF1 +#define NT_STATUS_TYPE_LDAP 0xF2 + +/* this defines special NTSTATUS codes to represent DOS errors. I + have chosen this macro to produce status codes in the invalid + NTSTATUS range */ +#define NT_STATUS_DOS_MASK (NT_STATUS_TYPE_DOS << 24) +#define NT_STATUS_DOS(class, code) NT_STATUS(NT_STATUS_DOS_MASK | ((class)<<16) | code) +#define NT_STATUS_IS_DOS(status) ((NT_STATUS_V(status) & 0xFF000000) == NT_STATUS_DOS_MASK) +#define NT_STATUS_DOS_CLASS(status) ((NT_STATUS_V(status) >> 16) & 0xFF) +#define NT_STATUS_DOS_CODE(status) (NT_STATUS_V(status) & 0xFFFF) + +/* define ldap error codes as NTSTATUS codes */ +#define NT_STATUS_LDAP_MASK (NT_STATUS_TYPE_LDAP << 24) +#define NT_STATUS_LDAP(code) NT_STATUS(NT_STATUS_LDAP_MASK | code) +#define NT_STATUS_IS_LDAP(status) ((NT_STATUS_V(status) & 0xFF000000) == NT_STATUS_LDAP_MASK) +#define NT_STATUS_LDAP_CODE(status) (NT_STATUS_V(status) & ~0xFF000000) + #endif diff --git a/source/include/ntdomain.h b/source/include/ntdomain.h index c27ec3675b4..6d8c4e62c65 100644 --- a/source/include/ntdomain.h +++ b/source/include/ntdomain.h @@ -267,6 +267,12 @@ typedef struct pipes_struct { BOOL bad_handle_fault_state; /* + * Set to true when the backend does not support a call. + */ + + BOOL rng_fault_state; + + /* * Set to RPC_BIG_ENDIAN when dealing with big-endian PDU's */ diff --git a/source/include/nterr.h b/source/include/nterr.h index 417719625e7..913ea5799e3 100644 --- a/source/include/nterr.h +++ b/source/include/nterr.h @@ -37,9 +37,6 @@ #define STATUS_NOTIFY_ENUM_DIR NT_STATUS(0x010c) #define ERROR_INVALID_DATATYPE NT_STATUS(0x070c) -/* Special "invalid" NT status code. */ -#define NT_STATUS_INVALID NT_STATUS(0xFFFFFFFF) - /* Win32 Error codes extracted using a loop in smbclient then printing a netmon sniff to a file. */ @@ -562,7 +559,9 @@ #define NT_STATUS_TOO_MANY_LINKS NT_STATUS(0xC0000000 | 0x0265) #define NT_STATUS_QUOTA_LIST_INCONSISTENT NT_STATUS(0xC0000000 | 0x0266) #define NT_STATUS_FILE_IS_OFFLINE NT_STATUS(0xC0000000 | 0x0267) +#define NT_STATUS_DS_NO_MORE_RIDS NT_STATUS(0xC0000000 | 0x02a8) #define NT_STATUS_NOT_A_REPARSE_POINT NT_STATUS(0xC0000000 | 0x0275) #define NT_STATUS_NO_SUCH_JOB NT_STATUS(0xC0000000 | 0xEDE) /* scheduler */ +#define NT_STATUS_RPC_PROTSEQ_NOT_SUPPORTED NT_STATUS(0xC0000000 | 0x20004) #endif /* _NTERR_H */ diff --git a/source/include/ntlmssp.h b/source/include/ntlmssp.h index a2dac7dc0ba..d15ce18021c 100644 --- a/source/include/ntlmssp.h +++ b/source/include/ntlmssp.h @@ -65,6 +65,10 @@ enum NTLM_MESSAGE_TYPE #define NTLMSSP_NEGOTIATE_KEY_EXCH 0x40000000 #define NTLMSSP_NEGOTIATE_56 0x80000000 +#define NTLMSSP_FEATURE_SESSION_KEY 0x00000001 +#define NTLMSSP_FEATURE_SIGN 0x00000002 +#define NTLMSSP_FEATURE_SEAL 0x00000004 + #define NTLMSSP_NAME_TYPE_SERVER 0x01 #define NTLMSSP_NAME_TYPE_DOMAIN 0x02 #define NTLMSSP_NAME_TYPE_SERVER_DNS 0x03 @@ -85,7 +89,8 @@ typedef struct ntlmssp_state char *user; char *domain; char *workstation; - char *password; + unsigned char *nt_hash; + unsigned char *lm_hash; char *server_domain; DATA_BLOB internal_chal; /* Random challenge as supplied to the client for NTLM authentication */ diff --git a/source/include/passdb.h b/source/include/passdb.h index 432976412db..10f77e1ed51 100644 --- a/source/include/passdb.h +++ b/source/include/passdb.h @@ -34,8 +34,8 @@ #define ACCT_FULL_NAME 0x00000002 #define ACCT_RID 0x00000004 #define ACCT_PRIMARY_GID 0x00000008 -#define ACCT_ADMIN_DESC 0x00000010 -#define ACCT_DESCRIPTION 0x00000020 +#define ACCT_DESCRIPTION 0x00000010 +#define ACCT_COMMENT 0x00000020 #define ACCT_HOME_DIR 0x00000040 #define ACCT_HOME_DRIVE 0x00000080 #define ACCT_LOGON_SCRIPT 0x00000100 @@ -90,7 +90,7 @@ enum pdb_elements { PDB_UNIXHOMEDIR, PDB_ACCTDESC, PDB_WORKSTATIONS, - PDB_UNKNOWNSTR, + PDB_COMMENT, PDB_MUNGEDDIAL, PDB_HOURS, PDB_FIELDS_PRESENT, @@ -160,7 +160,7 @@ struct samu { const char *profile_path; /* profile path string */ const char *acct_desc; /* user description string */ const char *workstations; /* login from workstations string */ - const char *unknown_str; /* don't know what this is, yet. */ + const char *comment; const char *munged_dial; /* munged path name and dial-back tel number */ DOM_SID user_sid; @@ -240,9 +240,11 @@ struct pdb_search { * There's no point in allocating arrays in * samr_lookup_rids twice. It was done in the srv_samr_nt.c code as well as in * the pdb module. Remove the latter, this might happen more often. VL. + * changed to version 14 to move lookup_rids and lookup_names to return + * enum lsa_SidType rather than uint32. */ -#define PASSDB_INTERFACE_VERSION 13 +#define PASSDB_INTERFACE_VERSION 15 struct pdb_methods { @@ -298,7 +300,7 @@ struct pdb_methods DOM_SID sid); NTSTATUS (*enum_group_mapping)(struct pdb_methods *methods, - const DOM_SID *sid, enum SID_NAME_USE sid_name_use, + const DOM_SID *sid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap, size_t *p_num_entries, BOOL unix_only); @@ -363,14 +365,14 @@ struct pdb_methods int num_rids, uint32 *rids, const char **pp_names, - uint32 *attrs); + enum lsa_SidType *attrs); NTSTATUS (*lookup_names)(struct pdb_methods *methods, const DOM_SID *domain_sid, int num_names, const char **pp_names, uint32 *rids, - uint32 *attrs); + enum lsa_SidType *attrs); NTSTATUS (*get_account_policy)(struct pdb_methods *methods, int policy_index, uint32 *value); @@ -391,10 +393,12 @@ struct pdb_methods BOOL (*uid_to_rid)(struct pdb_methods *methods, uid_t uid, uint32 *rid); + BOOL (*uid_to_sid)(struct pdb_methods *methods, uid_t uid, + DOM_SID *sid); BOOL (*gid_to_sid)(struct pdb_methods *methods, gid_t gid, DOM_SID *sid); BOOL (*sid_to_id)(struct pdb_methods *methods, const DOM_SID *sid, - union unid_t *id, enum SID_NAME_USE *type); + union unid_t *id, enum lsa_SidType *type); BOOL (*rid_algorithm)(struct pdb_methods *methods); BOOL (*new_rid)(struct pdb_methods *methods, uint32 *rid); diff --git a/source/include/printing.h b/source/include/printing.h index 54f32d5954c..21caff0a832 100644 --- a/source/include/printing.h +++ b/source/include/printing.h @@ -73,6 +73,10 @@ extern struct printif cups_printif; extern struct printif iprint_printif; #endif /* HAVE_IPRINT */ +#if defined(DEVELOPER) || defined(ENABLE_BUILD_FARM_HACKS) +extern struct printif test_printif; +#endif /* DEVELOPER||ENABLE_BUILD_FARM_HACKS */ + /* PRINT_MAX_JOBID is now defined in local.h */ #define UNIX_JOB_START PRINT_MAX_JOBID #define NEXT_JOBID(j) ((j+1) % PRINT_MAX_JOBID > 0 ? (j+1) % PRINT_MAX_JOBID : 1) diff --git a/source/include/privileges.h b/source/include/privileges.h index 3f425f6d728..eac42e0ba93 100644 --- a/source/include/privileges.h +++ b/source/include/privileges.h @@ -93,9 +93,9 @@ typedef struct { uint32 attr; } LUID_ATTR; -#ifndef _BOOL +#ifndef _UPPER_BOOL typedef int BOOL; -#define _BOOL /* So we don't typedef BOOL again in vfs.h */ +#define _UPPER_BOOL #endif typedef struct { diff --git a/source/include/reg_objects.h b/source/include/reg_objects.h index fff6fa16f79..1f819df999b 100644 --- a/source/include/reg_objects.h +++ b/source/include/reg_objects.h @@ -1,7 +1,8 @@ /* - Unix SMB/CIFS implementation. + Samba's Internal Registry objects + SMB parameters and setup - Copyright (C) Gerald Carter 2002-2005. + Copyright (C) Gerald Carter 2002-2006. 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 diff --git a/source/include/rpc_client.h b/source/include/rpc_client.h index 0524f037e2c..b05924e657d 100644 --- a/source/include/rpc_client.h +++ b/source/include/rpc_client.h @@ -21,6 +21,10 @@ #ifndef _RPC_CLIENT_H #define _RPC_CLIENT_H +/* autogenerated client stubs */ + +#include "librpc/gen_ndr/cli_wkssvc.h" + /* macro to expand cookie-cutter code in cli_xxx() using rpc_api_pipe_req() */ #define CLI_DO_RPC_INTERNAL( pcli, ctx, p_idx, opnum, q_in, r_out, \ diff --git a/source/include/rpc_dce.h b/source/include/rpc_dce.h index b4d350ee6fa..09e5f25da8c 100644 --- a/source/include/rpc_dce.h +++ b/source/include/rpc_dce.h @@ -126,7 +126,7 @@ enum schannel_direction { /* RPC_IFACE */ typedef struct rpc_iface_info { - struct uuid uuid; /* 16 bytes of rpc interface identification */ + struct GUID uuid; /* 16 bytes of rpc interface identification */ uint32 version; /* the interface version number */ } RPC_IFACE; diff --git a/source/include/rpc_dfs.h b/source/include/rpc_dfs.h index 9aba123deed..601d3d3b017 100644 --- a/source/include/rpc_dfs.h +++ b/source/include/rpc_dfs.h @@ -76,7 +76,7 @@ typedef struct netdfs_dfs_Info4 { UNISTR2 comment; uint32 state; uint32 timeout; - struct uuid guid; + struct GUID guid; uint32 num_stores; uint32 ptr0_stores; uint32 size_stores; diff --git a/source/include/rpc_ds.h b/source/include/rpc_ds.h index 424e6c0494a..bfe5179490c 100644 --- a/source/include/rpc_ds.h +++ b/source/include/rpc_ds.h @@ -49,7 +49,7 @@ #define DSROLE_BDC 4 #define DSROLE_PDC 5 -/* Settings for the domainFunctionality attribteu in the rootDSE */ +/* Settings for the domainFunctionality attribute in the rootDSE */ #define DS_DOMAIN_FUNCTION_2000 0 #define DS_DOMAIN_FUCNTION_2003_MIXED 1 @@ -68,7 +68,7 @@ typedef struct uint32 dnsname_ptr; uint32 forestname_ptr; - struct uuid domain_guid; + struct GUID domain_guid; UNISTR2 netbios_domain; @@ -114,7 +114,7 @@ typedef struct { uint32 trust_type; uint32 trust_attributes; uint32 sid_ptr; - struct uuid guid; + struct GUID guid; UNISTR2 netbios_domain; UNISTR2 dns_domain; @@ -128,7 +128,7 @@ struct ds_domain_trust { uint32 parent_index; uint32 trust_type; uint32 trust_attributes; - struct uuid guid; + struct GUID guid; DOM_SID sid; char *netbios_domain; diff --git a/source/include/rpc_lsa.h b/source/include/rpc_lsa.h index c4ce9e021d1..28dea219777 100644 --- a/source/include/rpc_lsa.h +++ b/source/include/rpc_lsa.h @@ -174,7 +174,7 @@ typedef struct lsa_dns_dom_info UNIHDR hdr_dns_dom_name; UNIHDR hdr_forest_name; - struct uuid dom_guid; /* domain GUID */ + struct GUID dom_guid; /* domain GUID */ UNISTR2 uni_nb_dom_name; UNISTR2 uni_dns_dom_name; diff --git a/source/include/rpc_misc.h b/source/include/rpc_misc.h index 661d436859a..7404f5669d2 100644 --- a/source/include/rpc_misc.h +++ b/source/include/rpc_misc.h @@ -92,34 +92,16 @@ enum unistr2_term_codes { UNI_FLAGS_NONE = 0, UNI_STR_TERMINATE = 1, UNI_MAXLEN_ * RPC policy handle used pretty much everywhere **********************************************************************/ +typedef struct policy_handle POLICY_HND; typedef struct { uint32 ptr_hnd; /* pointer to enumeration handle */ uint32 handle; /* enumeration handle */ } ENUM_HND; - - -/********************************************************************** - * RPC policy handle used pretty much everywhere - **********************************************************************/ - -typedef struct { - uint32 data1; - uint32 data2; - uint16 data3; - uint16 data4; - uint8 data5[8]; -#ifdef __INSURE__ - - /* To prevent the leakage of policy handles mallocate a bit of - memory when a policy handle is created and free it when the - handle is closed. This should cause Insure to flag an error - when policy handles are overwritten or fall out of scope without - being freed. */ - - char *marker; -#endif -} POLICY_HND; +#define OUR_HANDLE(hnd) (((hnd)==NULL) ? "NULL" :\ + ( IVAL((hnd)->uuid.node,2) == (uint32)sys_getpid() ? "OURS" : \ + "OTHER")), ((unsigned int)IVAL((hnd)->uuid.node,2)),\ + ((unsigned int)sys_getpid() ) /********************************************************************** @@ -357,10 +339,5 @@ typedef struct owf_info { uint8 data[16]; } OWF_INFO; -typedef struct uint64_s -{ - uint32 low; - uint32 high; -} UINT64_S; #endif /* _RPC_MISC_H */ diff --git a/source/include/rpc_netlogon.h b/source/include/rpc_netlogon.h index 01b6b99cbf6..d2d5cf2fbb4 100644 --- a/source/include/rpc_netlogon.h +++ b/source/include/rpc_netlogon.h @@ -671,8 +671,8 @@ typedef struct account_lockout_string { uint32 offset; uint32 length; /* uint16 *bindata; */ - UINT64_S lockout_duration; - UINT64_S reset_count; + uint64 lockout_duration; + uint64 reset_count; uint32 bad_attempt_lockout; uint32 dummy; } LOCKOUT_STRING; @@ -689,12 +689,12 @@ typedef struct sam_domain_info_info { UNIHDR hdr_dom_name; UNIHDR hdr_oem_info; - UINT64_S force_logoff; + uint64 force_logoff; uint16 min_pwd_len; uint16 pwd_history_len; - UINT64_S max_pwd_age; - UINT64_S min_pwd_age; - UINT64_S dom_mod_count; + uint64 max_pwd_age; + uint64 min_pwd_age; + uint64 dom_mod_count; NTTIME creation_time; uint32 security_information; @@ -858,7 +858,7 @@ typedef struct sam_alias_mem_info_info { /* SAM_DELTA_POLICY (0x0D) */ typedef struct { uint32 max_log_size; /* 0x5000 */ - UINT64_S audit_retention_period; /* 0 */ + uint64 audit_retention_period; /* 0 */ uint32 auditing_mode; /* 0 */ uint32 num_events; uint32 ptr_events; @@ -870,7 +870,7 @@ typedef struct { uint32 min_workset_size; /* 0x00010000 */ uint32 max_workset_size; /* 0x0f000000 */ uint32 page_file_limit; /* 0 */ - UINT64_S time_limit; /* 0 */ + uint64 time_limit; /* 0 */ NTTIME modify_time; /* 0x3c*/ NTTIME create_time; /* a7080110 */ BUFHDR2 hdr_sec_desc; @@ -917,7 +917,7 @@ typedef struct { uint32 min_workset_size; /* 0x00010000 */ uint32 max_workset_size; /* 0x0f000000 */ uint32 page_file_limit; /* 0 */ - UINT64_S time_limit; /* 0 */ + uint64 time_limit; /* 0 */ uint32 system_flags; /* 1 */ BUFHDR2 hdr_sec_desc; @@ -971,7 +971,7 @@ typedef struct { typedef struct { uint32 seqnum; uint32 dom_mod_count_ptr; - UINT64_S dom_mod_count; /* domain mod count at last sync */ + uint64 dom_mod_count; /* domain mod count at last sync */ } SAM_DELTA_MOD_COUNT; typedef union sam_delta_ctr_info { @@ -1013,7 +1013,7 @@ typedef struct net_q_sam_deltas_info { DOM_CRED ret_creds; uint32 database_id; - UINT64_S dom_mod_count; /* domain mod count at last sync */ + uint64 dom_mod_count; /* domain mod count at last sync */ uint32 max_size; /* preferred maximum length */ } NET_Q_SAM_DELTAS; @@ -1022,7 +1022,7 @@ typedef struct net_q_sam_deltas_info { typedef struct net_r_sam_deltas_info { DOM_CRED srv_creds; - UINT64_S dom_mod_count; /* new domain mod count */ + uint64 dom_mod_count; /* new domain mod count */ uint32 ptr_deltas; uint32 num_deltas; @@ -1041,9 +1041,9 @@ typedef struct net_q_dsr_getdcname { uint32 ptr_domain_name; UNISTR2 uni_domain_name; uint32 ptr_domain_guid; - struct uuid *domain_guid; + struct GUID *domain_guid; uint32 ptr_site_guid; - struct uuid *site_guid; + struct GUID *site_guid; uint32 flags; } NET_Q_DSR_GETDCNAME; @@ -1054,7 +1054,7 @@ typedef struct net_r_dsr_getdcname { uint32 ptr_dc_address; UNISTR2 uni_dc_address; int32 dc_address_type; - struct uuid domain_guid; + struct GUID domain_guid; uint32 ptr_domain_name; UNISTR2 uni_domain_name; uint32 ptr_forest_name; diff --git a/source/include/rpc_perfcount.h b/source/include/rpc_perfcount.h index 0e3a6eb0181..eecc24148dd 100644 --- a/source/include/rpc_perfcount.h +++ b/source/include/rpc_perfcount.h @@ -1,5 +1,26 @@ #ifndef _RPC_PERFCOUNT_H #define _RPC_PERFCOUNT_H +/* + * Unix SMB/CIFS implementation. + * Virtual Windows Registry Layer + * + * Copyright (C) Marcin Krzysztof Porwit 2005, + * Copyright (C) Gerald (Jerry) Carter 2005. + * + * 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. + */ typedef struct perf_counter_definition { @@ -59,8 +80,8 @@ typedef struct perf_object_type uint32 DefaultCounter; uint32 NumInstances; uint32 CodePage; - UINT64_S PerfTime; - UINT64_S PerfFreq; + uint64 PerfTime; + uint64 PerfFreq; PERF_COUNTER_DEFINITION *counters; PERF_INSTANCE_DEFINITION *instances; PERF_COUNTER_BLOCK counter_data; @@ -88,13 +109,13 @@ typedef struct perf_data_block PerfTime, and having it there will make my offset math much easier. */ uint32 Padding; /* Now when I'm marshalling this, I'll need to call prs_align_uint64() - before I start encodint the UINT64_S structs */ + before I start encodint the uint64 structs */ /* clock rate * seconds uptime */ - UINT64_S PerfTime; + uint64 PerfTime; /* The clock rate of the CPU */ - UINT64_S PerfFreq; + uint64 PerfFreq; /* used for high-res timers -- for now PerfTime * 10e7 */ - UINT64_S PerfTime100nSec; + uint64 PerfTime100nSec; uint32 SystemNameLength; uint32 SystemNameOffset; /* The SystemName, in unicode, terminated */ diff --git a/source/include/rpc_perfcount_defs.h b/source/include/rpc_perfcount_defs.h index 3999a6864d8..16d83c7b112 100644 --- a/source/include/rpc_perfcount_defs.h +++ b/source/include/rpc_perfcount_defs.h @@ -1,5 +1,26 @@ #ifndef _RPC_PERFCOUNT_DEFS_H #define _RPC_PERFCOUNT_DEFS_H +/* + * Unix SMB/CIFS implementation. + * Virtual Windows Registry Layer + * + * Copyright (C) Marcin Krzysztof Porwit 2005, + * Copyright (C) Gerald (Jerry) Carter 2005. + * + * 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. + */ /* * The following #defines match what is in winperf.h. diff --git a/source/include/rpc_samr.h b/source/include/rpc_samr.h index 910ccee1135..9a5484598a4 100644 --- a/source/include/rpc_samr.h +++ b/source/include/rpc_samr.h @@ -4,7 +4,7 @@ Copyright (C) Andrew Tridgell 1992-2000 Copyright (C) Luke Kenneth Casson Leighton 1996-2000 Copyright (C) Paul Ashton 1997-2000 - Copyright (C) Jean François Micouleau 1998-2001 + Copyright (C) Jean François Micouleau 1998-2001 Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2002 @@ -121,7 +121,7 @@ SamrTestPrivateFunctionsUser #define SAMR_QUERY_USERGROUPS 0x27 #define SAMR_QUERY_DISPINFO 0x28 -#define SAMR_UNKNOWN_29 0x29 +#define SAMR_GET_DISPENUM_INDEX 0x29 #define SAMR_UNKNOWN_2a 0x2a #define SAMR_UNKNOWN_2b 0x2b #define SAMR_GET_USRDOM_PWINFO 0x2c @@ -174,7 +174,7 @@ typedef struct sam_user_info_23 UNIHDR hdr_profile_path; /* profile path unicode string header */ UNIHDR hdr_acct_desc ; /* user description */ UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */ - UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */ + UNIHDR hdr_comment; UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */ uint8 lm_pwd[16]; /* lm user passwords */ @@ -211,7 +211,7 @@ typedef struct sam_user_info_23 UNISTR2 uni_profile_path; /* profile path unicode string */ UNISTR2 uni_acct_desc ; /* user description unicode string */ UNISTR2 uni_workstations; /* login from workstations unicode string */ - UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */ + UNISTR2 uni_comment; UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel no */ LOGON_HRS logon_hrs; @@ -222,7 +222,7 @@ typedef struct sam_user_info_23 typedef struct sam_user_info_24 { uint8 pass[516]; - uint16 pw_len; + uint8 pw_len; } SAM_USER_INFO_24; /* @@ -250,7 +250,7 @@ typedef struct sam_user_info_25 UNIHDR hdr_profile_path; /* profile path unicode string header */ UNIHDR hdr_acct_desc ; /* user description */ UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */ - UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */ + UNIHDR hdr_comment; UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */ uint8 lm_pwd[16]; /* lm user passwords */ @@ -274,7 +274,7 @@ typedef struct sam_user_info_25 UNISTR2 uni_profile_path; /* profile path unicode string */ UNISTR2 uni_acct_desc ; /* user description unicode string */ UNISTR2 uni_workstations; /* login from workstations unicode string */ - UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */ + UNISTR2 uni_comment; UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel no */ } SAM_USER_INFO_25; @@ -304,7 +304,7 @@ typedef struct sam_user_info_21 UNIHDR hdr_profile_path; /* profile path unicode string header */ UNIHDR hdr_acct_desc ; /* user description */ UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */ - UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */ + UNIHDR hdr_comment; UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */ uint8 lm_pwd[16]; /* lm user passwords */ @@ -340,7 +340,7 @@ typedef struct sam_user_info_21 UNISTR2 uni_profile_path; /* profile path unicode string */ UNISTR2 uni_acct_desc ; /* user description unicode string */ UNISTR2 uni_workstations; /* login from workstations unicode string */ - UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */ + UNISTR2 uni_comment; UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel number */ LOGON_HRS logon_hrs; @@ -553,7 +553,7 @@ typedef struct sam_unknown_info_2_inf pointer is referring to */ - UINT64_S seq_num; + uint64 seq_num; uint32 unknown_4; /* 0x0000 0001 */ uint32 server_role; @@ -605,7 +605,7 @@ typedef struct sam_unknown_info_7_info typedef struct sam_unknown_info_8_info { - UINT64_S seq_num; + uint64 seq_num; NTTIME domain_create_time; } SAM_UNK_INFO_8; @@ -626,7 +626,7 @@ typedef struct sam_unknown_info_12_inf typedef struct sam_unknown_info_13_info { - UINT64_S seq_num; + uint64 seq_num; NTTIME domain_create_time; uint32 unknown1; uint32 unknown2; @@ -1047,6 +1047,22 @@ typedef struct r_samr_query_dispinfo_info } SAMR_R_QUERY_DISPINFO; +/* SAMR_Q_GET_DISPENUM_INDEX */ +typedef struct q_samr_get_dispenum_index +{ + POLICY_HND domain_pol; + uint16 switch_level; + LSA_STRING name; + +} SAMR_Q_GET_DISPENUM_INDEX; + +/* SAMR_R_GET_DISPENUM_INDEX */ +typedef struct r_samr_get_dispenum_index +{ + uint32 idx; + NTSTATUS status; + +} SAMR_R_GET_DISPENUM_INDEX; /* SAMR_Q_DELETE_DOM_GROUP - delete domain group */ typedef struct q_samr_delete_dom_group_info diff --git a/source/include/rpc_secdes.h b/source/include/rpc_secdes.h index c385e41fd30..9e65052f849 100644 --- a/source/include/rpc_secdes.h +++ b/source/include/rpc_secdes.h @@ -43,33 +43,6 @@ #define SEC_ACE_OBJECT_PRESENT 0x00000001 /* thanks for Jim McDonough <jmcd@us.ibm.com> */ #define SEC_ACE_OBJECT_INHERITED_PRESENT 0x00000002 -#define SEC_ACE_FLAG_OBJECT_INHERIT 0x1 -#define SEC_ACE_FLAG_CONTAINER_INHERIT 0x2 -#define SEC_ACE_FLAG_NO_PROPAGATE_INHERIT 0x4 -#define SEC_ACE_FLAG_INHERIT_ONLY 0x8 -#define SEC_ACE_FLAG_INHERITED_ACE 0x10 /* New for Windows 2000 */ -#define SEC_ACE_FLAG_VALID_INHERIT 0xf -#define SEC_ACE_FLAG_SUCCESSFUL_ACCESS 0x40 -#define SEC_ACE_FLAG_FAILED_ACCESS 0x80 - -#define SEC_ACE_TYPE_ACCESS_ALLOWED 0x0 -#define SEC_ACE_TYPE_ACCESS_DENIED 0x1 -#define SEC_ACE_TYPE_SYSTEM_AUDIT 0x2 -#define SEC_ACE_TYPE_SYSTEM_ALARM 0x3 -#define SEC_ACE_TYPE_ALLOWED_COMPOUND 0x4 -#define SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT 0x5 -#define SEC_ACE_TYPE_ACCESS_DENIED_OBJECT 0x6 -#define SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT 0x7 -#define SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT 0x8 - -#define SEC_DESC_OWNER_DEFAULTED 0x0001 -#define SEC_DESC_GROUP_DEFAULTED 0x0002 -#define SEC_DESC_DACL_PRESENT 0x0004 -#define SEC_DESC_DACL_DEFAULTED 0x0008 -#define SEC_DESC_SACL_PRESENT 0x0010 -#define SEC_DESC_SACL_DEFAULTED 0x0020 -#define SEC_DESC_DACL_TRUSTED 0x0040 -#define SEC_DESC_SERVER_SECURITY 0x0080 /* * New Windows 2000 bits. */ @@ -80,11 +53,6 @@ #define SE_DESC_DACL_PROTECTED 0x1000 #define SE_DESC_SACL_PROTECTED 0x2000 -/* Don't know what this means. */ -#define SEC_DESC_RM_CONTROL_VALID 0x4000 - -#define SEC_DESC_SELF_RELATIVE 0x8000 - /* security information */ #define OWNER_SECURITY_INFORMATION 0x00000001 #define GROUP_SECURITY_INFORMATION 0x00000002 @@ -104,25 +72,20 @@ PROTECTED_DACL_SECURITY_INFORMATION) /* SEC_ACCESS */ -typedef struct security_info_info -{ - uint32 mask; - -} SEC_ACCESS; +typedef uint32 SEC_ACCESS; /* SEC_ACE */ -typedef struct security_ace_info -{ +typedef struct security_ace_info { uint8 type; /* xxxx_xxxx_ACE_TYPE - e.g allowed / denied etc */ uint8 flags; /* xxxx_INHERIT_xxxx - e.g OBJECT_INHERIT_ACE */ uint16 size; - SEC_ACCESS info; + SEC_ACCESS access_mask; /* this stuff may be present when type is XXXX_TYPE_XXXX_OBJECT */ uint32 obj_flags; /* xxxx_ACE_OBJECT_xxxx e.g present/inherited present etc */ - struct uuid obj_guid; /* object GUID */ - struct uuid inh_guid; /* inherited object GUID */ + struct GUID obj_guid; /* object GUID */ + struct GUID inh_guid; /* inherited object GUID */ /* eof object stuff */ DOM_SID trustee; @@ -134,19 +97,14 @@ typedef struct security_ace_info #define ACL_REVISION 0x3 #endif -#ifndef NT4_ACL_REVISION -#define NT4_ACL_REVISION 0x2 -#endif - #ifndef _SEC_ACL /* SEC_ACL */ -typedef struct security_acl_info -{ +typedef struct security_acl_info { uint16 revision; /* 0x0003 */ uint16 size; /* size in bytes of the entire ACL structure */ uint32 num_aces; /* number of Access Control Entries */ - SEC_ACE *ace; + SEC_ACE *aces; } SEC_ACL; #define SEC_ACL_HEADER_SIZE (2 * sizeof(uint16) + sizeof(uint32)) @@ -159,8 +117,7 @@ typedef struct security_acl_info #ifndef _SEC_DESC /* SEC_DESC */ -typedef struct security_descriptor_info -{ +typedef struct security_descriptor_info { uint16 revision; /* 0x0001 */ uint16 type; /* SEC_DESC_xxxx flags */ @@ -172,7 +129,7 @@ typedef struct security_descriptor_info SEC_ACL *dacl; /* user ACL */ SEC_ACL *sacl; /* system ACL */ DOM_SID *owner_sid; - DOM_SID *grp_sid; + DOM_SID *group_sid; } SEC_DESC; #define SEC_DESC_HEADER_SIZE (2 * sizeof(uint16) + 4 * sizeof(uint32)) @@ -181,8 +138,7 @@ typedef struct security_descriptor_info #ifndef _SEC_DESC_BUF /* SEC_DESC_BUF */ -typedef struct sec_desc_buf_info -{ +typedef struct sec_desc_buf_info { uint32 max_len; uint32 ptr; uint32 len; diff --git a/source/include/rpc_spoolss.h b/source/include/rpc_spoolss.h index 681dcd73d42..069d2b3bf74 100755 --- a/source/include/rpc_spoolss.h +++ b/source/include/rpc_spoolss.h @@ -984,6 +984,12 @@ typedef struct printer_info_5 } PRINTER_INFO_5; +typedef struct printer_info_6 +{ + uint32 status; +} +PRINTER_INFO_6; + #define SPOOL_DS_PUBLISH 1 #define SPOOL_DS_UPDATE 2 #define SPOOL_DS_UNPUBLISH 4 @@ -1556,7 +1562,7 @@ typedef struct { uint32 previousnames_len; uint32 previousnames_ptr; NTTIME driverdate; - UINT64_S driverversion; + uint64 driverversion; uint32 dummy4; uint32 mfgname_ptr; uint32 oemurl_ptr; diff --git a/source/include/rpc_srvsvc.h b/source/include/rpc_srvsvc.h index f84054b878b..5d32d65c3df 100644 --- a/source/include/rpc_srvsvc.h +++ b/source/include/rpc_srvsvc.h @@ -485,12 +485,6 @@ typedef struct ptr_info_1004_info SH_INFO_1004_STR info_1004_str; } SRV_SHARE_INFO_1004; -#define SHARE_1005_IN_DFS 0x00000001 -#define SHARE_1005_DFS_ROOT 0x00000002 -/* use the CSC policy mask and shift to match up with the smb.conf parm */ -#define SHARE_1005_CSC_POLICY_MASK 0x00000030 -#define SHARE_1005_CSC_POLICY_SHIFT 4 - typedef struct share_info_1005_info { uint32 share_info_flags; diff --git a/source/include/rpc_wkssvc.h b/source/include/rpc_wkssvc.h deleted file mode 100644 index adc37c255b2..00000000000 --- a/source/include/rpc_wkssvc.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - Unix SMB/CIFS implementation. - SMB parameters and setup - Copyright (C) Andrew Tridgell 1992-1997 - Copyright (C) Luke Kenneth Casson Leighton 1996-1997 - Copyright (C) Paul Ashton 1997 - - 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 _RPC_WKS_H /* _RPC_WKS_H */ -#define _RPC_WKS_H - - -/* wkssvc pipe */ -#define WKS_QUERY_INFO 0x00 - - -/* WKS_Q_QUERY_INFO - probably a capabilities request */ -typedef struct q_wks_query_info_info -{ - uint32 ptr_srv_name; /* pointer (to server name?) */ - UNISTR2 uni_srv_name; /* unicode server name starting with '\\' */ - - uint16 switch_value; /* info level 100 (0x64) */ - -} WKS_Q_QUERY_INFO; - - -/* WKS_INFO_100 - level 100 info */ -typedef struct wks_info_100_info -{ - uint32 platform_id; /* 0x0000 01f4 - unknown */ - uint32 ptr_compname; /* pointer to server name */ - uint32 ptr_lan_grp ; /* pointer to domain name */ - uint32 ver_major; /* 4 - unknown */ - uint32 ver_minor; /* 0 - unknown */ - - UNISTR2 uni_compname; /* unicode server name */ - UNISTR2 uni_lan_grp ; /* unicode domain name */ - -} WKS_INFO_100; - - -/* WKS_R_QUERY_INFO - probably a capabilities request */ -typedef struct r_wks_query_info_info -{ - uint16 switch_value; /* 100 (0x64) - switch value */ - - /* for now, only level 100 is supported. this should be an enum container */ - uint32 ptr_1; /* pointer 1 */ - WKS_INFO_100 *wks100; /* workstation info level 100 */ - - NTSTATUS status; /* return status */ - -} WKS_R_QUERY_INFO; - - -#endif /* _RPC_WKS_H */ - diff --git a/source/include/session.h b/source/include/session.h index f613afee09a..8c8faab5325 100644 --- a/source/include/session.h +++ b/source/include/session.h @@ -1,8 +1,10 @@ /* Unix SMB/CIFS implementation. session handling for recording currently vailid vuids + Copyright (C) tridge@samba.org 2001 Copyright (C) Andew Bartlett <abartlet@samba.org> 2001 + Copyright (C) Gerald (Jerry) Carter 2006 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 @@ -36,5 +38,6 @@ struct sessionid { uint32 id_num; uint32 pid; fstring ip_addr; + time_t connect_start; }; diff --git a/source/include/smb.h b/source/include/smb.h index b805f864a04..3f0356f2248 100644 --- a/source/include/smb.h +++ b/source/include/smb.h @@ -28,7 +28,7 @@ #define _SMB_H /* logged when starting the various Samba daemons */ -#define COPYRIGHT_STARTUP_MESSAGE "Copyright Andrew Tridgell and the Samba Team 1992-2006" +#define COPYRIGHT_STARTUP_MESSAGE "Copyright Andrew Tridgell and the Samba Team 1992-2007" #if defined(LARGE_SMB_OFF_T) @@ -52,11 +52,6 @@ #define Auto (2) #define Required (3) -#ifndef _BOOL -typedef int BOOL; -#define _BOOL /* So we don't typedef BOOL again in vfs.h */ -#endif - #define SIZEOFWORD 2 #ifndef DEF_CREATE_MASK @@ -138,13 +133,6 @@ typedef int BOOL; #define OPENX_FILE_CREATE_IF_NOT_EXIST 0x10 #define OPENX_FILE_FAIL_IF_NOT_EXIST 0 -/* share types */ -#define STYPE_DISKTREE 0 /* Disk drive */ -#define STYPE_PRINTQ 1 /* Spooler queue */ -#define STYPE_DEVICE 2 /* Serial device */ -#define STYPE_IPC 3 /* Interprocess communication (IPC) */ -#define STYPE_HIDDEN 0x80000000 /* share is a hidden one (ends with $) */ - #include "doserr.h" typedef union unid_t { @@ -179,6 +167,10 @@ typedef smb_ucs2_t wfstring[FSTRING_LEN]; #define COPY_UCS2_CHAR(dest,src) (((unsigned char *)(dest))[0] = ((unsigned char *)(src))[0],\ ((unsigned char *)(dest))[1] = ((unsigned char *)(src))[1], (dest)) +/* Large data type for manipulating uint32 unicode codepoints */ +typedef uint32 codepoint_t; +#define INVALID_CODEPOINT ((codepoint_t)-1) + /* pipe string names */ #define PIPE_LANMAN "\\PIPE\\LANMAN" #define PIPE_SRVSVC "\\PIPE\\srvsvc" @@ -217,10 +209,7 @@ typedef smb_ucs2_t wfstring[FSTRING_LEN]; #define PI_MAX_PIPES 14 /* 64 bit time (100usec) since ????? - cifs6.txt, section 3.5, page 30 */ -typedef struct nttime_info { - uint32 low; - uint32 high; -} NTTIME; +typedef uint64_t NTTIME; /* Allowable account control bits */ @@ -255,7 +244,7 @@ typedef struct nttime_info { #define SID_MAX_SIZE ((size_t)(8+(MAXSUBAUTHS*4))) /* SID Types */ -enum SID_NAME_USE { +enum lsa_SidType { SID_NAME_USE_NONE = 0, SID_NAME_USER = 1, /* user */ SID_NAME_DOM_GRP, /* domain group */ @@ -280,7 +269,7 @@ enum SID_NAME_USE { * * @sa http://msdn.microsoft.com/library/default.asp?url=/library/en-us/security/accctrl_38yn.asp **/ -typedef struct sid_info { +typedef struct dom_sid { uint8 sid_rev_num; /**< SID revision number */ uint8 num_auths; /**< Number of sub-authorities */ uint8 id_auth[6]; /**< Identifier Authority */ @@ -293,6 +282,36 @@ typedef struct sid_info { uint32 sub_auths[MAXSUBAUTHS]; } DOM_SID; +#define dom_sid2 dom_sid +#define dom_sid28 dom_sid + +enum id_mapping { + ID_UNKNOWN, + ID_MAPPED, + ID_UNMAPPED +}; + +enum id_type { + ID_TYPE_UID, + ID_TYPE_GID +}; + +struct unixid { + uint32_t id; + enum id_type type; +}; + +struct id_map { + DOM_SID *sid; + struct unixid xid; + enum id_mapping status; +}; + +#include "librpc/ndr/misc.h" +#include "librpc/ndr/security.h" +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/wkssvc.h" + struct lsa_dom_info { BOOL valid; DOM_SID sid; @@ -303,7 +322,7 @@ struct lsa_dom_info { struct lsa_name_info { uint32 rid; - enum SID_NAME_USE type; + enum lsa_SidType type; const char *name; int dom_idx; }; @@ -407,9 +426,60 @@ struct fd_handle { unsigned long file_id; }; +struct messaging_context; +struct event_context; +struct fd_event; struct timed_event; struct idle_event; struct share_mode_entry; +struct uuid; + +struct vfs_fsp_data { + struct vfs_fsp_data *next; + struct vfs_handle_struct *owner; + /* NOTE: This structure contains two pointers so that we can guarantee + * that the end of the structure is always both 4-byte and 8-byte aligned. + */ +}; + +/* the basic packet size, assuming no words or bytes */ +#define smb_size 39 + +struct notify_change { + uint32_t action; + const char *name; +}; + +struct notify_mid_map; +struct notify_entry; +struct notify_event; +struct notify_change_request; +struct sys_notify_backend; +struct sys_notify_context { + struct event_context *ev; + struct connection_struct *conn; + void *private_data; /* For use by the system backend */ +}; + +struct notify_change_buf { + /* + * If no requests are pending, changes are queued here. Simple array, + * we only append. + */ + + /* + * num_changes == -1 means that we have got a catch-all change, when + * asked we just return NT_STATUS_OK without specific changes. + */ + int num_changes; + struct notify_change *changes; + + /* + * If no changes are around requests are queued here. Using a linked + * list, because we have to append at the end and delete from the top. + */ + struct notify_change_request *requests; +}; typedef struct files_struct { struct files_struct *next, *prev; @@ -435,6 +505,7 @@ typedef struct files_struct { int oplock_type; int sent_oplock_break; struct timed_event *oplock_timeout; + struct lock_struct last_lock_failure; struct share_mode_entry *pending_break_messages; int num_pending_break_messages; @@ -448,8 +519,14 @@ typedef struct files_struct { BOOL is_stat; BOOL aio_write_behind; BOOL lockdb_clean; + BOOL initial_delete_on_close; /* Only set at NTCreateX if file was created. */ + BOOL posix_open; char *fsp_name; + + struct vfs_fsp_data *vfs_extension; FAKE_FILE_HANDLE *fake_file_handle; + + struct notify_change_buf *notify; } files_struct; #include "ntquotas.h" @@ -520,6 +597,8 @@ struct trans_state { /* Include VFS stuff */ +struct security_descriptor_info; + #include "smb_acls.h" #include "vfs.h" @@ -533,11 +612,19 @@ struct dfree_cached_info { struct dptr_struct; +struct share_params { + int service; +}; + +struct share_iterator { + int next_id; +}; + typedef struct connection_struct { struct connection_struct *next, *prev; - TALLOC_CTX *mem_ctx; + TALLOC_CTX *mem_ctx; /* long-lived memory context for things hanging off this struct. */ unsigned cnum; /* an index passed over the wire */ - int service; + struct share_params *params; BOOL force_user; BOOL force_group; struct vuid_cache vuid_cache; @@ -584,6 +671,7 @@ typedef struct connection_struct { name_compare_entry *aio_write_behind_list; /* Per-share list of files to use aio write behind on. */ struct dfree_cached_info *dfree_info; struct trans_state *pending_trans; + struct notify_context *notify_ctx; } connection_struct; struct current_user { @@ -656,6 +744,8 @@ struct pending_message_list { DATA_BLOB private_data; }; +#define SHARE_MODE_FLAG_POSIX_OPEN 0x1 + /* struct returned by get_share_modes */ struct share_mode_entry { struct process_id pid; @@ -672,6 +762,7 @@ struct share_mode_entry { SMB_INO_T inode; unsigned long share_file_id; uint32 uid; /* uid of file opener. */ + uint16 flags; /* POSIX_OPEN only defined so far... */ }; /* oplock break message definition - linearization of share_mode_entry. @@ -689,10 +780,11 @@ Offset Data length. 36 SMB_INO_T inode 8 bytes 44 unsigned long file_id 4 bytes 48 uint32 uid 4 bytes -52 +52 uint16 flags 2 bytes +54 */ -#define MSG_SMB_SHARE_MODE_ENTRY_SIZE 52 +#define MSG_SMB_SHARE_MODE_ENTRY_SIZE 54 struct share_mode_lock { const char *servicepath; /* canonicalized. */ @@ -703,7 +795,6 @@ struct share_mode_lock { struct share_mode_entry *share_modes; UNIX_USER_TOKEN *delete_token; BOOL delete_on_close; - BOOL initial_delete_on_close; BOOL fresh; BOOL modified; }; @@ -718,7 +809,6 @@ struct locking_data { struct { int num_share_mode_entries; BOOL delete_on_close; - BOOL initial_delete_on_close; /* Only set at NTCreateX if file was created. */ uint32 delete_token_size; /* Only valid if either of the two previous fields are True. */ @@ -733,6 +823,16 @@ struct locking_data { */ }; +/* Used to store pipe open records for NetFileEnum() */ + +struct pipe_open_rec { + struct process_id pid; + uid_t uid; + int pnum; + fstring name; +}; + + #define NT_HASH_LEN 16 #define LM_HASH_LEN 16 @@ -836,57 +936,11 @@ struct parm_struct { #define FLAG_HIDE 0x2000 /* options that should be hidden in SWAT */ #define FLAG_DOS_STRING 0x4000 /* convert from UNIX to DOS codepage when reading this string. */ -/* passed to br lock code - the UNLOCK_LOCK should never be stored into the tdb - and is used in calculating POSIX unlock ranges only. */ - -enum brl_type {READ_LOCK, WRITE_LOCK, PENDING_LOCK, UNLOCK_LOCK}; -enum brl_flavour {WINDOWS_LOCK = 0, POSIX_LOCK = 1}; - -/* The key used in the brlock database. */ - -struct lock_key { - SMB_DEV_T device; - SMB_INO_T inode; -}; - -struct byte_range_lock { - files_struct *fsp; - unsigned int num_locks; - BOOL modified; - struct lock_key key; - void *lock_data; -}; - -#define BRLOCK_FN_CAST() \ - void (*)(SMB_DEV_T dev, SMB_INO_T ino, struct process_id pid, \ - enum brl_type lock_type, \ - enum brl_flavour lock_flav, \ - br_off start, br_off size) - -#define BRLOCK_FN(fn) \ - void (*fn)(SMB_DEV_T dev, SMB_INO_T ino, struct process_id pid, \ - enum brl_type lock_type, \ - enum brl_flavour lock_flav, \ - br_off start, br_off size) - -#define LOCKING_FN_CAST() \ - void (*)(struct share_mode_entry *, const char *, const char *) - -#define LOCKING_FN(fn) \ - void (*fn)(struct share_mode_entry *, const char *, const char *) - struct bitmap { uint32 *b; unsigned int n; }; -#ifndef LOCKING_VERSION -#define LOCKING_VERSION 4 -#endif /* LOCKING_VERSION */ - -/* the basic packet size, assuming no words or bytes */ -#define smb_size 39 - /* offsets into message for common items */ #define smb_com 8 #define smb_rcls 9 @@ -948,7 +1002,7 @@ struct bitmap { #define SMBunlock 0x0D /* unlock byte range */ #define SMBctemp 0x0E /* create temporary file */ #define SMBmknew 0x0F /* make new file */ -#define SMBchkpth 0x10 /* check directory path */ +#define SMBcheckpath 0x10 /* check directory path */ #define SMBexit 0x11 /* process exit */ #define SMBlseek 0x12 /* seek */ #define SMBtcon 0x70 /* tree connect */ @@ -1337,7 +1391,7 @@ struct bitmap { #define FILE_READ_ONLY_VOLUME 0x00080000 /* ChangeNotify flags. */ -#define FILE_NOTIFY_CHANGE_FILE 0x001 +#define FILE_NOTIFY_CHANGE_FILE_NAME 0x001 #define FILE_NOTIFY_CHANGE_DIR_NAME 0x002 #define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x004 #define FILE_NOTIFY_CHANGE_SIZE 0x008 @@ -1346,7 +1400,23 @@ struct bitmap { #define FILE_NOTIFY_CHANGE_CREATION 0x040 #define FILE_NOTIFY_CHANGE_EA 0x080 #define FILE_NOTIFY_CHANGE_SECURITY 0x100 -#define FILE_NOTIFY_CHANGE_FILE_NAME 0x200 +#define FILE_NOTIFY_CHANGE_STREAM_NAME 0x00000200 +#define FILE_NOTIFY_CHANGE_STREAM_SIZE 0x00000400 +#define FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800 + +#define FILE_NOTIFY_CHANGE_NAME \ + (FILE_NOTIFY_CHANGE_FILE_NAME|FILE_NOTIFY_CHANGE_DIR_NAME) + +/* change notify action results */ +#define NOTIFY_ACTION_ADDED 1 +#define NOTIFY_ACTION_REMOVED 2 +#define NOTIFY_ACTION_MODIFIED 3 +#define NOTIFY_ACTION_OLD_NAME 4 +#define NOTIFY_ACTION_NEW_NAME 5 +#define NOTIFY_ACTION_ADDED_STREAM 6 +#define NOTIFY_ACTION_REMOVED_STREAM 7 +#define NOTIFY_ACTION_MODIFIED_STREAM 8 + /* where to find the base of the SMB packet proper */ #define smb_base(buf) (((char *)(buf))+4) @@ -1375,36 +1445,6 @@ char *strdup(char *s); #define SELECT_CAST #endif -/* these are used in NetServerEnum to choose what to receive */ -#define SV_TYPE_WORKSTATION 0x00000001 -#define SV_TYPE_SERVER 0x00000002 -#define SV_TYPE_SQLSERVER 0x00000004 -#define SV_TYPE_DOMAIN_CTRL 0x00000008 -#define SV_TYPE_DOMAIN_BAKCTRL 0x00000010 -#define SV_TYPE_TIME_SOURCE 0x00000020 -#define SV_TYPE_AFP 0x00000040 -#define SV_TYPE_NOVELL 0x00000080 -#define SV_TYPE_DOMAIN_MEMBER 0x00000100 -#define SV_TYPE_PRINTQ_SERVER 0x00000200 -#define SV_TYPE_DIALIN_SERVER 0x00000400 -#define SV_TYPE_SERVER_UNIX 0x00000800 -#define SV_TYPE_NT 0x00001000 -#define SV_TYPE_WFW 0x00002000 -#define SV_TYPE_SERVER_MFPN 0x00004000 -#define SV_TYPE_SERVER_NT 0x00008000 -#define SV_TYPE_POTENTIAL_BROWSER 0x00010000 -#define SV_TYPE_BACKUP_BROWSER 0x00020000 -#define SV_TYPE_MASTER_BROWSER 0x00040000 -#define SV_TYPE_DOMAIN_MASTER 0x00080000 -#define SV_TYPE_SERVER_OSF 0x00100000 -#define SV_TYPE_SERVER_VMS 0x00200000 -#define SV_TYPE_WIN95_PLUS 0x00400000 -#define SV_TYPE_DFS_SERVER 0x00800000 -#define SV_TYPE_ALTERNATE_XPORT 0x20000000 -#define SV_TYPE_LOCAL_LIST_ONLY 0x40000000 -#define SV_TYPE_DOMAIN_ENUM 0x80000000 -#define SV_TYPE_ALL 0xFFFFFFFF - /* This was set by JHT in liaison with Jeremy Allison early 1997 * History: * Version 4.0 - never made public @@ -1436,6 +1476,7 @@ char *strdup(char *s); #define FLAGS2_LONG_PATH_COMPONENTS 0x0001 #define FLAGS2_EXTENDED_ATTRIBUTES 0x0002 #define FLAGS2_SMB_SECURITY_SIGNATURES 0x0004 +#define FLAGS2_UNKNOWN_BIT4 0x0010 #define FLAGS2_IS_LONG_NAME 0x0040 #define FLAGS2_EXTENDED_SECURITY 0x0800 #define FLAGS2_DFS_PATHNAMES 0x1000 @@ -1483,7 +1524,7 @@ enum server_types { enum printing_types {PRINT_BSD,PRINT_SYSV,PRINT_AIX,PRINT_HPUX, PRINT_QNX,PRINT_PLP,PRINT_LPRNG,PRINT_SOFTQ, PRINT_CUPS,PRINT_LPRNT,PRINT_LPROS2,PRINT_IPRINT -#ifdef DEVELOPER +#if defined(DEVELOPER) || defined(ENABLE_BUILD_FARM_HACKS) ,PRINT_TEST,PRINT_VLP #endif /* DEVELOPER */ }; @@ -1499,7 +1540,8 @@ enum ldap_passwd_sync_types {LDAP_PASSWD_SYNC_ON, LDAP_PASSWD_SYNC_OFF, LDAP_PAS /* Remote architectures we know about. */ enum remote_arch_types {RA_UNKNOWN, RA_WFWG, RA_OS2, RA_WIN95, RA_WINNT, - RA_WIN2K, RA_WINXP, RA_WIN2K3, RA_SAMBA, RA_CIFSFS}; + RA_WIN2K, RA_WINXP, RA_WIN2K3, RA_VISTA, + RA_SAMBA, RA_CIFSFS}; /* case handling */ enum case_handling {CASE_LOWER,CASE_UPPER}; @@ -1552,19 +1594,19 @@ extern int chain_size; * Note these must fit into 16-bits. */ -#define NO_OPLOCK 0 -#define EXCLUSIVE_OPLOCK 1 -#define BATCH_OPLOCK 2 -#define LEVEL_II_OPLOCK 4 +#define NO_OPLOCK 0x0 +#define EXCLUSIVE_OPLOCK 0x1 +#define BATCH_OPLOCK 0x2 +#define LEVEL_II_OPLOCK 0x4 /* The following are Samba-private. */ -#define INTERNAL_OPEN_ONLY 8 -#define FAKE_LEVEL_II_OPLOCK 16 /* Client requested no_oplock, but we have to +#define INTERNAL_OPEN_ONLY 0x8 +#define FAKE_LEVEL_II_OPLOCK 0x10 /* Client requested no_oplock, but we have to * inform potential level2 holders on * write. */ -#define DEFERRED_OPEN_ENTRY 32 -#define UNUSED_SHARE_MODE_ENTRY 64 -#define FORCE_OPLOCK_BREAK_TO_NONE 128 +#define DEFERRED_OPEN_ENTRY 0x20 +#define UNUSED_SHARE_MODE_ENTRY 0x40 +#define FORCE_OPLOCK_BREAK_TO_NONE 0x80 /* None of the following should ever appear in fsp->oplock_request. */ #define SAMBA_PRIVATE_OPLOCK_MASK (INTERNAL_OPEN_ONLY|DEFERRED_OPEN_ENTRY|UNUSED_SHARE_MODE_ENTRY|FORCE_OPLOCK_BREAK_TO_NONE) @@ -1651,17 +1693,6 @@ struct kernel_oplocks { int notification_fd; }; - -/* this structure defines the functions for doing change notify in - various implementations */ -struct cnotify_fns { - void * (*register_notify)(connection_struct *conn, char *path, uint32 flags); - BOOL (*check_notify)(connection_struct *conn, uint16 vuid, char *path, uint32 flags, void *data, time_t t); - void (*remove_notify)(void *data); - int select_time; - int notification_fd; -}; - #include "smb_macros.h" #define MAX_NETBIOSNAME_LEN 16 @@ -1697,6 +1728,15 @@ struct pwd_info { fstring password; }; +/* For split krb5 SPNEGO blobs. */ +struct pending_auth_data { + struct pending_auth_data *prev, *next; + uint16 vuid; /* Tag for this entry. */ + uint16 smbpid; /* Alternate tag for this entry. */ + size_t needed_len; + DATA_BLOB partial_data; +}; + typedef struct user_struct { struct user_struct *next, *prev; uint16 vuid; /* Tag for this entry. */ @@ -1726,7 +1766,6 @@ typedef struct user_struct { struct auth_serversupplied_info *server_info; struct auth_ntlmssp_state *auth_ntlmssp_state; - } user_struct; struct unix_error_map { @@ -1803,6 +1842,9 @@ struct ip_service { unsigned port; }; +/* Special name type used to cause a _kerberos DNS lookup. */ +#define KDC_NAME_TYPE 0xDCDC + /* Used by the SMB signing functions. */ typedef struct smb_sign_info { @@ -1834,15 +1876,7 @@ struct ea_list { /* EA to use for DOS attributes */ #define SAMBA_XATTR_DOS_ATTRIB "user.DOSATTRIB" -struct uuid { - uint32 time_low; - uint16 time_mid; - uint16 time_hi_and_version; - uint8 clock_seq[2]; - uint8 node[6]; -}; #define UUID_SIZE 16 - #define UUID_FLAT_SIZE 16 typedef struct uuid_flat { uint8 info[UUID_FLAT_SIZE]; diff --git a/source/include/smb_acls.h b/source/include/smb_acls.h index ec1316e4667..0d2cbdde52c 100644 --- a/source/include/smb_acls.h +++ b/source/include/smb_acls.h @@ -20,250 +20,42 @@ #ifndef _SMB_ACLS_H #define _SMB_ACLS_H -#if defined(HAVE_POSIX_ACLS) -/* This is an identity mapping (just remove the SMB_). */ - -#define SMB_ACL_TAG_T acl_tag_t -#define SMB_ACL_TYPE_T acl_type_t -#define SMB_ACL_PERMSET_T acl_permset_t -#define SMB_ACL_PERM_T acl_perm_t -#define SMB_ACL_READ ACL_READ -#define SMB_ACL_WRITE ACL_WRITE -#define SMB_ACL_EXECUTE ACL_EXECUTE - -/* Types of ACLs. */ -#define SMB_ACL_USER ACL_USER -#define SMB_ACL_USER_OBJ ACL_USER_OBJ -#define SMB_ACL_GROUP ACL_GROUP -#define SMB_ACL_GROUP_OBJ ACL_GROUP_OBJ -#define SMB_ACL_OTHER ACL_OTHER -#define SMB_ACL_MASK ACL_MASK - -#define SMB_ACL_T acl_t - -#define SMB_ACL_ENTRY_T acl_entry_t - -#define SMB_ACL_FIRST_ENTRY ACL_FIRST_ENTRY -#define SMB_ACL_NEXT_ENTRY ACL_NEXT_ENTRY - -#define SMB_ACL_TYPE_ACCESS ACL_TYPE_ACCESS -#define SMB_ACL_TYPE_DEFAULT ACL_TYPE_DEFAULT - -#elif defined(HAVE_TRU64_ACLS) - -/* This is for DEC/Compaq Tru64 UNIX */ - -#define SMB_ACL_TAG_T acl_tag_t -#define SMB_ACL_TYPE_T acl_type_t -#define SMB_ACL_PERMSET_T acl_permset_t -#define SMB_ACL_PERM_T acl_perm_t -#define SMB_ACL_READ ACL_READ -#define SMB_ACL_WRITE ACL_WRITE -#define SMB_ACL_EXECUTE ACL_EXECUTE - -/* Types of ACLs. */ -#define SMB_ACL_USER ACL_USER -#define SMB_ACL_USER_OBJ ACL_USER_OBJ -#define SMB_ACL_GROUP ACL_GROUP -#define SMB_ACL_GROUP_OBJ ACL_GROUP_OBJ -#define SMB_ACL_OTHER ACL_OTHER -#define SMB_ACL_MASK ACL_MASK - -#define SMB_ACL_T acl_t - -#define SMB_ACL_ENTRY_T acl_entry_t - -#define SMB_ACL_FIRST_ENTRY 0 -#define SMB_ACL_NEXT_ENTRY 1 - -#define SMB_ACL_TYPE_ACCESS ACL_TYPE_ACCESS -#define SMB_ACL_TYPE_DEFAULT ACL_TYPE_DEFAULT - -#elif defined(HAVE_UNIXWARE_ACLS) || defined(HAVE_SOLARIS_ACLS) -/* - * Donated by Michael Davidson <md@sco.COM> for UnixWare / OpenUNIX. - * Modified by Toomas Soome <tsoome@ut.ee> for Solaris. - */ - -/* SVR4.2 ES/MP ACLs */ -typedef int SMB_ACL_TAG_T; typedef int SMB_ACL_TYPE_T; -typedef ushort *SMB_ACL_PERMSET_T; -typedef ushort SMB_ACL_PERM_T; +typedef mode_t *SMB_ACL_PERMSET_T; +typedef mode_t SMB_ACL_PERM_T; #define SMB_ACL_READ 4 #define SMB_ACL_WRITE 2 #define SMB_ACL_EXECUTE 1 /* Types of ACLs. */ -#define SMB_ACL_USER USER -#define SMB_ACL_USER_OBJ USER_OBJ -#define SMB_ACL_GROUP GROUP -#define SMB_ACL_GROUP_OBJ GROUP_OBJ -#define SMB_ACL_OTHER OTHER_OBJ -#define SMB_ACL_MASK CLASS_OBJ - -typedef struct SMB_ACL_T { - int size; - int count; - int next; - struct acl acl[1]; -} *SMB_ACL_T; - -typedef struct acl *SMB_ACL_ENTRY_T; - -#define SMB_ACL_FIRST_ENTRY 0 -#define SMB_ACL_NEXT_ENTRY 1 - -#define SMB_ACL_TYPE_ACCESS 0 -#define SMB_ACL_TYPE_DEFAULT 1 - -#elif defined(HAVE_HPUX_ACLS) - -/* - * Based on the Solaris & UnixWare code. - */ - -#undef GROUP -#include <sys/aclv.h> +enum smb_acl_tag_t { + SMB_ACL_TAG_INVALID=0, + SMB_ACL_USER=1, + SMB_ACL_USER_OBJ, + SMB_ACL_GROUP, + SMB_ACL_GROUP_OBJ, + SMB_ACL_OTHER, + SMB_ACL_MASK +}; -/* SVR4.2 ES/MP ACLs */ -typedef int SMB_ACL_TAG_T; -typedef int SMB_ACL_TYPE_T; -typedef ushort *SMB_ACL_PERMSET_T; -typedef ushort SMB_ACL_PERM_T; -#define SMB_ACL_READ 4 -#define SMB_ACL_WRITE 2 -#define SMB_ACL_EXECUTE 1 +typedef enum smb_acl_tag_t SMB_ACL_TAG_T; -/* Types of ACLs. */ -#define SMB_ACL_USER USER -#define SMB_ACL_USER_OBJ USER_OBJ -#define SMB_ACL_GROUP GROUP -#define SMB_ACL_GROUP_OBJ GROUP_OBJ -#define SMB_ACL_OTHER OTHER_OBJ -#define SMB_ACL_MASK CLASS_OBJ +struct smb_acl_entry { + enum smb_acl_tag_t a_type; + SMB_ACL_PERM_T a_perm; + uid_t uid; + gid_t gid; +}; -typedef struct SMB_ACL_T { +typedef struct smb_acl_t { int size; int count; int next; - struct acl acl[1]; -} *SMB_ACL_T; - -typedef struct acl *SMB_ACL_ENTRY_T; - -#define SMB_ACL_FIRST_ENTRY 0 -#define SMB_ACL_NEXT_ENTRY 1 - -#define SMB_ACL_TYPE_ACCESS 0 -#define SMB_ACL_TYPE_DEFAULT 1 - -#elif defined(HAVE_IRIX_ACLS) - -#define SMB_ACL_TAG_T acl_tag_t -#define SMB_ACL_TYPE_T acl_type_t -#define SMB_ACL_PERMSET_T acl_permset_t -#define SMB_ACL_PERM_T acl_perm_t -#define SMB_ACL_READ ACL_READ -#define SMB_ACL_WRITE ACL_WRITE -#define SMB_ACL_EXECUTE ACL_EXECUTE - -/* Types of ACLs. */ -#define SMB_ACL_USER ACL_USER -#define SMB_ACL_USER_OBJ ACL_USER_OBJ -#define SMB_ACL_GROUP ACL_GROUP -#define SMB_ACL_GROUP_OBJ ACL_GROUP_OBJ -#define SMB_ACL_OTHER ACL_OTHER_OBJ -#define SMB_ACL_MASK ACL_MASK - -typedef struct SMB_ACL_T { - int next; - BOOL freeaclp; - struct acl *aclp; -} *SMB_ACL_T; - -#define SMB_ACL_ENTRY_T acl_entry_t - -#define SMB_ACL_FIRST_ENTRY 0 -#define SMB_ACL_NEXT_ENTRY 1 - -#define SMB_ACL_TYPE_ACCESS ACL_TYPE_ACCESS -#define SMB_ACL_TYPE_DEFAULT ACL_TYPE_DEFAULT - -#elif defined(HAVE_AIX_ACLS) - -/* Donated by Medha Date, mdate@austin.ibm.com, for IBM */ - -#include <acl.h> - -typedef uint *SMB_ACL_PERMSET_T; - -struct acl_entry_link{ - struct acl_entry_link *prevp; - struct new_acl_entry *entryp; - struct acl_entry_link *nextp; - int count; -}; - -struct new_acl_entry{ - unsigned short ace_len; - unsigned short ace_type; - unsigned int ace_access; - struct ace_id ace_id[1]; -}; - -#define SMB_ACL_ENTRY_T struct new_acl_entry* -#define SMB_ACL_T struct acl_entry_link* - -#define SMB_ACL_TAG_T unsigned short -#define SMB_ACL_TYPE_T int -#define SMB_ACL_PERM_T uint -#define SMB_ACL_READ S_IRUSR -#define SMB_ACL_WRITE S_IWUSR -#define SMB_ACL_EXECUTE S_IXUSR - -/* Types of ACLs. */ -#define SMB_ACL_USER ACEID_USER -#define SMB_ACL_USER_OBJ 3 -#define SMB_ACL_GROUP ACEID_GROUP -#define SMB_ACL_GROUP_OBJ 4 -#define SMB_ACL_OTHER 5 -#define SMB_ACL_MASK 6 - - -#define SMB_ACL_FIRST_ENTRY 1 -#define SMB_ACL_NEXT_ENTRY 2 - -#define SMB_ACL_TYPE_ACCESS 0 -#define SMB_ACL_TYPE_DEFAULT 1 - -#else /* No ACLs. */ - -/* No ACLS - fake it. */ -#define SMB_ACL_TAG_T int -#define SMB_ACL_TYPE_T int -#define SMB_ACL_PERMSET_T mode_t -#define SMB_ACL_PERM_T mode_t -#define SMB_ACL_READ S_IRUSR -#define SMB_ACL_WRITE S_IWUSR -#define SMB_ACL_EXECUTE S_IXUSR - -/* Types of ACLs. */ -#define SMB_ACL_USER 0 -#define SMB_ACL_USER_OBJ 1 -#define SMB_ACL_GROUP 2 -#define SMB_ACL_GROUP_OBJ 3 -#define SMB_ACL_OTHER 4 -#define SMB_ACL_MASK 5 - -typedef struct SMB_ACL_T_ { - int dummy; + struct smb_acl_entry acl[1]; } *SMB_ACL_T; -typedef struct SMB_ACL_ENTRY_T_ { - int dummy; -} *SMB_ACL_ENTRY_T; +typedef struct smb_acl_entry *SMB_ACL_ENTRY_T; #define SMB_ACL_FIRST_ENTRY 0 #define SMB_ACL_NEXT_ENTRY 1 @@ -271,5 +63,4 @@ typedef struct SMB_ACL_ENTRY_T_ { #define SMB_ACL_TYPE_ACCESS 0 #define SMB_ACL_TYPE_DEFAULT 1 -#endif /* No ACLs. */ #endif /* _SMB_ACLS_H */ diff --git a/source/include/smb_macros.h b/source/include/smb_macros.h index 554dbbc0878..add7dcd31c2 100644 --- a/source/include/smb_macros.h +++ b/source/include/smb_macros.h @@ -83,30 +83,32 @@ #define SMB_ASSERT_ARRAY(a,n) SMB_ASSERT((sizeof(a)/sizeof((a)[0])) >= (n)) /* these are useful macros for checking validity of handles */ -#define OPEN_FSP(fsp) ((fsp) && !(fsp)->is_directory) -#define OPEN_CONN(conn) ((conn) && (conn)->open) #define IS_IPC(conn) ((conn) && (conn)->ipc) #define IS_PRINT(conn) ((conn) && (conn)->printer) /* you must add the following extern declaration to files using this macro + * (do not add it to the macro as that causes nested extern declaration warnings) * extern struct current_user current_user; */ #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));\ + return ERROR_NT(NT_STATUS_INVALID_HANDLE); \ } while(0) -#define FNUM_OK(fsp,c) (OPEN_FSP(fsp) && (c)==(fsp)->conn && current_user.vuid==(fsp)->vuid) +#define FNUM_OK(fsp,c) ((fsp) && !(fsp)->is_directory && (c)==(fsp)->conn && current_user.vuid==(fsp)->vuid) /* you must add the following extern declaration to files using this macro + * (do not add it to the macro as that causes nested extern declaration warnings) * extern struct current_user current_user; */ #define CHECK_FSP(fsp,conn) do {\ - extern struct current_user current_user;\ - if (!FNUM_OK(fsp,conn)) \ - return(ERROR_DOS(ERRDOS,ERRbadfid)); \ - else if((fsp)->fh->fd == -1) \ - return(ERROR_DOS(ERRDOS,ERRbadaccess));\ + if (!(fsp) || !(conn)) \ + return ERROR_NT(NT_STATUS_INVALID_HANDLE); \ + else if (((conn) != (fsp)->conn) || current_user.vuid != (fsp)->vuid) \ + return ERROR_NT(NT_STATUS_INVALID_HANDLE); \ + else if ((fsp)->is_directory) \ + return ERROR_NT(NT_STATUS_INVALID_DEVICE_REQUEST); \ + else if ((fsp)->fh->fd == -1) \ + return ERROR_NT(NT_STATUS_ACCESS_DENIED); \ (fsp)->num_smb_operations++;\ } while(0) @@ -122,7 +124,7 @@ /* the service number for the [globals] defaults */ #define GLOBAL_SECTION_SNUM (-1) /* translates a connection number into a service number */ -#define SNUM(conn) ((conn)?(conn)->service:GLOBAL_SECTION_SNUM) +#define SNUM(conn) ((conn)?(conn)->params->service:GLOBAL_SECTION_SNUM) /* access various service details */ @@ -133,10 +135,10 @@ #define GUEST_OK(snum) (VALID_SNUM(snum) && lp_guest_ok(snum)) #define GUEST_ONLY(snum) (VALID_SNUM(snum) && lp_guest_only(snum)) #define CAN_SETDIR(snum) (!lp_no_set_dir(snum)) -#define CAN_PRINT(conn) ((conn) && lp_print_ok((conn)->service)) -#define MAP_HIDDEN(conn) ((conn) && lp_map_hidden((conn)->service)) -#define MAP_SYSTEM(conn) ((conn) && lp_map_system((conn)->service)) -#define MAP_ARCHIVE(conn) ((conn) && lp_map_archive((conn)->service)) +#define CAN_PRINT(conn) ((conn) && lp_print_ok(SNUM(conn))) +#define MAP_HIDDEN(conn) ((conn) && lp_map_hidden(SNUM(conn))) +#define MAP_SYSTEM(conn) ((conn) && lp_map_system(SNUM(conn))) +#define MAP_ARCHIVE(conn) ((conn) && lp_map_archive(SNUM(conn))) #define IS_HIDDEN_PATH(conn,path) ((conn) && is_in_path((path),(conn)->hide_list,(conn)->case_sensitive)) #define IS_VETO_PATH(conn,path) ((conn) && is_in_path((path),(conn)->veto_list,(conn)->case_sensitive)) #define IS_VETO_OPLOCK_PATH(conn,path) ((conn) && is_in_path((path),(conn)->veto_oplock_list,(conn)->case_sensitive)) @@ -182,7 +184,6 @@ #define CACHED_ERROR(fsp) cached_error_packet(outbuf,fsp,__LINE__,__FILE__) #define ERROR_DOS(class,code) error_packet(outbuf,class,code,NT_STATUS_OK,__LINE__,__FILE__) -#define ERROR_FORCE_DOS(class,code) error_packet(outbuf,class,code,NT_STATUS_INVALID,__LINE__,__FILE__) #define ERROR_NT(status) error_packet(outbuf,0,0,status,__LINE__,__FILE__) #define ERROR_FORCE_NT(status) error_packet(outbuf,-1,-1,status,__LINE__,__FILE__) #define ERROR_BOTH(status,class,code) error_packet(outbuf,class,code,status,__LINE__,__FILE__) @@ -275,6 +276,7 @@ copy an IP address from one buffer to another *****************************************************************************/ #define SMB_MALLOC_ARRAY(type,count) (type *)malloc_array(sizeof(type),(count)) +#define SMB_MEMALIGN_ARRAY(type,align,count) (type *)memalign_array(sizeof(type),align,(count)) #define SMB_REALLOC(p,s) Realloc((p),(s),True) /* Always frees p on error or s == 0 */ #define SMB_REALLOC_KEEP_OLD_ON_ERROR(p,s) Realloc((p),(s),False) /* Never frees p on error or s == 0 */ #define SMB_REALLOC_ARRAY(p,type,count) (type *)realloc_array((p),sizeof(type),(count),True) /* Always frees p on error or s == 0 */ @@ -284,7 +286,7 @@ copy an IP address from one buffer to another #define SMB_XMALLOC_ARRAY(type,count) (type *)smb_xmalloc_array(sizeof(type),(count)) /* limiting size of ipc replies */ -#define SMB_REALLOC_LIMIT(ptr,size) SMB_REALLOC(ptr,MAX((size),4*1024)) +#define SMB_REALLOC_LIMIT(ptr,size) (char *)SMB_REALLOC(ptr,MAX((size),4*1024)) /* The new talloc is paranoid malloc checker safe. */ @@ -377,6 +379,14 @@ do { \ } while (0) #define ADD_TO_LARGE_ARRAY(mem_ctx, type, elem, array, num, size) \ - add_to_large_array((mem_ctx), sizeof(type), &(elem), (void **)(array), (num), (size)); + add_to_large_array((mem_ctx), sizeof(type), &(elem), (void *)(array), (num), (size)); + +#ifndef ISDOT +#define ISDOT(p) (*(p) == '.' && *((p) + 1) == '\0') +#endif /* ISDOT */ + +#ifndef ISDOTDOT +#define ISDOTDOT(p) (*(p) == '.' && *((p) + 1) == '.' && *((p) + 2) == '\0') +#endif /* ISDOTDOT */ #endif /* _SMB_MACROS_H */ diff --git a/source/include/smbldap.h b/source/include/smbldap.h index ae54e66b369..390b8f681a4 100644 --- a/source/include/smbldap.h +++ b/source/include/smbldap.h @@ -158,8 +158,12 @@ struct smbldap_state { time_t last_ping; /* retrive-once info */ const char *uri; + + /* credentials */ + BOOL anonymous; char *bind_dn; char *bind_secret; + BOOL paged_results; unsigned int num_failures; diff --git a/source/include/smbprofile.h b/source/include/smbprofile.h index b8a9a49be1a..fa7c6e4a5ae 100644 --- a/source/include/smbprofile.h +++ b/source/include/smbprofile.h @@ -4,7 +4,8 @@ Unix SMB/CIFS implementation. store smbd profiling information in shared memory Copyright (C) Andrew Tridgell 1999 - + Copyright (C) James Peach 2006 + 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 @@ -26,102 +27,719 @@ #define PROF_SHMEM_KEY ((key_t)0x07021999) #define PROF_SHM_MAGIC 0x6349985 -#define PROF_SHM_VERSION 10 +#define PROF_SHM_VERSION 11 /* time values in the following structure are in microseconds */ +#define __profile_stats_value(which, domain) domain[which] + +enum profile_stats_values +{ + PR_VALUE_SMBD_IDLE = 0, +#define smbd_idle_count __profile_stats_value(PR_VALUE_SMBD_IDLE, count) +#define smbd_idle_time __profile_stats_value(PR_VALUE_SMBD_IDLE, time) + +/* system call counters */ + PR_VALUE_SYSCALL_OPENDIR, +#define syscall_opendir_count __profile_stats_value(PR_VALUE_SYSCALL_OPENDIR, count) +#define syscall_opendir_time __profile_stats_value(PR_VALUE_SYSCALL_OPENDIR, time) + + PR_VALUE_SYSCALL_READDIR, +#define syscall_readdir_count __profile_stats_value(PR_VALUE_SYSCALL_READDIR, count) +#define syscall_readdir_time __profile_stats_value(PR_VALUE_SYSCALL_READDIR, time) + + PR_VALUE_SYSCALL_SEEKDIR, +#define syscall_seekdir_count __profile_stats_value(PR_VALUE_SYSCALL_SEEKDIR, count) +#define syscall_seekdir_time __profile_stats_value(PR_VALUE_SYSCALL_SEEKDIR, time) + + PR_VALUE_SYSCALL_TELLDIR, +#define syscall_telldir_count __profile_stats_value(PR_VALUE_SYSCALL_TELLDIR, count) +#define syscall_telldir_time __profile_stats_value(PR_VALUE_SYSCALL_TELLDIR, time) + + PR_VALUE_SYSCALL_REWINDDIR, +#define syscall_rewinddir_count __profile_stats_value(PR_VALUE_SYSCALL_REWINDDIR, count) +#define syscall_rewinddir_time __profile_stats_value(PR_VALUE_SYSCALL_REWINDDIR, time) + + PR_VALUE_SYSCALL_MKDIR, +#define syscall_mkdir_count __profile_stats_value(PR_VALUE_SYSCALL_MKDIR, count) +#define syscall_mkdir_time __profile_stats_value(PR_VALUE_SYSCALL_MKDIR, time) + + PR_VALUE_SYSCALL_RMDIR, +#define syscall_rmdir_count __profile_stats_value(PR_VALUE_SYSCALL_RMDIR, count) +#define syscall_rmdir_time __profile_stats_value(PR_VALUE_SYSCALL_RMDIR, time) + + PR_VALUE_SYSCALL_CLOSEDIR, +#define syscall_closedir_count __profile_stats_value(PR_VALUE_SYSCALL_CLOSEDIR, count) +#define syscall_closedir_time __profile_stats_value(PR_VALUE_SYSCALL_CLOSEDIR, time) + + PR_VALUE_SYSCALL_OPEN, +#define syscall_open_count __profile_stats_value(PR_VALUE_SYSCALL_OPEN, count) +#define syscall_open_time __profile_stats_value(PR_VALUE_SYSCALL_OPEN, time) + + PR_VALUE_SYSCALL_CLOSE, +#define syscall_close_count __profile_stats_value(PR_VALUE_SYSCALL_CLOSE, count) +#define syscall_close_time __profile_stats_value(PR_VALUE_SYSCALL_CLOSE, time) + + PR_VALUE_SYSCALL_READ, +#define syscall_read_count __profile_stats_value(PR_VALUE_SYSCALL_READ, count) +#define syscall_read_time __profile_stats_value(PR_VALUE_SYSCALL_READ, time) + + PR_VALUE_SYSCALL_PREAD, +#define syscall_pread_count __profile_stats_value(PR_VALUE_SYSCALL_PREAD, count) +#define syscall_pread_time __profile_stats_value(PR_VALUE_SYSCALL_PREAD, time) + + PR_VALUE_SYSCALL_WRITE, +#define syscall_write_count __profile_stats_value(PR_VALUE_SYSCALL_WRITE, count) +#define syscall_write_time __profile_stats_value(PR_VALUE_SYSCALL_WRITE, time) + + PR_VALUE_SYSCALL_PWRITE, +#define syscall_pwrite_count __profile_stats_value(PR_VALUE_SYSCALL_PWRITE, count) +#define syscall_pwrite_time __profile_stats_value(PR_VALUE_SYSCALL_PWRITE, time) + + PR_VALUE_SYSCALL_LSEEK, +#define syscall_lseek_count __profile_stats_value(PR_VALUE_SYSCALL_LSEEK, count) +#define syscall_lseek_time __profile_stats_value(PR_VALUE_SYSCALL_LSEEK, time) + + PR_VALUE_SYSCALL_SENDFILE, +#define syscall_sendfile_count __profile_stats_value(PR_VALUE_SYSCALL_SENDFILE, count) +#define syscall_sendfile_time __profile_stats_value(PR_VALUE_SYSCALL_SENDFILE, time) + + PR_VALUE_SYSCALL_RENAME, +#define syscall_rename_count __profile_stats_value(PR_VALUE_SYSCALL_RENAME, count) +#define syscall_rename_time __profile_stats_value(PR_VALUE_SYSCALL_RENAME, time) + + PR_VALUE_SYSCALL_FSYNC, +#define syscall_fsync_count __profile_stats_value(PR_VALUE_SYSCALL_FSYNC, count) +#define syscall_fsync_time __profile_stats_value(PR_VALUE_SYSCALL_FSYNC, time) + + PR_VALUE_SYSCALL_STAT, +#define syscall_stat_count __profile_stats_value(PR_VALUE_SYSCALL_STAT, count) +#define syscall_stat_time __profile_stats_value(PR_VALUE_SYSCALL_STAT, time) + + PR_VALUE_SYSCALL_FSTAT, +#define syscall_fstat_count __profile_stats_value(PR_VALUE_SYSCALL_FSTAT, count) +#define syscall_fstat_time __profile_stats_value(PR_VALUE_SYSCALL_FSTAT, time) + + PR_VALUE_SYSCALL_LSTAT, +#define syscall_lstat_count __profile_stats_value(PR_VALUE_SYSCALL_LSTAT, count) +#define syscall_lstat_time __profile_stats_value(PR_VALUE_SYSCALL_LSTAT, time) + + PR_VALUE_SYSCALL_UNLINK, +#define syscall_unlink_count __profile_stats_value(PR_VALUE_SYSCALL_UNLINK, count) +#define syscall_unlink_time __profile_stats_value(PR_VALUE_SYSCALL_UNLINK, time) + + PR_VALUE_SYSCALL_CHMOD, +#define syscall_chmod_count __profile_stats_value(PR_VALUE_SYSCALL_CHMOD, count) +#define syscall_chmod_time __profile_stats_value(PR_VALUE_SYSCALL_CHMOD, time) + + PR_VALUE_SYSCALL_FCHMOD, +#define syscall_fchmod_count __profile_stats_value(PR_VALUE_SYSCALL_FCHMOD, count) +#define syscall_fchmod_time __profile_stats_value(PR_VALUE_SYSCALL_FCHMOD, time) + + PR_VALUE_SYSCALL_CHOWN, +#define syscall_chown_count __profile_stats_value(PR_VALUE_SYSCALL_CHOWN, count) +#define syscall_chown_time __profile_stats_value(PR_VALUE_SYSCALL_CHOWN, time) + + PR_VALUE_SYSCALL_FCHOWN, +#define syscall_fchown_count __profile_stats_value(PR_VALUE_SYSCALL_FCHOWN, count) +#define syscall_fchown_time __profile_stats_value(PR_VALUE_SYSCALL_FCHOWN, time) + + PR_VALUE_SYSCALL_CHDIR, +#define syscall_chdir_count __profile_stats_value(PR_VALUE_SYSCALL_CHDIR, count) +#define syscall_chdir_time __profile_stats_value(PR_VALUE_SYSCALL_CHDIR, time) + + PR_VALUE_SYSCALL_GETWD, +#define syscall_getwd_count __profile_stats_value(PR_VALUE_SYSCALL_GETWD, count) +#define syscall_getwd_time __profile_stats_value(PR_VALUE_SYSCALL_GETWD, time) + + PR_VALUE_SYSCALL_UTIME, +#define syscall_utime_count __profile_stats_value(PR_VALUE_SYSCALL_UTIME, count) +#define syscall_utime_time __profile_stats_value(PR_VALUE_SYSCALL_UTIME, time) + + PR_VALUE_SYSCALL_FTRUNCATE, +#define syscall_ftruncate_count __profile_stats_value(PR_VALUE_SYSCALL_FTRUNCATE, count) +#define syscall_ftruncate_time __profile_stats_value(PR_VALUE_SYSCALL_FTRUNCATE, time) + + PR_VALUE_SYSCALL_FCNTL_LOCK, +#define syscall_fcntl_lock_count __profile_stats_value(PR_VALUE_SYSCALL_FCNTL_LOCK, count) +#define syscall_fcntl_lock_time __profile_stats_value(PR_VALUE_SYSCALL_FCNTL_LOCK, time) + + PR_VALUE_SYSCALL_KERNEL_FLOCK, +#define syscall_kernel_flock_count __profile_stats_value(PR_VALUE_SYSCALL_KERNEL_FLOCK, count) +#define syscall_kernel_flock_time __profile_stats_value(PR_VALUE_SYSCALL_KERNEL_FLOCK, time) + + PR_VALUE_SYSCALL_LINUX_SETLEASE, +#define syscall_linux_setlease_count __profile_stats_value(PR_VALUE_SYSCALL_LINUX_SETLEASE, count) +#define syscall_linux_setlease_time __profile_stats_value(PR_VALUE_SYSCALL_LINUX_SETLEASE, time) + + PR_VALUE_SYSCALL_FCNTL_GETLOCK, +#define syscall_fcntl_getlock_count __profile_stats_value(PR_VALUE_SYSCALL_FCNTL_GETLOCK, count) +#define syscall_fcntl_getlock_time __profile_stats_value(PR_VALUE_SYSCALL_FCNTL_GETLOCK, time) + + PR_VALUE_SYSCALL_READLINK, +#define syscall_readlink_count __profile_stats_value(PR_VALUE_SYSCALL_READLINK, count) +#define syscall_readlink_time __profile_stats_value(PR_VALUE_SYSCALL_READLINK, time) + + PR_VALUE_SYSCALL_SYMLINK, +#define syscall_symlink_count __profile_stats_value(PR_VALUE_SYSCALL_SYMLINK, count) +#define syscall_symlink_time __profile_stats_value(PR_VALUE_SYSCALL_SYMLINK, time) + + PR_VALUE_SYSCALL_LINK, +#define syscall_link_count __profile_stats_value(PR_VALUE_SYSCALL_LINK, count) +#define syscall_link_time __profile_stats_value(PR_VALUE_SYSCALL_LINK, time) + + PR_VALUE_SYSCALL_MKNOD, +#define syscall_mknod_count __profile_stats_value(PR_VALUE_SYSCALL_MKNOD, count) +#define syscall_mknod_time __profile_stats_value(PR_VALUE_SYSCALL_MKNOD, time) + + PR_VALUE_SYSCALL_REALPATH, +#define syscall_realpath_count __profile_stats_value(PR_VALUE_SYSCALL_REALPATH, count) +#define syscall_realpath_time __profile_stats_value(PR_VALUE_SYSCALL_REALPATH, time) + + PR_VALUE_SYSCALL_GET_QUOTA, +#define syscall_get_quota_count __profile_stats_value(PR_VALUE_SYSCALL_GET_QUOTA, count) +#define syscall_get_quota_time __profile_stats_value(PR_VALUE_SYSCALL_GET_QUOTA, time) + + PR_VALUE_SYSCALL_SET_QUOTA, +#define syscall_set_quota_count __profile_stats_value(PR_VALUE_SYSCALL_SET_QUOTA, count) +#define syscall_set_quota_time __profile_stats_value(PR_VALUE_SYSCALL_SET_QUOTA, time) + +/* counters for individual SMB types */ + PR_VALUE_SMBMKDIR, +#define SMBmkdir_count __profile_stats_value(PR_VALUE_SMBMKDIR, count) +#define SMBmkdir_time __profile_stats_value(PR_VALUE_SMBMKDIR, time) + + PR_VALUE_SMBRMDIR, +#define SMBrmdir_count __profile_stats_value(PR_VALUE_SMBRMDIR, count) +#define SMBrmdir_time __profile_stats_value(PR_VALUE_SMBRMDIR, time) + + PR_VALUE_SMBOPEN, +#define SMBopen_count __profile_stats_value(PR_VALUE_SMBOPEN, count) +#define SMBopen_time __profile_stats_value(PR_VALUE_SMBOPEN, time) + + PR_VALUE_SMBCREATE, +#define SMBcreate_count __profile_stats_value(PR_VALUE_SMBCREATE, count) +#define SMBcreate_time __profile_stats_value(PR_VALUE_SMBCREATE, time) + + PR_VALUE_SMBCLOSE, +#define SMBclose_count __profile_stats_value(PR_VALUE_SMBCLOSE, count) +#define SMBclose_time __profile_stats_value(PR_VALUE_SMBCLOSE, time) + + PR_VALUE_SMBFLUSH, +#define SMBflush_count __profile_stats_value(PR_VALUE_SMBFLUSH, count) +#define SMBflush_time __profile_stats_value(PR_VALUE_SMBFLUSH, time) + + PR_VALUE_SMBUNLINK, +#define SMBunlink_count __profile_stats_value(PR_VALUE_SMBUNLINK, count) +#define SMBunlink_time __profile_stats_value(PR_VALUE_SMBUNLINK, time) + + PR_VALUE_SMBMV, +#define SMBmv_count __profile_stats_value(PR_VALUE_SMBMV, count) +#define SMBmv_time __profile_stats_value(PR_VALUE_SMBMV, time) + + PR_VALUE_SMBGETATR, +#define SMBgetatr_count __profile_stats_value(PR_VALUE_SMBGETATR, count) +#define SMBgetatr_time __profile_stats_value(PR_VALUE_SMBGETATR, time) + + PR_VALUE_SMBSETATR, +#define SMBsetatr_count __profile_stats_value(PR_VALUE_SMBSETATR, count) +#define SMBsetatr_time __profile_stats_value(PR_VALUE_SMBSETATR, time) + + PR_VALUE_SMBREAD, +#define SMBread_count __profile_stats_value(PR_VALUE_SMBREAD, count) +#define SMBread_time __profile_stats_value(PR_VALUE_SMBREAD, time) + + PR_VALUE_SMBWRITE, +#define SMBwrite_count __profile_stats_value(PR_VALUE_SMBWRITE, count) +#define SMBwrite_time __profile_stats_value(PR_VALUE_SMBWRITE, time) + + PR_VALUE_SMBLOCK, +#define SMBlock_count __profile_stats_value(PR_VALUE_SMBLOCK, count) +#define SMBlock_time __profile_stats_value(PR_VALUE_SMBLOCK, time) + + PR_VALUE_SMBUNLOCK, +#define SMBunlock_count __profile_stats_value(PR_VALUE_SMBUNLOCK, count) +#define SMBunlock_time __profile_stats_value(PR_VALUE_SMBUNLOCK, time) + + PR_VALUE_SMBCTEMP, +#define SMBctemp_count __profile_stats_value(PR_VALUE_SMBCTEMP, count) +#define SMBctemp_time __profile_stats_value(PR_VALUE_SMBCTEMP, time) + + /* SMBmknew stats are currently combined with SMBcreate */ + PR_VALUE_SMBMKNEW, +#define SMBmknew_count __profile_stats_value(PR_VALUE_SMBMKNEW, count) +#define SMBmknew_time __profile_stats_value(PR_VALUE_SMBMKNEW, time) + + PR_VALUE_SMBCHECKPATH, +#define SMBcheckpath_count __profile_stats_value(PR_VALUE_SMBCHECKPATH, count) +#define SMBcheckpath_time __profile_stats_value(PR_VALUE_SMBCHECKPATH, time) + + PR_VALUE_SMBEXIT, +#define SMBexit_count __profile_stats_value(PR_VALUE_SMBEXIT, count) +#define SMBexit_time __profile_stats_value(PR_VALUE_SMBEXIT, time) + + PR_VALUE_SMBLSEEK, +#define SMBlseek_count __profile_stats_value(PR_VALUE_SMBLSEEK, count) +#define SMBlseek_time __profile_stats_value(PR_VALUE_SMBLSEEK, time) + + PR_VALUE_SMBLOCKREAD, +#define SMBlockread_count __profile_stats_value(PR_VALUE_SMBLOCKREAD, count) +#define SMBlockread_time __profile_stats_value(PR_VALUE_SMBLOCKREAD, time) + + PR_VALUE_SMBWRITEUNLOCK, +#define SMBwriteunlock_count __profile_stats_value(PR_VALUE_SMBWRITEUNLOCK, count) +#define SMBwriteunlock_time __profile_stats_value(PR_VALUE_SMBWRITEUNLOCK, time) + + PR_VALUE_SMBREADBRAW, +#define SMBreadbraw_count __profile_stats_value(PR_VALUE_SMBREADBRAW, count) +#define SMBreadbraw_time __profile_stats_value(PR_VALUE_SMBREADBRAW, time) + + PR_VALUE_SMBREADBMPX, +#define SMBreadBmpx_count __profile_stats_value(PR_VALUE_SMBREADBMPX, count) +#define SMBreadBmpx_time __profile_stats_value(PR_VALUE_SMBREADBMPX, time) + + PR_VALUE_SMBREADBS, +#define SMBreadBs_count __profile_stats_value(PR_VALUE_SMBREADBS, count) +#define SMBreadBs_time __profile_stats_value(PR_VALUE_SMBREADBS, time) + + PR_VALUE_SMBWRITEBRAW, +#define SMBwritebraw_count __profile_stats_value(PR_VALUE_SMBWRITEBRAW, count) +#define SMBwritebraw_time __profile_stats_value(PR_VALUE_SMBWRITEBRAW, time) + + PR_VALUE_SMBWRITEBMPX, +#define SMBwriteBmpx_count __profile_stats_value(PR_VALUE_SMBWRITEBMPX, count) +#define SMBwriteBmpx_time __profile_stats_value(PR_VALUE_SMBWRITEBMPX, time) + + PR_VALUE_SMBWRITEBS, +#define SMBwriteBs_count __profile_stats_value(PR_VALUE_SMBWRITEBS, count) +#define SMBwriteBs_time __profile_stats_value(PR_VALUE_SMBWRITEBS, time) + + PR_VALUE_SMBWRITEC, +#define SMBwritec_count __profile_stats_value(PR_VALUE_SMBWRITEC, count) +#define SMBwritec_time __profile_stats_value(PR_VALUE_SMBWRITEC, time) + + PR_VALUE_SMBSETATTRE, +#define SMBsetattrE_count __profile_stats_value(PR_VALUE_SMBSETATTRE, count) +#define SMBsetattrE_time __profile_stats_value(PR_VALUE_SMBSETATTRE, time) + + PR_VALUE_SMBGETATTRE, +#define SMBgetattrE_count __profile_stats_value(PR_VALUE_SMBGETATTRE, count) +#define SMBgetattrE_time __profile_stats_value(PR_VALUE_SMBGETATTRE, time) + + PR_VALUE_SMBLOCKINGX, +#define SMBlockingX_count __profile_stats_value(PR_VALUE_SMBLOCKINGX, count) +#define SMBlockingX_time __profile_stats_value(PR_VALUE_SMBLOCKINGX, time) + + PR_VALUE_SMBTRANS, +#define SMBtrans_count __profile_stats_value(PR_VALUE_SMBTRANS, count) +#define SMBtrans_time __profile_stats_value(PR_VALUE_SMBTRANS, time) + + PR_VALUE_SMBTRANSS, +#define SMBtranss_count __profile_stats_value(PR_VALUE_SMBTRANSS, count) +#define SMBtranss_time __profile_stats_value(PR_VALUE_SMBTRANSS, time) + + PR_VALUE_SMBIOCTL, +#define SMBioctl_count __profile_stats_value(PR_VALUE_SMBIOCTL, count) +#define SMBioctl_time __profile_stats_value(PR_VALUE_SMBIOCTL, time) + + PR_VALUE_SMBIOCTLS, +#define SMBioctls_count __profile_stats_value(PR_VALUE_SMBIOCTLS, count) +#define SMBioctls_time __profile_stats_value(PR_VALUE_SMBIOCTLS, time) + + PR_VALUE_SMBCOPY, +#define SMBcopy_count __profile_stats_value(PR_VALUE_SMBCOPY, count) +#define SMBcopy_time __profile_stats_value(PR_VALUE_SMBCOPY, time) + + PR_VALUE_SMBMOVE, +#define SMBmove_count __profile_stats_value(PR_VALUE_SMBMOVE, count) +#define SMBmove_time __profile_stats_value(PR_VALUE_SMBMOVE, time) + + PR_VALUE_SMBECHO, +#define SMBecho_count __profile_stats_value(PR_VALUE_SMBECHO, count) +#define SMBecho_time __profile_stats_value(PR_VALUE_SMBECHO, time) + + PR_VALUE_SMBWRITECLOSE, +#define SMBwriteclose_count __profile_stats_value(PR_VALUE_SMBWRITECLOSE, count) +#define SMBwriteclose_time __profile_stats_value(PR_VALUE_SMBWRITECLOSE, time) + + PR_VALUE_SMBOPENX, +#define SMBopenX_count __profile_stats_value(PR_VALUE_SMBOPENX, count) +#define SMBopenX_time __profile_stats_value(PR_VALUE_SMBOPENX, time) + + PR_VALUE_SMBREADX, +#define SMBreadX_count __profile_stats_value(PR_VALUE_SMBREADX, count) +#define SMBreadX_time __profile_stats_value(PR_VALUE_SMBREADX, time) + + PR_VALUE_SMBWRITEX, +#define SMBwriteX_count __profile_stats_value(PR_VALUE_SMBWRITEX, count) +#define SMBwriteX_time __profile_stats_value(PR_VALUE_SMBWRITEX, time) + + PR_VALUE_SMBTRANS2, +#define SMBtrans2_count __profile_stats_value(PR_VALUE_SMBTRANS2, count) +#define SMBtrans2_time __profile_stats_value(PR_VALUE_SMBTRANS2, time) + + PR_VALUE_SMBTRANSS2, +#define SMBtranss2_count __profile_stats_value(PR_VALUE_SMBTRANSS2, count) +#define SMBtranss2_time __profile_stats_value(PR_VALUE_SMBTRANSS2, time) + + PR_VALUE_SMBFINDCLOSE, +#define SMBfindclose_count __profile_stats_value(PR_VALUE_SMBFINDCLOSE, count) +#define SMBfindclose_time __profile_stats_value(PR_VALUE_SMBFINDCLOSE, time) + + PR_VALUE_SMBFINDNCLOSE, +#define SMBfindnclose_count __profile_stats_value(PR_VALUE_SMBFINDNCLOSE, count) +#define SMBfindnclose_time __profile_stats_value(PR_VALUE_SMBFINDNCLOSE, time) + + PR_VALUE_SMBTCON, +#define SMBtcon_count __profile_stats_value(PR_VALUE_SMBTCON, count) +#define SMBtcon_time __profile_stats_value(PR_VALUE_SMBTCON, time) + + PR_VALUE_SMBTDIS, +#define SMBtdis_count __profile_stats_value(PR_VALUE_SMBTDIS, count) +#define SMBtdis_time __profile_stats_value(PR_VALUE_SMBTDIS, time) + + PR_VALUE_SMBNEGPROT, +#define SMBnegprot_count __profile_stats_value(PR_VALUE_SMBNEGPROT, count) +#define SMBnegprot_time __profile_stats_value(PR_VALUE_SMBNEGPROT, time) + + PR_VALUE_SMBSESSSETUPX, +#define SMBsesssetupX_count __profile_stats_value(PR_VALUE_SMBSESSSETUPX, count) +#define SMBsesssetupX_time __profile_stats_value(PR_VALUE_SMBSESSSETUPX, time) + + PR_VALUE_SMBULOGOFFX, +#define SMBulogoffX_count __profile_stats_value(PR_VALUE_SMBULOGOFFX, count) +#define SMBulogoffX_time __profile_stats_value(PR_VALUE_SMBULOGOFFX, time) + + PR_VALUE_SMBTCONX, +#define SMBtconX_count __profile_stats_value(PR_VALUE_SMBTCONX, count) +#define SMBtconX_time __profile_stats_value(PR_VALUE_SMBTCONX, time) + + PR_VALUE_SMBDSKATTR, +#define SMBdskattr_count __profile_stats_value(PR_VALUE_SMBDSKATTR, count) +#define SMBdskattr_time __profile_stats_value(PR_VALUE_SMBDSKATTR, time) + + PR_VALUE_SMBSEARCH, +#define SMBsearch_count __profile_stats_value(PR_VALUE_SMBSEARCH, count) +#define SMBsearch_time __profile_stats_value(PR_VALUE_SMBSEARCH, time) + + /* SBMffirst stats combined with SMBsearch */ + PR_VALUE_SMBFFIRST, +#define SMBffirst_count __profile_stats_value(PR_VALUE_SMBFFIRST, count) +#define SMBffirst_time __profile_stats_value(PR_VALUE_SMBFFIRST, time) + + /* SBMfunique stats combined with SMBsearch */ + PR_VALUE_SMBFUNIQUE, +#define SMBfunique_count __profile_stats_value(PR_VALUE_SMBFUNIQUE, count) +#define SMBfunique_time __profile_stats_value(PR_VALUE_SMBFUNIQUE, time) + + PR_VALUE_SMBFCLOSE, +#define SMBfclose_count __profile_stats_value(PR_VALUE_SMBFCLOSE, count) +#define SMBfclose_time __profile_stats_value(PR_VALUE_SMBFCLOSE, time) + + PR_VALUE_SMBNTTRANS, +#define SMBnttrans_count __profile_stats_value(PR_VALUE_SMBNTTRANS, count) +#define SMBnttrans_time __profile_stats_value(PR_VALUE_SMBNTTRANS, time) + + PR_VALUE_SMBNTTRANSS, +#define SMBnttranss_count __profile_stats_value(PR_VALUE_SMBNTTRANSS, count) +#define SMBnttranss_time __profile_stats_value(PR_VALUE_SMBNTTRANSS, time) + + PR_VALUE_SMBNTCREATEX, +#define SMBntcreateX_count __profile_stats_value(PR_VALUE_SMBNTCREATEX, count) +#define SMBntcreateX_time __profile_stats_value(PR_VALUE_SMBNTCREATEX, time) + + PR_VALUE_SMBNTCANCEL, +#define SMBntcancel_count __profile_stats_value(PR_VALUE_SMBNTCANCEL, count) +#define SMBntcancel_time __profile_stats_value(PR_VALUE_SMBNTCANCEL, time) + + PR_VALUE_SMBNTRENAME, +#define SMBntrename_count __profile_stats_value(PR_VALUE_SMBNTRENAME, count) +#define SMBntrename_time __profile_stats_value(PR_VALUE_SMBNTRENAME, time) + + PR_VALUE_SMBSPLOPEN, +#define SMBsplopen_count __profile_stats_value(PR_VALUE_SMBSPLOPEN, count) +#define SMBsplopen_time __profile_stats_value(PR_VALUE_SMBSPLOPEN, time) + + PR_VALUE_SMBSPLWR, +#define SMBsplwr_count __profile_stats_value(PR_VALUE_SMBSPLWR, count) +#define SMBsplwr_time __profile_stats_value(PR_VALUE_SMBSPLWR, time) + + PR_VALUE_SMBSPLCLOSE, +#define SMBsplclose_count __profile_stats_value(PR_VALUE_SMBSPLCLOSE, count) +#define SMBsplclose_time __profile_stats_value(PR_VALUE_SMBSPLCLOSE, time) + + PR_VALUE_SMBSPLRETQ, +#define SMBsplretq_count __profile_stats_value(PR_VALUE_SMBSPLRETQ, count) +#define SMBsplretq_time __profile_stats_value(PR_VALUE_SMBSPLRETQ, time) + + PR_VALUE_SMBSENDS, +#define SMBsends_count __profile_stats_value(PR_VALUE_SMBSENDS, count) +#define SMBsends_time __profile_stats_value(PR_VALUE_SMBSENDS, time) + + PR_VALUE_SMBSENDB, +#define SMBsendb_count __profile_stats_value(PR_VALUE_SMBSENDB, count) +#define SMBsendb_time __profile_stats_value(PR_VALUE_SMBSENDB, time) + + PR_VALUE_SMBFWDNAME, +#define SMBfwdname_count __profile_stats_value(PR_VALUE_SMBFWDNAME, count) +#define SMBfwdname_time __profile_stats_value(PR_VALUE_SMBFWDNAME, time) + + PR_VALUE_SMBCANCELF, +#define SMBcancelf_count __profile_stats_value(PR_VALUE_SMBCANCELF, count) +#define SMBcancelf_time __profile_stats_value(PR_VALUE_SMBCANCELF, time) + + PR_VALUE_SMBGETMAC, +#define SMBgetmac_count __profile_stats_value(PR_VALUE_SMBGETMAC, count) +#define SMBgetmac_time __profile_stats_value(PR_VALUE_SMBGETMAC, time) + + PR_VALUE_SMBSENDSTRT, +#define SMBsendstrt_count __profile_stats_value(PR_VALUE_SMBSENDSTRT, count) +#define SMBsendstrt_time __profile_stats_value(PR_VALUE_SMBSENDSTRT, time) + + PR_VALUE_SMBSENDEND, +#define SMBsendend_count __profile_stats_value(PR_VALUE_SMBSENDEND, count) +#define SMBsendend_time __profile_stats_value(PR_VALUE_SMBSENDEND, time) + + PR_VALUE_SMBSENDTXT, +#define SMBsendtxt_count __profile_stats_value(PR_VALUE_SMBSENDTXT, count) +#define SMBsendtxt_time __profile_stats_value(PR_VALUE_SMBSENDTXT, time) + + PR_VALUE_SMBINVALID, +#define SMBinvalid_count __profile_stats_value(PR_VALUE_SMBINVALID, count) +#define SMBinvalid_time __profile_stats_value(PR_VALUE_SMBINVALID, time) + +/* Pathworks setdir command */ + PR_VALUE_PATHWORKS_SETDIR, +#define pathworks_setdir_count __profile_stats_value(PR_VALUE_PATHWORKS_SETDIR, count) +#define pathworks_setdir_time __profile_stats_value(PR_VALUE_PATHWORKS_SETDIR, time) + +/* These are the TRANS2 sub commands */ + PR_VALUE_TRANS2_OPEN, +#define Trans2_open_count __profile_stats_value(PR_VALUE_TRANS2_OPEN, count) +#define Trans2_open_time __profile_stats_value(PR_VALUE_TRANS2_OPEN, time) + + PR_VALUE_TRANS2_FINDFIRST, +#define Trans2_findfirst_count __profile_stats_value(PR_VALUE_TRANS2_FINDFIRST, count) +#define Trans2_findfirst_time __profile_stats_value(PR_VALUE_TRANS2_FINDFIRST, time) + + PR_VALUE_TRANS2_FINDNEXT, +#define Trans2_findnext_count __profile_stats_value(PR_VALUE_TRANS2_FINDNEXT, count) +#define Trans2_findnext_time __profile_stats_value(PR_VALUE_TRANS2_FINDNEXT, time) + + PR_VALUE_TRANS2_QFSINFO, +#define Trans2_qfsinfo_count __profile_stats_value(PR_VALUE_TRANS2_QFSINFO, count) +#define Trans2_qfsinfo_time __profile_stats_value(PR_VALUE_TRANS2_QFSINFO, time) + + PR_VALUE_TRANS2_SETFSINFO, +#define Trans2_setfsinfo_count __profile_stats_value(PR_VALUE_TRANS2_SETFSINFO, count) +#define Trans2_setfsinfo_time __profile_stats_value(PR_VALUE_TRANS2_SETFSINFO, time) + + PR_VALUE_TRANS2_QPATHINFO, +#define Trans2_qpathinfo_count __profile_stats_value(PR_VALUE_TRANS2_QPATHINFO, count) +#define Trans2_qpathinfo_time __profile_stats_value(PR_VALUE_TRANS2_QPATHINFO, time) + + PR_VALUE_TRANS2_SETPATHINFO, +#define Trans2_setpathinfo_count __profile_stats_value(PR_VALUE_TRANS2_SETPATHINFO, count) +#define Trans2_setpathinfo_time __profile_stats_value(PR_VALUE_TRANS2_SETPATHINFO, time) + + PR_VALUE_TRANS2_QFILEINFO, +#define Trans2_qfileinfo_count __profile_stats_value(PR_VALUE_TRANS2_QFILEINFO, count) +#define Trans2_qfileinfo_time __profile_stats_value(PR_VALUE_TRANS2_QFILEINFO, time) + + PR_VALUE_TRANS2_SETFILEINFO, +#define Trans2_setfileinfo_count __profile_stats_value(PR_VALUE_TRANS2_SETFILEINFO, count) +#define Trans2_setfileinfo_time __profile_stats_value(PR_VALUE_TRANS2_SETFILEINFO, time) + + PR_VALUE_TRANS2_FSCTL, +#define Trans2_fsctl_count __profile_stats_value(PR_VALUE_TRANS2_FSCTL, count) +#define Trans2_fsctl_time __profile_stats_value(PR_VALUE_TRANS2_FSCTL, time) + + PR_VALUE_TRANS2_IOCTL, +#define Trans2_ioctl_count __profile_stats_value(PR_VALUE_TRANS2_IOCTL, count) +#define Trans2_ioctl_time __profile_stats_value(PR_VALUE_TRANS2_IOCTL, time) + + PR_VALUE_TRANS2_FINDNOTIFYFIRST, +#define Trans2_findnotifyfirst_count __profile_stats_value(PR_VALUE_TRANS2_FINDNOTIFYFIRST, count) +#define Trans2_findnotifyfirst_time __profile_stats_value(PR_VALUE_TRANS2_FINDNOTIFYFIRST, time) + + PR_VALUE_TRANS2_FINDNOTIFYNEXT, +#define Trans2_findnotifynext_count __profile_stats_value(PR_VALUE_TRANS2_FINDNOTIFYNEXT, count) +#define Trans2_findnotifynext_time __profile_stats_value(PR_VALUE_TRANS2_FINDNOTIFYNEXT, time) + + PR_VALUE_TRANS2_MKDIR, +#define Trans2_mkdir_count __profile_stats_value(PR_VALUE_TRANS2_MKDIR, count) +#define Trans2_mkdir_time __profile_stats_value(PR_VALUE_TRANS2_MKDIR, time) + + PR_VALUE_TRANS2_SESSION_SETUP, +#define Trans2_session_setup_count __profile_stats_value(PR_VALUE_TRANS2_SESSION_SETUP, count) +#define Trans2_session_setup_time __profile_stats_value(PR_VALUE_TRANS2_SESSION_SETUP, time) + + PR_VALUE_TRANS2_GET_DFS_REFERRAL, +#define Trans2_get_dfs_referral_count __profile_stats_value(PR_VALUE_TRANS2_GET_DFS_REFERRAL, count) +#define Trans2_get_dfs_referral_time __profile_stats_value(PR_VALUE_TRANS2_GET_DFS_REFERRAL, time) + + PR_VALUE_TRANS2_REPORT_DFS_INCONSISTANCY, +#define Trans2_report_dfs_inconsistancy_count __profile_stats_value(PR_VALUE_TRANS2_REPORT_DFS_INCONSISTANCY, count) +#define Trans2_report_dfs_inconsistancy_time __profile_stats_value(PR_VALUE_TRANS2_REPORT_DFS_INCONSISTANCY, time) + +/* These are the NT transact sub commands. */ + PR_VALUE_NT_TRANSACT_CREATE, +#define NT_transact_create_count __profile_stats_value(PR_VALUE_NT_TRANSACT_CREATE, count) +#define NT_transact_create_time __profile_stats_value(PR_VALUE_NT_TRANSACT_CREATE, time) + + PR_VALUE_NT_TRANSACT_IOCTL, +#define NT_transact_ioctl_count __profile_stats_value(PR_VALUE_NT_TRANSACT_IOCTL, count) +#define NT_transact_ioctl_time __profile_stats_value(PR_VALUE_NT_TRANSACT_IOCTL, time) + + PR_VALUE_NT_TRANSACT_SET_SECURITY_DESC, +#define NT_transact_set_security_desc_count __profile_stats_value(PR_VALUE_NT_TRANSACT_SET_SECURITY_DESC, count) +#define NT_transact_set_security_desc_time __profile_stats_value(PR_VALUE_NT_TRANSACT_SET_SECURITY_DESC, time) + + PR_VALUE_NT_TRANSACT_NOTIFY_CHANGE, +#define NT_transact_notify_change_count __profile_stats_value(PR_VALUE_NT_TRANSACT_NOTIFY_CHANGE, count) +#define NT_transact_notify_change_time __profile_stats_value(PR_VALUE_NT_TRANSACT_NOTIFY_CHANGE, time) + + PR_VALUE_NT_TRANSACT_RENAME, +#define NT_transact_rename_count __profile_stats_value(PR_VALUE_NT_TRANSACT_RENAME, count) +#define NT_transact_rename_time __profile_stats_value(PR_VALUE_NT_TRANSACT_RENAME, time) + + PR_VALUE_NT_TRANSACT_QUERY_SECURITY_DESC, +#define NT_transact_query_security_desc_count __profile_stats_value(PR_VALUE_NT_TRANSACT_QUERY_SECURITY_DESC, count) +#define NT_transact_query_security_desc_time __profile_stats_value(PR_VALUE_NT_TRANSACT_QUERY_SECURITY_DESC, time) + + PR_VALUE_NT_TRANSACT_GET_USER_QUOTA, +#define NT_transact_get_user_quota_count __profile_stats_value(PR_VALUE_NT_TRANSACT_GET_USER_QUOTA, count) +#define NT_transact_get_user_quota_time __profile_stats_value(PR_VALUE_NT_TRANSACT_GET_USER_QUOTA, time) + + PR_VALUE_NT_TRANSACT_SET_USER_QUOTA, +#define NT_transact_set_user_quota_count __profile_stats_value(PR_VALUE_NT_TRANSACT_SET_USER_QUOTA, count) +#define NT_transact_set_user_quota_time __profile_stats_value(PR_VALUE_NT_TRANSACT_SET_USER_QUOTA, time) + +/* These are ACL manipulation calls */ + PR_VALUE_GET_NT_ACL, +#define get_nt_acl_count __profile_stats_value(PR_VALUE_GET_NT_ACL, count) +#define get_nt_acl_time __profile_stats_value(PR_VALUE_GET_NT_ACL, time) + + PR_VALUE_FGET_NT_ACL, +#define fget_nt_acl_count __profile_stats_value(PR_VALUE_FGET_NT_ACL, count) +#define fget_nt_acl_time __profile_stats_value(PR_VALUE_FGET_NT_ACL, time) + + PR_VALUE_SET_NT_ACL, +#define set_nt_acl_count __profile_stats_value(PR_VALUE_SET_NT_ACL, count) +#define set_nt_acl_time __profile_stats_value(PR_VALUE_SET_NT_ACL, time) + + PR_VALUE_FSET_NT_ACL, +#define fset_nt_acl_count __profile_stats_value(PR_VALUE_FSET_NT_ACL, count) +#define fset_nt_acl_time __profile_stats_value(PR_VALUE_FSET_NT_ACL, time) + + PR_VALUE_CHMOD_ACL, +#define chmod_acl_count __profile_stats_value(PR_VALUE_CHMOD_ACL, count) +#define chmod_acl_time __profile_stats_value(PR_VALUE_CHMOD_ACL, time) + + PR_VALUE_FCHMOD_ACL, +#define fchmod_acl_count __profile_stats_value(PR_VALUE_FCHMOD_ACL, count) +#define fchmod_acl_time __profile_stats_value(PR_VALUE_FCHMOD_ACL, time) + +/* These are nmbd stats */ + PR_VALUE_NAME_RELEASE, +#define name_release_count __profile_stats_value(PR_VALUE_NAME_RELEASE, count) +#define name_release_time __profile_stats_value(PR_VALUE_NAME_RELEASE, time) + + PR_VALUE_NAME_REFRESH, +#define name_refresh_count __profile_stats_value(PR_VALUE_NAME_REFRESH, count) +#define name_refresh_time __profile_stats_value(PR_VALUE_NAME_REFRESH, time) + + PR_VALUE_NAME_REGISTRATION, +#define name_registration_count __profile_stats_value(PR_VALUE_NAME_REGISTRATION, count) +#define name_registration_time __profile_stats_value(PR_VALUE_NAME_REGISTRATION, time) + + PR_VALUE_NODE_STATUS, +#define node_status_count __profile_stats_value(PR_VALUE_NODE_STATUS, count) +#define node_status_time __profile_stats_value(PR_VALUE_NODE_STATUS, time) + + PR_VALUE_NAME_QUERY, +#define name_query_count __profile_stats_value(PR_VALUE_NAME_QUERY, count) +#define name_query_time __profile_stats_value(PR_VALUE_NAME_QUERY, time) + + PR_VALUE_HOST_ANNOUNCE, +#define host_announce_count __profile_stats_value(PR_VALUE_HOST_ANNOUNCE, count) +#define host_announce_time __profile_stats_value(PR_VALUE_HOST_ANNOUNCE, time) + + PR_VALUE_WORKGROUP_ANNOUNCE, +#define workgroup_announce_count __profile_stats_value(PR_VALUE_WORKGROUP_ANNOUNCE, count) +#define workgroup_announce_time __profile_stats_value(PR_VALUE_WORKGROUP_ANNOUNCE, time) + + PR_VALUE_LOCAL_MASTER_ANNOUNCE, +#define local_master_announce_count __profile_stats_value(PR_VALUE_LOCAL_MASTER_ANNOUNCE, count) +#define local_master_announce_time __profile_stats_value(PR_VALUE_LOCAL_MASTER_ANNOUNCE, time) + + PR_VALUE_MASTER_BROWSER_ANNOUNCE, +#define master_browser_announce_count __profile_stats_value(PR_VALUE_MASTER_BROWSER_ANNOUNCE, count) +#define master_browser_announce_time __profile_stats_value(PR_VALUE_MASTER_BROWSER_ANNOUNCE, time) + + PR_VALUE_LM_HOST_ANNOUNCE, +#define lm_host_announce_count __profile_stats_value(PR_VALUE_LM_HOST_ANNOUNCE, count) +#define lm_host_announce_time __profile_stats_value(PR_VALUE_LM_HOST_ANNOUNCE, time) + + PR_VALUE_GET_BACKUP_LIST, +#define get_backup_list_count __profile_stats_value(PR_VALUE_GET_BACKUP_LIST, count) +#define get_backup_list_time __profile_stats_value(PR_VALUE_GET_BACKUP_LIST, time) + + PR_VALUE_RESET_BROWSER, +#define reset_browser_count __profile_stats_value(PR_VALUE_RESET_BROWSER, count) +#define reset_browser_time __profile_stats_value(PR_VALUE_RESET_BROWSER, time) + + PR_VALUE_ANNOUNCE_REQUEST, +#define announce_request_count __profile_stats_value(PR_VALUE_ANNOUNCE_REQUEST, count) +#define announce_request_time __profile_stats_value(PR_VALUE_ANNOUNCE_REQUEST, time) + + PR_VALUE_LM_ANNOUNCE_REQUEST, +#define lm_announce_request_count __profile_stats_value(PR_VALUE_LM_ANNOUNCE_REQUEST, count) +#define lm_announce_request_time __profile_stats_value(PR_VALUE_LM_ANNOUNCE_REQUEST, time) + + PR_VALUE_DOMAIN_LOGON, +#define domain_logon_count __profile_stats_value(PR_VALUE_DOMAIN_LOGON, count) +#define domain_logon_time __profile_stats_value(PR_VALUE_DOMAIN_LOGON, time) + + PR_VALUE_SYNC_BROWSE_LISTS, +#define sync_browse_lists_count __profile_stats_value(PR_VALUE_SYNC_BROWSE_LISTS, count) +#define sync_browse_lists_time __profile_stats_value(PR_VALUE_SYNC_BROWSE_LISTS, time) + + PR_VALUE_RUN_ELECTIONS, +#define run_elections_count __profile_stats_value(PR_VALUE_RUN_ELECTIONS, count) +#define run_elections_time __profile_stats_value(PR_VALUE_RUN_ELECTIONS, time) + + PR_VALUE_ELECTION, +#define election_count __profile_stats_value(PR_VALUE_ELECTION, count) +#define election_time __profile_stats_value(PR_VALUE_ELECTION, time) + + /* This mist remain the last value. */ + PR_VALUE_MAX +}; /* enum profile_stats_values */ + +const char * profile_value_name(enum profile_stats_values val); + struct profile_stats { /* general counters */ unsigned smb_count; /* how many SMB packets we have processed */ unsigned uid_changes; /* how many times we change our effective uid */ -/* system call counters */ - unsigned syscall_opendir_count; - unsigned syscall_opendir_time; - unsigned syscall_readdir_count; - unsigned syscall_readdir_time; - unsigned syscall_seekdir_count; - unsigned syscall_seekdir_time; - unsigned syscall_telldir_count; - unsigned syscall_telldir_time; - unsigned syscall_rewinddir_count; - unsigned syscall_rewinddir_time; - unsigned syscall_mkdir_count; - unsigned syscall_mkdir_time; - unsigned syscall_rmdir_count; - unsigned syscall_rmdir_time; - unsigned syscall_closedir_count; - unsigned syscall_closedir_time; - unsigned syscall_open_count; - unsigned syscall_open_time; - unsigned syscall_close_count; - unsigned syscall_close_time; - unsigned syscall_read_count; - unsigned syscall_read_time; - unsigned syscall_read_bytes; /* bytes read with read syscall */ - unsigned syscall_pread_count; - unsigned syscall_pread_time; - unsigned syscall_pread_bytes; /* bytes read with pread syscall */ - unsigned syscall_write_count; - unsigned syscall_write_time; - unsigned syscall_write_bytes; /* bytes written with write syscall */ - unsigned syscall_pwrite_count; - unsigned syscall_pwrite_time; - unsigned syscall_pwrite_bytes; /* bytes written with pwrite syscall */ - unsigned syscall_lseek_count; - unsigned syscall_lseek_time; - unsigned syscall_sendfile_count; - unsigned syscall_sendfile_time; - unsigned syscall_sendfile_bytes; /* bytes read with sendfile syscall */ - unsigned syscall_rename_count; - unsigned syscall_rename_time; - unsigned syscall_fsync_count; - unsigned syscall_fsync_time; - unsigned syscall_stat_count; - unsigned syscall_stat_time; - unsigned syscall_fstat_count; - unsigned syscall_fstat_time; - unsigned syscall_lstat_count; - unsigned syscall_lstat_time; - unsigned syscall_unlink_count; - unsigned syscall_unlink_time; - unsigned syscall_chmod_count; - unsigned syscall_chmod_time; - unsigned syscall_fchmod_count; - unsigned syscall_fchmod_time; - unsigned syscall_chown_count; - unsigned syscall_chown_time; - unsigned syscall_fchown_count; - unsigned syscall_fchown_time; - unsigned syscall_chdir_count; - unsigned syscall_chdir_time; - unsigned syscall_getwd_count; - unsigned syscall_getwd_time; - unsigned syscall_utime_count; - unsigned syscall_utime_time; - unsigned syscall_ftruncate_count; - unsigned syscall_ftruncate_time; - unsigned syscall_fcntl_lock_count; - unsigned syscall_fcntl_lock_time; - unsigned syscall_fcntl_getlock_count; - unsigned syscall_fcntl_getlock_time; - unsigned syscall_readlink_count; - unsigned syscall_readlink_time; - unsigned syscall_symlink_count; - unsigned syscall_symlink_time; - unsigned syscall_link_count; - unsigned syscall_link_time; - unsigned syscall_mknod_count; - unsigned syscall_mknod_time; - unsigned syscall_realpath_count; - unsigned syscall_realpath_time; - unsigned syscall_get_quota_count; - unsigned syscall_get_quota_time; - unsigned syscall_set_quota_count; - unsigned syscall_set_quota_time; + +/* system call and protocol operation counters and cumulative times */ + unsigned count[PR_VALUE_MAX]; + unsigned time[PR_VALUE_MAX]; + +/* cumulative byte counts */ + unsigned syscall_pread_bytes; + unsigned syscall_pwrite_bytes; + unsigned syscall_read_bytes; + unsigned syscall_write_bytes; + unsigned syscall_sendfile_bytes; + /* stat cache counters */ unsigned statcache_lookups; unsigned statcache_misses; unsigned statcache_hits; + /* write cache counters */ unsigned writecache_read_hits; unsigned writecache_abutted_writes; @@ -133,265 +751,6 @@ struct profile_stats { unsigned writecache_num_perfect_writes; unsigned writecache_num_write_caches; unsigned writecache_allocated_write_caches; -/* counters for individual SMB types */ - unsigned SMBmkdir_count; /* create directory */ - unsigned SMBmkdir_time; - unsigned SMBrmdir_count; /* delete directory */ - unsigned SMBrmdir_time; - unsigned SMBopen_count; /* open file */ - unsigned SMBopen_time; - unsigned SMBcreate_count; /* create file */ - unsigned SMBcreate_time; - unsigned SMBclose_count; /* close file */ - unsigned SMBclose_time; - unsigned SMBflush_count; /* flush file */ - unsigned SMBflush_time; - unsigned SMBunlink_count; /* delete file */ - unsigned SMBunlink_time; - unsigned SMBmv_count; /* rename file */ - unsigned SMBmv_time; - unsigned SMBgetatr_count; /* get file attributes */ - unsigned SMBgetatr_time; - unsigned SMBsetatr_count; /* set file attributes */ - unsigned SMBsetatr_time; - unsigned SMBread_count; /* read from file */ - unsigned SMBread_time; - unsigned SMBwrite_count; /* write to file */ - unsigned SMBwrite_time; - unsigned SMBlock_count; /* lock byte range */ - unsigned SMBlock_time; - unsigned SMBunlock_count; /* unlock byte range */ - unsigned SMBunlock_time; - unsigned SMBctemp_count; /* create temporary file */ - unsigned SMBctemp_time; - /* SMBmknew stats are currently combined with SMBcreate */ - unsigned SMBmknew_count; /* make new file */ - unsigned SMBmknew_time; - unsigned SMBchkpth_count; /* check directory path */ - unsigned SMBchkpth_time; - unsigned SMBexit_count; /* process exit */ - unsigned SMBexit_time; - unsigned SMBlseek_count; /* seek */ - unsigned SMBlseek_time; - unsigned SMBlockread_count; /* Lock a range and read */ - unsigned SMBlockread_time; - unsigned SMBwriteunlock_count; /* Unlock a range then write */ - unsigned SMBwriteunlock_time; - unsigned SMBreadbraw_count; /* read a block of data with no smb header */ - unsigned SMBreadbraw_time; - unsigned SMBreadBmpx_count; /* read block multiplexed */ - unsigned SMBreadBmpx_time; - unsigned SMBreadBs_count; /* read block (secondary response) */ - unsigned SMBreadBs_time; - unsigned SMBwritebraw_count; /* write a block of data with no smb header */ - unsigned SMBwritebraw_time; - unsigned SMBwriteBmpx_count; /* write block multiplexed */ - unsigned SMBwriteBmpx_time; - unsigned SMBwriteBs_count; /* write block (secondary request) */ - unsigned SMBwriteBs_time; - unsigned SMBwritec_count; /* secondary write request */ - unsigned SMBwritec_time; - unsigned SMBsetattrE_count; /* set file attributes expanded */ - unsigned SMBsetattrE_time; - unsigned SMBgetattrE_count; /* get file attributes expanded */ - unsigned SMBgetattrE_time; - unsigned SMBlockingX_count; /* lock/unlock byte ranges and X */ - unsigned SMBlockingX_time; - unsigned SMBtrans_count; /* transaction - name, bytes in/out */ - unsigned SMBtrans_time; - unsigned SMBtranss_count; /* transaction (secondary request/response) */ - unsigned SMBtranss_time; - unsigned SMBioctl_count; /* IOCTL */ - unsigned SMBioctl_time; - unsigned SMBioctls_count; /* IOCTL (secondary request/response) */ - unsigned SMBioctls_time; - unsigned SMBcopy_count; /* copy */ - unsigned SMBcopy_time; - unsigned SMBmove_count; /* move */ - unsigned SMBmove_time; - unsigned SMBecho_count; /* echo */ - unsigned SMBecho_time; - unsigned SMBwriteclose_count; /* write a file then close it */ - unsigned SMBwriteclose_time; - unsigned SMBopenX_count; /* open and X */ - unsigned SMBopenX_time; - unsigned SMBreadX_count; /* read and X */ - unsigned SMBreadX_time; - unsigned SMBwriteX_count; /* write and X */ - unsigned SMBwriteX_time; - unsigned SMBtrans2_count; /* TRANS2 protocol set */ - unsigned SMBtrans2_time; - unsigned SMBtranss2_count; /* TRANS2 protocol set, secondary command */ - unsigned SMBtranss2_time; - unsigned SMBfindclose_count; /* Terminate a TRANSACT2_FINDFIRST */ - unsigned SMBfindclose_time; - unsigned SMBfindnclose_count; /* Terminate a TRANSACT2_FINDNOTIFYFIRST */ - unsigned SMBfindnclose_time; - unsigned SMBtcon_count; /* tree connect */ - unsigned SMBtcon_time; - unsigned SMBtdis_count; /* tree disconnect */ - unsigned SMBtdis_time; - unsigned SMBnegprot_count; /* negotiate protocol */ - unsigned SMBnegprot_time; - unsigned SMBsesssetupX_count; /* Session Set Up & X (including User Logon) */ - unsigned SMBsesssetupX_time; - unsigned SMBulogoffX_count; /* user logoff */ - unsigned SMBulogoffX_time; - unsigned SMBtconX_count; /* tree connect and X*/ - unsigned SMBtconX_time; - unsigned SMBdskattr_count; /* get disk attributes */ - unsigned SMBdskattr_time; - unsigned SMBsearch_count; /* search directory */ - unsigned SMBsearch_time; - /* SBMffirst stats combined with SMBsearch */ - unsigned SMBffirst_count; /* find first */ - unsigned SMBffirst_time; - /* SBMfunique stats combined with SMBsearch */ - unsigned SMBfunique_count; /* find unique */ - unsigned SMBfunique_time; - unsigned SMBfclose_count; /* find close */ - unsigned SMBfclose_time; - unsigned SMBnttrans_count; /* NT transact */ - unsigned SMBnttrans_time; - unsigned SMBnttranss_count; /* NT transact secondary */ - unsigned SMBnttranss_time; - unsigned SMBntcreateX_count; /* NT create and X */ - unsigned SMBntcreateX_time; - unsigned SMBntcancel_count; /* NT cancel */ - unsigned SMBntcancel_time; - unsigned SMBntrename_count; /* NT rename file */ - unsigned SMBntrename_time; - unsigned SMBsplopen_count; /* open print spool file */ - unsigned SMBsplopen_time; - unsigned SMBsplwr_count; /* write to print spool file */ - unsigned SMBsplwr_time; - unsigned SMBsplclose_count; /* close print spool file */ - unsigned SMBsplclose_time; - unsigned SMBsplretq_count; /* return print queue */ - unsigned SMBsplretq_time; - unsigned SMBsends_count; /* send single block message */ - unsigned SMBsends_time; - unsigned SMBsendb_count; /* send broadcast message */ - unsigned SMBsendb_time; - unsigned SMBfwdname_count; /* forward user name */ - unsigned SMBfwdname_time; - unsigned SMBcancelf_count; /* cancel forward */ - unsigned SMBcancelf_time; - unsigned SMBgetmac_count; /* get machine name */ - unsigned SMBgetmac_time; - unsigned SMBsendstrt_count; /* send start of multi-block message */ - unsigned SMBsendstrt_time; - unsigned SMBsendend_count; /* send end of multi-block message */ - unsigned SMBsendend_time; - unsigned SMBsendtxt_count; /* send text of multi-block message */ - unsigned SMBsendtxt_time; - unsigned SMBinvalid_count; /* invalid command */ - unsigned SMBinvalid_time; -/* Pathworks setdir command */ - unsigned pathworks_setdir_count; - unsigned pathworks_setdir_time; -/* These are the TRANS2 sub commands */ - unsigned Trans2_open_count; - unsigned Trans2_open_time; - unsigned Trans2_findfirst_count; - unsigned Trans2_findfirst_time; - unsigned Trans2_findnext_count; - unsigned Trans2_findnext_time; - unsigned Trans2_qfsinfo_count; - unsigned Trans2_qfsinfo_time; - unsigned Trans2_setfsinfo_count; - unsigned Trans2_setfsinfo_time; - unsigned Trans2_qpathinfo_count; - unsigned Trans2_qpathinfo_time; - unsigned Trans2_setpathinfo_count; - unsigned Trans2_setpathinfo_time; - unsigned Trans2_qfileinfo_count; - unsigned Trans2_qfileinfo_time; - unsigned Trans2_setfileinfo_count; - unsigned Trans2_setfileinfo_time; - unsigned Trans2_fsctl_count; - unsigned Trans2_fsctl_time; - unsigned Trans2_ioctl_count; - unsigned Trans2_ioctl_time; - unsigned Trans2_findnotifyfirst_count; - unsigned Trans2_findnotifyfirst_time; - unsigned Trans2_findnotifynext_count; - unsigned Trans2_findnotifynext_time; - unsigned Trans2_mkdir_count; - unsigned Trans2_mkdir_time; - unsigned Trans2_session_setup_count; - unsigned Trans2_session_setup_time; - unsigned Trans2_get_dfs_referral_count; - unsigned Trans2_get_dfs_referral_time; - unsigned Trans2_report_dfs_inconsistancy_count; - unsigned Trans2_report_dfs_inconsistancy_time; -/* These are the NT transact sub commands. */ - unsigned NT_transact_create_count; - unsigned NT_transact_create_time; - unsigned NT_transact_ioctl_count; - unsigned NT_transact_ioctl_time; - unsigned NT_transact_set_security_desc_count; - unsigned NT_transact_set_security_desc_time; - unsigned NT_transact_notify_change_count; - unsigned NT_transact_notify_change_time; - unsigned NT_transact_rename_count; - unsigned NT_transact_rename_time; - unsigned NT_transact_query_security_desc_count; - unsigned NT_transact_query_security_desc_time; - unsigned NT_transact_get_user_quota_count; - unsigned NT_transact_get_user_quota_time; - unsigned NT_transact_set_user_quota_count; - unsigned NT_transact_set_user_quota_time; -/* These are ACL manipulation calls */ - unsigned get_nt_acl_count; - unsigned get_nt_acl_time; - unsigned fget_nt_acl_count; - unsigned fget_nt_acl_time; - unsigned set_nt_acl_count; - unsigned set_nt_acl_time; - unsigned fset_nt_acl_count; - unsigned fset_nt_acl_time; - unsigned chmod_acl_count; - unsigned chmod_acl_time; - unsigned fchmod_acl_count; - unsigned fchmod_acl_time; -/* These are nmbd stats */ - unsigned name_release_count; - unsigned name_release_time; - unsigned name_refresh_count; - unsigned name_refresh_time; - unsigned name_registration_count; - unsigned name_registration_time; - unsigned node_status_count; - unsigned node_status_time; - unsigned name_query_count; - unsigned name_query_time; - unsigned host_announce_count; - unsigned host_announce_time; - unsigned workgroup_announce_count; - unsigned workgroup_announce_time; - unsigned local_master_announce_count; - unsigned local_master_announce_time; - unsigned master_browser_announce_count; - unsigned master_browser_announce_time; - unsigned lm_host_announce_count; - unsigned lm_host_announce_time; - unsigned get_backup_list_count; - unsigned get_backup_list_time; - unsigned reset_browser_count; - unsigned reset_browser_time; - unsigned announce_request_count; - unsigned announce_request_time; - unsigned lm_announce_request_count; - unsigned lm_announce_request_time; - unsigned domain_logon_count; - unsigned domain_logon_time; - unsigned sync_browse_lists_count; - unsigned sync_browse_lists_time; - unsigned run_elections_count; - unsigned run_elections_time; - unsigned election_count; - unsigned election_time; }; struct profile_header { @@ -402,10 +761,6 @@ struct profile_header { extern struct profile_header *profile_h; extern struct profile_stats *profile_p; -extern struct timeval profile_starttime; -extern struct timeval profile_endtime; -extern struct timeval profile_starttime_nested; -extern struct timeval profile_endtime_nested; extern BOOL do_profile_flag; extern BOOL do_profile_times; @@ -491,8 +846,6 @@ static inline SMB_BIG_UINT profile_timestamp(void) profile_timestamp() - __profstamp_##x); \ } -#define START_PROFILE_NESTED(x) START_PROFILE(x) -#define END_PROFILE_NESTED(x) END_PROFILE(x) #else /* WITH_PROFILE */ @@ -501,10 +854,8 @@ static inline SMB_BIG_UINT profile_timestamp(void) #define DO_PROFILE_DEC_INC(x,y) #define DO_PROFILE_ADD(x,n) #define START_PROFILE(x) -#define START_PROFILE_NESTED(x) #define START_PROFILE_BYTES(x,n) #define END_PROFILE(x) -#define END_PROFILE_NESTED(x) #endif /* WITH_PROFILE */ diff --git a/source/include/socket_wrapper.h b/source/include/socket_wrapper.h deleted file mode 100644 index d8815a25757..00000000000 --- a/source/include/socket_wrapper.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - Copyright (C) Jelmer Vernooij 2005 <jelmer@samba.org> - - 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 __SOCKET_WRAPPER_H__ -#define __SOCKET_WRAPPER_H__ - -int swrap_socket(int domain, int type, int protocol); -int swrap_accept(int s, struct sockaddr *addr, socklen_t *addrlen); -int swrap_connect(int s, const struct sockaddr *serv_addr, socklen_t addrlen); -int swrap_bind(int s, const struct sockaddr *myaddr, socklen_t addrlen); -int swrap_getpeername(int s, struct sockaddr *name, socklen_t *addrlen); -int swrap_getsockname(int s, struct sockaddr *name, socklen_t *addrlen); -int swrap_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen); -int swrap_setsockopt(int s, int level, int optname, const void *optval, socklen_t optlen); -ssize_t swrap_recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen); -ssize_t swrap_sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); -int swrap_close(int); - -#ifdef SOCKET_WRAPPER_REPLACE -#define accept(s,addr,addrlen) swrap_accept(s,addr,addrlen) -#define connect(s,serv_addr,addrlen) swrap_connect(s,serv_addr,addrlen) -#define bind(s,myaddr,addrlen) swrap_bind(s,myaddr,addrlen) -#define getpeername(s,name,addrlen) swrap_getpeername(s,name,addrlen) -#define getsockname(s,name,addrlen) swrap_getsockname(s,name,addrlen) -#define getsockopt(s,level,optname,optval,optlen) swrap_getsockopt(s,level,optname,optval,optlen) -#define setsockopt(s,level,optname,optval,optlen) swrap_setsockopt(s,level,optname,optval,optlen) -#define recvfrom(s,buf,len,flags,from,fromlen) swrap_recvfrom(s,buf,len,flags,from,fromlen) -#define sendto(s,buf,len,flags,to,tolen) swrap_sendto(s,buf,len,flags,to,tolen) -#define socket(domain,type,protocol) swrap_socket(domain,type,protocol) -#define close(s) swrap_close(s) -#endif - -#endif /* __SOCKET_WRAPPER_H__ */ diff --git a/source/include/talloc.h b/source/include/talloc.h deleted file mode 100644 index 17032ac7acc..00000000000 --- a/source/include/talloc.h +++ /dev/null @@ -1,145 +0,0 @@ -#ifndef _TALLOC_H_ -#define _TALLOC_H_ -/* - Unix SMB/CIFS implementation. - Samba temporary memory allocation functions - - Copyright (C) Andrew Tridgell 2004-2005 - - ** NOTE! The following LGPL license applies to the talloc - ** library. This does NOT imply that all of Samba is released - ** under the LGPL - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* this is only needed for compatibility with the old talloc */ -typedef void TALLOC_CTX; - -/* - this uses a little trick to allow __LINE__ to be stringified -*/ -#define _STRING_LINE_(s) #s -#define _STRING_LINE2_(s) _STRING_LINE_(s) -#define __LINESTR__ _STRING_LINE2_(__LINE__) -#define __location__ __FILE__ ":" __LINESTR__ - -#ifndef TALLOC_DEPRECATED -#define TALLOC_DEPRECATED 0 -#endif - -/* useful macros for creating type checked pointers */ -#define talloc(ctx, type) (type *)talloc_named_const(ctx, sizeof(type), #type) -#define talloc_size(ctx, size) talloc_named_const(ctx, size, __location__) - -#define talloc_new(ctx) talloc_named_const(ctx, 0, "talloc_new: " __location__) - -#define talloc_zero(ctx, type) (type *)_talloc_zero(ctx, sizeof(type), #type) -#define talloc_zero_size(ctx, size) _talloc_zero(ctx, size, __location__) - -#define talloc_zero_array(ctx, type, count) (type *)_talloc_zero_array(ctx, sizeof(type), count, #type) -#define talloc_array(ctx, type, count) (type *)_talloc_array(ctx, sizeof(type), count, #type) -#define talloc_array_size(ctx, size, count) _talloc_array(ctx, size, count, __location__) - -#define talloc_realloc(ctx, p, type, count) (type *)_talloc_realloc_array(ctx, p, sizeof(type), count, #type) -#define talloc_realloc_size(ctx, ptr, size) _talloc_realloc(ctx, ptr, size, __location__) - -#define talloc_memdup(t, p, size) _talloc_memdup(t, p, size, __location__) - -#define malloc_p(type) (type *)malloc(sizeof(type)) -#define malloc_array_p(type, count) (type *)realloc_array(NULL, sizeof(type), count) -#define realloc_p(p, type, count) (type *)realloc_array(p, sizeof(type), count) - -#if 0 -/* Not correct for Samba3. */ -#define data_blob(ptr, size) data_blob_named(ptr, size, "DATA_BLOB: "__location__) -#define data_blob_talloc(ctx, ptr, size) data_blob_talloc_named(ctx, ptr, size, "DATA_BLOB: "__location__) -#define data_blob_dup_talloc(ctx, blob) data_blob_talloc_named(ctx, (blob)->data, (blob)->length, "DATA_BLOB: "__location__) -#endif - -#define talloc_set_type(ptr, type) talloc_set_name_const(ptr, #type) -#define talloc_get_type(ptr, type) (type *)talloc_check_name(ptr, #type) - -#define talloc_find_parent_bytype(ptr, type) (type *)talloc_find_parent_byname(ptr, #type) - - -#if TALLOC_DEPRECATED -#define talloc_zero_p(ctx, type) talloc_zero(ctx, type) -#define talloc_p(ctx, type) talloc(ctx, type) -#define talloc_array_p(ctx, type, count) talloc_array(ctx, type, count) -#define talloc_realloc_p(ctx, p, type, count) talloc_realloc(ctx, p, type, count) -#define talloc_destroy(ctx) talloc_free(ctx) -#endif - -#ifndef PRINTF_ATTRIBUTE -#if (__GNUC__ >= 3) -/** Use gcc attribute to check printf fns. a1 is the 1-based index of - * the parameter containing the format, and a2 the index of the first - * argument. Note that some gcc 2.x versions don't handle this - * properly **/ -#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2))) -#else -#define PRINTF_ATTRIBUTE(a1, a2) -#endif -#endif - - -/* The following definitions come from talloc.c */ -void *_talloc(const void *context, size_t size); -void talloc_set_destructor(const void *ptr, int (*destructor)(void *)); -void talloc_increase_ref_count(const void *ptr); -void *talloc_reference(const void *context, const void *ptr); -int talloc_unlink(const void *context, void *ptr); -void talloc_set_name(const void *ptr, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3); -void talloc_set_name_const(const void *ptr, const char *name); -void *talloc_named(const void *context, size_t size, - const char *fmt, ...) PRINTF_ATTRIBUTE(3,4); -void *talloc_named_const(const void *context, size_t size, const char *name); -const char *talloc_get_name(const void *ptr); -void *talloc_check_name(const void *ptr, const char *name); -void talloc_report_depth(const void *ptr, FILE *f, int depth); -void *talloc_parent(const void *ptr); -void *talloc_init(const char *fmt, ...) PRINTF_ATTRIBUTE(1,2); -int talloc_free(void *ptr); -void *_talloc_realloc(const void *context, void *ptr, size_t size, const char *name); -void *talloc_steal(const void *new_ctx, const void *ptr); -off_t talloc_total_size(const void *ptr); -off_t talloc_total_blocks(const void *ptr); -void talloc_report_full(const void *ptr, FILE *f); -void talloc_report(const void *ptr, FILE *f); -void talloc_enable_null_tracking(void); -void talloc_enable_leak_report(void); -void talloc_enable_leak_report_full(void); -void *_talloc_zero(const void *ctx, size_t size, const char *name); -void *_talloc_memdup(const void *t, const void *p, size_t size, const char *name); -char *talloc_strdup(const void *t, const char *p); -char *talloc_strndup(const void *t, const char *p, size_t n); -char *talloc_append_string(const void *t, char *orig, const char *append); -char *talloc_vasprintf(const void *t, const char *fmt, va_list ap) PRINTF_ATTRIBUTE(2,0); -char *talloc_asprintf(const void *t, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3); -char *talloc_asprintf_append(char *s, - const char *fmt, ...) PRINTF_ATTRIBUTE(2,3); -void *_talloc_array(const void *ctx, size_t el_size, unsigned count, const char *name); -void *_talloc_zero_array(const void *ctx, size_t el_size, unsigned count, const char *name); -void *_talloc_realloc_array(const void *ctx, void *ptr, size_t el_size, unsigned count, const char *name); -void *talloc_realloc_fn(const void *context, void *ptr, size_t size); -void *talloc_autofree_context(void); -size_t talloc_get_size(const void *ctx); -void *talloc_find_parent_byname(const void *ctx, const char *name); -void talloc_show_parents(const void *context, FILE *file); -int talloc_is_parent(const void *context, const char *ptr); - -#endif - diff --git a/source/include/trans2.h b/source/include/trans2.h index 92c5a2e963f..5b9623e3d40 100644 --- a/source/include/trans2.h +++ b/source/include/trans2.h @@ -394,6 +394,8 @@ Offset Size Name 100 - end. */ +#define SMB_FILE_UNIX_BASIC_SIZE 100 + /* UNIX filetype mappings. */ #define UNIX_TYPE_FILE 0 @@ -446,6 +448,13 @@ Offset Size Name /* Only valid for setfileinfo */ #define SMB_SET_POSIX_LOCK 0x208 +/* The set info levels for POSIX path operations. */ +#define SMB_POSIX_PATH_OPEN 0x209 +#define SMB_POSIX_PATH_UNLINK 0x20A + +#define SMB_QUERY_FILE_UNIX_INFO2 0x20B /* UNIX File Info2 */ +#define SMB_SET_FILE_UNIX_INFO2 0x20B + /* Transact 2 Find First levels */ #define SMB_FIND_FILE_UNIX 0x202 @@ -477,6 +486,7 @@ Offset Size Name #define CIFS_UNIX_EXTATTR_CAP 0x8 /* for support of chattr (chflags) and lsattr */ #define CIFS_UNIX_POSIX_PATHNAMES_CAP 0x10 /* Use POSIX pathnames on the wire. */ +#define CIFS_UNIX_POSIX_PATH_OPERATIONS_CAP 0x20 /* We can cope with POSIX open/mkdir/unlink etc. */ #define SMB_QUERY_POSIX_FS_INFO 0x201 @@ -579,7 +589,7 @@ number of entries sent will be zero. #define SMB_POSIX_IGNORE_ACE_ENTRIES 0xFFFF -/* Definition of SMB_SET_POSIX_LOCK */ +/* Definition of parameter block of SMB_SET_POSIX_LOCK */ /* [2 bytes] lock_type - 0 = Read, 1 = Write, 2 = Unlock [2 bytes] lock_flags - 1 = Wait (only valid for setlock) @@ -602,4 +612,37 @@ number of entries sent will be zero. #define POSIX_LOCK_TYPE_WRITE 1 #define POSIX_LOCK_TYPE_UNLOCK 2 +/* SMB_POSIX_PATH_OPEN "open_mode" definitions. */ +#define SMB_O_RDONLY 0x1 +#define SMB_O_WRONLY 0x2 +#define SMB_O_RDWR 0x4 + +#define SMB_ACCMODE 0x7 + +#define SMB_O_CREAT 0x10 +#define SMB_O_EXCL 0x20 +#define SMB_O_TRUNC 0x40 +#define SMB_O_APPEND 0x80 +#define SMB_O_SYNC 0x100 +#define SMB_O_DIRECTORY 0x200 +#define SMB_O_NOFOLLOW 0x400 +#define SMB_O_DIRECT 0x800 + +/* Definition of request parameter block for SMB_POSIX_PATH_OPEN */ +/* + [4 bytes] flags (as smb_ntcreate_Flags). + [4 bytes] open_mode + [4 bytes] mode_t - same encoding as "Standard UNIX permissions" above. + [2 bytes] ret_info_level - optimization. Info level to be returned. +*/ + +/* Definition of reply data block for SMB_POSIX_PATH_OPEN */ + +#define SMB_NO_INFO_LEVEL_RETURNED 0xFFFF + +/* + [2 bytes] reply info level - as requested or 0xFFFF if not available. + [n bytes] - info level reply - if available. +*/ + #endif diff --git a/source/include/util_tdb.h b/source/include/util_tdb.h new file mode 100644 index 00000000000..a8def46e441 --- /dev/null +++ b/source/include/util_tdb.h @@ -0,0 +1,76 @@ +/* + Unix SMB/CIFS implementation. + tdb utility functions + Copyright (C) Andrew Tridgell 1999 + + 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 __TDBUTIL_H__ +#define __TDBUTIL_H__ + +#include "tdb.h" + +#ifndef _BOOL +typedef int BOOL; +#define _BOOL +#endif + +/* single node of a list returned by tdb_search_keys */ +typedef struct keys_node +{ + struct keys_node *prev, *next; + TDB_DATA node_key; +} TDB_LIST_NODE; + +struct tdb_wrap { + struct tdb_context *tdb; + const char *name; + struct tdb_wrap *next, *prev; +}; + +TDB_LIST_NODE *tdb_search_keys(struct tdb_context*, const char*); +void tdb_search_list_free(TDB_LIST_NODE*); +int32_t tdb_change_int32_atomic(struct tdb_context *tdb, const char *keystr, int32_t *oldval, int32_t change_val); +int tdb_lock_bystring(struct tdb_context *tdb, const char *keyval); +int tdb_lock_bystring_with_timeout(TDB_CONTEXT *tdb, const char *keyval, + int timeout); +void tdb_unlock_bystring(struct tdb_context *tdb, const char *keyval); +int tdb_read_lock_bystring_with_timeout(TDB_CONTEXT *tdb, const char *keyval, + unsigned int timeout); +void tdb_read_unlock_bystring(TDB_CONTEXT *tdb, const char *keyval); +int32_t tdb_fetch_int32(struct tdb_context *tdb, const char *keystr); +int tdb_store_uint32(struct tdb_context *tdb, const char *keystr, uint32_t value); +int tdb_store_int32(struct tdb_context *tdb, const char *keystr, int32_t v); +int tdb_fetch_uint32(struct tdb_context *tdb, const char *keystr, uint32_t *value); +int tdb_traverse_delete_fn(struct tdb_context *the_tdb, TDB_DATA key, TDB_DATA dbuf, + void *state); +int tdb_store_bystring(struct tdb_context *tdb, const char *keystr, TDB_DATA data, int flags); +TDB_DATA tdb_fetch_bystring(struct tdb_context *tdb, const char *keystr); +int tdb_delete_bystring(struct tdb_context *tdb, const char *keystr); +struct tdb_context *tdb_open_log(const char *name, int hash_size, + int tdb_flags, int open_flags, mode_t mode); +int tdb_unpack(char *buf, int bufsize, const char *fmt, ...); +size_t tdb_pack(char *buf, int bufsize, const char *fmt, ...); +TDB_DATA make_tdb_data(const char *dptr, size_t dsize); +TDB_DATA string_tdb_data(const char *string); +int tdb_trans_store(struct tdb_context *tdb, TDB_DATA key, TDB_DATA dbuf, + int flag); +int tdb_change_uint32_atomic(TDB_CONTEXT *tdb, const char *keystr, + uint32 *oldval, uint32 change_val); +int tdb_chainlock_with_timeout( TDB_CONTEXT *tdb, TDB_DATA key, + unsigned int timeout); + +#endif /* __TDBUTIL_H__ */ diff --git a/source/include/vfs.h b/source/include/vfs.h index fb99d824125..2d04a374c4c 100644 --- a/source/include/vfs.h +++ b/source/include/vfs.h @@ -62,7 +62,12 @@ /* Changed to version 14 as we had to change DIR to SMB_STRUCT_DIR. JRA */ /* Changed to version 15 as we added the statvfs call. JRA */ /* Changed to version 16 as we added the getlock call. JRA */ -#define SMB_VFS_INTERFACE_VERSION 16 +/* Changed to version 17 as we removed redundant connection_struct parameters. --jpeach */ +/* Changed to version 18 to add fsp parameter to the open call -- jpeach + Also include kernel_flock call - jmcd */ +/* Changed to version 19, kernel change notify has been merged + Also included linux setlease call - jmcd */ +#define SMB_VFS_INTERFACE_VERSION 19 /* to bug old modules which are trying to compile with the old functions */ @@ -142,12 +147,15 @@ typedef enum _vfs_op_type { SMB_VFS_OP_UTIME, SMB_VFS_OP_FTRUNCATE, SMB_VFS_OP_LOCK, + SMB_VFS_OP_KERNEL_FLOCK, + SMB_VFS_OP_LINUX_SETLEASE, SMB_VFS_OP_GETLOCK, SMB_VFS_OP_SYMLINK, SMB_VFS_OP_READLINK, SMB_VFS_OP_LINK, SMB_VFS_OP_MKNOD, SMB_VFS_OP_REALPATH, + SMB_VFS_OP_NOTIFY_WATCH, /* NT ACL operations. */ @@ -219,29 +227,29 @@ struct vfs_ops { struct vfs_fn_pointers { /* Disk operations */ - int (*connect_fn)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *service, const char *user); - void (*disconnect)(struct vfs_handle_struct *handle, struct connection_struct *conn); - SMB_BIG_UINT (*disk_free)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, BOOL small_query, SMB_BIG_UINT *bsize, + int (*connect_fn)(struct vfs_handle_struct *handle, const char *service, const char *user); + void (*disconnect)(struct vfs_handle_struct *handle); + SMB_BIG_UINT (*disk_free)(struct vfs_handle_struct *handle, const char *path, BOOL small_query, SMB_BIG_UINT *bsize, 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_quota)(struct vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt); + int (*set_quota)(struct vfs_handle_struct *handle, 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); - int (*statvfs)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, struct vfs_statvfs_struct *statbuf); + int (*statvfs)(struct vfs_handle_struct *handle, const char *path, struct vfs_statvfs_struct *statbuf); /* Directory operations */ - SMB_STRUCT_DIR *(*opendir)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *fname, const char *mask, uint32 attributes); - SMB_STRUCT_DIRENT *(*readdir)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_STRUCT_DIR *dirp); - void (*seekdir)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_STRUCT_DIR *dirp, long offset); - long (*telldir)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_STRUCT_DIR *dirp); - void (*rewind_dir)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_STRUCT_DIR *dirp); - int (*mkdir)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, mode_t mode); - int (*rmdir)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path); - int (*closedir)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_STRUCT_DIR *dir); + SMB_STRUCT_DIR *(*opendir)(struct vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attributes); + SMB_STRUCT_DIRENT *(*readdir)(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp); + void (*seekdir)(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp, long offset); + long (*telldir)(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp); + void (*rewind_dir)(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp); + int (*mkdir)(struct vfs_handle_struct *handle, const char *path, mode_t mode); + int (*rmdir)(struct vfs_handle_struct *handle, const char *path); + int (*closedir)(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dir); /* File operations */ - int (*open)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *fname, int flags, mode_t mode); + int (*open)(struct vfs_handle_struct *handle, const char *fname, files_struct *fsp, int flags, mode_t mode); int (*close_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd); ssize_t (*read)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, void *data, size_t n); ssize_t (*pread)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, void *data, size_t n, SMB_OFF_T offset); @@ -249,27 +257,36 @@ struct vfs_ops { ssize_t (*pwrite)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, const void *data, size_t n, SMB_OFF_T offset); SMB_OFF_T (*lseek)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_OFF_T offset, int whence); ssize_t (*sendfile)(struct vfs_handle_struct *handle, int tofd, files_struct *fsp, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count); - int (*rename)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *oldname, const char *newname); + int (*rename)(struct vfs_handle_struct *handle, const char *oldname, const char *newname); int (*fsync)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd); - int (*stat)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *fname, SMB_STRUCT_STAT *sbuf); + int (*stat)(struct vfs_handle_struct *handle, const char *fname, SMB_STRUCT_STAT *sbuf); int (*fstat)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_STRUCT_STAT *sbuf); - int (*lstat)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, SMB_STRUCT_STAT *sbuf); - int (*unlink)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path); - int (*chmod)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, mode_t mode); + int (*lstat)(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf); + int (*unlink)(struct vfs_handle_struct *handle, const char *path); + int (*chmod)(struct vfs_handle_struct *handle, const char *path, mode_t mode); int (*fchmod)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, mode_t mode); - int (*chown)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, uid_t uid, gid_t gid); + int (*chown)(struct vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid); int (*fchown)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, uid_t uid, gid_t gid); - int (*chdir)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path); - char *(*getwd)(struct vfs_handle_struct *handle, struct connection_struct *conn, char *buf); - int (*utime)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, struct utimbuf *times); + int (*chdir)(struct vfs_handle_struct *handle, const char *path); + char *(*getwd)(struct vfs_handle_struct *handle, char *buf); + int (*utime)(struct vfs_handle_struct *handle, const char *path, struct utimbuf *times); int (*ftruncate)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_OFF_T offset); BOOL (*lock)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type); + int (*kernel_flock)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, uint32 share_mode); + int (*linux_setlease)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, int leasetype); BOOL (*getlock)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid); - int (*symlink)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *oldpath, const char *newpath); - int (*readlink)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, char *buf, size_t bufsiz); - int (*link)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *oldpath, const char *newpath); - int (*mknod)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, mode_t mode, SMB_DEV_T dev); - char *(*realpath)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, char *resolved_path); + int (*symlink)(struct vfs_handle_struct *handle, const char *oldpath, const char *newpath); + int (*readlink)(struct vfs_handle_struct *handle, const char *path, char *buf, size_t bufsiz); + int (*link)(struct vfs_handle_struct *handle, const char *oldpath, const char *newpath); + int (*mknod)(struct vfs_handle_struct *handle, const char *path, mode_t mode, SMB_DEV_T dev); + char *(*realpath)(struct vfs_handle_struct *handle, const char *path, char *resolved_path); + NTSTATUS (*notify_watch)(struct vfs_handle_struct *handle, + struct sys_notify_context *ctx, + struct notify_entry *e, + void (*callback)(struct sys_notify_context *ctx, + void *private_data, + struct notify_event *ev), + void *private_data, void *handle_p); /* NT ACL operations. */ @@ -280,44 +297,44 @@ struct vfs_ops { /* POSIX ACL operations. */ - int (*chmod_acl)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *name, mode_t mode); + int (*chmod_acl)(struct vfs_handle_struct *handle, const char *name, mode_t mode); int (*fchmod_acl)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, mode_t mode); - int (*sys_acl_get_entry)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_ACL_T theacl, int entry_id, SMB_ACL_ENTRY_T *entry_p); - int (*sys_acl_get_tag_type)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *tag_type_p); - int (*sys_acl_get_permset)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p); - void * (*sys_acl_get_qualifier)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_ACL_ENTRY_T entry_d); - SMB_ACL_T (*sys_acl_get_file)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path_p, SMB_ACL_TYPE_T type); + int (*sys_acl_get_entry)(struct vfs_handle_struct *handle, SMB_ACL_T theacl, int entry_id, SMB_ACL_ENTRY_T *entry_p); + int (*sys_acl_get_tag_type)(struct vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *tag_type_p); + int (*sys_acl_get_permset)(struct vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p); + void * (*sys_acl_get_qualifier)(struct vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d); + SMB_ACL_T (*sys_acl_get_file)(struct vfs_handle_struct *handle, const char *path_p, SMB_ACL_TYPE_T type); SMB_ACL_T (*sys_acl_get_fd)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd); - int (*sys_acl_clear_perms)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_ACL_PERMSET_T permset); - int (*sys_acl_add_perm)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm); - char * (*sys_acl_to_text)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_ACL_T theacl, ssize_t *plen); - SMB_ACL_T (*sys_acl_init)(struct vfs_handle_struct *handle, struct connection_struct *conn, int count); - int (*sys_acl_create_entry)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry); - int (*sys_acl_set_tag_type)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype); - int (*sys_acl_set_qualifier)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_ACL_ENTRY_T entry, void *qual); - int (*sys_acl_set_permset)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset); - int (*sys_acl_valid)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_ACL_T theacl ); - int (*sys_acl_set_file)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl); + int (*sys_acl_clear_perms)(struct vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset); + int (*sys_acl_add_perm)(struct vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm); + char * (*sys_acl_to_text)(struct vfs_handle_struct *handle, SMB_ACL_T theacl, ssize_t *plen); + SMB_ACL_T (*sys_acl_init)(struct vfs_handle_struct *handle, int count); + int (*sys_acl_create_entry)(struct vfs_handle_struct *handle, SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry); + int (*sys_acl_set_tag_type)(struct vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype); + int (*sys_acl_set_qualifier)(struct vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, void *qual); + int (*sys_acl_set_permset)(struct vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset); + int (*sys_acl_valid)(struct vfs_handle_struct *handle, SMB_ACL_T theacl ); + int (*sys_acl_set_file)(struct vfs_handle_struct *handle, const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl); int (*sys_acl_set_fd)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_ACL_T theacl); - int (*sys_acl_delete_def_file)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path); - int (*sys_acl_get_perm)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm); - int (*sys_acl_free_text)(struct vfs_handle_struct *handle, struct connection_struct *conn, char *text); - int (*sys_acl_free_acl)(struct vfs_handle_struct *handle, struct connection_struct *conn, SMB_ACL_T posix_acl); - int (*sys_acl_free_qualifier)(struct vfs_handle_struct *handle, struct connection_struct *conn, void *qualifier, SMB_ACL_TAG_T tagtype); + int (*sys_acl_delete_def_file)(struct vfs_handle_struct *handle, const char *path); + int (*sys_acl_get_perm)(struct vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm); + int (*sys_acl_free_text)(struct vfs_handle_struct *handle, char *text); + int (*sys_acl_free_acl)(struct vfs_handle_struct *handle, SMB_ACL_T posix_acl); + int (*sys_acl_free_qualifier)(struct vfs_handle_struct *handle, void *qualifier, SMB_ACL_TAG_T tagtype); /* EA operations. */ - ssize_t (*getxattr)(struct vfs_handle_struct *handle,struct connection_struct *conn,const char *path, const char *name, void *value, size_t size); - ssize_t (*lgetxattr)(struct vfs_handle_struct *handle,struct connection_struct *conn,const char *path, const char *name, void *value, size_t size); + ssize_t (*getxattr)(struct vfs_handle_struct *handle,const char *path, const char *name, void *value, size_t size); + ssize_t (*lgetxattr)(struct vfs_handle_struct *handle,const char *path, const char *name, void *value, size_t size); ssize_t (*fgetxattr)(struct vfs_handle_struct *handle, struct files_struct *fsp,int fd, const char *name, void *value, size_t size); - ssize_t (*listxattr)(struct vfs_handle_struct *handle, struct connection_struct *conn,const char *path, char *list, size_t size); - ssize_t (*llistxattr)(struct vfs_handle_struct *handle, struct connection_struct *conn,const char *path, char *list, size_t size); + ssize_t (*listxattr)(struct vfs_handle_struct *handle, const char *path, char *list, size_t size); + ssize_t (*llistxattr)(struct vfs_handle_struct *handle, const char *path, char *list, size_t size); ssize_t (*flistxattr)(struct vfs_handle_struct *handle, struct files_struct *fsp,int fd, char *list, size_t size); - int (*removexattr)(struct vfs_handle_struct *handle, struct connection_struct *conn,const char *path, const char *name); - int (*lremovexattr)(struct vfs_handle_struct *handle, struct connection_struct *conn,const char *path, const char *name); + int (*removexattr)(struct vfs_handle_struct *handle, const char *path, const char *name); + int (*lremovexattr)(struct vfs_handle_struct *handle, const char *path, const char *name); int (*fremovexattr)(struct vfs_handle_struct *handle, struct files_struct *fsp,int filedes, const char *name); - int (*setxattr)(struct vfs_handle_struct *handle, struct connection_struct *conn,const char *path, const char *name, const void *value, size_t size, int flags); - int (*lsetxattr)(struct vfs_handle_struct *handle, struct connection_struct *conn,const char *path, const char *name, const void *value, size_t size, int flags); + int (*setxattr)(struct vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags); + int (*lsetxattr)(struct vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags); int (*fsetxattr)(struct vfs_handle_struct *handle, struct files_struct *fsp,int filedes, const char *name, const void *value, size_t size, int flags); /* aio operations */ @@ -378,12 +395,15 @@ struct vfs_ops { struct vfs_handle_struct *utime; struct vfs_handle_struct *ftruncate; struct vfs_handle_struct *lock; + struct vfs_handle_struct *kernel_flock; + struct vfs_handle_struct *linux_setlease; struct vfs_handle_struct *getlock; struct vfs_handle_struct *symlink; struct vfs_handle_struct *readlink; struct vfs_handle_struct *link; struct vfs_handle_struct *mknod; struct vfs_handle_struct *realpath; + struct vfs_handle_struct *notify_watch; /* NT ACL operations. */ @@ -530,6 +550,14 @@ typedef struct vfs_statvfs_struct { /* NB flags can come from FILE_SYSTEM_DEVICE_INFO call */ } vfs_statvfs_struct; +#define VFS_ADD_FSP_EXTENSION(handle, fsp, type) \ + vfs_add_fsp_extension_notype(handle, (fsp), sizeof(type)) + +#define VFS_FETCH_FSP_EXTENSION(handle, fsp) \ + vfs_fetch_fsp_extension(handle, (fsp)) + +#define VFS_REMOVE_FSP_EXTENSION(handle, fsp) \ + vfs_remove_fsp_extension((handle), (fsp)) #define SMB_VFS_HANDLE_GET_DATA(handle, datap, type, ret) { \ if (!(handle)||((datap=(type *)(handle)->data)==NULL)) { \ @@ -562,6 +590,7 @@ typedef struct vfs_statvfs_struct { #define SMB_VFS_OP(x) ((void *) x) +#define DEFAULT_VFS_MODULE_NAME "/[Default VFS]/" #include "vfs_macros.h" diff --git a/source/include/vfs_macros.h b/source/include/vfs_macros.h index e08b386a6ac..f50da3a02b5 100644 --- a/source/include/vfs_macros.h +++ b/source/include/vfs_macros.h @@ -28,26 +28,26 @@ ********************************************************************/ /* Disk operations */ -#define SMB_VFS_CONNECT(conn, service, user) ((conn)->vfs.ops.connect_fn((conn)->vfs.handles.connect_hnd, (conn), (service), (user))) -#define SMB_VFS_DISCONNECT(conn) ((conn)->vfs.ops.disconnect((conn)->vfs.handles.disconnect, (conn))) -#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_CONNECT(conn, service, user) ((conn)->vfs.ops.connect_fn((conn)->vfs.handles.connect_hnd, (service), (user))) +#define SMB_VFS_DISCONNECT(conn) ((conn)->vfs.ops.disconnect((conn)->vfs.handles.disconnect)) +#define SMB_VFS_DISK_FREE(conn, path, small_query, bsize, dfree ,dsize) ((conn)->vfs.ops.disk_free((conn)->vfs.handles.disk_free, (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, (qtype), (id), (qt))) +#define SMB_VFS_SET_QUOTA(conn, qtype, id, qt) ((conn)->vfs.ops.set_quota((conn)->vfs.handles.set_quota, (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))) -#define SMB_VFS_STATVFS(conn, path, statbuf) ((conn)->vfs.ops.statvfs((conn)->vfs.handles.statvfs, (conn), (path), (statbuf))) +#define SMB_VFS_STATVFS(conn, path, statbuf) ((conn)->vfs.ops.statvfs((conn)->vfs.handles.statvfs, (path), (statbuf))) /* Directory operations */ -#define SMB_VFS_OPENDIR(conn, fname, mask, attr) ((conn)->vfs.ops.opendir((conn)->vfs.handles.opendir, (conn), (fname), (mask), (attr))) -#define SMB_VFS_READDIR(conn, dirp) ((conn)->vfs.ops.readdir((conn)->vfs.handles.readdir, (conn), (dirp))) -#define SMB_VFS_SEEKDIR(conn, dirp, offset) ((conn)->vfs.ops.seekdir((conn)->vfs.handles.seekdir, (conn), (dirp), (offset))) -#define SMB_VFS_TELLDIR(conn, dirp) ((conn)->vfs.ops.telldir((conn)->vfs.handles.telldir, (conn), (dirp))) -#define SMB_VFS_REWINDDIR(conn, dirp) ((conn)->vfs.ops.rewind_dir((conn)->vfs.handles.rewind_dir, (conn), (dirp))) -#define SMB_VFS_MKDIR(conn, path, mode) ((conn)->vfs.ops.mkdir((conn)->vfs.handles.mkdir,(conn), (path), (mode))) -#define SMB_VFS_RMDIR(conn, path) ((conn)->vfs.ops.rmdir((conn)->vfs.handles.rmdir, (conn), (path))) -#define SMB_VFS_CLOSEDIR(conn, dir) ((conn)->vfs.ops.closedir((conn)->vfs.handles.closedir, (conn), dir)) +#define SMB_VFS_OPENDIR(conn, fname, mask, attr) ((conn)->vfs.ops.opendir((conn)->vfs.handles.opendir, (fname), (mask), (attr))) +#define SMB_VFS_READDIR(conn, dirp) ((conn)->vfs.ops.readdir((conn)->vfs.handles.readdir, (dirp))) +#define SMB_VFS_SEEKDIR(conn, dirp, offset) ((conn)->vfs.ops.seekdir((conn)->vfs.handles.seekdir, (dirp), (offset))) +#define SMB_VFS_TELLDIR(conn, dirp) ((conn)->vfs.ops.telldir((conn)->vfs.handles.telldir, (dirp))) +#define SMB_VFS_REWINDDIR(conn, dirp) ((conn)->vfs.ops.rewind_dir((conn)->vfs.handles.rewind_dir, (dirp))) +#define SMB_VFS_MKDIR(conn, path, mode) ((conn)->vfs.ops.mkdir((conn)->vfs.handles.mkdir,(path), (mode))) +#define SMB_VFS_RMDIR(conn, path) ((conn)->vfs.ops.rmdir((conn)->vfs.handles.rmdir, (path))) +#define SMB_VFS_CLOSEDIR(conn, dir) ((conn)->vfs.ops.closedir((conn)->vfs.handles.closedir, dir)) /* File operations */ -#define SMB_VFS_OPEN(conn, fname, flags, mode) ((conn)->vfs.ops.open((conn)->vfs.handles.open, (conn), (fname), (flags), (mode))) +#define SMB_VFS_OPEN(conn, fname, fsp, flags, mode) ((conn)->vfs.ops.open((conn)->vfs.handles.open, (fname), (fsp), (flags), (mode))) #define SMB_VFS_CLOSE(fsp, fd) ((fsp)->conn->vfs.ops.close_fn((fsp)->conn->vfs.handles.close_hnd, (fsp), (fd))) #define SMB_VFS_READ(fsp, fd, data, n) ((fsp)->conn->vfs.ops.read((fsp)->conn->vfs.handles.read, (fsp), (fd), (data), (n))) #define SMB_VFS_PREAD(fsp, fd, data, n, off) ((fsp)->conn->vfs.ops.pread((fsp)->conn->vfs.handles.pread, (fsp), (fd), (data), (n), (off))) @@ -55,27 +55,30 @@ #define SMB_VFS_PWRITE(fsp, fd, data, n, off) ((fsp)->conn->vfs.ops.pwrite((fsp)->conn->vfs.handles.pwrite, (fsp), (fd), (data), (n), (off))) #define SMB_VFS_LSEEK(fsp, fd, offset, whence) ((fsp)->conn->vfs.ops.lseek((fsp)->conn->vfs.handles.lseek, (fsp), (fd), (offset), (whence))) #define SMB_VFS_SENDFILE(tofd, fsp, fromfd, header, offset, count) ((fsp)->conn->vfs.ops.sendfile((fsp)->conn->vfs.handles.sendfile, (tofd), (fsp), (fromfd), (header), (offset), (count))) -#define SMB_VFS_RENAME(conn, old, new) ((conn)->vfs.ops.rename((conn)->vfs.handles.rename, (conn), (old), (new))) +#define SMB_VFS_RENAME(conn, old, new) ((conn)->vfs.ops.rename((conn)->vfs.handles.rename, (old), (new))) #define SMB_VFS_FSYNC(fsp, fd) ((fsp)->conn->vfs.ops.fsync((fsp)->conn->vfs.handles.fsync, (fsp), (fd))) -#define SMB_VFS_STAT(conn, fname, sbuf) ((conn)->vfs.ops.stat((conn)->vfs.handles.stat, (conn), (fname), (sbuf))) +#define SMB_VFS_STAT(conn, fname, sbuf) ((conn)->vfs.ops.stat((conn)->vfs.handles.stat, (fname), (sbuf))) #define SMB_VFS_FSTAT(fsp, fd, sbuf) ((fsp)->conn->vfs.ops.fstat((fsp)->conn->vfs.handles.fstat, (fsp) ,(fd) ,(sbuf))) -#define SMB_VFS_LSTAT(conn, path, sbuf) ((conn)->vfs.ops.lstat((conn)->vfs.handles.lstat, (conn), (path), (sbuf))) -#define SMB_VFS_UNLINK(conn, path) ((conn)->vfs.ops.unlink((conn)->vfs.handles.unlink, (conn), (path))) -#define SMB_VFS_CHMOD(conn, path, mode) ((conn)->vfs.ops.chmod((conn)->vfs.handles.chmod, (conn), (path), (mode))) +#define SMB_VFS_LSTAT(conn, path, sbuf) ((conn)->vfs.ops.lstat((conn)->vfs.handles.lstat, (path), (sbuf))) +#define SMB_VFS_UNLINK(conn, path) ((conn)->vfs.ops.unlink((conn)->vfs.handles.unlink, (path))) +#define SMB_VFS_CHMOD(conn, path, mode) ((conn)->vfs.ops.chmod((conn)->vfs.handles.chmod, (path), (mode))) #define SMB_VFS_FCHMOD(fsp, fd, mode) ((fsp)->conn->vfs.ops.fchmod((fsp)->conn->vfs.handles.fchmod, (fsp), (fd), (mode))) -#define SMB_VFS_CHOWN(conn, path, uid, gid) ((conn)->vfs.ops.chown((conn)->vfs.handles.chown, (conn), (path), (uid), (gid))) +#define SMB_VFS_CHOWN(conn, path, uid, gid) ((conn)->vfs.ops.chown((conn)->vfs.handles.chown, (path), (uid), (gid))) #define SMB_VFS_FCHOWN(fsp, fd, uid, gid) ((fsp)->conn->vfs.ops.fchown((fsp)->conn->vfs.handles.fchown, (fsp), (fd), (uid), (gid))) -#define SMB_VFS_CHDIR(conn, path) ((conn)->vfs.ops.chdir((conn)->vfs.handles.chdir, (conn), (path))) -#define SMB_VFS_GETWD(conn, buf) ((conn)->vfs.ops.getwd((conn)->vfs.handles.getwd, (conn), (buf))) -#define SMB_VFS_UTIME(conn, path, times) ((conn)->vfs.ops.utime((conn)->vfs.handles.utime, (conn), (path), (times))) +#define SMB_VFS_CHDIR(conn, path) ((conn)->vfs.ops.chdir((conn)->vfs.handles.chdir, (path))) +#define SMB_VFS_GETWD(conn, buf) ((conn)->vfs.ops.getwd((conn)->vfs.handles.getwd, (buf))) +#define SMB_VFS_UTIME(conn, path, times) ((conn)->vfs.ops.utime((conn)->vfs.handles.utime, (path), (times))) #define SMB_VFS_FTRUNCATE(fsp, fd, offset) ((fsp)->conn->vfs.ops.ftruncate((fsp)->conn->vfs.handles.ftruncate, (fsp), (fd), (offset))) #define SMB_VFS_LOCK(fsp, fd, op, offset, count, type) ((fsp)->conn->vfs.ops.lock((fsp)->conn->vfs.handles.lock, (fsp), (fd) ,(op), (offset), (count), (type))) +#define SMB_VFS_KERNEL_FLOCK(fsp, fd, share_mode) ((fsp)->conn->vfs.ops.kernel_flock((fsp)->conn->vfs.handles.kernel_flock, (fsp), (fd), (share_mode))) +#define SMB_VFS_LINUX_SETLEASE(fsp, fd, leasetype) ((fsp)->conn->vfs.ops.linux_setlease((fsp)->conn->vfs.handles.linux_setlease, (fsp), (fd), (leasetype))) #define SMB_VFS_GETLOCK(fsp, fd, poffset, pcount, ptype, ppid) ((fsp)->conn->vfs.ops.getlock((fsp)->conn->vfs.handles.getlock, (fsp), (fd) ,(poffset), (pcount), (ptype), (ppid))) -#define SMB_VFS_SYMLINK(conn, oldpath, newpath) ((conn)->vfs.ops.symlink((conn)->vfs.handles.symlink, (conn), (oldpath), (newpath))) -#define SMB_VFS_READLINK(conn, path, buf, bufsiz) ((conn)->vfs.ops.readlink((conn)->vfs.handles.readlink, (conn), (path), (buf), (bufsiz))) -#define SMB_VFS_LINK(conn, oldpath, newpath) ((conn)->vfs.ops.link((conn)->vfs.handles.link, (conn), (oldpath), (newpath))) -#define SMB_VFS_MKNOD(conn, path, mode, dev) ((conn)->vfs.ops.mknod((conn)->vfs.handles.mknod, (conn), (path), (mode), (dev))) -#define SMB_VFS_REALPATH(conn, path, resolved_path) ((conn)->vfs.ops.realpath((conn)->vfs.handles.realpath, (conn), (path), (resolved_path))) +#define SMB_VFS_SYMLINK(conn, oldpath, newpath) ((conn)->vfs.ops.symlink((conn)->vfs.handles.symlink, (oldpath), (newpath))) +#define SMB_VFS_READLINK(conn, path, buf, bufsiz) ((conn)->vfs.ops.readlink((conn)->vfs.handles.readlink, (path), (buf), (bufsiz))) +#define SMB_VFS_LINK(conn, oldpath, newpath) ((conn)->vfs.ops.link((conn)->vfs.handles.link, (oldpath), (newpath))) +#define SMB_VFS_MKNOD(conn, path, mode, dev) ((conn)->vfs.ops.mknod((conn)->vfs.handles.mknod, (path), (mode), (dev))) +#define SMB_VFS_REALPATH(conn, path, resolved_path) ((conn)->vfs.ops.realpath((conn)->vfs.handles.realpath, (path), (resolved_path))) +#define SMB_VFS_NOTIFY_WATCH(conn, ctx, e, callback, private_data, handle_p) ((conn)->vfs.ops.notify_watch((conn)->vfs.handles.notify_watch, (ctx), (e), (callback), (private_data), (handle_p))) /* NT ACL operations. */ #define SMB_VFS_FGET_NT_ACL(fsp, fd, security_info, ppdesc) ((fsp)->conn->vfs.ops.fget_nt_acl((fsp)->conn->vfs.handles.fget_nt_acl, (fsp), (fd), (security_info), (ppdesc))) @@ -84,44 +87,44 @@ #define SMB_VFS_SET_NT_ACL(fsp, name, security_info_sent, psd) ((fsp)->conn->vfs.ops.set_nt_acl((fsp)->conn->vfs.handles.set_nt_acl, (fsp), (name), (security_info_sent), (psd))) /* POSIX ACL operations. */ -#define SMB_VFS_CHMOD_ACL(conn, name, mode) ((conn)->vfs.ops.chmod_acl((conn)->vfs.handles.chmod_acl, (conn), (name), (mode))) +#define SMB_VFS_CHMOD_ACL(conn, name, mode) ((conn)->vfs.ops.chmod_acl((conn)->vfs.handles.chmod_acl, (name), (mode))) #define SMB_VFS_FCHMOD_ACL(fsp, fd, mode) ((fsp)->conn->vfs.ops.fchmod_acl((fsp)->conn->vfs.handles.chmod_acl, (fsp), (fd), (mode))) -#define SMB_VFS_SYS_ACL_GET_ENTRY(conn, theacl, entry_id, entry_p) ((conn)->vfs.ops.sys_acl_get_entry((conn)->vfs.handles.sys_acl_get_entry, (conn), (theacl), (entry_id), (entry_p))) -#define SMB_VFS_SYS_ACL_GET_TAG_TYPE(conn, entry_d, tag_type_p) ((conn)->vfs.ops.sys_acl_get_tag_type((conn)->vfs.handles.sys_acl_get_tag_type, (conn), (entry_d), (tag_type_p))) -#define SMB_VFS_SYS_ACL_GET_PERMSET(conn, entry_d, permset_p) ((conn)->vfs.ops.sys_acl_get_permset((conn)->vfs.handles.sys_acl_get_permset, (conn), (entry_d), (permset_p))) -#define SMB_VFS_SYS_ACL_GET_QUALIFIER(conn, entry_d) ((conn)->vfs.ops.sys_acl_get_qualifier((conn)->vfs.handles.sys_acl_get_qualifier, (conn), (entry_d))) -#define SMB_VFS_SYS_ACL_GET_FILE(conn, path_p, type) ((conn)->vfs.ops.sys_acl_get_file((conn)->vfs.handles.sys_acl_get_file, (conn), (path_p), (type))) +#define SMB_VFS_SYS_ACL_GET_ENTRY(conn, theacl, entry_id, entry_p) ((conn)->vfs.ops.sys_acl_get_entry((conn)->vfs.handles.sys_acl_get_entry, (theacl), (entry_id), (entry_p))) +#define SMB_VFS_SYS_ACL_GET_TAG_TYPE(conn, entry_d, tag_type_p) ((conn)->vfs.ops.sys_acl_get_tag_type((conn)->vfs.handles.sys_acl_get_tag_type, (entry_d), (tag_type_p))) +#define SMB_VFS_SYS_ACL_GET_PERMSET(conn, entry_d, permset_p) ((conn)->vfs.ops.sys_acl_get_permset((conn)->vfs.handles.sys_acl_get_permset, (entry_d), (permset_p))) +#define SMB_VFS_SYS_ACL_GET_QUALIFIER(conn, entry_d) ((conn)->vfs.ops.sys_acl_get_qualifier((conn)->vfs.handles.sys_acl_get_qualifier, (entry_d))) +#define SMB_VFS_SYS_ACL_GET_FILE(conn, path_p, type) ((conn)->vfs.ops.sys_acl_get_file((conn)->vfs.handles.sys_acl_get_file, (path_p), (type))) #define SMB_VFS_SYS_ACL_GET_FD(fsp, fd) ((fsp)->conn->vfs.ops.sys_acl_get_fd((fsp)->conn->vfs.handles.sys_acl_get_fd, (fsp), (fd))) -#define SMB_VFS_SYS_ACL_CLEAR_PERMS(conn, permset) ((conn)->vfs.ops.sys_acl_clear_perms((conn)->vfs.handles.sys_acl_clear_perms, (conn), (permset))) -#define SMB_VFS_SYS_ACL_ADD_PERM(conn, permset, perm) ((conn)->vfs.ops.sys_acl_add_perm((conn)->vfs.handles.sys_acl_add_perm, (conn), (permset), (perm))) -#define SMB_VFS_SYS_ACL_TO_TEXT(conn, theacl, plen) ((conn)->vfs.ops.sys_acl_to_text((conn)->vfs.handles.sys_acl_to_text, (conn), (theacl), (plen))) -#define SMB_VFS_SYS_ACL_INIT(conn, count) ((conn)->vfs.ops.sys_acl_init((conn)->vfs.handles.sys_acl_init, (conn), (count))) -#define SMB_VFS_SYS_ACL_CREATE_ENTRY(conn, pacl, pentry) ((conn)->vfs.ops.sys_acl_create_entry((conn)->vfs.handles.sys_acl_create_entry, (conn), (pacl), (pentry))) -#define SMB_VFS_SYS_ACL_SET_TAG_TYPE(conn, entry, tagtype) ((conn)->vfs.ops.sys_acl_set_tag_type((conn)->vfs.handles.sys_acl_set_tag_type, (conn), (entry), (tagtype))) -#define SMB_VFS_SYS_ACL_SET_QUALIFIER(conn, entry, qual) ((conn)->vfs.ops.sys_acl_set_qualifier((conn)->vfs.handles.sys_acl_set_qualifier, (conn), (entry), (qual))) -#define SMB_VFS_SYS_ACL_SET_PERMSET(conn, entry, permset) ((conn)->vfs.ops.sys_acl_set_permset((conn)->vfs.handles.sys_acl_set_permset, (conn), (entry), (permset))) -#define SMB_VFS_SYS_ACL_VALID(conn, theacl) ((conn)->vfs.ops.sys_acl_valid((conn)->vfs.handles.sys_acl_valid, (conn), (theacl))) -#define SMB_VFS_SYS_ACL_SET_FILE(conn, name, acltype, theacl) ((conn)->vfs.ops.sys_acl_set_file((conn)->vfs.handles.sys_acl_set_file, (conn), (name), (acltype), (theacl))) +#define SMB_VFS_SYS_ACL_CLEAR_PERMS(conn, permset) ((conn)->vfs.ops.sys_acl_clear_perms((conn)->vfs.handles.sys_acl_clear_perms, (permset))) +#define SMB_VFS_SYS_ACL_ADD_PERM(conn, permset, perm) ((conn)->vfs.ops.sys_acl_add_perm((conn)->vfs.handles.sys_acl_add_perm, (permset), (perm))) +#define SMB_VFS_SYS_ACL_TO_TEXT(conn, theacl, plen) ((conn)->vfs.ops.sys_acl_to_text((conn)->vfs.handles.sys_acl_to_text, (theacl), (plen))) +#define SMB_VFS_SYS_ACL_INIT(conn, count) ((conn)->vfs.ops.sys_acl_init((conn)->vfs.handles.sys_acl_init, (count))) +#define SMB_VFS_SYS_ACL_CREATE_ENTRY(conn, pacl, pentry) ((conn)->vfs.ops.sys_acl_create_entry((conn)->vfs.handles.sys_acl_create_entry, (pacl), (pentry))) +#define SMB_VFS_SYS_ACL_SET_TAG_TYPE(conn, entry, tagtype) ((conn)->vfs.ops.sys_acl_set_tag_type((conn)->vfs.handles.sys_acl_set_tag_type, (entry), (tagtype))) +#define SMB_VFS_SYS_ACL_SET_QUALIFIER(conn, entry, qual) ((conn)->vfs.ops.sys_acl_set_qualifier((conn)->vfs.handles.sys_acl_set_qualifier, (entry), (qual))) +#define SMB_VFS_SYS_ACL_SET_PERMSET(conn, entry, permset) ((conn)->vfs.ops.sys_acl_set_permset((conn)->vfs.handles.sys_acl_set_permset, (entry), (permset))) +#define SMB_VFS_SYS_ACL_VALID(conn, theacl) ((conn)->vfs.ops.sys_acl_valid((conn)->vfs.handles.sys_acl_valid, (theacl))) +#define SMB_VFS_SYS_ACL_SET_FILE(conn, name, acltype, theacl) ((conn)->vfs.ops.sys_acl_set_file((conn)->vfs.handles.sys_acl_set_file, (name), (acltype), (theacl))) #define SMB_VFS_SYS_ACL_SET_FD(fsp, fd, theacl) ((fsp)->conn->vfs.ops.sys_acl_set_fd((fsp)->conn->vfs.handles.sys_acl_set_fd, (fsp), (fd), (theacl))) -#define SMB_VFS_SYS_ACL_DELETE_DEF_FILE(conn, path) ((conn)->vfs.ops.sys_acl_delete_def_file((conn)->vfs.handles.sys_acl_delete_def_file, (conn), (path))) -#define SMB_VFS_SYS_ACL_GET_PERM(conn, permset, perm) ((conn)->vfs.ops.sys_acl_get_perm((conn)->vfs.handles.sys_acl_get_perm, (conn), (permset), (perm))) -#define SMB_VFS_SYS_ACL_FREE_TEXT(conn, text) ((conn)->vfs.ops.sys_acl_free_text((conn)->vfs.handles.sys_acl_free_text, (conn), (text))) -#define SMB_VFS_SYS_ACL_FREE_ACL(conn, posix_acl) ((conn)->vfs.ops.sys_acl_free_acl((conn)->vfs.handles.sys_acl_free_acl, (conn), (posix_acl))) -#define SMB_VFS_SYS_ACL_FREE_QUALIFIER(conn, qualifier, tagtype) ((conn)->vfs.ops.sys_acl_free_qualifier((conn)->vfs.handles.sys_acl_free_qualifier, (conn), (qualifier), (tagtype))) +#define SMB_VFS_SYS_ACL_DELETE_DEF_FILE(conn, path) ((conn)->vfs.ops.sys_acl_delete_def_file((conn)->vfs.handles.sys_acl_delete_def_file, (path))) +#define SMB_VFS_SYS_ACL_GET_PERM(conn, permset, perm) ((conn)->vfs.ops.sys_acl_get_perm((conn)->vfs.handles.sys_acl_get_perm, (permset), (perm))) +#define SMB_VFS_SYS_ACL_FREE_TEXT(conn, text) ((conn)->vfs.ops.sys_acl_free_text((conn)->vfs.handles.sys_acl_free_text, (text))) +#define SMB_VFS_SYS_ACL_FREE_ACL(conn, posix_acl) ((conn)->vfs.ops.sys_acl_free_acl((conn)->vfs.handles.sys_acl_free_acl, (posix_acl))) +#define SMB_VFS_SYS_ACL_FREE_QUALIFIER(conn, qualifier, tagtype) ((conn)->vfs.ops.sys_acl_free_qualifier((conn)->vfs.handles.sys_acl_free_qualifier, (qualifier), (tagtype))) /* EA operations. */ -#define SMB_VFS_GETXATTR(conn,path,name,value,size) ((conn)->vfs.ops.getxattr((conn)->vfs.handles.getxattr,(conn),(path),(name),(value),(size))) -#define SMB_VFS_LGETXATTR(conn,path,name,value,size) ((conn)->vfs.ops.lgetxattr((conn)->vfs.handles.lgetxattr,(conn),(path),(name),(value),(size))) +#define SMB_VFS_GETXATTR(conn,path,name,value,size) ((conn)->vfs.ops.getxattr((conn)->vfs.handles.getxattr,(path),(name),(value),(size))) +#define SMB_VFS_LGETXATTR(conn,path,name,value,size) ((conn)->vfs.ops.lgetxattr((conn)->vfs.handles.lgetxattr,(path),(name),(value),(size))) #define SMB_VFS_FGETXATTR(fsp,fd,name,value,size) ((fsp)->conn->vfs.ops.fgetxattr((fsp)->conn->vfs.handles.fgetxattr,(fsp),(fd),(name),(value),(size))) -#define SMB_VFS_LISTXATTR(conn,path,list,size) ((conn)->vfs.ops.listxattr((conn)->vfs.handles.listxattr,(conn),(path),(list),(size))) -#define SMB_VFS_LLISTXATTR(conn,path,list,size) ((conn)->vfs.ops.llistxattr((conn)->vfs.handles.llistxattr,(conn),(path),(list),(size))) +#define SMB_VFS_LISTXATTR(conn,path,list,size) ((conn)->vfs.ops.listxattr((conn)->vfs.handles.listxattr,(path),(list),(size))) +#define SMB_VFS_LLISTXATTR(conn,path,list,size) ((conn)->vfs.ops.llistxattr((conn)->vfs.handles.llistxattr,(path),(list),(size))) #define SMB_VFS_FLISTXATTR(fsp,fd,list,size) ((fsp)->conn->vfs.ops.flistxattr((fsp)->conn->vfs.handles.flistxattr,(fsp),(fd),(list),(size))) -#define SMB_VFS_REMOVEXATTR(conn,path,name) ((conn)->vfs.ops.removexattr((conn)->vfs.handles.removexattr,(conn),(path),(name))) -#define SMB_VFS_LREMOVEXATTR(conn,path,name) ((conn)->vfs.ops.lremovexattr((conn)->vfs.handles.lremovexattr,(conn),(path),(name))) +#define SMB_VFS_REMOVEXATTR(conn,path,name) ((conn)->vfs.ops.removexattr((conn)->vfs.handles.removexattr,(path),(name))) +#define SMB_VFS_LREMOVEXATTR(conn,path,name) ((conn)->vfs.ops.lremovexattr((conn)->vfs.handles.lremovexattr,(path),(name))) #define SMB_VFS_FREMOVEXATTR(fsp,fd,name) ((fsp)->conn->vfs.ops.fremovexattr((fsp)->conn->vfs.handles.fremovexattr,(fsp),(fd),(name))) -#define SMB_VFS_SETXATTR(conn,path,name,value,size,flags) ((conn)->vfs.ops.setxattr((conn)->vfs.handles.setxattr,(conn),(path),(name),(value),(size),(flags))) -#define SMB_VFS_LSETXATTR(conn,path,name,value,size,flags) ((conn)->vfs.ops.lsetxattr((conn)->vfs.handles.lsetxattr,(conn),(path),(name),(value),(size),(flags))) +#define SMB_VFS_SETXATTR(conn,path,name,value,size,flags) ((conn)->vfs.ops.setxattr((conn)->vfs.handles.setxattr,(path),(name),(value),(size),(flags))) +#define SMB_VFS_LSETXATTR(conn,path,name,value,size,flags) ((conn)->vfs.ops.lsetxattr((conn)->vfs.handles.lsetxattr,(path),(name),(value),(size),(flags))) #define SMB_VFS_FSETXATTR(fsp,fd,name,value,size,flags) ((fsp)->conn->vfs.ops.fsetxattr((fsp)->conn->vfs.handles.fsetxattr,(fsp),(fd),(name),(value),(size),(flags))) /* AIO operations. */ @@ -140,26 +143,26 @@ ********************************************************************/ /* Disk operations */ -#define SMB_VFS_OPAQUE_CONNECT(conn, service, user) ((conn)->vfs_opaque.ops.connect_fn((conn)->vfs_opaque.handles.connect_hnd, (conn), (service), (user))) -#define SMB_VFS_OPAQUE_DISCONNECT(conn) ((conn)->vfs_opaque.ops.disconnect((conn)->vfs_opaque.handles.disconnect, (conn))) -#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_CONNECT(conn, service, user) ((conn)->vfs_opaque.ops.connect_fn((conn)->vfs_opaque.handles.connect_hnd, (service), (user))) +#define SMB_VFS_OPAQUE_DISCONNECT(conn) ((conn)->vfs_opaque.ops.disconnect((conn)->vfs_opaque.handles.disconnect)) +#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, (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, (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, (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))) -#define SMB_VFS_OPAQUE_STATVFS(conn, path, statbuf) ((conn)->vfs_opaque.ops.statvfs((conn)->vfs_opaque.handles.statvfs, (conn), (path), (statbuf))) +#define SMB_VFS_OPAQUE_STATVFS(conn, path, statbuf) ((conn)->vfs_opaque.ops.statvfs((conn)->vfs_opaque.handles.statvfs, (path), (statbuf))) /* Directory operations */ -#define SMB_VFS_OPAQUE_OPENDIR(conn, fname, mask, attr) ((conn)->vfs_opaque.ops.opendir((conn)->vfs_opaque.handles.opendir, (conn), (fname), (mask), (attr))) -#define SMB_VFS_OPAQUE_READDIR(conn, dirp) ((conn)->vfs_opaque.ops.readdir((conn)->vfs_opaque.handles.readdir, (conn), (dirp))) -#define SMB_VFS_OPAQUE_SEEKDIR(conn, dirp, offset) ((conn)->vfs_opaque.ops.seekdir((conn)->vfs_opaque.handles.seekdir, (conn), (dirp), (offset))) -#define SMB_VFS_OPAQUE_TELLDIR(conn, dirp) ((conn)->vfs_opaque.ops.telldir((conn)->vfs_opaque.handles.telldir, (conn), (dirp))) -#define SMB_VFS_OPAQUE_REWINDDIR(conn, dirp) ((conn)->vfs_opaque.ops.rewind_dir((conn)->vfs_opaque.handles.rewind_dir, (conn), (dirp))) -#define SMB_VFS_OPAQUE_MKDIR(conn, path, mode) ((conn)->vfs_opaque.ops.mkdir((conn)->vfs_opaque.handles.mkdir,(conn), (path), (mode))) -#define SMB_VFS_OPAQUE_RMDIR(conn, path) ((conn)->vfs_opaque.ops.rmdir((conn)->vfs_opaque.handles.rmdir, (conn), (path))) -#define SMB_VFS_OPAQUE_CLOSEDIR(conn, dir) ((conn)->vfs_opaque.ops.closedir((conn)->vfs_opaque.handles.closedir, (conn), dir)) +#define SMB_VFS_OPAQUE_OPENDIR(conn, fname, mask, attr) ((conn)->vfs_opaque.ops.opendir((conn)->vfs_opaque.handles.opendir, (fname), (mask), (attr))) +#define SMB_VFS_OPAQUE_READDIR(conn, dirp) ((conn)->vfs_opaque.ops.readdir((conn)->vfs_opaque.handles.readdir, (dirp))) +#define SMB_VFS_OPAQUE_SEEKDIR(conn, dirp, offset) ((conn)->vfs_opaque.ops.seekdir((conn)->vfs_opaque.handles.seekdir, (dirp), (offset))) +#define SMB_VFS_OPAQUE_TELLDIR(conn, dirp) ((conn)->vfs_opaque.ops.telldir((conn)->vfs_opaque.handles.telldir, (dirp))) +#define SMB_VFS_OPAQUE_REWINDDIR(conn, dirp) ((conn)->vfs_opaque.ops.rewind_dir((conn)->vfs_opaque.handles.rewind_dir, (dirp))) +#define SMB_VFS_OPAQUE_MKDIR(conn, path, mode) ((conn)->vfs_opaque.ops.mkdir((conn)->vfs_opaque.handles.mkdir,(path), (mode))) +#define SMB_VFS_OPAQUE_RMDIR(conn, path) ((conn)->vfs_opaque.ops.rmdir((conn)->vfs_opaque.handles.rmdir, (path))) +#define SMB_VFS_OPAQUE_CLOSEDIR(conn, dir) ((conn)->vfs_opaque.ops.closedir((conn)->vfs_opaque.handles.closedir, dir)) /* File operations */ -#define SMB_VFS_OPAQUE_OPEN(conn, fname, flags, mode) ((conn)->vfs_opaque.ops.open((conn)->vfs_opaque.handles.open, (conn), (fname), (flags), (mode))) +#define SMB_VFS_OPAQUE_OPEN(conn, fname, fsp, flags, mode) ((conn)->vfs_opaque.ops.open((conn)->vfs_opaque.handles.open, (fname), (fsp), (flags), (mode))) #define SMB_VFS_OPAQUE_CLOSE(fsp, fd) ((fsp)->conn->vfs_opaque.ops.close_fn((fsp)->conn->vfs_opaque.handles.close_hnd, (fsp), (fd))) #define SMB_VFS_OPAQUE_READ(fsp, fd, data, n) ((fsp)->conn->vfs_opaque.ops.read((fsp)->conn->vfs_opaque.handles.read, (fsp), (fd), (data), (n))) #define SMB_VFS_OPAQUE_PREAD(fsp, fd, data, n, off) ((fsp)->conn->vfs_opaque.ops.pread((fsp)->conn->vfs_opaque.handles.pread, (fsp), (fd), (data), (n), (off))) @@ -167,27 +170,30 @@ #define SMB_VFS_OPAQUE_PWRITE(fsp, fd, data, n, off) ((fsp)->conn->vfs_opaque.ops.pwrite((fsp)->conn->vfs_opaque.handles.pwrite, (fsp), (fd), (data), (n), (off))) #define SMB_VFS_OPAQUE_LSEEK(fsp, fd, offset, whence) ((fsp)->conn->vfs_opaque.ops.lseek((fsp)->conn->vfs_opaque.handles.lseek, (fsp), (fd), (offset), (whence))) #define SMB_VFS_OPAQUE_SENDFILE(tofd, fsp, fromfd, header, offset, count) ((fsp)->conn->vfs_opaque.ops.sendfile((fsp)->conn->vfs_opaque.handles.sendfile, (tofd), (fsp), (fromfd), (header), (offset), (count))) -#define SMB_VFS_OPAQUE_RENAME(conn, old, new) ((conn)->vfs_opaque.ops.rename((conn)->vfs_opaque.handles.rename, (conn), (old), (new))) +#define SMB_VFS_OPAQUE_RENAME(conn, old, new) ((conn)->vfs_opaque.ops.rename((conn)->vfs_opaque.handles.rename, (old), (new))) #define SMB_VFS_OPAQUE_FSYNC(fsp, fd) ((fsp)->conn->vfs_opaque.ops.fsync((fsp)->conn->vfs_opaque.handles.fsync, (fsp), (fd))) -#define SMB_VFS_OPAQUE_STAT(conn, fname, sbuf) ((conn)->vfs_opaque.ops.stat((conn)->vfs_opaque.handles.stat, (conn), (fname), (sbuf))) +#define SMB_VFS_OPAQUE_STAT(conn, fname, sbuf) ((conn)->vfs_opaque.ops.stat((conn)->vfs_opaque.handles.stat, (fname), (sbuf))) #define SMB_VFS_OPAQUE_FSTAT(fsp, fd, sbuf) ((fsp)->conn->vfs_opaque.ops.fstat((fsp)->conn->vfs_opaque.handles.fstat, (fsp) ,(fd) ,(sbuf))) -#define SMB_VFS_OPAQUE_LSTAT(conn, path, sbuf) ((conn)->vfs_opaque.ops.lstat((conn)->vfs_opaque.handles.lstat, (conn), (path), (sbuf))) -#define SMB_VFS_OPAQUE_UNLINK(conn, path) ((conn)->vfs_opaque.ops.unlink((conn)->vfs_opaque.handles.unlink, (conn), (path))) -#define SMB_VFS_OPAQUE_CHMOD(conn, path, mode) ((conn)->vfs_opaque.ops.chmod((conn)->vfs_opaque.handles.chmod, (conn), (path), (mode))) +#define SMB_VFS_OPAQUE_LSTAT(conn, path, sbuf) ((conn)->vfs_opaque.ops.lstat((conn)->vfs_opaque.handles.lstat, (path), (sbuf))) +#define SMB_VFS_OPAQUE_UNLINK(conn, path) ((conn)->vfs_opaque.ops.unlink((conn)->vfs_opaque.handles.unlink, (path))) +#define SMB_VFS_OPAQUE_CHMOD(conn, path, mode) ((conn)->vfs_opaque.ops.chmod((conn)->vfs_opaque.handles.chmod, (path), (mode))) #define SMB_VFS_OPAQUE_FCHMOD(fsp, fd, mode) ((fsp)->conn->vfs_opaque.ops.fchmod((fsp)->conn->vfs_opaque.handles.fchmod, (fsp), (fd), (mode))) -#define SMB_VFS_OPAQUE_CHOWN(conn, path, uid, gid) ((conn)->vfs_opaque.ops.chown((conn)->vfs_opaque.handles.chown, (conn), (path), (uid), (gid))) +#define SMB_VFS_OPAQUE_CHOWN(conn, path, uid, gid) ((conn)->vfs_opaque.ops.chown((conn)->vfs_opaque.handles.chown, (path), (uid), (gid))) #define SMB_VFS_OPAQUE_FCHOWN(fsp, fd, uid, gid) ((fsp)->conn->vfs_opaque.ops.fchown((fsp)->conn->vfs_opaque.handles.fchown, (fsp), (fd), (uid), (gid))) -#define SMB_VFS_OPAQUE_CHDIR(conn, path) ((conn)->vfs_opaque.ops.chdir((conn)->vfs_opaque.handles.chdir, (conn), (path))) -#define SMB_VFS_OPAQUE_GETWD(conn, buf) ((conn)->vfs_opaque.ops.getwd((conn)->vfs_opaque.handles.getwd, (conn), (buf))) -#define SMB_VFS_OPAQUE_UTIME(conn, path, times) ((conn)->vfs_opaque.ops.utime((conn)->vfs_opaque.handles.utime, (conn), (path), (times))) +#define SMB_VFS_OPAQUE_CHDIR(conn, path) ((conn)->vfs_opaque.ops.chdir((conn)->vfs_opaque.handles.chdir, (path))) +#define SMB_VFS_OPAQUE_GETWD(conn, buf) ((conn)->vfs_opaque.ops.getwd((conn)->vfs_opaque.handles.getwd, (buf))) +#define SMB_VFS_OPAQUE_UTIME(conn, path, times) ((conn)->vfs_opaque.ops.utime((conn)->vfs_opaque.handles.utime, (path), (times))) #define SMB_VFS_OPAQUE_FTRUNCATE(fsp, fd, offset) ((fsp)->conn->vfs_opaque.ops.ftruncate((fsp)->conn->vfs_opaque.handles.ftruncate, (fsp), (fd), (offset))) #define SMB_VFS_OPAQUE_LOCK(fsp, fd, op, offset, count, type) ((fsp)->conn->vfs_opaque.ops.lock((fsp)->conn->vfs_opaque.handles.lock, (fsp), (fd) ,(op), (offset), (count), (type))) +#define SMB_VFS_OPAQUE_FLOCK(fsp, fd, share_mode) ((fsp)->conn->vfs_opaque.ops.lock((fsp)->conn->vfs_opaque.handles.kernel_flock, (fsp), (fd), (share_mode))) +#define SMB_VFS_OPAQUE_LINUX_SETLEASE(fsp, fd, leasetype) ((fsp)->conn->vfs_opaque.ops.linux_setlease((fsp)->conn->vfs_opaque.handles.linux_setlease, (fsp), (fd), (leasetype))) #define SMB_VFS_OPAQUE_GETLOCK(fsp, fd, poffset, pcount, ptype, ppid) ((fsp)->conn->vfs_opaque.ops.getlock((fsp)->conn->vfs_opaque.handles.getlock, (fsp), (fd), (poffset), (pcount), (ptype), (ppid))) -#define SMB_VFS_OPAQUE_SYMLINK(conn, oldpath, newpath) ((conn)->vfs_opaque.ops.symlink((conn)->vfs_opaque.handles.symlink, (conn), (oldpath), (newpath))) -#define SMB_VFS_OPAQUE_READLINK(conn, path, buf, bufsiz) ((conn)->vfs_opaque.ops.readlink((conn)->vfs_opaque.handles.readlink, (conn), (path), (buf), (bufsiz))) -#define SMB_VFS_OPAQUE_LINK(conn, oldpath, newpath) ((conn)->vfs_opaque.ops.link((conn)->vfs_opaque.handles.link, (conn), (oldpath), (newpath))) -#define SMB_VFS_OPAQUE_MKNOD(conn, path, mode, dev) ((conn)->vfs_opaque.ops.mknod((conn)->vfs_opaque.handles.mknod, (conn), (path), (mode), (dev))) -#define SMB_VFS_OPAQUE_REALPATH(conn, path, resolved_path) ((conn)->vfs_opaque.ops.realpath((conn)->vfs_opaque.handles.realpath, (conn), (path), (resolved_path))) +#define SMB_VFS_OPAQUE_SYMLINK(conn, oldpath, newpath) ((conn)->vfs_opaque.ops.symlink((conn)->vfs_opaque.handles.symlink, (oldpath), (newpath))) +#define SMB_VFS_OPAQUE_READLINK(conn, path, buf, bufsiz) ((conn)->vfs_opaque.ops.readlink((conn)->vfs_opaque.handles.readlink, (path), (buf), (bufsiz))) +#define SMB_VFS_OPAQUE_LINK(conn, oldpath, newpath) ((conn)->vfs_opaque.ops.link((conn)->vfs_opaque.handles.link, (oldpath), (newpath))) +#define SMB_VFS_OPAQUE_MKNOD(conn, path, mode, dev) ((conn)->vfs_opaque.ops.mknod((conn)->vfs_opaque.handles.mknod, (path), (mode), (dev))) +#define SMB_VFS_OPAQUE_REALPATH(conn, path, resolved_path) ((conn)->vfs_opaque.ops.realpath((conn)->vfs_opaque.handles.realpath, (path), (resolved_path))) +#define SMB_VFS_OPAQUE_NOTIFY_WATCH(conn, ctx, e, callback, private_data, handle_p) ((conn)->vfs_opaque.ops.notify_watch((conn)->vfs_opaque.handles.notify_watch, (ctx), (e), (callback), (private_data), (handle_p))) /* NT ACL operations. */ #define SMB_VFS_OPAQUE_FGET_NT_ACL(fsp, fd, security_info, ppdesc) ((fsp)->conn->vfs_opaque.ops.fget_nt_acl((fsp)->conn->vfs_opaque.handles.fget_nt_acl, (fsp), (fd), (security_info), (ppdesc))) @@ -196,44 +202,44 @@ #define SMB_VFS_OPAQUE_SET_NT_ACL(fsp, name, security_info_sent, psd) ((fsp)->conn->vfs_opaque.ops.set_nt_acl((fsp)->conn->vfs_opaque.handles.set_nt_acl, (fsp), (name), (security_info_sent), (psd))) /* POSIX ACL operations. */ -#define SMB_VFS_OPAQUE_CHMOD_ACL(conn, name, mode) ((conn)->vfs_opaque.ops.chmod_acl((conn)->vfs_opaque.handles.chmod_acl, (conn), (name), (mode))) +#define SMB_VFS_OPAQUE_CHMOD_ACL(conn, name, mode) ((conn)->vfs_opaque.ops.chmod_acl((conn)->vfs_opaque.handles.chmod_acl, (name), (mode))) #define SMB_VFS_OPAQUE_FCHMOD_ACL(fsp, fd, mode) ((fsp)->conn->vfs_opaque.ops.fchmod_acl((fsp)->conn->vfs_opaque.handles.chmod_acl, (fsp), (fd), (mode))) -#define SMB_VFS_OPAQUE_SYS_ACL_GET_ENTRY(conn, theacl, entry_id, entry_p) ((conn)->vfs_opaque.ops.sys_acl_get_entry((conn)->vfs_opaque.handles.sys_acl_get_entry, (conn), (theacl), (entry_id), (entry_p))) -#define SMB_VFS_OPAQUE_SYS_ACL_GET_TAG_TYPE(conn, entry_d, tag_type_p) ((conn)->vfs_opaque.ops.sys_acl_get_tag_type((conn)->vfs_opaque.handles.sys_acl_get_tag_type, (conn), (entry_d), (tag_type_p))) -#define SMB_VFS_OPAQUE_SYS_ACL_GET_PERMSET(conn, entry_d, permset_p) ((conn)->vfs_opaque.ops.sys_acl_get_permset((conn)->vfs_opaque.handles.sys_acl_get_permset, (conn), (entry_d), (permset_p))) -#define SMB_VFS_OPAQUE_SYS_ACL_GET_QUALIFIER(conn, entry_d) ((conn)->vfs_opaque.ops.sys_acl_get_qualifier((conn)->vfs_opaque.handles.sys_acl_get_qualifier, (conn), (entry_d))) -#define SMB_VFS_OPAQUE_SYS_ACL_GET_FILE(conn, path_p, type) ((conn)->vfs_opaque.ops.sys_acl_get_file((conn)->vfs_opaque.handles.sys_acl_get_file, (conn), (path_p), (type))) +#define SMB_VFS_OPAQUE_SYS_ACL_GET_ENTRY(conn, theacl, entry_id, entry_p) ((conn)->vfs_opaque.ops.sys_acl_get_entry((conn)->vfs_opaque.handles.sys_acl_get_entry, (theacl), (entry_id), (entry_p))) +#define SMB_VFS_OPAQUE_SYS_ACL_GET_TAG_TYPE(conn, entry_d, tag_type_p) ((conn)->vfs_opaque.ops.sys_acl_get_tag_type((conn)->vfs_opaque.handles.sys_acl_get_tag_type, (entry_d), (tag_type_p))) +#define SMB_VFS_OPAQUE_SYS_ACL_GET_PERMSET(conn, entry_d, permset_p) ((conn)->vfs_opaque.ops.sys_acl_get_permset((conn)->vfs_opaque.handles.sys_acl_get_permset, (entry_d), (permset_p))) +#define SMB_VFS_OPAQUE_SYS_ACL_GET_QUALIFIER(conn, entry_d) ((conn)->vfs_opaque.ops.sys_acl_get_qualifier((conn)->vfs_opaque.handles.sys_acl_get_qualifier, (entry_d))) +#define SMB_VFS_OPAQUE_SYS_ACL_GET_FILE(conn, path_p, type) ((conn)->vfs_opaque.ops.sys_acl_get_file((conn)->vfs_opaque.handles.sys_acl_get_file, (path_p), (type))) #define SMB_VFS_OPAQUE_SYS_ACL_GET_FD(fsp, fd) ((fsp)->conn->vfs_opaque.ops.sys_acl_get_fd((fsp)->conn->vfs_opaque.handles.sys_acl_get_fd, (fsp), (fd))) -#define SMB_VFS_OPAQUE_SYS_ACL_CLEAR_PERMS(conn, permset) ((conn)->vfs_opaque.ops.sys_acl_clear_perms((conn)->vfs_opaque.handles.sys_acl_clear_perms, (conn), (permset))) -#define SMB_VFS_OPAQUE_SYS_ACL_ADD_PERM(conn, permset, perm) ((conn)->vfs_opaque.ops.sys_acl_add_perm((conn)->vfs_opaque.handles.sys_acl_add_perm, (conn), (permset), (perm))) -#define SMB_VFS_OPAQUE_SYS_ACL_TO_TEXT(conn, theacl, plen) ((conn)->vfs_opaque.ops.sys_acl_to_text((conn)->vfs_opaque.handles.sys_acl_to_text, (conn), (theacl), (plen))) -#define SMB_VFS_OPAQUE_SYS_ACL_INIT(conn, count) ((conn)->vfs_opaque.ops.sys_acl_init((conn)->vfs_opaque.handles.sys_acl_init, (conn), (count))) -#define SMB_VFS_OPAQUE_SYS_ACL_CREATE_ENTRY(conn, pacl, pentry) ((conn)->vfs_opaque.ops.sys_acl_create_entry((conn)->vfs_opaque.handles.sys_acl_create_entry, (conn), (pacl), (pentry))) -#define SMB_VFS_OPAQUE_SYS_ACL_SET_TAG_TYPE(conn, entry, tagtype) ((conn)->vfs_opaque.ops.sys_acl_set_tag_type((conn)->vfs_opaque.handles.sys_acl_set_tag_type, (conn), (entry), (tagtype))) -#define SMB_VFS_OPAQUE_SYS_ACL_SET_QUALIFIER(conn, entry, qual) ((conn)->vfs_opaque.ops.sys_acl_set_qualifier((conn)->vfs_opaque.handles.sys_acl_set_qualifier, (conn), (entry), (qual))) -#define SMB_VFS_OPAQUE_SYS_ACL_SET_PERMSET(conn, entry, permset) ((conn)->vfs_opaque.ops.sys_acl_set_permset((conn)->vfs_opaque.handles.sys_acl_set_permset, (conn), (entry), (permset))) -#define SMB_VFS_OPAQUE_SYS_ACL_VALID(conn, theacl) ((conn)->vfs_opaque.ops.sys_acl_valid((conn)->vfs_opaque.handles.sys_acl_valid, (conn), (theacl))) -#define SMB_VFS_OPAQUE_SYS_ACL_SET_FILE(conn, name, acltype, theacl) ((conn)->vfs_opaque.ops.sys_acl_set_file((conn)->vfs_opaque.handles.sys_acl_set_file, (conn), (name), (acltype), (theacl))) +#define SMB_VFS_OPAQUE_SYS_ACL_CLEAR_PERMS(conn, permset) ((conn)->vfs_opaque.ops.sys_acl_clear_perms((conn)->vfs_opaque.handles.sys_acl_clear_perms, (permset))) +#define SMB_VFS_OPAQUE_SYS_ACL_ADD_PERM(conn, permset, perm) ((conn)->vfs_opaque.ops.sys_acl_add_perm((conn)->vfs_opaque.handles.sys_acl_add_perm, (permset), (perm))) +#define SMB_VFS_OPAQUE_SYS_ACL_TO_TEXT(conn, theacl, plen) ((conn)->vfs_opaque.ops.sys_acl_to_text((conn)->vfs_opaque.handles.sys_acl_to_text, (theacl), (plen))) +#define SMB_VFS_OPAQUE_SYS_ACL_INIT(conn, count) ((conn)->vfs_opaque.ops.sys_acl_init((conn)->vfs_opaque.handles.sys_acl_init, (count))) +#define SMB_VFS_OPAQUE_SYS_ACL_CREATE_ENTRY(conn, pacl, pentry) ((conn)->vfs_opaque.ops.sys_acl_create_entry((conn)->vfs_opaque.handles.sys_acl_create_entry, (pacl), (pentry))) +#define SMB_VFS_OPAQUE_SYS_ACL_SET_TAG_TYPE(conn, entry, tagtype) ((conn)->vfs_opaque.ops.sys_acl_set_tag_type((conn)->vfs_opaque.handles.sys_acl_set_tag_type, (entry), (tagtype))) +#define SMB_VFS_OPAQUE_SYS_ACL_SET_QUALIFIER(conn, entry, qual) ((conn)->vfs_opaque.ops.sys_acl_set_qualifier((conn)->vfs_opaque.handles.sys_acl_set_qualifier, (entry), (qual))) +#define SMB_VFS_OPAQUE_SYS_ACL_SET_PERMSET(conn, entry, permset) ((conn)->vfs_opaque.ops.sys_acl_set_permset((conn)->vfs_opaque.handles.sys_acl_set_permset, (entry), (permset))) +#define SMB_VFS_OPAQUE_SYS_ACL_VALID(conn, theacl) ((conn)->vfs_opaque.ops.sys_acl_valid((conn)->vfs_opaque.handles.sys_acl_valid, (theacl))) +#define SMB_VFS_OPAQUE_SYS_ACL_SET_FILE(conn, name, acltype, theacl) ((conn)->vfs_opaque.ops.sys_acl_set_file((conn)->vfs_opaque.handles.sys_acl_set_file, (name), (acltype), (theacl))) #define SMB_VFS_OPAQUE_SYS_ACL_SET_FD(fsp, fd, theacl) ((fsp)->conn->vfs_opaque.ops.sys_acl_set_fd((fsp)->conn->vfs_opaque.handles.sys_acl_set_fd, (fsp), (fd), (theacl))) -#define SMB_VFS_OPAQUE_SYS_ACL_DELETE_DEF_FILE(conn, path) ((conn)->vfs_opaque.ops.sys_acl_delete_def_file((conn)->vfs_opaque.handles.sys_acl_delete_def_file, (conn), (path))) -#define SMB_VFS_OPAQUE_SYS_ACL_GET_PERM(conn, permset, perm) ((conn)->vfs_opaque.ops.sys_acl_get_perm((conn)->vfs_opaque.handles.sys_acl_get_perm, (conn), (permset), (perm))) -#define SMB_VFS_OPAQUE_SYS_ACL_FREE_TEXT(conn, text) ((conn)->vfs_opaque.ops.sys_acl_free_text((conn)->vfs_opaque.handles.sys_acl_free_text, (conn), (text))) -#define SMB_VFS_OPAQUE_SYS_ACL_FREE_ACL(conn, posix_acl) ((conn)->vfs_opaque.ops.sys_acl_free_acl((conn)->vfs_opaque.handles.sys_acl_free_acl, (conn), (posix_acl))) -#define SMB_VFS_OPAQUE_SYS_ACL_FREE_QUALIFIER(conn, qualifier, tagtype) ((conn)->vfs_opaque.ops.sys_acl_free_qualifier((conn)->vfs_opaque.handles.sys_acl_free_qualifier, (conn), (qualifier), (tagtype))) +#define SMB_VFS_OPAQUE_SYS_ACL_DELETE_DEF_FILE(conn, path) ((conn)->vfs_opaque.ops.sys_acl_delete_def_file((conn)->vfs_opaque.handles.sys_acl_delete_def_file, (path))) +#define SMB_VFS_OPAQUE_SYS_ACL_GET_PERM(conn, permset, perm) ((conn)->vfs_opaque.ops.sys_acl_get_perm((conn)->vfs_opaque.handles.sys_acl_get_perm, (permset), (perm))) +#define SMB_VFS_OPAQUE_SYS_ACL_FREE_TEXT(conn, text) ((conn)->vfs_opaque.ops.sys_acl_free_text((conn)->vfs_opaque.handles.sys_acl_free_text, (text))) +#define SMB_VFS_OPAQUE_SYS_ACL_FREE_ACL(conn, posix_acl) ((conn)->vfs_opaque.ops.sys_acl_free_acl((conn)->vfs_opaque.handles.sys_acl_free_acl, (posix_acl))) +#define SMB_VFS_OPAQUE_SYS_ACL_FREE_QUALIFIER(conn, qualifier, tagtype) ((conn)->vfs_opaque.ops.sys_acl_free_qualifier((conn)->vfs_opaque.handles.sys_acl_free_qualifier, (qualifier), (tagtype))) /* EA operations. */ -#define SMB_VFS_OPAQUE_GETXATTR(conn,path,name,value,size) ((conn)->vfs_opaque.ops.getxattr((conn)->vfs_opaque.handles.getxattr,(conn),(path),(name),(value),(size))) -#define SMB_VFS_OPAQUE_LGETXATTR(conn,path,name,value,size) ((conn)->vfs_opaque.ops.lgetxattr((conn)->vfs_opaque.handles.lgetxattr,(conn),(path),(name),(value),(size))) +#define SMB_VFS_OPAQUE_GETXATTR(conn,path,name,value,size) ((conn)->vfs_opaque.ops.getxattr((conn)->vfs_opaque.handles.getxattr,(path),(name),(value),(size))) +#define SMB_VFS_OPAQUE_LGETXATTR(conn,path,name,value,size) ((conn)->vfs_opaque.ops.lgetxattr((conn)->vfs_opaque.handles.lgetxattr,(path),(name),(value),(size))) #define SMB_VFS_OPAQUE_FGETXATTR(fsp,fd,name,value,size) ((fsp)->conn->vfs_opaque.ops.fgetxattr((fsp)->conn->vfs_opaque.handles.fgetxattr,(fsp),(fd),(name),(value),(size))) -#define SMB_VFS_OPAQUE_LISTXATTR(conn,path,list,size) ((conn)->vfs_opaque.ops.listxattr((conn)->vfs_opaque.handles.listxattr,(conn),(path),(list),(size))) -#define SMB_VFS_OPAQUE_LLISTXATTR(conn,path,list,size) ((conn)->vfs_opaque.ops.llistxattr((conn)->vfs_opaque.handles.llistxattr,(conn),(path),(list),(size))) +#define SMB_VFS_OPAQUE_LISTXATTR(conn,path,list,size) ((conn)->vfs_opaque.ops.listxattr((conn)->vfs_opaque.handles.listxattr,(path),(list),(size))) +#define SMB_VFS_OPAQUE_LLISTXATTR(conn,path,list,size) ((conn)->vfs_opaque.ops.llistxattr((conn)->vfs_opaque.handles.llistxattr,(path),(list),(size))) #define SMB_VFS_OPAQUE_FLISTXATTR(fsp,fd,list,size) ((fsp)->conn->vfs_opaque.ops.flistxattr((fsp)->conn->vfs_opaque.handles.flistxattr,(fsp),(fd),(list),(size))) -#define SMB_VFS_OPAQUE_REMOVEXATTR(conn,path,name) ((conn)->vfs_opaque.ops.removexattr((conn)->vfs_opaque.handles.removexattr,(conn),(path),(name))) -#define SMB_VFS_OPAQUE_LREMOVEXATTR(conn,path,name) ((conn)->vfs_opaque.ops.lremovexattr((conn)->vfs_opaque.handles.lremovexattr,(conn),(path),(name))) +#define SMB_VFS_OPAQUE_REMOVEXATTR(conn,path,name) ((conn)->vfs_opaque.ops.removexattr((conn)->vfs_opaque.handles.removexattr,(path),(name))) +#define SMB_VFS_OPAQUE_LREMOVEXATTR(conn,path,name) ((conn)->vfs_opaque.ops.lremovexattr((conn)->vfs_opaque.handles.lremovexattr,(path),(name))) #define SMB_VFS_OPAQUE_FREMOVEXATTR(fsp,fd,name) ((fsp)->conn->vfs_opaque.ops.fremovexattr((fsp)->conn->vfs_opaque.handles.fremovexattr,(fsp),(fd),(name))) -#define SMB_VFS_OPAQUE_SETXATTR(conn,path,name,value,size,flags) ((conn)->vfs_opaque.ops.setxattr((conn)->vfs_opaque.handles.setxattr,(conn),(path),(name),(value),(size),(flags))) -#define SMB_VFS_OPAQUE_LSETXATTR(conn,path,name,value,size,flags) ((conn)->vfs_opaque.ops.lsetxattr((conn)->vfs_opaque.handles.lsetxattr,(conn),(path),(name),(value),(size),(flags))) +#define SMB_VFS_OPAQUE_SETXATTR(conn,path,name,value,size,flags) ((conn)->vfs_opaque.ops.setxattr((conn)->vfs_opaque.handles.setxattr,(path),(name),(value),(size),(flags))) +#define SMB_VFS_OPAQUE_LSETXATTR(conn,path,name,value,size,flags) ((conn)->vfs_opaque.ops.lsetxattr((conn)->vfs_opaque.handles.lsetxattr,(path),(name),(value),(size),(flags))) #define SMB_VFS_OPAQUE_FSETXATTR(fsp,fd,name,value,size,flags) ((fsp)->conn->vfs_opaque.ops.fsetxattr((fsp)->conn->vfs_opaque.handles.fsetxattr,(fsp),(fd),(name),(value),(size),(flags))) /* AIO operations. */ @@ -252,27 +258,27 @@ ********************************************************************/ /* Disk operations */ -#define SMB_VFS_NEXT_CONNECT(handle, conn, service, user) ((handle)->vfs_next.ops.connect_fn((handle)->vfs_next.handles.connect_hnd, (conn), (service), (user))) -#define SMB_VFS_NEXT_DISCONNECT(handle, conn) ((handle)->vfs_next.ops.disconnect((handle)->vfs_next.handles.disconnect, (conn))) -#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_CONNECT(handle, service, user) ((handle)->vfs_next.ops.connect_fn((handle)->vfs_next.handles.connect_hnd, (service), (user))) +#define SMB_VFS_NEXT_DISCONNECT(handle) ((handle)->vfs_next.ops.disconnect((handle)->vfs_next.handles.disconnect)) +#define SMB_VFS_NEXT_DISK_FREE(handle, path, small_query, bsize, dfree ,dsize) ((handle)->vfs_next.ops.disk_free((handle)->vfs_next.handles.disk_free, (path), (small_query), (bsize), (dfree), (dsize))) +#define SMB_VFS_NEXT_GET_QUOTA(handle, qtype, id, qt) ((handle)->vfs_next.ops.get_quota((handle)->vfs_next.handles.get_quota, (qtype), (id), (qt))) +#define SMB_VFS_NEXT_SET_QUOTA(handle, qtype, id, qt) ((handle)->vfs_next.ops.set_quota((handle)->vfs_next.handles.set_quota, (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))) -#define SMB_VFS_NEXT_STATVFS(handle, conn, path, statbuf) ((handle)->vfs_next.ops.statvfs((handle)->vfs_next.handles.statvfs, (conn), (path), (statbuf))) +#define SMB_VFS_NEXT_STATVFS(handle, path, statbuf) ((handle)->vfs_next.ops.statvfs((handle)->vfs_next.handles.statvfs, (path), (statbuf))) /* Directory operations */ -#define SMB_VFS_NEXT_OPENDIR(handle, conn, fname, mask, attr) ((handle)->vfs_next.ops.opendir((handle)->vfs_next.handles.opendir, (conn), (fname), (mask), (attr))) -#define SMB_VFS_NEXT_READDIR(handle, conn, dirp) ((handle)->vfs_next.ops.readdir((handle)->vfs_next.handles.readdir, (conn), (dirp))) -#define SMB_VFS_NEXT_SEEKDIR(handle, conn, dirp, offset) ((handle)->vfs_next.ops.seekdir((handle)->vfs_next.handles.seekdir, (conn), (dirp), (offset))) -#define SMB_VFS_NEXT_TELLDIR(handle, conn, dirp) ((handle)->vfs_next.ops.telldir((handle)->vfs_next.handles.telldir, (conn), (dirp))) -#define SMB_VFS_NEXT_REWINDDIR(handle, conn, dirp) ((handle)->vfs_next.ops.rewind_dir((handle)->vfs_next.handles.rewind_dir, (conn), (dirp))) -#define SMB_VFS_NEXT_DIR(handle, conn, dirp) ((handle)->vfs_next.ops.readdir((handle)->vfs_next.handles.readdir, (conn), (dirp))) -#define SMB_VFS_NEXT_MKDIR(handle, conn, path, mode) ((handle)->vfs_next.ops.mkdir((handle)->vfs_next.handles.mkdir,(conn), (path), (mode))) -#define SMB_VFS_NEXT_RMDIR(handle, conn, path) ((handle)->vfs_next.ops.rmdir((handle)->vfs_next.handles.rmdir, (conn), (path))) -#define SMB_VFS_NEXT_CLOSEDIR(handle, conn, dir) ((handle)->vfs_next.ops.closedir((handle)->vfs_next.handles.closedir, (conn), dir)) +#define SMB_VFS_NEXT_OPENDIR(handle, fname, mask, attr) ((handle)->vfs_next.ops.opendir((handle)->vfs_next.handles.opendir, (fname), (mask), (attr))) +#define SMB_VFS_NEXT_READDIR(handle, dirp) ((handle)->vfs_next.ops.readdir((handle)->vfs_next.handles.readdir, (dirp))) +#define SMB_VFS_NEXT_SEEKDIR(handle, dirp, offset) ((handle)->vfs_next.ops.seekdir((handle)->vfs_next.handles.seekdir, (dirp), (offset))) +#define SMB_VFS_NEXT_TELLDIR(handle, dirp) ((handle)->vfs_next.ops.telldir((handle)->vfs_next.handles.telldir, (dirp))) +#define SMB_VFS_NEXT_REWINDDIR(handle, dirp) ((handle)->vfs_next.ops.rewind_dir((handle)->vfs_next.handles.rewind_dir, (dirp))) +#define SMB_VFS_NEXT_DIR(handle, dirp) ((handle)->vfs_next.ops.readdir((handle)->vfs_next.handles.readdir, (dirp))) +#define SMB_VFS_NEXT_MKDIR(handle, path, mode) ((handle)->vfs_next.ops.mkdir((handle)->vfs_next.handles.mkdir,(path), (mode))) +#define SMB_VFS_NEXT_RMDIR(handle, path) ((handle)->vfs_next.ops.rmdir((handle)->vfs_next.handles.rmdir, (path))) +#define SMB_VFS_NEXT_CLOSEDIR(handle, dir) ((handle)->vfs_next.ops.closedir((handle)->vfs_next.handles.closedir, dir)) /* File operations */ -#define SMB_VFS_NEXT_OPEN(handle, conn, fname, flags, mode) ((handle)->vfs_next.ops.open((handle)->vfs_next.handles.open, (conn), (fname), (flags), (mode))) +#define SMB_VFS_NEXT_OPEN(handle, fname, fsp, flags, mode) ((handle)->vfs_next.ops.open((handle)->vfs_next.handles.open, (fname), (fsp), (flags), (mode))) #define SMB_VFS_NEXT_CLOSE(handle, fsp, fd) ((handle)->vfs_next.ops.close_fn((handle)->vfs_next.handles.close_hnd, (fsp), (fd))) #define SMB_VFS_NEXT_READ(handle, fsp, fd, data, n) ((handle)->vfs_next.ops.read((handle)->vfs_next.handles.read, (fsp), (fd), (data), (n))) #define SMB_VFS_NEXT_PREAD(handle, fsp, fd, data, n, off) ((handle)->vfs_next.ops.pread((handle)->vfs_next.handles.pread, (fsp), (fd), (data), (n), (off))) @@ -280,27 +286,30 @@ #define SMB_VFS_NEXT_PWRITE(handle, fsp, fd, data, n, off) ((handle)->vfs_next.ops.pwrite((handle)->vfs_next.handles.pwrite, (fsp), (fd), (data), (n), (off))) #define SMB_VFS_NEXT_LSEEK(handle, fsp, fd, offset, whence) ((handle)->vfs_next.ops.lseek((handle)->vfs_next.handles.lseek, (fsp), (fd), (offset), (whence))) #define SMB_VFS_NEXT_SENDFILE(handle, tofd, fsp, fromfd, header, offset, count) ((handle)->vfs_next.ops.sendfile((handle)->vfs_next.handles.sendfile, (tofd), (fsp), (fromfd), (header), (offset), (count))) -#define SMB_VFS_NEXT_RENAME(handle, conn, old, new) ((handle)->vfs_next.ops.rename((handle)->vfs_next.handles.rename, (conn), (old), (new))) +#define SMB_VFS_NEXT_RENAME(handle, old, new) ((handle)->vfs_next.ops.rename((handle)->vfs_next.handles.rename, (old), (new))) #define SMB_VFS_NEXT_FSYNC(handle, fsp, fd) ((handle)->vfs_next.ops.fsync((handle)->vfs_next.handles.fsync, (fsp), (fd))) -#define SMB_VFS_NEXT_STAT(handle, conn, fname, sbuf) ((handle)->vfs_next.ops.stat((handle)->vfs_next.handles.stat, (conn), (fname), (sbuf))) +#define SMB_VFS_NEXT_STAT(handle, fname, sbuf) ((handle)->vfs_next.ops.stat((handle)->vfs_next.handles.stat, (fname), (sbuf))) #define SMB_VFS_NEXT_FSTAT(handle, fsp, fd, sbuf) ((handle)->vfs_next.ops.fstat((handle)->vfs_next.handles.fstat, (fsp) ,(fd) ,(sbuf))) -#define SMB_VFS_NEXT_LSTAT(handle, conn, path, sbuf) ((handle)->vfs_next.ops.lstat((handle)->vfs_next.handles.lstat, (conn), (path), (sbuf))) -#define SMB_VFS_NEXT_UNLINK(handle, conn, path) ((handle)->vfs_next.ops.unlink((handle)->vfs_next.handles.unlink, (conn), (path))) -#define SMB_VFS_NEXT_CHMOD(handle, conn, path, mode) ((handle)->vfs_next.ops.chmod((handle)->vfs_next.handles.chmod, (conn), (path), (mode))) +#define SMB_VFS_NEXT_LSTAT(handle, path, sbuf) ((handle)->vfs_next.ops.lstat((handle)->vfs_next.handles.lstat, (path), (sbuf))) +#define SMB_VFS_NEXT_UNLINK(handle, path) ((handle)->vfs_next.ops.unlink((handle)->vfs_next.handles.unlink, (path))) +#define SMB_VFS_NEXT_CHMOD(handle, path, mode) ((handle)->vfs_next.ops.chmod((handle)->vfs_next.handles.chmod, (path), (mode))) #define SMB_VFS_NEXT_FCHMOD(handle, fsp, fd, mode) ((handle)->vfs_next.ops.fchmod((handle)->vfs_next.handles.fchmod, (fsp), (fd), (mode))) -#define SMB_VFS_NEXT_CHOWN(handle, conn, path, uid, gid) ((handle)->vfs_next.ops.chown((handle)->vfs_next.handles.chown, (conn), (path), (uid), (gid))) +#define SMB_VFS_NEXT_CHOWN(handle, path, uid, gid) ((handle)->vfs_next.ops.chown((handle)->vfs_next.handles.chown, (path), (uid), (gid))) #define SMB_VFS_NEXT_FCHOWN(handle, fsp, fd, uid, gid) ((handle)->vfs_next.ops.fchown((handle)->vfs_next.handles.fchown, (fsp), (fd), (uid), (gid))) -#define SMB_VFS_NEXT_CHDIR(handle, conn, path) ((handle)->vfs_next.ops.chdir((handle)->vfs_next.handles.chdir, (conn), (path))) -#define SMB_VFS_NEXT_GETWD(handle, conn, buf) ((handle)->vfs_next.ops.getwd((handle)->vfs_next.handles.getwd, (conn), (buf))) -#define SMB_VFS_NEXT_UTIME(handle, conn, path, times) ((handle)->vfs_next.ops.utime((handle)->vfs_next.handles.utime, (conn), (path), (times))) +#define SMB_VFS_NEXT_CHDIR(handle, path) ((handle)->vfs_next.ops.chdir((handle)->vfs_next.handles.chdir, (path))) +#define SMB_VFS_NEXT_GETWD(handle, buf) ((handle)->vfs_next.ops.getwd((handle)->vfs_next.handles.getwd, (buf))) +#define SMB_VFS_NEXT_UTIME(handle, path, times) ((handle)->vfs_next.ops.utime((handle)->vfs_next.handles.utime, (path), (times))) #define SMB_VFS_NEXT_FTRUNCATE(handle, fsp, fd, offset) ((handle)->vfs_next.ops.ftruncate((handle)->vfs_next.handles.ftruncate, (fsp), (fd), (offset))) #define SMB_VFS_NEXT_LOCK(handle, fsp, fd, op, offset, count, type) ((handle)->vfs_next.ops.lock((handle)->vfs_next.handles.lock, (fsp), (fd) ,(op), (offset), (count), (type))) +#define SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, fd, share_mode)((handle)->vfs_next.ops.kernel_flock((handle)->vfs_next.handles.kernel_flock, (fsp), (fd), (share_mode))) +#define SMB_VFS_NEXT_LINUX_SETLEASE(handle, fsp, fd, leasetype)((handle)->vfs_next.ops.linux_setlease((handle)->vfs_next.handles.linux_setlease, (fsp), (fd), (leasetype))) #define SMB_VFS_NEXT_GETLOCK(handle, fsp, fd, poffset, pcount, ptype, ppid) ((handle)->vfs_next.ops.getlock((handle)->vfs_next.handles.getlock, (fsp), (fd), (poffset), (pcount), (ptype), (ppid))) -#define SMB_VFS_NEXT_SYMLINK(handle, conn, oldpath, newpath) ((handle)->vfs_next.ops.symlink((handle)->vfs_next.handles.symlink, (conn), (oldpath), (newpath))) -#define SMB_VFS_NEXT_READLINK(handle, conn, path, buf, bufsiz) ((handle)->vfs_next.ops.readlink((handle)->vfs_next.handles.readlink, (conn), (path), (buf), (bufsiz))) -#define SMB_VFS_NEXT_LINK(handle, conn, oldpath, newpath) ((handle)->vfs_next.ops.link((handle)->vfs_next.handles.link, (conn), (oldpath), (newpath))) -#define SMB_VFS_NEXT_MKNOD(handle, conn, path, mode, dev) ((handle)->vfs_next.ops.mknod((handle)->vfs_next.handles.mknod, (conn), (path), (mode), (dev))) -#define SMB_VFS_NEXT_REALPATH(handle, conn, path, resolved_path) ((handle)->vfs_next.ops.realpath((handle)->vfs_next.handles.realpath, (conn), (path), (resolved_path))) +#define SMB_VFS_NEXT_SYMLINK(handle, oldpath, newpath) ((handle)->vfs_next.ops.symlink((handle)->vfs_next.handles.symlink, (oldpath), (newpath))) +#define SMB_VFS_NEXT_READLINK(handle, path, buf, bufsiz) ((handle)->vfs_next.ops.readlink((handle)->vfs_next.handles.readlink, (path), (buf), (bufsiz))) +#define SMB_VFS_NEXT_LINK(handle, oldpath, newpath) ((handle)->vfs_next.ops.link((handle)->vfs_next.handles.link, (oldpath), (newpath))) +#define SMB_VFS_NEXT_MKNOD(handle, path, mode, dev) ((handle)->vfs_next.ops.mknod((handle)->vfs_next.handles.mknod, (path), (mode), (dev))) +#define SMB_VFS_NEXT_REALPATH(handle, path, resolved_path) ((handle)->vfs_next.ops.realpath((handle)->vfs_next.handles.realpath, (path), (resolved_path))) +#define SMB_VFS_NEXT_NOTIFY_WATCH(conn, ctx, e, callback, private_data, handle_p) ((conn)->vfs_next.ops.notify_watch((conn)->vfs_next.handles.notify_watch, (ctx), (e), (callback), (private_data), (handle_p))) /* NT ACL operations. */ #define SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, fd, security_info, ppdesc) ((handle)->vfs_next.ops.fget_nt_acl((handle)->vfs_next.handles.fget_nt_acl, (fsp), (fd), (security_info), (ppdesc))) @@ -309,44 +318,44 @@ #define SMB_VFS_NEXT_SET_NT_ACL(handle, fsp, name, security_info_sent, psd) ((handle)->vfs_next.ops.set_nt_acl((handle)->vfs_next.handles.set_nt_acl, (fsp), (name), (security_info_sent), (psd))) /* POSIX ACL operations. */ -#define SMB_VFS_NEXT_CHMOD_ACL(handle, conn, name, mode) ((handle)->vfs_next.ops.chmod_acl((handle)->vfs_next.handles.chmod_acl, (conn), (name), (mode))) +#define SMB_VFS_NEXT_CHMOD_ACL(handle, name, mode) ((handle)->vfs_next.ops.chmod_acl((handle)->vfs_next.handles.chmod_acl, (name), (mode))) #define SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, fd, mode) ((handle)->vfs_next.ops.fchmod_acl((handle)->vfs_next.handles.chmod_acl, (fsp), (fd), (mode))) -#define SMB_VFS_NEXT_SYS_ACL_GET_ENTRY(handle, conn, theacl, entry_id, entry_p) ((handle)->vfs_next.ops.sys_acl_get_entry((handle)->vfs_next.handles.sys_acl_get_entry, (conn), (theacl), (entry_id), (entry_p))) -#define SMB_VFS_NEXT_SYS_ACL_GET_TAG_TYPE(handle, conn, entry_d, tag_type_p) ((handle)->vfs_next.ops.sys_acl_get_tag_type((handle)->vfs_next.handles.sys_acl_get_tag_type, (conn), (entry_d), (tag_type_p))) -#define SMB_VFS_NEXT_SYS_ACL_GET_PERMSET(handle, conn, entry_d, permset_p) ((handle)->vfs_next.ops.sys_acl_get_permset((handle)->vfs_next.handles.sys_acl_get_permset, (conn), (entry_d), (permset_p))) -#define SMB_VFS_NEXT_SYS_ACL_GET_QUALIFIER(handle, conn, entry_d) ((handle)->vfs_next.ops.sys_acl_get_qualifier((handle)->vfs_next.handles.sys_acl_get_qualifier, (conn), (entry_d))) -#define SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, conn, path_p, type) ((handle)->vfs_next.ops.sys_acl_get_file((handle)->vfs_next.handles.sys_acl_get_file, (conn), (path_p), (type))) +#define SMB_VFS_NEXT_SYS_ACL_GET_ENTRY(handle, theacl, entry_id, entry_p) ((handle)->vfs_next.ops.sys_acl_get_entry((handle)->vfs_next.handles.sys_acl_get_entry, (theacl), (entry_id), (entry_p))) +#define SMB_VFS_NEXT_SYS_ACL_GET_TAG_TYPE(handle, entry_d, tag_type_p) ((handle)->vfs_next.ops.sys_acl_get_tag_type((handle)->vfs_next.handles.sys_acl_get_tag_type, (entry_d), (tag_type_p))) +#define SMB_VFS_NEXT_SYS_ACL_GET_PERMSET(handle, entry_d, permset_p) ((handle)->vfs_next.ops.sys_acl_get_permset((handle)->vfs_next.handles.sys_acl_get_permset, (entry_d), (permset_p))) +#define SMB_VFS_NEXT_SYS_ACL_GET_QUALIFIER(handle, entry_d) ((handle)->vfs_next.ops.sys_acl_get_qualifier((handle)->vfs_next.handles.sys_acl_get_qualifier, (entry_d))) +#define SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, path_p, type) ((handle)->vfs_next.ops.sys_acl_get_file((handle)->vfs_next.handles.sys_acl_get_file, (path_p), (type))) #define SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp, fd) ((handle)->vfs_next.ops.sys_acl_get_fd((handle)->vfs_next.handles.sys_acl_get_fd, (fsp), (fd))) -#define SMB_VFS_NEXT_SYS_ACL_CLEAR_PERMS(handle, conn, permset) ((handle)->vfs_next.ops.sys_acl_clear_perms((handle)->vfs_next.handles.sys_acl_clear_perms, (conn), (permset))) -#define SMB_VFS_NEXT_SYS_ACL_ADD_PERM(handle, conn, permset, perm) ((handle)->vfs_next.ops.sys_acl_add_perm((handle)->vfs_next.handles.sys_acl_add_perm, (conn), (permset), (perm))) -#define SMB_VFS_NEXT_SYS_ACL_TO_TEXT(handle, conn, theacl, plen) ((handle)->vfs_next.ops.sys_acl_to_text((handle)->vfs_next.handles.sys_acl_to_text, (conn), (theacl), (plen))) -#define SMB_VFS_NEXT_SYS_ACL_INIT(handle, conn, count) ((handle)->vfs_next.ops.sys_acl_init((handle)->vfs_next.handles.sys_acl_init, (conn), (count))) -#define SMB_VFS_NEXT_SYS_ACL_CREATE_ENTRY(handle, conn, pacl, pentry) ((handle)->vfs_next.ops.sys_acl_create_entry((handle)->vfs_next.handles.sys_acl_create_entry, (conn), (pacl), (pentry))) -#define SMB_VFS_NEXT_SYS_ACL_SET_TAG_TYPE(handle, conn, entry, tagtype) ((handle)->vfs_next.ops.sys_acl_set_tag_type((handle)->vfs_next.handles.sys_acl_set_tag_type, (conn), (entry), (tagtype))) -#define SMB_VFS_NEXT_SYS_ACL_SET_QUALIFIER(handle, conn, entry, qual) ((handle)->vfs_next.ops.sys_acl_set_qualifier((handle)->vfs_next.handles.sys_acl_set_qualifier, (conn), (entry), (qual))) -#define SMB_VFS_NEXT_SYS_ACL_SET_PERMSET(handle, conn, entry, permset) ((handle)->vfs_next.ops.sys_acl_set_permset((handle)->vfs_next.handles.sys_acl_set_permset, (conn), (entry), (permset))) -#define SMB_VFS_NEXT_SYS_ACL_VALID(handle, conn, theacl) ((handle)->vfs_next.ops.sys_acl_valid((handle)->vfs_next.handles.sys_acl_valid, (conn), (theacl))) -#define SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, conn, name, acltype, theacl) ((handle)->vfs_next.ops.sys_acl_set_file((handle)->vfs_next.handles.sys_acl_set_file, (conn), (name), (acltype), (theacl))) +#define SMB_VFS_NEXT_SYS_ACL_CLEAR_PERMS(handle, permset) ((handle)->vfs_next.ops.sys_acl_clear_perms((handle)->vfs_next.handles.sys_acl_clear_perms, (permset))) +#define SMB_VFS_NEXT_SYS_ACL_ADD_PERM(handle, permset, perm) ((handle)->vfs_next.ops.sys_acl_add_perm((handle)->vfs_next.handles.sys_acl_add_perm, (permset), (perm))) +#define SMB_VFS_NEXT_SYS_ACL_TO_TEXT(handle, theacl, plen) ((handle)->vfs_next.ops.sys_acl_to_text((handle)->vfs_next.handles.sys_acl_to_text, (theacl), (plen))) +#define SMB_VFS_NEXT_SYS_ACL_INIT(handle, count) ((handle)->vfs_next.ops.sys_acl_init((handle)->vfs_next.handles.sys_acl_init, (count))) +#define SMB_VFS_NEXT_SYS_ACL_CREATE_ENTRY(handle, pacl, pentry) ((handle)->vfs_next.ops.sys_acl_create_entry((handle)->vfs_next.handles.sys_acl_create_entry, (pacl), (pentry))) +#define SMB_VFS_NEXT_SYS_ACL_SET_TAG_TYPE(handle, entry, tagtype) ((handle)->vfs_next.ops.sys_acl_set_tag_type((handle)->vfs_next.handles.sys_acl_set_tag_type, (entry), (tagtype))) +#define SMB_VFS_NEXT_SYS_ACL_SET_QUALIFIER(handle, entry, qual) ((handle)->vfs_next.ops.sys_acl_set_qualifier((handle)->vfs_next.handles.sys_acl_set_qualifier, (entry), (qual))) +#define SMB_VFS_NEXT_SYS_ACL_SET_PERMSET(handle, entry, permset) ((handle)->vfs_next.ops.sys_acl_set_permset((handle)->vfs_next.handles.sys_acl_set_permset, (entry), (permset))) +#define SMB_VFS_NEXT_SYS_ACL_VALID(handle, theacl) ((handle)->vfs_next.ops.sys_acl_valid((handle)->vfs_next.handles.sys_acl_valid, (theacl))) +#define SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, name, acltype, theacl) ((handle)->vfs_next.ops.sys_acl_set_file((handle)->vfs_next.handles.sys_acl_set_file, (name), (acltype), (theacl))) #define SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, fd, theacl) ((handle)->vfs_next.ops.sys_acl_set_fd((handle)->vfs_next.handles.sys_acl_set_fd, (fsp), (fd), (theacl))) -#define SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, conn, path) ((handle)->vfs_next.ops.sys_acl_delete_def_file((handle)->vfs_next.handles.sys_acl_delete_def_file, (conn), (path))) -#define SMB_VFS_NEXT_SYS_ACL_GET_PERM(handle, conn, permset, perm) ((handle)->vfs_next.ops.sys_acl_get_perm((handle)->vfs_next.handles.sys_acl_get_perm, (conn), (permset), (perm))) -#define SMB_VFS_NEXT_SYS_ACL_FREE_TEXT(handle, conn, text) ((handle)->vfs_next.ops.sys_acl_free_text((handle)->vfs_next.handles.sys_acl_free_text, (conn), (text))) -#define SMB_VFS_NEXT_SYS_ACL_FREE_ACL(handle, conn, posix_acl) ((handle)->vfs_next.ops.sys_acl_free_acl((handle)->vfs_next.handles.sys_acl_free_acl, (conn), (posix_acl))) -#define SMB_VFS_NEXT_SYS_ACL_FREE_QUALIFIER(handle, conn, qualifier, tagtype) ((handle)->vfs_next.ops.sys_acl_free_qualifier((handle)->vfs_next.handles.sys_acl_free_qualifier, (conn), (qualifier), (tagtype))) +#define SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, path) ((handle)->vfs_next.ops.sys_acl_delete_def_file((handle)->vfs_next.handles.sys_acl_delete_def_file, (path))) +#define SMB_VFS_NEXT_SYS_ACL_GET_PERM(handle, permset, perm) ((handle)->vfs_next.ops.sys_acl_get_perm((handle)->vfs_next.handles.sys_acl_get_perm, (permset), (perm))) +#define SMB_VFS_NEXT_SYS_ACL_FREE_TEXT(handle, text) ((handle)->vfs_next.ops.sys_acl_free_text((handle)->vfs_next.handles.sys_acl_free_text, (text))) +#define SMB_VFS_NEXT_SYS_ACL_FREE_ACL(handle, posix_acl) ((handle)->vfs_next.ops.sys_acl_free_acl((handle)->vfs_next.handles.sys_acl_free_acl, (posix_acl))) +#define SMB_VFS_NEXT_SYS_ACL_FREE_QUALIFIER(handle, qualifier, tagtype) ((handle)->vfs_next.ops.sys_acl_free_qualifier((handle)->vfs_next.handles.sys_acl_free_qualifier, (qualifier), (tagtype))) /* EA operations. */ -#define SMB_VFS_NEXT_GETXATTR(handle,conn,path,name,value,size) ((handle)->vfs_next.ops.getxattr((handle)->vfs_next.handles.getxattr,(conn),(path),(name),(value),(size))) -#define SMB_VFS_NEXT_LGETXATTR(handle,conn,path,name,value,size) ((handle)->vfs_next.ops.lgetxattr((handle)->vfs_next.handles.lgetxattr,(conn),(path),(name),(value),(size))) +#define SMB_VFS_NEXT_GETXATTR(handle,path,name,value,size) ((handle)->vfs_next.ops.getxattr((handle)->vfs_next.handles.getxattr,(path),(name),(value),(size))) +#define SMB_VFS_NEXT_LGETXATTR(handle,path,name,value,size) ((handle)->vfs_next.ops.lgetxattr((handle)->vfs_next.handles.lgetxattr,(path),(name),(value),(size))) #define SMB_VFS_NEXT_FGETXATTR(handle,fsp,fd,name,value,size) ((handle)->vfs_next.ops.fgetxattr((handle)->vfs_next.handles.fgetxattr,(fsp),(fd),(name),(value),(size))) -#define SMB_VFS_NEXT_LISTXATTR(handle,conn,path,list,size) ((handle)->vfs_next.ops.listxattr((handle)->vfs_next.handles.listxattr,(conn),(path),(list),(size))) -#define SMB_VFS_NEXT_LLISTXATTR(handle,conn,path,list,size) ((handle)->vfs_next.ops.llistxattr((handle)->vfs_next.handles.llistxattr,(conn),(path),(list),(size))) +#define SMB_VFS_NEXT_LISTXATTR(handle,path,list,size) ((handle)->vfs_next.ops.listxattr((handle)->vfs_next.handles.listxattr,(path),(list),(size))) +#define SMB_VFS_NEXT_LLISTXATTR(handle,path,list,size) ((handle)->vfs_next.ops.llistxattr((handle)->vfs_next.handles.llistxattr,(path),(list),(size))) #define SMB_VFS_NEXT_FLISTXATTR(handle,fsp,fd,list,size) ((handle)->vfs_next.ops.flistxattr((handle)->vfs_next.handles.flistxattr,(fsp),(fd),(list),(size))) -#define SMB_VFS_NEXT_REMOVEXATTR(handle,conn,path,name) ((handle)->vfs_next.ops.removexattr((handle)->vfs_next.handles.removexattr,(conn),(path),(name))) -#define SMB_VFS_NEXT_LREMOVEXATTR(handle,conn,path,name) ((handle)->vfs_next.ops.lremovexattr((handle)->vfs_next.handles.lremovexattr,(conn),(path),(name))) +#define SMB_VFS_NEXT_REMOVEXATTR(handle,path,name) ((handle)->vfs_next.ops.removexattr((handle)->vfs_next.handles.removexattr,(path),(name))) +#define SMB_VFS_NEXT_LREMOVEXATTR(handle,path,name) ((handle)->vfs_next.ops.lremovexattr((handle)->vfs_next.handles.lremovexattr,(path),(name))) #define SMB_VFS_NEXT_FREMOVEXATTR(handle,fsp,fd,name) ((handle)->vfs_next.ops.fremovexattr((handle)->vfs_next.handles.fremovexattr,(fsp),(fd),(name))) -#define SMB_VFS_NEXT_SETXATTR(handle,conn,path,name,value,size,flags) ((handle)->vfs_next.ops.setxattr((handle)->vfs_next.handles.setxattr,(conn),(path),(name),(value),(size),(flags))) -#define SMB_VFS_NEXT_LSETXATTR(handle,conn,path,name,value,size,flags) ((handle)->vfs_next.ops.lsetxattr((handle)->vfs_next.handles.lsetxattr,(conn),(path),(name),(value),(size),(flags))) +#define SMB_VFS_NEXT_SETXATTR(handle,path,name,value,size,flags) ((handle)->vfs_next.ops.setxattr((handle)->vfs_next.handles.setxattr,(path),(name),(value),(size),(flags))) +#define SMB_VFS_NEXT_LSETXATTR(handle,path,name,value,size,flags) ((handle)->vfs_next.ops.lsetxattr((handle)->vfs_next.handles.lsetxattr,(path),(name),(value),(size),(flags))) #define SMB_VFS_NEXT_FSETXATTR(handle,fsp,fd,name,value,size,flags) ((handle)->vfs_next.ops.fsetxattr((handle)->vfs_next.handles.fsetxattr,(fsp),(fd),(name),(value),(size),(flags))) /* AIO operations. */ |