diff options
author | Simo Sorce <idra@samba.org> | 2008-02-01 14:24:31 -0500 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2008-02-01 14:24:31 -0500 |
commit | 2fffc9a1b1fe2a1490e867bb38462e50c282d2b3 (patch) | |
tree | 428e09c9b35138db8b7ca7161c659a71aa129d29 /source3/include | |
parent | 93a3c5b3f9927973b4ad1496f593ea147052d1e1 (diff) | |
parent | b708005a7106db26d7df689b887b419c9f2ea41c (diff) | |
download | samba-2fffc9a1b1fe2a1490e867bb38462e50c282d2b3.tar.gz samba-2fffc9a1b1fe2a1490e867bb38462e50c282d2b3.tar.bz2 samba-2fffc9a1b1fe2a1490e867bb38462e50c282d2b3.zip |
Merge branch 'v3-2-test' of ssh://git.samba.org/data/git/samba into v3-2-test
(This used to be commit 7dbfc7bdc65314466a83e8121b35c9bcb24b2631)
Diffstat (limited to 'source3/include')
28 files changed, 605 insertions, 1043 deletions
diff --git a/source3/include/ads.h b/source3/include/ads.h index a75eaf80fc..d1047bbdc2 100644 --- a/source3/include/ads.h +++ b/source3/include/ads.h @@ -396,4 +396,11 @@ typedef struct { #define ADS_IGNORE_PRINCIPAL "not_defined_in_RFC4178@please_ignore" +/* Settings for the domainFunctionality attribute in the rootDSE */ + +#define DS_DOMAIN_FUNCTION_2000 0 +#define DS_DOMAIN_FUCNTION_2003_MIXED 1 +#define DS_DOMAIN_FUNCTION_2003 2 +#define DS_DOMAIN_FUNCTION_2008 3 + #endif /* _INCLUDE_ADS_H_ */ diff --git a/source3/include/ads_protos.h b/source3/include/ads_protos.h index 0292d91f4f..738df3ed40 100644 --- a/source3/include/ads_protos.h +++ b/source3/include/ads_protos.h @@ -114,3 +114,7 @@ ADS_STATUS ads_get_tokensids(ADS_STRUCT *ads, DOM_SID *primary_group_sid, DOM_SID **sids, size_t *num_sids); +ADS_STATUS ads_get_joinable_ous(ADS_STRUCT *ads, + TALLOC_CTX *mem_ctx, + char ***ous, + size_t *num_ous); diff --git a/source3/include/client.h b/source3/include/client.h index 0047b2bf23..f8adf567de 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -27,7 +27,9 @@ will be a multiple of the page size on almost any system */ #define CLI_BUFFER_SIZE (0xFFFF) #define CLI_SAMBA_MAX_LARGE_READX_SIZE (127*1024) /* Works for Samba servers */ +#define CLI_SAMBA_MAX_LARGE_WRITEX_SIZE (127*1024) /* Works for Samba servers */ #define CLI_WINDOWS_MAX_LARGE_READX_SIZE ((64*1024)-2) /* Windows servers are broken.... */ +#define CLI_WINDOWS_MAX_LARGE_WRITEX_SIZE ((64*1024)-2) /* Windows servers are broken.... */ #define CLI_SAMBA_MAX_POSIX_LARGE_READX_SIZE (0xFFFF00) /* 24-bit len. */ #define CLI_SAMBA_MAX_POSIX_LARGE_WRITEX_SIZE (0xFFFF00) /* 24-bit len. */ @@ -79,6 +81,28 @@ struct rpc_pipe_client { struct dcinfo *dc; }; +/* Transport encryption state. */ +enum smb_trans_enc_type { SMB_TRANS_ENC_NTLM, SMB_TRANS_ENC_GSS }; + +#if defined(HAVE_GSSAPI) && defined(HAVE_KRB5) +struct smb_tran_enc_state_gss { + gss_ctx_id_t gss_ctx; + gss_cred_id_t creds; +}; +#endif + +struct smb_trans_enc_state { + enum smb_trans_enc_type smb_enc_type; + uint16 enc_ctx_num; + bool enc_on; + union { + NTLMSSP_STATE *ntlmssp_state; +#if defined(HAVE_GSSAPI) && defined(HAVE_KRB5) + struct smb_tran_enc_state_gss *gss_state; +#endif + } s; +}; + struct cli_state { int port; int fd; @@ -142,6 +166,8 @@ struct cli_state { smb_sign_info sign_info; + struct smb_trans_enc_state *trans_enc_state; /* Setup if we're encrypting SMB's. */ + /* the session key for this CLI, outside any per-pipe authenticaion */ DATA_BLOB user_session_key; diff --git a/source3/include/ctdbd_conn.h b/source3/include/ctdbd_conn.h index 425cc65a00..6e1b2f737a 100644 --- a/source3/include/ctdbd_conn.h +++ b/source3/include/ctdbd_conn.h @@ -17,6 +17,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#ifndef _CTDBD_CONN_H +#define _CTDBD_CONN_H + struct ctdbd_connection; NTSTATUS ctdbd_init_connection(TALLOC_CTX *mem_ctx, @@ -62,3 +65,6 @@ NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn, NTSTATUS ctdbd_register_reconfigure(struct ctdbd_connection *conn); +NTSTATUS ctdbd_persistent_store(struct ctdbd_connection *conn, uint32_t db_id, TDB_DATA key, TDB_DATA data); + +#endif /* _CTDBD_CONN_H */ diff --git a/source3/include/dbwrap.h b/source3/include/dbwrap.h index 3bb378c841..4eb174fef1 100644 --- a/source3/include/dbwrap.h +++ b/source3/include/dbwrap.h @@ -43,6 +43,7 @@ struct db_context { void *private_data); int (*get_seqnum)(struct db_context *db); void *private_data; + bool persistent; }; struct db_context *db_open(TALLOC_CTX *mem_ctx, diff --git a/source3/include/debug.h b/source3/include/debug.h index 46e5620cc7..d8dafcbd45 100644 --- a/source3/include/debug.h +++ b/source3/include/debug.h @@ -161,17 +161,35 @@ extern bool *DEBUGLEVEL_CLASS_ISSET; * will remove the extra conditional test. */ -#define DEBUGLVL( level ) \ +/* + * From talloc.c: + */ + +/* these macros gain us a few percent of speed on gcc */ +#if (__GNUC__ >= 3) +/* the strange !! is to ensure that __builtin_expect() takes either 0 or 1 + as its first argument */ +#define likely(x) __builtin_expect(!!(x), 1) +#define unlikely(x) __builtin_expect(!!(x), 0) +#else +#define likely(x) (x) +#define unlikely(x) (x) +#endif + +#define CHECK_DEBUGLVL( level ) \ ( ((level) <= MAX_DEBUG_LEVEL) && \ - ((DEBUGLEVEL_CLASS[ DBGC_CLASS ] >= (level))|| \ + unlikely((DEBUGLEVEL_CLASS[ DBGC_CLASS ] >= (level))|| \ (!DEBUGLEVEL_CLASS_ISSET[ DBGC_CLASS ] && \ - DEBUGLEVEL_CLASS[ DBGC_ALL ] >= (level)) ) \ + DEBUGLEVEL_CLASS[ DBGC_ALL ] >= (level)) ) ) + +#define DEBUGLVL( level ) \ + ( CHECK_DEBUGLVL(level) \ && dbghdr( level, DBGC_CLASS, __FILE__, FUNCTION_MACRO, (__LINE__) ) ) #define DEBUGLVLC( dbgc_class, level ) \ ( ((level) <= MAX_DEBUG_LEVEL) && \ - ((DEBUGLEVEL_CLASS[ dbgc_class ] >= (level))|| \ + unlikely((DEBUGLEVEL_CLASS[ dbgc_class ] >= (level))|| \ (!DEBUGLEVEL_CLASS_ISSET[ dbgc_class ] && \ DEBUGLEVEL_CLASS[ DBGC_ALL ] >= (level)) ) \ && dbghdr( level, DBGC_CLASS, __FILE__, FUNCTION_MACRO, (__LINE__) ) ) @@ -179,7 +197,7 @@ extern bool *DEBUGLEVEL_CLASS_ISSET; #define DEBUG( level, body ) \ (void)( ((level) <= MAX_DEBUG_LEVEL) && \ - ((DEBUGLEVEL_CLASS[ DBGC_CLASS ] >= (level))|| \ + unlikely((DEBUGLEVEL_CLASS[ DBGC_CLASS ] >= (level))|| \ (!DEBUGLEVEL_CLASS_ISSET[ DBGC_CLASS ] && \ DEBUGLEVEL_CLASS[ DBGC_ALL ] >= (level)) ) \ && (dbghdr( level, DBGC_CLASS, __FILE__, FUNCTION_MACRO, (__LINE__) )) \ @@ -187,7 +205,7 @@ extern bool *DEBUGLEVEL_CLASS_ISSET; #define DEBUGC( dbgc_class, level, body ) \ (void)( ((level) <= MAX_DEBUG_LEVEL) && \ - ((DEBUGLEVEL_CLASS[ dbgc_class ] >= (level))|| \ + unlikely((DEBUGLEVEL_CLASS[ dbgc_class ] >= (level))|| \ (!DEBUGLEVEL_CLASS_ISSET[ dbgc_class ] && \ DEBUGLEVEL_CLASS[ DBGC_ALL ] >= (level)) ) \ && (dbghdr( level, DBGC_CLASS, __FILE__, FUNCTION_MACRO, (__LINE__) )) \ @@ -195,14 +213,14 @@ extern bool *DEBUGLEVEL_CLASS_ISSET; #define DEBUGADD( level, body ) \ (void)( ((level) <= MAX_DEBUG_LEVEL) && \ - ((DEBUGLEVEL_CLASS[ DBGC_CLASS ] >= (level))|| \ + unlikely((DEBUGLEVEL_CLASS[ DBGC_CLASS ] >= (level))|| \ (!DEBUGLEVEL_CLASS_ISSET[ DBGC_CLASS ] && \ DEBUGLEVEL_CLASS[ DBGC_ALL ] >= (level)) ) \ && (dbgtext body) ) #define DEBUGADDC( dbgc_class, level, body ) \ (void)( ((level) <= MAX_DEBUG_LEVEL) && \ - ((DEBUGLEVEL_CLASS[ dbgc_class ] >= (level))|| \ + unlikely((DEBUGLEVEL_CLASS[ dbgc_class ] >= (level))|| \ (!DEBUGLEVEL_CLASS_ISSET[ dbgc_class ] && \ DEBUGLEVEL_CLASS[ DBGC_ALL ] >= (level)) ) \ && (dbgtext body) ) diff --git a/source3/include/doserr.h b/source3/include/doserr.h index a22eda2ab7..5794fbe71c 100644 --- a/source3/include/doserr.h +++ b/source3/include/doserr.h @@ -202,8 +202,10 @@ #define WERR_SERVICE_ALREADY_RUNNING W_ERROR(1056) #define WERR_SERVICE_DISABLED W_ERROR(1058) #define WERR_SERVICE_NEVER_STARTED W_ERROR(1077) +#define WERR_INVALID_COMPUTER_NAME W_ERROR(1210) #define WERR_MACHINE_LOCKED W_ERROR(1271) #define WERR_NO_LOGON_SERVERS W_ERROR(1311) +#define WERR_NO_SUCH_LOGON_SESSION W_ERROR(1312) #define WERR_LOGON_FAILURE W_ERROR(1326) #define WERR_NO_SUCH_DOMAIN W_ERROR(1355) #define WERR_INVALID_SECURITY_DESCRIPTOR W_ERROR(1338) @@ -212,15 +214,22 @@ #define WERR_SERVER_UNAVAILABLE W_ERROR(1722) #define WERR_INVALID_FORM_NAME W_ERROR(1902) #define WERR_INVALID_FORM_SIZE W_ERROR(1903) +#define WERR_PASSWORD_MUST_CHANGE W_ERROR(1907) +#define WERR_DOMAIN_CONTROLLER_NOT_FOUND W_ERROR(1908) +#define WERR_ACCOUNT_LOCKED_OUT W_ERROR(1909) + +/* should these go down to NERR_BASE ? */ #define WERR_BUF_TOO_SMALL W_ERROR(2123) #define WERR_JOB_NOT_FOUND W_ERROR(2151) #define WERR_DEST_NOT_FOUND W_ERROR(2152) +#define WERR_USER_EXISTS W_ERROR(2224) #define WERR_NOT_LOCAL_DOMAIN W_ERROR(2320) -#define WERR_DOMAIN_CONTROLLER_NOT_FOUND W_ERROR(2453) +#define WERR_DC_NOT_FOUND W_ERROR(2453) #define WERR_SETUP_ALREADY_JOINED W_ERROR(2691) #define WERR_SETUP_NOT_JOINED W_ERROR(2692) #define WERR_SETUP_DOMAIN_CONTROLLER W_ERROR(2693) +#define WERR_DEFAULT_JOIN_REQUIRED W_ERROR(2694) #define WERR_DEVICE_NOT_AVAILABLE W_ERROR(4319) #define WERR_STATUS_MORE_ENTRIES W_ERROR(0x0105) diff --git a/source3/include/includes.h b/source3/include/includes.h index 22451741a1..041c431a58 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -250,6 +250,10 @@ typedef int ber_int_t; #include <langinfo.h> #endif +#if HAVE_NETGROUP_H +#include <netgroup.h> +#endif + #if defined(HAVE_AIO_H) && defined(WITH_AIO) #include <aio.h> #endif @@ -698,10 +702,10 @@ typedef char fstring[FSTRING_LEN]; #include "rpc_srvsvc.h" #include "rpc_spoolss.h" #include "rpc_eventlog.h" -#include "rpc_ds.h" #include "rpc_perfcount.h" #include "rpc_perfcount_defs.h" #include "librpc/gen_ndr/notify.h" +#include "librpc/gen_ndr/xattr.h" #include "nt_printing.h" #include "idmap.h" #include "client.h" @@ -719,6 +723,7 @@ typedef char fstring[FSTRING_LEN]; #include "packet.h" #include "ctdbd_conn.h" #include "talloc_stack.h" +#include "memcache.h" /* used in net.c */ struct functable { @@ -783,6 +788,7 @@ enum flush_reason_enum { NUM_FLUSH_REASONS}; #include "nss_info.h" +#include "nsswitch/libwbclient/wbclient.h" /* generated rpc server implementation functions */ #include "librpc/gen_ndr/srv_echo.h" @@ -809,6 +815,9 @@ enum flush_reason_enum { #include "srvstr.h" #include "safe_string.h" +/* prototypes from lib/util_transfer_file.c */ +#include "transfer_file.h" + #ifdef __COMPAR_FN_T #define QSORT_CAST (__compar_fn_t) #endif @@ -1102,6 +1111,14 @@ char *talloc_asprintf_strupper_m(TALLOC_CTX *t, const char *fmt, ...) PRINTF_ATT #define VXFS_QUOTA #endif +#ifndef XATTR_CREATE +#define XATTR_CREATE 0x1 /* set value, fail if attr already exists */ +#endif + +#ifndef XATTR_REPLACE +#define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */ +#endif + #if defined(HAVE_KRB5) krb5_error_code smb_krb5_parse_name(krb5_context context, diff --git a/source3/include/libsmb_internal.h b/source3/include/libsmb_internal.h index 19a3edc9bf..6c7dc80da8 100644 --- a/source3/include/libsmb_internal.h +++ b/source3/include/libsmb_internal.h @@ -15,6 +15,7 @@ struct _SMBCSRV { bool no_pathinfo; bool no_pathinfo2; bool no_nt_session; + POLICY_HND pol; SMBCSRV *next, *prev; @@ -106,6 +107,13 @@ struct smbc_internal_data { * and retrieved with smbc_option_set() and smbc_option_get(). */ void * _user_data; + + /* + * Should we attempt UNIX smb encryption ? + * Set to 0 if we should never attempt, set to 1 if + * encryption requested, set to 2 if encryption required. + */ + int _smb_encryption_level; }; diff --git a/source3/include/libsmbclient.h b/source3/include/libsmbclient.h index 9175b33d60..07242f7956 100644 --- a/source3/include/libsmbclient.h +++ b/source3/include/libsmbclient.h @@ -1961,7 +1961,7 @@ int smbc_fremovexattr(int fd, * extended attributes * * @note This function always returns all attribute names supported - * by NT file systems, regardless of wether the referenced + * by NT file systems, regardless of whether the referenced * file system supports extended attributes (e.g. a Windows * 2000 machine supports extended attributes if NTFS is used, * but not if FAT is used, and Windows 98 doesn't support diff --git a/source3/include/memcache.h b/source3/include/memcache.h new file mode 100644 index 0000000000..0a596b91a5 --- /dev/null +++ b/source3/include/memcache.h @@ -0,0 +1,115 @@ +/* + Unix SMB/CIFS implementation. + In-memory cache + Copyright (C) Volker Lendecke 2007-2008 + + 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 3 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, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef __MEMCACHE_H__ +#define __MEMCACHE_H__ + +#include "includes.h" + +struct memcache; + +/* + * A memcache can store different subkeys with overlapping keys, the + * memcache_number becomes part of the key. Feel free to add caches of your + * own here. + * + * If you add talloc type caches, also note this in the switch statement in + * memcache_is_talloc(). + */ + +enum memcache_number { + STAT_CACHE, + UID_SID_CACHE, + SID_UID_CACHE, + GID_SID_CACHE, + SID_GID_CACHE, + GETWD_CACHE, + GETPWNAM_CACHE, /* talloc */ + MANGLE_HASH2_CACHE, + PDB_GETPWSID_CACHE, /* talloc */ + SINGLETON_CACHE_TALLOC, /* talloc */ + SINGLETON_CACHE +}; + +/* + * Create a memcache structure. max_size is in bytes, if you set it 0 it will + * not forget anything. + */ + +struct memcache *memcache_init(TALLOC_CTX *mem_ctx, size_t max_size); + +/* + * If you set this global memcache, use it as the default cache when NULL is + * passed to the memcache functions below. This is a workaround for many + * situations where passing the cache everywhere would be a big hassle. + */ + +void memcache_set_global(struct memcache *cache); + +/* + * Add a data blob to the cache + */ + +void memcache_add(struct memcache *cache, enum memcache_number n, + DATA_BLOB key, DATA_BLOB value); + +/* + * Add a talloc object to the cache. The difference to memcache_add() is that + * when the objects is to be discared, talloc_free is called for it. Also + * talloc_move() ownership of the object to the cache. + * + * Please note that the current implementation has a fixed relationship + * between what cache subtypes store talloc objects and which ones store plain + * blobs. We can fix this, but for now we don't have a mixed use of blobs vs + * talloc objects in the cache types. + */ + +void memcache_add_talloc(struct memcache *cache, enum memcache_number n, + DATA_BLOB key, void *ptr); + +/* + * Delete an object from the cache + */ + +void memcache_delete(struct memcache *cache, enum memcache_number n, + DATA_BLOB key); + +/* + * Look up an object from the cache. Memory still belongs to the cache, so + * make a copy of it if needed. + */ + +bool memcache_lookup(struct memcache *cache, enum memcache_number n, + DATA_BLOB key, DATA_BLOB *value); + +/* + * Look up an object from the cache. Memory still belongs to the cache, so + * make a copy of it if needed. + */ + +void *memcache_lookup_talloc(struct memcache *cache, enum memcache_number n, + DATA_BLOB key); + +/* + * Flush a complete cache subset. + */ + +void memcache_flush(struct memcache *cache, enum memcache_number n); + +#endif diff --git a/source3/include/messages.h b/source3/include/messages.h index 8de41ca049..c97ad982b3 100644 --- a/source3/include/messages.h +++ b/source3/include/messages.h @@ -97,6 +97,7 @@ #define MSG_WINBIND_TRY_TO_GO_ONLINE 0x0406 #define MSG_WINBIND_FAILED_TO_GO_ONLINE 0x0407 #define MSG_WINBIND_VALIDATE_CACHE 0x0408 +#define MSG_WINBIND_DUMP_DOMAIN_LIST 0x0409 /* event messages */ #define MSG_DUMP_EVENT_LIST 0x0500 diff --git a/source3/include/passdb.h b/source3/include/passdb.h index bb8a336b8c..b72ec6b0ba 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -242,20 +242,15 @@ struct pdb_search { * changed to version 14 to move lookup_rids and lookup_names to return * enum lsa_SidType rather than uint32. * Changed to 16 for access to the trusted domain passwords (obnox). + * Changed to 17, the sampwent interface is gone. */ -#define PASSDB_INTERFACE_VERSION 16 +#define PASSDB_INTERFACE_VERSION 17 struct pdb_methods { const char *name; /* What name got this module */ - NTSTATUS (*setsampwent)(struct pdb_methods *, bool update, uint32 acb_mask); - - void (*endsampwent)(struct pdb_methods *); - - NTSTATUS (*getsampwent)(struct pdb_methods *, struct samu *user); - NTSTATUS (*getsampwnam)(struct pdb_methods *, struct samu *sam_acct, const char *username); NTSTATUS (*getsampwsid)(struct pdb_methods *, struct samu *sam_acct, const DOM_SID *sid); diff --git a/source3/include/popt_common.h b/source3/include/popt_common.h index 1d3cc57acd..9e5503f270 100644 --- a/source3/include/popt_common.h +++ b/source3/include/popt_common.h @@ -49,6 +49,7 @@ struct user_auth_info { bool got_pass; bool use_kerberos; int signing_state; + bool smb_encrypt; }; #endif /* _POPT_COMMON_H */ diff --git a/source3/include/reg_objects.h b/source3/include/reg_objects.h index f6cf9cccb7..3df701f61c 100644 --- a/source3/include/reg_objects.h +++ b/source3/include/reg_objects.h @@ -61,6 +61,7 @@ struct registry_value { typedef struct { uint32 num_values; REGISTRY_VALUE **values; + int seqnum; } REGVAL_CTR; /* container for registry subkey names */ @@ -68,6 +69,7 @@ typedef struct { typedef struct { uint32 num_subkeys; char **subkeys; + int seqnum; } REGSUBKEY_CTR; /* @@ -92,11 +94,17 @@ typedef struct { #define KEY_HKCU "HKCU" #define KEY_HKDD "HKDD" #define KEY_SERVICES "HKLM\\SYSTEM\\CurrentControlSet\\Services" +#define KEY_EVENTLOG "HKLM\\SYSTEM\\CurrentControlSet\\Services\\Eventlog" +#define KEY_SHARES "HKLM\\SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Shares" +#define KEY_NETLOGON_PARAMS "HKLM\\SYSTEM\\CurrentControlSet\\Services\\Netlogon\\Parameters" +#define KEY_TCPIP_PARAMS "HKLM\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters" +#define KEY_PROD_OPTIONS "HKLM\\SYSTEM\\CurrentControlSet\\Control\\ProductOptions" #define KEY_PRINTING "HKLM\\SYSTEM\\CurrentControlSet\\Control\\Print" #define KEY_PRINTING_2K "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Print\\Printers" #define KEY_PRINTING_PORTS "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Ports" -#define KEY_EVENTLOG "HKLM\\SYSTEM\\CurrentControlSet\\Services\\Eventlog" -#define KEY_SHARES "HKLM\\SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Shares" +#define KEY_CURRENT_VERSION "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion" +#define KEY_PERFLIB "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Perflib" +#define KEY_PERFLIB_009 "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Perflib\\009" #define KEY_SMBCONF "HKLM\\SOFTWARE\\Samba\\smbconf" #define KEY_TREE_ROOT "" @@ -128,6 +136,8 @@ typedef struct { struct security_descriptor **psecdesc); WERROR (*set_secdesc)(const char *key, struct security_descriptor *sec_desc); + bool (*subkeys_need_update)(REGSUBKEY_CTR *subkeys); + bool (*values_need_update)(REGVAL_CTR *values); } REGISTRY_OPS; typedef struct { diff --git a/source3/include/rpc_client.h b/source3/include/rpc_client.h index 66c4f58987..c560fd0909 100644 --- a/source3/include/rpc_client.h +++ b/source3/include/rpc_client.h @@ -31,6 +31,9 @@ #include "librpc/gen_ndr/cli_initshutdown.h" #include "librpc/gen_ndr/cli_winreg.h" #include "librpc/gen_ndr/cli_srvsvc.h" +#include "librpc/gen_ndr/cli_samr.h" +#include "librpc/gen_ndr/cli_netlogon.h" +#include "librpc/gen_ndr/cli_dssetup.h" /* macro to expand cookie-cutter code in cli_xxx() using rpc_api_pipe_req() */ diff --git a/source3/include/rpc_dce.h b/source3/include/rpc_dce.h index 7ea3fcbc23..ec08eb5f8f 100644 --- a/source3/include/rpc_dce.h +++ b/source3/include/rpc_dce.h @@ -98,11 +98,6 @@ enum RPC_PKT_TYPE { #define RPC_AUTH_SCHANNEL_SIGN_OR_SEAL_CHK_LEN 0x20 #define RPC_AUTH_SCHANNEL_SIGN_ONLY_CHK_LEN 0x18 - -#define NETLOGON_NEG_ARCFOUR 0x00000004 -#define NETLOGON_NEG_128BIT 0x00004000 -#define NETLOGON_NEG_SCHANNEL 0x40000000 - /* The 7 here seems to be required to get Win2k not to downgrade us to NT4. Actually, anything other than 1ff would seem to do... */ #define NETLOGON_NEG_AUTH2_FLAGS 0x000701ff @@ -111,6 +106,8 @@ enum RPC_PKT_TYPE { /* these are the flags that ADS clients use */ #define NETLOGON_NEG_AUTH2_ADS_FLAGS (0x200fbffb | NETLOGON_NEG_ARCFOUR | NETLOGON_NEG_128BIT | NETLOGON_NEG_SCHANNEL) +#define NETLOGON_NEG_SELECT_AUTH2_FLAGS ((lp_security() == SEC_ADS) ? NETLOGON_NEG_AUTH2_ADS_FLAGS : NETLOGON_NEG_AUTH2_FLAGS) + enum schannel_direction { SENDER_IS_INITIATOR, SENDER_IS_ACCEPTOR diff --git a/source3/include/rpc_ds.h b/source3/include/rpc_ds.h deleted file mode 100644 index 1ba02aede0..0000000000 --- a/source3/include/rpc_ds.h +++ /dev/null @@ -1,184 +0,0 @@ -/* - Unix SMB/CIFS implementation. - SMB parameters and setup - Copyright (C) Gerald Carter 2002 - - 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 3 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, see <http://www.gnu.org/licenses/>. -*/ - -#ifndef _RPC_DS_H /* _RPC_LSA_H */ -#define _RPC_DS_H - -/* Opcodes available on PIPE_LSARPC_DS */ - -#define DS_GETPRIMDOMINFO 0x00 -#define DS_NOP 0xFF /* no op -- placeholder */ - -/* Opcodes available on PIPE_NETLOGON */ - -#define DS_ENUM_DOM_TRUSTS 0x28 - -/* macros for RPC's */ - -/* DSROLE_PRIMARY_DOMAIN_INFO_BASIC */ - -/* flags */ - -#define DSROLE_PRIMARY_DS_RUNNING 0x00000001 -#define DSROLE_PRIMARY_DS_MIXED_MODE 0x00000002 -#define DSROLE_UPGRADE_IN_PROGRESS 0x00000004 -#define DSROLE_PRIMARY_DOMAIN_GUID_PRESENT 0x01000000 - -/* machine role */ - -#define DSROLE_DOMAIN_MEMBER_WKS 1 -#define DSROLE_STANDALONE_SRV 2 -#define DSROLE_DOMAIN_MEMBER_SRV 3 -#define DSROLE_BDC 4 -#define DSROLE_PDC 5 - -/* Settings for the domainFunctionality attribute in the rootDSE */ - -#define DS_DOMAIN_FUNCTION_2000 0 -#define DS_DOMAIN_FUCNTION_2003_MIXED 1 -#define DS_DOMAIN_FUNCTION_2003 2 - -typedef struct -{ - uint16 machine_role; - uint32 flags; - uint32 netbios_ptr; - uint32 dnsname_ptr; - uint32 forestname_ptr; - - struct GUID domain_guid; - UNISTR2 netbios_domain; - UNISTR2 dns_domain; /* our dns domain */ - UNISTR2 forest_domain; /* root domain of the forest to which we belong */ -} DSROLE_PRIMARY_DOMAIN_INFO_BASIC; - -typedef struct -{ - DSROLE_PRIMARY_DOMAIN_INFO_BASIC *basic; -} DS_DOMINFO_CTR; - -/* info levels for ds_getprimdominfo() */ - -#define DsRolePrimaryDomainInfoBasic 1 - -/* DS_Q_GETPRIMDOMINFO - DsGetPrimaryDomainInformation() request */ -typedef struct -{ - uint16 level; -} DS_Q_GETPRIMDOMINFO; - -/* DS_R_GETPRIMDOMINFO - DsGetPrimaryDomainInformation() response */ -typedef struct -{ - uint32 ptr; - - uint16 level; - uint16 unknown0; /* 0x455c -- maybe just alignment? */ - - DS_DOMINFO_CTR info; - - NTSTATUS status; -} DS_R_GETPRIMDOMINFO; - -typedef struct { - /* static portion of structure */ - uint32 netbios_ptr; - uint32 dns_ptr; - uint32 flags; - uint32 parent_index; - uint32 trust_type; - uint32 trust_attributes; - uint32 sid_ptr; - struct GUID guid; - - UNISTR2 netbios_domain; - UNISTR2 dns_domain; - DOM_SID2 sid; - -} DS_DOMAIN_TRUSTS; - -struct ds_domain_trust { - /* static portion of structure */ - uint32 flags; - uint32 parent_index; - uint32 trust_type; - uint32 trust_attributes; - struct GUID guid; - - DOM_SID sid; - char *netbios_domain; - char *dns_domain; -}; - -typedef struct { - - uint32 ptr; - uint32 max_count; - DS_DOMAIN_TRUSTS *trusts; - -} DS_DOMAIN_TRUSTS_CTR; - -/* Trust flags */ - -#define DS_DOMAIN_IN_FOREST 0x0001 /* domains in the forest to which - we belong; even different domain trees */ -#define DS_DOMAIN_DIRECT_OUTBOUND 0x0002 /* trusted domains */ -#define DS_DOMAIN_TREE_ROOT 0x0004 /* root of a forest */ -#define DS_DOMAIN_PRIMARY 0x0008 /* our domain */ -#define DS_DOMAIN_NATIVE_MODE 0x0010 /* native mode AD servers */ -#define DS_DOMAIN_DIRECT_INBOUND 0x0020 /* trusting domains */ - -/* Trust types */ - -#define DS_DOMAIN_TRUST_TYPE_DOWNLEVEL 0x00000001 -#define DS_DOMAIN_TRUST_TYPE_UPLEVEL 0x00000002 - -/* Trust attributes */ - -#define DS_DOMAIN_TRUST_ATTRIB_NON_TRANSITIVE 0x00000001 -#define DS_DOMAIN_TRUST_ATTRIB_UPLEVEL_ONLY 0x00000002 -#define DS_DOMAIN_TRUST_ATTRIB_QUARANTINED_DOMAIN 0x00000004 -#define DS_DOMAIN_TRUST_ATTRIB_FOREST_TRANSITIVE 0x00000008 -#define DS_DOMAIN_TRUST_ATTRIB_CROSS_ORG 0x00000010 -#define DS_DOMAIN_TRUST_ATTRIB_IN_FOREST 0x00000020 -#define DS_DOMAIN_TRUST_ATTRIB_EXTERNAL 0x00000040 - - - -/* DS_Q_ENUM_DOM_TRUSTS - DsEnumerateDomainTrusts() request */ -typedef struct -{ - uint32 server_ptr; - UNISTR2 server; - uint32 flags; - -} DS_Q_ENUM_DOM_TRUSTS; - -/* DS_R_ENUM_DOM_TRUSTS - DsEnumerateDomainTrusts() response */ -typedef struct -{ - uint32 num_domains; - DS_DOMAIN_TRUSTS_CTR domains; - - NTSTATUS status; - -} DS_R_ENUM_DOM_TRUSTS; - - -#endif /* _RPC_DS_H */ diff --git a/source3/include/rpc_lsa.h b/source3/include/rpc_lsa.h index 9f90b53ffa..371c3ebd11 100644 --- a/source3/include/rpc_lsa.h +++ b/source3/include/rpc_lsa.h @@ -87,27 +87,8 @@ #define LSA_AUDIT_NUM_CATEGORIES_NT4 7 #define LSA_AUDIT_NUM_CATEGORIES_WIN2K 9 - #define LSA_AUDIT_NUM_CATEGORIES LSA_AUDIT_NUM_CATEGORIES_NT4 -#define LSA_AUDIT_POLICY_NONE 0x00 -#define LSA_AUDIT_POLICY_SUCCESS 0x01 -#define LSA_AUDIT_POLICY_FAILURE 0x02 -#define LSA_AUDIT_POLICY_ALL (LSA_AUDIT_POLICY_SUCCESS|LSA_AUDIT_POLICY_FAILURE) -#define LSA_AUDIT_POLICY_CLEAR 0x04 - -enum lsa_audit_categories { - LSA_AUDIT_CATEGORY_SYSTEM = 0, - LSA_AUDIT_CATEGORY_LOGON = 1, - LSA_AUDIT_CATEGORY_FILE_AND_OBJECT_ACCESS, - LSA_AUDIT_CATEGORY_USE_OF_USER_RIGHTS, - LSA_AUDIT_CATEGORY_PROCCESS_TRACKING, - LSA_AUDIT_CATEGORY_SECURITY_POLICY_CHANGES, - LSA_AUDIT_CATEGORY_ACCOUNT_MANAGEMENT, - LSA_AUDIT_CATEGORY_DIRECTORY_SERVICE_ACCESS, /* only in win2k/2k3 */ - LSA_AUDIT_CATEGORY_ACCOUNT_LOGON /* only in win2k/2k3 */ -}; - /* level 1 is auditing settings */ typedef struct dom_query_1 { @@ -334,22 +315,6 @@ typedef struct lsa_info_ctr typedef LSA_INFO_CTR LSA_INFO_CTR2; -/* LSA_Q_SET_INFO - LSA set info policy */ -typedef struct lsa_set_info -{ - POLICY_HND pol; /* policy handle */ - uint16 info_class; /* info class */ - LSA_INFO_CTR ctr; - -} LSA_Q_SET_INFO; - -/* LSA_R_SET_INFO - response to LSA set info policy */ -typedef struct lsa_r_set_info -{ - NTSTATUS status; /* return code */ - -} LSA_R_SET_INFO; - /* LSA_R_QUERY_INFO - response to LSA query info policy */ typedef struct lsa_r_query_info { @@ -962,64 +927,6 @@ typedef struct lsa_r_removeprivs } LSA_R_REMOVEPRIVS; /*******************************************************/ -#if 0 /* jerry, I think this not correct - gd */ -typedef struct { - POLICY_HND handle; - uint32 count; /* ??? this is what ethereal calls it */ - DOM_SID sid; -} LSA_Q_OPEN_TRUSTED_DOMAIN; -#endif - -/* LSA_Q_OPEN_TRUSTED_DOMAIN - LSA Query Open Trusted Domain */ -typedef struct lsa_q_open_trusted_domain -{ - POLICY_HND pol; /* policy handle */ - DOM_SID2 sid; /* domain sid */ - uint32 access_mask; /* access mask */ - -} LSA_Q_OPEN_TRUSTED_DOMAIN; - -/* LSA_R_OPEN_TRUSTED_DOMAIN - response to LSA Query Open Trusted Domain */ -typedef struct { - POLICY_HND handle; /* trustdom policy handle */ - NTSTATUS status; /* return code */ -} LSA_R_OPEN_TRUSTED_DOMAIN; - - -/*******************************************************/ - -/* LSA_Q_OPEN_TRUSTED_DOMAIN_BY_NAME - LSA Query Open Trusted Domain by Name*/ -typedef struct lsa_q_open_trusted_domain_by_name -{ - POLICY_HND pol; /* policy handle */ - LSA_STRING name; /* domain name */ - uint32 access_mask; /* access mask */ - -} LSA_Q_OPEN_TRUSTED_DOMAIN_BY_NAME; - -/* LSA_R_OPEN_TRUSTED_DOMAIN_BY_NAME - response to LSA Query Open Trusted Domain by Name */ -typedef struct { - POLICY_HND handle; /* trustdom policy handle */ - NTSTATUS status; /* return code */ -} LSA_R_OPEN_TRUSTED_DOMAIN_BY_NAME; - - -/*******************************************************/ - - -typedef struct { - POLICY_HND handle; - UNISTR4 secretname; - uint32 access; -} LSA_Q_OPEN_SECRET; - -typedef struct { - POLICY_HND handle; - NTSTATUS status; -} LSA_R_OPEN_SECRET; - - -/*******************************************************/ typedef struct { POLICY_HND handle; @@ -1029,221 +936,4 @@ typedef struct { NTSTATUS status; } LSA_R_DELETE_OBJECT; - -/*******************************************************/ - -typedef struct { - POLICY_HND handle; - UNISTR4 secretname; - uint32 access; -} LSA_Q_CREATE_SECRET; - -typedef struct { - POLICY_HND handle; - NTSTATUS status; -} LSA_R_CREATE_SECRET; - - -/*******************************************************/ - -typedef struct { - POLICY_HND handle; - UNISTR4 secretname; - uint32 access; -} LSA_Q_CREATE_TRUSTED_DOMAIN; - -typedef struct { - POLICY_HND handle; - NTSTATUS status; -} LSA_R_CREATE_TRUSTED_DOMAIN; - - -/*******************************************************/ - -typedef struct { - uint32 size; /* size is written on the wire twice so I - can only assume that one is supposed to - be a max length and one is a size */ - UNISTR2 *data; /* not really a UNICODE string but the parsing - is the same */ -} LSA_DATA_BLOB; - -typedef struct { - POLICY_HND handle; - LSA_DATA_BLOB *old_value; - LSA_DATA_BLOB *new_value; -} LSA_Q_SET_SECRET; - -typedef struct { - NTSTATUS status; -} LSA_R_SET_SECRET; - -/* LSA_Q_QUERY_TRUSTED_DOMAIN_INFO - LSA query trusted domain info */ -typedef struct lsa_query_trusted_domain_info -{ - POLICY_HND pol; /* policy handle */ - uint16 info_class; /* info class */ - -} LSA_Q_QUERY_TRUSTED_DOMAIN_INFO; - -/* LSA_Q_QUERY_TRUSTED_DOMAIN_INFO_BY_SID - LSA query trusted domain info */ -typedef struct lsa_query_trusted_domain_info_by_sid -{ - POLICY_HND pol; /* policy handle */ - DOM_SID2 dom_sid; /* domain sid */ - uint16 info_class; /* info class */ - -} LSA_Q_QUERY_TRUSTED_DOMAIN_INFO_BY_SID; - -/* LSA_Q_QUERY_TRUSTED_DOMAIN_INFO_BY_NAME - LSA query trusted domain info */ -typedef struct lsa_query_trusted_domain_info_by_name -{ - POLICY_HND pol; /* policy handle */ - LSA_STRING domain_name; /* domain name */ - uint16 info_class; /* info class */ - -} LSA_Q_QUERY_TRUSTED_DOMAIN_INFO_BY_NAME; - -typedef struct trusted_domain_info_name { - LSA_STRING netbios_name; -} TRUSTED_DOMAIN_INFO_NAME; - -typedef struct trusted_domain_info_posix_offset { - uint32 posix_offset; -} TRUSTED_DOMAIN_INFO_POSIX_OFFSET; - -typedef struct lsa_data_buf { - uint32 size; - uint32 offset; - uint32 length; - uint8 *data; -} LSA_DATA_BUF; - -typedef struct lsa_data_buf_hdr { - uint32 length; - uint32 size; - uint32 data_ptr; -} LSA_DATA_BUF_HDR; - - -typedef struct lsa_data_buf2 { - uint32 size; - uint8 *data; -} LSA_DATA_BUF2; - -typedef struct trusted_domain_info_password { - uint32 ptr_password; - uint32 ptr_old_password; - LSA_DATA_BUF_HDR password_hdr; - LSA_DATA_BUF_HDR old_password_hdr; - LSA_DATA_BUF password; - LSA_DATA_BUF old_password; -} TRUSTED_DOMAIN_INFO_PASSWORD; - -typedef struct trusted_domain_info_basic { - LSA_STRING netbios_name; - DOM_SID2 sid; -} TRUSTED_DOMAIN_INFO_BASIC; - -typedef struct trusted_domain_info_ex { - LSA_STRING domain_name; - LSA_STRING netbios_name; - DOM_SID2 sid; - uint32 trust_direction; - uint32 trust_type; - uint32 trust_attributes; -} TRUSTED_DOMAIN_INFO_EX; - -typedef struct trust_domain_info_buffer { - NTTIME last_update_time; - uint32 secret_type; - LSA_DATA_BUF2 data; -} LSA_TRUSTED_DOMAIN_INFO_BUFFER; - -typedef struct trusted_domain_info_auth_info { - uint32 incoming_count; - LSA_TRUSTED_DOMAIN_INFO_BUFFER incoming_current_auth_info; - LSA_TRUSTED_DOMAIN_INFO_BUFFER incoming_previous_auth_info; - uint32 outgoing_count; - LSA_TRUSTED_DOMAIN_INFO_BUFFER outgoing_current_auth_info; - LSA_TRUSTED_DOMAIN_INFO_BUFFER outgoing_previous_auth_info; -} TRUSTED_DOMAIN_INFO_AUTH_INFO; - -typedef struct trusted_domain_info_full_info { - TRUSTED_DOMAIN_INFO_EX info_ex; - TRUSTED_DOMAIN_INFO_POSIX_OFFSET posix_offset; - TRUSTED_DOMAIN_INFO_AUTH_INFO auth_info; -} TRUSTED_DOMAIN_INFO_FULL_INFO; - -typedef struct trusted_domain_info_11 { - TRUSTED_DOMAIN_INFO_EX info_ex; - LSA_DATA_BUF2 data1; -} TRUSTED_DOMAIN_INFO_11; - -typedef struct trusted_domain_info_all { - TRUSTED_DOMAIN_INFO_EX info_ex; - LSA_DATA_BUF2 data1; - TRUSTED_DOMAIN_INFO_POSIX_OFFSET posix_offset; - TRUSTED_DOMAIN_INFO_AUTH_INFO auth_info; -} TRUSTED_DOMAIN_INFO_ALL; - -/* LSA_TRUSTED_DOMAIN_INFO */ -typedef union lsa_trusted_domain_info -{ - uint16 info_class; - TRUSTED_DOMAIN_INFO_NAME name; - /* deprecated - gd - TRUSTED_DOMAIN_INFO_CONTROLLERS_INFO controllers; */ - TRUSTED_DOMAIN_INFO_POSIX_OFFSET posix_offset; - TRUSTED_DOMAIN_INFO_PASSWORD password; - TRUSTED_DOMAIN_INFO_BASIC basic; - TRUSTED_DOMAIN_INFO_EX info_ex; - TRUSTED_DOMAIN_INFO_AUTH_INFO auth_info; - TRUSTED_DOMAIN_INFO_FULL_INFO full_info; - TRUSTED_DOMAIN_INFO_11 info11; - TRUSTED_DOMAIN_INFO_ALL info_all; - -} LSA_TRUSTED_DOMAIN_INFO; - -/* LSA_R_QUERY_TRUSTED_DOMAIN_INFO - LSA query trusted domain info */ -typedef struct r_lsa_query_trusted_domain_info -{ - LSA_TRUSTED_DOMAIN_INFO *info; - NTSTATUS status; -} LSA_R_QUERY_TRUSTED_DOMAIN_INFO; - -typedef struct dom_info_kerberos { - uint32 enforce_restrictions; - NTTIME service_tkt_lifetime; - NTTIME user_tkt_lifetime; - NTTIME user_tkt_renewaltime; - NTTIME clock_skew; - NTTIME unknown6; -} LSA_DOM_INFO_POLICY_KERBEROS; - -typedef struct dom_info_efs { - uint32 blob_len; - UNISTR2 efs_blob; -} LSA_DOM_INFO_POLICY_EFS; - -typedef struct lsa_dom_info_union { - uint16 info_class; - LSA_DOM_INFO_POLICY_EFS efs_policy; - LSA_DOM_INFO_POLICY_KERBEROS krb_policy; -} LSA_DOM_INFO_UNION; - -/* LSA_Q_QUERY_DOM_INFO_POLICY - LSA query info */ -typedef struct lsa_q_query_dom_info_policy -{ - POLICY_HND pol; /* policy handle */ - uint16 info_class; /* info class */ -} LSA_Q_QUERY_DOM_INFO_POLICY; - -typedef struct lsa_r_query_dom_info_policy -{ - LSA_DOM_INFO_UNION *info; - NTSTATUS status; -} LSA_R_QUERY_DOM_INFO_POLICY; - - #endif /* _RPC_LSA_H */ diff --git a/source3/include/rpc_netlogon.h b/source3/include/rpc_netlogon.h index a82b977a5b..244e37d85a 100644 --- a/source3/include/rpc_netlogon.h +++ b/source3/include/rpc_netlogon.h @@ -45,11 +45,6 @@ #define NET_DSR_GETDCNAMEEX2 0x22 #define NET_SAMLOGON_EX 0x27 -/* Secure Channel types. used in NetrServerAuthenticate negotiation */ -#define SEC_CHAN_WKSTA 2 -#define SEC_CHAN_DOMAIN 4 -#define SEC_CHAN_BDC 6 - /* Returned delta types */ #define SAM_DELTA_DOMAIN_INFO 0x01 #define SAM_DELTA_GROUP_INFO 0x02 @@ -89,30 +84,12 @@ #define NL_CTRL_REPL_IN_PROGRESS 0x0002 #define NL_CTRL_FULL_SYNC 0x0004 -#define LOGON_GUEST 0x00000001 -#define LOGON_NOENCRYPTION 0x00000002 -#define LOGON_CACHED_ACCOUNT 0x00000004 -#define LOGON_USED_LM_PASSWORD 0x00000008 -#define LOGON_EXTRA_SIDS 0x00000020 -#define LOGON_SUBAUTH_SESSION_KEY 0x00000040 -#define LOGON_SERVER_TRUST_ACCOUNT 0x00000080 -#define LOGON_NTLMV2_ENABLED 0x00000100 -#define LOGON_RESOURCE_GROUPS 0x00000200 -#define LOGON_PROFILE_PATH_RETURNED 0x00000400 -#define LOGON_GRACE_LOGON 0x01000000 #define LOGON_KRB5_FAIL_CLOCK_SKEW 0x02000000 -#define SE_GROUP_MANDATORY 0x00000001 -#define SE_GROUP_ENABLED_BY_DEFAULT 0x00000002 -#define SE_GROUP_ENABLED 0x00000004 -#define SE_GROUP_OWNER 0x00000008 -#define SE_GROUP_USE_FOR_DENY_ONLY 0x00000010 -#define SE_GROUP_LOGON_ID 0xC0000000 -#define SE_GROUP_RESOURCE 0x20000000 /* Domain Local Group */ - /* Flags for controlling the behaviour of a particular logon */ -/* sets LOGON_SERVER_TRUST_ACCOUNT user_flag */ +/* sets NETLOGON_SERVER_TRUST_ACCOUNT user_flag */ +#if 0 #define MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT 0x00000020 #define MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT 0x00000800 @@ -125,6 +102,7 @@ /* returns the profilepath in the driveletter and * sets LOGON_PROFILE_PATH_RETURNED user_flag */ #define MSV1_0_RETURN_PROFILE_PATH 0x00000200 +#endif #if 0 /* I think this is correct - it's what gets parsed on the wire. JRA. */ @@ -1054,31 +1032,6 @@ typedef struct net_r_sam_deltas_info { NTSTATUS status; } NET_R_SAM_DELTAS; -#define DS_FORCE_REDISCOVERY 0x00000001 -#define DS_DIRECTORY_SERVICE_REQUIRED 0x00000010 -#define DS_DIRECTORY_SERVICE_PREFERRED 0x00000020 -#define DS_GC_SERVER_REQUIRED 0x00000040 -#define DS_PDC_REQUIRED 0x00000080 -#define DS_BACKGROUND_ONLY 0x00000100 -#define DS_IP_REQUIRED 0x00000200 -#define DS_KDC_REQUIRED 0x00000400 -#define DS_TIMESERV_REQUIRED 0x00000800 -#define DS_WRITABLE_REQUIRED 0x00001000 -#define DS_GOOD_TIMESERV_PREFERRED 0x00002000 -#define DS_AVOID_SELF 0x00004000 -#define DS_ONLY_LDAP_NEEDED 0x00008000 - -#define DS_IS_FLAT_NAME 0x00010000 -#define DS_IS_DNS_NAME 0x00020000 - -#define DS_RETURN_DNS_NAME 0x40000000 -#define DS_RETURN_FLAT_NAME 0x80000000 - -#if 0 /* unknown yet */ -#define DS_IP_VERSION_AGNOSTIC -#define DS_TRY_NEXTCLOSEST_SITE -#endif - #define DSGETDC_VALID_FLAGS ( \ DS_FORCE_REDISCOVERY | \ DS_DIRECTORY_SERVICE_REQUIRED | \ @@ -1143,41 +1096,6 @@ typedef struct net_r_dsr_getdcname { WERROR result; } NET_R_DSR_GETDCNAME; -/* NET_Q_DSR_GETDCNAMEEX */ -typedef struct net_q_dsr_getdcnameex { - uint32 ptr_server_unc; - UNISTR2 uni_server_unc; - uint32 ptr_domain_name; - UNISTR2 uni_domain_name; - uint32 ptr_domain_guid; - struct GUID *domain_guid; - uint32 ptr_site_name; - UNISTR2 uni_site_name; - uint32 flags; -} NET_Q_DSR_GETDCNAMEEX; - -/* NET_R_DSR_GETDCNAMEEX */ -typedef struct net_r_dsr_getdcnameex NET_R_DSR_GETDCNAMEEX; - -/* NET_Q_DSR_GETDCNAMEEX2 */ -typedef struct net_q_dsr_getdcnameex2 { - uint32 ptr_server_unc; - UNISTR2 uni_server_unc; - uint32 ptr_client_account; - UNISTR2 uni_client_account; - uint32 mask; - uint32 ptr_domain_name; - UNISTR2 uni_domain_name; - uint32 ptr_domain_guid; - struct GUID *domain_guid; - uint32 ptr_site_name; - UNISTR2 uni_site_name; - uint32 flags; -} NET_Q_DSR_GETDCNAMEEX2; - -/* NET_R_DSR_GETDCNAMEEX2 */ -typedef struct net_r_dsr_getdcnameex2 NET_R_DSR_GETDCNAMEEX2; - /* NET_Q_DSR_GESITENAME */ typedef struct net_q_dsr_getsitename { uint32 ptr_computer_name; diff --git a/source3/include/rpc_samr.h b/source3/include/rpc_samr.h index 2273fba2e6..fa8bf07564 100644 --- a/source3/include/rpc_samr.h +++ b/source3/include/rpc_samr.h @@ -445,23 +445,6 @@ typedef struct sam_user_info_9 } SAM_USER_INFO_9; -/* SAMR_Q_CLOSE_HND - probably a policy handle close */ -typedef struct q_samr_close_hnd_info -{ - POLICY_HND pol; /* policy handle */ - -} SAMR_Q_CLOSE_HND; - - -/* SAMR_R_CLOSE_HND - probably a policy handle close */ -typedef struct r_samr_close_hnd_info -{ - POLICY_HND pol; /* policy handle */ - NTSTATUS status; /* return status */ - -} SAMR_R_CLOSE_HND; - - /**************************************************************************** SAMR_Q_GET_USRDOM_PWINFO - a "set user info" occurs just after this *****************************************************************************/ @@ -701,31 +684,6 @@ typedef struct r_samr_lookup_domain_info } SAMR_R_LOOKUP_DOMAIN; -/**************************************************************************** -SAMR_Q_OPEN_DOMAIN - unknown_0 values seen associated with SIDs: - -0x0000 03f1 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0 -0x0000 0200 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0 -*****************************************************************************/ - -/* SAMR_Q_OPEN_DOMAIN */ -typedef struct q_samr_open_domain_info -{ - POLICY_HND pol; /* policy handle */ - uint32 flags; /* 0x2000 0000; 0x0000 0211; 0x0000 0280; 0x0000 0200 - flags? */ - DOM_SID2 dom_sid; /* domain SID */ - -} SAMR_Q_OPEN_DOMAIN; - - -/* SAMR_R_OPEN_DOMAIN - probably an open */ -typedef struct r_samr_open_domain_info -{ - POLICY_HND domain_pol; /* policy handle associated with the SID */ - NTSTATUS status; /* return status */ - -} SAMR_R_OPEN_DOMAIN; - #define MAX_SAM_ENTRIES_W2K 0x400 #define MAX_SAM_ENTRIES_W95 50 /* The following should be the greater of the preceeding two. */ @@ -1076,45 +1034,6 @@ typedef struct r_samr_get_dispenum_index } SAMR_R_GET_DISPENUM_INDEX; -/* SAMR_Q_DELETE_DOM_GROUP - delete domain group */ -typedef struct q_samr_delete_dom_group_info -{ - POLICY_HND group_pol; /* policy handle */ - -} SAMR_Q_DELETE_DOM_GROUP; - - -/* SAMR_R_DELETE_DOM_GROUP - delete domain group */ -typedef struct r_samr_delete_dom_group_info -{ - POLICY_HND pol; /* policy handle */ - NTSTATUS status; /* return status */ - -} SAMR_R_DELETE_DOM_GROUP; - - -/* SAMR_Q_CREATE_DOM_GROUP - SAM create group */ -typedef struct q_samr_create_dom_group_info -{ - POLICY_HND pol; /* policy handle */ - - UNIHDR hdr_acct_desc; - UNISTR2 uni_acct_desc; - - uint32 access_mask; - -} SAMR_Q_CREATE_DOM_GROUP; - -/* SAMR_R_CREATE_DOM_GROUP - SAM create group */ -typedef struct r_samr_create_dom_group_info -{ - POLICY_HND pol; /* policy handle */ - - uint32 rid; - NTSTATUS status; - -} SAMR_R_CREATE_DOM_GROUP; - /* SAMR_Q_QUERY_GROUPINFO - SAM Group Info */ typedef struct q_samr_query_group_info { @@ -1218,46 +1137,6 @@ typedef struct r_samr_set_group_info } SAMR_R_SET_GROUPINFO; -/* SAMR_Q_DELETE_DOM_ALIAS - delete domain alias */ -typedef struct q_samr_delete_dom_alias_info -{ - POLICY_HND alias_pol; /* policy handle */ - -} SAMR_Q_DELETE_DOM_ALIAS; - - -/* SAMR_R_DELETE_DOM_ALIAS - delete domain alias */ -typedef struct r_samr_delete_dom_alias_info -{ - POLICY_HND pol; /* policy handle */ - NTSTATUS status; /* return status */ - -} SAMR_R_DELETE_DOM_ALIAS; - - -/* SAMR_Q_CREATE_DOM_ALIAS - SAM create alias */ -typedef struct q_samr_create_dom_alias_info -{ - POLICY_HND dom_pol; /* policy handle */ - - UNIHDR hdr_acct_desc; - UNISTR2 uni_acct_desc; - - uint32 access_mask; /* 0x001f000f */ - -} SAMR_Q_CREATE_DOM_ALIAS; - -/* SAMR_R_CREATE_DOM_ALIAS - SAM create alias */ -typedef struct r_samr_create_dom_alias_info -{ - POLICY_HND alias_pol; /* policy handle */ - - uint32 rid; - NTSTATUS status; - -} SAMR_R_CREATE_DOM_ALIAS; - - /********************************************************/ typedef struct { @@ -1527,68 +1406,6 @@ typedef struct r_samr_lookup_rids_info } SAMR_R_LOOKUP_RIDS; -/* SAMR_Q_OPEN_USER - probably an open */ -typedef struct q_samr_open_user_info -{ - POLICY_HND domain_pol; /* policy handle */ - uint32 access_mask; /* 32 bit unknown - 0x02011b */ - uint32 user_rid; /* user RID */ - -} SAMR_Q_OPEN_USER; - - -/* SAMR_R_OPEN_USER - probably an open */ -typedef struct r_samr_open_user_info -{ - POLICY_HND user_pol; /* policy handle associated with unknown id */ - NTSTATUS status; /* return status */ - -} SAMR_R_OPEN_USER; - - -/* SAMR_Q_CREATE_USER - probably a create */ -typedef struct q_samr_create_user_info -{ - POLICY_HND domain_pol; /* policy handle */ - - UNIHDR hdr_name; /* unicode account name header */ - UNISTR2 uni_name; /* unicode account name */ - - uint32 acb_info; /* account control info */ - uint32 access_mask; /* 0xe005 00b0 */ - -} SAMR_Q_CREATE_USER; - - -/* SAMR_R_CREATE_USER - probably a create */ -typedef struct r_samr_create_user_info -{ - POLICY_HND user_pol; /* policy handle associated with user */ - - uint32 access_granted; - uint32 user_rid; /* user RID */ - NTSTATUS status; /* return status */ - -} SAMR_R_CREATE_USER; - - -/* SAMR_Q_DELETE_DOM_USER - delete domain user */ -typedef struct q_samr_delete_dom_user_info -{ - POLICY_HND user_pol; /* policy handle */ - -} SAMR_Q_DELETE_DOM_USER; - - -/* SAMR_R_DELETE_DOM_USER - delete domain user */ -typedef struct r_samr_delete_dom_user_info -{ - POLICY_HND pol; /* policy handle */ - NTSTATUS status; /* return status */ - -} SAMR_R_DELETE_DOM_USER; - - /* SAMR_Q_QUERY_GROUPMEM - query group members */ typedef struct q_samr_query_groupmem_info { @@ -1653,25 +1470,6 @@ typedef struct r_samr_add_group_mem_info } SAMR_R_ADD_GROUPMEM; -/* SAMR_Q_OPEN_GROUP - probably an open */ -typedef struct q_samr_open_group_info -{ - POLICY_HND domain_pol; /* policy handle */ - uint32 access_mask; /* 0x0000 0001, 0x0000 0003, 0x0000 001f */ - uint32 rid_group; /* rid */ - -} SAMR_Q_OPEN_GROUP; - - -/* SAMR_R_OPEN_GROUP - probably an open */ -typedef struct r_samr_open_group_info -{ - POLICY_HND pol; /* policy handle */ - NTSTATUS status; /* return status */ - -} SAMR_R_OPEN_GROUP; - - /* SAMR_Q_QUERY_ALIASMEM - query alias members */ typedef struct q_samr_query_aliasmem_info { @@ -1730,27 +1528,6 @@ typedef struct r_samr_del_alias_mem_info } SAMR_R_DEL_ALIASMEM; - -/* SAMR_Q_OPEN_ALIAS - probably an open */ -typedef struct q_samr_open_alias_info -{ - POLICY_HND dom_pol; - - uint32 access_mask; - uint32 rid_alias; - -} SAMR_Q_OPEN_ALIAS; - - -/* SAMR_R_OPEN_ALIAS - probably an open */ -typedef struct r_samr_open_alias_info -{ - POLICY_HND pol; /* policy handle */ - NTSTATUS status; /* return status */ - -} SAMR_R_OPEN_ALIAS; - - /* SAMR_Q_CONNECT_ANON - probably an open */ typedef struct q_samr_connect_anon_info { uint32 ptr; /* ptr? */ @@ -1823,31 +1600,6 @@ typedef struct r_samr_connect_info5 } SAMR_R_CONNECT5; -/* SAMR_Q_GET_DOM_PWINFO */ -typedef struct q_samr_get_dom_pwinfo -{ - uint32 ptr; - UNIHDR hdr_srv_name; - UNISTR2 uni_srv_name; - -} SAMR_Q_GET_DOM_PWINFO; - -#define DOMAIN_PASSWORD_COMPLEX 0x00000001 -#define DOMAIN_PASSWORD_NO_ANON_CHANGE 0x00000002 -#define DOMAIN_PASSWORD_NO_CLEAR_CHANGE 0x00000004 -#define DOMAIN_LOCKOUT_ADMINS 0x00000008 -#define DOMAIN_PASSWORD_STORE_CLEARTEXT 0x00000010 -#define DOMAIN_REFUSE_PASSWORD_CHANGE 0x00000020 - -/* SAMR_R_GET_DOM_PWINFO */ -typedef struct r_samr_get_dom_pwinfo -{ - uint16 min_pwd_length; - uint32 password_properties; - NTSTATUS status; - -} SAMR_R_GET_DOM_PWINFO; - /* SAMR_ENC_PASSWD */ typedef struct enc_passwd_info { @@ -1915,11 +1667,6 @@ typedef struct q_samr_chgpasswd_user3 } SAMR_Q_CHGPASSWD_USER3; -#define REJECT_REASON_OTHER 0x00000000 -#define REJECT_REASON_TOO_SHORT 0x00000001 -#define REJECT_REASON_IN_HISTORY 0x00000002 -#define REJECT_REASON_NOT_COMPLEX 0x00000005 - /* SAMR_CHANGE_REJECT */ typedef struct samr_change_reject { diff --git a/source3/include/smb.h b/source3/include/smb.h index 1222c9a73a..3e0c997997 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -27,7 +27,7 @@ #define _SMB_H /* logged when starting the various Samba daemons */ -#define COPYRIGHT_STARTUP_MESSAGE "Copyright Andrew Tridgell and the Samba Team 1992-2007" +#define COPYRIGHT_STARTUP_MESSAGE "Copyright Andrew Tridgell and the Samba Team 1992-2008" #if defined(LARGE_SMB_OFF_T) @@ -80,7 +80,8 @@ enum smb_read_errors { SMB_WRITE_ERROR, /* This error code can go into the client smb_rw_error. */ SMB_READ_BAD_SIG, SMB_NO_MEMORY, - SMB_DO_NOT_DO_TDIS /* cli_close_connection() check for this when smbfs wants to keep tree connected */ + SMB_DO_NOT_DO_TDIS, /* cli_close_connection() check for this when smbfs wants to keep tree connected */ + SMB_READ_BAD_DECRYPT }; #define DIR_STRUCT_SIZE 43 @@ -192,7 +193,7 @@ typedef uint32 codepoint_t; #define PIPE_NETLOGON_PLAIN "\\NETLOGON" #define PI_LSARPC 0 -#define PI_LSARPC_DS 1 +#define PI_DSSETUP 1 #define PI_SAMR 2 #define PI_NETLOGON 3 #define PI_SRVSVC 4 @@ -210,30 +211,6 @@ typedef uint32 codepoint_t; /* 64 bit time (100usec) since ????? - cifs6.txt, section 3.5, page 30 */ typedef uint64_t NTTIME; - -/* Allowable account control bits */ -#define ACB_DISABLED 0x00000001 /* 1 = User account disabled */ -#define ACB_HOMDIRREQ 0x00000002 /* 1 = Home directory required */ -#define ACB_PWNOTREQ 0x00000004 /* 1 = User password not required */ -#define ACB_TEMPDUP 0x00000008 /* 1 = Temporary duplicate account */ -#define ACB_NORMAL 0x00000010 /* 1 = Normal user account */ -#define ACB_MNS 0x00000020 /* 1 = MNS logon user account */ -#define ACB_DOMTRUST 0x00000040 /* 1 = Interdomain trust account */ -#define ACB_WSTRUST 0x00000080 /* 1 = Workstation trust account */ -#define ACB_SVRTRUST 0x00000100 /* 1 = Server trust account (BDC) */ -#define ACB_PWNOEXP 0x00000200 /* 1 = User password does not expire */ -#define ACB_AUTOLOCK 0x00000400 /* 1 = Account auto locked */ - -/* only valid for > Windows 2000 */ -#define ACB_ENC_TXT_PWD_ALLOWED 0x00000800 /* 1 = Text password encryped */ -#define ACB_SMARTCARD_REQUIRED 0x00001000 /* 1 = Smart Card required */ -#define ACB_TRUSTED_FOR_DELEGATION 0x00002000 /* 1 = Trusted for Delegation */ -#define ACB_NOT_DELEGATED 0x00004000 /* 1 = Not delegated */ -#define ACB_USE_DES_KEY_ONLY 0x00008000 /* 1 = Use DES key only */ -#define ACB_DONT_REQUIRE_PREAUTH 0x00010000 /* 1 = Preauth not required */ -#define ACB_PWEXPIRED 0x00020000 /* 1 = Password is expired */ -#define ACB_NO_AUTH_DATA_REQD 0x00080000 /* 1 = No authorization data required */ - #define MAX_HOURS_LEN 32 #ifndef MAXSUBAUTHS @@ -282,9 +259,6 @@ typedef struct dom_sid { uint32 sub_auths[MAXSUBAUTHS]; } DOM_SID; -#define dom_sid2 dom_sid -#define dom_sid28 dom_sid - enum id_mapping { ID_UNKNOWN = 0, ID_MAPPED, @@ -309,8 +283,17 @@ struct id_map { enum id_mapping status; }; -#include "librpc/ndr/misc.h" -#include "librpc/ndr/security.h" +/* used to hold an arbitrary blob of data */ +typedef struct data_blob { + uint8 *data; + size_t length; + void (*free)(struct data_blob *data_blob); +} DATA_BLOB; + +extern const DATA_BLOB data_blob_null; + +#include "librpc/gen_ndr/misc.h" +#include "librpc/gen_ndr/security.h" #include "librpc/ndr/libndr.h" #include "librpc/gen_ndr/lsa.h" #include "librpc/gen_ndr/dfs.h" @@ -321,6 +304,10 @@ struct id_map { #include "librpc/gen_ndr/wkssvc.h" #include "librpc/gen_ndr/echo.h" #include "librpc/gen_ndr/svcctl.h" +#include "librpc/gen_ndr/netlogon.h" +#include "librpc/gen_ndr/samr.h" +#include "librpc/gen_ndr/dssetup.h" +#include "librpc/gen_ndr/libnet_join.h" struct lsa_dom_info { bool valid; @@ -524,20 +511,13 @@ typedef struct files_struct { FAKE_FILE_HANDLE *fake_file_handle; struct notify_change_buf *notify; + + struct files_struct *base_fsp; /* placeholder for delete on close */ } files_struct; #include "ntquotas.h" #include "sysquotas.h" -/* used to hold an arbitrary blob of data */ -typedef struct data_blob { - uint8 *data; - size_t length; - void (*free)(struct data_blob *data_blob); -} DATA_BLOB; - -extern const DATA_BLOB data_blob_null; - /* * Structure used to keep directory state information around. * Used in NT change-notify code. @@ -594,6 +574,16 @@ struct trans_state { char *data; }; +/* + * Info about an alternate data stream + */ + +struct stream_struct { + SMB_OFF_T size; + SMB_OFF_T alloc_size; + char *name; +}; + /* Include VFS stuff */ #include "smb_acls.h" @@ -657,11 +647,17 @@ typedef struct connection_struct { bool used; int num_files_open; unsigned int num_smb_operations; /* Count of smb operations on this tree. */ + int encrypt_level; + bool encrypted_tid; + /* Semantics requested by the client or forced by the server config. */ bool case_sensitive; bool case_preserve; bool short_case_preserve; + /* Semantics provided by the underlying filesystem. */ + int fs_capabilities; + name_compare_entry *hide_list; /* Per-share list of files to return as hidden. */ name_compare_entry *veto_list; /* Per-share list of files to veto (never show). */ name_compare_entry *veto_oplock_list; /* Per-share list of files to refuse oplocks on. */ @@ -688,6 +684,8 @@ struct smb_request { const uint8 *inbuf; uint8 *outbuf; size_t unread_bytes; + bool encrypted; + connection_struct *conn; }; /* Defines for the sent_oplock_break field above. */ @@ -751,6 +749,7 @@ struct pending_message_list { struct pending_message_list *next, *prev; struct timeval request_time; /* When was this first issued? */ struct timeval end_time; /* When does this time out? */ + bool encrypted; DATA_BLOB buf; DATA_BLOB private_data; }; @@ -1370,6 +1369,9 @@ struct bitmap { #define NTCREATEX_OPTIONS_PRIVATE_DENY_DOS 0x01000000 #define NTCREATEX_OPTIONS_PRIVATE_DENY_FCB 0x02000000 +/* Private options for streams support */ +#define NTCREATEX_OPTIONS_PRIVATE_STREAM_DELETE 0x04000000 + /* Responses when opening a file. */ #define FILE_WAS_SUPERSEDED 0 #define FILE_WAS_OPENED 1 @@ -1900,6 +1902,8 @@ struct ea_list { #define SAMBA_POSIX_INHERITANCE_EA_NAME "user.SAMBA_PAI" /* EA to use for DOS attributes */ #define SAMBA_XATTR_DOS_ATTRIB "user.DOSATTRIB" +/* Prefix for DosStreams in the vfs_streams_xattr module */ +#define SAMBA_XATTR_DOSSTREAM_PREFIX "user.DosStream." #define UUID_SIZE 16 @@ -1930,4 +1934,15 @@ enum usershare_err { /* Different reasons for closing a file. */ enum file_close_type {NORMAL_CLOSE=0,SHUTDOWN_CLOSE,ERROR_CLOSE}; +/* Used in SMB_FS_OBJECTID_INFORMATION requests. Must be exactly 48 bytes. */ +#define SAMBA_EXTENDED_INFO_MAGIC 0x536d4261 /* "SmBa" */ +#define SAMBA_EXTENDED_INFO_VERSION_STRING_LENGTH 28 +struct smb_extended_info { + uint32 samba_magic; /* Always SAMBA_EXTRA_INFO_MAGIC */ + uint32 samba_version; /* Major/Minor/Release/Revision */ + uint32 samba_subversion; /* Prerelease/RC/Vendor patch */ + NTTIME samba_gitcommitdate; + char samba_version_string[SAMBA_EXTENDED_INFO_VERSION_STRING_LENGTH]; +}; + #endif /* _SMB_H */ diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index 0dfb596994..463a2bdb0b 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -160,7 +160,6 @@ #define ERROR_DOS(class,code) error_packet(outbuf,class,code,NT_STATUS_OK,__LINE__,__FILE__) #define ERROR_NT(status) error_packet(outbuf,0,0,status,__LINE__,__FILE__) -#define ERROR_OPEN(status) error_open(outbuf,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__) @@ -170,9 +169,6 @@ #define reply_botherror(req,status,eclass,ecode) reply_both_error(req,eclass,ecode,status,__LINE__,__FILE__) #define reply_unixerror(req,defclass,deferror) reply_unix_error(req,defclass,deferror,NT_STATUS_OK,__LINE__,__FILE__) -/* this is how errors are generated */ -#define UNIXERROR(defclass,deferror) unix_error_packet(outbuf,defclass,deferror,NT_STATUS_OK,__LINE__,__FILE__) - /* these are the datagram types */ #define DGRAM_DIRECT_UNIQUE 0x10 @@ -189,13 +185,16 @@ #define smb_offset(p,buf) (PTR_DIFF(p,buf+4) + chain_size) #define smb_len(buf) (PVAL(buf,3)|(PVAL(buf,2)<<8)|((PVAL(buf,1)&1)<<16)) -#define _smb_setlen(buf,len) do { buf[0] = 0; buf[1] = (len&0x10000)>>16; \ - buf[2] = (len&0xFF00)>>8; buf[3] = len&0xFF; } while (0) +#define _smb_setlen(buf,len) do { buf[0] = 0; buf[1] = ((len)&0x10000)>>16; \ + buf[2] = ((len)&0xFF00)>>8; buf[3] = (len)&0xFF; } while (0) #define smb_len_large(buf) (PVAL(buf,3)|(PVAL(buf,2)<<8)|(PVAL(buf,1)<<16)) #define _smb_setlen_large(buf,len) do { buf[0] = 0; buf[1] = ((len)&0xFF0000)>>16; \ buf[2] = ((len)&0xFF00)>>8; buf[3] = (len)&0xFF; } while (0) +#define ENCRYPTION_REQUIRED(conn) ((conn) ? ((conn)->encrypt_level == Required) : false) +#define IS_CONN_ENCRYPTED(conn) ((conn) ? (conn)->encrypted_tid : false) + /******************************************************************* find the difference in milliseconds between two struct timeval values @@ -386,4 +385,12 @@ do { \ #define ISDOTDOT(p) (*(p) == '.' && *((p) + 1) == '.' && *((p) + 2) == '\0') #endif /* ISDOTDOT */ +#ifndef toupper_ascii_fast +/* Warning - this must only be called with 0 <= c < 128. IT WILL + * GIVE GARBAGE if c > 128 or c < 0. JRA. + */ +extern char toupper_ascii_fast_table[]; +#define toupper_ascii_fast(c) toupper_ascii_fast_table[(unsigned int)(c)]; +#endif + #endif /* _SMB_MACROS_H */ diff --git a/source3/include/talloc_stack.h b/source3/include/talloc_stack.h index 331893cbd6..a2a12f8a63 100644 --- a/source3/include/talloc_stack.h +++ b/source3/include/talloc_stack.h @@ -45,6 +45,7 @@ */ TALLOC_CTX *talloc_stackframe(void); +TALLOC_CTX *talloc_stackframe_pool(size_t poolsize); /* * Get us the current top of the talloc stack. diff --git a/source3/include/trans2.h b/source3/include/trans2.h index f7f3ef2149..3759d59681 100644 --- a/source3/include/trans2.h +++ b/source3/include/trans2.h @@ -530,7 +530,8 @@ findfirst/findnext is SMB_FIND_FILE_UNIX_INFO2. #define CIFS_UNIX_POSIX_PATH_OPERATIONS_CAP 0x20 /* We can cope with POSIX open/mkdir/unlink etc. */ #define CIFS_UNIX_LARGE_READ_CAP 0x40 /* We can cope with 24 bit reads in readX. */ #define CIFS_UNIX_LARGE_WRITE_CAP 0x80 /* We can cope with 24 bit writes in writeX. */ - +#define CIFS_UNIX_TRANSPORT_ENCRYPTION_CAP 0x100 /* We can do SPNEGO negotiations for encryption. */ +#define CIFS_UNIX_TRANSPORT_ENCRYPTION_MANDATORY_CAP 0x200 /* We *must* SPNEGO negotiations for encryption. */ #define SMB_QUERY_POSIX_FS_INFO 0x201 @@ -566,7 +567,6 @@ findfirst/findnext is SMB_FIND_FILE_UNIX_INFO2. __u8 * psid_list may be empty */ - /* ... more as we think of them :-). */ /* SMB POSIX ACL definitions. */ @@ -653,6 +653,29 @@ enum smb_whoami_flags { DOM_SID[] - list of SIDs (may be empty) */ +/* + * The following trans2 is done between client and server + * as a FSINFO call to set up the encryption state for transport + * encryption. + * This is a subcommand of the TRANS2_QFSINFO. + * + * The request looks like : + * + * [data block] -> SPNEGO framed GSSAPI request. + * + * The reply looks like : + * + * [data block] -> SPNEGO framed GSSAPI reply - if error + * is NT_STATUS_OK then we're done, if it's + * NT_STATUS_MORE_PROCESSING_REQUIRED then the + * client needs to keep going. If it's an + * error it can be any NT_STATUS error. + * + */ + +#define SMB_REQUEST_TRANSPORT_ENCRYPTION 0x203 /* QFSINFO */ + + /* The query/set info levels for POSIX ACLs. */ #define SMB_QUERY_POSIX_ACL 0x204 #define SMB_SET_POSIX_ACL 0x204 diff --git a/source3/include/transfer_file.h b/source3/include/transfer_file.h new file mode 100644 index 0000000000..79ad9c4c34 --- /dev/null +++ b/source3/include/transfer_file.h @@ -0,0 +1,32 @@ +/* + * Unix SMB/CIFS implementation. + * Utility functions to transfer files. + * + * Copyright (C) Michael Adam 2008 + * + * 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 3 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, see <http://www.gnu.org/licenses/>. + */ + +#ifndef __TRANSFER_FILE_H__ +#define __TRANSFER_FILE_H__ + +ssize_t transfer_file_internal(void *in_file, + void *out_file, + size_t n, + ssize_t (*read_fn)(void *, void *, size_t), + ssize_t (*write_fn)(void *, const void *, size_t)); + +SMB_OFF_T transfer_file(int infd, int outfd, SMB_OFF_T n); + +#endif /* __TRANSFER_FILE_H__ */ diff --git a/source3/include/vfs.h b/source3/include/vfs.h index b45320dd87..ca176aabb2 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -75,6 +75,37 @@ /* Leave at 22 - not yet released. Change all BOOL parameters (int) to bool. jra. */ /* Leave at 22 - not yet released. Added recvfile. */ /* Leave at 22 - not yet released. Change get_nt_acl to return NTSTATUS - vl */ +/* Leave at 22 - not yet released. Change get_nt_acl to *not* take a + * files_struct. - obnox.*/ +/* Leave at 22 - not yet released. Remove parameter fd from fget_nt_acl. - obnox */ +/* Leave at 22 - not yet released. Remove parameter fd from gset_nt_acl. - obnox */ +/* Leave at 22 - not yet released. Remove parameter fd from pread. - obnox */ +/* Leave at 22 - not yet released. Remove parameter fd from pwrite. - obnox */ +/* Leave at 22 - not yet released. Remove parameter fd from lseek. - obnox */ +/* Leave at 22 - not yet released. Remove parameter fd from fsync. - obnox */ +/* Leave at 22 - not yet released. Remove parameter fd from fstat. - obnox */ +/* Leave at 22 - not yet released. Remove parameter fd from fchmod. - obnox */ +/* Leave at 22 - not yet released. Remove parameter fd from fchown. - obnox */ +/* Leave at 22 - not yet released. Remove parameter fd from ftruncate. - obnox */ +/* Leave at 22 - not yet released. Remove parameter fd from lock. - obnox */ +/* Leave at 22 - not yet released. Remove parameter fd from kernel_flock. - obnox */ +/* Leave at 22 - not yet released. Remove parameter fd from linux_setlease. - obnox */ +/* Leave at 22 - not yet released. Remove parameter fd from getlock. - obnox */ +/* Leave at 22 - not yet released. Remove parameter fd from sys_acl_get_fd. - obnox */ +/* Leave at 22 - not yet released. Remove parameter fd from fchmod_acl. - obnox */ +/* Leave at 22 - not yet released. Remove parameter fd from sys_acl_set_fd. - obnox */ +/* Leave at 22 - not yet released. Remove parameter fd from fgetxattr. - obnox */ +/* Leave at 22 - not yet released. Remove parameter fd from flistxattr. - obnox */ +/* Leave at 22 - not yet released. Remove parameter fd from fremovexattr. - obnox */ +/* Leave at 22 - not yet released. Remove parameter fd from fsetxattr. - obnox */ +/* Leave at 22 - not yet released. Remove parameter fd from aio_cancel. - obnox */ +/* Leave at 22 - not yet released. Remove parameter fd from read. - obnox */ +/* Leave at 22 - not yet released. Remove parameter fd from write. - obnox */ +/* Leave at 22 - not yet released. Remove parameter fromfd from sendfile. - obnox */ +/* Leave at 22 - not yet released. Remove parameter fromfd from recvfile. - obnox */ +/* Leave at 22 - not yet released. Additional change: add operations for offline files -- ab */ +/* Leave at 22 - not yet released. Add the streaminfo call. -- jpeach, vl */ + #define SMB_VFS_INTERFACE_VERSION 22 @@ -118,6 +149,7 @@ typedef enum _vfs_op_type { SMB_VFS_OP_SET_QUOTA, SMB_VFS_OP_GET_SHADOW_COPY_DATA, SMB_VFS_OP_STATVFS, + SMB_VFS_OP_FS_CAPABILITIES, /* Directory operations */ @@ -168,6 +200,7 @@ typedef enum _vfs_op_type { SMB_VFS_OP_NOTIFY_WATCH, SMB_VFS_OP_CHFLAGS, SMB_VFS_OP_FILE_ID_CREATE, + SMB_VFS_OP_STREAMINFO, /* NT ACL operations. */ @@ -226,9 +259,14 @@ typedef enum _vfs_op_type { SMB_VFS_OP_AIO_ERROR, SMB_VFS_OP_AIO_FSYNC, SMB_VFS_OP_AIO_SUSPEND, + SMB_VFS_OP_AIO_FORCE, + + /* offline operations */ + SMB_VFS_OP_IS_OFFLINE, + SMB_VFS_OP_SET_OFFLINE, /* This should always be last enum value */ - + SMB_VFS_OP_LAST } vfs_op_type; @@ -238,7 +276,7 @@ typedef enum _vfs_op_type { struct vfs_ops { struct vfs_fn_pointers { /* Disk operations */ - + 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, @@ -247,9 +285,10 @@ struct vfs_ops { 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, const char *path, struct vfs_statvfs_struct *statbuf); - + uint32_t (*fs_capabilities)(struct vfs_handle_struct *handle); + /* Directory operations */ - + 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); @@ -258,37 +297,37 @@ struct vfs_ops { 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, 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); - ssize_t (*write)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, const void *data, size_t n); - 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); - ssize_t (*recvfile)(struct vfs_handle_struct *handle, int fromfd, files_struct *fsp, int tofd, SMB_OFF_T offset, size_t count); + ssize_t (*read)(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n); + ssize_t (*pread)(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n, SMB_OFF_T offset); + ssize_t (*write)(struct vfs_handle_struct *handle, struct files_struct *fsp, const void *data, size_t n); + ssize_t (*pwrite)(struct vfs_handle_struct *handle, struct files_struct *fsp, const void *data, size_t n, SMB_OFF_T offset); + SMB_OFF_T (*lseek)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_OFF_T offset, int whence); + ssize_t (*sendfile)(struct vfs_handle_struct *handle, int tofd, files_struct *fromfsp, const DATA_BLOB *header, SMB_OFF_T offset, size_t count); + ssize_t (*recvfile)(struct vfs_handle_struct *handle, int fromfd, files_struct *tofsp, SMB_OFF_T offset, size_t count); 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 (*fsync)(struct vfs_handle_struct *handle, struct files_struct *fsp); 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 (*fstat)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_STAT *sbuf); 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 (*fchmod)(struct vfs_handle_struct *handle, struct files_struct *fsp, mode_t mode); 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 (*fchown)(struct vfs_handle_struct *handle, struct files_struct *fsp, uid_t uid, gid_t gid); int (*lchown)(struct vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid); int (*chdir)(struct vfs_handle_struct *handle, const char *path); char *(*getwd)(struct vfs_handle_struct *handle, char *buf); int (*ntimes)(struct vfs_handle_struct *handle, const char *path, const struct timespec ts[2]); - 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 (*ftruncate)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_OFF_T offset); + bool (*lock)(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type); + int (*kernel_flock)(struct vfs_handle_struct *handle, struct files_struct *fsp, uint32 share_mode); + int (*linux_setlease)(struct vfs_handle_struct *handle, struct files_struct *fsp, int leasetype); + bool (*getlock)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid); 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); @@ -304,31 +343,44 @@ struct vfs_ops { int (*chflags)(struct vfs_handle_struct *handle, const char *path, unsigned int flags); struct file_id (*file_id_create)(struct vfs_handle_struct *handle, SMB_DEV_T dev, SMB_INO_T inode); + NTSTATUS (*streaminfo)(struct vfs_handle_struct *handle, + struct files_struct *fsp, + const char *fname, + TALLOC_CTX *mem_ctx, + unsigned int *num_streams, + struct stream_struct **streams); + /* NT ACL operations. */ - + NTSTATUS (*fget_nt_acl)(struct vfs_handle_struct *handle, - struct files_struct *fsp, int fd, + struct files_struct *fsp, uint32 security_info, struct security_descriptor **ppdesc); NTSTATUS (*get_nt_acl)(struct vfs_handle_struct *handle, - struct files_struct *fsp, const char *name, uint32 security_info, struct security_descriptor **ppdesc); - NTSTATUS (*fset_nt_acl)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, uint32 security_info_sent, struct security_descriptor *psd); - NTSTATUS (*set_nt_acl)(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, uint32 security_info_sent, struct security_descriptor *psd); - + NTSTATUS (*fset_nt_acl)(struct vfs_handle_struct *handle, + struct files_struct *fsp, + uint32 security_info_sent, + struct security_descriptor *psd); + NTSTATUS (*set_nt_acl)(struct vfs_handle_struct *handle, + struct files_struct *fsp, + const char *name, + uint32 security_info_sent, + struct security_descriptor *psd); + /* POSIX ACL operations. */ - + 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 (*fchmod_acl)(struct vfs_handle_struct *handle, struct files_struct *fsp, mode_t mode); + 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); + SMB_ACL_T (*sys_acl_get_fd)(struct vfs_handle_struct *handle, struct files_struct *fsp); 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); @@ -339,7 +391,7 @@ struct vfs_ops { 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_set_fd)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_ACL_T theacl); 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); @@ -349,26 +401,30 @@ struct vfs_ops { /* EA operations. */ 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 (*fgetxattr)(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, void *value, 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); + ssize_t (*flistxattr)(struct vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size); 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 (*fremovexattr)(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name); 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); + int (*fsetxattr)(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, const void *value, size_t size, int flags); /* aio operations */ int (*aio_read)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); int (*aio_write)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); ssize_t (*aio_return_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); - int (*aio_cancel)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_STRUCT_AIOCB *aiocb); + int (*aio_cancel)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); int (*aio_error_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); int (*aio_fsync)(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_STRUCT_AIOCB *aiocb); int (*aio_suspend)(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_AIOCB * const aiocb[], int n, const struct timespec *timeout); + bool (*aio_force)(struct vfs_handle_struct *handle, struct files_struct *fsp); + /* offline operations */ + bool (*is_offline)(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf); + int (*set_offline)(struct vfs_handle_struct *handle, const char *path); } ops; struct vfs_handles_pointers { @@ -381,6 +437,7 @@ struct vfs_ops { struct vfs_handle_struct *set_quota; struct vfs_handle_struct *get_shadow_copy_data; struct vfs_handle_struct *statvfs; + struct vfs_handle_struct *fs_capabilities; /* Directory operations */ @@ -431,6 +488,7 @@ struct vfs_ops { struct vfs_handle_struct *notify_watch; struct vfs_handle_struct *chflags; struct vfs_handle_struct *file_id_create; + struct vfs_handle_struct *streaminfo; /* NT ACL operations. */ @@ -489,27 +547,32 @@ struct vfs_ops { struct vfs_handle_struct *aio_error; struct vfs_handle_struct *aio_fsync; struct vfs_handle_struct *aio_suspend; + struct vfs_handle_struct *aio_force; + + /* offline operations */ + struct vfs_handle_struct *is_offline; + struct vfs_handle_struct *set_offline; } handles; }; /* Possible VFS operation layers (per-operation) - + These values are used by VFS subsystem when building vfs_ops for connection from multiple VFS modules. Internally, Samba differentiates only opaque and transparent layers at this process. Other types are used for providing better diagnosing facilities. - + Most modules will provide transparent layers. Opaque layer is for modules which implement actual file system calls (like DB-based VFS). For example, default POSIX VFS which is built in into Samba is an opaque VFS module. - + Other layer types (audit, splitter, scanner) were designed to provide different degree of transparency and for diagnosing VFS module behaviour. - + Each module can implement several layers at the same time provided that only one layer is used per each operation. - + */ typedef enum _vfs_op_layer { @@ -528,7 +591,7 @@ typedef enum _vfs_op_layer { /* VFS operation description. Each VFS module registers an array of vfs_op_tuple to VFS subsystem, - which describes all operations this module is willing to intercept. + which describes all operations this module is willing to intercept. VFS subsystem initializes then the conn->vfs_ops and conn->vfs_opaque_ops structs using this information. */ @@ -553,12 +616,12 @@ typedef struct vfs_handle_struct { typedef struct vfs_statvfs_struct { /* For undefined recommended transfer size return -1 in that field */ uint32 OptimalTransferSize; /* bsize on some os, iosize on other os */ - uint32 BlockSize; + uint32 BlockSize; /* The next three fields are in terms of the block size. (above). If block size is unknown, 4096 would be a - reasonable block size for a server to report. + reasonable block size for a server to report. Note that returning the blocks/blocksavail removes need to make a second call (to QFSInfo level 0x103 to get this info. UserBlockAvail is typically less than or equal to BlocksAvail, @@ -575,14 +638,25 @@ typedef struct vfs_statvfs_struct { SMB_BIG_UINT FsIdentifier; /* fsid */ /* NB Namelen comes from FILE_SYSTEM_ATTRIBUTE_INFO call */ /* NB flags can come from FILE_SYSTEM_DEVICE_INFO call */ + + int FsCapabilities; } vfs_statvfs_struct; +/* Add a new FSP extension of the given type. Returns a pointer to the + * extenstion data. + */ #define VFS_ADD_FSP_EXTENSION(handle, fsp, type) \ vfs_add_fsp_extension_notype(handle, (fsp), sizeof(type)) +/* Return a pointer to the existing FSP extension data. */ #define VFS_FETCH_FSP_EXTENSION(handle, fsp) \ vfs_fetch_fsp_extension(handle, (fsp)) +/* Return the talloc context associated with an FSP extension. */ +#define VFS_MEMCTX_FSP_EXTENSION(handle, fsp) \ + vfs_memctx_fsp_extension(handle, (fsp)) + +/* Remove and destroy an FSP extension. */ #define VFS_REMOVE_FSP_EXTENSION(handle, fsp) \ vfs_remove_fsp_extension((handle), (fsp)) diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index cc7780f354..1e64bd5ac3 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -1,18 +1,18 @@ -/* +/* Unix SMB/CIFS implementation. VFS wrapper macros Copyright (C) Stefan (metze) Metzmacher 2003 - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 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, see <http://www.gnu.org/licenses/>. */ @@ -26,7 +26,7 @@ (Fixes should go also into the vfs_opaque_* and vfs_next_* macros!) ********************************************************************/ -/* Disk operations */ +/* Disk operations */ #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))) @@ -34,6 +34,7 @@ #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, (path), (statbuf))) +#define SMB_VFS_FS_CAPABILITIES(conn) ((conn)->vfs.ops.fs_capabilities((conn)->vfs.handles.fs_capabilities)) /* Directory operations */ #define SMB_VFS_OPENDIR(conn, fname, mask, attr) ((conn)->vfs.ops.opendir((conn)->vfs.handles.opendir, (fname), (mask), (attr))) @@ -44,36 +45,36 @@ #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, 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))) -#define SMB_VFS_WRITE(fsp, fd, data, n) ((fsp)->conn->vfs.ops.write((fsp)->conn->vfs.handles.write, (fsp), (fd), (data), (n))) -#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_RECVFILE(fromfd, fsp, tofd, offset, count) ((fsp)->conn->vfs.ops.recvfile((fsp)->conn->vfs.handles.recvfile, (fromfd), (fsp), (tofd), (offset), (count))) +#define SMB_VFS_READ(fsp, data, n) ((fsp)->conn->vfs.ops.read((fsp)->conn->vfs.handles.read, (fsp), (data), (n))) +#define SMB_VFS_PREAD(fsp, data, n, off) ((fsp)->conn->vfs.ops.pread((fsp)->conn->vfs.handles.pread, (fsp), (data), (n), (off))) +#define SMB_VFS_WRITE(fsp, data, n) ((fsp)->conn->vfs.ops.write((fsp)->conn->vfs.handles.write, (fsp), (data), (n))) +#define SMB_VFS_PWRITE(fsp, data, n, off) ((fsp)->conn->vfs.ops.pwrite((fsp)->conn->vfs.handles.pwrite, (fsp), (data), (n), (off))) +#define SMB_VFS_LSEEK(fsp, offset, whence) ((fsp)->conn->vfs.ops.lseek((fsp)->conn->vfs.handles.lseek, (fsp), (offset), (whence))) +#define SMB_VFS_SENDFILE(tofd, fromfsp, header, offset, count) ((fsp)->conn->vfs.ops.sendfile((fsp)->conn->vfs.handles.sendfile, (tofd), (fromfsp), (header), (offset), (count))) +#define SMB_VFS_RECVFILE(fromfd, tofsp, offset, count) ((fsp)->conn->vfs.ops.recvfile((fsp)->conn->vfs.handles.recvfile, (fromfd), (tofsp), (offset), (count))) #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_FSYNC(fsp) ((fsp)->conn->vfs.ops.fsync((fsp)->conn->vfs.handles.fsync, (fsp))) #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_FSTAT(fsp, sbuf) ((fsp)->conn->vfs.ops.fstat((fsp)->conn->vfs.handles.fstat, (fsp), (sbuf))) #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_FCHMOD(fsp, mode) ((fsp)->conn->vfs.ops.fchmod((fsp)->conn->vfs.handles.fchmod, (fsp), (mode))) #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_FCHOWN(fsp, uid, gid) ((fsp)->conn->vfs.ops.fchown((fsp)->conn->vfs.handles.fchown, (fsp), (uid), (gid))) #define SMB_VFS_LCHOWN(conn, path, uid, gid) ((conn)->vfs.ops.lchown((conn)->vfs.handles.lchown, (path), (uid), (gid))) #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_NTIMES(conn, path, ts) ((conn)->vfs.ops.ntimes((conn)->vfs.handles.ntimes, (path), (ts))) -#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_FTRUNCATE(fsp, offset) ((fsp)->conn->vfs.ops.ftruncate((fsp)->conn->vfs.handles.ftruncate, (fsp), (offset))) +#define SMB_VFS_LOCK(fsp, op, offset, count, type) ((fsp)->conn->vfs.ops.lock((fsp)->conn->vfs.handles.lock, (fsp), (op), (offset), (count), (type))) +#define SMB_VFS_KERNEL_FLOCK(fsp, share_mode) ((fsp)->conn->vfs.ops.kernel_flock((fsp)->conn->vfs.handles.kernel_flock, (fsp), (share_mode))) +#define SMB_VFS_LINUX_SETLEASE(fsp, leasetype) ((fsp)->conn->vfs.ops.linux_setlease((fsp)->conn->vfs.handles.linux_setlease, (fsp), (leasetype))) +#define SMB_VFS_GETLOCK(fsp, poffset, pcount, ptype, ppid) ((fsp)->conn->vfs.ops.getlock((fsp)->conn->vfs.handles.getlock, (fsp), (poffset), (pcount), (ptype), (ppid))) #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))) @@ -82,23 +83,24 @@ #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))) #define SMB_VFS_CHFLAGS(conn, path, flags) ((conn)->vfs.ops.chflags((conn)->vfs.handles.chflags, (path), (flags))) #define SMB_VFS_FILE_ID_CREATE(conn, dev, inode) ((conn)->vfs.ops.file_id_create((conn)->vfs.handles.file_id_create, (dev), (inode))) +#define SMB_VFS_STREAMINFO(conn, fsp, fname, mem_ctx, num_streams, streams) ((conn)->vfs.ops.streaminfo((conn)->vfs.handles.streaminfo, (fsp), (fname), (mem_ctx), (num_streams), (streams))) /* 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))) -#define SMB_VFS_GET_NT_ACL(fsp, name, security_info, ppdesc) ((fsp)->conn->vfs.ops.get_nt_acl((fsp)->conn->vfs.handles.get_nt_acl, (fsp), (name), (security_info), (ppdesc))) -#define SMB_VFS_FSET_NT_ACL(fsp, fd, security_info_sent, psd) ((fsp)->conn->vfs.ops.fset_nt_acl((fsp)->conn->vfs.handles.fset_nt_acl, (fsp), (fd), (security_info_sent), (psd))) +#define SMB_VFS_FGET_NT_ACL(fsp, security_info, ppdesc) ((fsp)->conn->vfs.ops.fget_nt_acl((fsp)->conn->vfs.handles.fget_nt_acl, (fsp), (security_info), (ppdesc))) +#define SMB_VFS_GET_NT_ACL(conn, name, security_info, ppdesc) ((conn)->vfs.ops.get_nt_acl((conn)->vfs.handles.get_nt_acl, (name), (security_info), (ppdesc))) +#define SMB_VFS_FSET_NT_ACL(fsp, security_info_sent, psd) ((fsp)->conn->vfs.ops.fset_nt_acl((fsp)->conn->vfs.handles.fset_nt_acl, (fsp), (security_info_sent), (psd))) #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, (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_FCHMOD_ACL(fsp, mode) ((fsp)->conn->vfs.ops.fchmod_acl((fsp)->conn->vfs.handles.chmod_acl, (fsp), (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, (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_GET_FD(fsp) ((fsp)->conn->vfs.ops.sys_acl_get_fd((fsp)->conn->vfs.handles.sys_acl_get_fd, (fsp))) #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))) @@ -109,7 +111,7 @@ #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_SET_FD(fsp, theacl) ((fsp)->conn->vfs.ops.sys_acl_set_fd((fsp)->conn->vfs.handles.sys_acl_set_fd, (fsp), (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, (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))) @@ -119,25 +121,30 @@ /* EA operations. */ #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_FGETXATTR(fsp,name,value,size) ((fsp)->conn->vfs.ops.fgetxattr((fsp)->conn->vfs.handles.fgetxattr,(fsp),(name),(value),(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_FLISTXATTR(fsp,list,size) ((fsp)->conn->vfs.ops.flistxattr((fsp)->conn->vfs.handles.flistxattr,(fsp),(list),(size))) #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_FREMOVEXATTR(fsp,name) ((fsp)->conn->vfs.ops.fremovexattr((fsp)->conn->vfs.handles.fremovexattr,(fsp),(name))) #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))) +#define SMB_VFS_FSETXATTR(fsp,name,value,size,flags) ((fsp)->conn->vfs.ops.fsetxattr((fsp)->conn->vfs.handles.fsetxattr,(fsp),(name),(value),(size),(flags))) /* AIO operations. */ #define SMB_VFS_AIO_READ(fsp,aiocb) ((fsp)->conn->vfs.ops.aio_read((fsp)->conn->vfs.handles.aio_read,(fsp),(aiocb))) #define SMB_VFS_AIO_WRITE(fsp,aiocb) ((fsp)->conn->vfs.ops.aio_write((fsp)->conn->vfs.handles.aio_write,(fsp),(aiocb))) #define SMB_VFS_AIO_RETURN(fsp,aiocb) ((fsp)->conn->vfs.ops.aio_return_fn((fsp)->conn->vfs.handles.aio_return,(fsp),(aiocb))) -#define SMB_VFS_AIO_CANCEL(fsp,fd,aiocb) ((fsp)->conn->vfs.ops.aio_cancel((fsp)->conn->vfs.handles.aio_cancel,(fsp),(fd),(aiocb))) +#define SMB_VFS_AIO_CANCEL(fsp,aiocb) ((fsp)->conn->vfs.ops.aio_cancel((fsp)->conn->vfs.handles.aio_cancel,(fsp),(aiocb))) #define SMB_VFS_AIO_ERROR(fsp,aiocb) ((fsp)->conn->vfs.ops.aio_error_fn((fsp)->conn->vfs.handles.aio_error,(fsp),(aiocb))) #define SMB_VFS_AIO_FSYNC(fsp,op,aiocb) ((fsp)->conn->vfs.ops.aio_fsync((fsp)->conn->vfs.handles.aio_fsync,(fsp),(op),(aiocb))) #define SMB_VFS_AIO_SUSPEND(fsp,aiocb,n,ts) ((fsp)->conn->vfs.ops.aio_suspend((fsp)->conn->vfs.handles.aio_suspend,(fsp),(aiocb),(n),(ts))) +#define SMB_VFS_AIO_FORCE(fsp) ((fsp)->conn->vfs.ops.aio_force((fsp)->conn->vfs.handles.aio_force,(fsp))) + +/* Offline operations */ +#define SMB_VFS_IS_OFFLINE(conn,path,sbuf) ((conn)->vfs.ops.is_offline((conn)->vfs.handles.is_offline,(path),(sbuf))) +#define SMB_VFS_SET_OFFLINE(conn,path) ((conn)->vfs.ops.set_offline((conn)->vfs.handles.set_offline,(path))) /******************************************************************* Don't access conn->vfs_opaque.ops directly!!! @@ -145,7 +152,7 @@ (Fixes should also go into the vfs_* and vfs_next_* macros!) ********************************************************************/ -/* Disk operations */ +/* Disk operations */ #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))) @@ -153,6 +160,7 @@ #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, (path), (statbuf))) +#define SMB_VFS_OPAQUE_FS_CAPABILITIES(conn) ((conn)->vfs_opaque.ops.fs_capabilities((conn)->vfs_opaque.handles.fs_capabilities)) /* Directory operations */ #define SMB_VFS_OPAQUE_OPENDIR(conn, fname, mask, attr) ((conn)->vfs_opaque.ops.opendir((conn)->vfs_opaque.handles.opendir, (fname), (mask), (attr))) @@ -163,36 +171,36 @@ #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, 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))) -#define SMB_VFS_OPAQUE_WRITE(fsp, fd, data, n) ((fsp)->conn->vfs_opaque.ops.write((fsp)->conn->vfs_opaque.handles.write, (fsp), (fd), (data), (n))) -#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_RECVFILE(fromfd, fsp, tofd, offset, count) ((fsp)->conn->vfs_opaque.ops.recvfile((fsp)->conn->vfs_opaque.handles.recvfile, (fromfd), (fsp), (tofd), (offset), (count))) +#define SMB_VFS_OPAQUE_READ(fsp, data, n) ((fsp)->conn->vfs_opaque.ops.read((fsp)->conn->vfs_opaque.handles.read, (fsp), (data), (n))) +#define SMB_VFS_OPAQUE_PREAD(fsp, data, n, off) ((fsp)->conn->vfs_opaque.ops.pread((fsp)->conn->vfs_opaque.handles.pread, (fsp), (data), (n), (off))) +#define SMB_VFS_OPAQUE_WRITE(fsp, data, n) ((fsp)->conn->vfs_opaque.ops.write((fsp)->conn->vfs_opaque.handles.write, (fsp), (data), (n))) +#define SMB_VFS_OPAQUE_PWRITE(fsp, data, n, off) ((fsp)->conn->vfs_opaque.ops.pwrite((fsp)->conn->vfs_opaque.handles.pwrite, (fsp), (data), (n), (off))) +#define SMB_VFS_OPAQUE_LSEEK(fsp, offset, whence) ((fsp)->conn->vfs_opaque.ops.lseek((fsp)->conn->vfs_opaque.handles.lseek, (fsp), (offset), (whence))) +#define SMB_VFS_OPAQUE_SENDFILE(tofd, fromfsp, header, offset, count) ((fsp)->conn->vfs_opaque.ops.sendfile((fsp)->conn->vfs_opaque.handles.sendfile, (tofd), (fromfsp), (header), (offset), (count))) +#define SMB_VFS_OPAQUE_RECVFILE(fromfd, tofsp, offset, count) ((fsp)->conn->vfs_opaque.ops.recvfile((fsp)->conn->vfs_opaque.handles.recvfile, (fromfd), (tofsp), (offset), (count))) #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_FSYNC(fsp) ((fsp)->conn->vfs_opaque.ops.fsync((fsp)->conn->vfs_opaque.handles.fsync, (fsp))) #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_FSTAT(fsp, sbuf) ((fsp)->conn->vfs_opaque.ops.fstat((fsp)->conn->vfs_opaque.handles.fstat, (fsp), (sbuf))) #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_FCHMOD(fsp, mode) ((fsp)->conn->vfs_opaque.ops.fchmod((fsp)->conn->vfs_opaque.handles.fchmod, (fsp), (mode))) #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_FCHOWN(fsp, uid, gid) ((fsp)->conn->vfs_opaque.ops.fchown((fsp)->conn->vfs_opaque.handles.fchown, (fsp), (uid), (gid))) #define SMB_VFS_OPAQUE_LCHOWN(conn, path, uid, gid) ((conn)->vfs_opaque.ops.lchown((conn)->vfs_opaque.handles.lchown, (path), (uid), (gid))) #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_NTIMES(conn, path, ts) ((conn)->vfs_opaque.ops.ntimes((conn)->vfs_opaque.handles.ntimes, (path), (ts))) -#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_FTRUNCATE(fsp, offset) ((fsp)->conn->vfs_opaque.ops.ftruncate((fsp)->conn->vfs_opaque.handles.ftruncate, (fsp), (offset))) +#define SMB_VFS_OPAQUE_LOCK(fsp, op, offset, count, type) ((fsp)->conn->vfs_opaque.ops.lock((fsp)->conn->vfs_opaque.handles.lock, (fsp), (op), (offset), (count), (type))) +#define SMB_VFS_OPAQUE_KERNEL_FLOCK(fsp, share_mode) ((fsp)->conn->vfs_opaque.ops.kernel_flock((fsp)->conn->vfs_opaque.handles.kernel_flock, (fsp), (share_mode))) +#define SMB_VFS_OPAQUE_LINUX_SETLEASE(fsp, leasetype) ((fsp)->conn->vfs_opaque.ops.linux_setlease((fsp)->conn->vfs_opaque.handles.linux_setlease, (fsp), (leasetype))) +#define SMB_VFS_OPAQUE_GETLOCK(fsp, poffset, pcount, ptype, ppid) ((fsp)->conn->vfs_opaque.ops.getlock((fsp)->conn->vfs_opaque.handles.getlock, (fsp), (poffset), (pcount), (ptype), (ppid))) #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))) @@ -201,23 +209,24 @@ #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))) #define SMB_VFS_OPAQUE_CHFLAGS(conn, path, flags) ((conn)->vfs_opaque.ops.chflags((conn)->vfs_opaque.handles.chflags, (path), (flags))) #define SMB_VFS_OPAQUE_FILE_ID_CREATE(conn, dev, inode) ((conn)->vfs.ops_opaque.file_id_create((conn)->vfs_opaque.handles.file_id_create, (dev), (inode))) +#define SMB_VFS_OPAQUE_STREAMINFO(conn, fsp, fname, mem_ctx, num_streams, streams) ((conn)->vfs_opaque.ops.streaminfo((conn)->vfs_opaque.handles.streaminfo, (fsp), (fname), (mem_ctx), (num_streams), (streams))) /* 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))) -#define SMB_VFS_OPAQUE_GET_NT_ACL(fsp, name, security_info, ppdesc) ((fsp)->conn->vfs_opaque.ops.get_nt_acl((fsp)->conn->vfs_opaque.handles.get_nt_acl, (fsp), (name), (security_info), (ppdesc))) -#define SMB_VFS_OPAQUE_FSET_NT_ACL(fsp, fd, security_info_sent, psd) ((fsp)->conn->vfs_opaque.ops.fset_nt_acl((fsp)->conn->vfs_opaque.handles.fset_nt_acl, (fsp), (fd), (security_info_sent), (psd))) +#define SMB_VFS_OPAQUE_FGET_NT_ACL(fsp, security_info, ppdesc) ((fsp)->conn->vfs_opaque.ops.fget_nt_acl((fsp)->conn->vfs_opaque.handles.fget_nt_acl, (fsp), (security_info), (ppdesc))) +#define SMB_VFS_OPAQUE_GET_NT_ACL(conn, name, security_info, ppdesc) ((conn)->vfs_opaque.ops.get_nt_acl((conn)->vfs_opaque.handles.get_nt_acl, (name), (security_info), (ppdesc))) +#define SMB_VFS_OPAQUE_FSET_NT_ACL(fsp, security_info_sent, psd) ((fsp)->conn->vfs_opaque.ops.fset_nt_acl((fsp)->conn->vfs_opaque.handles.fset_nt_acl, (fsp), (security_info_sent), (psd))) #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, (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_FCHMOD_ACL(fsp, mode) ((fsp)->conn->vfs_opaque.ops.fchmod_acl((fsp)->conn->vfs_opaque.handles.chmod_acl, (fsp), (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, (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_GET_FD(fsp) ((fsp)->conn->vfs_opaque.ops.sys_acl_get_fd((fsp)->conn->vfs_opaque.handles.sys_acl_get_fd, (fsp))) #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))) @@ -228,7 +237,7 @@ #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_SET_FD(fsp, theacl) ((fsp)->conn->vfs_opaque.ops.sys_acl_set_fd((fsp)->conn->vfs_opaque.handles.sys_acl_set_fd, (fsp), (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, (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))) @@ -238,25 +247,30 @@ /* EA operations. */ #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_FGETXATTR(fsp,name,value,size) ((fsp)->conn->vfs_opaque.ops.fgetxattr((fsp)->conn->vfs_opaque.handles.fgetxattr,(fsp),(name),(value),(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_FLISTXATTR(fsp,list,size) ((fsp)->conn->vfs_opaque.ops.flistxattr((fsp)->conn->vfs_opaque.handles.flistxattr,(fsp),(list),(size))) #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_FREMOVEXATTR(fsp,name) ((fsp)->conn->vfs_opaque.ops.fremovexattr((fsp)->conn->vfs_opaque.handles.fremovexattr,(fsp),(name))) #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))) +#define SMB_VFS_OPAQUE_FSETXATTR(fsp,name,value,size,flags) ((fsp)->conn->vfs_opaque.ops.fsetxattr((fsp)->conn->vfs_opaque.handles.fsetxattr,(fsp),(name),(value),(size),(flags))) /* AIO operations. */ #define SMB_VFS_OPAQUE_AIO_READ(fsp,aiocb) ((fsp)->conn->vfs_opaque.ops.aio_read((fsp)->conn->vfs_opaque.handles.aio_read,(fsp),(aiocb))) #define SMB_VFS_OPAQUE_AIO_WRITE(fsp,aiocb) ((fsp)->conn->vfs_opaque.ops.aio_write((fsp)->conn->vfs_opaque.handles.aio_write,(fsp),(aiocb))) #define SMB_VFS_OPAQUE_AIO_RETURN(fsp,aiocb) ((fsp)->conn->vfs_opaque.ops.aio_return_fn((fsp)->conn->vfs_opaque.handles.aio_return,(fsp),(aiocb))) -#define SMB_VFS_OPAQUE_AIO_CANCEL(fsp,fd,aiocb) ((fsp)->conn->vfs_opaque.ops.aio_cancel((fsp)->conn->vfs_opaque.handles.cancel,(fsp),(fd),(aiocb))) +#define SMB_VFS_OPAQUE_AIO_CANCEL(fsp,aiocb) ((fsp)->conn->vfs_opaque.ops.aio_cancel((fsp)->conn->vfs_opaque.handles.cancel,(fsp),(aiocb))) #define SMB_VFS_OPAQUE_AIO_ERROR(fsp,aiocb) ((fsp)->conn->vfs_opaque.ops.aio_error_fn((fsp)->conn->vfs_opaque.handles.aio_error,(fsp),(aiocb))) #define SMB_VFS_OPAQUE_AIO_FSYNC(fsp,op,aiocb) ((fsp)->conn->vfs_opaque.ops.aio_fsync((fsp)->conn->vfs_opaque.handles.aio_fsync,(fsp),(op),(aiocb))) #define SMB_VFS_OPAQUE_AIO_SUSPEND(fsp,aiocb,n,ts) ((fsp)->conn->vfs_opaque.ops.aio_suspend((fsp)->conn->vfs_opaque.handles.aio_suspend,(fsp),(aiocb),(n),(ts))) +#define SMB_VFS_OPAQUE_AIO_FORCE(fsp) ((fsp)->conn->vfs_opaque.ops.aio_force((fsp)->conn->vfs_opaque.handles.aio_force,(fsp))) + +/* Offline operations */ +#define SMB_VFS_OPAQUE_IS_OFFLINE(conn,path,sbuf) ((conn)->vfs_opaque.ops.is_offline((conn)->vfs_opaque.handles.is_offline,(path),(sbuf))) +#define SMB_VFS_OPAQUE_SET_OFFLINE(conn,path) ((conn)->vfs_opaque.ops.set_offline((conn)->vfs_opaque.handles.set_offline,(path))) /******************************************************************* Don't access handle->vfs_next.ops.* directly!!! @@ -264,7 +278,7 @@ (Fixes should go also into the vfs_* and vfs_opaque_* macros!) ********************************************************************/ -/* Disk operations */ +/* Disk operations */ #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))) @@ -272,6 +286,7 @@ #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, path, statbuf) ((handle)->vfs_next.ops.statvfs((handle)->vfs_next.handles.statvfs, (path), (statbuf))) +#define SMB_VFS_NEXT_FS_CAPABILITIES(handle) ((handle)->vfs_next.ops.fs_capabilities((handle)->vfs_next.handles.fs_capabilities)) /* Directory operations */ #define SMB_VFS_NEXT_OPENDIR(handle, fname, mask, attr) ((handle)->vfs_next.ops.opendir((handle)->vfs_next.handles.opendir, (fname), (mask), (attr))) @@ -283,36 +298,36 @@ #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, 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))) -#define SMB_VFS_NEXT_WRITE(handle, fsp, fd, data, n) ((handle)->vfs_next.ops.write((handle)->vfs_next.handles.write, (fsp), (fd), (data), (n))) -#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_RECVFILE(handle, fromfd, fsp, tofd, offset, count) ((handle)->vfs_next.ops.recvfile((handle)->vfs_next.handles.recvfile, (fromfd), (fsp), (tofd), (offset), (count))) +#define SMB_VFS_NEXT_READ(handle, fsp, data, n) ((handle)->vfs_next.ops.read((handle)->vfs_next.handles.read, (fsp), (data), (n))) +#define SMB_VFS_NEXT_PREAD(handle, fsp, data, n, off) ((handle)->vfs_next.ops.pread((handle)->vfs_next.handles.pread, (fsp), (data), (n), (off))) +#define SMB_VFS_NEXT_WRITE(handle, fsp, data, n) ((handle)->vfs_next.ops.write((handle)->vfs_next.handles.write, (fsp), (data), (n))) +#define SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, off) ((handle)->vfs_next.ops.pwrite((handle)->vfs_next.handles.pwrite, (fsp), (data), (n), (off))) +#define SMB_VFS_NEXT_LSEEK(handle, fsp, offset, whence) ((handle)->vfs_next.ops.lseek((handle)->vfs_next.handles.lseek, (fsp), (offset), (whence))) +#define SMB_VFS_NEXT_SENDFILE(handle, tofd, fromfsp, header, offset, count) ((handle)->vfs_next.ops.sendfile((handle)->vfs_next.handles.sendfile, (tofd), (fromfsp), (header), (offset), (count))) +#define SMB_VFS_NEXT_RECVFILE(handle, fromfd, tofsp, offset, count) ((handle)->vfs_next.ops.recvfile((handle)->vfs_next.handles.recvfile, (fromfd), (tofsp), (offset), (count))) #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_FSYNC(handle, fsp) ((handle)->vfs_next.ops.fsync((handle)->vfs_next.handles.fsync, (fsp))) #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_FSTAT(handle, fsp, sbuf) ((handle)->vfs_next.ops.fstat((handle)->vfs_next.handles.fstat, (fsp), (sbuf))) #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_FCHMOD(handle, fsp, mode) ((handle)->vfs_next.ops.fchmod((handle)->vfs_next.handles.fchmod, (fsp), (mode))) #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_FCHOWN(handle, fsp, uid, gid) ((handle)->vfs_next.ops.fchown((handle)->vfs_next.handles.fchown, (fsp), (uid), (gid))) #define SMB_VFS_NEXT_LCHOWN(handle, path, uid, gid) ((handle)->vfs_next.ops.lchown((handle)->vfs_next.handles.lchown, (path), (uid), (gid))) #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_NTIMES(handle, path, ts) ((handle)->vfs_next.ops.ntimes((handle)->vfs_next.handles.ntimes, (path), (ts))) -#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_FTRUNCATE(handle, fsp, offset) ((handle)->vfs_next.ops.ftruncate((handle)->vfs_next.handles.ftruncate, (fsp), (offset))) +#define SMB_VFS_NEXT_LOCK(handle, fsp, op, offset, count, type) ((handle)->vfs_next.ops.lock((handle)->vfs_next.handles.lock, (fsp), (op), (offset), (count), (type))) +#define SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_mode)((handle)->vfs_next.ops.kernel_flock((handle)->vfs_next.handles.kernel_flock, (fsp), (share_mode))) +#define SMB_VFS_NEXT_LINUX_SETLEASE(handle, fsp, leasetype)((handle)->vfs_next.ops.linux_setlease((handle)->vfs_next.handles.linux_setlease, (fsp), (leasetype))) +#define SMB_VFS_NEXT_GETLOCK(handle, fsp, poffset, pcount, ptype, ppid) ((handle)->vfs_next.ops.getlock((handle)->vfs_next.handles.getlock, (fsp), (poffset), (pcount), (ptype), (ppid))) #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))) @@ -321,23 +336,24 @@ #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))) #define SMB_VFS_NEXT_CHFLAGS(handle, path, flags) ((handle)->vfs_next.ops.chflags((handle)->vfs_next.handles.chflags, (path), (flags))) #define SMB_VFS_NEXT_FILE_ID_CREATE(handle, dev, inode) ((handle)->vfs_next.ops.file_id_create((handle)->vfs_next.handles.file_id_create, (dev), (inode))) +#define SMB_VFS_NEXT_STREAMINFO(handle, fsp, fname, mem_ctx, num_streams, streams) ((handle)->vfs.ops.streaminfo((handle)->vfs.handles.streaminfo, (fsp), (fname), (mem_ctx), (num_streams), (streams))) /* 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))) -#define SMB_VFS_NEXT_GET_NT_ACL(handle, fsp, name, security_info, ppdesc) ((handle)->vfs_next.ops.get_nt_acl((handle)->vfs_next.handles.get_nt_acl, (fsp), (name), (security_info), (ppdesc))) -#define SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, fd, security_info_sent, psd) ((handle)->vfs_next.ops.fset_nt_acl((handle)->vfs_next.handles.fset_nt_acl, (fsp), (fd), (security_info_sent), (psd))) +#define SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, ppdesc) ((handle)->vfs_next.ops.fget_nt_acl((handle)->vfs_next.handles.fget_nt_acl, (fsp), (security_info), (ppdesc))) +#define SMB_VFS_NEXT_GET_NT_ACL(handle, name, security_info, ppdesc) ((handle)->vfs_next.ops.get_nt_acl((handle)->vfs_next.handles.get_nt_acl, (name), (security_info), (ppdesc))) +#define SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd) ((handle)->vfs_next.ops.fset_nt_acl((handle)->vfs_next.handles.fset_nt_acl, (fsp), (security_info_sent), (psd))) #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, 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_FCHMOD_ACL(handle, fsp, mode) ((handle)->vfs_next.ops.fchmod_acl((handle)->vfs_next.handles.chmod_acl, (fsp), (mode))) #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_GET_FD(handle, fsp) ((handle)->vfs_next.ops.sys_acl_get_fd((handle)->vfs_next.handles.sys_acl_get_fd, (fsp))) #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))) @@ -348,7 +364,7 @@ #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_SET_FD(handle, fsp, theacl) ((handle)->vfs_next.ops.sys_acl_set_fd((handle)->vfs_next.handles.sys_acl_set_fd, (fsp), (theacl))) #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))) @@ -358,24 +374,29 @@ /* EA operations. */ #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_FGETXATTR(handle,fsp,name,value,size) ((handle)->vfs_next.ops.fgetxattr((handle)->vfs_next.handles.fgetxattr,(fsp),(name),(value),(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_FLISTXATTR(handle,fsp,list,size) ((handle)->vfs_next.ops.flistxattr((handle)->vfs_next.handles.flistxattr,(fsp),(list),(size))) #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_FREMOVEXATTR(handle,fsp,name) ((handle)->vfs_next.ops.fremovexattr((handle)->vfs_next.handles.fremovexattr,(fsp),(name))) #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))) +#define SMB_VFS_NEXT_FSETXATTR(handle,fsp,name,value,size,flags) ((handle)->vfs_next.ops.fsetxattr((handle)->vfs_next.handles.fsetxattr,(fsp),(name),(value),(size),(flags))) /* AIO operations. */ #define SMB_VFS_NEXT_AIO_READ(handle,fsp,aiocb) ((handle)->vfs_next.ops.aio_read((handle)->vfs_next.handles.aio_read,(fsp),(aiocb))) #define SMB_VFS_NEXT_AIO_WRITE(handle,fsp,aiocb) ((handle)->vfs_next.ops.aio_write((handle)->vfs_next.handles.aio_write,(fsp),(aiocb))) #define SMB_VFS_NEXT_AIO_RETURN(handle,fsp,aiocb) ((handle)->vfs_next.ops.aio_return_fn((handle)->vfs_next.handles.aio_return,(fsp),(aiocb))) -#define SMB_VFS_NEXT_AIO_CANCEL(handle,fsp,fd,aiocb) ((handle)->vfs_next.ops.aio_cancel((handle)->vfs_next.handles.aio_cancel,(fsp),(fd),(aiocb))) +#define SMB_VFS_NEXT_AIO_CANCEL(handle,fsp,aiocb) ((handle)->vfs_next.ops.aio_cancel((handle)->vfs_next.handles.aio_cancel,(fsp),(aiocb))) #define SMB_VFS_NEXT_AIO_ERROR(handle,fsp,aiocb) ((handle)->vfs_next.ops.aio_error_fn((handle)->vfs_next.handles.aio_error,(fsp),(aiocb))) #define SMB_VFS_NEXT_AIO_FSYNC(handle,fsp,op,aiocb) ((handle)->vfs_next.ops.aio_fsync((handle)->vfs_next.handles.aio_fsync,(fsp),(op),(aiocb))) #define SMB_VFS_NEXT_AIO_SUSPEND(handle,fsp,aiocb,n,ts) ((handle)->vfs_next.ops.aio_suspend((handle)->vfs_next.handles.aio_suspend,(fsp),(aiocb),(n),(ts))) +#define SMB_VFS_NEXT_AIO_FORCE(handle,fsp) ((handle)->vfs_next.ops.aio_force((handle)->vfs_next.handles.aio_force,(fsp))) + +/* Offline operations */ +#define SMB_VFS_NEXT_IS_OFFLINE(handle,path,sbuf) ((handle)->vfs_next.ops.is_offline((handle)->vfs_next.handles.is_offline,(path),(sbuf))) +#define SMB_VFS_NEXT_SET_OFFLINE(handle,path) ((handle)->vfs_next.ops.set_offline((handle)->vfs_next.handles.set_offline,(path))) #endif /* _VFS_MACROS_H */ |