Changeset 988 for vendor/current/source3/include
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- Location:
- vendor/current/source3/include
- Files:
-
- 6 added
- 15 deleted
- 47 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/include/MacExtensions.h
r414 r988 31 31 #define DefaultStreamTest ":$DATA" 32 32 #define AFPDATA_STREAM "::$DATA" 33 #define AFPINFO_STREAM ":AFP_AfpInfo:$DATA" 34 #define AFPRESOURCE_STREAM ":AFP_Resource:$DATA" 35 #define AFPCOMMENTS_STREAM ":Comments:$DATA" 36 #define AFPDESKTOP_STREAM ":AFP_DeskTop:$DATA" 37 #define AFPIDINDEX_STREAM ":AFP_IdIndex:$DATA" 33 34 #define AFPINFO_STREAM_NAME ":AFP_AfpInfo" 35 #define AFPRESOURCE_STREAM_NAME ":AFP_Resource" 36 #define AFPCOMMENTS_STREAM_NAME ":Comments" 37 #define AFPDESKTOP_STREAM_NAME ":AFP_DeskTop" 38 #define AFPIDINDEX_STREAM_NAME ":AFP_IdIndex" 39 40 #define AFPINFO_STREAM AFPINFO_STREAM_NAME ":$DATA" 41 #define AFPRESOURCE_STREAM AFPRESOURCE_STREAM_NAME ":$DATA" 42 #define AFPCOMMENTS_STREAM AFPCOMMENTS_STREAM_NAME ":$DATA" 43 #define AFPDESKTOP_STREAM AFPDESKTOP_STREAM_NAME ":$DATA" 44 #define AFPIDINDEX_STREAM AFPIDINDEX_STREAM_NAME ":$DATA" 38 45 39 46 /* 40 47 ** NT's AFP_AfpInfo stream structure 41 48 */ 42 #define A PF_INFO_SIZE 0x3c49 #define AFP_INFO_SIZE 0x3c 43 50 #define AFP_Signature 0x41465000 44 51 #define AFP_Version 0x00000100 45 #define AFP_BackupTime 0x 0000008052 #define AFP_BackupTime 0x80000000 46 53 #define AFP_FinderSize 32 47 54 /* … … 53 60 typedef struct _AfpInfo 54 61 { 55 uint32 56 uint32 57 uint32 58 uint32 62 uint32_t afpi_Signature; /* Must be *(PDWORD)"AFP" */ 63 uint32_t afpi_Version; /* Must be 0x00010000 */ 64 uint32_t afpi_Reserved1; 65 uint32_t afpi_BackupTime; /* Backup time for the file/dir */ 59 66 unsigned char afpi_FinderInfo[AFP_FinderSize]; /* Finder Info (32 bytes) */ 60 67 unsigned char afpi_ProDosInfo[6]; /* ProDos Info (6 bytes) # */ … … 74 81 75 82 /* 76 ** These exten tions are only supported with the NT LM 0.12 Dialect. These extentions83 ** These extensions are only supported with the NT LM 0.12 Dialect. These extentions 77 84 ** will be process on a share by share bases. 78 85 */ 79 86 80 87 /* 81 ** Trans2_Query_FS_Information Call is used by the MacCIFS exten tions for three reasons.82 ** First to see if the remote server share supports the basic Macintosh CIFS exten tions.88 ** Trans2_Query_FS_Information Call is used by the MacCIFS extensions for three reasons. 89 ** First to see if the remote server share supports the basic Macintosh CIFS extensions. 83 90 ** Second to return some basic need information about the share to the Macintosh. 84 ** Third to see if this share support any other Macintosh exten tions.91 ** Third to see if this share support any other Macintosh extensions. 85 92 ** 86 93 ** We will be using infromation levels that are betwwen 0x300 and 0x399 for all Macintosh 87 ** exten tions calls. The first of these will be the SMB_MAC_QUERY_FS_INFO level which94 ** extensions calls. The first of these will be the SMB_MAC_QUERY_FS_INFO level which 88 95 ** will allow the server to return the MacQueryFSInfo structure. All fields are Little 89 96 ** Endian unless other wise specified. -
vendor/current/source3/include/ads.h
r746 r988 14 14 struct ads_saslwrap_ops { 15 15 const char *name; 16 ADS_STATUS (*wrap)(struct ads_struct *, uint8 *buf, uint32len);16 ADS_STATUS (*wrap)(struct ads_struct *, uint8_t *buf, uint32_t len); 17 17 ADS_STATUS (*unwrap)(struct ads_struct *); 18 18 void (*disconnect)(struct ads_struct *); … … 27 27 typedef struct ads_struct { 28 28 int is_mine; /* do I own this structure's memory? */ 29 29 30 30 /* info needed to find the server */ 31 31 struct { … … 33 33 char *workgroup; 34 34 char *ldap_server; 35 int foreign; /* set to 1 if connecting to a foreign36 * realm */37 35 bool gc; /* Is this a global catalog server? */ 38 36 } server; … … 46 44 unsigned flags; 47 45 int time_offset; 46 char *ccache_name; 48 47 time_t tgt_expire; 49 48 time_t tgs_expire; … … 53 52 /* info derived from the servers config */ 54 53 struct { 55 uint32 flags; /* cldap flags identifying the services. */54 uint32_t flags; /* cldap flags identifying the services. */ 56 55 char *realm; 57 56 char *bind_path; … … 82 81 void *wrap_private_data; 83 82 struct { 84 uint32 ofs;85 uint32 needed;86 uint32 left;83 uint32_t ofs; 84 uint32_t needed; 85 uint32_t left; 87 86 #define ADS_SASL_WRAPPING_IN_MAX_WRAPPED 0x0FFFFFFF 88 uint32 max_wrapped;89 uint32 min_wrapped;90 uint32 size;91 uint8 *buf;87 uint32_t max_wrapped; 88 uint32_t min_wrapped; 89 uint32_t size; 90 uint8_t *buf; 92 91 } in; 93 92 struct { 94 uint32 ofs;95 uint32 left;93 uint32_t ofs; 94 uint32_t left; 96 95 #define ADS_SASL_WRAPPING_OUT_MAX_WRAPPED 0x00A00000 97 uint32 max_unwrapped;98 uint32 sig_size;99 uint32 size;100 uint8 *buf;96 uint32_t max_unwrapped; 97 uint32_t sig_size; 98 uint32_t size; 99 uint8_t *buf; 101 100 } out; 102 101 } ldap; … … 128 127 #define ADS_PINGS 0x0000FFFF /* Ping response */ 129 128 130 /* ads auth control flags */131 #define ADS_AUTH_DISABLE_KERBEROS 0x0001132 #define ADS_AUTH_NO_BIND 0x0002133 #define ADS_AUTH_ANON_BIND 0x0004134 #define ADS_AUTH_SIMPLE_BIND 0x0008135 #define ADS_AUTH_ALLOW_NTLMSSP 0x0010136 #define ADS_AUTH_SASL_SIGN 0x0020137 #define ADS_AUTH_SASL_SEAL 0x0040138 #define ADS_AUTH_SASL_FORCE 0x0080139 #define ADS_AUTH_USER_CREDS 0x0100140 141 129 enum ads_extended_dn_flags { 142 130 ADS_EXTENDED_DN_HEX_STRING = 0, -
vendor/current/source3/include/adt_tree.h
r740 r988 33 33 /* add a new path component */ 34 34 35 WERRORpathtree_add(struct sorted_tree *tree, const char *path, void *data_p );35 bool pathtree_add(struct sorted_tree *tree, const char *path, void *data_p ); 36 36 37 37 /* search path */ -
vendor/current/source3/include/async_smb.h
r740 r988 23 23 struct cli_state; 24 24 25 /*26 * Fetch an error out of a NBT packet27 */28 29 NTSTATUS cli_pull_error(char *buf);30 31 /*32 * Compatibility helper for the sync APIs: Fake NTSTATUS in cli->inbuf33 */34 35 void cli_set_error(struct cli_state *cli, NTSTATUS status);36 37 25 struct tevent_req *cli_smb_req_create(TALLOC_CTX *mem_ctx, 38 struct event_context *ev,26 struct tevent_context *ev, 39 27 struct cli_state *cli, 40 28 uint8_t smb_command, … … 43 31 int iov_count, 44 32 struct iovec *bytes_iov); 45 NTSTATUS cli_smb_req_send(struct tevent_req *req); 46 size_t cli_smb_wct_ofs(struct tevent_req **reqs, int num_reqs); 47 NTSTATUS cli_smb_chain_send(struct tevent_req **reqs, int num_reqs); 48 uint8_t *cli_smb_inbuf(struct tevent_req *req); 49 bool cli_has_async_calls(struct cli_state *cli); 50 void cli_smb_req_unset_pending(struct tevent_req *req); 51 bool cli_smb_req_set_pending(struct tevent_req *req); 52 uint16_t cli_smb_req_mid(struct tevent_req *req); 53 void cli_smb_req_set_mid(struct tevent_req *req, uint16_t mid); 54 uint32_t cli_smb_req_seqnum(struct tevent_req *req); 55 void cli_smb_req_set_seqnum(struct tevent_req *req, uint32_t seqnum); 56 struct tevent_req *cli_smb_send(TALLOC_CTX *mem_ctx, struct event_context *ev, 33 struct tevent_req *cli_smb_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, 57 34 struct cli_state *cli, 58 35 uint8_t smb_command, uint8_t additional_flags, … … 65 42 uint32_t *pnum_bytes, uint8_t **pbytes); 66 43 67 struct tevent_req *cli_smb_oplock_break_waiter_send(TALLOC_CTX *mem_ctx,68 struct event_context *ev,69 struct cli_state *cli);70 NTSTATUS cli_smb_oplock_break_waiter_recv(struct tevent_req *req,71 uint16_t *pfnum,72 uint8_t *plevel);73 74 struct tevent_req *cli_session_request_send(TALLOC_CTX *mem_ctx,75 struct tevent_context *ev,76 int sock,77 const struct nmb_name *called,78 const struct nmb_name *calling);79 bool cli_session_request_recv(struct tevent_req *req, int *err, uint8_t *resp);80 81 44 #endif -
vendor/current/source3/include/auth.h
r740 r988 22 22 #include "../auth/common_auth.h" 23 23 24 struct gensec_security; 25 24 26 struct extra_auth_info { 25 27 struct dom_sid user_sid; … … 37 39 struct security_token *security_token; 38 40 39 /* This is the final session key, as used by SMB signing, and 40 * (truncated to 16 bytes) encryption on the SAMR and LSA pipes 41 * when over ncacn_np. 42 * It is calculated by NTLMSSP from the session key in the info3, 43 * and is set from the Kerberos session key using 44 * krb5_auth_con_getremotesubkey(). 45 * 46 * Bottom line, it is not the same as the session keys in info3. 41 /* These are the intermediate session keys, as provided by a 42 * NETLOGON server and used by NTLMSSP to negotiate key 43 * exchange etc (which will provide the session_key in the 44 * auth_session_info). It is usually the same as the keys in 45 * the info3, but is a variable length structure here to allow 46 * it to be omitted if the auth module does not know it. 47 47 */ 48 48 49 DATA_BLOB user_session_key;49 DATA_BLOB session_key; 50 50 DATA_BLOB lm_session_key; 51 51 … … 65 65 66 66 char *unix_name; 67 }; 67 68 68 /* 69 * For performance reasons we keep an alpha_strcpy-sanitized version 70 * of the username around as long as the global variable current_user 71 * still exists. If we did not do keep this, we'd have to call72 * alpha_strcpy whenever we do a become_user(), potentially on every73 * smb request. See set_current_user_info. 74 */ 75 char *sanitized_username;76 };69 struct auth_context; 70 71 typedef NTSTATUS (*prepare_gensec_fn)(const struct auth_context *auth_context, 72 TALLOC_CTX *mem_ctx, 73 struct gensec_security **gensec_context); 74 75 typedef NTSTATUS (*make_auth4_context_fn)(const struct auth_context *auth_context, 76 TALLOC_CTX *mem_ctx, 77 struct auth4_context **auth4_context); 77 78 78 79 struct auth_context { … … 82 83 const char *challenge_set_by; 83 84 84 bool challenge_may_be_modified;85 86 struct auth_methods *challenge_set_method;87 85 /* What order are the various methods in? Try to stop it changing under us */ 88 86 struct auth_methods *auth_method_list; 89 87 90 NTSTATUS (*get_ntlm_challenge)(struct auth_context *auth_context, 91 uint8_t chal[8]); 92 NTSTATUS (*check_ntlm_password)(const struct auth_context *auth_context, 93 const struct auth_usersupplied_info *user_info, 94 struct auth_serversupplied_info **server_info); 95 NTSTATUS (*nt_status_squash)(NTSTATUS nt_status); 88 prepare_gensec_fn prepare_gensec; 89 make_auth4_context_fn make_auth4_context; 90 const char *forced_samba4_methods; 96 91 }; 97 92 … … 107 102 struct auth_serversupplied_info **server_info); 108 103 109 /* If you are using this interface, then you are probably 110 * getting something wrong. This interface is only for 111 * security=server, and makes a number of compromises to allow 112 * that. It is not compatible with being a PDC. */ 113 DATA_BLOB (*get_chal)(const struct auth_context *auth_context, 114 void **my_private_data, 115 TALLOC_CTX *mem_ctx); 116 104 /* Optional methods allowing this module to provide a way to get a gensec context and an auth4_context */ 105 prepare_gensec_fn prepare_gensec; 106 make_auth4_context_fn make_auth4_context; 117 107 /* Used to keep tabs on things like the cli for SMB server authentication */ 118 108 void *private_data; 109 110 uint32_t flags; 119 111 120 112 } auth_methods; … … 131 123 }; 132 124 133 struct auth_ntlmssp_state; 125 extern const struct gensec_security_ops gensec_ntlmssp3_server_ops; 126 127 /* Intent of use for session key. LSA and SAMR pipes use 16 bytes of session key when doing create/modify calls */ 128 enum session_key_use_intent { 129 KEY_USE_FULL = 0, 130 KEY_USE_16BYTES 131 }; 134 132 135 133 /* Changed from 1 -> 2 to add the logon_parameters field. */ 136 134 /* Changed from 2 -> 3 when we reworked many auth structures to use IDL or be in common with Samba4 */ 137 #define AUTH_INTERFACE_VERSION 3 135 /* Changed from 3 -> 4 when we reworked added the flags */ 136 #define AUTH_INTERFACE_VERSION 4 138 137 139 138 #include "auth/proto.h" -
vendor/current/source3/include/client.h
r740 r988 23 23 #define _CLIENT_H 24 24 25 /* the client asks for a smaller buffer to save ram and also to get more 26 overlap on the wire. This size gives us a nice read/write size, which 27 will be a multiple of the page size on almost any system */ 28 #define CLI_BUFFER_SIZE (0xFFFF) 29 #define CLI_SAMBA_MAX_LARGE_READX_SIZE (127*1024) /* Works for Samba servers */ 30 #define CLI_SAMBA_MAX_LARGE_WRITEX_SIZE (127*1024) /* Works for Samba servers */ 31 #define CLI_WINDOWS_MAX_LARGE_READX_SIZE ((64*1024)-2) /* Windows servers are broken.... */ 32 #define CLI_WINDOWS_MAX_LARGE_WRITEX_SIZE ((64*1024)-2) /* Windows servers are broken.... */ 33 #define CLI_SAMBA_MAX_POSIX_LARGE_READX_SIZE (0xFFFF00) /* 24-bit len. */ 34 #define CLI_SAMBA_MAX_POSIX_LARGE_WRITEX_SIZE (0xFFFF00) /* 24-bit len. */ 25 #define CLI_BUFFER_SIZE SMB_BUFFER_SIZE_MAX 26 27 /* default client timeout to 20 seconds on most commands */ 28 #define CLIENT_TIMEOUT (20 * 1000) 35 29 36 30 /* … … 39 33 40 34 struct print_job_info { 41 uint16 id;42 uint16 priority;35 uint16_t id; 36 uint16_t priority; 43 37 size_t size; 44 38 fstring user; … … 47 41 }; 48 42 49 struct cli_state_seqnum { 50 struct cli_state_seqnum *prev, *next; 51 uint16_t mid; 52 uint32_t seqnum; 53 bool persistent; 54 }; 43 struct smbXcli_conn; 44 struct smbXcli_session; 55 45 56 46 struct cli_state { … … 59 49 */ 60 50 struct cli_state *prev, *next; 61 int port;62 int fd;63 /* Last read or write error. */64 enum smb_read_errors smb_rw_error;65 uint16 cnum;66 uint16 pid;67 uint16 mid;68 uint16 vuid;69 int protocol;70 int sec_mode;71 51 int rap_error; 72 int privileges; 73 74 char *desthost; 75 76 /* The credentials used to open the cli_state connection. */ 77 char *domain; 78 char *user_name; 79 char *password; /* Can be null to force use of zero NTLMSSP session key. */ 52 NTSTATUS raw_status; /* maybe via NT_STATUS_DOS() */ 53 bool map_dos_errors; 80 54 81 55 /* … … 90 64 char *share; 91 65 char *dev; 92 struct nmb_name called;93 struct nmb_name calling;94 struct sockaddr_storage dest_ss;95 66 96 DATA_BLOB secblob; /* cryptkey or negTokenInit */97 uint32 sesskey;98 int serverzone;99 uint32 servertime;100 int readbraw_supported;101 int writebraw_supported;102 67 int timeout; /* in milliseconds. */ 103 size_t max_xmit;104 size_t max_mux;105 char *outbuf;106 struct cli_state_seqnum *seqnum;107 char *inbuf;108 unsigned int bufsize;109 68 int initialised; 110 69 int win95; 111 bool is_samba;112 bool is_guestlogin;113 uint32 capabilities;114 70 /* What the server offered. */ 115 71 uint32_t server_posix_capabilities; 116 72 /* What the client requested. */ 117 73 uint32_t requested_posix_capabilities; 118 bool dfsroot; 119 120 struct smb_signing_state *signing_state; 121 122 struct smb_trans_enc_state *trans_enc_state; /* Setup if we're encrypting SMB's. */ 123 124 /* the session key for this CLI, outside 125 any per-pipe authenticaion */ 126 DATA_BLOB user_session_key; 74 bool backup_intent; 127 75 128 76 /* The list of pipes currently open on this connection. */ … … 131 79 bool use_kerberos; 132 80 bool fallback_after_kerberos; 133 bool use_spnego;134 81 bool use_ccache; 82 bool pw_nt_hash; 135 83 bool got_kerberos_mechanism; /* Server supports krb5 in SPNEGO. */ 136 84 137 85 bool use_oplocks; /* should we use oplocks? */ 138 bool use_level_II_oplocks; /* should we use level II oplocks? */139 140 /* a oplock break request handler */141 NTSTATUS (*oplock_handler)(struct cli_state *cli, uint16_t fnum, unsigned char level);142 143 bool force_dos_errors;144 bool case_sensitive; /* False by default. */145 86 146 87 /* Where (if anywhere) this is mounted under DFS. */ 147 88 char *dfs_mountpoint; 148 89 149 struct tevent_queue *outgoing; 150 struct tevent_req **pending; 90 struct smbXcli_conn *conn; 91 const char *remote_realm; 92 93 struct { 94 uint16_t pid; 95 uint16_t vc_num; 96 struct smbXcli_session *session; 97 struct smbXcli_tcon *tcon; 98 } smb1; 99 100 struct { 101 struct smbXcli_session *session; 102 struct smbXcli_tcon *tcon; 103 struct idr_context *open_handles; 104 } smb2; 151 105 }; 152 106 153 107 struct file_info { 154 108 uint64_t size; 155 uint16 mode;109 uint16_t mode; 156 110 uid_t uid; 157 111 gid_t gid; … … 161 115 struct timespec ctime_ts; 162 116 char *name; 163 char short_name[13*3]; /* the *3 is to cope with multi-byte */117 char *short_name; 164 118 }; 165 119 … … 171 125 #define CLI_FULL_CONNECTION_LEVEL_II_OPLOCKS 0x0020 172 126 #define CLI_FULL_CONNECTION_USE_CCACHE 0x0040 127 #define CLI_FULL_CONNECTION_FORCE_DOS_ERRORS 0x0080 128 #define CLI_FULL_CONNECTION_FORCE_ASCII 0x0100 129 #define CLI_FULL_CONNECTION_USE_NT_HASH 0x0200 173 130 174 131 #endif /* _CLIENT_H */ -
vendor/current/source3/include/ctdbd_conn.h
r740 r988 3 3 Samba3 ctdb connection handling 4 4 Copyright (C) Volker Lendecke 2007 5 5 6 6 This program is free software; you can redistribute it and/or modify 7 7 it under the terms of the GNU General Public License as published by 8 8 the Free Software Foundation; either version 3 of the License, or 9 9 (at your option) any later version. 10 10 11 11 This program is distributed in the hope that it will be useful, 12 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 14 GNU General Public License for more details. 15 15 16 16 You should have received a copy of the GNU General Public License 17 17 along with this program. If not, see <http://www.gnu.org/licenses/>. … … 27 27 struct messaging_rec; 28 28 29 NTSTATUS ctdbd_messaging_connection(TALLOC_CTX *mem_ctx, 30 struct ctdbd_connection **pconn); 29 int ctdbd_messaging_connection(TALLOC_CTX *mem_ctx, 30 const char *sockname, int timeout, 31 struct ctdbd_connection **pconn); 31 32 32 uint32 ctdbd_vnn(const struct ctdbd_connection *conn);33 uint32_t ctdbd_vnn(const struct ctdbd_connection *conn); 33 34 34 NTSTATUS ctdbd_register_msg_ctx(struct ctdbd_connection *conn, 35 struct messaging_context *msg_ctx); 35 int ctdbd_register_msg_ctx(struct ctdbd_connection *conn, 36 struct messaging_context *msg_ctx, 37 struct tevent_context *ev); 36 38 struct messaging_context *ctdb_conn_msg_ctx(struct ctdbd_connection *conn); 37 39 38 40 int ctdbd_conn_get_fd(struct ctdbd_connection *conn); 39 41 40 NTSTATUS ctdbd_messaging_send(struct ctdbd_connection *conn,41 uint32 dst_vnn, uint64dst_srvid,42 struct messaging_rec *msg);42 int ctdbd_messaging_send_iov(struct ctdbd_connection *conn, 43 uint32_t dst_vnn, uint64_t dst_srvid, 44 const struct iovec *iov, int iovlen); 43 45 44 bool ctdbd_process_exists(struct ctdbd_connection *conn, uint32 vnn,46 bool ctdbd_process_exists(struct ctdbd_connection *conn, uint32_t vnn, 45 47 pid_t pid); 48 bool ctdb_processes_exist(struct ctdbd_connection *conn, 49 const struct server_id *pids, int num_pids, 50 bool *results); 46 51 47 52 char *ctdbd_dbpath(struct ctdbd_connection *conn, 48 53 TALLOC_CTX *mem_ctx, uint32_t db_id); 49 54 50 NTSTATUSctdbd_db_attach(struct ctdbd_connection *conn, const char *name,51 55 int ctdbd_db_attach(struct ctdbd_connection *conn, const char *name, 56 uint32_t *db_id, int tdb_flags); 52 57 53 NTSTATUS ctdbd_migrate(struct ctdbd_connection *conn, uint32 db_id, 54 TDB_DATA key); 58 int ctdbd_migrate(struct ctdbd_connection *conn, uint32_t db_id, TDB_DATA key); 55 59 56 NTSTATUS ctdbd_fetch(struct ctdbd_connection *conn, uint32 db_id, 57 TDB_DATA key, TALLOC_CTX *mem_ctx, TDB_DATA *data); 60 int ctdbd_parse(struct ctdbd_connection *conn, uint32_t db_id, 61 TDB_DATA key, bool local_copy, 62 void (*parser)(TDB_DATA key, TDB_DATA data, 63 void *private_data), 64 void *private_data); 58 65 59 NTSTATUS ctdbd_traverse(uint32 db_id, 60 void (*fn)(TDB_DATA key, TDB_DATA data, 61 void *private_data), 66 int ctdbd_traverse(struct ctdbd_connection *master, uint32_t db_id, 67 void (*fn)(TDB_DATA key, TDB_DATA data, 68 void *private_data), 69 void *private_data); 70 71 int ctdbd_register_ips(struct ctdbd_connection *conn, 72 const struct sockaddr_storage *server, 73 const struct sockaddr_storage *client, 74 int (*cb)(uint32_t src_vnn, uint32_t dst_vnn, 75 uint64_t dst_srvid, 76 const uint8_t *msg, size_t msglen, 77 void *private_data), 78 void *private_data); 79 80 int ctdbd_control_local(struct ctdbd_connection *conn, uint32_t opcode, 81 uint64_t srvid, uint32_t flags, TDB_DATA data, 82 TALLOC_CTX *mem_ctx, TDB_DATA *outdata, 83 int *cstatus); 84 int ctdb_watch_us(struct ctdbd_connection *conn); 85 int ctdb_unwatch(struct ctdbd_connection *conn); 86 87 struct ctdb_req_message_old; 88 89 int register_with_ctdbd(struct ctdbd_connection *conn, uint64_t srvid, 90 int (*cb)(uint32_t src_vnn, uint32_t dst_vnn, 91 uint64_t dst_srvid, 92 const uint8_t *msg, size_t msglen, 93 void *private_data), 62 94 void *private_data); 63 64 NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn, 65 const struct sockaddr_storage *server, 66 const struct sockaddr_storage *client, 67 void (*release_ip_handler)(const char *ip_addr, 68 void *private_data), 69 void *private_data); 70 71 NTSTATUS ctdbd_register_reconfigure(struct ctdbd_connection *conn); 72 73 NTSTATUS ctdbd_control_local(struct ctdbd_connection *conn, uint32 opcode, 74 uint64_t srvid, uint32_t flags, TDB_DATA data, 75 TALLOC_CTX *mem_ctx, TDB_DATA *outdata, 76 int *cstatus); 77 NTSTATUS ctdb_watch_us(struct ctdbd_connection *conn); 78 NTSTATUS ctdb_unwatch(struct ctdbd_connection *conn); 95 int ctdbd_probe(const char *sockname, int timeout); 79 96 80 97 #endif /* _CTDBD_CONN_H */ -
vendor/current/source3/include/event.h
r740 r988 3 3 event handling 4 4 Copyright (C) Andrew Tridgell 1992-1998 5 Copyright (C) Volker Lendecke 2005 5 Copyright (C) Volker Lendecke 2005-2007 6 6 7 7 This program is free software; you can redistribute it and/or modify … … 19 19 */ 20 20 21 #define TEVENT_COMPAT_DEFINES22 21 #include <tevent.h> 23 24 #undef event_context_init25 #define event_context_init(mem_ctx) s3_tevent_context_init(mem_ctx)26 22 27 23 /* The following definitions come from lib/events.c */ 28 24 struct pollfd; 29 struct timeval *get_timed_events_timeout(struct event_context *event_ctx,25 struct timeval *get_timed_events_timeout(struct tevent_context *event_ctx, 30 26 struct timeval *to_ret); 31 void dump_event_list(struct event_context *event_ctx);27 void dump_event_list(struct tevent_context *event_ctx); 32 28 struct tevent_context *s3_tevent_context_init(TALLOC_CTX *mem_ctx); 33 29 … … 37 33 bool run_events_poll(struct tevent_context *ev, int pollrtn, 38 34 struct pollfd *pfds, int num_pfds); 35 36 struct idle_event *event_add_idle(struct tevent_context *event_ctx, 37 TALLOC_CTX *mem_ctx, 38 struct timeval interval, 39 const char *name, 40 bool (*handler)(const struct timeval *now, 41 void *private_data), 42 void *private_data); -
vendor/current/source3/include/fake_file.h
r740 r988 42 42 enum FAKE_FILE_TYPE is_fake_file(const struct smb_filename *smb_fname); 43 43 NTSTATUS open_fake_file(struct smb_request *req, connection_struct *conn, 44 uint 16_t current_vuid,44 uint64_t current_vuid, 45 45 enum FAKE_FILE_TYPE fake_file_type, 46 46 const struct smb_filename *smb_fname, 47 uint32 access_mask,47 uint32_t access_mask, 48 48 files_struct **result); 49 49 NTSTATUS close_fake_file(struct smb_request *req, files_struct *fsp); -
vendor/current/source3/include/g_lock.h
r740 r988 21 21 #define _G_LOCK_H_ 22 22 23 #include "dbwrap .h"23 #include "dbwrap/dbwrap.h" 24 24 25 25 struct g_lock_ctx; 26 struct messaging_context; 26 27 27 28 enum g_lock_type { … … 30 31 }; 31 32 32 /*33 * Or'ed with g_lock_type34 */35 #define G_LOCK_PENDING (2)36 37 33 struct g_lock_ctx *g_lock_ctx_init(TALLOC_CTX *mem_ctx, 38 34 struct messaging_context *msg); 39 35 36 struct tevent_req *g_lock_lock_send(TALLOC_CTX *mem_ctx, 37 struct tevent_context *ev, 38 struct g_lock_ctx *ctx, 39 const char *name, 40 enum g_lock_type type); 41 NTSTATUS g_lock_lock_recv(struct tevent_req *req); 40 42 NTSTATUS g_lock_lock(struct g_lock_ctx *ctx, const char *name, 41 43 enum g_lock_type lock_type, struct timeval timeout); … … 45 47 46 48 NTSTATUS g_lock_do(const char *name, enum g_lock_type lock_type, 47 struct timeval timeout, struct server_id self,49 struct timeval timeout, 48 50 void (*fn)(void *private_data), void *private_data); 49 51 -
vendor/current/source3/include/includes.h
r740 r988 23 23 #include "../replace/replace.h" 24 24 25 #if _SAMBA_BUILD_ == 426 # undef _SAMBA_BUILD_27 # define _SAMBA_BUILD_ 328 #endif29 30 25 /* make sure we have included the correct config.h */ 31 26 #ifndef NO_CONFIG_H /* for some tests */ … … 143 138 #endif 144 139 145 /* mutually exclusive (SuSE 8.2) */146 #if HAVE_ATTR_XATTR_H147 #include <attr/xattr.h>148 #elif HAVE_SYS_XATTR_H149 #include <sys/xattr.h>150 #endif151 152 #ifdef HAVE_SYS_EA_H153 #include <sys/ea.h>154 #endif155 156 #ifdef HAVE_SYS_EXTATTR_H157 #include <sys/extattr.h>158 #endif159 160 140 #ifdef HAVE_SYS_UIO_H 161 141 #include <sys/uio.h> … … 168 148 #if HAVE_NETGROUP_H 169 149 #include <netgroup.h> 170 #endif171 172 #if defined(HAVE_AIO_H) && defined(WITH_AIO)173 #include <aio.h>174 150 #endif 175 151 … … 202 178 203 179 /* 204 Samba needs type definitions for int16, int32, uint16 and uint32.205 206 Normally these are signed and unsigned 16 and 32 bit integers, but207 they actually only need to be at least 16 and 32 bits208 respectively. Thus if your word size is 8 bytes just defining them209 as signed and unsigned int will work.210 */211 212 #ifndef uint8213 #define uint8 uint8_t214 #endif215 216 #if !defined(int16) && !defined(HAVE_INT16_FROM_RPC_RPC_H)217 # define int16 int16_t218 /* needed to work around compile issue on HP-UX 11.x */219 # define _INT16 1220 #endif221 222 /*223 * Note we duplicate the size tests in the unsigned224 * case as int16 may be a typedef from rpc/rpc.h225 */226 227 228 #if !defined(uint16) && !defined(HAVE_UINT16_FROM_RPC_RPC_H)229 # define uint16 uint16_t230 #endif231 232 #if !defined(int32) && !defined(HAVE_INT32_FROM_RPC_RPC_H)233 # define int32 int32_t234 # ifndef _INT32235 /* needed to work around compile issue on HP-UX 11.x */236 # define _INT32 1237 # endif238 #endif239 240 /*241 * Note we duplicate the size tests in the unsigned242 * case as int32 may be a typedef from rpc/rpc.h243 */244 245 #if !defined(uint32) && !defined(HAVE_UINT32_FROM_RPC_RPC_H)246 # define uint32 uint32_t247 #endif248 249 /*250 * check for 8 byte long long251 */252 253 #if !defined(uint64)254 # define uint64 uint64_t255 #endif256 257 #if !defined(int64)258 # define int64 int64_t259 #endif260 261 262 /*263 180 * Types for devices, inodes and offsets. 264 181 */ 265 182 266 183 #ifndef SMB_DEV_T 267 # if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_DEV64_T) 268 # define SMB_DEV_T dev64_t 269 # else 270 # define SMB_DEV_T dev_t 271 # endif 184 # define SMB_DEV_T dev_t 272 185 #endif 273 186 274 187 #ifndef LARGE_SMB_DEV_T 275 # if (defined( HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_DEV64_T)) || (defined(SIZEOF_DEV_T) && (SIZEOF_DEV_T == 8))188 # if (defined(SIZEOF_DEV_T) && (SIZEOF_DEV_T == 8)) 276 189 # define LARGE_SMB_DEV_T 1 277 190 # endif … … 291 204 292 205 #ifndef SMB_INO_T 293 # if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_INO64_T)294 # define SMB_INO_T ino64_t295 # else296 206 # define SMB_INO_T ino_t 297 # endif298 207 #endif 299 208 300 209 #ifndef LARGE_SMB_INO_T 301 # if (defined( HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_INO64_T)) || (defined(SIZEOF_INO_T) && (SIZEOF_INO_T == 8))210 # if (defined(SIZEOF_INO_T) && (SIZEOF_INO_T == 8)) 302 211 # define LARGE_SMB_INO_T 1 303 212 # endif … … 312 221 #endif 313 222 314 #ifndef SMB_OFF_T315 # if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_OFF64_T)316 # define SMB_OFF_T off64_t317 # else318 # define SMB_OFF_T off_t319 # endif320 #endif321 322 223 /* TODO: remove this macros */ 323 224 #define SBIG_UINT(p, ofs, v) SBVAL(p, ofs, v) … … 328 229 typedef uint64_t br_off; 329 230 330 #define SMB_OFF_T_BITS (sizeof( SMB_OFF_T)*8)231 #define SMB_OFF_T_BITS (sizeof(off_t)*8) 331 232 332 233 /* … … 335 236 */ 336 237 337 #ifndef LARGE_SMB_OFF_T338 # if (defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_OFF64_T)) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8))339 # define LARGE_SMB_OFF_T 1340 # endif341 #endif342 343 #ifdef LARGE_SMB_OFF_T344 238 #define SOFF_T(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,(v)>>32)) 345 239 #define SOFF_T_R(p, ofs, v) (SIVAL(p,(ofs)+4,(v)&0xFFFFFFFF), SIVAL(p,ofs,(v)>>32)) 346 #define IVAL_TO_SMB_OFF_T(buf,off) ((SMB_OFF_T)(( ((uint64_t)(IVAL((buf),(off)))) & ((uint64_t)0xFFFFFFFF) ))) 347 #else 348 #define SOFF_T(p, ofs, v) (SIVAL(p,ofs,v),SIVAL(p,(ofs)+4,0)) 349 #define SOFF_T_R(p, ofs, v) (SIVAL(p,(ofs)+4,v),SIVAL(p,ofs,0)) 350 #define IVAL_TO_SMB_OFF_T(buf,off) ((SMB_OFF_T)(( ((uint32)(IVAL((buf),(off)))) & 0xFFFFFFFF ))) 351 #endif 352 353 #ifndef HAVE_BLKSIZE_T 354 /* This is mainly for HP/UX which defines st_blksize as long */ 355 typedef long blksize_t; 356 #endif 357 358 #ifndef HAVE_BLKCNT_T 359 /* This is mainly for HP/UX which doesn't have blkcnt_t */ 360 typedef long blkcnt_t; 361 #endif 240 #define IVAL_TO_SMB_OFF_T(buf,off) ((off_t)(( ((uint64_t)(IVAL((buf),(off)))) & ((uint64_t)0xFFFFFFFF) ))) 362 241 363 242 /* … … 385 264 uint32_t st_ex_flags; 386 265 uint32_t st_ex_mask; 387 388 /*389 * Add space for VFS internal extensions. The initial user of this390 * would be the onefs modules, passing the snapid from the stat calls391 * to the file_id_create call. Maybe we'll have to expand this later,392 * but the core of Samba should never look at this field.393 */394 uint64_t vfs_private;395 266 }; 396 267 397 268 typedef struct stat_ex SMB_STRUCT_STAT; 398 399 /*400 * Type for dirent structure.401 */402 403 #ifndef SMB_STRUCT_DIRENT404 # if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_DIRENT64)405 # define SMB_STRUCT_DIRENT struct dirent64406 # else407 # define SMB_STRUCT_DIRENT struct dirent408 # endif409 #endif410 411 /*412 * Type for DIR structure.413 */414 415 #ifndef SMB_STRUCT_DIR416 # if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_DIR64)417 # define SMB_STRUCT_DIR DIR64418 # else419 # define SMB_STRUCT_DIR DIR420 # endif421 #endif422 423 /*424 * Defines for 64 bit fcntl locks.425 */426 427 #ifndef SMB_STRUCT_FLOCK428 # if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_FLOCK64) && defined(HAVE_OFF64_T)429 # define SMB_STRUCT_FLOCK struct flock64430 # else431 # define SMB_STRUCT_FLOCK struct flock432 # endif433 #endif434 435 #ifndef SMB_F_SETLKW436 # if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_FLOCK64) && defined(HAVE_OFF64_T)437 # define SMB_F_SETLKW F_SETLKW64438 # else439 # define SMB_F_SETLKW F_SETLKW440 # endif441 #endif442 443 #ifndef SMB_F_SETLK444 # if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_FLOCK64) && defined(HAVE_OFF64_T)445 # define SMB_F_SETLK F_SETLK64446 # else447 # define SMB_F_SETLK F_SETLK448 # endif449 #endif450 451 #ifndef SMB_F_GETLK452 # if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_FLOCK64) && defined(HAVE_OFF64_T)453 # define SMB_F_GETLK F_GETLK64454 # else455 # define SMB_F_GETLK F_GETLK456 # endif457 #endif458 459 /*460 * Type for aiocb structure.461 */462 463 #ifndef SMB_STRUCT_AIOCB464 # if defined(WITH_AIO)465 # if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_AIOCB64)466 # define SMB_STRUCT_AIOCB struct aiocb64467 # else468 # define SMB_STRUCT_AIOCB struct aiocb469 # endif470 # else471 # define SMB_STRUCT_AIOCB int /* AIO not being used but we still need the define.... */472 # endif473 #endif474 269 475 270 enum timestamp_set_resolution { … … 503 298 #endif 504 299 300 /* debug.h need to be included before samba_util.h for the macro SMB_ASSERT */ 301 #include "../lib/util/debug.h" 302 505 303 /* Lists, trees, caching, database... */ 506 #include "../lib/util/ util.h"304 #include "../lib/util/samba_util.h" 507 305 #include "../lib/util/util_net.h" 508 306 #include "../lib/util/xfile.h" … … 518 316 #include "../lib/util/data_blob.h" 519 317 #include "../lib/util/time.h" 520 #include "../lib/util/debug.h"521 318 #include "../lib/util/debug_s3.h" 522 319 … … 524 321 #include "../libcli/util/error.h" 525 322 #include "../lib/util/charset/charset.h" 526 #include "dynconfig .h"323 #include "dynconfig/dynconfig.h" 527 324 #include "locking.h" 528 325 #include "smb_perfcount.h" … … 530 327 #include "../lib/util/byteorder.h" 531 328 532 #include " module.h"329 #include "../lib/util/samba_modules.h" 533 330 #include "../lib/util/talloc_stack.h" 534 331 #include "../lib/util/smb_threads.h" 535 332 #include "../lib/util/smb_threads_internal.h" 536 333 334 /* samba_setXXid functions. */ 335 #include "../lib/util/setid.h" 336 537 337 /***** prototypes *****/ 538 338 #ifndef NO_PROTO_H … … 540 340 #endif 541 341 342 #include "lib/param/loadparm.h" 343 542 344 /* String routines */ 543 345 … … 553 355 #endif 554 356 555 #if defined(HAVE_PUTPRPWNAM) && defined(AUTH_CLEARTEXT_SEG_CHARS)556 #define OSF1_ENH_SEC 1557 #endif558 357 559 358 #if defined(HAVE_CRYPT16) && defined(HAVE_GETAUTHUID) … … 580 379 581 380 #define MAX_SEC_CTX_DEPTH 8 /* Maximum number of security contexts */ 582 583 584 #ifdef GLIBC_HACK_FCNTL64585 /* this is a gross hack. 64 bit locking is completely screwed up on586 i386 Linux in glibc 2.1.95 (which ships with RedHat 7.0). This hack587 "fixes" the problem with the current 2.4.0test kernels588 */589 #define fcntl fcntl64590 #undef F_SETLKW591 #undef F_SETLK592 #define F_SETLK 13593 #define F_SETLKW 14594 #endif595 381 596 382 … … 604 390 605 391 /* PRINTFLIKE2 */ 606 void sys_adminlog(int priority, const char *format_str, ...) PRINTF_ATTRIBUTE(2,3);607 608 /* PRINTFLIKE2 */609 392 int fstr_sprintf(fstring s, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3); 610 611 int d_vfprintf(FILE *f, const char *format, va_list ap) PRINTF_ATTRIBUTE(2,0);612 393 613 394 int smb_xvasprintf(char **ptr, const char *format, va_list ap) PRINTF_ATTRIBUTE(2,0); … … 624 405 #endif 625 406 626 #ifndef XATTR_CREATE627 #define XATTR_CREATE 0x1 /* set value, fail if attr already exists */628 #endif629 630 #ifndef XATTR_REPLACE631 #define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */632 #endif633 634 407 #ifdef TRUE 635 408 #undef TRUE … … 649 422 #endif 650 423 651 #ifndef CONST_DISCARD652 #define CONST_DISCARD(type, ptr) ((type) ((void *) (ptr)))653 #endif654 655 void smb_panic( const char *why ) _NORETURN_;656 424 void dump_core(void) _NORETURN_; 657 425 void exit_server(const char *const reason) _NORETURN_; 658 426 void exit_server_cleanly(const char *const reason) _NORETURN_; 659 void exit_server_fault(void) _NORETURN_;660 661 /* samba3 doesn't use uwrap yet */662 #define uwrap_enabled() 0663 427 664 428 #define BASE_RID (0x000003E8L) -
vendor/current/source3/include/libsmb_internal.h
r740 r988 1 /* 1 /* 2 2 Unix SMB/Netbios implementation. 3 3 SMB client library implementation … … 5 5 Copyright (C) Richard Sharpe 2000, 2002 6 6 Copyright (C) John Terpstra 2000 7 Copyright (C) Tom Jansen (Ninja ISD) 2002 7 Copyright (C) Tom Jansen (Ninja ISD) 2002 8 8 Copyright (C) Derrell Lipman 2003-2008 9 9 Copyright (C) Jeremy Allison 2007, 2008 10 10 11 11 This program is free software; you can redistribute it and/or modify 12 12 it under the terms of the GNU General Public License as published by 13 13 the Free Software Foundation; either version 3 of the License, or 14 14 (at your option) any later version. 15 15 16 16 This program is distributed in the hope that it will be useful, 17 17 but WITHOUT ANY WARRANTY; without even the implied warranty of 18 18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 19 GNU General Public License for more details. 20 20 21 21 You should have received a copy of the GNU General Public License 22 22 along with this program. If not, see <http://www.gnu.org/licenses/>. … … 41 41 typedef struct DOS_ATTR_DESC { 42 42 int mode; 43 SMB_OFF_Tsize;43 off_t size; 44 44 time_t create_time; 45 45 time_t access_time; … … 49 49 } DOS_ATTR_DESC; 50 50 51 /* 52 * Extension of libsmbclient.h's #defines 53 */ 54 #define SMB_CTX_FLAG_USE_NT_HASH (1 << 4) 51 55 52 56 /* … … 75 79 bool no_pathinfo; 76 80 bool no_pathinfo2; 81 bool no_pathinfo3; 77 82 bool no_nt_session; 78 83 struct policy_handle pol; 84 time_t last_echo_time; 79 85 80 86 SMBCSRV *next, *prev; 81 82 87 }; 83 88 84 /* 85 * Keep directory entries in a list 89 /* 90 * Keep directory entries in a list 86 91 */ 87 92 struct smbc_dir_list { … … 93 98 /* 94 99 * Structure for open file management 95 */ 100 */ 96 101 struct _SMBCFILE { 97 int cli_fd; 102 int cli_fd; 103 /* 104 * cache of cli_state we opened cli_fd on. 105 * Due to DFS can be a subsidiary connection to srv->cli 106 */ 107 struct cli_state *targetcli; 98 108 char *fname; 99 SMB_OFF_Toffset;109 off_t offset; 100 110 struct _SMBCSRV *srv; 101 111 bool file; … … 133 143 */ 134 144 SMBCSRV * servers; 135 145 136 146 /* 137 147 * open file/dir list … … 167 177 168 178 /* 169 * Should we attempt UNIX smb encryption ? 179 * Should we attempt UNIX smb encryption ? 170 180 * Set to 0 if we should never attempt, set to 1 if 171 181 * encryption requested, set to 2 if encryption required. … … 234 244 #endif 235 245 236 #if 0 /* None available yet */237 246 /* SMB high-level functions */ 238 247 struct 239 248 { 249 smbc_splice_fn splice_fn; 250 smbc_notify_fn notify_fn; 240 251 } smb; 241 252 242 #endif 253 uint16_t port; 243 254 }; 244 255 … … 248 259 SMBCSRV * newsrv, 249 260 const char * server, 250 const char * share, 261 const char * share, 251 262 const char * workgroup, 252 263 const char * username); … … 254 265 SMBCSRV * 255 266 SMBC_get_cached_server(SMBCCTX * context, 256 const char * server, 267 const char * server, 257 268 const char * share, 258 269 const char * workgroup, … … 331 342 int 332 343 SMBC_rename_ctx(SMBCCTX *ocontext, 333 const char *oname, 344 const char *oname, 334 345 SMBCCTX *ncontext, 335 346 const char *nname); 347 348 int 349 SMBC_notify_ctx(SMBCCTX *c, SMBCFILE *dir, smbc_bool recursive, 350 uint32_t completion_filter, unsigned callback_timeout_ms, 351 smbc_notify_callback_fn cb, void *private_data); 352 336 353 337 354 … … 360 377 size_t count); 361 378 379 off_t 380 SMBC_splice_ctx(SMBCCTX *context, 381 SMBCFILE *srcfile, 382 SMBCFILE *dstfile, 383 off_t count, 384 int (*splice_cb)(off_t n, void *priv), 385 void *priv); 386 362 387 int 363 388 SMBC_close_ctx(SMBCCTX *context, … … 367 392 SMBC_getatr(SMBCCTX * context, 368 393 SMBCSRV *srv, 369 c har *path,370 uint16 *mode,371 SMB_OFF_T*size,394 const char *path, 395 uint16_t *mode, 396 off_t *size, 372 397 struct timespec *create_time_ts, 373 398 struct timespec *access_time_ts, … … 377 402 378 403 bool 379 SMBC_setatr(SMBCCTX * context, SMBCSRV *srv, char *path, 404 SMBC_setatr(SMBCCTX * context, SMBCSRV *srv, char *path, 380 405 time_t create_time, 381 406 time_t access_time, 382 407 time_t write_time, 383 408 time_t change_time, 384 uint16 mode);409 uint16_t mode); 385 410 386 411 off_t … … 412 437 char **pp_workgroup, 413 438 char **pp_server, 439 uint16_t *p_port, 414 440 char **pp_share, 415 441 char **pp_path, … … 449 475 SMBC_remove_unused_server(SMBCCTX * context, 450 476 SMBCSRV * srv); 451 452 void453 SMBC_call_auth_fn(TALLOC_CTX *ctx,454 SMBCCTX *context,455 const char *server,456 const char *share,457 char **pp_workgroup,458 char **pp_username,459 char **pp_password);460 477 461 478 void … … 479 496 bool connect_if_not_found, 480 497 const char *server, 498 uint16_t port, 481 499 const char *share, 482 500 char **pp_workgroup, … … 488 506 SMBCCTX *context, 489 507 const char *server, 508 uint16_t port, 490 509 const char *share, 491 510 char **pp_workgroup, -
vendor/current/source3/include/libsmbclient.h
r740 r988 5 5 Copyright (C) Richard Sharpe 2000 6 6 Copyright (C) John Terpsra 2000 7 Copyright (C) Tom Jansen (Ninja ISD) 2002 7 Copyright (C) Tom Jansen (Ninja ISD) 2002 8 8 Copyright (C) Derrell Lipman 2003-2008 9 9 10 10 11 11 This program is free software; you can redistribute it and/or modify 12 12 it under the terms of the GNU General Public License as published by 13 13 the Free Software Foundation; either version 3 of the License, or 14 14 (at your option) any later version. 15 15 16 16 This program is distributed in the hope that it will be useful, 17 17 but WITHOUT ANY WARRANTY; without even the implied warranty of 18 18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 19 GNU General Public License for more details. 20 20 21 21 You should have received a copy of the GNU General Public License 22 22 along with this program; if not, see <http://www.gnu.org/licenses/>. … … 38 38 39 39 /*-------------------------------------------------------------------*/ 40 /* The following are special comments to instruct DOXYGEN (automated 40 /* The following are special comments to instruct DOXYGEN (automated 41 41 * documentation tool: 42 42 */ … … 71 71 * Functions that don't fit in to other categories 72 72 */ 73 /*-------------------------------------------------------------------*/ 73 /*-------------------------------------------------------------------*/ 74 74 75 75 /* Make sure we have the following includes for now ... */ … … 77 77 #include <sys/stat.h> 78 78 #include <sys/statvfs.h> 79 #include <stdint.h> 79 80 #include <fcntl.h> 80 81 #include <utime.h> … … 96 97 * 97 98 */ 98 struct smbc_dirent 99 struct smbc_dirent 99 100 { 100 101 /** Type of entity. 101 102 SMBC_WORKGROUP=1, 102 SMBC_SERVER=2, 103 SMBC_SERVER=2, 103 104 SMBC_FILE_SHARE=3, 104 105 SMBC_PRINTER_SHARE=4, … … 107 108 SMBC_DIR=7, 108 109 SMBC_FILE=8, 109 SMBC_LINK=9,*/ 110 unsigned int smbc_type; 110 SMBC_LINK=9,*/ 111 unsigned int smbc_type; 111 112 112 113 /** Length of this smbc_dirent in bytes … … 117 118 */ 118 119 unsigned int commentlen; 119 /** Points to the null terminated comment string 120 /** Points to the null terminated comment string 120 121 */ 121 122 char *comment; … … 124 125 */ 125 126 unsigned int namelen; 126 /** Points to the null terminated name string 127 /** Points to the null terminated name string 127 128 */ 128 129 char name[1]; … … 207 208 */ 208 209 #ifndef _CLIENT_H 209 struct print_job_info 210 struct print_job_info 210 211 { 211 212 /** numeric ID of the print job 212 213 */ 213 214 unsigned short id; 214 215 215 216 /** represents print job priority (lower numbers mean higher priority) 216 217 */ 217 218 unsigned short priority; 218 219 219 220 /** Size of the print job 220 221 */ 221 222 size_t size; 222 223 223 224 /** Name of the user that owns the print job 224 225 */ 225 226 char user[128]; 226 227 227 228 /** Name of the print job. This will have no name if an anonymous print 228 229 * file was opened. Ie smb://server/printer … … 238 239 239 240 /**@ingroup structure 240 * Server handle 241 * Server handle 241 242 */ 242 243 typedef struct _SMBCSRV SMBCSRV; 243 244 244 245 /**@ingroup structure 245 * File or directory handle 246 * File or directory handle 246 247 */ 247 248 typedef struct _SMBCFILE SMBCFILE; 248 249 249 250 /**@ingroup structure 250 * File or directory handle 251 * File or directory handle 251 252 */ 252 253 typedef struct _SMBCCTX SMBCCTX; … … 276 277 /**@ingroup callback 277 278 * Authentication callback function type (traditional method) 278 * 279 * 279 280 * Type for the the authentication function called by the library to 280 * obtain authentication credent als281 * obtain authentication credentials 281 282 * 282 283 * For kerberos support the function should just be called without … … 292 293 * workgroup to be authenticated. Should be filled in 293 294 * with the correct workgroup if the hint is wrong. 294 * 295 * 295 296 * @param wglen The size of the workgroup buffer in bytes 296 297 * … … 299 300 * filled in with the correct workgroup if the hint is 300 301 * wrong. 301 * 302 * 302 303 * @param unlen The size of the username buffer in bytes 303 304 * 304 * @param pw Pointer to buffer containing to which password 305 * @param pw Pointer to buffer containing to which password 305 306 * copied 306 * 307 * 307 308 * @param pwlen The size of the password buffer in bytes 308 * 309 */ 310 typedef void (*smbc_get_auth_data_fn)(const char *srv, 309 * 310 */ 311 typedef void (*smbc_get_auth_data_fn)(const char *srv, 311 312 const char *shr, 312 char *wg, int wglen, 313 char *wg, int wglen, 313 314 char *un, int unlen, 314 315 char *pw, int pwlen); 315 316 /**@ingroup callback 316 317 * Authentication callback function type (method that includes context) 317 * 318 * 318 319 * Type for the the authentication function called by the library to 319 * obtain authentication credent als320 * obtain authentication credentials 320 321 * 321 322 * For kerberos support the function should just be called without … … 333 334 * workgroup to be authenticated. Should be filled in 334 335 * with the correct workgroup if the hint is wrong. 335 * 336 * 336 337 * @param wglen The size of the workgroup buffer in bytes 337 338 * … … 340 341 * filled in with the correct workgroup if the hint is 341 342 * wrong. 342 * 343 * 343 344 * @param unlen The size of the username buffer in bytes 344 345 * 345 * @param pw Pointer to buffer containing to which password 346 * @param pw Pointer to buffer containing to which password 346 347 * copied 347 * 348 * 348 349 * @param pwlen The size of the password buffer in bytes 349 * 350 * 350 351 */ 351 352 typedef void (*smbc_get_auth_data_with_context_fn)(SMBCCTX *c, 352 const char *srv, 353 const char *srv, 353 354 const char *shr, 354 char *wg, int wglen, 355 char *wg, int wglen, 355 356 char *un, int unlen, 356 357 char *pw, int pwlen); … … 362 363 * @param i pointer to print job information structure 363 364 * 364 */ 365 */ 365 366 typedef void (*smbc_list_print_job_fn)(struct print_job_info *i); 366 367 367 368 368 369 /**@ingroup callback … … 375 376 * @return 0 when connection is good. 1 on error. 376 377 * 377 */ 378 */ 378 379 typedef int (*smbc_check_server_fn)(SMBCCTX * c, SMBCSRV *srv); 379 380 … … 387 388 * @return 0 on success. 1 on failure. 388 389 * 389 */ 390 */ 390 391 typedef int (*smbc_remove_unused_server_fn)(SMBCCTX * c, SMBCSRV *srv); 391 392 … … 398 399 * @param srv pointer to server to add 399 400 * 400 * @param server server name 401 * @param server server name 401 402 * 402 403 * @param share share name … … 408 409 * @return 0 on success. 1 on failure. 409 410 * 410 */ 411 typedef int (*smbc_add_cached_srv_fn) (SMBCCTX * c, SMBCSRV *srv, 411 */ 412 typedef int (*smbc_add_cached_srv_fn) (SMBCCTX * c, SMBCSRV *srv, 412 413 const char * server, const char * share, 413 414 const char * workgroup, const char * username); … … 428 429 * @return pointer to SMBCSRV on success. NULL on failure. 429 430 * 430 */ 431 */ 431 432 typedef SMBCSRV * (*smbc_get_cached_srv_fn) (SMBCCTX * c, const char * server, 432 433 const char * share, const char * workgroup, … … 442 443 * @return 0 when found and removed. 1 on failure. 443 444 * 444 */ 445 */ 445 446 typedef int (*smbc_remove_cached_srv_fn)(SMBCCTX * c, SMBCSRV *srv); 446 447 … … 453 454 * @return 0 when found and removed. 1 on failure. 454 455 * 455 */ 456 */ 456 457 typedef int (*smbc_purge_cached_fn) (SMBCCTX * c); 457 458 … … 506 507 void 507 508 smbc_setTimeout(SMBCCTX *c, int timeout); 509 510 511 /** 512 * Get the TCP port used to connect (0 means default). 513 */ 514 uint16_t 515 smbc_getPort(SMBCCTX *c); 516 517 /** 518 * Set the TCP port used to connect (0 means default). 519 */ 520 void 521 smbc_setPort(SMBCCTX *c, uint16_t port); 508 522 509 523 … … 744 758 smbc_setOptionUseCCache(SMBCCTX *c, smbc_bool b); 745 759 760 /** Get indication that the password supplied is the NT hash */ 761 smbc_bool 762 smbc_getOptionUseNTHash(SMBCCTX *c); 763 764 /** Set indication that the password supplied is the NT hash */ 765 void 766 smbc_setOptionUseNTHash(SMBCCTX *c, smbc_bool b); 767 746 768 747 769 … … 851 873 void smbc_setFunctionWrite(SMBCCTX *c, smbc_write_fn fn); 852 874 875 typedef off_t (*smbc_splice_fn)(SMBCCTX *c, 876 SMBCFILE *srcfile, 877 SMBCFILE *dstfile, 878 off_t count, 879 int (*splice_cb)(off_t n, void *priv), 880 void *priv); 881 smbc_splice_fn smbc_getFunctionSplice(SMBCCTX *c); 882 void smbc_setFunctionSplice(SMBCCTX *c, smbc_splice_fn fn); 883 853 884 typedef int (*smbc_unlink_fn)(SMBCCTX *c, 854 885 const char *fname); … … 963 994 void smbc_setFunctionFstatdir(SMBCCTX *c, smbc_fstatdir_fn fn); 964 995 996 #define SMBC_NOTIFY_ACTION_ADDED 1 997 #define SMBC_NOTIFY_ACTION_REMOVED 2 998 #define SMBC_NOTIFY_ACTION_MODIFIED 3 999 #define SMBC_NOTIFY_ACTION_OLD_NAME 4 1000 #define SMBC_NOTIFY_ACTION_NEW_NAME 5 1001 #define SMBC_NOTIFY_ACTION_ADDED_STREAM 6 1002 #define SMBC_NOTIFY_ACTION_REMOVED_STREAM 7 1003 #define SMBC_NOTIFY_ACTION_MODIFIED_STREAM 8 1004 1005 struct smbc_notify_callback_action { 1006 uint32_t action; 1007 const char *filename; 1008 }; 1009 1010 typedef int (*smbc_notify_callback_fn)( 1011 const struct smbc_notify_callback_action *actions, 1012 size_t num_actions, void *private_data); 1013 1014 typedef int (*smbc_notify_fn)(SMBCCTX *c, SMBCFILE *dir, smbc_bool recursive, 1015 uint32_t completion_filter, 1016 unsigned callback_timeout_ms, 1017 smbc_notify_callback_fn cb, void *private_data); 1018 smbc_notify_fn smbc_getFunctionNotify(SMBCCTX *c); 1019 void smbc_setFunctionNotify(SMBCCTX *c, smbc_notify_fn fn); 965 1020 966 1021 … … 1074 1129 * 1075 1130 * @return Returns 0 on succes. Returns 1 on failure with errno set: 1076 * - EBUSY Server connections are still used, Files are open or cache 1131 * - EBUSY Server connections are still used, Files are open or cache 1077 1132 * could not be purged 1078 1133 * - EBADF context == NULL … … 1122 1177 * smbc_context_init() failure. Avoid this. 1123 1178 * You'll have to call smbc_free_context() yourself 1124 * on failure. 1179 * on failure. 1125 1180 */ 1126 1181 … … 1131 1186 * 1132 1187 * Must be called before using any of the smbclient API function 1133 * 1134 * @param fn The function that will be called to obtaion 1188 * 1189 * @param fn The function that will be called to obtaion 1135 1190 * authentication credentials. 1136 1191 * … … 1138 1193 * changed in smb.conf file. Allows caller to set 1139 1194 * debugging if no smb.conf. 1140 * 1195 * 1141 1196 * @return 0 on success, < 0 on error with errno set: 1142 1197 * - ENOMEM Out of memory … … 1174 1229 * Open a file on an SMB server. 1175 1230 * 1176 * @param furl The smb url of the file to be opened. 1177 * 1178 * @param flags Is one of O_RDONLY, O_WRONLY or O_RDWR which 1231 * @param furl The smb url of the file to be opened. 1232 * 1233 * @param flags Is one of O_RDONLY, O_WRONLY or O_RDWR which 1179 1234 * request opening the file read-only,write-only 1180 1235 * or read/write. flags may also be bitwise-or'd with 1181 * one or more of the following: 1182 * O_CREAT - If the file does not exist it will be 1236 * one or more of the following: 1237 * O_CREAT - If the file does not exist it will be 1183 1238 * created. 1184 * O_EXCL - When used with O_CREAT, if the file 1185 * already exists it is an error and the open will 1186 * fail. 1239 * O_EXCL - When used with O_CREAT, if the file 1240 * already exists it is an error and the open will 1241 * fail. 1187 1242 * O_TRUNC - If the file already exists it will be 1188 1243 * truncated. 1189 * O_APPEND The file is opened in append mode 1190 * 1191 * @param mode mode specifies the permissions to use if a new 1192 * file is created. It is modified by the 1244 * O_APPEND The file is opened in append mode 1245 * 1246 * @param mode mode specifies the permissions to use if a new 1247 * file is created. It is modified by the 1193 1248 * process's umask in the usual way: the permissions 1194 * of the created file are (mode & ~umask) 1249 * of the created file are (mode & ~umask) 1195 1250 * 1196 1251 * Not currently use, but there for future use. … … 1200 1255 * @return Valid file handle, < 0 on error with errno set: 1201 1256 * - ENOMEM Out of memory 1202 * - EINVAL if an invalid parameter passed, like no 1203 * file, or smbc_init not called. 1204 * - EEXIST pathname already exists and O_CREAT and 1205 * O_EXCL were used. 1206 * - EISDIR pathname refers to a directory and 1207 * the access requested involved writing. 1208 * - EACCES The requested access to the file is not 1209 * allowed 1210 * - ENODEV The requested share does not exist 1211 * - ENOTDIR A file on the path is not a directory 1212 * - ENOENT A directory component in pathname does 1213 * not exist. 1214 * 1215 * @see smbc_creat() 1216 * 1217 * @note This call uses an underlying routine that may create 1218 * a new connection to the server specified in the URL. 1219 * If the credentials supplied in the URL, or via the 1220 * auth_fn in the smbc_init call, fail, this call will 1221 * try again with an empty username and password. This 1222 * often gets mapped to the guest account on some machines. 1223 */ 1224 1225 int smbc_open(const char *furl, int flags, mode_t mode); 1226 1227 /**@ingroup file 1228 * Create a file on an SMB server. 1229 * 1230 * Same as calling smbc_open() with flags = O_CREAT|O_WRONLY|O_TRUNC 1231 * 1232 * @param furl The smb url of the file to be created 1233 * 1234 * @param mode mode specifies the permissions to use if a new 1235 * file is created. It is modified by the 1236 * process's umask in the usual way: the permissions 1237 * of the created file are (mode & ~umask) 1238 * 1239 * NOTE, the above is not true. We are dealing with 1240 * an SMB server, which has no concept of a umask! 1241 * 1242 * @return Valid file handle, < 0 on error with errno set: 1243 * - ENOMEM Out of memory 1244 * - EINVAL if an invalid parameter passed, like no 1257 * - EINVAL if an invalid parameter passed, like no 1245 1258 * file, or smbc_init not called. 1246 1259 * - EEXIST pathname already exists and O_CREAT and … … 1249 1262 * the access requested involved writing. 1250 1263 * - EACCES The requested access to the file is not 1251 * allowed 1252 * - ENOENT A directory component in pathname does 1264 * allowed 1265 * - ENODEV The requested share does not exist 1266 * - ENOTDIR A file on the path is not a directory 1267 * - ENOENT A directory component in pathname does 1268 * not exist. 1269 * 1270 * @see smbc_creat() 1271 * 1272 * @note This call uses an underlying routine that may create 1273 * a new connection to the server specified in the URL. 1274 * If the credentials supplied in the URL, or via the 1275 * auth_fn in the smbc_init call, fail, this call will 1276 * try again with an empty username and password. This 1277 * often gets mapped to the guest account on some machines. 1278 */ 1279 1280 int smbc_open(const char *furl, int flags, mode_t mode); 1281 1282 /**@ingroup file 1283 * Create a file on an SMB server. 1284 * 1285 * Same as calling smbc_open() with flags = O_CREAT|O_WRONLY|O_TRUNC 1286 * 1287 * @param furl The smb url of the file to be created 1288 * 1289 * @param mode mode specifies the permissions to use if a new 1290 * file is created. It is modified by the 1291 * process's umask in the usual way: the permissions 1292 * of the created file are (mode & ~umask) 1293 * 1294 * NOTE, the above is not true. We are dealing with 1295 * an SMB server, which has no concept of a umask! 1296 * 1297 * @return Valid file handle, < 0 on error with errno set: 1298 * - ENOMEM Out of memory 1299 * - EINVAL if an invalid parameter passed, like no 1300 * file, or smbc_init not called. 1301 * - EEXIST pathname already exists and O_CREAT and 1302 * O_EXCL were used. 1303 * - EISDIR pathname refers to a directory and 1304 * the access requested involved writing. 1305 * - EACCES The requested access to the file is not 1306 * allowed 1307 * - ENOENT A directory component in pathname does 1253 1308 * not exist. 1254 1309 * - ENODEV The requested share does not exist. … … 1272 1327 * < 0 on error, with errno set: 1273 1328 * - EISDIR fd refers to a directory 1274 * - EBADF fd is not a valid file descriptor or 1329 * - EBADF fd is not a valid file descriptor or 1275 1330 * is not open for reading. 1276 * - EINVAL fd is attached to an object which is 1331 * - EINVAL fd is attached to an object which is 1277 1332 * unsuitable for reading, or no buffer passed or 1278 1333 * smbc_init not called. … … 1295 1350 * @return Number of bytes written, < 0 on error with errno set: 1296 1351 * - EISDIR fd refers to a directory. 1297 * - EBADF fd is not a valid file descriptor or 1352 * - EBADF fd is not a valid file descriptor or 1298 1353 * is not open for reading. 1299 * - EINVAL fd is attached to an object which is 1354 * - EINVAL fd is attached to an object which is 1300 1355 * unsuitable for reading, or no buffer passed or 1301 1356 * smbc_init not called. … … 1311 1366 * 1312 1367 * @param fd Open file handle from smbc_open() or smbc_creat() 1313 * 1368 * 1314 1369 * @param offset Offset in bytes from whence 1315 * 1370 * 1316 1371 * @param whence A location in the file: 1317 1372 * - SEEK_SET The offset is set to offset bytes from 1318 1373 * the beginning of the file 1319 * - SEEK_CUR The offset is set to current location 1374 * - SEEK_CUR The offset is set to current location 1320 1375 * plus offset bytes. 1321 * - SEEK_END The offset is set to the size of the 1376 * - SEEK_END The offset is set to the size of the 1322 1377 * file plus offset bytes. 1323 1378 * 1324 * @return Upon successful completion, lseek returns the 1325 * resulting offset location as measured in bytes 1379 * @return Upon successful completion, lseek returns the 1380 * resulting offset location as measured in bytes 1326 1381 * from the beginning of the file. Otherwise, a value 1327 * of (off_t)-1 is returned and errno is set to 1382 * of (off_t)-1 is returned and errno is set to 1328 1383 * indicate the error: 1329 1384 * - EBADF Fildes is not an open file descriptor. … … 1332 1387 * 1333 1388 * @todo Are all the whence values really supported? 1334 * 1389 * 1335 1390 * @todo Are errno values complete and correct? 1336 1391 */ … … 1358 1413 * 1359 1414 * @return 0 on success, < 0 on error with errno set: 1360 * - EACCES or EPERM Write access to the directory 1361 * containing pathname is not allowed or one 1415 * - EACCES or EPERM Write access to the directory 1416 * containing pathname is not allowed or one 1362 1417 * of the directories in pathname did not allow 1363 1418 * search (execute) permission … … 1378 1433 /**@ingroup directory 1379 1434 * Rename or move a file or directory. 1380 * 1381 * @param ourl The original smb url (source url) of file or 1435 * 1436 * @param ourl The original smb url (source url) of file or 1382 1437 * directory to be moved 1383 * 1438 * 1384 1439 * @param nurl The new smb url (destination url) of the file 1385 1440 * or directory after the move. Currently nurl must … … 1389 1444 * - EISDIR nurl is an existing directory, but ourl is 1390 1445 * not a directory. 1391 * - EEXIST nurl is a non-empty directory, 1446 * - EEXIST nurl is a non-empty directory, 1392 1447 * i.e., contains entries other than "." and ".." 1393 * - EINVAL The new url contained a path prefix 1448 * - EINVAL The new url contained a path prefix 1394 1449 * of the old, or, more generally, an attempt was 1395 1450 * made to make a directory a subdirectory of itself 1396 1451 * or smbc_init not called. 1397 * - ENOTDIR A component used as a directory in ourl 1398 * or nurl path is not, in fact, a directory. Or, 1452 * - ENOTDIR A component used as a directory in ourl 1453 * or nurl path is not, in fact, a directory. Or, 1399 1454 * ourl is a directory, and newpath exists but is not 1400 1455 * a directory. 1401 * - EACCES or EPERM Write access to the directory 1402 * containing ourl or nurl is not allowed for the 1403 * process's effective uid, or one of the 1456 * - EACCES or EPERM Write access to the directory 1457 * containing ourl or nurl is not allowed for the 1458 * process's effective uid, or one of the 1404 1459 * directories in ourl or nurl did not allow search 1405 1460 * (execute) permission, or ourl was a directory 1406 1461 * and did not allow write permission. 1407 * - ENOENT A directory component in ourl or nurl 1462 * - ENOENT A directory component in ourl or nurl 1408 1463 * does not exist. 1409 1464 * - EXDEV Rename across shares not supported. … … 1429 1484 * not parse, or was of incorrect form or smbc_init not 1430 1485 * called. 1431 * - ENOENT durl does not exist, or name is an 1432 * - ENOMEM Insufficient memory to complete the 1433 * operation. 1486 * - ENOENT durl does not exist, or name is an 1487 * - ENOMEM Insufficient memory to complete the 1488 * operation. 1434 1489 * - ENOTDIR name is not a directory. 1435 1490 * - EPERM the workgroup could not be found. … … 1458 1513 * Get multiple directory entries. 1459 1514 * 1460 * smbc_getdents() reads as many dirent structures from the an open 1515 * smbc_getdents() reads as many dirent structures from the an open 1461 1516 * directory handle into a specified memory area as will fit. 1462 1517 * … … 1465 1520 * @param dirp pointer to buffer that will receive the directory 1466 1521 * entries. 1467 * 1522 * 1468 1523 * @param count The size of the dirp buffer in bytes 1469 1524 * … … 1509 1564 * @return The current location in the directory stream or -1 1510 1565 * if an error occur. The current location is not 1511 * an offset. Becuase of the implementation, it is a 1566 * an offset. Becuase of the implementation, it is a 1512 1567 * handle that allows the library to find the entry 1513 1568 * later. … … 1529 1584 * 1530 1585 * @param fd Valid directory as returned by smbc_opendir() 1531 * 1586 * 1532 1587 * @param offset The offset (as returned by smbc_telldir). Can be 1533 1588 * NULL, in which case we will rewind … … 1552 1607 * 1553 1608 * @param mode Specifies the permissions to use. It is modified 1554 * by the process's umask in the usual way: the 1609 * by the process's umask in the usual way: the 1555 1610 * permissions of the created file are (mode & ~umask). 1556 * 1611 * 1557 1612 * @return 0 on success, < 0 on error with errno set: 1558 1613 * - EEXIST directory url already exists … … 1572 1627 /**@ingroup directory 1573 1628 * Remove a directory. 1574 * 1629 * 1575 1630 * @param durl The smb url of the directory to remove 1576 1631 * … … 1584 1639 * - ENOMEM Insufficient kernel memory was available. 1585 1640 * 1586 * @see smbc_mkdir(), smbc_unlink() 1641 * @see smbc_mkdir(), smbc_unlink() 1587 1642 * 1588 1643 * @todo Are errno values complete and correct? … … 1590 1645 int smbc_rmdir(const char *durl); 1591 1646 1647 /**@ingroup directory 1648 * Request directory notifications 1649 * 1650 * @param dh Valid directory as returned by smbc_opendir() 1651 * 1652 * @param recursive Are changes in subdirectories wanted? 1653 * 1654 * @param completion_filter Bitwise-or of the SMBC_NOTIFY_CHANGE_* 1655 * events that are interesting 1656 * 1657 * @param callback_timeout_ms If set to non-zero, interval in milliseconds 1658 * that "cb" will be called with 0 actions. 1659 * This gives "cb" the chance to cancel the 1660 * smbc_notify call. 1661 * 1662 * @param cb Callback functions taking events. If "cb" 1663 * returns nonzero, smbc_notify will return. 1664 * 1665 * @param private_data Pointer given to "cb" 1666 * 1667 * @return 0 on success, -1 on error with errno set 1668 * 1669 * @see smbc_opendir(), smbc_closedir() 1670 */ 1671 1672 #define SMBC_NOTIFY_CHANGE_FILE_NAME 0x001 1673 #define SMBC_NOTIFY_CHANGE_DIR_NAME 0x002 1674 #define SMBC_NOTIFY_CHANGE_ATTRIBUTES 0x004 1675 #define SMBC_NOTIFY_CHANGE_SIZE 0x008 1676 #define SMBC_NOTIFY_CHANGE_LAST_WRITE 0x010 1677 #define SMBC_NOTIFY_CHANGE_LAST_ACCESS 0x020 1678 #define SMBC_NOTIFY_CHANGE_CREATION 0x040 1679 #define SMBC_NOTIFY_CHANGE_EA 0x080 1680 #define SMBC_NOTIFY_CHANGE_SECURITY 0x100 1681 #define SMBC_NOTIFY_CHANGE_STREAM_NAME 0x200 1682 #define SMBC_NOTIFY_CHANGE_STREAM_SIZE 0x400 1683 #define SMBC_NOTIFY_CHANGE_STREAM_WRITE 0x800 1684 1685 int smbc_notify(int dh, smbc_bool recursive, uint32_t completion_filter, 1686 unsigned callback_timeout_ms, 1687 smbc_notify_callback_fn cb, void *private_data); 1592 1688 1593 1689 /**@ingroup attribute … … 1596 1692 * @param url The smb url to get information for 1597 1693 * 1598 * @param st pointer to a buffer that will be filled with 1694 * @param st pointer to a buffer that will be filled with 1599 1695 * standard Unix struct stat information. 1600 1696 * … … 1615 1711 /**@ingroup attribute 1616 1712 * Get file information via an file descriptor. 1617 * 1713 * 1618 1714 * @param fd Open file handle from smbc_open() or smbc_creat() 1619 1715 * 1620 * @param st pointer to a buffer that will be filled with 1716 * @param st pointer to a buffer that will be filled with 1621 1717 * standard Unix struct stat information. 1622 * 1718 * 1623 1719 * @return 0 on success, < 0 on error with errno set: 1624 1720 * - EBADF filedes is bad. … … 1637 1733 /**@ingroup attribute 1638 1734 * Get file system information for a specified path. 1639 * 1735 * 1640 1736 * @param url The smb url to get information for 1641 1737 * 1642 * @param st pointer to a buffer that will be filled with 1738 * @param st pointer to a buffer that will be filled with 1643 1739 * standard Unix struct statvfs information. 1644 * 1740 * 1645 1741 * @return 0 on success, < 0 on error with errno set: 1646 1742 * - EBADF filedes is bad. … … 1660 1756 /**@ingroup attribute 1661 1757 * Get file system information via an file descriptor. 1662 * 1758 * 1663 1759 * @param fd Open file handle from smbc_open(), smbc_creat(), 1664 1760 * or smbc_opendir() 1665 1761 * 1666 * @param st pointer to a buffer that will be filled with 1762 * @param st pointer to a buffer that will be filled with 1667 1763 * standard Unix struct statvfs information. 1668 * 1764 * 1669 1765 * @return 0 on success, < 0 on error with errno set: 1670 1766 * - EBADF filedes is bad. … … 1685 1781 /**@ingroup attribute 1686 1782 * Truncate a file given a file descriptor 1687 * 1783 * 1688 1784 * @param fd Open file handle from smbc_open() or smbc_creat() 1689 1785 * 1690 1786 * @param size size to truncate the file to 1691 * 1787 * 1692 1788 * @return 0 on success, < 0 on error with errno set: 1693 1789 * - EBADF filedes is bad. … … 1709 1805 * @param url The smb url of the file or directory to change 1710 1806 * permissions of 1711 * 1807 * 1712 1808 * @param mode The permissions to set: 1713 1809 * - Put good explaination of permissions here! … … 1771 1867 * @param url The smb url of the file or directory to set extended 1772 1868 * attributes for. 1773 * 1869 * 1774 1870 * @param name The name of an attribute to be changed. Names are of 1775 1871 * one of the following forms: … … 1881 1977 * @param url The smb url of the file or directory to set extended 1882 1978 * attributes for. 1883 * 1979 * 1884 1980 * @param name The name of an attribute to be changed. Names are of 1885 1981 * one of the following forms: … … 1988 2084 * previously returned by smbc_open(), to get extended 1989 2085 * attributes for. 1990 * 2086 * 1991 2087 * @param name The name of an attribute to be changed. Names are of 1992 2088 * one of the following forms: … … 2093 2189 * @param url The smb url of the file or directory to get extended 2094 2190 * attributes for. 2095 * 2191 * 2096 2192 * @param name The name of an attribute to be retrieved. Names are of 2097 2193 * one of the following forms: … … 2129 2225 * required to hold the attribute value will be returned, 2130 2226 * but nothing will be placed into the value buffer. 2131 * 2227 * 2132 2228 * @return 0 on success, < 0 on error with errno set: 2133 2229 * - EINVAL The client library is not properly initialized … … 2158 2254 * @param url The smb url of the file or directory to get extended 2159 2255 * attributes for. 2160 * 2256 * 2161 2257 * @param name The name of an attribute to be retrieved. Names are of 2162 2258 * one of the following forms: … … 2194 2290 * required to hold the attribute value will be returned, 2195 2291 * but nothing will be placed into the value buffer. 2196 * 2292 * 2197 2293 * @return 0 on success, < 0 on error with errno set: 2198 2294 * - EINVAL The client library is not properly initialized … … 2221 2317 * previously returned by smbc_open(), to get extended 2222 2318 * attributes for. 2223 * 2319 * 2224 2320 * @param name The name of an attribute to be retrieved. Names are of 2225 2321 * one of the following forms: … … 2257 2353 * required to hold the attribute value will be returned, 2258 2354 * but nothing will be placed into the value buffer. 2259 * 2355 * 2260 2356 * @return 0 on success, < 0 on error with errno set: 2261 2357 * - EINVAL The client library is not properly initialized … … 2284 2380 * @param url The smb url of the file or directory to remove the extended 2285 2381 * attributes for. 2286 * 2382 * 2287 2383 * @param name The name of an attribute to be removed. Names are of 2288 2384 * one of the following forms: … … 2334 2430 * @param url The smb url of the file or directory to remove the extended 2335 2431 * attributes for. 2336 * 2432 * 2337 2433 * @param name The name of an attribute to be removed. Names are of 2338 2434 * one of the following forms: … … 2382 2478 * previously returned by smbc_open(), to get extended 2383 2479 * attributes for. 2384 * 2480 * 2385 2481 * @param name The name of an attribute to be removed. Names are of 2386 2482 * one of the following forms: … … 2437 2533 * required to hold all of the attribute names will be 2438 2534 * returned, but nothing will be placed into the list buffer. 2439 * 2535 * 2440 2536 * @return 0 on success, < 0 on error with errno set: 2441 2537 * - EINVAL The client library is not properly initialized … … 2475 2571 * required to hold all of the attribute names will be 2476 2572 * returned, but nothing will be placed into the list buffer. 2477 * 2573 * 2478 2574 * @return 0 on success, < 0 on error with errno set: 2479 2575 * - EINVAL The client library is not properly initialized … … 2501 2597 * previously returned by smbc_open(), to get extended 2502 2598 * attributes for. 2503 * 2599 * 2504 2600 * @param list A pointer to a buffer in which the list of attributes for 2505 2601 * the specified file or directory will be placed (unless … … 2510 2606 * required to hold all of the attribute names will be 2511 2607 * returned, but nothing will be placed into the list buffer. 2512 * 2608 * 2513 2609 * @return 0 on success, < 0 on error with errno set: 2514 2610 * - EINVAL The client library is not properly initialized … … 2532 2628 /**@ingroup print 2533 2629 * Print a file given the name in fname. It would be a URL ... 2534 * 2630 * 2535 2631 * @param fname The URL of a file on a remote SMB server that the 2536 2632 * caller wants printed … … 2538 2634 * @param printq The URL of the print share to print the file to. 2539 2635 * 2540 * @return 0 on success, < 0 on error with errno set: 2636 * @return 0 on success, < 0 on error with errno set: 2541 2637 * 2542 2638 * - EINVAL fname or printq was NULL or smbc_init not … … 2544 2640 * and errors returned by smbc_open 2545 2641 * 2546 */ 2642 */ 2547 2643 int smbc_print_file(const char *fname, const char *printq); 2548 2644 … … 2563 2659 2564 2660 /**@ingroup print 2565 * List the print jobs on a print share, for the moment, pass a callback 2661 * List the print jobs on a print share, for the moment, pass a callback 2566 2662 * 2567 2663 * @param purl The url of the print share to list the jobs of 2568 * 2664 * 2569 2665 * @param fn Callback function the receives printjob info 2570 * 2571 * @return 0 on success, < 0 on error with errno set: 2666 * 2667 * @return 0 on success, < 0 on error with errno set: 2572 2668 * - EINVAL fname was NULL or smbc_init not called 2573 2669 * - EACCES ??? … … 2576 2672 2577 2673 /**@ingroup print 2578 * Delete a print job 2674 * Delete a print job 2579 2675 * 2580 2676 * @param purl Url of the print share … … 2582 2678 * @param id The id of the job to delete 2583 2679 * 2584 * @return 0 on success, < 0 on error with errno set: 2680 * @return 0 on success, < 0 on error with errno set: 2585 2681 * - EINVAL fname was NULL or smbc_init not called 2586 2682 * … … 2611 2707 * string should be placed. This may be a pointer to the 2612 2708 * same buffer as src_segment. 2613 * 2709 * 2614 2710 * @param src A pointer to the buffer containing the URL to be decoded. 2615 2711 * Any %xx sequences herein are converted to their single … … 2619 2715 * @param max_dest_len 2620 2716 * The size of the buffer pointed to by dest_segment. 2621 * 2717 * 2622 2718 * @return The number of % sequences which could not be converted 2623 2719 * due to lack of two following hexadecimal digits. … … 2640 2736 * string should be placed. Unlike smbc_urldecode(), this 2641 2737 * must be a buffer unique from src. 2642 * 2738 * 2643 2739 * @param src A pointer to the buffer containing the string to be encoded. 2644 2740 * Any character not specifically allowed in a URL is converted … … 2647 2743 * @param max_dest_len 2648 2744 * The size of the buffer pointed to by dest_segment. 2649 * 2745 * 2650 2746 * @returns The remaining buffer length. 2651 2747 */ … … 2704 2800 * Wrapper around smbc_set_credentials. 2705 2801 * Used to set correct credentials that will 2706 * be used to connect to DFS target share 2802 * be used to connect to DFS target share 2707 2803 * in libsmbclient 2708 2804 */ … … 2807 2903 int lock_type, 2808 2904 const char *location), 2809 2905 2810 2906 /* Thread local storage. */ 2811 2907 int (*create_tls)(const char *keyname, … … 2825 2921 /** 2826 2922 * @ingroup structure 2827 * Structure that contains a client context information 2923 * Structure that contains a client context information 2828 2924 * This structure is known as SMBCCTX 2829 2925 * … … 2847 2943 */ 2848 2944 int debug DEPRECATED_SMBC_INTERFACE; 2849 2945 2850 2946 /** 2851 2947 * netbios name used for making connections … … 2889 2985 * Use smbc_getFunction*() and smbc_setFunction*(), e.g. 2890 2986 * smbc_getFunctionOpen(), smbc_setFunctionUnlink(), etc. 2891 */ 2987 */ 2892 2988 smbc_open_fn open DEPRECATED_SMBC_INTERFACE; 2893 2989 smbc_creat_fn creat DEPRECATED_SMBC_INTERFACE; … … 2942 3038 */ 2943 3039 smbc_get_auth_data_fn auth_fn DEPRECATED_SMBC_INTERFACE; 2944 3040 2945 3041 /** 2946 3042 * check if a server is still good … … 2970 3066 2971 3067 /** 2972 * server cache addition 3068 * server cache addition 2973 3069 * 2974 3070 * DEPRECATED: … … 2979 3075 2980 3076 /** 2981 * server cache lookup 3077 * server cache lookup 2982 3078 * 2983 3079 * DEPRECATED: … … 2995 3091 */ 2996 3092 smbc_remove_cached_srv_fn remove_cached_srv_fn DEPRECATED_SMBC_INTERFACE; 2997 3093 2998 3094 /** 2999 3095 * server cache purging, try to remove all cached servers … … 3017 3113 /* 3018 3114 * Very old configuration options. 3019 * 3115 * 3020 3116 * DEPRECATED: 3021 3117 * Use one of the following functions instead: … … 3028 3124 */ 3029 3125 int flags DEPRECATED_SMBC_INTERFACE; 3030 3126 3031 3127 /** 3032 3128 * user options selections that apply to this session … … 3043 3139 int one_share_per_server DEPRECATED_SMBC_INTERFACE; 3044 3140 } options DEPRECATED_SMBC_INTERFACE; 3045 3141 3046 3142 /** INTERNAL DATA 3047 3143 * do _NOT_ touch this from your program ! -
vendor/current/source3/include/local.h
r746 r988 5 5 #ifndef _LOCAL_H 6 6 #define _LOCAL_H 7 8 /* The default workgroup - usually overridden in smb.conf */9 #ifndef WORKGROUP10 #define WORKGROUP "WORKGROUP"11 #endif12 13 /* This defines the section name in the configuration file that will contain */14 /* global parameters - that is, parameters relating to the whole server, not */15 /* just services. This name is then reserved, and may not be used as a */16 /* a service name. It will default to "global" if not defined here. */17 #define GLOBAL_NAME "global"18 #define GLOBAL_NAME2 "globals"19 20 /* This defines the section name in the configuration file that will21 refer to the special "homes" service */22 #define HOMES_NAME "homes"23 24 /* This defines the section name in the configuration file that will25 refer to the special "printers" service */26 #define PRINTERS_NAME "printers"27 7 28 8 /* Yves Gaige <yvesg@hptnodur.grenoble.hp.com> requested this set this */ … … 48 28 49 29 #ifndef MAX_OPEN_FUDGEFACTOR 50 #define MAX_OPEN_FUDGEFACTOR 2030 #define MAX_OPEN_FUDGEFACTOR 40 51 31 #endif 52 32 … … 100 80 NT file manager window? */ 101 81 #define FSTYPE_STRING "NTFS" 102 103 /* the default guest account - normally set in the Makefile or smb.conf */104 #ifndef GUEST_ACCOUNT105 #define GUEST_ACCOUNT "nobody"106 #endif107 82 108 83 /* user to test password server with as invalid in security=server mode. */ … … 172 147 #define USE_READ_PREDICTION 0 173 148 174 /*175 * Default passwd chat script.176 */177 178 #define DEFAULT_PASSWD_CHAT "*new*password* %n\\n *new*password* %n\\n *changed*"179 180 149 /* Minimum length of allowed password when changing UNIX password. */ 181 150 #define MINPASSWDLENGTH 5 182 151 183 /* maximum ID number used for session control. This cannot be larger184 than 62*62 for the current code */185 #define MAX_SESSION_ID 3000186 187 /* For the benifit of PAM and the 'session exec' scripts, we fake up a terminal188 name. This can be in one of two forms: The first for systems not using189 utmp (and therefore not constrained as to length or the need for a number190 < 3000 or so) and the second for systems with this 'well behaved terminal191 like name' constraint.192 */193 194 #ifndef SESSION_TEMPLATE195 /* Paramaters are 'pid' and 'vuid' */196 #define SESSION_TEMPLATE "smb/%lu/%d"197 #endif198 199 #ifndef SESSION_UTMP_TEMPLATE200 #define SESSION_UTMP_TEMPLATE "smb/%d"201 #endif202 203 152 /* the maximum age in seconds of a password. Should be a lp_ parameter */ 204 153 #define MAX_PASSWORD_AGE (21*24*60*60) … … 212 161 /* this enables the "rabbit pellet" fix for SMBwritebraw */ 213 162 #define RABBIT_PELLET_FIX 1 214 215 /* Max number of jobs per print queue. */216 #define PRINT_MAX_JOBID 10000217 163 218 164 /* Max number of open RPC pipes. */ … … 248 194 249 195 /* Seconds between connection attempts to a remote server. */ 250 #define FAILED_CONNECTION_CACHE_TIMEOUT 30196 #define FAILED_CONNECTION_CACHE_TIMEOUT (LONG_CONNECT_TIMEOUT * 2 / 1000) 251 197 252 198 /* Default hash size for the winbindd cache. */ … … 259 205 #define MAX_RPC_DATA_SIZE (15*1024*1024) 260 206 261 #define CLIENT_NDR_PADDING_SIZE 8 262 #define SERVER_NDR_PADDING_SIZE 8 263 264 #define DEFAULT_SMB2_MAX_READ (64*1024) 265 #define DEFAULT_SMB2_MAX_WRITE (64*1024) 266 #define DEFAULT_SMB2_MAX_TRANSACT (64*1024) 267 #define DEFAULT_SMB2_MAX_CREDITS 8192 268 269 #endif 207 /* A guestimate of how many domains winbindd will be contacting */ 208 #ifndef WINBIND_MAX_DOMAINS_HINT 209 #define WINBIND_MAX_DOMAINS_HINT 10 210 #endif 211 #endif -
vendor/current/source3/include/locking.h
r740 r988 1 /* 1 /* 2 2 Unix SMB/CIFS implementation. 3 3 SMB parameters and setup, plus a whole lot more. 4 4 5 5 Copyright (C) Jeremy Allison 2006 6 6 7 7 This program is free software; you can redistribute it and/or modify 8 8 it under the terms of the GNU General Public License as published by 9 9 the Free Software Foundation; either version 3 of the License, or 10 10 (at your option) any later version. 11 11 12 12 This program is distributed in the hope that it will be useful, 13 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 15 GNU General Public License for more details. 16 16 17 17 You should have received a copy of the GNU General Public License 18 18 along with this program. If not, see <http://www.gnu.org/licenses/>. … … 40 40 struct lock_context { 41 41 uint64_t smblctx; 42 uint 16tid;42 uint32_t tid; 43 43 struct server_id pid; 44 44 }; … … 46 46 struct files_struct; 47 47 48 #include " ../librpc/gen_ndr/file_id.h"48 #include "lib/file_id.h" 49 49 50 struct byte_range_lock { 51 struct files_struct *fsp; 52 unsigned int num_locks; 53 bool modified; 54 bool read_only; 55 struct file_id key; 56 struct lock_struct *lock_data; 57 struct db_record *record; 58 }; 50 struct byte_range_lock; 59 51 60 /* Internal structure in brlock.tdb. 52 /* Internal structure in brlock.tdb. 61 53 The data in brlock records is an unsorted linear array of these 62 54 records. It is unnecessary to store the count as tdb provides the … … 67 59 br_off start; 68 60 br_off size; 69 uint 16fnum;61 uint64_t fnum; 70 62 enum brl_type lock_type; 71 63 enum brl_flavour lock_flav; … … 99 91 }; 100 92 93 struct share_mode_lock { 94 struct share_mode_data *data; 95 }; 96 101 97 #endif /* _LOCKING_H_ */ -
vendor/current/source3/include/messages.h
r740 r988 4 4 Copyright (C) Andrew Tridgell 2000 5 5 Copyright (C) 2001, 2002 by Martin Pool 6 6 7 7 This program is free software; you can redistribute it and/or modify 8 8 it under the terms of the GNU General Public License as published by 9 9 the Free Software Foundation; either version 3 of the License, or 10 10 (at your option) any later version. 11 11 12 12 This program is distributed in the hope that it will be useful, 13 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 15 GNU General Public License for more details. 16 16 17 17 You should have received a copy of the GNU General Public License 18 18 along with this program. If not, see <http://www.gnu.org/licenses/>. … … 43 43 #define FLAG_MSG_SMBD 0x0002 44 44 #define FLAG_MSG_NMBD 0x0004 45 #define FLAG_MSG_ PRINT_NOTIFY0x000845 #define FLAG_MSG_WINBIND 0x0008 46 46 #define FLAG_MSG_PRINT_GENERAL 0x0010 47 47 /* dbwrap messages 4001-4999 */ 48 48 #define FLAG_MSG_DBWRAP 0x0020 49 50 51 /*52 * Virtual Node Numbers are identifying a node within a cluster. Ctdbd sets53 * this, we retrieve our vnn from it.54 */55 56 #define NONCLUSTER_VNN (0xFFFFFFFF)57 49 58 50 /* … … 68 60 69 61 #include "librpc/gen_ndr/server_id.h" 62 #include "lib/util/data_blob.h" 63 #include "system/network.h" 70 64 71 #ifdef CLUSTER_SUPPORT72 65 #define MSG_BROADCAST_PID_STR "0:0" 73 #else74 #define MSG_BROADCAST_PID_STR "0"75 #endif76 66 77 67 struct messaging_context; 78 68 struct messaging_rec; 79 69 80 /*81 * struct messaging_context belongs to messages.c, but because we still have82 * messaging_dispatch, we need it here. Once we get rid of signals for83 * notifying processes, this will go.84 */85 86 struct messaging_context {87 struct server_id id;88 struct event_context *event_ctx;89 struct messaging_callback *callbacks;90 91 struct messaging_backend *local;92 struct messaging_backend *remote;93 };94 95 70 struct messaging_backend { 96 NTSTATUS (*send_fn)(struct messaging_context *msg_ctx, 97 struct server_id pid, int msg_type, 98 const DATA_BLOB *data, 99 struct messaging_backend *backend); 71 int (*send_fn)(struct server_id src, 72 struct server_id pid, int msg_type, 73 const struct iovec *iov, int iovlen, 74 const int *fds, size_t num_fds, 75 struct messaging_backend *backend); 100 76 void *private_data; 101 77 }; 102 78 103 NTSTATUS messaging_tdb_init(struct messaging_context *msg_ctx, 104 TALLOC_CTX *mem_ctx, 105 struct messaging_backend **presult); 106 107 bool messaging_tdb_parent_init(TALLOC_CTX *mem_ctx); 108 109 NTSTATUS messaging_ctdbd_init(struct messaging_context *msg_ctx, 110 TALLOC_CTX *mem_ctx, 111 struct messaging_backend **presult); 79 int messaging_ctdbd_init(struct messaging_context *msg_ctx, 80 TALLOC_CTX *mem_ctx, 81 struct messaging_backend **presult); 112 82 struct ctdbd_connection *messaging_ctdbd_connection(void); 113 83 … … 116 86 const void *buf, size_t len, 117 87 int *n_sent); 118 struct event_context *messaging_event_context(struct messaging_context *msg_ctx);119 88 struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, 120 struct server_id server_id, 121 struct event_context *ev); 89 struct tevent_context *ev); 122 90 123 91 struct server_id messaging_server_id(const struct messaging_context *msg_ctx); 92 struct tevent_context *messaging_tevent_context( 93 struct messaging_context *msg_ctx); 94 struct server_id_db *messaging_names_db(struct messaging_context *msg_ctx); 124 95 125 96 /* 126 97 * re-init after a fork 127 98 */ 128 NTSTATUS messaging_reinit(struct messaging_context *msg_ctx, 129 struct server_id id); 99 NTSTATUS messaging_reinit(struct messaging_context *msg_ctx); 130 100 131 101 NTSTATUS messaging_register(struct messaging_context *msg_ctx, … … 139 109 void messaging_deregister(struct messaging_context *ctx, uint32_t msg_type, 140 110 void *private_data); 111 112 /** 113 * CAVEAT: 114 * 115 * While the messaging_send*() functions are synchronuous by API, 116 * they trigger a tevent-based loop upon sending bigger messages. 117 * 118 * Hence callers should not use these in purely synchonous code, 119 * but run a tevent_loop instead. 120 */ 141 121 NTSTATUS messaging_send(struct messaging_context *msg_ctx, 142 122 struct server_id server, 143 123 uint32_t msg_type, const DATA_BLOB *data); 124 144 125 NTSTATUS messaging_send_buf(struct messaging_context *msg_ctx, 145 126 struct server_id server, uint32_t msg_type, 146 const uint8 *buf, size_t len); 147 void messaging_dispatch_rec(struct messaging_context *msg_ctx, 148 struct messaging_rec *rec); 127 const uint8_t *buf, size_t len); 128 int messaging_send_iov_from(struct messaging_context *msg_ctx, 129 struct server_id src, struct server_id dst, 130 uint32_t msg_type, 131 const struct iovec *iov, int iovlen, 132 const int *fds, size_t num_fds); 133 NTSTATUS messaging_send_iov(struct messaging_context *msg_ctx, 134 struct server_id server, uint32_t msg_type, 135 const struct iovec *iov, int iovlen, 136 const int *fds, size_t num_fds); 137 138 struct tevent_req *messaging_filtered_read_send( 139 TALLOC_CTX *mem_ctx, struct tevent_context *ev, 140 struct messaging_context *msg_ctx, 141 bool (*filter)(struct messaging_rec *rec, void *private_data), 142 void *private_data); 143 int messaging_filtered_read_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, 144 struct messaging_rec **presult); 145 146 struct tevent_req *messaging_read_send(TALLOC_CTX *mem_ctx, 147 struct tevent_context *ev, 148 struct messaging_context *msg, 149 uint32_t msg_type); 150 int messaging_read_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, 151 struct messaging_rec **presult); 152 153 struct tevent_req *messaging_handler_send( 154 TALLOC_CTX *mem_ctx, struct tevent_context *ev, 155 struct messaging_context *msg_ctx, uint32_t msg_type, 156 bool (*handler)(struct messaging_context *msg_ctx, 157 struct messaging_rec **rec, void *private_data), 158 void *private_data); 159 int messaging_handler_recv(struct tevent_req *req); 160 161 int messaging_cleanup(struct messaging_context *msg_ctx, pid_t pid); 162 163 bool messaging_parent_dgm_cleanup_init(struct messaging_context *msg); 149 164 150 165 #include "librpc/gen_ndr/ndr_messaging.h" -
vendor/current/source3/include/msdfs.h
r740 r988 39 39 40 40 struct client_dfs_referral { 41 uint32 proximity;42 uint32 ttl;41 uint32_t proximity; 42 uint32_t ttl; 43 43 char *dfspath; 44 44 }; … … 46 46 struct referral { 47 47 char *alternate_path; /* contains the path referred */ 48 uint32 proximity;49 uint32 ttl; /* how long should client cache referral */48 uint32_t proximity; 49 uint32_t ttl; /* how long should client cache referral */ 50 50 }; 51 51 -
vendor/current/source3/include/nameserv.h
r414 r988 200 200 201 201 struct nmb_data { 202 uint16 nb_flags;/* Netbios flags. */202 uint16_t nb_flags; /* Netbios flags. */ 203 203 int num_ips; /* Number of ip entries. */ 204 204 struct in_addr *ip; /* The ip list for this name. */ … … 233 233 }; 234 234 235 /* used for server information: client, nameserv and ipc */ 236 struct server_info_struct { 237 fstring name; 238 uint32_t type; 239 fstring comment; 240 fstring domain; /* used ONLY in ipc.c NOT namework.c */ 241 bool server_added; /* used ONLY in ipc.c NOT namework.c */ 242 }; 243 235 244 /* This is used to hold the list of servers in my domain, and is 236 245 contained within lists of domains. */ … … 281 290 bool needelection; 282 291 int ElectionCount; 283 uint32 ElectionCriterion;292 uint32_t ElectionCriterion; 284 293 285 294 /* Domain master browser info. Used for efficient syncs. */ … … 329 338 struct userdata_struct *, 330 339 struct nmb_name *, 331 uint16 ,340 uint16_t, 332 341 int, 333 342 struct in_addr); … … 347 356 struct userdata_struct *, 348 357 struct nmb_name *, 349 uint16 ,358 uint16_t, 350 359 int, 351 360 struct in_addr); … … 378 387 struct response_record *prev; 379 388 380 uint16 response_id;389 uint16_t response_id; 381 390 382 391 /* Callbacks for packets received or not. */ -
vendor/current/source3/include/nt_printing.h
r860 r988 68 68 69 69 /* Notify spoolss clients that something has changed. The 70 notification data is either stored in two uint32 values or a70 notification data is either stored in two uint32_t values or a 71 71 variable length array. */ 72 72 … … 75 75 typedef struct spoolss_notify_msg { 76 76 fstring printer; /* Name of printer notified */ 77 uint32 type; /* Printer or job notify */78 uint32 field; /* Notify field changed */79 uint32 id; /* Job id */80 uint32 len; /* Length of data, 0 for two uint32value */81 uint32 flags;77 uint32_t type; /* Printer or job notify */ 78 uint32_t field; /* Notify field changed */ 79 uint32_t id; /* Job id */ 80 uint32_t len; /* Length of data, 0 for two uint32_t value */ 81 uint32_t flags; 82 82 union { 83 uint32 value[2];83 uint32_t value[2]; 84 84 char *data; 85 85 } notify; … … 88 88 typedef struct { 89 89 fstring printername; 90 uint32 90 uint32_t num_msgs; 91 91 SPOOLSS_NOTIFY_MSG *msgs; 92 92 } SPOOLSS_NOTIFY_MSG_GROUP; … … 94 94 typedef struct { 95 95 TALLOC_CTX *ctx; 96 uint32 96 uint32_t num_groups; 97 97 SPOOLSS_NOTIFY_MSG_GROUP *msg_groups; 98 98 } SPOOLSS_NOTIFY_MSG_CTR; … … 129 129 const char *get_short_archi(const char *long_archi); 130 130 131 bool print_access_check(const struct auth_serversupplied_info *server_info, 132 struct messaging_context *msg_ctx, int snum, 133 int access_type); 131 WERROR print_access_check(const struct auth_session_info *server_info, 132 struct messaging_context *msg_ctx, int snum, 133 int access_type); 134 135 WERROR nt_printer_guid_retrieve(TALLOC_CTX *mem_ctx, const char *printer, 136 struct GUID *pguid); 137 138 WERROR nt_printer_guid_store(struct messaging_context *msg_ctx, 139 const char *printer, struct GUID guid); 134 140 135 141 WERROR nt_printer_guid_get(TALLOC_CTX *mem_ctx, 136 const struct auth_se rversupplied_info *server_info,142 const struct auth_session_info *session_info, 137 143 struct messaging_context *msg_ctx, 138 144 const char *printer, struct GUID *guid); 139 145 140 146 WERROR nt_printer_publish(TALLOC_CTX *mem_ctx, 141 const struct auth_se rversupplied_info *server_info,147 const struct auth_session_info *server_info, 142 148 struct messaging_context *msg_ctx, 143 149 struct spoolss_PrinterInfo2 *pinfo2, … … 145 151 146 152 bool is_printer_published(TALLOC_CTX *mem_ctx, 147 const struct auth_se rversupplied_info *server_info,153 const struct auth_session_info *server_info, 148 154 struct messaging_context *msg_ctx, 149 155 const char *servername, … … 153 159 WERROR check_published_printers(struct messaging_context *msg_ctx); 154 160 161 struct dcerpc_binding_handle; 162 155 163 bool printer_driver_in_use(TALLOC_CTX *mem_ctx, 156 const struct auth_serversupplied_info *server_info, 157 struct messaging_context *msg_ctx, 164 struct dcerpc_binding_handle *b, 158 165 const struct spoolss_DriverInfo8 *r); 159 166 bool printer_driver_files_in_use(TALLOC_CTX *mem_ctx, 160 const struct auth_serversupplied_info *server_info, 161 struct messaging_context *msg_ctx, 167 struct dcerpc_binding_handle *b, 162 168 struct spoolss_DriverInfo8 *r); 163 bool delete_driver_files(const struct auth_se rversupplied_info *server_info,169 bool delete_driver_files(const struct auth_session_info *server_info, 164 170 const struct spoolss_DriverInfo8 *r); 165 171 166 WERROR move_driver_to_download_area(struct auth_se rversupplied_info *session_info,172 WERROR move_driver_to_download_area(struct auth_session_info *session_info, 167 173 struct spoolss_AddDriverInfoCtr *r); 168 174 169 175 WERROR clean_up_driver_struct(TALLOC_CTX *mem_ctx, 170 struct auth_se rversupplied_info *session_info,176 struct auth_session_info *session_info, 171 177 struct spoolss_AddDriverInfoCtr *r); 172 178 … … 175 181 void map_job_permissions(struct security_descriptor *sd); 176 182 177 bool print_time_access_check(const struct auth_se rversupplied_info *server_info,183 bool print_time_access_check(const struct auth_session_info *server_info, 178 184 struct messaging_context *msg_ctx, 179 185 const char *servicename); 180 186 181 187 void nt_printer_remove(TALLOC_CTX *mem_ctx, 182 const struct auth_se rversupplied_info *server_info,188 const struct auth_session_info *server_info, 183 189 struct messaging_context *msg_ctx, 184 190 const char *printer); 185 191 void nt_printer_add(TALLOC_CTX *mem_ctx, 186 const struct auth_se rversupplied_info *server_info,192 const struct auth_session_info *server_info, 187 193 struct messaging_context *msg_ctx, 188 194 const char *printer); -
vendor/current/source3/include/ntdomain.h
r919 r988 22 22 23 23 #ifndef _NT_DOMAIN_H /* _NT_DOMAIN_H */ 24 #define _NT_DOMAIN_H 25 26 #include "librpc/rpc/dcerpc.h" 24 #define _NT_DOMAIN_H 27 25 28 26 /* … … 31 29 */ 32 30 33 typedef struct _output_data {34 /*35 * Raw RPC output data. This does not include RPC headers or footers.36 */37 DATA_BLOB rdata;38 39 /* The amount of data sent from the current rdata struct. */40 uint32 data_sent_length;41 42 /*43 * The current fragment being returned. This inclues44 * headers, data and authentication footer.45 */46 DATA_BLOB frag;47 48 /* The amount of data sent from the current PDU. */49 uint32 current_pdu_sent;50 } output_data;51 52 typedef struct _input_data {53 /*54 * This is the current incoming pdu. The data here55 * is collected via multiple writes until a complete56 * pdu is seen, then the data is copied into the in_data57 * structure. The maximum size of this is 0x1630 (RPC_MAX_PDU_FRAG_LEN).58 * If length is zero, then we are at the start of a new59 * pdu.60 */61 DATA_BLOB pdu;62 63 /*64 * The amount of data needed to complete the in_pdu.65 * If this is zero, then we are at the start of a new66 * pdu.67 */68 uint32 pdu_needed_len;69 70 /*71 * This is the collection of input data with all72 * the rpc headers and auth footers removed.73 * The maximum length of this (1Mb) is strictly enforced.74 */75 DATA_BLOB data;76 77 } input_data;78 79 struct handle_list;80 81 typedef struct pipe_rpc_fns {82 83 struct pipe_rpc_fns *next, *prev;84 85 /* RPC function table associated with the current rpc_bind (associated by context) */86 87 const struct api_struct *cmds;88 int n_cmds;89 uint32 context_id;90 struct ndr_syntax_id syntax;91 92 /*93 * shall we allow "connect" auth level for this interface ?94 */95 bool allow_connect;96 } PIPE_RPC_FNS;97 98 /*99 * Different auth types we support.100 * Can't keep in sync with wire values as spnego wraps different auth methods.101 */102 103 31 struct gse_context; 104 32 105 struct dcesrv_ep_entry_list; 106 107 /* 108 * DCE/RPC-specific samba-internal-specific handling of data on 109 * NamedPipes. 110 */ 111 112 struct pipes_struct { 113 struct pipes_struct *next, *prev; 114 115 struct client_address *client_id; 116 struct client_address *server_id; 117 118 enum dcerpc_transport_t transport; 119 120 struct auth_serversupplied_info *session_info; 121 struct messaging_context *msg_ctx; 122 123 struct ndr_syntax_id syntax; 124 struct dcesrv_ep_entry_list *ep_entries; 125 126 /* linked list of rpc dispatch tables associated 127 with the open rpc contexts */ 128 129 PIPE_RPC_FNS *contexts; 130 131 struct pipe_auth_data auth; 132 133 bool ncalrpc_as_system; 134 135 /* 136 * Set to true when an RPC bind has been done on this pipe. 137 */ 138 139 bool pipe_bound; 140 141 /* 142 * States we can be in. 143 */ 144 bool allow_alter; 145 bool allow_bind; 146 bool allow_auth3; 147 148 /* 149 * Set the DCERPC_FAULT to return. 150 */ 151 152 int fault_state; 153 154 /* 155 * Set to RPC_BIG_ENDIAN when dealing with big-endian PDU's 156 */ 157 158 bool endian; 159 160 /* 161 * Struct to deal with multiple pdu inputs. 162 */ 163 164 input_data in_data; 165 166 /* 167 * Struct to deal with multiple pdu outputs. 168 */ 169 170 output_data out_data; 171 172 /* This context is used for PDU data and is freed between each pdu. 173 Don't use for pipe state storage. */ 174 TALLOC_CTX *mem_ctx; 175 176 /* handle database to use on this pipe. */ 177 struct handle_list *pipe_handles; 178 179 /* call id retrieved from the pdu header */ 180 uint32_t call_id; 181 182 /* operation number retrieved from the rpc header */ 183 uint16_t opnum; 184 185 /* private data for the interface implementation */ 186 void *private_data; 187 188 }; 189 190 struct api_struct { 191 const char *name; 192 uint8 opnum; 193 bool (*fn) (struct pipes_struct *); 194 }; 195 196 /* The following definitions come from rpc_server/rpc_handles.c */ 197 198 size_t num_pipe_handles(struct pipes_struct *p); 199 bool init_pipe_handles(struct pipes_struct *p, const struct ndr_syntax_id *syntax); 200 bool create_policy_hnd(struct pipes_struct *p, struct policy_handle *hnd, void *data_ptr); 201 bool find_policy_by_hnd(struct pipes_struct *p, const struct policy_handle *hnd, 202 void **data_p); 203 bool close_policy_hnd(struct pipes_struct *p, struct policy_handle *hnd); 204 void close_policy_by_pipe(struct pipes_struct *p); 205 bool pipe_access_check(struct pipes_struct *p); 206 207 void *_policy_handle_create(struct pipes_struct *p, struct policy_handle *hnd, 208 uint32_t access_granted, size_t data_size, 209 const char *type, NTSTATUS *pstatus); 210 #define policy_handle_create(_p, _hnd, _access, _type, _pstatus) \ 211 (_type *)_policy_handle_create((_p), (_hnd), (_access), sizeof(_type), #_type, \ 212 (_pstatus)) 213 214 void *_policy_handle_find(struct pipes_struct *p, 215 const struct policy_handle *hnd, 216 uint32_t access_required, uint32_t *paccess_granted, 217 const char *name, const char *location, 218 NTSTATUS *pstatus); 219 #define policy_handle_find(_p, _hnd, _access_required, _access_granted, _type, _pstatus) \ 220 (_type *)_policy_handle_find((_p), (_hnd), (_access_required), \ 221 (_access_granted), #_type, __location__, (_pstatus)) 33 #include "rpc_server/rpc_pipes.h" 222 34 223 35 #include "rpc_server/srv_pipe_register.h" -
vendor/current/source3/include/ntioctl.h
r860 r988 3 3 NT ioctl code constants 4 4 Copyright (C) Andrew Tridgell 2002 5 5 6 6 This program is free software; you can redistribute it and/or modify 7 7 it under the terms of the GNU General Public License as published by 8 8 the Free Software Foundation; either version 3 of the License, or 9 9 (at your option) any later version. 10 10 11 11 This program is distributed in the hope that it will be useful, 12 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 14 GNU General Public License for more details. 15 15 16 16 You should have received a copy of the GNU General Public License 17 17 along with this program. If not, see <http://www.gnu.org/licenses/>. 18 */19 20 /*21 I'm guessing we will need to support a bunch of these eventually. For now22 we only need the sparse flag23 18 */ 24 19 … … 26 21 #define _NTIOCTL_H 27 22 28 /* IOCTL information */ 29 /* List of ioctl function codes that look to be of interest to remote clients like this. */ 30 /* Need to do some experimentation to make sure they all work remotely. */ 31 /* Some of the following such as the encryption/compression ones would be */ 32 /* invoked from tools via a specialized hook into the VFS rather than via the */ 33 /* standard vfs entry points */ 34 #define FSCTL_LOCK_VOLUME 0x00090018 35 #define FSCTL_UNLOCK_VOLUME 0x0009001C 36 #define FSCTL_GET_COMPRESSION 0x0009003C 37 #define FSCTL_SET_COMPRESSION 0x0009C040 38 #define FSCTL_REQUEST_FILTER_OPLOCK 0x0009008C 39 #define FSCTL_SET_ZERO_DATA 0x000900C8 40 #define FSCTL_SET_ENCRYPTION 0x000900D7 41 #define FSCTL_ENCRYPTION_FSCTL_IO 0x000900DB 42 #define FSCTL_WRITE_RAW_ENCRYPTED 0x000900DF 43 #define FSCTL_READ_RAW_ENCRYPTED 0x000900E3 44 #define FSCTL_SIS_COPYFILE 0x00090100 45 #define FSCTL_SIS_LINK_FILES 0x0009C104 46 47 /* filesystem control codes */ 48 #define FSCTL_METHOD_BUFFERED 0x00000000 49 #define FSCTL_METHOD_IN_DIRECT 0x00000001 50 #define FSCTL_METHOD_OUT_DIRECT 0x00000002 51 #define FSCTL_METHOD_NEITHER 0x00000003 52 53 #define FSCTL_ACCESS_ANY 0x00000000 54 #define FSCTL_ACCESS_READ 0x00004000 55 #define FSCTL_ACCESS_WRITE 0x00008000 56 57 #define FSCTL_DFS 0x00060000 58 #define FSCTL_DFS_GET_REFERRALS (FSCTL_DFS | FSCTL_ACCESS_ANY | 0x0194 | FSCTL_METHOD_BUFFERED) 59 #define FSCTL_DFS_GET_REFERRALS_EX (FSCTL_DFS | FSCTL_ACCESS_ANY | 0x01B0 | FSCTL_METHOD_BUFFERED) 60 61 #define FSCTL_FILESYSTEM 0x00090000 62 #define FSCTL_REQUEST_OPLOCK_LEVEL_1 (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x0000 | FSCTL_METHOD_BUFFERED) 63 #define FSCTL_REQUEST_OPLOCK_LEVEL_2 (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x0004 | FSCTL_METHOD_BUFFERED) 64 #define FSCTL_REQUEST_BATCH_OPLOCK (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x0008 | FSCTL_METHOD_BUFFERED) 65 #define FSCTL_OPLOCK_BREAK_ACKNOWLEDGE (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x000C | FSCTL_METHOD_BUFFERED) 66 #define FSCTL_OPBATCH_ACK_CLOSE_PENDING (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x0010 | FSCTL_METHOD_BUFFERED) 67 #define FSCTL_OPLOCK_BREAK_NOTIFY (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x0014 | FSCTL_METHOD_BUFFERED) 68 #define FSCTL_FILESYS_GET_STATISTICS (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x0060 | FSCTL_METHOD_BUFFERED) 69 #define FSCTL_GET_NTFS_VOLUME_DATA (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x0064 | FSCTL_METHOD_BUFFERED) 70 #define FSCTL_IS_VOLUME_DIRTY (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x0078 | FSCTL_METHOD_BUFFERED) 71 #define FSCTL_FIND_FILES_BY_SID (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x008C | FSCTL_METHOD_NEITHER) 72 #define FSCTL_SET_OBJECT_ID (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x0098 | FSCTL_METHOD_BUFFERED) 73 #define FSCTL_GET_OBJECT_ID (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x009C | FSCTL_METHOD_BUFFERED) 74 #define FSCTL_DELETE_OBJECT_ID (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x00A0 | FSCTL_METHOD_BUFFERED) 75 #define FSCTL_SET_REPARSE_POINT (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x00A4 | FSCTL_METHOD_BUFFERED) 76 #define FSCTL_GET_REPARSE_POINT (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x00A8 | FSCTL_METHOD_BUFFERED) 77 #define FSCTL_DELETE_REPARSE_POINT (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x00AC | FSCTL_METHOD_BUFFERED) 78 #define FSCTL_CREATE_OR_GET_OBJECT_ID (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x00C0 | FSCTL_METHOD_BUFFERED) 79 #define FSCTL_SET_SPARSE (FSCTL_FILESYSTEM | FSCTL_ACCESS_ANY | 0x00C4 | FSCTL_METHOD_BUFFERED) 80 #define FSCTL_QUERY_ALLOCATED_RANGES (FSCTL_FILESYSTEM | FSCTL_ACCESS_READ | 0x00CC | FSCTL_METHOD_NEITHER) 81 #define FSCTL_FILE_LEVEL_TRIM (FSCTL_FILESYSTEM | FSCTL_ACCESS_WRITE | 0x0208 | FSCTL_METHOD_BUFFERED) 82 #define FSCTL_OFFLOAD_READ (FSCTL_FILESYSTEM | FSCTL_ACCESS_READ | 0x0264 | FSCTL_METHOD_BUFFERED) 83 #define FSCTL_OFFLOAD_WRITE (FSCTL_FILESYSTEM | FSCTL_ACCESS_WRITE | 0x0268 | FSCTL_METHOD_BUFFERED) 84 85 #define FSCTL_NAMED_PIPE 0x00110000 86 #define FSCTL_PIPE_PEEK (FSCTL_NAMED_PIPE | FSCTL_ACCESS_READ | 0x000C | FSCTL_METHOD_BUFFERED) 87 #define FSCTL_NAMED_PIPE_READ_WRITE (FSCTL_NAMED_PIPE | FSCTL_ACCESS_READ \ 88 | FSCTL_ACCESS_WRITE | 0x0014 | FSCTL_METHOD_NEITHER) 89 #define FSCTL_PIPE_TRANSCEIVE FSCTL_NAMED_PIPE_READ_WRITE /* SMB2 function name */ 90 #define FSCTL_PIPE_WAIT (FSCTL_NAMED_PIPE | FSCTL_ACCESS_ANY | 0x0018 | FSCTL_METHOD_BUFFERED) 91 92 #define FSCTL_NETWORK_FILESYSTEM 0x00140000 93 #define FSCTL_GET_SHADOW_COPY_DATA (FSCTL_NETWORK_FILESYSTEM | FSCTL_ACCESS_READ | 0x0064 | FSCTL_METHOD_BUFFERED) 94 #define FSCTL_SRV_ENUM_SNAPS FSCTL_GET_SHADOW_COPY_DATA /* SMB2 function name */ 95 #define FSCTL_SRV_REQUEST_RESUME_KEY (FSCTL_NETWORK_FILESYSTEM | FSCTL_ACCESS_ANY | 0x0078 | FSCTL_METHOD_BUFFERED) 96 #define FSCTL_SRV_COPYCHUNK (FSCTL_NETWORK_FILESYSTEM | FSCTL_ACCESS_READ | 0x00F0 | FSCTL_METHOD_OUT_DIRECT) 97 #define FSCTL_SRV_COPYCHUNK_WRITE (FSCTL_NETWORK_FILESYSTEM | FSCTL_ACCESS_WRITE | 0x00F0 | FSCTL_METHOD_OUT_DIRECT) 98 #define FSCTL_SRV_READ_HASH (FSCTL_NETWORK_FILESYSTEM | FSCTL_ACCESS_READ| 0x01B8 | FSCTL_METHOD_NEITHER) 99 #define FSCTL_LMR_REQ_RESILIENCY (FSCTL_NETWORK_FILESYSTEM | FSCTL_ACCESS_ANY | 0x01D4 | FSCTL_METHOD_BUFFERED) 100 #define FSCTL_LMR_SET_LINK_TRACKING_INFORMATION \ 101 (FSCTL_NETWORK_FILESYSTEM | FSCTL_ACCESS_ANY | 0x00EC | FSCTL_METHOD_BUFFERED) 102 #define FSCTL_QUERY_NETWORK_INTERFACE_INFO \ 103 (FSCTL_NETWORK_FILESYSTEM | FSCTL_ACCESS_ANY | 0x01FC | FSCTL_METHOD_BUFFERED) 104 105 /* 106 * FSCTL_VALIDATE_NEGOTIATE_INFO_224 was used used in 107 * Windows 8 server beta with SMB 2.24 108 */ 109 #define FSCTL_VALIDATE_NEGOTIATE_INFO_224 \ 110 (FSCTL_NETWORK_FILESYSTEM | FSCTL_ACCESS_ANY | 0x0200 | FSCTL_METHOD_BUFFERED) 111 #define FSCTL_VALIDATE_NEGOTIATE_INFO (FSCTL_NETWORK_FILESYSTEM | FSCTL_ACCESS_ANY | 0x0204 | FSCTL_METHOD_BUFFERED) 112 113 #if 0 114 #define FSCTL_SECURITY_ID_CHECK 115 #define FSCTL_DISMOUNT_VOLUME 116 #define FSCTL_GET_NTFS_FILE_RECORD 117 #define FSCTL_ALLOW_EXTENDED_DASD_IO 118 #define FSCTL_RECALL_FILE 119 120 #endif 23 #define IO_REPARSE_TAG_SYMLINK 0xA000000C 24 #define SYMLINK_FLAG_RELATIVE 0x00000001 121 25 122 26 #define IO_REPARSE_TAG_MOUNT_POINT 0xA0000003 … … 131 35 struct shadow_copy_data { 132 36 /* Total number of shadow volumes currently mounted */ 133 uint32 num_volumes;37 uint32_t num_volumes; 134 38 /* Concatenated list of labels */ 135 39 SHADOW_COPY_LABEL *labels; -
vendor/current/source3/include/ntquotas.h
r740 r988 64 64 SMB_USER_QUOTA_TYPE = 2, 65 65 SMB_GROUP_FS_QUOTA_TYPE = 3,/* not used yet */ 66 SMB_GROUP_QUOTA_TYPE = 4 /* not in use yet, maybe fordisk_free queries */66 SMB_GROUP_QUOTA_TYPE = 4 /* used by disk_free queries */ 67 67 }; 68 68 … … 72 72 uint64_t softlim; 73 73 uint64_t hardlim; 74 uint32 qflags;74 uint32_t qflags; 75 75 struct dom_sid sid; 76 76 } SMB_NTQUOTA_STRUCT; -
vendor/current/source3/include/passdb.h
r740 r988 24 24 #define _PASSDB_H 25 25 26 #ifndef NT_HASH_LEN 27 #define NT_HASH_LEN 16 28 #endif 29 30 #ifndef LM_HASH_LEN 31 #define LM_HASH_LEN 16 32 #endif 33 26 34 #include "../librpc/gen_ndr/lsa.h" 27 28 #include "mapping.h" 35 #include <tevent.h> 36 struct unixid; 37 struct cli_credentials; 38 39 /* group mapping headers */ 40 41 #define ENUM_ONLY_MAPPED True 42 #define ENUM_ALL_MAPPED False 43 44 typedef struct _GROUP_MAP { 45 struct pdb_methods *methods; 46 gid_t gid; 47 struct dom_sid sid; 48 enum lsa_SidType sid_name_use; 49 char *nt_name; 50 char *comment; 51 } GROUP_MAP; 52 53 struct acct_info { 54 char *acct_name; /* account name */ 55 char *acct_desc; /* account name */ 56 uint32_t rid; /* domain-relative RID */ 57 }; 58 59 /* The following definitions come from groupdb/mapping.c */ 60 61 NTSTATUS add_initial_entry(gid_t gid, const char *sid, enum lsa_SidType sid_name_use, const char *nt_name, const char *comment); 62 bool get_domain_group_from_sid(struct dom_sid sid, GROUP_MAP *map); 63 int smb_create_group(const char *unix_group, gid_t *new_gid); 64 int smb_delete_group(const char *unix_group); 65 int smb_set_primary_group(const char *unix_group, const char* unix_user); 66 int smb_add_user_group(const char *unix_group, const char *unix_user); 67 int smb_delete_user_group(const char *unix_group, const char *unix_user); 68 NTSTATUS pdb_default_getgrsid(struct pdb_methods *methods, GROUP_MAP *map, 69 struct dom_sid sid); 70 NTSTATUS pdb_default_getgrgid(struct pdb_methods *methods, GROUP_MAP *map, 71 gid_t gid); 72 NTSTATUS pdb_default_getgrnam(struct pdb_methods *methods, GROUP_MAP *map, 73 const char *name); 74 NTSTATUS pdb_default_add_group_mapping_entry(struct pdb_methods *methods, 75 GROUP_MAP *map); 76 NTSTATUS pdb_default_update_group_mapping_entry(struct pdb_methods *methods, 77 GROUP_MAP *map); 78 NTSTATUS pdb_default_delete_group_mapping_entry(struct pdb_methods *methods, 79 struct dom_sid sid); 80 NTSTATUS pdb_default_enum_group_mapping(struct pdb_methods *methods, 81 const struct dom_sid *sid, 82 enum lsa_SidType sid_name_use, 83 GROUP_MAP ***pp_rmap, 84 size_t *p_num_entries, 85 bool unix_only); 86 NTSTATUS pdb_default_create_alias(struct pdb_methods *methods, 87 const char *name, uint32_t *rid); 88 NTSTATUS pdb_default_delete_alias(struct pdb_methods *methods, 89 const struct dom_sid *sid); 90 NTSTATUS pdb_default_get_aliasinfo(struct pdb_methods *methods, 91 const struct dom_sid *sid, 92 struct acct_info *info); 93 NTSTATUS pdb_default_set_aliasinfo(struct pdb_methods *methods, 94 const struct dom_sid *sid, 95 struct acct_info *info); 96 NTSTATUS pdb_default_add_aliasmem(struct pdb_methods *methods, 97 const struct dom_sid *alias, const struct dom_sid *member); 98 NTSTATUS pdb_default_del_aliasmem(struct pdb_methods *methods, 99 const struct dom_sid *alias, const struct dom_sid *member); 100 NTSTATUS pdb_default_enum_aliasmem(struct pdb_methods *methods, 101 const struct dom_sid *alias, TALLOC_CTX *mem_ctx, 102 struct dom_sid **pp_members, 103 size_t *p_num_members); 104 NTSTATUS pdb_default_alias_memberships(struct pdb_methods *methods, 105 TALLOC_CTX *mem_ctx, 106 const struct dom_sid *domain_sid, 107 const struct dom_sid *members, 108 size_t num_members, 109 uint32_t **pp_alias_rids, 110 size_t *p_num_alias_rids); 111 NTSTATUS pdb_nop_getgrsid(struct pdb_methods *methods, GROUP_MAP *map, 112 struct dom_sid sid); 113 NTSTATUS pdb_nop_getgrgid(struct pdb_methods *methods, GROUP_MAP *map, 114 gid_t gid); 115 NTSTATUS pdb_nop_getgrnam(struct pdb_methods *methods, GROUP_MAP *map, 116 const char *name); 117 NTSTATUS pdb_nop_add_group_mapping_entry(struct pdb_methods *methods, 118 GROUP_MAP *map); 119 NTSTATUS pdb_nop_update_group_mapping_entry(struct pdb_methods *methods, 120 GROUP_MAP *map); 121 NTSTATUS pdb_nop_delete_group_mapping_entry(struct pdb_methods *methods, 122 struct dom_sid sid); 123 NTSTATUS pdb_nop_enum_group_mapping(struct pdb_methods *methods, 124 enum lsa_SidType sid_name_use, 125 GROUP_MAP **rmap, size_t *num_entries, 126 bool unix_only); 127 NTSTATUS pdb_create_builtin_alias(uint32_t rid, gid_t gid); 128 129 130 /* passdb headers */ 29 131 30 132 /********************************************************************** … … 84 186 PDB_BAD_PASSWORD_TIME, 85 187 PDB_CANCHANGETIME, 86 PDB_MUSTCHANGETIME,87 188 PDB_PLAINTEXT_PW, 88 189 PDB_USERNAME, … … 168 269 time_t pass_last_set_time; /* password last set time */ 169 270 time_t pass_can_change_time; /* password can change time */ 170 time_t pass_must_change_time; /* password must change time */171 271 172 272 const char *username; /* UNIX username string */ … … 218 318 }; 219 319 220 struct acct_info {221 fstring acct_name; /* account name */222 fstring acct_desc; /* account name */223 uint32_t rid; /* domain-relative RID */224 };225 226 320 struct samr_displayentry { 227 321 uint32_t idx; … … 268 362 uint32_t trust_type; 269 363 uint32_t trust_attributes; 364 uint32_t *trust_posix_offset; 365 uint32_t *supported_enc_type; 270 366 DATA_BLOB trust_forest_trust_info; 271 367 }; … … 317 413 * Changed to 18, pdb_rid_algorithm -> pdb_capabilities 318 414 * Changed to 19, removed uid_to_rid 415 * Changed to 20, pdb_secret calls 416 * Changed to 21, set/enum_upn_suffixes. AB. 417 * Changed to 22, idmap control functions 418 * Changed to 23, new idmap control functions 419 * Changed to 24, removed uid_to_sid and gid_to_sid, replaced with id_to_sid 420 * Leave at 24, add optional get_trusteddom_creds() 319 421 */ 320 422 321 #define PASSDB_INTERFACE_VERSION 19423 #define PASSDB_INTERFACE_VERSION 24 322 424 323 425 struct pdb_methods … … 373 475 NTSTATUS (*enum_group_mapping)(struct pdb_methods *methods, 374 476 const struct dom_sid *sid, enum lsa_SidType sid_name_use, 375 GROUP_MAP ** pp_rmap, size_t *p_num_entries,477 GROUP_MAP ***pp_rmap, size_t *p_num_entries, 376 478 bool unix_only); 377 479 … … 462 564 const struct dom_sid *sid); 463 565 464 bool (*uid_to_sid)(struct pdb_methods *methods, uid_t uid, 465 struct dom_sid *sid); 466 bool (*gid_to_sid)(struct pdb_methods *methods, gid_t gid, 467 struct dom_sid *sid); 566 /* 567 * Instead of passing down a gid or uid, this function sends down a pointer 568 * to a unixid. 569 * 570 * This acts as an in-out variable so that the idmap functions can correctly 571 * receive ID_TYPE_BOTH, filling in cache details correctly rather than forcing 572 * the cache to store ID_TYPE_UID or ID_TYPE_GID. 573 */ 574 bool (*id_to_sid)(struct pdb_methods *methods, struct unixid *id, 575 struct dom_sid *sid); 468 576 bool (*sid_to_id)(struct pdb_methods *methods, const struct dom_sid *sid, 469 union unid_t *id, enum lsa_SidType *type);577 struct unixid *id); 470 578 471 579 uint32_t (*capabilities)(struct pdb_methods *methods); … … 476 584 const char *domain, char** pwd, 477 585 struct dom_sid *sid, time_t *pass_last_set_time); 586 NTSTATUS (*get_trusteddom_creds)(struct pdb_methods *methods, 587 const char *domain, 588 TALLOC_CTX *mem_ctx, 589 struct cli_credentials **creds); 478 590 bool (*set_trusteddom_pw)(struct pdb_methods *methods, 479 591 const char* domain, const char* pwd, … … 484 596 TALLOC_CTX *mem_ctx, uint32_t *num_domains, 485 597 struct trustdom_info ***domains); 486 487 598 488 599 NTSTATUS (*get_trusted_domain)(struct pdb_methods *methods, … … 504 615 struct pdb_trusted_domain ***domains); 505 616 617 NTSTATUS (*get_secret)(struct pdb_methods *methods, 618 TALLOC_CTX *mem_ctx, 619 const char *secret_name, 620 DATA_BLOB *secret_current, 621 NTTIME *secret_current_lastchange, 622 DATA_BLOB *secret_old, 623 NTTIME *secret_old_lastchange, 624 struct security_descriptor **sd); 625 NTSTATUS (*set_secret)(struct pdb_methods *methods, 626 const char *secret_name, 627 DATA_BLOB *secret_current, 628 DATA_BLOB *secret_old, 629 struct security_descriptor *sd); 630 NTSTATUS (*delete_secret)(struct pdb_methods *methods, 631 const char *secret_name); 632 633 NTSTATUS (*enum_upn_suffixes)(struct pdb_methods *methods, 634 TALLOC_CTX *mem_ctx, 635 uint32_t *num_suffixes, 636 char ***suffixes); 637 638 NTSTATUS (*set_upn_suffixes)(struct pdb_methods *methods, 639 uint32_t num_suffixes, 640 const char **suffixes); 641 642 bool (*is_responsible_for_our_sam)(struct pdb_methods *methods); 643 bool (*is_responsible_for_builtin)(struct pdb_methods *methods); 644 bool (*is_responsible_for_wellknown)(struct pdb_methods *methods); 645 bool (*is_responsible_for_unix_users)(struct pdb_methods *methods); 646 bool (*is_responsible_for_unix_groups)(struct pdb_methods *methods); 647 bool (*is_responsible_for_everything_else)(struct pdb_methods *methods); 648 506 649 void *private_data; /* Private data of some kind */ 507 650 … … 520 663 }; 521 664 522 #include "passdb/proto.h" 665 /* The following definitions come from passdb/account_pol.c */ 666 667 void account_policy_names_list(TALLOC_CTX *mem_ctx, const char ***names, int *num_names); 668 const char *decode_account_policy_name(enum pdb_policy_type type); 669 const char *get_account_policy_attr(enum pdb_policy_type type); 670 const char *account_policy_get_desc(enum pdb_policy_type type); 671 enum pdb_policy_type account_policy_name_to_typenum(const char *name); 672 bool account_policy_get_default(enum pdb_policy_type type, uint32_t *val); 673 bool init_account_policy(void); 674 bool account_policy_get(enum pdb_policy_type type, uint32_t *value); 675 bool account_policy_set(enum pdb_policy_type type, uint32_t value); 676 bool cache_account_policy_set(enum pdb_policy_type type, uint32_t value); 677 bool cache_account_policy_get(enum pdb_policy_type type, uint32_t *value); 678 struct db_context *get_account_pol_db( void ); 679 680 /* The following definitions come from passdb/login_cache.c */ 681 682 bool login_cache_init(void); 683 bool login_cache_shutdown(void); 684 bool login_cache_read(struct samu *sampass, struct login_cache *entry); 685 bool login_cache_write(const struct samu *sampass, 686 const struct login_cache *entry); 687 bool login_cache_delentry(const struct samu *sampass); 688 689 /* The following definitions come from passdb/passdb.c */ 690 691 struct samu *samu_new( TALLOC_CTX *ctx ); 692 NTSTATUS samu_set_unix(struct samu *user, const struct passwd *pwd); 693 NTSTATUS samu_alloc_rid_unix(struct pdb_methods *methods, 694 struct samu *user, const struct passwd *pwd); 695 char *pdb_encode_acct_ctrl(uint32_t acct_ctrl, size_t length); 696 uint32_t pdb_decode_acct_ctrl(const char *p); 697 void pdb_sethexpwd(char p[33], const unsigned char *pwd, uint32_t acct_ctrl); 698 bool pdb_gethexpwd(const char *p, unsigned char *pwd); 699 void pdb_sethexhours(char *p, const unsigned char *hours); 700 bool pdb_gethexhours(const char *p, unsigned char *hours); 701 int algorithmic_rid_base(void); 702 uid_t algorithmic_pdb_user_rid_to_uid(uint32_t user_rid); 703 uid_t max_algorithmic_uid(void); 704 uint32_t algorithmic_pdb_uid_to_user_rid(uid_t uid); 705 gid_t pdb_group_rid_to_gid(uint32_t group_rid); 706 gid_t max_algorithmic_gid(void); 707 uint32_t algorithmic_pdb_gid_to_group_rid(gid_t gid); 708 bool algorithmic_pdb_rid_is_user(uint32_t rid); 709 bool lookup_global_sam_name(const char *name, int flags, uint32_t *rid, 710 enum lsa_SidType *type); 711 NTSTATUS local_password_change(const char *user_name, 712 int local_flags, 713 const char *new_passwd, 714 char **pp_err_str, 715 char **pp_msg_str); 716 bool init_samu_from_buffer(struct samu *sampass, uint32_t level, 717 uint8_t *buf, uint32_t buflen); 718 uint32_t init_buffer_from_samu (uint8_t **buf, struct samu *sampass, bool size_only); 719 bool pdb_copy_sam_account(struct samu *dst, struct samu *src ); 720 bool pdb_update_bad_password_count(struct samu *sampass, bool *updated); 721 bool pdb_update_autolock_flag(struct samu *sampass, bool *updated); 722 bool pdb_increment_bad_password_count(struct samu *sampass); 723 bool is_dc_trusted_domain_situation(const char *domain_name); 724 bool get_trust_pw_clear(const char *domain, char **ret_pwd, 725 const char **account_name, 726 enum netr_SchannelType *channel); 727 bool get_trust_pw_hash(const char *domain, uint8_t ret_pwd[16], 728 const char **account_name, 729 enum netr_SchannelType *channel); 730 struct cli_credentials; 731 NTSTATUS pdb_get_trust_credentials(const char *netbios_domain, 732 const char *dns_domain, /* optional */ 733 TALLOC_CTX *mem_ctx, 734 struct cli_credentials **_creds); 735 736 /* The following definitions come from passdb/pdb_compat.c */ 737 738 uint32_t pdb_get_user_rid (const struct samu *sampass); 739 uint32_t pdb_get_group_rid (struct samu *sampass); 740 bool pdb_set_user_sid_from_rid (struct samu *sampass, uint32_t rid, enum pdb_value_state flag); 741 bool pdb_set_group_sid_from_rid (struct samu *sampass, uint32_t grid, enum pdb_value_state flag); 742 743 /* The following definitions come from passdb/pdb_get_set.c */ 744 745 bool pdb_is_password_change_time_max(time_t test_time); 746 uint32_t pdb_get_acct_ctrl(const struct samu *sampass); 747 time_t pdb_get_logon_time(const struct samu *sampass); 748 time_t pdb_get_logoff_time(const struct samu *sampass); 749 time_t pdb_get_kickoff_time(const struct samu *sampass); 750 time_t pdb_get_bad_password_time(const struct samu *sampass); 751 time_t pdb_get_pass_last_set_time(const struct samu *sampass); 752 time_t pdb_get_pass_can_change_time(const struct samu *sampass); 753 time_t pdb_get_pass_can_change_time_noncalc(const struct samu *sampass); 754 time_t pdb_get_pass_must_change_time(const struct samu *sampass); 755 bool pdb_get_pass_can_change(const struct samu *sampass); 756 uint16_t pdb_get_logon_divs(const struct samu *sampass); 757 uint32_t pdb_get_hours_len(const struct samu *sampass); 758 const uint8_t *pdb_get_hours(const struct samu *sampass); 759 const uint8_t *pdb_get_nt_passwd(const struct samu *sampass); 760 const uint8_t *pdb_get_lanman_passwd(const struct samu *sampass); 761 const uint8_t *pdb_get_pw_history(const struct samu *sampass, uint32_t *current_hist_len); 762 const char *pdb_get_plaintext_passwd(const struct samu *sampass); 763 const struct dom_sid *pdb_get_user_sid(const struct samu *sampass); 764 const struct dom_sid *pdb_get_group_sid(struct samu *sampass); 765 enum pdb_value_state pdb_get_init_flags(const struct samu *sampass, enum pdb_elements element); 766 const char *pdb_get_username(const struct samu *sampass); 767 const char *pdb_get_domain(const struct samu *sampass); 768 const char *pdb_get_nt_username(const struct samu *sampass); 769 const char *pdb_get_fullname(const struct samu *sampass); 770 const char *pdb_get_homedir(const struct samu *sampass); 771 const char *pdb_get_dir_drive(const struct samu *sampass); 772 const char *pdb_get_logon_script(const struct samu *sampass); 773 const char *pdb_get_profile_path(const struct samu *sampass); 774 const char *pdb_get_acct_desc(const struct samu *sampass); 775 const char *pdb_get_workstations(const struct samu *sampass); 776 const char *pdb_get_comment(const struct samu *sampass); 777 const char *pdb_get_munged_dial(const struct samu *sampass); 778 uint16_t pdb_get_bad_password_count(const struct samu *sampass); 779 uint16_t pdb_get_logon_count(const struct samu *sampass); 780 uint16_t pdb_get_country_code(const struct samu *sampass); 781 uint16_t pdb_get_code_page(const struct samu *sampass); 782 uint32_t pdb_get_unknown_6(const struct samu *sampass); 783 void *pdb_get_backend_private_data(const struct samu *sampass, const struct pdb_methods *my_methods); 784 bool pdb_set_acct_ctrl(struct samu *sampass, uint32_t acct_ctrl, enum pdb_value_state flag); 785 bool pdb_set_logon_time(struct samu *sampass, time_t mytime, enum pdb_value_state flag); 786 bool pdb_set_logoff_time(struct samu *sampass, time_t mytime, enum pdb_value_state flag); 787 bool pdb_set_kickoff_time(struct samu *sampass, time_t mytime, enum pdb_value_state flag); 788 bool pdb_set_bad_password_time(struct samu *sampass, time_t mytime, enum pdb_value_state flag); 789 bool pdb_set_pass_can_change_time(struct samu *sampass, time_t mytime, enum pdb_value_state flag); 790 bool pdb_set_pass_last_set_time(struct samu *sampass, time_t mytime, enum pdb_value_state flag); 791 bool pdb_set_hours_len(struct samu *sampass, uint32_t len, enum pdb_value_state flag); 792 bool pdb_set_logon_divs(struct samu *sampass, uint16_t hours, enum pdb_value_state flag); 793 bool pdb_set_init_flags(struct samu *sampass, enum pdb_elements element, enum pdb_value_state value_flag); 794 bool pdb_set_user_sid(struct samu *sampass, const struct dom_sid *u_sid, enum pdb_value_state flag); 795 bool pdb_set_user_sid_from_string(struct samu *sampass, const char *u_sid, enum pdb_value_state flag); 796 bool pdb_set_group_sid(struct samu *sampass, const struct dom_sid *g_sid, enum pdb_value_state flag); 797 bool pdb_set_username(struct samu *sampass, const char *username, enum pdb_value_state flag); 798 bool pdb_set_domain(struct samu *sampass, const char *domain, enum pdb_value_state flag); 799 bool pdb_set_nt_username(struct samu *sampass, const char *nt_username, enum pdb_value_state flag); 800 bool pdb_set_fullname(struct samu *sampass, const char *full_name, enum pdb_value_state flag); 801 bool pdb_set_logon_script(struct samu *sampass, const char *logon_script, enum pdb_value_state flag); 802 bool pdb_set_profile_path(struct samu *sampass, const char *profile_path, enum pdb_value_state flag); 803 bool pdb_set_dir_drive(struct samu *sampass, const char *dir_drive, enum pdb_value_state flag); 804 bool pdb_set_homedir(struct samu *sampass, const char *home_dir, enum pdb_value_state flag); 805 bool pdb_set_acct_desc(struct samu *sampass, const char *acct_desc, enum pdb_value_state flag); 806 bool pdb_set_workstations(struct samu *sampass, const char *workstations, enum pdb_value_state flag); 807 bool pdb_set_comment(struct samu *sampass, const char *comment, enum pdb_value_state flag); 808 bool pdb_set_munged_dial(struct samu *sampass, const char *munged_dial, enum pdb_value_state flag); 809 bool pdb_set_nt_passwd(struct samu *sampass, const uint8_t pwd[NT_HASH_LEN], enum pdb_value_state flag); 810 bool pdb_set_lanman_passwd(struct samu *sampass, const uint8_t pwd[LM_HASH_LEN], enum pdb_value_state flag); 811 bool pdb_set_pw_history(struct samu *sampass, const uint8_t *pwd, uint32_t historyLen, enum pdb_value_state flag); 812 bool pdb_set_plaintext_pw_only(struct samu *sampass, const char *password, enum pdb_value_state flag); 813 bool pdb_update_history(struct samu *sampass, const uint8_t new_nt[NT_HASH_LEN]); 814 bool pdb_set_bad_password_count(struct samu *sampass, uint16_t bad_password_count, enum pdb_value_state flag); 815 bool pdb_set_logon_count(struct samu *sampass, uint16_t logon_count, enum pdb_value_state flag); 816 bool pdb_set_country_code(struct samu *sampass, uint16_t country_code, 817 enum pdb_value_state flag); 818 bool pdb_set_code_page(struct samu *sampass, uint16_t code_page, 819 enum pdb_value_state flag); 820 bool pdb_set_unknown_6(struct samu *sampass, uint32_t unkn, enum pdb_value_state flag); 821 bool pdb_set_hours(struct samu *sampass, const uint8_t *hours, int hours_len, 822 enum pdb_value_state flag); 823 bool pdb_set_backend_private_data(struct samu *sampass, void *private_data, 824 void (*free_fn)(void **), 825 const struct pdb_methods *my_methods, 826 enum pdb_value_state flag); 827 bool pdb_set_pass_can_change(struct samu *sampass, bool canchange); 828 bool pdb_set_plaintext_passwd(struct samu *sampass, const char *plaintext); 829 uint32_t pdb_build_fields_present(struct samu *sampass); 830 bool pdb_element_is_changed(const struct samu *sampass, 831 enum pdb_elements element); 832 bool pdb_element_is_set_or_changed(const struct samu *sampass, 833 enum pdb_elements element); 834 835 /* The following definitions come from passdb/pdb_interface.c */ 836 837 NTSTATUS smb_register_passdb(int version, const char *name, pdb_init_function init) ; 838 struct pdb_init_function_entry *pdb_find_backend_entry(const char *name); 839 const struct pdb_init_function_entry *pdb_get_backends(void); 840 struct tevent_context *pdb_get_tevent_context(void); 841 NTSTATUS make_pdb_method_name(struct pdb_methods **methods, const char *selected); 842 struct pdb_domain_info *pdb_get_domain_info(TALLOC_CTX *mem_ctx); 843 bool pdb_getsampwnam(struct samu *sam_acct, const char *username) ; 844 bool pdb_getsampwsid(struct samu *sam_acct, const struct dom_sid *sid) ; 845 NTSTATUS pdb_create_user(TALLOC_CTX *mem_ctx, const char *name, uint32_t flags, 846 uint32_t *rid); 847 NTSTATUS pdb_delete_user(TALLOC_CTX *mem_ctx, struct samu *sam_acct); 848 NTSTATUS pdb_add_sam_account(struct samu *sam_acct) ; 849 NTSTATUS pdb_update_sam_account(struct samu *sam_acct) ; 850 NTSTATUS pdb_delete_sam_account(struct samu *sam_acct) ; 851 NTSTATUS pdb_rename_sam_account(struct samu *oldname, const char *newname); 852 NTSTATUS pdb_update_login_attempts(struct samu *sam_acct, bool success); 853 bool pdb_getgrsid(GROUP_MAP *map, struct dom_sid sid); 854 bool pdb_getgrgid(GROUP_MAP *map, gid_t gid); 855 bool pdb_getgrnam(GROUP_MAP *map, const char *name); 856 NTSTATUS pdb_create_dom_group(TALLOC_CTX *mem_ctx, const char *name, 857 uint32_t *rid); 858 NTSTATUS pdb_delete_dom_group(TALLOC_CTX *mem_ctx, uint32_t rid); 859 NTSTATUS pdb_add_group_mapping_entry(GROUP_MAP *map); 860 NTSTATUS pdb_update_group_mapping_entry(GROUP_MAP *map); 861 NTSTATUS pdb_delete_group_mapping_entry(struct dom_sid sid); 862 bool pdb_enum_group_mapping(const struct dom_sid *sid, 863 enum lsa_SidType sid_name_use, 864 GROUP_MAP ***pp_rmap, 865 size_t *p_num_entries, 866 bool unix_only); 867 NTSTATUS pdb_enum_group_members(TALLOC_CTX *mem_ctx, 868 const struct dom_sid *sid, 869 uint32_t **pp_member_rids, 870 size_t *p_num_members); 871 NTSTATUS pdb_enum_group_memberships(TALLOC_CTX *mem_ctx, struct samu *user, 872 struct dom_sid **pp_sids, gid_t **pp_gids, 873 uint32_t *p_num_groups); 874 NTSTATUS pdb_set_unix_primary_group(TALLOC_CTX *mem_ctx, struct samu *user); 875 NTSTATUS pdb_add_groupmem(TALLOC_CTX *mem_ctx, uint32_t group_rid, 876 uint32_t member_rid); 877 NTSTATUS pdb_del_groupmem(TALLOC_CTX *mem_ctx, uint32_t group_rid, 878 uint32_t member_rid); 879 NTSTATUS pdb_create_alias(const char *name, uint32_t *rid); 880 NTSTATUS pdb_delete_alias(const struct dom_sid *sid); 881 NTSTATUS pdb_get_aliasinfo(const struct dom_sid *sid, struct acct_info *info); 882 NTSTATUS pdb_set_aliasinfo(const struct dom_sid *sid, struct acct_info *info); 883 NTSTATUS pdb_add_aliasmem(const struct dom_sid *alias, const struct dom_sid *member); 884 NTSTATUS pdb_del_aliasmem(const struct dom_sid *alias, const struct dom_sid *member); 885 NTSTATUS pdb_enum_aliasmem(const struct dom_sid *alias, TALLOC_CTX *mem_ctx, 886 struct dom_sid **pp_members, size_t *p_num_members); 887 NTSTATUS pdb_enum_alias_memberships(TALLOC_CTX *mem_ctx, 888 const struct dom_sid *domain_sid, 889 const struct dom_sid *members, size_t num_members, 890 uint32_t **pp_alias_rids, 891 size_t *p_num_alias_rids); 892 NTSTATUS pdb_lookup_rids(const struct dom_sid *domain_sid, 893 int num_rids, 894 uint32_t *rids, 895 const char **names, 896 enum lsa_SidType *attrs); 897 NTSTATUS pdb_lookup_names(const struct dom_sid *domain_sid, 898 int num_names, 899 const char **names, 900 uint32_t *rids, 901 enum lsa_SidType *attrs); 902 bool pdb_get_account_policy(enum pdb_policy_type type, uint32_t *value); 903 bool pdb_set_account_policy(enum pdb_policy_type type, uint32_t value); 904 bool pdb_get_seq_num(time_t *seq_num); 905 /* 906 * Instead of passing down a gid or uid, this function sends down a pointer 907 * to a unixid. 908 * 909 * This acts as an in-out variable so that the idmap functions can correctly 910 * receive ID_TYPE_BOTH, filling in cache details correctly rather than forcing 911 * the cache to store ID_TYPE_UID or ID_TYPE_GID. 912 */ 913 bool pdb_id_to_sid(struct unixid *id, struct dom_sid *sid); 914 bool pdb_sid_to_id(const struct dom_sid *sid, struct unixid *id); 915 uint32_t pdb_capabilities(void); 916 bool pdb_new_rid(uint32_t *rid); 917 bool initialize_password_db(bool reload, struct tevent_context *tevent_ctx); 918 struct pdb_search *pdb_search_init(TALLOC_CTX *mem_ctx, 919 enum pdb_search_type type); 920 struct pdb_search *pdb_search_users(TALLOC_CTX *mem_ctx, uint32_t acct_flags); 921 struct pdb_search *pdb_search_groups(TALLOC_CTX *mem_ctx); 922 struct pdb_search *pdb_search_aliases(TALLOC_CTX *mem_ctx, const struct dom_sid *sid); 923 uint32_t pdb_search_entries(struct pdb_search *search, 924 uint32_t start_idx, uint32_t max_entries, 925 struct samr_displayentry **result); 926 bool pdb_get_trusteddom_pw(const char *domain, char** pwd, struct dom_sid *sid, 927 time_t *pass_last_set_time); 928 NTSTATUS pdb_get_trusteddom_creds(const char *domain, TALLOC_CTX *mem_ctx, 929 struct cli_credentials **creds); 930 bool pdb_set_trusteddom_pw(const char* domain, const char* pwd, 931 const struct dom_sid *sid); 932 bool pdb_del_trusteddom_pw(const char *domain); 933 NTSTATUS pdb_enum_trusteddoms(TALLOC_CTX *mem_ctx, uint32_t *num_domains, 934 struct trustdom_info ***domains); 935 NTSTATUS pdb_get_trusted_domain(TALLOC_CTX *mem_ctx, const char *domain, 936 struct pdb_trusted_domain **td); 937 NTSTATUS pdb_get_trusted_domain_by_sid(TALLOC_CTX *mem_ctx, struct dom_sid *sid, 938 struct pdb_trusted_domain **td); 939 NTSTATUS pdb_set_trusted_domain(const char* domain, 940 const struct pdb_trusted_domain *td); 941 NTSTATUS pdb_del_trusted_domain(const char *domain); 942 NTSTATUS pdb_enum_trusted_domains(TALLOC_CTX *mem_ctx, uint32_t *num_domains, 943 struct pdb_trusted_domain ***domains); 944 NTSTATUS make_pdb_method( struct pdb_methods **methods ) ; 945 NTSTATUS pdb_get_secret(TALLOC_CTX *mem_ctx, 946 const char *secret_name, 947 DATA_BLOB *secret_current, 948 NTTIME *secret_current_lastchange, 949 DATA_BLOB *secret_old, 950 NTTIME *secret_old_lastchange, 951 struct security_descriptor **sd); 952 NTSTATUS pdb_set_secret(const char *secret_name, 953 DATA_BLOB *secret_current, 954 DATA_BLOB *secret_old, 955 struct security_descriptor *sd); 956 NTSTATUS pdb_delete_secret(const char *secret_name); 957 bool pdb_sid_to_id_unix_users_and_groups(const struct dom_sid *sid, 958 struct unixid *id); 959 960 NTSTATUS pdb_enum_upn_suffixes(TALLOC_CTX *mem_ctx, 961 uint32_t *num_suffixes, 962 char ***suffixes); 963 964 NTSTATUS pdb_set_upn_suffixes(uint32_t num_suffixes, 965 const char **suffixes); 966 bool pdb_is_responsible_for_our_sam(void); 967 bool pdb_is_responsible_for_builtin(void); 968 bool pdb_is_responsible_for_wellknown(void); 969 bool pdb_is_responsible_for_unix_users(void); 970 bool pdb_is_responsible_for_unix_groups(void); 971 bool pdb_is_responsible_for_everything_else(void); 972 973 /* The following definitions come from passdb/pdb_util.c */ 974 975 NTSTATUS pdb_create_builtin(uint32_t rid); 976 NTSTATUS create_builtin_users(const struct dom_sid *sid); 977 NTSTATUS create_builtin_administrators(const struct dom_sid *sid); 978 523 979 #include "passdb/machine_sid.h" 524 980 #include "passdb/lookup_sid.h" 525 981 982 /* The following definitions come from passdb/pdb_unixid.c */ 983 void unixid_from_uid(struct unixid *id, uint32_t some_uid); 984 void unixid_from_gid(struct unixid *id, uint32_t some_gid); 985 void unixid_from_both(struct unixid *id, uint32_t some_id); 986 987 /* The following definitions come from passdb/pdb_secrets.c 988 * and should be used by PDB modules if they need to store 989 * sid/guid information for the domain in secrets database 990 */ 991 bool PDB_secrets_mark_domain_protected(const char *domain); 992 bool PDB_secrets_clear_domain_protection(const char *domain); 993 bool PDB_secrets_store_domain_sid(const char *domain, const struct dom_sid *sid); 994 bool PDB_secrets_fetch_domain_sid(const char *domain, struct dom_sid *sid); 995 bool PDB_secrets_store_domain_guid(const char *domain, struct GUID *guid); 996 bool PDB_secrets_fetch_domain_guid(const char *domain, struct GUID *guid); 997 526 998 #endif /* _PASSDB_H */ -
vendor/current/source3/include/popt_common.h
r740 r988 22 22 23 23 #include <popt.h> 24 #include "auth_info.h" 24 25 25 26 /* Common popt structures */ … … 43 44 #define POPT_COMMON_CREDENTIALS { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_credentials, 0, "Authentication options:", NULL }, 44 45 #define POPT_COMMON_DYNCONFIG { NULL, 0, POPT_ARG_INCLUDE_TABLE, \ 45 CONST_DISCARD(poptOption *, popt_common_dynconfig), 0, \46 discard_const_p(poptOption, popt_common_dynconfig), 0, \ 46 47 "Build-time configuration overrides:", NULL }, 47 48 #define POPT_COMMON_DEBUGLEVEL { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_debuglevel, 0, "Common samba debugging:", NULL }, 48 49 #define POPT_COMMON_OPTION { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_option, 0, "Common samba commandline config:", NULL }, 49 50 50 struct user_auth_info {51 char *username;52 char *domain;53 char *password;54 bool got_pass;55 bool use_kerberos;56 int signing_state;57 bool smb_encrypt;58 bool use_machine_account;59 bool fallback_after_kerberos;60 bool use_ccache;61 };62 63 51 void popt_common_set_auth_info(struct user_auth_info *auth_info); 52 void popt_burn_cmdline_password(int argc, char *argv[]); 64 53 65 54 #endif /* _POPT_COMMON_H */ -
vendor/current/source3/include/printing.h
r746 r988 25 25 SAMBA printing subsystem. 26 26 */ 27 #include <tdb.h> 28 #include "lib/param/loadparm.h" 27 29 28 30 /* Extra fields above "LPQ_PRINTING" are used to map extra NT status codes. */ … … 162 164 #define MAX_PRINT_DBS_OPEN 1 163 165 164 struct TDB_DATA;165 struct tdb_context;166 167 166 struct tdb_print_db { 168 167 struct tdb_print_db *next, *prev; … … 182 181 NTSTATUS print_spool_open(files_struct *fsp, 183 182 const char *fname, 184 uint 16_t current_vuid);183 uint64_t current_vuid); 185 184 186 185 int print_spool_write(files_struct *fsp, const char *data, uint32_t size, 187 SMB_OFF_Toffset, uint32_t *written);186 off_t offset, uint32_t *written); 188 187 189 188 void print_spool_end(files_struct *fsp, enum file_close_type close_type); … … 191 190 void print_spool_terminate(struct connection_struct *conn, 192 191 struct print_file_data *print_file); 192 uint16_t print_spool_rap_jobid(struct print_file_data *print_file); 193 193 194 194 /* The following definitions come from printing/printing.c */ 195 195 196 uint32 sysjob_to_jobid(int unix_jobid); 196 uint32_t sysjob_to_jobid_pdb(struct tdb_print_db *pdb, int sysjob); 197 uint32_t sysjob_to_jobid(int unix_jobid); 198 int jobid_to_sysjob_pdb(struct tdb_print_db *pdb, uint32_t jobid); 197 199 bool print_notify_register_pid(int snum); 198 200 bool print_notify_deregister_pid(int snum); 199 bool print_job_exists(const char* sharename, uint32 jobid);201 bool print_job_exists(const char* sharename, uint32_t jobid); 200 202 struct spoolss_DeviceMode *print_job_devmode(TALLOC_CTX *mem_ctx, 201 203 const char *sharename, 202 uint32 jobid);204 uint32_t jobid); 203 205 bool print_job_set_name(struct tevent_context *ev, 204 206 struct messaging_context *msg_ctx, 205 const char *sharename, uint32 jobid, const char *name);207 const char *sharename, uint32_t jobid, const char *name); 206 208 bool print_job_get_name(TALLOC_CTX *mem_ctx, const char *sharename, uint32_t jobid, char **name); 207 WERROR print_job_delete(const struct auth_se rversupplied_info *server_info,209 WERROR print_job_delete(const struct auth_session_info *server_info, 208 210 struct messaging_context *msg_ctx, 209 211 int snum, uint32_t jobid); 210 WERROR print_job_pause(const struct auth_se rversupplied_info *server_info,212 WERROR print_job_pause(const struct auth_session_info *server_info, 211 213 struct messaging_context *msg_ctx, 212 int snum, uint32 jobid);213 WERROR print_job_resume(const struct auth_se rversupplied_info *server_info,214 int snum, uint32_t jobid); 215 WERROR print_job_resume(const struct auth_session_info *server_info, 214 216 struct messaging_context *msg_ctx, 215 int snum, uint32 jobid);217 int snum, uint32_t jobid); 216 218 ssize_t print_job_write(struct tevent_context *ev, 217 219 struct messaging_context *msg_ctx, 218 int snum, uint32 jobid, const char *buf, size_t size);220 int snum, uint32_t jobid, const char *buf, size_t size); 219 221 int print_queue_length(struct messaging_context *msg_ctx, int snum, 220 222 print_status_struct *pstatus); 221 WERROR print_job_start(const struct auth_se rversupplied_info *server_info,223 WERROR print_job_start(const struct auth_session_info *server_info, 222 224 struct messaging_context *msg_ctx, 223 225 const char *clientmachine, … … 225 227 struct spoolss_DeviceMode *devmode, uint32_t *_jobid); 226 228 void print_job_endpage(struct messaging_context *msg_ctx, 227 int snum, uint32 jobid);229 int snum, uint32_t jobid); 228 230 NTSTATUS print_job_end(struct messaging_context *msg_ctx, int snum, 229 uint32 jobid, enum file_close_type close_type);231 uint32_t jobid, enum file_close_type close_type); 230 232 int print_queue_status(struct messaging_context *msg_ctx, int snum, 231 233 print_queue_struct **ppqueue, 232 234 print_status_struct *status); 233 WERROR print_queue_pause(const struct auth_se rversupplied_info *server_info,235 WERROR print_queue_pause(const struct auth_session_info *server_info, 234 236 struct messaging_context *msg_ctx, int snum); 235 WERROR print_queue_resume(const struct auth_se rversupplied_info *server_info,237 WERROR print_queue_resume(const struct auth_session_info *server_info, 236 238 struct messaging_context *msg_ctx, int snum); 237 WERROR print_queue_purge(const struct auth_se rversupplied_info *server_info,239 WERROR print_queue_purge(const struct auth_session_info *server_info, 238 240 struct messaging_context *msg_ctx, int snum); 239 uint16 pjobid_to_rap(const char* sharename, uint32jobid);240 bool rap_to_pjobid(uint16 rap_jobid, fstring sharename, uint32*pjobid);241 void rap_jobid_delete(const char* sharename, uint32 jobid);241 uint16_t pjobid_to_rap(const char* sharename, uint32_t jobid); 242 bool rap_to_pjobid(uint16_t rap_jobid, fstring sharename, uint32_t *pjobid); 243 void rap_jobid_delete(const char* sharename, uint32_t jobid); 242 244 bool print_backend_init(struct messaging_context *msg_ctx); 243 void start_background_queue(struct tevent_context *ev,244 struct messaging_context *msg);245 245 void printing_end(void); 246 246 … … 256 256 void release_print_db( struct tdb_print_db *pdb); 257 257 void close_all_print_db(void); 258 structTDB_DATA get_printer_notify_pid_list(struct tdb_context *tdb, const char *printer_name, bool cleanlist);258 TDB_DATA get_printer_notify_pid_list(struct tdb_context *tdb, const char *printer_name, bool cleanlist); 259 259 260 260 void print_queue_receive(struct messaging_context *msg, -
vendor/current/source3/include/proto.h
r919 r988 24 24 #define _PROTO_H_ 25 25 26 #include <sys/types.h> 27 #include <regex.h> 28 26 29 /* The following definitions come from lib/access.c */ 27 30 … … 36 39 /* The following definitions come from lib/adt_tree.c */ 37 40 38 39 /* The following definitions come from lib/afs.c */40 41 char *afs_createtoken_str(const char *username, const char *cell);42 bool afs_login(connection_struct *conn);43 bool afs_login(connection_struct *conn);44 char *afs_createtoken_str(const char *username, const char *cell);45 46 /* The following definitions come from lib/afs_settoken.c */47 48 int afs_syscall( int subcall,49 char * path,50 int cmd,51 char * cmarg,52 int follow);53 bool afs_settoken_str(const char *token_string);54 bool afs_settoken_str(const char *token_string);55 56 41 /* The following definitions come from lib/audit.c */ 57 42 58 const char *audit_category_str(uint32 category);59 const char *audit_param_str(uint32 category);60 const char *audit_description_str(uint32 category);61 bool get_audit_category_from_param(const char *param, uint32 *audit_category);62 const char *audit_policy_str(TALLOC_CTX *mem_ctx, uint32 policy);43 const char *audit_category_str(uint32_t category); 44 const char *audit_param_str(uint32_t category); 45 const char *audit_description_str(uint32_t category); 46 bool get_audit_category_from_param(const char *param, uint32_t *audit_category); 47 const char *audit_policy_str(TALLOC_CTX *mem_ctx, uint32_t policy); 63 48 64 49 /* The following definitions come from lib/charcnv.c */ 65 50 66 char lp_failed_convert_char(void);67 void lazy_initialize_conv(void);68 51 void gfree_charcnv(void); 69 void init_iconv(void);70 size_t convert_string(charset_t from, charset_t to,71 void const *src, size_t srclen,72 void *dest, size_t destlen, bool allow_bad_conv);73 size_t unix_strupper(const char *src, size_t srclen, char *dest, size_t destlen);74 char *talloc_strdup_upper(TALLOC_CTX *ctx, const char *s);75 char *strupper_talloc(TALLOC_CTX *ctx, const char *s);76 size_t unix_strlower(const char *src, size_t srclen, char *dest, size_t destlen);77 char *talloc_strdup_lower(TALLOC_CTX *ctx, const char *s);78 char *strlower_talloc(TALLOC_CTX *ctx, const char *s);79 52 size_t ucs2_align(const void *base_ptr, const void *p, int flags); 80 53 size_t push_ascii(void *dest, const char *src, size_t dest_len, int flags); … … 84 57 size_t pull_ascii_fstring(char *dest, const void *src); 85 58 size_t pull_ascii_nstring(char *dest, size_t dest_len, const void *src); 86 size_t push_ ucs2(const void *base_ptr, void *dest, const char *src, size_t dest_len, int flags);87 size_t push_utf8_fstring(void *dest, const char *src);88 bool push_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src,89 size_t *converted_size);90 size_t pull_ucs2(const void *base_ptr, char *dest, const void *src, size_t dest_len, size_t src_len, int flags);91 size_t pull_ ucs2_base_talloc(TALLOC_CTX *ctx,59 size_t push_string_check_fn(void *dest, const char *src, 60 size_t dest_len, int flags); 61 size_t push_string_base(const char *base, uint16_t flags2, 62 void *dest, const char *src, 63 size_t dest_len, int flags); 64 size_t pull_string_talloc(TALLOC_CTX *ctx, 92 65 const void *base_ptr, 66 uint16_t smb_flags2, 93 67 char **ppdest, 94 68 const void *src, 95 69 size_t src_len, 96 70 int flags); 97 size_t pull_ucs2_fstring(char *dest, const void *src); 98 bool push_ucs2_talloc(TALLOC_CTX *ctx, smb_ucs2_t **dest, const char *src, 99 size_t *converted_size); 100 bool pull_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src, 101 size_t *converted_size); 102 bool pull_ucs2_talloc(TALLOC_CTX *ctx, char **dest, const smb_ucs2_t *src, 103 size_t *converted_size); 104 bool pull_ascii_talloc(TALLOC_CTX *ctx, char **dest, const char *src, 105 size_t *converted_size); 106 size_t push_string_check_fn(const char *function, unsigned int line, 107 void *dest, const char *src, 108 size_t dest_len, int flags); 109 size_t push_string_base(const char *function, unsigned int line, 110 const char *base, uint16 flags2, 111 void *dest, const char *src, 112 size_t dest_len, int flags); 113 size_t pull_string_fn(const char *function, 114 unsigned int line, 115 const void *base_ptr, 116 uint16 smb_flags2, 117 char *dest, 118 const void *src, 119 size_t dest_len, 120 size_t src_len, 121 int flags); 122 size_t pull_string_talloc_fn(const char *function, 123 unsigned int line, 124 TALLOC_CTX *ctx, 125 const void *base_ptr, 126 uint16 smb_flags2, 127 char **ppdest, 128 const void *src, 129 size_t src_len, 130 int flags); 131 size_t align_string(const void *base_ptr, const char *p, int flags); 132 133 /* The following definitions come from lib/clobber.c */ 134 135 void clobber_region(const char *fn, unsigned int line, char *dest, size_t len); 136 137 /* The following definitions come from lib/conn_tdb.c */ 138 139 struct db_record *connections_fetch_entry(TALLOC_CTX *mem_ctx, 140 connection_struct *conn, 141 const char *name); 142 int connections_traverse(int (*fn)(struct db_record *rec, 143 void *private_data), 144 void *private_data); 145 int connections_forall(int (*fn)(struct db_record *rec, 146 const struct connections_key *key, 147 const struct connections_data *data, 148 void *private_data), 149 void *private_data); 150 int connections_forall_read(int (*fn)(const struct connections_key *key, 151 const struct connections_data *data, 152 void *private_data), 153 void *private_data); 154 bool connections_init(bool rw); 71 size_t dos_PutUniCode(char *dst,const char *src, size_t len, bool null_terminate); 72 int rpcstr_push_talloc(TALLOC_CTX *ctx, smb_ucs2_t **dest, const char *src); 155 73 156 74 /* The following definitions come from lib/dmallocmsg.c */ … … 167 85 int map_errno_from_nt_status(NTSTATUS status); 168 86 169 /* The following definitions come from lib/fault.c */170 void fault_setup(void (*fn)(void *));171 void dump_core_setup(const char *progname);172 173 87 /* The following definitions come from lib/file_id.c */ 174 88 175 89 struct file_id vfs_file_id_from_sbuf(connection_struct *conn, const SMB_STRUCT_STAT *sbuf); 176 bool file_id_equal(const struct file_id *id1, const struct file_id *id2); 177 const char *file_id_string_tos(const struct file_id *id); 178 void push_file_id_16(char *buf, const struct file_id *id); 179 void push_file_id_24(char *buf, const struct file_id *id); 180 void pull_file_id_24(char *buf, struct file_id *id); 181 182 /* The following definitions come from lib/gencache.c */ 183 184 bool gencache_set(const char *keystr, const char *value, time_t timeout); 185 bool gencache_del(const char *keystr); 186 bool gencache_get(const char *keystr, char **valstr, time_t *timeout); 187 bool gencache_parse(const char *keystr, 188 void (*parser)(time_t timeout, DATA_BLOB blob, 189 void *private_data), 190 void *private_data); 191 bool gencache_get_data_blob(const char *keystr, DATA_BLOB *blob, 192 time_t *timeout, bool *was_expired); 193 bool gencache_stabilize(void); 194 bool gencache_set_data_blob(const char *keystr, const DATA_BLOB *blob, time_t timeout); 195 void gencache_iterate_blobs(void (*fn)(const char *key, DATA_BLOB value, 196 time_t timeout, void *private_data), 197 void *private_data, const char *pattern); 198 void gencache_iterate(void (*fn)(const char* key, const char *value, time_t timeout, void* dptr), 199 void* data, const char* keystr_pattern); 90 91 #include "lib/gencache.h" 200 92 201 93 /* The following definitions come from lib/interface.c */ … … 229 121 char *escape_rdn_val_string_alloc(const char *s); 230 122 231 /* The following definitions come from lib/module.c */232 233 NTSTATUS smb_load_module(const char *module_name);234 int smb_load_modules(const char **modules);235 NTSTATUS smb_probe_module(const char *subsystem, const char *module);236 NTSTATUS smb_load_module(const char *module_name);237 int smb_load_modules(const char **modules);238 NTSTATUS smb_probe_module(const char *subsystem, const char *module);239 void init_modules(void);240 241 123 /* The following definitions come from lib/ms_fnmatch.c */ 242 124 243 125 int ms_fnmatch(const char *pattern, const char *string, bool translate_pattern, 244 126 bool is_case_sensitive); 245 int gen_fnmatch(const char *pattern, const char *string);246 247 /* The following definitions come from lib/pidfile.c */248 249 pid_t pidfile_pid(const char *name);250 void pidfile_create(const char *program_name);251 void pidfile_unlink(void);252 127 253 128 /* The following definitions come from lib/recvfile.c */ … … 255 130 ssize_t sys_recvfile(int fromfd, 256 131 int tofd, 257 SMB_OFF_Toffset,132 off_t offset, 258 133 size_t count); 259 134 ssize_t sys_recvfile(int fromfd, 260 135 int tofd, 261 SMB_OFF_Toffset,136 off_t offset, 262 137 size_t count); 263 138 ssize_t drain_socket(int sockfd, size_t count); 264 139 265 /* The following definitions come from lib/secdesc.c */266 267 uint32_t get_sec_info(const struct security_descriptor *sd);268 struct security_descriptor *sec_desc_merge(TALLOC_CTX *ctx, struct security_descriptor *new_sdb, struct security_descriptor *old_sdb);269 struct sec_desc_buf *sec_desc_merge_buf(TALLOC_CTX *ctx, struct sec_desc_buf *new_sdb, struct sec_desc_buf *old_sdb);270 struct security_descriptor *make_sec_desc(TALLOC_CTX *ctx,271 enum security_descriptor_revision revision,272 uint16 type,273 const struct dom_sid *owner_sid, const struct dom_sid *grp_sid,274 struct security_acl *sacl, struct security_acl *dacl, size_t *sd_size);275 struct security_descriptor *dup_sec_desc(TALLOC_CTX *ctx, const struct security_descriptor *src);276 NTSTATUS marshall_sec_desc(TALLOC_CTX *mem_ctx,277 struct security_descriptor *secdesc,278 uint8 **data, size_t *len);279 NTSTATUS marshall_sec_desc_buf(TALLOC_CTX *mem_ctx,280 struct sec_desc_buf *secdesc_buf,281 uint8_t **data, size_t *len);282 NTSTATUS unmarshall_sec_desc(TALLOC_CTX *mem_ctx, uint8 *data, size_t len,283 struct security_descriptor **psecdesc);284 NTSTATUS unmarshall_sec_desc_buf(TALLOC_CTX *mem_ctx, uint8_t *data, size_t len,285 struct sec_desc_buf **psecdesc_buf);286 struct security_descriptor *make_standard_sec_desc(TALLOC_CTX *ctx, const struct dom_sid *owner_sid, const struct dom_sid *grp_sid,287 struct security_acl *dacl, size_t *sd_size);288 struct sec_desc_buf *make_sec_desc_buf(TALLOC_CTX *ctx, size_t len, struct security_descriptor *sec_desc);289 struct sec_desc_buf *dup_sec_desc_buf(TALLOC_CTX *ctx, struct sec_desc_buf *src);290 NTSTATUS sec_desc_add_sid(TALLOC_CTX *ctx, struct security_descriptor **psd, const struct dom_sid *sid, uint32 mask, size_t *sd_size);291 NTSTATUS sec_desc_mod_sid(struct security_descriptor *sd, struct dom_sid *sid, uint32 mask);292 NTSTATUS sec_desc_del_sid(TALLOC_CTX *ctx, struct security_descriptor **psd, struct dom_sid *sid, size_t *sd_size);293 bool sd_has_inheritable_components(const struct security_descriptor *parent_ctr, bool container);294 NTSTATUS se_create_child_secdesc(TALLOC_CTX *ctx,295 struct security_descriptor **ppsd,296 size_t *psize,297 const struct security_descriptor *parent_ctr,298 const struct dom_sid *owner_sid,299 const struct dom_sid *group_sid,300 bool container);301 NTSTATUS se_create_child_secdesc_buf(TALLOC_CTX *ctx,302 struct sec_desc_buf **ppsdb,303 const struct security_descriptor *parent_ctr,304 bool container);305 306 140 /* The following definitions come from lib/sendfile.c */ 307 141 308 ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_Toffset, size_t count);142 ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, off_t offset, size_t count); 309 143 310 144 /* The following definitions come from lib/server_mutex.c */ … … 316 150 317 151 bool share_info_db_init(void); 318 struct security_descriptor *get_share_security_default( TALLOC_CTX *ctx, size_t *psize, uint32 def_access);152 struct security_descriptor *get_share_security_default( TALLOC_CTX *ctx, size_t *psize, uint32_t def_access); 319 153 struct security_descriptor *get_share_security( TALLOC_CTX *ctx, const char *servicename, 320 154 size_t *psize); … … 323 157 bool share_access_check(const struct security_token *token, 324 158 const char *sharename, 325 uint32 desired_access,159 uint32_t desired_access, 326 160 uint32_t *pgranted); 327 161 bool parse_usershare_acl(TALLOC_CTX *ctx, const char *acl_str, struct security_descriptor **ppsd); … … 357 191 const char *input_string, 358 192 const char *username, 193 const char *grpname, 359 194 const char *domain, 360 195 uid_t uid, … … 369 204 const char *smb_name, const char *domain_name, 370 205 char *str, size_t len); 371 char *standard_sub_conn(TALLOC_CTX *ctx, connection_struct *conn, const char *str);372 373 /* The following definitions come from lib/sysacls.c */374 375 int sys_acl_get_entry(SMB_ACL_T acl_d, int entry_id, SMB_ACL_ENTRY_T *entry_p);376 int sys_acl_get_tag_type(SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *type_p);377 int sys_acl_get_permset(SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p);378 void *sys_acl_get_qualifier(SMB_ACL_ENTRY_T entry_d);379 int sys_acl_clear_perms(SMB_ACL_PERMSET_T permset_d);380 int sys_acl_add_perm(SMB_ACL_PERMSET_T permset_d, SMB_ACL_PERM_T perm);381 int sys_acl_get_perm(SMB_ACL_PERMSET_T permset_d, SMB_ACL_PERM_T perm);382 char *sys_acl_to_text(SMB_ACL_T acl_d, ssize_t *len_p);383 SMB_ACL_T sys_acl_init(int count);384 int sys_acl_create_entry(SMB_ACL_T *acl_p, SMB_ACL_ENTRY_T *entry_p);385 int sys_acl_set_tag_type(SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T tag_type);386 int sys_acl_set_qualifier(SMB_ACL_ENTRY_T entry_d, void *qual_p);387 int sys_acl_set_permset(SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T permset_d);388 int sys_acl_free_text(char *text);389 int sys_acl_free_acl(SMB_ACL_T acl_d) ;390 int sys_acl_free_qualifier(void *qual, SMB_ACL_TAG_T tagtype);391 int sys_acl_valid(SMB_ACL_T acl_d);392 SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle,393 const char *path_p, SMB_ACL_TYPE_T type);394 SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp);395 int sys_acl_set_file(vfs_handle_struct *handle,396 const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d);397 int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,398 SMB_ACL_T acl_d);399 int sys_acl_delete_def_file(vfs_handle_struct *handle,400 const char *path);401 int no_acl_syscall_error(int err);402 206 403 207 /* The following definitions come from lib/sysquotas.c */ … … 423 227 /* The following definitions come from lib/system.c */ 424 228 425 void *sys_memalign( size_t align, size_t size );426 int sys_usleep(long usecs);427 ssize_t sys_read(int fd, void *buf, size_t count);428 ssize_t sys_write(int fd, const void *buf, size_t count);429 ssize_t sys_writev(int fd, const struct iovec *iov, int iovcnt);430 ssize_t sys_pread(int fd, void *buf, size_t count, SMB_OFF_T off);431 ssize_t sys_pwrite(int fd, const void *buf, size_t count, SMB_OFF_T off);432 229 ssize_t sys_send(int s, const void *msg, size_t len, int flags); 433 ssize_t sys_sendto(int s, const void *msg, size_t len, int flags, const struct sockaddr *to, socklen_t tolen);434 ssize_t sys_recv(int fd, void *buf, size_t count, int flags);435 230 ssize_t sys_recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen); 436 231 int sys_fcntl_ptr(int fd, int cmd, void *arg); … … 444 239 int sys_lstat(const char *fname,SMB_STRUCT_STAT *sbuf, 445 240 bool fake_dir_create_times); 446 int sys_ftruncate(int fd, SMB_OFF_T offset); 447 int sys_posix_fallocate(int fd, SMB_OFF_T offset, SMB_OFF_T len); 448 int sys_fallocate(int fd, enum vfs_fallocate_mode mode, SMB_OFF_T offset, SMB_OFF_T len); 449 SMB_OFF_T sys_lseek(int fd, SMB_OFF_T offset, int whence); 450 int sys_fseek(FILE *fp, SMB_OFF_T offset, int whence); 451 SMB_OFF_T sys_ftell(FILE *fp); 452 int sys_creat(const char *path, mode_t mode); 453 int sys_open(const char *path, int oflag, mode_t mode); 454 FILE *sys_fopen(const char *path, const char *type); 455 void kernel_flock(int fd, uint32 share_mode, uint32 access_mask); 456 SMB_STRUCT_DIR *sys_opendir(const char *name); 457 SMB_STRUCT_DIR *sys_fdopendir(int fd); 458 SMB_STRUCT_DIRENT *sys_readdir(SMB_STRUCT_DIR *dirp); 459 void sys_seekdir(SMB_STRUCT_DIR *dirp, long offset); 460 long sys_telldir(SMB_STRUCT_DIR *dirp); 461 void sys_rewinddir(SMB_STRUCT_DIR *dirp); 462 int sys_closedir(SMB_STRUCT_DIR *dirp); 241 int sys_posix_fallocate(int fd, off_t offset, off_t len); 242 int sys_fallocate(int fd, uint32_t mode, off_t offset, off_t len); 243 void kernel_flock(int fd, uint32_t share_mode, uint32_t access_mask); 244 DIR *sys_fdopendir(int fd); 463 245 int sys_mknod(const char *path, mode_t mode, SMB_DEV_T dev); 464 246 int sys_waitpid(pid_t pid,int *status,int options); 465 char *sys_getwd( char *s);247 char *sys_getwd(void); 466 248 void set_effective_capability(enum smbd_capability capability); 467 249 void drop_effective_capability(enum smbd_capability capability); … … 474 256 int sys_pclose(int fd); 475 257 ssize_t sys_getxattr (const char *path, const char *name, void *value, size_t size); 476 ssize_t sys_lgetxattr (const char *path, const char *name, void *value, size_t size);477 258 ssize_t sys_fgetxattr (int filedes, const char *name, void *value, size_t size); 478 259 ssize_t sys_listxattr (const char *path, char *list, size_t size); 479 ssize_t sys_llistxattr (const char *path, char *list, size_t size);480 260 ssize_t sys_flistxattr (int filedes, char *list, size_t size); 481 261 int sys_removexattr (const char *path, const char *name); 482 int sys_lremovexattr (const char *path, const char *name);483 262 int sys_fremovexattr (int filedes, const char *name); 484 263 int sys_setxattr (const char *path, const char *name, const void *value, size_t size, int flags); 485 int sys_lsetxattr (const char *path, const char *name, const void *value, size_t size, int flags);486 264 int sys_fsetxattr (int filedes, const char *name, const void *value, size_t size, int flags); 487 uint32 unix_dev_major(SMB_DEV_T dev); 488 uint32 unix_dev_minor(SMB_DEV_T dev); 489 int sys_aio_read(SMB_STRUCT_AIOCB *aiocb); 490 int sys_aio_write(SMB_STRUCT_AIOCB *aiocb); 491 ssize_t sys_aio_return(SMB_STRUCT_AIOCB *aiocb); 492 int sys_aio_cancel(int fd, SMB_STRUCT_AIOCB *aiocb); 493 int sys_aio_error(const SMB_STRUCT_AIOCB *aiocb); 494 int sys_aio_fsync(int op, SMB_STRUCT_AIOCB *aiocb); 495 int sys_aio_suspend(const SMB_STRUCT_AIOCB * const cblist[], int n, const struct timespec *timeout); 496 int sys_aio_read(SMB_STRUCT_AIOCB *aiocb); 497 int sys_aio_write(SMB_STRUCT_AIOCB *aiocb); 498 ssize_t sys_aio_return(SMB_STRUCT_AIOCB *aiocb); 499 int sys_aio_cancel(int fd, SMB_STRUCT_AIOCB *aiocb); 500 int sys_aio_error(const SMB_STRUCT_AIOCB *aiocb); 501 int sys_aio_fsync(int op, SMB_STRUCT_AIOCB *aiocb); 502 int sys_aio_suspend(const SMB_STRUCT_AIOCB * const cblist[], int n, const struct timespec *timeout); 265 uint32_t unix_dev_major(SMB_DEV_T dev); 266 uint32_t unix_dev_minor(SMB_DEV_T dev); 267 #if 0 268 int sys_get_number_of_cores(void); 269 #endif 270 271 struct stat; 272 void init_stat_ex_from_stat (struct stat_ex *dst, 273 const struct stat *src, 274 bool fake_dir_create_times); 275 503 276 /* The following definitions come from lib/system_smbd.c */ 504 277 … … 537 310 time_t srv_make_unix_date2(const void *date_ptr); 538 311 time_t srv_make_unix_date3(const void *date_ptr); 539 struct timespec convert_time_t_to_timespec(time_t t);540 struct timespec convert_timeval_to_timespec(const struct timeval tv);541 struct timeval convert_timespec_to_timeval(const struct timespec ts);542 struct timespec timespec_current(void);543 struct timespec timespec_min(const struct timespec *ts1,544 const struct timespec *ts2);545 int timespec_compare(const struct timespec *ts1, const struct timespec *ts2);546 void round_timespec_to_sec(struct timespec *ts);547 void round_timespec_to_usec(struct timespec *ts);548 312 struct timespec interpret_long_date(const char *p); 549 313 void TimeInit(void); … … 552 316 time_t nt_time_to_unix_abs(const NTTIME *nt); 553 317 time_t uint64s_nt_time_to_unix_abs(const uint64_t *src); 554 void unix_timespec_to_nt_time(NTTIME *nt, struct timespec ts);555 318 void unix_to_nt_time_abs(NTTIME *nt, time_t t); 556 319 const char *time_to_asc(const time_t t); … … 565 328 566 329 /* The following definitions come from lib/util_names.c */ 567 void gfree_netbios_names(void);568 bool set_global_myname(const char *myname);569 const char *global_myname(void);570 bool set_global_myworkgroup(const char *myworkgroup);571 const char *lp_workgroup(void);572 330 const char *get_global_sam_name(void); 331 const char *my_sam_name(void); 573 332 574 333 /* The following definitions come from lib/util.c */ … … 577 336 void set_Protocol(enum protocol_types p); 578 337 bool all_zero(const uint8_t *ptr, size_t size); 579 bool set_global_scope(const char *scope);580 const char *global_scope(void);581 338 void gfree_names(void); 582 339 void gfree_all( void ); … … 588 345 bool socket_exist(const char *fname); 589 346 uint64_t get_file_size_stat(const SMB_STRUCT_STAT *sbuf); 590 SMB_OFF_T get_file_size(char *file_name); 591 char *attrib_string(uint16 mode);592 void show_msg(char *buf); 593 void smb_set_enclen(char *buf,int len,uint16 enc_ctx_num);594 void s mb_setlen(char *buf,int len);347 bool check_same_dev_ino(const SMB_STRUCT_STAT *sbuf1, 348 const SMB_STRUCT_STAT *sbuf2); 349 bool check_same_stat(const SMB_STRUCT_STAT *sbuf1, 350 const SMB_STRUCT_STAT *sbuf2); 351 void show_msg(const char *buf); 595 352 int set_message_bcc(char *buf,int num_bytes); 596 ssize_t message_push_blob(uint8 **outbuf, DATA_BLOB blob);353 ssize_t message_push_blob(uint8_t **outbuf, DATA_BLOB blob); 597 354 char *unix_clean_name(TALLOC_CTX *ctx, const char *s); 598 355 char *clean_name(TALLOC_CTX *ctx, const char *s); 599 ssize_t write_data_at_offset(int fd, const char *buffer, size_t N, SMB_OFF_Tpos);356 ssize_t write_data_at_offset(int fd, const char *buffer, size_t N, off_t pos); 600 357 int set_blocking(int fd, bool set); 358 NTSTATUS init_before_fork(void); 601 359 NTSTATUS reinit_after_fork(struct messaging_context *msg_ctx, 602 struct event_context *ev_ctx, 603 struct server_id id, 604 bool parent_longlived); 360 struct tevent_context *ev_ctx, 361 bool parent_longlived, 362 const char *comment); 363 NTSTATUS smbd_reinit_after_fork(struct messaging_context *msg_ctx, 364 struct tevent_context *ev_ctx, 365 bool parent_longlived, 366 const char *comment); 605 367 void *malloc_(size_t size); 606 void *memalign_array(size_t el_size, size_t align, unsigned int count);607 void *calloc_array(size_t size, size_t nmemb);608 368 void *Realloc(void *p, size_t size, bool free_old_on_error); 609 369 void add_to_large_array(TALLOC_CTX *mem_ctx, size_t element_size, 610 void *element, void *_array, uint32 *num_elements,370 void *element, void *_array, uint32_t *num_elements, 611 371 ssize_t *array_size); 612 372 char *get_myname(TALLOC_CTX *ctx); 613 373 char *get_mydnsdomname(TALLOC_CTX *ctx); 614 int interpret_protocol(const char *str,int def);615 374 char *automount_lookup(TALLOC_CTX *ctx, const char *user_name); 616 375 char *automount_lookup(TALLOC_CTX *ctx, const char *user_name); 617 376 bool process_exists(const struct server_id pid); 377 bool processes_exist(const struct server_id *pids, int num_pids, 378 bool *results); 618 379 const char *uidtoname(uid_t uid); 619 380 char *gidtoname(gid_t gid); 620 381 uid_t nametouid(const char *name); 621 382 gid_t nametogid(const char *name); 622 void smb_panic (const char *constwhy);383 void smb_panic_s3(const char *why); 623 384 void log_stack_trace(void); 624 const char *readdirname( SMB_STRUCT_DIR *p);385 const char *readdirname(DIR *p); 625 386 bool is_in_path(const char *name, name_compare_entry *namelist, bool case_sensitive); 626 387 void set_namearray(name_compare_entry **ppname_array, const char *namelist); 627 388 void free_namearray(name_compare_entry *name_array); 628 bool fcntl_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_Tcount, int type);629 bool fcntl_getlock(int fd, SMB_OFF_T *poffset, SMB_OFF_T*pcount, int *ptype, pid_t *ppid);389 bool fcntl_lock(int fd, int op, off_t offset, off_t count, int type); 390 bool fcntl_getlock(int fd, off_t *poffset, off_t *pcount, int *ptype, pid_t *ppid); 630 391 bool is_myname(const char *s); 631 bool is_myworkgroup(const char *s);632 392 void ra_lanman_string( const char *native_lanman ); 633 393 const char *get_remote_arch_str(void); … … 641 401 void *smb_xmalloc_array(size_t size, unsigned int count); 642 402 char *myhostname(void); 643 char *lock_path(const char *name); 644 char *pid_path(const char *name); 645 char *lib_path(const char *name); 646 char *modules_path(const char *name); 647 char *data_path(const char *name); 648 char *state_path(const char *name); 649 char *cache_path(const char *name); 650 const char *shlib_ext(void); 403 char *myhostname_upper(void); 404 #include "lib/util_path.h" 651 405 bool parent_dirname(TALLOC_CTX *mem_ctx, const char *dir, char **parent, 652 406 const char **name); … … 658 412 bool unix_wild_match(const char *pattern, const char *string); 659 413 bool name_to_fqdn(fstring fqdn, const char *name); 660 void *talloc_append_blob(TALLOC_CTX *mem_ctx, void *buf, DATA_BLOB blob); 661 uint32 map_share_mode_to_deny_mode(uint32 share_access, uint32 private_options); 662 pid_t procid_to_pid(const struct server_id *proc); 663 void set_my_vnn(uint32 vnn); 664 uint32 get_my_vnn(void); 665 void set_my_unique_id(uint64_t unique_id); 666 struct server_id pid_to_procid(pid_t pid); 667 struct server_id procid_self(void); 668 bool procid_equal(const struct server_id *p1, const struct server_id *p2); 669 bool cluster_id_equal(const struct server_id *id1, 670 const struct server_id *id2); 671 bool procid_is_me(const struct server_id *pid); 414 uint32_t map_share_mode_to_deny_mode(uint32_t share_access, uint32_t private_options); 415 416 #include "lib/util_procid.h" 417 418 #define serverid_equal(p1, p2) server_id_equal(p1,p2) 672 419 struct server_id interpret_pid(const char *pid_string); 673 char *procid_str(TALLOC_CTX *mem_ctx, const struct server_id *pid);674 char *procid_str_static(const struct server_id *pid);675 bool procid_valid(const struct server_id *pid);676 bool procid_is_local(const struct server_id *pid);677 bool trans_oob(uint32_t bufsize, uint32_t offset, uint32_t length);678 420 bool is_offset_safe(const char *buf_base, size_t buf_len, char *ptr, size_t off); 679 421 char *get_safe_ptr(const char *buf_base, size_t buf_len, char *ptr, size_t off); … … 685 427 char **domain, 686 428 char **user); 687 void *_talloc_zero_zeronull(const void *ctx, size_t size, const char *name);688 void *_talloc_memdup_zeronull(const void *t, const void *p, size_t size, const char *name);689 void *_talloc_array_zeronull(const void *ctx, size_t el_size, unsigned count, const char *name);690 void *_talloc_zero_array_zeronull(const void *ctx, size_t el_size, unsigned count, const char *name);691 void *talloc_zeronull(const void *context, size_t size, const char *name);692 429 const char *strip_hostname(const char *s); 693 bool tevent_req_poll_ntstatus(struct tevent_req *req,694 struct tevent_context *ev,695 NTSTATUS *status);696 430 bool any_nt_status_not_ok(NTSTATUS err1, NTSTATUS err2, NTSTATUS *result); 697 431 int timeval_to_msec(struct timeval t); … … 700 434 bool map_open_params_to_ntcreate(const char *smb_base_fname, 701 435 int deny_mode, int open_func, 702 uint32 *paccess_mask,703 uint32 *pshare_mode,704 uint32 *pcreate_disposition,705 uint32 *pcreate_options,436 uint32_t *paccess_mask, 437 uint32_t *pshare_mode, 438 uint32_t *pcreate_disposition, 439 uint32_t *pcreate_options, 706 440 uint32_t *pprivate_flags); 707 708 /* The following definitions come from lib/util_cmdline.c */ 709 710 struct user_auth_info *user_auth_info_init(TALLOC_CTX *mem_ctx); 711 const char *get_cmdline_auth_info_username(const struct user_auth_info *auth_info); 712 void set_cmdline_auth_info_username(struct user_auth_info *auth_info, 713 const char *username); 714 const char *get_cmdline_auth_info_domain(const struct user_auth_info *auth_info); 715 void set_cmdline_auth_info_domain(struct user_auth_info *auth_info, 716 const char *domain); 717 void set_cmdline_auth_info_password(struct user_auth_info *auth_info, 718 const char *password); 719 const char *get_cmdline_auth_info_password(const struct user_auth_info *auth_info); 720 bool set_cmdline_auth_info_signing_state(struct user_auth_info *auth_info, 721 const char *arg); 722 int get_cmdline_auth_info_signing_state(const struct user_auth_info *auth_info); 723 void set_cmdline_auth_info_use_ccache(struct user_auth_info *auth_info, 724 bool b); 725 bool get_cmdline_auth_info_use_ccache(const struct user_auth_info *auth_info); 726 void set_cmdline_auth_info_use_kerberos(struct user_auth_info *auth_info, 727 bool b); 728 bool get_cmdline_auth_info_use_kerberos(const struct user_auth_info *auth_info); 729 void set_cmdline_auth_info_fallback_after_kerberos(struct user_auth_info *auth_info, 730 bool b); 731 bool get_cmdline_auth_info_fallback_after_kerberos(const struct user_auth_info *auth_info); 732 void set_cmdline_auth_info_use_krb5_ticket(struct user_auth_info *auth_info); 733 void set_cmdline_auth_info_smb_encrypt(struct user_auth_info *auth_info); 734 void set_cmdline_auth_info_use_machine_account(struct user_auth_info *auth_info); 735 bool get_cmdline_auth_info_got_pass(const struct user_auth_info *auth_info); 736 bool get_cmdline_auth_info_smb_encrypt(const struct user_auth_info *auth_info); 737 bool get_cmdline_auth_info_use_machine_account(const struct user_auth_info *auth_info); 738 struct user_auth_info *get_cmdline_auth_info_copy(TALLOC_CTX *mem_ctx, 739 const struct user_auth_info *info); 740 bool set_cmdline_auth_info_machine_account_creds(struct user_auth_info *auth_info); 741 void set_cmdline_auth_info_getpass(struct user_auth_info *auth_info); 441 struct security_unix_token *copy_unix_token(TALLOC_CTX *ctx, const struct security_unix_token *tok); 442 bool dir_check_ftype(uint32_t mode, uint32_t dirtype); 443 void init_modules(void); 742 444 743 445 /* The following definitions come from lib/util_builtin.c */ 744 446 745 bool lookup_builtin_rid(TALLOC_CTX *mem_ctx, uint32 rid, const char **name);746 bool lookup_builtin_name(const char *name, uint32 *rid);447 bool lookup_builtin_rid(TALLOC_CTX *mem_ctx, uint32_t rid, const char **name); 448 bool lookup_builtin_name(const char *name, uint32_t *rid); 747 449 const char *builtin_domain_name(void); 748 450 bool sid_check_is_builtin(const struct dom_sid *sid); 749 451 bool sid_check_is_in_builtin(const struct dom_sid *sid); 452 bool sid_check_is_wellknown_builtin(const struct dom_sid *sid); 750 453 751 454 /* The following definitions come from lib/util_file.c */ … … 773 476 uid_t sec_initial_uid(void); 774 477 gid_t sec_initial_gid(void); 478 bool root_mode(void); 775 479 bool non_root_mode(void); 776 480 void gain_root_privilege(void); … … 785 489 int set_re_uid(void); 786 490 void become_user_permanently(uid_t uid, gid_t gid); 491 int set_thread_credentials(uid_t uid, 492 gid_t gid, 493 size_t setlen, 494 const gid_t *gidset); 787 495 bool is_setuid_root(void) ; 788 496 … … 793 501 char *sid_string_dbg(const struct dom_sid *sid); 794 502 char *sid_string_tos(const struct dom_sid *sid); 795 bool sid_linearize( char*outbuf, size_t len, const struct dom_sid *sid);503 bool sid_linearize(uint8_t *outbuf, size_t len, const struct dom_sid *sid); 796 504 bool non_mappable_sid(struct dom_sid *sid); 797 char *sid_binstring_hex (const struct dom_sid *sid);505 char *sid_binstring_hex_talloc(TALLOC_CTX *mem_ctx, const struct dom_sid *sid); 798 506 struct netr_SamInfo3; 799 507 NTSTATUS sid_array_from_info3(TALLOC_CTX *mem_ctx, … … 824 532 char *print_canonical_sockaddr(TALLOC_CTX *ctx, 825 533 const struct sockaddr_storage *pss); 826 const char *client_name(int fd);827 534 int get_socket_port(int fd); 828 535 const char *client_addr(int fd, char *addr, size_t addrlen); 829 536 const char *client_socket_addr(int fd, char *addr, size_t addr_len); 830 537 int client_socket_port(int fd); 831 void set_smb_read_error(enum smb_read_errors *pre,832 enum smb_read_errors newerr);833 void cond_set_smb_read_error(enum smb_read_errors *pre,834 enum smb_read_errors newerr);835 538 bool is_a_socket(int fd); 836 539 void set_socket_options(int fd, const char *options); … … 843 546 unsigned int time_out, 844 547 size_t *size_ret); 845 NTSTATUS read_data(int fd, char *buffer, size_t N); 846 ssize_t write_data(int fd, const char *buffer, size_t N); 847 ssize_t write_data_iov(int fd, const struct iovec *orig_iov, int iovcnt); 548 NTSTATUS read_data_ntstatus(int fd, char *buffer, size_t N); 549 848 550 bool send_keepalive(int client); 849 551 NTSTATUS read_smb_length_return_keepalive(int fd, char *inbuf, … … 864 566 int timeout, int *pfd); 865 567 struct tevent_req *open_socket_out_send(TALLOC_CTX *mem_ctx, 866 struct event_context *ev,568 struct tevent_context *ev, 867 569 const struct sockaddr_storage *pss, 868 570 uint16_t port, … … 870 572 NTSTATUS open_socket_out_recv(struct tevent_req *req, int *pfd); 871 573 struct tevent_req *open_socket_out_defer_send(TALLOC_CTX *mem_ctx, 872 struct event_context *ev,574 struct tevent_context *ev, 873 575 struct timeval wait_time, 874 576 const struct sockaddr_storage *pss, … … 877 579 NTSTATUS open_socket_out_defer_recv(struct tevent_req *req, int *pfd); 878 580 int open_udp_socket(const char *host, int port); 879 const char *get_peer_name(int fd, bool force_lookup);880 581 const char *get_peer_addr(int fd, char *addr, size_t addr_len); 582 583 struct tsocket_address; 584 585 int get_remote_hostname(const struct tsocket_address *remote_address, 586 char **name, 587 TALLOC_CTX *mem_ctx); 588 881 589 int create_pipe_sock(const char *socket_dir, 882 590 const char *socket_name, 883 591 mode_t dir_perms); 592 int create_tcpip_socket(const struct sockaddr_storage *ifss, uint16_t *port); 884 593 const char *get_mydnsfullname(void); 885 594 bool is_myname_or_ipaddr(const char *s); … … 893 602 int poll_one_fd(int fd, int events, int timeout, int *revents); 894 603 int poll_intr_one_fd(int fd, int events, int timeout, int *revents); 895 struct tstream_context;896 struct tevent_req *tstream_read_packet_send(TALLOC_CTX *mem_ctx,897 struct tevent_context *ev,898 struct tstream_context *stream,899 size_t initial,900 ssize_t (*more)(uint8_t *buf,901 size_t buflen,902 void *private_data),903 void *private_data);904 ssize_t tstream_read_packet_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,905 uint8_t **pbuf, int *perrno);906 604 907 605 /* The following definitions come from lib/util_str.c */ 908 606 909 607 bool next_token(const char **ptr, char *buff, const char *sep, size_t bufsize); 910 int StrCaseCmp(const char *s, const char *t);911 int StrnCaseCmp(const char *s, const char *t, size_t len);912 608 bool strnequal(const char *s1,const char *s2,size_t n); 913 609 bool strcsequal(const char *s1,const char *s2); 914 void strnorm(char *s, int case_default); 915 bool strisnormal(const char *s, int case_default); 610 bool strnorm(char *s, int case_default); 916 611 char *push_skip_string(char *buf); 917 612 char *skip_string(const char *base, size_t len, char *buf); 918 613 size_t str_charnum(const char *s); 919 size_t str_ascii_charnum(const char *s);920 614 bool trim_char(char *s,char cfront,char cback); 921 615 bool strhasupper(const char *s); 922 616 bool strhaslower(const char *s); 923 char *safe_strcpy_fn(const char *fn, 924 int line, 925 char *dest, 926 const char *src, 927 size_t maxlength); 928 char *safe_strcat_fn(const char *fn, 929 int line, 930 char *dest, 931 const char *src, 932 size_t maxlength); 933 char *alpha_strcpy_fn(const char *fn, 934 int line, 935 char *dest, 936 const char *src, 937 const char *other_safe_chars, 938 size_t maxlength); 939 char *StrnCpy_fn(const char *fn, int line,char *dest,const char *src,size_t n); 617 char *StrnCpy(char *dest,const char *src,size_t n); 940 618 bool in_list(const char *s, const char *list, bool casesensitive); 941 void string_free(char **s);942 bool string_set(char **dest,const char *src);943 void string_sub2(char *s,const char *pattern, const char *insert, size_t len,944 bool remove_unsafe_characters, bool replace_once,945 bool allow_trailing_dollar);946 void string_sub_once(char *s, const char *pattern,947 const char *insert, size_t len);948 void string_sub(char *s,const char *pattern, const char *insert, size_t len);949 619 void fstring_sub(char *s,const char *pattern,const char *insert); 950 620 char *realloc_string_sub2(char *string, … … 977 647 char *strnrchr_m(const char *s, char c, unsigned int n); 978 648 char *strstr_m(const char *src, const char *findstr); 979 voidstrlower_m(char *s);980 voidstrupper_m(char *s);649 bool strlower_m(char *s); 650 bool strupper_m(char *s); 981 651 size_t strlen_m(const char *s); 982 652 size_t strlen_m_term(const char *s); … … 992 662 int ipstr_list_parse(const char *ipstr_list, struct ip_service **ip_list); 993 663 void ipstr_list_free(char* ipstr_list); 994 DATA_BLOB base64_decode_data_blob(const char *s);995 void base64_decode_inplace(char *s);996 char *base64_encode_data_blob(TALLOC_CTX *mem_ctx, DATA_BLOB data);997 664 uint64_t STR_TO_SMB_BIG_UINT(const char *nptr, const char **entptr); 998 SMB_OFF_T conv_str_size(const char * str); 999 void string_append(char **left, const char *right); 1000 bool add_string_to_array(TALLOC_CTX *mem_ctx, 1001 const char *str, const char ***strings, 1002 int *num); 665 uint64_t conv_str_size(const char * str); 1003 666 void sprintf_append(TALLOC_CTX *mem_ctx, char **string, ssize_t *len, 1004 667 size_t *bufsize, const char *fmt, ...); … … 1006 669 char *talloc_asprintf_strupper_m(TALLOC_CTX *t, const char *fmt, ...); 1007 670 char *talloc_asprintf_strlower_m(TALLOC_CTX *t, const char *fmt, ...); 1008 char *sstring_sub(const char *src, char front, char back);1009 671 bool validate_net_name( const char *name, 1010 672 const char *invalid_chars, 1011 673 int max_len); 1012 674 char *escape_shell_string(const char *src); 1013 char **str_list_make_v3(TALLOC_CTX *mem_ctx, const char *string, const char *sep); 1014 char *sanitize_username(TALLOC_CTX *mem_ctx, const char *username); 1015 1016 /* The following definitions come from lib/util_unistr.c */ 1017 1018 void gfree_case_tables(void); 1019 void load_case_tables(void); 1020 size_t dos_PutUniCode(char *dst,const char *src, size_t len, bool null_terminate); 1021 int rpcstr_push(void *dest, const char *src, size_t dest_len, int flags); 1022 int rpcstr_push_talloc(TALLOC_CTX *ctx, smb_ucs2_t **dest, const char *src); 1023 bool isvalid83_w(smb_ucs2_t c); 1024 size_t strlen_w(const smb_ucs2_t *src); 1025 size_t strnlen_w(const smb_ucs2_t *src, size_t max); 1026 smb_ucs2_t *strchr_w(const smb_ucs2_t *s, smb_ucs2_t c); 1027 smb_ucs2_t *strchr_wa(const smb_ucs2_t *s, char c); 1028 smb_ucs2_t *strrchr_w(const smb_ucs2_t *s, smb_ucs2_t c); 1029 smb_ucs2_t *strnrchr_w(const smb_ucs2_t *s, smb_ucs2_t c, unsigned int n); 1030 smb_ucs2_t *strstr_w(const smb_ucs2_t *s, const smb_ucs2_t *ins); 1031 bool strlower_w(smb_ucs2_t *s); 1032 bool strupper_w(smb_ucs2_t *s); 1033 void strnorm_w(smb_ucs2_t *s, int case_default); 1034 int strcmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b); 1035 int strncmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b, size_t len); 1036 int strcasecmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b); 1037 int strncasecmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b, size_t len); 1038 bool strequal_w(const smb_ucs2_t *s1, const smb_ucs2_t *s2); 1039 bool strnequal_w(const smb_ucs2_t *s1,const smb_ucs2_t *s2,size_t n); 1040 smb_ucs2_t *strdup_w(const smb_ucs2_t *src); 1041 smb_ucs2_t *strndup_w(const smb_ucs2_t *src, size_t len); 1042 smb_ucs2_t *strncpy_w(smb_ucs2_t *dest, const smb_ucs2_t *src, const size_t max); 1043 smb_ucs2_t *strncat_w(smb_ucs2_t *dest, const smb_ucs2_t *src, const size_t max); 1044 smb_ucs2_t *strcat_w(smb_ucs2_t *dest, const smb_ucs2_t *src); 1045 void string_replace_w(smb_ucs2_t *s, smb_ucs2_t oldc, smb_ucs2_t newc); 1046 bool trim_string_w(smb_ucs2_t *s, const smb_ucs2_t *front, 1047 const smb_ucs2_t *back); 1048 int strcmp_wa(const smb_ucs2_t *a, const char *b); 1049 int strncmp_wa(const smb_ucs2_t *a, const char *b, size_t len); 1050 smb_ucs2_t *strpbrk_wa(const smb_ucs2_t *s, const char *p); 1051 smb_ucs2_t *strstr_wa(const smb_ucs2_t *s, const char *ins); 1052 smb_ucs2_t toupper_w(smb_ucs2_t v); 1053 bool isupper_w(smb_ucs2_t v); 1054 smb_ucs2_t tolower_w(smb_ucs2_t v); 1055 bool islower_w(smb_ucs2_t v); 675 ssize_t full_path_tos(const char *dir, const char *name, 676 char *tmpbuf, size_t tmpbuf_len, 677 char **pdst, char **to_free); 1056 678 1057 679 /* The following definitions come from lib/version.c */ … … 1068 690 void wins_srv_tags_free(char **list); 1069 691 struct in_addr wins_srv_ip_tag(const char *tag, struct in_addr src_ip); 692 bool wins_server_tag_ips(const char *tag, TALLOC_CTX *mem_ctx, 693 struct in_addr **pservers, int *pnum_servers); 1070 694 unsigned wins_srv_count_tag(const char *tag); 1071 1072 /* The following definitions come from libsmb/clispnego.c */1073 1074 DATA_BLOB spnego_gen_negTokenInit(TALLOC_CTX *ctx,1075 const char *OIDs[],1076 DATA_BLOB *psecblob,1077 const char *principal);1078 695 1079 696 #ifndef ASN1_MAX_OIDS … … 1085 702 char **principal, 1086 703 DATA_BLOB *secblob); 1087 DATA_BLOB spnego_gen_krb5_wrap(TALLOC_CTX *ctx, const DATA_BLOB ticket, const uint8 tok_id[2]); 1088 bool spnego_parse_krb5_wrap(TALLOC_CTX *ctx, DATA_BLOB blob, DATA_BLOB *ticket, uint8 tok_id[2]); 1089 int spnego_gen_krb5_negTokenInit(TALLOC_CTX *ctx, 1090 const char *principal, int time_offset, 1091 DATA_BLOB *targ, 1092 DATA_BLOB *session_key_krb5, uint32 extra_ap_opts, 1093 time_t *expire_time); 1094 bool spnego_parse_challenge(TALLOC_CTX *ctx, const DATA_BLOB blob, 1095 DATA_BLOB *chal1, DATA_BLOB *chal2); 1096 DATA_BLOB spnego_gen_auth(TALLOC_CTX *ctx, DATA_BLOB blob); 1097 bool spnego_parse_auth(TALLOC_CTX *ctx, DATA_BLOB blob, DATA_BLOB *auth); 1098 DATA_BLOB spnego_gen_auth_response(TALLOC_CTX *ctx, DATA_BLOB *reply, NTSTATUS nt_status, 1099 const char *mechOID); 1100 bool spnego_parse_auth_response(TALLOC_CTX *ctx, 1101 DATA_BLOB blob, NTSTATUS nt_status, 1102 const char *mechOID, 1103 DATA_BLOB *auth); 1104 1105 bool spnego_parse_auth_and_mic(TALLOC_CTX *ctx, DATA_BLOB blob, 1106 DATA_BLOB *auth, DATA_BLOB *signature); 1107 DATA_BLOB spnego_gen_auth_response_and_mic(TALLOC_CTX *ctx, 1108 NTSTATUS nt_status, 1109 const char *mechOID, 1110 DATA_BLOB *reply, 1111 DATA_BLOB *mechlistMIC); 1112 bool spnego_mech_list_blob(TALLOC_CTX *mem_ctx, 1113 char **oid_list, DATA_BLOB *data); 704 DATA_BLOB spnego_gen_krb5_wrap(TALLOC_CTX *ctx, const DATA_BLOB ticket, const uint8_t tok_id[2]); 1114 705 1115 706 /* The following definitions come from libsmb/conncache.c */ … … 1123 714 struct netr_DsRGetDCNameInfo; 1124 715 1125 void debug_dsdcinfo_flags(int lvl, uint32_t flags);1126 716 NTSTATUS dsgetdcname(TALLOC_CTX *mem_ctx, 1127 717 struct messaging_context *msg_ctx, … … 1134 724 /* The following definitions come from libsmb/errormap.c */ 1135 725 1136 NTSTATUS dos_to_ntstatus(uint8 eclass, uint32 ecode); 1137 void ntstatus_to_dos(NTSTATUS ntstatus, uint8 *eclass, uint32 *ecode); 1138 NTSTATUS werror_to_ntstatus(WERROR error); 1139 WERROR ntstatus_to_werror(NTSTATUS error); 1140 NTSTATUS map_nt_error_from_gss(uint32 gss_maj, uint32 minor); 726 NTSTATUS dos_to_ntstatus(uint8_t eclass, uint32_t ecode); 1141 727 1142 728 /* The following definitions come from libsmb/namecache.c */ … … 1166 752 bool saf_join_store( const char *domain, const char *servername ); 1167 753 bool saf_delete( const char *domain ); 1168 char *saf_fetch( const char *domain );754 char *saf_fetch(TALLOC_CTX *mem_ctx, const char *domain ); 1169 755 struct tevent_req *node_status_query_send(TALLOC_CTX *mem_ctx, 1170 756 struct tevent_context *ev, … … 1185 771 const struct sockaddr_storage *to_ss, 1186 772 fstring name); 1187 int ip_service_compare(struct ip_service *ss1, struct ip_service *ss2);773 int remove_duplicate_addrs2(struct ip_service *iplist, int count ); 1188 774 struct tevent_req *name_query_send(TALLOC_CTX *mem_ctx, 1189 775 struct tevent_context *ev, … … 1200 786 struct sockaddr_storage **addrs, 1201 787 int *num_addrs, uint8_t *flags); 788 struct tevent_req *name_resolve_bcast_send(TALLOC_CTX *mem_ctx, 789 struct tevent_context *ev, 790 const char *name, 791 int name_type); 792 NTSTATUS name_resolve_bcast_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, 793 struct sockaddr_storage **addrs, 794 int *num_addrs); 1202 795 NTSTATUS name_resolve_bcast(const char *name, 1203 796 int name_type, … … 1205 798 struct sockaddr_storage **return_iplist, 1206 799 int *return_count); 800 struct tevent_req *resolve_wins_send(TALLOC_CTX *mem_ctx, 801 struct tevent_context *ev, 802 const char *name, 803 int name_type); 804 NTSTATUS resolve_wins_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, 805 struct sockaddr_storage **addrs, 806 int *num_addrs, uint8_t *flags); 1207 807 NTSTATUS resolve_wins(const char *name, 1208 808 int name_type, 1209 struct ip_service **return_iplist, 809 TALLOC_CTX *mem_ctx, 810 struct sockaddr_storage **return_iplist, 1210 811 int *return_count); 1211 812 NTSTATUS internal_resolve_name(const char *name, … … 1214 815 struct ip_service **return_iplist, 1215 816 int *return_count, 1216 const char * resolve_order);817 const char **resolve_order); 1217 818 bool resolve_name(const char *name, 1218 819 struct sockaddr_storage *return_ss, … … 1243 844 struct sockaddr_storage *ss_out); 1244 845 1245 /* The following definitions come from libsmb/nterr.c */1246 1247 const char *nt_errstr(NTSTATUS nt_code);1248 const char *get_friendly_nt_error_msg(NTSTATUS nt_code);1249 const char *get_nt_error_c_code(NTSTATUS nt_code);1250 NTSTATUS nt_status_string_to_code(const char *nt_status_str);1251 NTSTATUS nt_status_squash(NTSTATUS nt_status);1252 1253 /* The following definitions come from libsmb/ntlmssp.c */1254 struct ntlmssp_state;1255 NTSTATUS ntlmssp_set_username(struct ntlmssp_state *ntlmssp_state, const char *user) ;1256 NTSTATUS ntlmssp_set_hashes(struct ntlmssp_state *ntlmssp_state,1257 const uint8_t lm_hash[16],1258 const uint8_t nt_hash[16]) ;1259 NTSTATUS ntlmssp_set_password(struct ntlmssp_state *ntlmssp_state, const char *password) ;1260 NTSTATUS ntlmssp_set_domain(struct ntlmssp_state *ntlmssp_state, const char *domain) ;1261 void ntlmssp_want_feature_list(struct ntlmssp_state *ntlmssp_state, char *feature_list);1262 void ntlmssp_want_feature(struct ntlmssp_state *ntlmssp_state, uint32_t feature);1263 bool ntlmssp_have_feature(struct ntlmssp_state *ntlmssp_state, uint32_t feature);1264 NTSTATUS ntlmssp_update(struct ntlmssp_state *ntlmssp_state,1265 const DATA_BLOB in, DATA_BLOB *out) ;1266 NTSTATUS ntlmssp_server_start(TALLOC_CTX *mem_ctx,1267 bool is_standalone,1268 const char *netbios_name,1269 const char *netbios_domain,1270 const char *dns_name,1271 const char *dns_domain,1272 struct ntlmssp_state **ntlmssp_state);1273 NTSTATUS ntlmssp_client_start(TALLOC_CTX *mem_ctx,1274 const char *netbios_name,1275 const char *netbios_domain,1276 bool use_ntlmv2,1277 struct ntlmssp_state **_ntlmssp_state);1278 1279 846 /* The following definitions come from libsmb/passchange.c */ 1280 847 … … 1294 861 /* The following definitions come from libsmb/smberr.c */ 1295 862 1296 const char *smb_dos_err_name(uint8 e_class, uint16num);863 const char *smb_dos_err_name(uint8_t e_class, uint16_t num); 1297 864 const char *get_dos_error_msg(WERROR result); 1298 const char *smb_dos_err_class(uint8 e_class); 1299 char *smb_dos_errstr(char *inbuf); 865 const char *smb_dos_err_class(uint8_t e_class); 1300 866 WERROR map_werror_from_unix(int error); 1301 867 … … 1304 870 bool trustdom_cache_enable(void); 1305 871 bool trustdom_cache_shutdown(void); 1306 bool trustdom_cache_store(c har* name, char* alt_name, const struct dom_sid *sid,1307 872 bool trustdom_cache_store(const char *name, const char *alt_name, 873 const struct dom_sid *sid, time_t timeout); 1308 874 bool trustdom_cache_fetch(const char* name, struct dom_sid* sid); 1309 uint32 trustdom_cache_fetch_timestamp( void );1310 bool trustdom_cache_store_timestamp( uint32 t, time_t timeout );875 uint32_t trustdom_cache_fetch_timestamp( void ); 876 bool trustdom_cache_store_timestamp( uint32_t t, time_t timeout ); 1311 877 void trustdom_cache_flush(void); 1312 878 void update_trustdom_cache( void ); … … 1314 880 /* The following definitions come from libsmb/trusts_util.c */ 1315 881 1316 NTSTATUS trust_pw_change_and_store_it(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, 1317 const char *domain, 1318 const char *account_name, 1319 unsigned char orig_trust_passwd_hash[16], 1320 enum netr_SchannelType sec_channel_type); 1321 NTSTATUS trust_pw_find_change_and_store_it(struct rpc_pipe_client *cli, 1322 TALLOC_CTX *mem_ctx, 1323 const char *domain) ; 1324 bool enumerate_domain_trusts( TALLOC_CTX *mem_ctx, const char *domain, 1325 char ***domain_names, uint32 *num_domains, 1326 struct dom_sid **sids ); 1327 NTSTATUS change_trust_account_password( const char *domain, const char *remote_machine); 882 struct netlogon_creds_cli_context; 883 struct messaging_context; 884 struct dcerpc_binding_handle; 885 NTSTATUS trust_pw_change(struct netlogon_creds_cli_context *context, 886 struct messaging_context *msg_ctx, 887 struct dcerpc_binding_handle *b, 888 const char *domain, 889 bool force); 1328 890 1329 891 /* The following definitions come from param/loadparm.c */ 1330 892 1331 char *lp_smb_ports(void); 1332 const char *lp_dos_charset(void); 1333 const char *lp_unix_charset(void); 1334 const char *lp_display_charset(void); 1335 char *lp_logfile(void); 1336 char *lp_configfile(void); 1337 char *lp_smb_passwd_file(void); 1338 char *lp_private_dir(void); 1339 char *lp_serverstring(void); 1340 int lp_printcap_cache_time(void); 1341 char *lp_addport_cmd(void); 1342 char *lp_enumports_cmd(void); 1343 char *lp_addprinter_cmd(void); 1344 char *lp_deleteprinter_cmd(void); 1345 char *lp_os2_driver_map(void); 1346 char *lp_lockdir(void); 1347 char *lp_statedir(void); 1348 char *lp_cachedir(void); 1349 char *lp_piddir(void); 1350 char *lp_mangling_method(void); 1351 int lp_mangle_prefix(void); 1352 char *lp_utmpdir(void); 1353 char *lp_wtmpdir(void); 1354 bool lp_utmp(void); 1355 char *lp_rootdir(void); 1356 char *lp_defaultservice(void); 1357 char *lp_msg_command(void); 1358 char *lp_get_quota_command(void); 1359 char *lp_set_quota_command(void); 1360 char *lp_auto_services(void); 1361 char *lp_passwd_program(void); 1362 char *lp_passwd_chat(void); 1363 char *lp_passwordserver(void); 1364 char *lp_name_resolve_order(void); 1365 char *lp_realm(void); 1366 const char *lp_afs_username_map(void); 1367 int lp_afs_token_lifetime(void); 1368 char *lp_log_nt_token_command(void); 1369 char *lp_username_map(void); 1370 const char *lp_logon_script(void); 1371 const char *lp_logon_path(void); 1372 const char *lp_logon_drive(void); 1373 const char *lp_logon_home(void); 1374 char *lp_remote_announce(void); 1375 char *lp_remote_browse_sync(void); 1376 bool lp_nmbd_bind_explicit_broadcast(void); 1377 const char **lp_wins_server_list(void); 1378 const char **lp_interfaces(void); 1379 const char *lp_socket_address(void); 1380 char *lp_nis_home_map_name(void); 1381 const char **lp_netbios_aliases(void); 1382 const char *lp_passdb_backend(void); 1383 const char **lp_preload_modules(void); 1384 char *lp_panic_action(void); 1385 char *lp_adduser_script(void); 1386 char *lp_renameuser_script(void); 1387 char *lp_deluser_script(void); 1388 const char *lp_guestaccount(void); 1389 char *lp_addgroup_script(void); 1390 char *lp_delgroup_script(void); 1391 char *lp_addusertogroup_script(void); 1392 char *lp_deluserfromgroup_script(void); 1393 char *lp_setprimarygroup_script(void); 1394 char *lp_addmachine_script(void); 1395 char *lp_shutdown_script(void); 1396 char *lp_abort_shutdown_script(void); 1397 char *lp_username_map_script(void); 1398 int lp_username_map_cache_time(void); 1399 char *lp_check_password_script(void); 1400 char *lp_wins_hook(void); 1401 const char *lp_template_homedir(void); 1402 const char *lp_template_shell(void); 1403 const char *lp_winbind_separator(void); 1404 int lp_acl_compatibility(void); 1405 bool lp_winbind_enum_users(void); 1406 bool lp_winbind_enum_groups(void); 1407 bool lp_winbind_use_default_domain(void); 1408 bool lp_winbind_trusted_domains_only(void); 1409 bool lp_winbind_nested_groups(void); 1410 int lp_winbind_expand_groups(void); 1411 bool lp_winbind_refresh_tickets(void); 1412 bool lp_winbind_offline_logon(void); 1413 bool lp_winbind_normalize_names(void); 1414 bool lp_winbind_rpc_only(void); 1415 bool lp_create_krb5_conf(void); 893 #include "source3/param/param_proto.h" 894 895 char *lp_servicename(TALLOC_CTX *ctx, int); 896 const char *lp_const_servicename(int); 897 bool lp_autoloaded(int); 898 const char *lp_dnsdomain(void); 1416 899 int lp_winbind_max_domain_connections(void); 1417 const char *lp_idmap_backend(void); 1418 int lp_idmap_cache_time(void); 1419 int lp_idmap_negative_cache_time(void); 1420 int lp_keepalive(void); 1421 bool lp_passdb_expand_explicit(void); 1422 char *lp_ldap_suffix(void); 1423 char *lp_ldap_admin_dn(void); 1424 int lp_ldap_ssl(void); 1425 bool lp_ldap_ssl_ads(void); 1426 int lp_ldap_deref(void); 1427 int lp_ldap_follow_referral(void); 1428 int lp_ldap_passwd_sync(void); 1429 bool lp_ldap_delete_dn(void); 1430 int lp_ldap_replication_sleep(void); 1431 int lp_ldap_timeout(void); 1432 int lp_ldap_connection_timeout(void); 1433 int lp_ldap_page_size(void); 1434 int lp_ldap_debug_level(void); 1435 int lp_ldap_debug_threshold(void); 1436 char *lp_add_share_cmd(void); 1437 char *lp_change_share_cmd(void); 1438 char *lp_delete_share_cmd(void); 1439 char *lp_usershare_path(void); 1440 const char **lp_usershare_prefix_allow_list(void); 1441 const char **lp_usershare_prefix_deny_list(void); 1442 const char **lp_eventlog_list(void); 1443 bool lp_registry_shares(void); 1444 bool lp_usershare_allow_guests(void); 1445 bool lp_usershare_owner_only(void); 1446 bool lp_disable_netbios(void); 1447 bool lp_reset_on_zero_vc(void); 1448 bool lp_log_writeable_files_on_exit(void); 1449 bool lp_ms_add_printer_wizard(void); 1450 bool lp_dns_proxy(void); 1451 bool lp_wins_support(void); 1452 bool lp_we_are_a_wins_server(void); 1453 bool lp_wins_proxy(void); 1454 bool lp_local_master(void); 1455 bool lp_domain_logons(void); 1456 const char **lp_init_logon_delayed_hosts(void); 1457 int lp_init_logon_delay(void); 1458 bool lp_load_printers(void); 1459 bool lp_readraw(void); 1460 bool _lp_readraw(void); 1461 bool lp_large_readwrite(void); 1462 bool lp_writeraw(void); 1463 bool _lp_writeraw(void); 1464 bool lp_null_passwords(void); 1465 bool lp_obey_pam_restrictions(void); 1466 bool lp_encrypted_passwords(void); 1467 int lp_client_schannel(void); 1468 int lp_server_schannel(void); 1469 bool lp_syslog_only(void); 1470 bool lp_timestamp_logs(void); 1471 bool lp_debug_prefix_timestamp(void); 1472 bool lp_debug_hires_timestamp(void); 1473 bool lp_debug_pid(void); 1474 bool lp_debug_uid(void); 1475 bool lp_debug_class(void); 1476 bool lp_enable_core_files(void); 1477 bool lp_browse_list(void); 1478 bool lp_nis_home_map(void); 1479 bool lp_bind_interfaces_only(void); 1480 bool lp_pam_password_change(void); 1481 bool lp_unix_password_sync(void); 1482 bool lp_passwd_chat_debug(void); 1483 int lp_passwd_chat_timeout(void); 1484 bool lp_nt_pipe_support(void); 1485 bool lp_nt_status_support(void); 1486 bool lp_stat_cache(void); 1487 int lp_max_stat_cache_size(void); 1488 bool lp_allow_trusted_domains(void); 1489 bool lp_map_untrusted_to_domain(void); 1490 int lp_restrict_anonymous(void); 1491 bool lp_lanman_auth(void); 1492 bool lp_ntlm_auth(void); 1493 bool lp_raw_ntlmv2_auth(void); 1494 bool lp_client_plaintext_auth(void); 1495 bool lp_client_lanman_auth(void); 1496 bool lp_client_ntlmv2_auth(void); 1497 bool lp_host_msdfs(void); 1498 bool lp_kernel_oplocks(void); 1499 bool lp_enhanced_browsing(void); 1500 bool lp_use_mmap(void); 1501 bool lp_unix_extensions(void); 1502 bool lp_use_spnego(void); 1503 bool lp_client_use_spnego(void); 1504 bool lp_client_use_spnego_principal(void); 1505 bool lp_send_spnego_principal(void); 1506 bool lp_hostname_lookups(void); 1507 bool lp_change_notify(const struct share_params *p ); 1508 bool lp_kernel_change_notify(const struct share_params *p ); 1509 char * lp_dedicated_keytab_file(void); 1510 int lp_kerberos_method(void); 1511 bool lp_defer_sharing_violations(void); 1512 bool lp_enable_privileges(void); 1513 bool lp_enable_asu_support(void); 1514 int lp_os_level(void); 1515 int lp_max_ttl(void); 1516 int lp_max_wins_ttl(void); 1517 int lp_min_wins_ttl(void); 1518 int lp_max_log_size(void); 1519 int lp_max_open_files(void); 1520 int lp_open_files_db_hash_size(void); 1521 int lp_maxxmit(void); 1522 int lp_maxmux(void); 1523 int lp_passwordlevel(void); 1524 int lp_usernamelevel(void); 1525 int lp_deadtime(void); 1526 bool lp_getwd_cache(void); 1527 int lp_maxprotocol(void); 1528 int lp_minprotocol(void); 900 bool lp_idmap_range(const char *domain_name, uint32_t *low, uint32_t *high); 901 bool lp_idmap_default_range(uint32_t *low, uint32_t *high); 902 const char *lp_idmap_backend(const char *domain_name); 903 const char *lp_idmap_default_backend (void); 1529 904 int lp_security(void); 1530 const char **lp_auth_methods(void); 1531 bool lp_paranoid_server_security(void); 1532 int lp_maxdisksize(void); 1533 int lp_lpqcachetime(void); 1534 int lp_max_smbd_processes(void); 1535 bool _lp_disable_spoolss(void); 1536 int lp_syslog(void); 1537 int lp_lm_announce(void); 1538 int lp_lm_interval(void); 1539 int lp_machine_password_timeout(void); 1540 int lp_map_to_guest(void); 1541 int lp_oplock_break_wait_time(void); 1542 int lp_lock_spin_time(void); 1543 int lp_usershare_max_shares(void); 1544 const char *lp_socket_options(void); 1545 int lp_config_backend(void); 1546 int lp_smb2_max_read(void); 1547 int lp_smb2_max_write(void); 1548 int lp_smb2_max_trans(void); 905 int lp_client_max_protocol(void); 906 int lp_client_ipc_min_protocol(void); 907 int lp_client_ipc_max_protocol(void); 908 int lp_client_ipc_signing(void); 1549 909 int lp_smb2_max_credits(void); 1550 char *lp_preexec(int );1551 char *lp_postexec(int );1552 char *lp_rootpreexec(int );1553 char *lp_rootpostexec(int );1554 char *lp_servicename(int );1555 const char *lp_const_servicename(int );1556 char *lp_pathname(int );1557 char *lp_dontdescend(int );1558 char *lp_username(int );1559 const char **lp_invalid_users(int );1560 const char **lp_valid_users(int );1561 const char **lp_admin_users(int );1562 const char **lp_svcctl_list(void);1563 char *lp_cups_options(int );1564 char *lp_cups_server(void);1565 910 int lp_cups_encrypt(void); 1566 char *lp_iprint_server(void);1567 int lp_cups_connection_timeout(void);1568 const char *lp_ctdbd_socket(void);1569 const char **lp_cluster_addresses(void);1570 bool lp_clustering(void);1571 int lp_ctdb_timeout(void);1572 int lp_ctdb_locktime_warn_threshold(void);1573 char *lp_printcommand(int );1574 char *lp_lpqcommand(int );1575 char *lp_lprmcommand(int );1576 char *lp_lppausecommand(int );1577 char *lp_lpresumecommand(int );1578 char *lp_queuepausecommand(int );1579 char *lp_queueresumecommand(int );1580 const char *lp_printjob_username(int );1581 const char **lp_hostsallow(int );1582 const char **lp_hostsdeny(int );1583 char *lp_magicscript(int );1584 char *lp_magicoutput(int );1585 char *lp_comment(int );1586 char *lp_force_user(int );1587 char *lp_force_group(int );1588 const char **lp_readlist(int );1589 const char **lp_writelist(int );1590 const char **lp_printer_admin(int );1591 char *lp_fstype(int );1592 const char **lp_vfs_objects(int );1593 char *lp_msdfs_proxy(int );1594 char *lp_veto_files(int );1595 char *lp_hide_files(int );1596 char *lp_veto_oplocks(int );1597 bool lp_msdfs_root(int );1598 char *lp_aio_write_behind(int );1599 char *lp_dfree_command(int );1600 bool lp_autoloaded(int );1601 bool lp_preexec_close(int );1602 bool lp_rootpreexec_close(int );1603 int lp_casesensitive(int );1604 bool lp_preservecase(int );1605 bool lp_shortpreservecase(int );1606 bool lp_hide_dot_files(int );1607 bool lp_hide_special_files(int );1608 bool lp_hideunreadable(int );1609 bool lp_hideunwriteable_files(int );1610 bool lp_browseable(int );1611 bool lp_access_based_share_enum(int );1612 bool lp_readonly(int );1613 bool lp_no_set_dir(int );1614 bool lp_guest_ok(int );1615 bool lp_guest_only(int );1616 bool lp_administrative_share(int );1617 bool lp_print_ok(int );1618 bool lp_print_notify_backchannel(int );1619 bool lp_map_hidden(int );1620 bool lp_map_archive(int );1621 bool lp_store_dos_attributes(int );1622 bool lp_dmapi_support(int );1623 bool lp_locking(const struct share_params *p );1624 int lp_strict_locking(const struct share_params *p );1625 bool lp_posix_locking(const struct share_params *p );1626 bool lp_share_modes(int );1627 bool lp_oplocks(int );1628 bool lp_level2_oplocks(int );1629 bool lp_onlyuser(int );1630 bool lp_manglednames(const struct share_params *p );1631 bool lp_allow_insecure_widelinks(void);1632 911 bool lp_widelinks(int ); 1633 bool lp_symlinks(int ); 1634 bool lp_syncalways(int ); 1635 bool lp_strict_allocate(int ); 1636 bool lp_strict_sync(int ); 1637 bool lp_map_system(int ); 1638 bool lp_delete_readonly(int ); 1639 bool lp_fake_oplocks(int ); 1640 bool lp_recursive_veto_delete(int ); 1641 bool lp_dos_filemode(int ); 1642 bool lp_dos_filetimes(int ); 1643 bool lp_dos_filetime_resolution(int ); 1644 bool lp_fake_dir_create_times(int); 1645 bool lp_async_smb_echo_handler(void); 1646 bool lp_multicast_dns_register(void); 1647 bool lp_blocking_locks(int ); 1648 bool lp_inherit_perms(int ); 1649 bool lp_inherit_acls(int ); 1650 bool lp_inherit_owner(int ); 1651 bool lp_use_client_driver(int ); 1652 bool lp_default_devmode(int ); 1653 bool lp_force_printername(int ); 1654 bool lp_nt_acl_support(int ); 1655 bool lp_force_unknown_acl_user(int ); 1656 bool lp_ea_support(int ); 1657 bool _lp_use_sendfile(int ); 1658 bool lp_profile_acls(int ); 1659 bool lp_map_acl_inherit(int ); 1660 bool lp_afs_share(int ); 1661 bool lp_acl_check_permissions(int ); 1662 bool lp_acl_group_control(int ); 1663 bool lp_acl_map_full_control(int ); 1664 int lp_create_mask(int ); 1665 int lp_force_create_mode(int ); 1666 int lp_security_mask(int ); 1667 int lp_force_security_mode(int ); 1668 int lp_dir_mask(int ); 1669 int lp_force_dir_mode(int ); 1670 int lp_dir_security_mask(int ); 1671 int lp_force_dir_security_mode(int ); 1672 int lp_max_connections(int ); 1673 int lp_defaultcase(int ); 1674 int lp_minprintspace(int ); 1675 int lp_printing(int ); 1676 int lp_max_reported_jobs(int ); 1677 int lp_oplock_contention_limit(int ); 1678 int lp_csc_policy(int ); 1679 int lp_write_cache_size(int ); 1680 int lp_block_size(int ); 1681 int lp_dfree_cache_time(int ); 1682 int lp_allocation_roundup_size(int ); 1683 int lp_aio_read_size(int ); 1684 int lp_aio_write_size(int ); 1685 int lp_map_readonly(int ); 1686 int lp_directory_name_cache_size(int ); 1687 int lp_smb_encrypt(int ); 1688 char lp_magicchar(const struct share_params *p ); 1689 int lp_winbind_cache_time(void); 1690 int lp_winbind_reconnect_delay(void); 1691 int lp_winbind_max_clients(void); 1692 const char **lp_winbind_nss_info(void); 1693 bool lp_winbind_sealed_pipes(void); 1694 int lp_algorithmic_rid_base(void); 1695 int lp_name_cache_timeout(void); 1696 int lp_client_signing(void); 1697 int lp_client_ipc_signing(void); 1698 int lp_server_signing(void); 1699 int lp_client_ldap_sasl_wrapping(void); 1700 char *lp_parm_talloc_string(int snum, const char *type, const char *option, const char *def); 912 913 int lp_wi_scan_global_parametrics( 914 const char *regex, size_t max_matches, 915 bool (*cb)(const char *string, regmatch_t matches[], 916 void *private_data), 917 void *private_data); 918 919 char *lp_parm_talloc_string(TALLOC_CTX *ctx, int snum, const char *type, const char *option, const char *def); 1701 920 const char *lp_parm_const_string(int snum, const char *type, const char *option, const char *def); 921 struct loadparm_service; 922 const char *lp_parm_const_string_service(struct loadparm_service *service, const char *type, 923 const char *option, const char *def); 1702 924 const char **lp_parm_string_list(int snum, const char *type, const char *option, const char **def); 1703 925 int lp_parm_int(int snum, const char *type, const char *option, int def); 1704 926 unsigned long lp_parm_ulong(int snum, const char *type, const char *option, unsigned long def); 927 unsigned long long lp_parm_ulonglong(int snum, const char *type, 928 const char *option, 929 unsigned long long def); 1705 930 bool lp_parm_bool(int snum, const char *type, const char *option, bool def); 931 struct enum_list; 1706 932 int lp_parm_enum(int snum, const char *type, const char *option, 1707 933 const struct enum_list *_enum, int def); … … 1713 939 bool lp_parameter_is_valid(const char *pszParmName); 1714 940 bool lp_parameter_is_global(const char *pszParmName); 1715 bool lp_parameter_is_canonical(const char *parm_name);1716 941 bool lp_canonicalize_parameter(const char *parm_name, const char **canon_parm, 1717 942 bool *inverse); … … 1721 946 const char **canon_val); 1722 947 void show_parameter_list(void); 1723 bool lp_string_is_valid_boolean(const char *parm_value);1724 948 bool lp_invert_boolean(const char *str, const char **inverse_str); 1725 949 bool lp_canonicalize_boolean(const char *str, const char**canon_str); 1726 bool service_ok(int iService);1727 950 bool process_registry_service(const char *service_name); 1728 951 bool process_registry_shares(void); … … 1730 953 bool lp_config_backend_is_file(void); 1731 954 bool lp_file_list_changed(void); 1732 bool lp_idmap_uid(uid_t *low, uid_t *high); 1733 bool lp_idmap_gid(gid_t *low, gid_t *high); 1734 const char *lp_ldap_machine_suffix(void); 1735 const char *lp_ldap_user_suffix(void); 1736 const char *lp_ldap_group_suffix(void); 1737 const char *lp_ldap_idmap_suffix(void); 1738 void *lp_local_ptr_by_snum(int snum, void *ptr); 955 const char *lp_ldap_machine_suffix(TALLOC_CTX *ctx); 956 const char *lp_ldap_user_suffix(TALLOC_CTX *ctx); 957 const char *lp_ldap_group_suffix(TALLOC_CTX *ctx); 958 const char *lp_ldap_idmap_suffix(TALLOC_CTX *ctx); 959 struct parm_struct; 960 /* Return a pointer to a service by name. */ 961 struct loadparm_service *lp_service(const char *pszServiceName); 962 struct loadparm_service *lp_servicebynum(int snum); 963 struct loadparm_service *lp_default_loadparm_service(void); 964 void *lp_parm_ptr(struct loadparm_service *service, struct parm_struct *parm); 965 void *lp_local_ptr_by_snum(int snum, struct parm_struct *parm); 1739 966 bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue); 1740 967 bool lp_set_cmdline(const char *pszParmName, const char *pszParmValue); 1741 bool lp_set_option(const char *option);1742 void init_locals(void);1743 bool lp_is_default(int snum, struct parm_struct *parm);1744 968 bool dump_a_parameter(int snum, char *parm_name, FILE * f, bool isGlobal); 1745 struct parm_struct *lp_get_parameter(const char *param_name);1746 struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters);1747 969 bool lp_snum_ok(int iService); 1748 970 void lp_add_one_printer(const char *name, const char *comment, 1749 971 const char *location, void *pdata); 1750 972 bool lp_loaded(void); 1751 void lp_killunused(bool (*snumused) (int)); 973 void lp_killunused(struct smbd_server_connection *sconn, 974 bool (*snumused) (struct smbd_server_connection *, int)); 1752 975 void lp_kill_all_services(void); 1753 976 void lp_killservice(int iServiceIn); 1754 const char* server_role_str(uint32 role);977 const char* server_role_str(uint32_t role); 1755 978 enum usershare_err parse_usershare_file(TALLOC_CTX *ctx, 1756 979 SMB_STRUCT_STAT *psbuf, … … 1765 988 bool *pallow_guest); 1766 989 int load_usershare_service(const char *servicename); 1767 int load_usershare_shares(void); 990 int load_usershare_shares(struct smbd_server_connection *sconn, 991 bool (*snumused) (struct smbd_server_connection *, int)); 1768 992 void gfree_loadparm(void); 1769 void lp_set_in_client(bool b);1770 bool lp_is_in_client(void);1771 bool lp_load(const char *pszFname,1772 bool global_only,1773 bool save_defaults,1774 bool add_ipc,1775 bool initialize_globals);1776 993 bool lp_load_initial_only(const char *pszFname); 1777 bool lp_load_with_registry_shares(const char *pszFname, 1778 bool global_only, 1779 bool save_defaults, 1780 bool add_ipc, 1781 bool initialize_globals); 994 bool lp_load_global(const char *file_name); 995 bool lp_load_with_shares(const char *file_name); 996 bool lp_load_client(const char *file_name); 997 bool lp_load_global_no_reinit(const char *file_name); 998 bool lp_load_no_reinit(const char *file_name); 999 bool lp_load_client_no_reinit(const char *file_name); 1000 bool lp_load_with_registry_shares(const char *pszFname); 1782 1001 int lp_numservices(void); 1783 1002 void lp_dump(FILE *f, bool show_defaults, int maxtoprint); 1784 1003 void lp_dump_one(FILE * f, bool show_defaults, int snum); 1785 1004 int lp_servicenumber(const char *pszServiceName); 1786 bool share_defined(const char *service_name); 1787 struct share_params *get_share_params(TALLOC_CTX *mem_ctx, 1788 const char *sharename); 1789 struct share_iterator *share_list_all(TALLOC_CTX *mem_ctx); 1790 struct share_params *next_share(struct share_iterator *list); 1791 struct share_params *next_printer(struct share_iterator *list); 1792 struct share_params *snum2params_static(int snum); 1793 const char *volume_label(int snum); 1005 const char *volume_label(TALLOC_CTX *ctx, int snum); 1794 1006 bool lp_domain_master(void); 1795 bool lp_domain_master_true_or_auto(void);1796 1007 bool lp_preferred_master(void); 1797 1008 void lp_remove_service(int snum); 1798 1009 void lp_copy_service(int snum, const char *new_name); 1799 1010 int lp_default_server_announce(void); 1800 int lp_major_announce_version(void); 1801 int lp_minor_announce_version(void); 1802 void lp_set_name_resolve_order(const char *new_order); 1803 const char *lp_printername(int snum); 1011 const char *lp_printername(TALLOC_CTX *ctx, int snum); 1804 1012 void lp_set_logfile(const char *name); 1805 1013 int lp_maxprintjobs(int snum); 1806 1014 const char *lp_printcapname(void); 1807 1015 bool lp_disable_spoolss( void ); 1808 void lp_set_spoolss_state( uint32 state );1809 uint32 lp_get_spoolss_state( void );1016 void lp_set_spoolss_state( uint32_t state ); 1017 uint32_t lp_get_spoolss_state( void ); 1810 1018 struct smb_signing_state; 1811 1019 bool lp_use_sendfile(int snum, struct smb_signing_state *signing_state); 1812 1020 void set_use_sendfile(int snum, bool val); 1813 void set_store_dos_attributes(int snum, bool val);1814 1021 void lp_set_mangling_method(const char *new_method); 1815 1022 bool lp_posix_pathnames(void); … … 1818 1025 void lp_set_posix_default_cifsx_readwrite_locktype(enum brl_flavour val); 1819 1026 int lp_min_receive_file_size(void); 1820 char* lp_perfcount_module(void); 1821 void lp_set_passdb_backend(const char *backend); 1027 char* lp_perfcount_module(TALLOC_CTX *ctx); 1822 1028 void widelinks_warning(int snum); 1823 char *lp_ncalrpc_dir(void); 1824 bool lp_allow_dcerpc_auth_level_connect(void); 1029 const char *lp_ncalrpc_dir(void); 1030 void _lp_set_server_role(int server_role); 1031 1032 /* The following definitions come from param/loadparm_ctx.c */ 1033 1034 const struct loadparm_s3_helpers *loadparm_s3_helpers(void); 1825 1035 1826 1036 /* The following definitions come from param/loadparm_server_role.c */ … … 1831 1041 /* The following definitions come from param/util.c */ 1832 1042 1833 uint32 get_int_param( const char* param );1043 uint32_t get_int_param( const char* param ); 1834 1044 char* get_string_param( const char* param ); 1835 1045 … … 1842 1052 /* The following definitions come from lib/sessionid_tdb.c */ 1843 1053 struct sessionid; 1844 bool sessionid_init(void); 1845 bool sessionid_init_readonly(void); 1846 struct db_record *sessionid_fetch_record(TALLOC_CTX *mem_ctx, const char *key); 1847 int sessionid_traverse(int (*fn)(struct db_record *rec, const char *key, 1848 struct sessionid *session, 1849 void *private_data), 1850 void *private_data); 1851 int sessionid_traverse_read(int (*fn)(const char *key, 1852 struct sessionid *session, 1853 void *private_data), 1854 void *private_data); 1054 NTSTATUS sessionid_traverse_read(int (*fn)(const char *key, 1055 struct sessionid *session, 1056 void *private_data), 1057 void *private_data); 1855 1058 1856 1059 /* The following definitions come from utils/passwd_util.c */ … … 1934 1137 bool lookup_unix_group_name(const char *name, struct dom_sid *sid); 1935 1138 1139 /* The following definitions come from lib/util_specialsids.c */ 1140 bool sid_check_is_asserted_identity(const struct dom_sid *sid); 1141 bool sid_check_is_in_asserted_identity(const struct dom_sid *sid); 1142 const char *asserted_identity_domain_name(void); 1143 1936 1144 /* The following definitions come from lib/filename_util.c */ 1937 1145 1938 1146 NTSTATUS get_full_smb_filename(TALLOC_CTX *ctx, const struct smb_filename *smb_fname, 1939 1147 char **full_name); 1940 NTSTATUS create_synthetic_smb_fname(TALLOC_CTX *ctx, const char *base_name, 1941 const char *stream_name, 1942 const SMB_STRUCT_STAT *psbuf, 1943 struct smb_filename **smb_fname_out); 1944 NTSTATUS create_synthetic_smb_fname_split(TALLOC_CTX *ctx, 1945 const char *fname, 1946 const SMB_STRUCT_STAT *psbuf, 1947 struct smb_filename **smb_fname_out); 1148 struct smb_filename *synthetic_smb_fname(TALLOC_CTX *mem_ctx, 1149 const char *base_name, 1150 const char *stream_name, 1151 const SMB_STRUCT_STAT *psbuf); 1152 struct smb_filename *synthetic_smb_fname_split(TALLOC_CTX *ctx, 1153 const char *fname, 1154 const SMB_STRUCT_STAT *psbuf); 1948 1155 const char *smb_fname_str_dbg(const struct smb_filename *smb_fname); 1949 1156 const char *fsp_str_dbg(const struct files_struct *fsp); 1950 NTSTATUS copy_smb_filename(TALLOC_CTX *ctx, 1951 const struct smb_filename *smb_fname_in,1952 struct smb_filename **smb_fname_out);1157 const char *fsp_fnum_dbg(const struct files_struct *fsp); 1158 struct smb_filename *cp_smb_filename(TALLOC_CTX *mem_ctx, 1159 const struct smb_filename *in); 1953 1160 bool is_ntfs_stream_smb_fname(const struct smb_filename *smb_fname); 1954 1161 bool is_ntfs_default_stream_smb_fname(const struct smb_filename *smb_fname); 1162 bool is_invalid_windows_ea_name(const char *name); 1163 bool ea_list_has_invalid_name(struct ea_list *ea_list); 1955 1164 1956 1165 /* The following definitions come from lib/dummyroot.c */ … … 1959 1168 void unbecome_root(void); 1960 1169 1961 /* The following definitions come from lib/ dummysmbd.c */1170 /* The following definitions come from lib/smbd_shim.c */ 1962 1171 1963 1172 int find_service(TALLOC_CTX *ctx, const char *service_in, char **p_service_out); 1964 bool conn_snum_used(int snum);1965 1173 void cancel_pending_lock_requests_by_fid(files_struct *fsp, 1966 1174 struct byte_range_lock *br_lck, … … 1970 1178 NTSTATUS can_delete_directory_fsp(files_struct *fsp); 1971 1179 bool change_to_root_user(void); 1972 struct event_context *smbd_event_context(void); 1180 bool become_authenticated_pipe_user(struct auth_session_info *session_info); 1181 bool unbecome_authenticated_pipe_user(void); 1182 1973 1183 void contend_level2_oplocks_begin(files_struct *fsp, 1974 1184 enum level2_contention_type type); -
vendor/current/source3/include/registry.h
r740 r988 46 46 bool (*store_subkeys)( const char *key, struct regsubkey_ctr *subkeys ); 47 47 WERROR (*create_subkey)(const char *key, const char *subkey); 48 WERROR (*delete_subkey)(const char *key, const char *subkey );48 WERROR (*delete_subkey)(const char *key, const char *subkey, bool lazy); 49 49 bool (*store_values)( const char *key, struct regval_ctr *val ); 50 bool (*reg_access_check)( const char *keyname, uint32 requested,51 uint32 *granted,50 bool (*reg_access_check)( const char *keyname, uint32_t requested, 51 uint32_t *granted, 52 52 const struct security_token *token ); 53 53 WERROR (*get_secdesc)(TALLOC_CTX *mem_ctx, const char *key, … … 62 62 63 63 struct registry_key_handle { 64 uint32 64 uint32_t type; 65 65 char *name; /* full name of registry key */ 66 uint32 66 uint32_t access_granted; 67 67 struct registry_ops *ops; 68 68 }; -
vendor/current/source3/include/rpc_misc.h
r740 r988 29 29 30 30 #define OUR_HANDLE(hnd) (((hnd)==NULL) ? "NULL" :\ 31 ( IVAL((hnd)->uuid.node,2) == (uint32 )sys_getpid() ? "OURS" : \31 ( IVAL((hnd)->uuid.node,2) == (uint32_t)getpid() ? "OURS" : \ 32 32 "OTHER")), ((unsigned int)IVAL((hnd)->uuid.node,2)),\ 33 ((unsigned int) sys_getpid() )33 ((unsigned int)getpid() ) 34 34 35 35 #endif /* _RPC_MISC_H */ -
vendor/current/source3/include/safe_string.h
r740 r988 63 63 #endif /* !_SPLINT_ */ 64 64 65 #ifdef DEVELOPER 66 #define SAFE_STRING_FUNCTION_NAME __FUNCTION__ 67 #define SAFE_STRING_LINE __LINE__ 68 #else 69 #define SAFE_STRING_FUNCTION_NAME ("") 70 #define SAFE_STRING_LINE (0) 71 #endif 72 73 /* We need a number of different prototypes for our 74 non-existant fuctions */ 75 char * __unsafe_string_function_usage_here__(void); 76 77 size_t __unsafe_string_function_usage_here_size_t__(void); 78 79 size_t __unsafe_string_function_usage_here_char__(void); 80 81 #ifdef HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS 82 83 /* if the compiler will optimize out function calls, then use this to tell if we are 84 have the correct types (this works only where sizeof() returns the size of the buffer, not 85 the size of the pointer). */ 86 87 #define CHECK_STRING_SIZE(d, len) (sizeof(d) != (len) && sizeof(d) != sizeof(char *)) 88 89 #else /* HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS */ 90 91 #endif /* HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS */ 92 93 #define safe_strcpy_base(dest, src, base, size) \ 94 safe_strcpy(dest, src, size-PTR_DIFF(dest,base)-1) 95 96 /* String copy functions - macro hell below adds 'type checking' (limited, 97 but the best we can do in C) and may tag with function name/number to 98 record the last 'clobber region' on that string */ 99 100 #define fstrcpy(d,s) safe_strcpy((d),(s),sizeof(fstring)-1) 101 #define fstrcat(d,s) safe_strcat((d),(s),sizeof(fstring)-1) 102 #define nstrcpy(d,s) safe_strcpy((d), (s),sizeof(nstring)-1) 103 #define unstrcpy(d,s) safe_strcpy((d), (s),sizeof(unstring)-1) 104 105 /* the addition of the DEVELOPER checks in safe_strcpy means we must 106 * update a lot of code. To make this a little easier here are some 107 * functions that provide the lengths with less pain */ 108 109 /* Inside the _fn variants of these is a call to clobber_region(), - 110 * which might destroy the stack on a buggy function. We help the 111 * debugging process by putting the function and line who last caused 112 * a clobbering into a static buffer. If the program crashes at 113 * address 0xf1f1f1f1 then this function is probably, but not 114 * necessarily, to blame. */ 115 116 /* overmalloc_safe_strcpy: DEPRECATED! Used when you know the 117 * destination buffer is longer than maxlength, but you don't know how 118 * long. This is not a good situation, because we can't do the normal 119 * sanity checks. Don't use in new code! */ 120 121 #define overmalloc_safe_strcpy(dest,src,maxlength) \ 122 safe_strcpy_fn(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, \ 123 dest,src,maxlength) 124 125 #define safe_strcpy(dest,src,maxlength) \ 126 safe_strcpy_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, \ 127 dest,src,maxlength) 128 129 #define safe_strcat(dest,src,maxlength) \ 130 safe_strcat_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, \ 131 dest,src,maxlength) 132 133 #define push_string_check(dest, src, dest_len, flags) \ 134 push_string_check_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, \ 135 dest, src, dest_len, flags) 136 137 #define pull_string_talloc(ctx, base_ptr, smb_flags2, dest, src, src_len, flags) \ 138 pull_string_talloc_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, \ 139 ctx, base_ptr, smb_flags2, dest, src, src_len, flags) 140 141 #define clistr_push(cli, dest, src, dest_len, flags) \ 142 clistr_push_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, \ 143 cli, dest, src, dest_len, flags) 144 145 #define clistr_pull(inbuf, dest, src, dest_len, src_len, flags) \ 146 clistr_pull_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, \ 147 inbuf, dest, src, dest_len, src_len, flags) 148 149 #define clistr_pull_talloc(ctx, base, flags2, pp_dest, src, src_len, flags) \ 150 clistr_pull_talloc_fn(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, \ 151 ctx, base, flags2, pp_dest, src, src_len, flags) 152 153 #define srvstr_push(base_ptr, smb_flags2, dest, src, dest_len, flags) \ 154 srvstr_push_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, \ 155 base_ptr, smb_flags2, dest, src, dest_len, flags) 156 157 #define alpha_strcpy(dest,src,other_safe_chars,maxlength) \ 158 alpha_strcpy_fn(SAFE_STRING_FUNCTION_NAME,SAFE_STRING_LINE, \ 159 dest,src,other_safe_chars,maxlength) 160 161 #define StrnCpy(dest,src,n) \ 162 StrnCpy_fn(SAFE_STRING_FUNCTION_NAME,SAFE_STRING_LINE, \ 163 dest,src,n) 164 165 #ifdef HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS 166 167 /* if the compiler will optimize out function calls, then use this to tell if we are 168 have the correct types (this works only where sizeof() returns the size of the buffer, not 169 the size of the pointer). */ 170 171 #define safe_strcpy_fn2(fn_name, fn_line, d, s, max_len) \ 172 (CHECK_STRING_SIZE(d, max_len+1) \ 173 ? __unsafe_string_function_usage_here__() \ 174 : safe_strcpy_fn(fn_name, fn_line, (d), (s), (max_len))) 175 176 #define safe_strcat_fn2(fn_name, fn_line, d, s, max_len) \ 177 (CHECK_STRING_SIZE(d, max_len+1) \ 178 ? __unsafe_string_function_usage_here__() \ 179 : safe_strcat_fn(fn_name, fn_line, (d), (s), (max_len))) 180 181 #define push_string_check_fn2(fn_name, fn_line, dest, src, dest_len, flags) \ 182 (CHECK_STRING_SIZE(dest, dest_len) \ 183 ? __unsafe_string_function_usage_here_size_t__() \ 184 : push_string_check_fn(fn_name, fn_line, dest, src, dest_len, flags)) 185 186 #define pull_string_talloc_fn2(fn_name, fn_line, ctx, base_ptr, smb_flags2, dest, src, src_len, flags) \ 187 pull_string_talloc_fn(fn_name, fn_line, ctx, base_ptr, smb_flags2, dest, src, src_len, flags) 188 189 #define clistr_push_fn2(fn_name, fn_line, cli, dest, src, dest_len, flags) \ 190 (CHECK_STRING_SIZE(dest, dest_len) \ 191 ? __unsafe_string_function_usage_here_size_t__() \ 192 : clistr_push_fn(fn_name, fn_line, cli, dest, src, dest_len, flags)) 193 194 #define clistr_pull_fn2(fn_name, fn_line, inbuf, dest, src, dest_len, srclen, flags) \ 195 (CHECK_STRING_SIZE(dest, dest_len) \ 196 ? __unsafe_string_function_usage_here_size_t__() \ 197 : clistr_pull_fn(fn_name, fn_line, inbuf, dest, src, dest_len, srclen, flags)) 198 199 #define srvstr_push_fn2(fn_name, fn_line, base_ptr, smb_flags2, dest, src, dest_len, flags) \ 200 (CHECK_STRING_SIZE(dest, dest_len) \ 201 ? __unsafe_string_function_usage_here_size_t__() \ 202 : srvstr_push_fn(fn_name, fn_line, base_ptr, smb_flags2, dest, src, dest_len, flags)) 203 204 #else 205 206 #define safe_strcpy_fn2 safe_strcpy_fn 207 #define safe_strcat_fn2 safe_strcat_fn 208 #define push_string_check_fn2 push_string_check_fn 209 #define pull_string_talloc_fn2 pull_string_talloc_fn 210 #define clistr_push_fn2 clistr_push_fn 211 #define clistr_pull_fn2 clistr_pull_fn 212 #define srvstr_push_fn2 srvstr_push_fn 65 #include "../libcli/util/ntstatus.h" 66 #include "lib/util/string_wrappers.h" 213 67 214 68 #endif 215 216 #endif -
vendor/current/source3/include/samba_linux_quota.h
r414 r988 228 228 #endif 229 229 230 long quotactl __P((int, const char *, qid_t, caddr_t));230 long quotactl(int, const char *, qid_t, caddr_t); 231 231 232 232 #endif /* _QUOTA_LINUX */ -
vendor/current/source3/include/secrets.h
r740 r988 40 40 #define SECRETS_DOMAIN_SID "SECRETS/SID" 41 41 #define SECRETS_SAM_SID "SAM/SID" 42 #define SECRETS_PROTECT_IDS "SECRETS/PROTECT/IDS" 42 43 43 44 /* The domain GUID and server GUID (NOT the same) are also not secret */ … … 58 59 (ie. when samba server is member of a domain */ 59 60 struct machine_acct_pass { 60 uint8 hash[16];61 uint8_t hash[16]; 61 62 time_t mod_time; 62 63 }; … … 69 70 70 71 struct afs_key { 71 uint32 kvno;72 uint32_t kvno; 72 73 char key[8]; 73 74 }; 74 75 75 76 struct afs_keyfile { 76 uint32 nkeys;77 uint32_t nkeys; 77 78 struct afs_key entry[SECRETS_AFS_MAXKEYS]; 78 79 }; … … 82 83 /* The following definitions come from passdb/secrets.c */ 83 84 85 bool secrets_init_path(const char *private_dir); 84 86 bool secrets_init(void); 85 87 struct db_context *secrets_db_ctx(void); … … 88 90 bool secrets_store(const char *key, const void *data, size_t size); 89 91 bool secrets_delete(const char *key); 92 93 /* The following definitions come from passdb/machine_account_secrets.c */ 94 bool secrets_mark_domain_protected(const char *domain); 95 bool secrets_clear_domain_protection(const char *domain); 90 96 bool secrets_store_domain_sid(const char *domain, const struct dom_sid *sid); 91 97 bool secrets_fetch_domain_sid(const char *domain, struct dom_sid *sid); 92 98 bool secrets_store_domain_guid(const char *domain, struct GUID *guid); 93 99 bool secrets_fetch_domain_guid(const char *domain, struct GUID *guid); 94 void *secrets_get_trust_account_lock(TALLOC_CTX *mem_ctx, const char *domain);95 100 enum netr_SchannelType get_default_sec_channel(void); 96 101 bool secrets_fetch_trust_account_password_legacy(const char *domain, 97 uint8 ret_pwd[16],102 uint8_t ret_pwd[16], 98 103 time_t *pass_last_set_time, 99 104 enum netr_SchannelType *channel); 100 bool secrets_fetch_trust_account_password(const char *domain, uint8 ret_pwd[16],105 bool secrets_fetch_trust_account_password(const char *domain, uint8_t ret_pwd[16], 101 106 time_t *pass_last_set_time, 102 107 enum netr_SchannelType *channel); … … 105 110 bool secrets_store_trusted_domain_password(const char* domain, const char* pwd, 106 111 const struct dom_sid *sid); 107 bool secrets_delete_machine_password(const char *domain);108 112 bool secrets_delete_machine_password_ex(const char *domain); 109 113 bool secrets_delete_domain_sid(const char *domain); 110 114 bool secrets_store_machine_password(const char *pass, const char *domain, enum netr_SchannelType sec_channel); 111 115 char *secrets_fetch_prev_machine_password(const char *domain); 116 time_t secrets_fetch_pass_last_set_time(const char *domain); 112 117 char *secrets_fetch_machine_password(const char *domain, 113 118 time_t *pass_last_set_time, … … 116 121 bool secrets_store_ldap_pw(const char* dn, char* pw); 117 122 bool fetch_ldap_pw(char **dn, char** pw); 118 struct trustdom_info;119 NTSTATUS secrets_trusted_domains(TALLOC_CTX *mem_ctx, uint32 *num_domains,120 struct trustdom_info ***domains);121 123 bool secrets_store_afs_keyfile(const char *cell, const struct afs_keyfile *keyfile); 122 124 bool secrets_fetch_afs_key(const char *cell, struct afs_key *result); … … 124 126 bool secrets_store_generic(const char *owner, const char *key, const char *secret); 125 127 char *secrets_fetch_generic(const char *owner, const char *key); 126 bool secrets_delete_generic(const char *owner, const char *key); 128 129 bool secrets_store_machine_pw_sync(const char *pass, const char *oldpass, const char *domain, 130 const char *realm, 131 const char *salting_principal, uint32_t supported_enc_types, 132 const struct dom_sid *domain_sid, uint32_t last_change_time, 133 uint32_t secure_channel, 134 bool delete_join); 135 136 /* The following definitions come from passdb/secrets_lsa.c */ 137 NTSTATUS lsa_secret_get(TALLOC_CTX *mem_ctx, 138 const char *secret_name, 139 DATA_BLOB *secret_current, 140 NTTIME *secret_current_lastchange, 141 DATA_BLOB *secret_old, 142 NTTIME *secret_old_lastchange, 143 struct security_descriptor **sd); 144 NTSTATUS lsa_secret_set(const char *secret_name, 145 DATA_BLOB *secret_current, 146 DATA_BLOB *secret_old, 147 struct security_descriptor *sd); 148 NTSTATUS lsa_secret_delete(const char *secret_name); 127 149 128 150 #endif /* _SECRETS_H */ -
vendor/current/source3/include/serverid.h
r860 r988 21 21 #define __SERVERID_H__ 22 22 23 #include "includes.h" 24 25 /** Don't verify this unique id */ 26 #define SERVERID_UNIQUE_ID_NOT_TO_VERIFY 0xFFFFFFFFFFFFFFFFULL 23 #include "replace.h" 24 #include "lib/dbwrap/dbwrap.h" 27 25 28 26 /* … … 35 33 */ 36 34 bool serverid_deregister(const struct server_id id); 37 38 /*39 * (De)register additional message flags40 */41 bool serverid_register_msg_flags(const struct server_id id, bool do_reg,42 uint32_t msg_flags);43 35 44 36 /* … … 68 60 bool serverid_parent_init(TALLOC_CTX *mem_ctx); 69 61 70 /*71 * Get a random unique_id and make sure that it is not72 * SERVERID_UNIQUE_ID_NOT_TO_VERIFY73 */74 uint64_t serverid_get_random_unique_id(void);75 76 bool serverid_init_readonly(TALLOC_CTX *mem_ctx);77 78 62 #endif -
vendor/current/source3/include/session.h
r414 r988 35 35 fstring remote_machine; 36 36 fstring id_str; 37 uint32 37 uint32_t id_num; 38 38 struct server_id pid; 39 39 fstring ip_addr_str; 40 40 time_t connect_start; 41 uint16_t connection_dialect; 42 uint8_t encryption_flags; 43 uint16_t cipher; 44 uint8_t signing_flags; 41 45 }; 42 46 -
vendor/current/source3/include/smb.h
r919 r988 27 27 #define _SMB_H 28 28 29 #include "libcli/smb/smb_common.h" 30 #include "libds/common/roles.h" 31 29 32 /* logged when starting the various Samba daemons */ 30 #define COPYRIGHT_STARTUP_MESSAGE "Copyright Andrew Tridgell and the Samba Team 1992-2011" 31 32 33 #if defined(LARGE_SMB_OFF_T) 34 #define BUFFER_SIZE (128*1024) 35 #else /* no large readwrite possible */ 36 #define BUFFER_SIZE (0xFFFF) 37 #endif 33 #define COPYRIGHT_STARTUP_MESSAGE "Copyright Andrew Tridgell and the Samba Team 1992-2016" 38 34 39 35 #define SAFETY_MARGIN 1024 40 36 #define LARGE_WRITEX_HDR_SIZE 65 37 #define LARGE_WRITEX_BUFFER_SIZE (128*1024) 41 38 42 39 #define NMB_PORT 137 43 40 #define DGRAM_PORT 138 44 #define SMB_PORT1 44545 #define SMB_PORT2 13941 #define NBT_SMB_PORT 139 /* Port for SMB over NBT transport (IETF STD#19). */ 42 #define TCP_SMB_PORT 445 /* Port for SMB over naked TCP transport. */ 46 43 #define SMB_PORTS "445 139" 47 44 … … 68 65 /* how long to wait for secondary SMB packets (milli-seconds) */ 69 66 #define SMB_SECONDARY_WAIT (60*1000) 70 71 /* this defines the error codes that receive_smb can put in smb_read_error */72 enum smb_read_errors {73 SMB_READ_OK = 0,74 SMB_READ_TIMEOUT,75 SMB_READ_EOF,76 SMB_READ_ERROR,77 SMB_WRITE_ERROR, /* This error code can go into the client smb_rw_error. */78 SMB_READ_BAD_SIG,79 SMB_NO_MEMORY,80 SMB_DO_NOT_DO_TDIS, /* cli_close_connection() check for this when smbfs wants to keep tree connected */81 SMB_READ_BAD_DECRYPT82 };83 67 84 68 #define DIR_STRUCT_SIZE 43 … … 127 111 #define OPENX_FILE_FAIL_IF_NOT_EXIST 0 128 112 129 typedef union unid_t {130 uid_t uid;131 gid_t gid;132 } unid_t;133 134 113 /* pipe string names */ 135 114 … … 141 120 142 121 #include "librpc/gen_ndr/security.h" 143 144 /*145 * The complete list of SIDS belonging to this user.146 * Created when a vuid is registered.147 * The definition of the user_sids array is as follows :148 *149 * token->user_sids[0] = primary user SID.150 * token->user_sids[1] = primary group SID.151 * token->user_sids[2..num_sids] = supplementary group SIDS.152 */153 154 #define PRIMARY_USER_SID_INDEX 0155 #define PRIMARY_GROUP_SID_INDEX 1156 157 typedef struct write_cache {158 SMB_OFF_T file_size;159 SMB_OFF_T offset;160 size_t alloc_size;161 size_t data_size;162 char *data;163 } write_cache;164 165 struct fd_handle {166 size_t ref_count;167 int fd;168 uint64_t position_information;169 SMB_OFF_T pos;170 uint32 private_options; /* NT Create options, but we only look at171 * NTCREATEX_OPTIONS_PRIVATE_DENY_DOS and172 * NTCREATEX_OPTIONS_PRIVATE_DENY_FCB and173 * NTCREATEX_OPTIONS_PRIVATE_DELETE_ON_CLOSE174 * for print files *only*, where175 * DELETE_ON_CLOSE is not stored in the share176 * mode database.177 */178 unsigned long gen_id;179 };180 122 181 123 struct idle_event; … … 187 129 struct fncall_context; 188 130 189 struct vfs_fsp_data {190 struct vfs_fsp_data *next;191 struct vfs_handle_struct *owner;192 void (*destroy)(void *p_data);193 void *_dummy_;194 /* NOTE: This structure contains four pointers so that we can guarantee195 * that the end of the structure is always both 4-byte and 8-byte aligned.196 */197 };198 199 131 /* the basic packet size, assuming no words or bytes */ 200 132 #define smb_size 39 … … 206 138 207 139 struct notify_mid_map; 208 struct notify_ entry;140 struct notify_db_entry; 209 141 struct notify_event; 210 142 struct notify_change_request; 211 143 struct sys_notify_backend; 212 144 struct sys_notify_context { 213 struct event_context *ev; 214 struct connection_struct *conn; 145 struct tevent_context *ev; 215 146 void *private_data; /* For use by the system backend */ 216 147 }; 217 218 struct notify_change_buf {219 /*220 * If no requests are pending, changes are queued here. Simple array,221 * we only append.222 */223 224 /*225 * num_changes == -1 means that we have got a catch-all change, when226 * asked we just return NT_STATUS_OK without specific changes.227 */228 int num_changes;229 struct notify_change *changes;230 231 /*232 * If no changes are around requests are queued here. Using a linked233 * list, because we have to append at the end and delete from the top.234 */235 struct notify_change_request *requests;236 };237 238 struct print_file_data {239 char *svcname;240 char *docname;241 char *filename;242 struct policy_handle handle;243 uint32_t jobid;244 uint16 rap_jobid;245 };246 247 typedef struct files_struct {248 struct files_struct *next, *prev;249 int fnum;250 struct connection_struct *conn;251 struct fd_handle *fh;252 unsigned int num_smb_operations;253 struct file_id file_id;254 uint64_t initial_allocation_size; /* Faked up initial allocation on disk. */255 mode_t mode;256 uint16 file_pid;257 uint16 vuid;258 write_cache *wcp;259 struct timeval open_time;260 uint32 access_mask; /* NTCreateX access bits (FILE_READ_DATA etc.) */261 uint32 share_access; /* NTCreateX share constants (FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE). */262 263 bool update_write_time_triggered;264 struct timed_event *update_write_time_event;265 bool update_write_time_on_close;266 struct timespec close_write_time;267 bool write_time_forced;268 269 int oplock_type;270 int sent_oplock_break;271 struct timed_event *oplock_timeout;272 struct lock_struct last_lock_failure;273 int current_lock_count; /* Count the number of outstanding locks and pending locks. */274 275 struct share_mode_entry *pending_break_messages;276 int num_pending_break_messages;277 278 bool can_lock;279 bool can_read;280 bool can_write;281 bool modified;282 bool is_directory;283 bool aio_write_behind;284 bool lockdb_clean;285 bool initial_delete_on_close; /* Only set at NTCreateX if file was created. */286 bool delete_on_close;287 bool posix_open;288 bool is_sparse;289 struct smb_filename *fsp_name;290 uint32_t name_hash; /* Jenkins hash of full pathname. */291 292 struct vfs_fsp_data *vfs_extension;293 struct fake_file_handle *fake_file_handle;294 295 struct notify_change_buf *notify;296 297 struct files_struct *base_fsp; /* placeholder for delete on close */298 299 /*300 * Read-only cached brlock record, thrown away when the301 * brlock.tdb seqnum changes. This avoids fetching data from302 * the brlock.tdb on every read/write call.303 */304 int brlock_seqnum;305 struct byte_range_lock *brlock_rec;306 307 struct dptr_struct *dptr;308 309 /* if not NULL, means this is a print file */310 struct print_file_data *print_file;311 312 } files_struct;313 148 314 149 #include "ntquotas.h" 315 150 #include "sysquotas.h" 316 151 317 struct client_address {318 char addr[INET6_ADDRSTRLEN];319 const char *name;320 };321 322 struct vuid_cache_entry {323 struct auth_serversupplied_info *session_info;324 uint16_t vuid;325 bool read_only;326 };327 328 struct vuid_cache {329 unsigned int next_entry;330 struct vuid_cache_entry array[VUID_CACHE_SIZE];331 };332 333 typedef struct {334 char *name;335 bool is_wild;336 } name_compare_entry;337 338 struct trans_state {339 struct trans_state *next, *prev;340 uint16 vuid;341 uint64_t mid;342 343 uint32 max_param_return;344 uint32 max_data_return;345 uint32 max_setup_return;346 347 uint8 cmd; /* SMBtrans or SMBtrans2 */348 349 char *name; /* for trans requests */350 uint16 call; /* for trans2 and nttrans requests */351 352 bool close_on_completion;353 bool one_way;354 355 unsigned int setup_count;356 uint16 *setup;357 358 size_t received_data;359 size_t received_param;360 361 size_t total_param;362 char *param;363 364 size_t total_data;365 char *data;366 };367 368 /*369 * Info about an alternate data stream370 */371 372 struct stream_struct {373 SMB_OFF_T size;374 SMB_OFF_T alloc_size;375 char *name;376 };377 378 152 /* Include VFS stuff */ 379 153 380 154 #include "smb_acls.h" 155 #include "lib/readdir_attr.h" 381 156 #include "vfs.h" 382 157 383 struct dfree_cached_info {384 time_t last_dfree_time;385 uint64_t dfree_ret;386 uint64_t bsize;387 uint64_t dfree;388 uint64_t dsize;389 };390 391 struct dptr_struct;392 393 struct share_params {394 int service;395 };396 397 struct share_iterator {398 int next_id;399 };400 401 typedef struct connection_struct {402 struct connection_struct *next, *prev;403 struct smbd_server_connection *sconn; /* can be NULL */404 unsigned cnum; /* an index passed over the wire */405 struct share_params *params;406 bool force_user;407 struct vuid_cache vuid_cache;408 bool printer;409 bool ipc;410 bool read_only; /* Attributes for the current user of the share. */411 uint32_t share_access;412 /* Does this filesystem honor413 sub second timestamps on files414 and directories when setting time ? */415 enum timestamp_set_resolution ts_res;416 char *connectpath;417 char *origpath;418 419 struct vfs_handle_struct *vfs_handles; /* for the new plugins */420 421 /*422 * This represents the user information on this connection. Depending423 * on the vuid using this tid, this might change per SMB request.424 */425 struct auth_serversupplied_info *session_info;426 427 /*428 * If the "force group" parameter is set, this is the primary gid that429 * may be used in the users token, depending on the vuid using this tid.430 */431 gid_t force_group_gid;432 433 uint16 vuid; /* vuid of user who *opened* this connection, or UID_FIELD_INVALID */434 435 time_t lastused;436 time_t lastused_count;437 bool used;438 int num_files_open;439 unsigned int num_smb_operations; /* Count of smb operations on this tree. */440 int encrypt_level;441 bool encrypted_tid;442 443 /* Semantics requested by the client or forced by the server config. */444 bool case_sensitive;445 bool case_preserve;446 bool short_case_preserve;447 448 /* Semantics provided by the underlying filesystem. */449 int fs_capabilities;450 /* Device number of the directory of the share mount.451 Used to ensure unique FileIndex returns. */452 SMB_DEV_T base_share_dev;453 454 name_compare_entry *hide_list; /* Per-share list of files to return as hidden. */455 name_compare_entry *veto_list; /* Per-share list of files to veto (never show). */456 name_compare_entry *veto_oplock_list; /* Per-share list of files to refuse oplocks on. */457 name_compare_entry *aio_write_behind_list; /* Per-share list of files to use aio write behind on. */458 struct dfree_cached_info *dfree_info;459 struct trans_state *pending_trans;460 struct notify_context *notify_ctx;461 462 struct rpc_pipe_client *spoolss_pipe;463 464 } connection_struct;465 466 158 struct current_user { 467 connection_struct *conn;468 uint 16 vuid;159 struct connection_struct *conn; 160 uint64_t vuid; /* SMB2 compat */ 469 161 struct security_unix_token ut; 470 162 struct security_token *nt_user_token; 471 };472 473 struct smbd_smb2_request;474 475 struct smb_request {476 uint8_t cmd;477 uint16 flags2;478 uint16 smbpid;479 uint64_t mid; /* For compatibility with SMB2. */480 uint32_t seqnum;481 uint16 vuid;482 uint16 tid;483 uint8 wct;484 uint16_t *vwv;485 uint16_t buflen;486 const uint8_t *buf;487 const uint8 *inbuf;488 489 /*490 * Async handling in the main smb processing loop is directed by491 * outbuf: reply_xxx routines indicate sync behaviour by putting their492 * reply into "outbuf". If they leave it as NULL, they take of it493 * themselves, possibly later.494 *495 * If async handling is wanted, the reply_xxx routine must make sure496 * that it talloc_move()s the smb_req somewhere else.497 */498 uint8 *outbuf;499 500 size_t unread_bytes;501 bool encrypted;502 connection_struct *conn;503 struct smbd_server_connection *sconn;504 struct smb_perfcount_data pcd;505 506 /*507 * Chained request handling508 */509 struct files_struct *chain_fsp;510 511 /*512 * Here we collect the outbufs from the chain handlers513 */514 uint8_t *chain_outbuf;515 516 /*517 * state information for async smb handling518 */519 void *async_priv;520 521 bool done;522 523 /*524 * Back pointer to smb2 request.525 */526 struct smbd_smb2_request *smb2req;527 163 }; 528 164 … … 537 173 fstring domain; /* domain that the client specified */ 538 174 } userdom_struct; 539 540 /* used for server information: client, nameserv and ipc */541 struct server_info_struct {542 fstring name;543 uint32 type;544 fstring comment;545 fstring domain; /* used ONLY in ipc.c NOT namework.c */546 bool server_added; /* used ONLY in ipc.c NOT namework.c */547 };548 175 549 176 /* used for network interfaces */ … … 555 182 struct sockaddr_storage netmask; 556 183 struct sockaddr_storage bcast; 557 }; 558 559 /* Internal message queue for deferred opens. */ 560 struct pending_message_list { 561 struct pending_message_list *next, *prev; 562 struct timeval request_time; /* When was this first issued? */ 563 struct timed_event *te; 564 struct smb_perfcount_data pcd; 565 uint32_t seqnum; 566 bool encrypted; 567 bool processed; 568 DATA_BLOB buf; 569 DATA_BLOB private_data; 184 uint32_t if_index; 185 uint64_t linkspeed; 186 uint32_t capability; 570 187 }; 571 188 … … 573 190 574 191 #include "librpc/gen_ndr/server_id.h" 575 576 /* struct returned by get_share_modes */577 struct share_mode_entry {578 struct server_id pid;579 uint64_t op_mid; /* For compatibility with SMB2 opens. */580 uint16 op_type;581 uint32 access_mask; /* NTCreateX access bits (FILE_READ_DATA etc.) */582 uint32 share_access; /* NTCreateX share constants (FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE). */583 uint32 private_options; /* NT Create options, but we only look at584 * NTCREATEX_OPTIONS_PRIVATE_DENY_DOS and585 * NTCREATEX_OPTIONS_PRIVATE_DENY_FCB for586 * smbstatus and swat */587 struct timeval time;588 struct file_id id;589 unsigned long share_file_id;590 uint32 uid; /* uid of file opener. */591 uint16 flags; /* See SHARE_MODE_XX above. */592 uint32_t name_hash; /* Jenkins hash of full pathname. */593 };594 192 595 193 /* oplock break message definition - linearization of share_mode_entry. … … 597 195 Offset Data length. 598 196 0 struct server_id pid 4 599 4 uint16 op_mid 8600 12 uint16 op_type2601 14 uint32 access_mask 4602 18 uint32 share_access 4603 22 uint32 private_options 4604 26 uint32 time sec 4605 30 uint32 time usec 4606 34 uint64 dev 8 bytes607 42 uint64 inode 8 bytes608 50 uint64 extid 8 bytes197 4 uint16_t op_mid 8 198 12 uint16_t op_type 2 199 14 uint32_t access_mask 4 200 18 uint32_t share_access 4 201 22 uint32_t private_options 4 202 26 uint32_t time sec 4 203 30 uint32_t time usec 4 204 34 uint64_t dev 8 bytes 205 42 uint64_t inode 8 bytes 206 50 uint64_t extid 8 bytes 609 207 58 unsigned long file_id 4 bytes 610 62 uint32 uid 4 bytes611 66 uint16 flags 2 bytes612 68 uint32 name_hash 4 bytes208 62 uint32_t uid 4 bytes 209 66 uint16_t flags 2 bytes 210 68 uint32_t name_hash 4 bytes 613 211 72 614 212 … … 634 232 #define MSG_SMB_SHARE_MODE_ENTRY_SIZE 76 635 233 636 struct delete_token_list {637 struct delete_token_list *next, *prev;638 uint32_t name_hash;639 struct security_unix_token *delete_token;640 struct security_token *delete_nt_token;641 };642 643 struct share_mode_lock {644 const char *servicepath; /* canonicalized. */645 const char *base_name;646 const char *stream_name;647 struct file_id id;648 int num_share_modes;649 struct share_mode_entry *share_modes;650 struct delete_token_list *delete_tokens;651 struct timespec old_write_time;652 struct timespec changed_write_time;653 bool fresh;654 bool modified;655 struct db_record *record;656 };657 658 /*659 * Internal structure of locking.tdb share mode db.660 * Used by locking.c and libsmbsharemodes.c661 */662 663 struct locking_data {664 union {665 struct {666 int num_share_mode_entries;667 struct timespec old_write_time;668 struct timespec changed_write_time;669 uint32 num_delete_token_entries;670 } s;671 struct share_mode_entry dummy; /* Needed for alignment. */672 } u;673 /* The following four entries are implicit674 675 (1) struct share_mode_entry modes[num_share_mode_entries];676 677 (2) A num_delete_token_entries of structs {678 uint32_t len_delete_token;679 char unix_token[len_delete_token] (divisible by 4).680 };681 682 (3) char share_name[];683 (4) char file_name[];684 */685 };686 687 234 #define NT_HASH_LEN 16 688 235 #define LM_HASH_LEN 16 689 236 690 /* key and data in the connections database - used in smbstatus and smbd */691 struct connections_key {692 struct server_id pid;693 int cnum;694 fstring name;695 };696 697 struct connections_data {698 int magic;699 struct server_id pid;700 int cnum;701 uid_t uid;702 gid_t gid;703 char servicename[FSTRING_LEN];704 char addr[24];705 char machine[FSTRING_LEN];706 time_t start;707 708 /*709 * This field used to hold the msg_flags. For compatibility reasons,710 * keep the data structure in the tdb file the same.711 */712 uint32 unused_compatitibility_field;713 };714 715 /* the following are used by loadparm for option lists */716 typedef enum {717 P_BOOL,P_BOOLREV,P_CHAR,P_INTEGER,P_OCTAL,P_LIST,718 P_STRING,P_USTRING,P_ENUM,P_SEP719 } parm_type;720 721 typedef enum {722 P_LOCAL,P_GLOBAL,P_SEPARATOR,P_NONE723 } parm_class;724 725 struct enum_list {726 int value;727 const char *name;728 };729 730 struct parm_struct {731 const char *label;732 parm_type type;733 parm_class p_class;734 void *ptr;735 bool (*special)(int snum, const char *, char **);736 const struct enum_list *enum_list;737 unsigned flags;738 union {739 bool bvalue;740 int ivalue;741 char *svalue;742 char cvalue;743 char **lvalue;744 } def;745 };746 747 /* The following flags are used in SWAT */748 #define FLAG_BASIC 0x0001 /* Display only in BASIC view */749 #define FLAG_SHARE 0x0002 /* file sharing options */750 #define FLAG_PRINT 0x0004 /* printing options */751 #define FLAG_GLOBAL 0x0008 /* local options that should be globally settable in SWAT */752 #define FLAG_WIZARD 0x0010 /* Parameters that the wizard will operate on */753 #define FLAG_ADVANCED 0x0020 /* Parameters that will be visible in advanced view */754 #define FLAG_DEVELOPER 0x0040 /* No longer used */755 #define FLAG_DEPRECATED 0x1000 /* options that should no longer be used */756 #define FLAG_HIDE 0x2000 /* options that should be hidden in SWAT */757 #define FLAG_DOS_STRING 0x4000 /* convert from UNIX to DOS codepage when reading this string. */758 #define FLAG_META 0x8000 /* A meta directive - not a real parameter */759 #define FLAG_CMDLINE 0x10000 /* option has been overridden */760 761 237 /* offsets into message for common items */ 762 #define smb_com 8 763 #define smb_rcls 9 764 #define smb_reh 10 765 #define smb_err 11 766 #define smb_flg 13 767 #define smb_flg2 14 768 #define smb_pidhigh 16 769 #define smb_ss_field 18 770 #define smb_tid 28 771 #define smb_pid 30 772 #define smb_uid 32 773 #define smb_mid 34 774 #define smb_wct 36 775 #define smb_vwv 37 776 #define smb_vwv0 37 777 #define smb_vwv1 39 778 #define smb_vwv2 41 779 #define smb_vwv3 43 780 #define smb_vwv4 45 781 #define smb_vwv5 47 782 #define smb_vwv6 49 783 #define smb_vwv7 51 784 #define smb_vwv8 53 785 #define smb_vwv9 55 786 #define smb_vwv10 57 787 #define smb_vwv11 59 788 #define smb_vwv12 61 789 #define smb_vwv13 63 790 #define smb_vwv14 65 791 #define smb_vwv15 67 792 #define smb_vwv16 69 793 #define smb_vwv17 71 794 795 /* flag defines. CIFS spec 3.1.1 */ 796 #define FLAG_SUPPORT_LOCKREAD 0x01 797 #define FLAG_CLIENT_BUF_AVAIL 0x02 798 #define FLAG_RESERVED 0x04 799 #define FLAG_CASELESS_PATHNAMES 0x08 800 #define FLAG_CANONICAL_PATHNAMES 0x10 801 #define FLAG_REQUEST_OPLOCK 0x20 802 #define FLAG_REQUEST_BATCH_OPLOCK 0x40 803 #define FLAG_REPLY 0x80 804 805 /* the complete */ 806 #define SMBmkdir 0x00 /* create directory */ 807 #define SMBrmdir 0x01 /* delete directory */ 808 #define SMBopen 0x02 /* open file */ 809 #define SMBcreate 0x03 /* create file */ 810 #define SMBclose 0x04 /* close file */ 811 #define SMBflush 0x05 /* flush file */ 812 #define SMBunlink 0x06 /* delete file */ 813 #define SMBmv 0x07 /* rename file */ 814 #define SMBgetatr 0x08 /* get file attributes */ 815 #define SMBsetatr 0x09 /* set file attributes */ 816 #define SMBread 0x0A /* read from file */ 817 #define SMBwrite 0x0B /* write to file */ 818 #define SMBlock 0x0C /* lock byte range */ 819 #define SMBunlock 0x0D /* unlock byte range */ 820 #define SMBctemp 0x0E /* create temporary file */ 821 #define SMBmknew 0x0F /* make new file */ 822 #define SMBcheckpath 0x10 /* check directory path */ 823 #define SMBexit 0x11 /* process exit */ 824 #define SMBlseek 0x12 /* seek */ 825 #define SMBtcon 0x70 /* tree connect */ 826 #define SMBtconX 0x75 /* tree connect and X*/ 827 #define SMBtdis 0x71 /* tree disconnect */ 828 #define SMBnegprot 0x72 /* negotiate protocol */ 829 #define SMBdskattr 0x80 /* get disk attributes */ 830 #define SMBsearch 0x81 /* search directory */ 831 #define SMBsplopen 0xC0 /* open print spool file */ 832 #define SMBsplwr 0xC1 /* write to print spool file */ 833 #define SMBsplclose 0xC2 /* close print spool file */ 834 #define SMBsplretq 0xC3 /* return print queue */ 835 #define SMBsends 0xD0 /* send single block message */ 836 #define SMBsendb 0xD1 /* send broadcast message */ 837 #define SMBfwdname 0xD2 /* forward user name */ 838 #define SMBcancelf 0xD3 /* cancel forward */ 839 #define SMBgetmac 0xD4 /* get machine name */ 840 #define SMBsendstrt 0xD5 /* send start of multi-block message */ 841 #define SMBsendend 0xD6 /* send end of multi-block message */ 842 #define SMBsendtxt 0xD7 /* send text of multi-block message */ 843 844 /* Core+ protocol */ 845 #define SMBlockread 0x13 /* Lock a range and read */ 846 #define SMBwriteunlock 0x14 /* Unlock a range then write */ 847 #define SMBreadbraw 0x1a /* read a block of data with no smb header */ 848 #define SMBwritebraw 0x1d /* write a block of data with no smb header */ 849 #define SMBwritec 0x20 /* secondary write request */ 850 #define SMBwriteclose 0x2c /* write a file then close it */ 851 852 /* dos extended protocol */ 853 #define SMBreadBraw 0x1A /* read block raw */ 854 #define SMBreadBmpx 0x1B /* read block multiplexed */ 855 #define SMBreadBs 0x1C /* read block (secondary response) */ 856 #define SMBwriteBraw 0x1D /* write block raw */ 857 #define SMBwriteBmpx 0x1E /* write block multiplexed */ 858 #define SMBwriteBs 0x1F /* write block (secondary request) */ 859 #define SMBwriteC 0x20 /* write complete response */ 860 #define SMBsetattrE 0x22 /* set file attributes expanded */ 861 #define SMBgetattrE 0x23 /* get file attributes expanded */ 862 #define SMBlockingX 0x24 /* lock/unlock byte ranges and X */ 863 #define SMBtrans 0x25 /* transaction - name, bytes in/out */ 864 #define SMBtranss 0x26 /* transaction (secondary request/response) */ 865 #define SMBioctl 0x27 /* IOCTL */ 866 #define SMBioctls 0x28 /* IOCTL (secondary request/response) */ 867 #define SMBcopy 0x29 /* copy */ 868 #define SMBmove 0x2A /* move */ 869 #define SMBecho 0x2B /* echo */ 870 #define SMBopenX 0x2D /* open and X */ 871 #define SMBreadX 0x2E /* read and X */ 872 #define SMBwriteX 0x2F /* write and X */ 873 #define SMBsesssetupX 0x73 /* Session Set Up & X (including User Logon) */ 874 #define SMBffirst 0x82 /* find first */ 875 #define SMBfunique 0x83 /* find unique */ 876 #define SMBfclose 0x84 /* find close */ 877 #define SMBkeepalive 0x85 /* keepalive */ 878 #define SMBinvalid 0xFE /* invalid command */ 879 880 /* Extended 2.0 protocol */ 881 #define SMBtrans2 0x32 /* TRANS2 protocol set */ 882 #define SMBtranss2 0x33 /* TRANS2 protocol set, secondary command */ 883 #define SMBfindclose 0x34 /* Terminate a TRANSACT2_FINDFIRST */ 884 #define SMBfindnclose 0x35 /* Terminate a TRANSACT2_FINDNOTIFYFIRST */ 885 #define SMBulogoffX 0x74 /* user logoff */ 886 887 /* NT SMB extensions. */ 888 #define SMBnttrans 0xA0 /* NT transact */ 889 #define SMBnttranss 0xA1 /* NT transact secondary */ 890 #define SMBntcreateX 0xA2 /* NT create and X */ 891 #define SMBntcancel 0xA4 /* NT cancel */ 892 #define SMBntrename 0xA5 /* NT rename */ 893 894 /* These are the trans subcommands */ 895 #define TRANSACT_SETNAMEDPIPEHANDLESTATE 0x01 896 #define TRANSACT_DCERPCCMD 0x26 897 #define TRANSACT_WAITNAMEDPIPEHANDLESTATE 0x53 898 899 /* These are the TRANS2 sub commands */ 900 #define TRANSACT2_OPEN 0x00 901 #define TRANSACT2_FINDFIRST 0x01 902 #define TRANSACT2_FINDNEXT 0x02 903 #define TRANSACT2_QFSINFO 0x03 904 #define TRANSACT2_SETFSINFO 0x04 905 #define TRANSACT2_QPATHINFO 0x05 906 #define TRANSACT2_SETPATHINFO 0x06 907 #define TRANSACT2_QFILEINFO 0x07 908 #define TRANSACT2_SETFILEINFO 0x08 909 #define TRANSACT2_FSCTL 0x09 910 #define TRANSACT2_IOCTL 0x0A 911 #define TRANSACT2_FINDNOTIFYFIRST 0x0B 912 #define TRANSACT2_FINDNOTIFYNEXT 0x0C 913 #define TRANSACT2_MKDIR 0x0D 914 #define TRANSACT2_SESSION_SETUP 0x0E 915 #define TRANSACT2_GET_DFS_REFERRAL 0x10 916 #define TRANSACT2_REPORT_DFS_INCONSISTANCY 0x11 917 918 /* These are the NT transact sub commands. */ 919 #define NT_TRANSACT_CREATE 1 920 #define NT_TRANSACT_IOCTL 2 921 #define NT_TRANSACT_SET_SECURITY_DESC 3 922 #define NT_TRANSACT_NOTIFY_CHANGE 4 923 #define NT_TRANSACT_RENAME 5 924 #define NT_TRANSACT_QUERY_SECURITY_DESC 6 925 #define NT_TRANSACT_GET_USER_QUOTA 7 926 #define NT_TRANSACT_SET_USER_QUOTA 8 238 #define smb_com (NBT_HDR_SIZE+HDR_COM) 239 #define smb_rcls (NBT_HDR_SIZE+HDR_RCLS) 240 #define smb_reh (NBT_HDR_SIZE+HDR_REH) 241 #define smb_err (NBT_HDR_SIZE+HDR_ERR) 242 #define smb_flg (NBT_HDR_SIZE+HDR_FLG) 243 #define smb_flg2 (NBT_HDR_SIZE+HDR_FLG2) 244 #define smb_pidhigh (NBT_HDR_SIZE+HDR_PIDHIGH) 245 #define smb_ss_field (NBT_HDR_SIZE+HDR_SS_FIELD) 246 #define smb_tid (NBT_HDR_SIZE+HDR_TID) 247 #define smb_pid (NBT_HDR_SIZE+HDR_PID) 248 #define smb_uid (NBT_HDR_SIZE+HDR_UID) 249 #define smb_mid (NBT_HDR_SIZE+HDR_MID) 250 #define smb_wct (NBT_HDR_SIZE+HDR_WCT) 251 #define smb_vwv (NBT_HDR_SIZE+HDR_VWV) 252 #define smb_vwv0 (smb_vwv+( 0*2)) 253 #define smb_vwv1 (smb_vwv+( 1*2)) 254 #define smb_vwv2 (smb_vwv+( 2*2)) 255 #define smb_vwv3 (smb_vwv+( 3*2)) 256 #define smb_vwv4 (smb_vwv+( 4*2)) 257 #define smb_vwv5 (smb_vwv+( 5*2)) 258 #define smb_vwv6 (smb_vwv+( 6*2)) 259 #define smb_vwv7 (smb_vwv+( 7*2)) 260 #define smb_vwv8 (smb_vwv+( 8*2)) 261 #define smb_vwv9 (smb_vwv+( 9*2)) 262 #define smb_vwv10 (smb_vwv+(10*2)) 263 #define smb_vwv11 (smb_vwv+(11*2)) 264 #define smb_vwv12 (smb_vwv+(12*2)) 265 #define smb_vwv13 (smb_vwv+(13*2)) 266 #define smb_vwv14 (smb_vwv+(14*2)) 267 #define smb_vwv15 (smb_vwv+(15*2)) 268 #define smb_vwv16 (smb_vwv+(16*2)) 269 #define smb_vwv17 (smb_vwv+(17*2)) 927 270 928 271 /* These are the NT transact_get_user_quota sub commands */ … … 1019 362 #define smb_ntcreate_SecurityFlags (smb_vwv0 + 47) 1020 363 1021 /* this is used on a TConX. I'm not sure the name is very helpful though */1022 #define SMB_SUPPORT_SEARCH_BITS 0x00011023 #define SMB_SHARE_IN_DFS 0x00021024 1025 364 /* Named pipe write mode flags. Used in writeX calls. */ 1026 365 #define PIPE_RAW_MODE 0x4 … … 1065 404 #define EXTENDED_RESPONSE_REQUIRED 0x10 1066 405 1067 /* ShareAccess field. */1068 #define FILE_SHARE_NONE 0 /* Cannot be used in bitmask. */1069 #define FILE_SHARE_READ 11070 #define FILE_SHARE_WRITE 21071 #define FILE_SHARE_DELETE 41072 1073 /* FileAttributesField */1074 #define FILE_ATTRIBUTE_READONLY 0x001L1075 #define FILE_ATTRIBUTE_HIDDEN 0x002L1076 #define FILE_ATTRIBUTE_SYSTEM 0x004L1077 #define FILE_ATTRIBUTE_VOLUME 0x008L1078 #define FILE_ATTRIBUTE_DIRECTORY 0x010L1079 #define FILE_ATTRIBUTE_ARCHIVE 0x020L1080 #define FILE_ATTRIBUTE_NORMAL 0x080L1081 #define FILE_ATTRIBUTE_TEMPORARY 0x100L1082 #define FILE_ATTRIBUTE_SPARSE 0x200L1083 #define FILE_ATTRIBUTE_REPARSE_POINT 0x400L1084 #define FILE_ATTRIBUTE_COMPRESSED 0x800L1085 #define FILE_ATTRIBUTE_OFFLINE 0x1000L1086 #define FILE_ATTRIBUTE_NONINDEXED 0x2000L1087 #define FILE_ATTRIBUTE_ENCRYPTED 0x4000L1088 #define SAMBA_ATTRIBUTES_MASK (FILE_ATTRIBUTE_READONLY|\1089 FILE_ATTRIBUTE_HIDDEN|\1090 FILE_ATTRIBUTE_SYSTEM|\1091 FILE_ATTRIBUTE_DIRECTORY|\1092 FILE_ATTRIBUTE_ARCHIVE)1093 1094 /* Flags - combined with attributes. */1095 #define FILE_FLAG_WRITE_THROUGH 0x80000000L1096 #define FILE_FLAG_NO_BUFFERING 0x20000000L1097 #define FILE_FLAG_RANDOM_ACCESS 0x10000000L1098 #define FILE_FLAG_SEQUENTIAL_SCAN 0x08000000L1099 #define FILE_FLAG_DELETE_ON_CLOSE 0x04000000L1100 #define FILE_FLAG_BACKUP_SEMANTICS 0x02000000L1101 #define FILE_FLAG_POSIX_SEMANTICS 0x01000000L1102 1103 /* CreateDisposition field. */1104 #define FILE_SUPERSEDE 0 /* File exists overwrite/supersede. File not exist create. */1105 #define FILE_OPEN 1 /* File exists open. File not exist fail. */1106 #define FILE_CREATE 2 /* File exists fail. File not exist create. */1107 #define FILE_OPEN_IF 3 /* File exists open. File not exist create. */1108 #define FILE_OVERWRITE 4 /* File exists overwrite. File not exist fail. */1109 #define FILE_OVERWRITE_IF 5 /* File exists overwrite. File not exist create. */1110 1111 /* CreateOptions field. */1112 #define FILE_DIRECTORY_FILE 0x00011113 #define FILE_WRITE_THROUGH 0x00021114 #define FILE_SEQUENTIAL_ONLY 0x00041115 #define FILE_NO_INTERMEDIATE_BUFFERING 0x00081116 #define FILE_SYNCHRONOUS_IO_ALERT 0x0010 /* may be ignored */1117 #define FILE_SYNCHRONOUS_IO_NONALERT 0x0020 /* may be ignored */1118 #define FILE_NON_DIRECTORY_FILE 0x00401119 #define FILE_CREATE_TREE_CONNECTION 0x0080 /* ignore, should be zero */1120 #define FILE_COMPLETE_IF_OPLOCKED 0x0100 /* ignore, should be zero */1121 #define FILE_NO_EA_KNOWLEDGE 0x02001122 #define FILE_EIGHT_DOT_THREE_ONLY 0x0400 /* aka OPEN_FOR_RECOVERY: ignore, should be zero */1123 #define FILE_RANDOM_ACCESS 0x08001124 #define FILE_DELETE_ON_CLOSE 0x10001125 #define FILE_OPEN_BY_FILE_ID 0x20001126 #define FILE_OPEN_FOR_BACKUP_INTENT 0x40001127 #define FILE_NO_COMPRESSION 0x80001128 #define FILE_RESERVER_OPFILTER 0x00100000 /* ignore, should be zero */1129 #define FILE_OPEN_REPARSE_POINT 0x002000001130 #define FILE_OPEN_NO_RECALL 0x004000001131 #define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000 /* ignore should be zero */1132 1133 406 #define NTCREATEX_OPTIONS_MUST_IGNORE_MASK (0x008F0480) 1134 407 … … 1148 421 /* Private options for printer support */ 1149 422 #define NTCREATEX_OPTIONS_PRIVATE_DELETE_ON_CLOSE 0x0008 1150 1151 /* Responses when opening a file. */1152 #define FILE_WAS_SUPERSEDED 01153 #define FILE_WAS_OPENED 11154 #define FILE_WAS_CREATED 21155 #define FILE_WAS_OVERWRITTEN 31156 1157 /* File type flags */1158 #define FILE_TYPE_DISK 01159 #define FILE_TYPE_BYTE_MODE_PIPE 11160 #define FILE_TYPE_MESSAGE_MODE_PIPE 21161 #define FILE_TYPE_PRINTER 31162 #define FILE_TYPE_COMM_DEVICE 41163 #define FILE_TYPE_UNKNOWN 0xFFFF1164 423 1165 424 /* Flag for NT transact rename call. */ … … 1171 430 #define RENAME_FLAG_RENAME 0x104 1172 431 #define RENAME_FLAG_COPY 0x105 1173 1174 /* Filesystem Attributes. */1175 #define FILE_CASE_SENSITIVE_SEARCH 0x000000011176 #define FILE_CASE_PRESERVED_NAMES 0x000000021177 #define FILE_UNICODE_ON_DISK 0x000000041178 /* According to cifs9f, this is 4, not 8 */1179 /* Acconding to testing, this actually sets the security attribute! */1180 #define FILE_PERSISTENT_ACLS 0x000000081181 #define FILE_FILE_COMPRESSION 0x000000101182 #define FILE_VOLUME_QUOTAS 0x000000201183 #define FILE_SUPPORTS_SPARSE_FILES 0x000000401184 #define FILE_SUPPORTS_REPARSE_POINTS 0x000000801185 #define FILE_SUPPORTS_REMOTE_STORAGE 0x000001001186 #define FS_LFN_APIS 0x000040001187 #define FILE_VOLUME_IS_COMPRESSED 0x000080001188 #define FILE_SUPPORTS_OBJECT_IDS 0x000100001189 #define FILE_SUPPORTS_ENCRYPTION 0x000200001190 #define FILE_NAMED_STREAMS 0x000400001191 #define FILE_READ_ONLY_VOLUME 0x000800001192 432 1193 433 /* ChangeNotify flags. */ … … 1208 448 (FILE_NOTIFY_CHANGE_FILE_NAME|FILE_NOTIFY_CHANGE_DIR_NAME) 1209 449 450 #define FILE_NOTIFY_CHANGE_ALL \ 451 (FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_DIR_NAME | \ 452 FILE_NOTIFY_CHANGE_ATTRIBUTES | FILE_NOTIFY_CHANGE_SIZE | \ 453 FILE_NOTIFY_CHANGE_LAST_WRITE | FILE_NOTIFY_CHANGE_LAST_ACCESS | \ 454 FILE_NOTIFY_CHANGE_CREATION | FILE_NOTIFY_CHANGE_EA | \ 455 FILE_NOTIFY_CHANGE_SECURITY | FILE_NOTIFY_CHANGE_STREAM_NAME | \ 456 FILE_NOTIFY_CHANGE_STREAM_SIZE | FILE_NOTIFY_CHANGE_STREAM_WRITE) 457 1210 458 /* change notify action results */ 1211 459 #define NOTIFY_ACTION_ADDED 1 … … 1218 466 #define NOTIFY_ACTION_MODIFIED_STREAM 8 1219 467 468 /* 469 * Timestamp format used in "previous versions": 470 * This is the windows-level format of the @GMT- token. 471 * It is a fixed format not to be confused with the 472 * format for the POSIX-Level token of the shadow_copy2 473 * VFS module that can be configured via the "shadow:format" 474 * configuration option but defaults to the same format. 475 * See the shadow_copy2 module. 476 */ 477 #define GMT_NAME_LEN 24 /* length of a @GMT- name */ 478 #define GMT_FORMAT "@GMT-%Y.%m.%d-%H.%M.%S" 1220 479 1221 480 /* where to find the base of the SMB packet proper */ 1222 #define smb_base(buf) (((c har *)(buf))+4)481 #define smb_base(buf) (((const char *)(buf))+4) 1223 482 1224 483 /* we don't allow server strings to be longer than 48 characters as … … 1228 487 1229 488 #define SMB_SUCCESS 0 /* The request was successful. */ 1230 1231 #ifdef WITH_DFS1232 void dfs_unlogin(void);1233 extern int dcelogin_atmost_once;1234 #endif1235 489 1236 490 #ifdef NOSTRDUP … … 1253 507 * Setting this above 4.9 can have undesired side-effects. 1254 508 * This may change again in Samba-3.0 after further testing. JHT 509 * 510 * Version 6.1 - For older smb server versions, MMC doesn't let offline 511 * settings to be configured during share creation. Changing 512 * it to 6.1 to mimic Win2K8R2. 513 * 1255 514 */ 1256 515 1257 #define DEFAULT_MAJOR_VERSION 0x041258 #define DEFAULT_MINOR_VERSION 0x09516 #define SAMBA_MAJOR_NBT_ANNOUNCE_VERSION 0x06 517 #define SAMBA_MINOR_NBT_ANNOUNCE_VERSION 0x01 1259 518 1260 519 /* Browser Election Values */ … … 1262 521 #define BROWSER_CONSTANT 0xaa55 1263 522 1264 /* Sercurity mode bits. */1265 #define NEGOTIATE_SECURITY_USER_LEVEL 0x011266 #define NEGOTIATE_SECURITY_CHALLENGE_RESPONSE 0x021267 #define NEGOTIATE_SECURITY_SIGNATURES_ENABLED 0x041268 #define NEGOTIATE_SECURITY_SIGNATURES_REQUIRED 0x081269 1270 /* NT Flags2 bits - cifs6.txt section 3.1.2 */1271 1272 #define FLAGS2_LONG_PATH_COMPONENTS 0x00011273 #define FLAGS2_EXTENDED_ATTRIBUTES 0x00021274 #define FLAGS2_SMB_SECURITY_SIGNATURES 0x00041275 #define FLAGS2_UNKNOWN_BIT4 0x00101276 #define FLAGS2_IS_LONG_NAME 0x00401277 #define FLAGS2_EXTENDED_SECURITY 0x08001278 #define FLAGS2_DFS_PATHNAMES 0x10001279 #define FLAGS2_READ_PERMIT_EXECUTE 0x20001280 #define FLAGS2_32_BIT_ERROR_CODES 0x40001281 #define FLAGS2_UNICODE_STRINGS 0x80001282 1283 #define FLAGS2_WIN2K_SIGNATURE 0xC852 /* Hack alert ! For now... JRA. */1284 1285 /* TCONX Flag (smb_vwv2). */1286 #define TCONX_FLAG_EXTENDED_RESPONSE 0x81287 1288 523 /* File Status Flags. See: 1289 524 … … 1294 529 #define NO_SUBSTREAMS 0x2 1295 530 #define NO_REPARSETAG 0x4 1296 1297 /* Capabilities. see ftp.microsoft.com/developr/drg/cifs/cifs/cifs4.txt */1298 1299 #define CAP_RAW_MODE 0x00011300 #define CAP_MPX_MODE 0x00021301 #define CAP_UNICODE 0x00041302 #define CAP_LARGE_FILES 0x00081303 #define CAP_NT_SMBS 0x00101304 #define CAP_RPC_REMOTE_APIS 0x00201305 #define CAP_STATUS32 0x00401306 #define CAP_LEVEL_II_OPLOCKS 0x00801307 #define CAP_LOCK_AND_READ 0x01001308 #define CAP_NT_FIND 0x02001309 #define CAP_DFS 0x10001310 #define CAP_W2K_SMBS 0x20001311 #define CAP_LARGE_READX 0x40001312 #define CAP_LARGE_WRITEX 0x80001313 #define CAP_UNIX 0x800000 /* Capabilities for UNIX extensions. Created by HP. */1314 #define CAP_EXTENDED_SECURITY 0x800000001315 1316 /* protocol types. It assumes that higher protocols include lower protocols1317 as subsets */1318 enum protocol_types {1319 PROTOCOL_NONE,1320 PROTOCOL_CORE,1321 PROTOCOL_COREPLUS,1322 PROTOCOL_LANMAN1,1323 PROTOCOL_LANMAN2,1324 PROTOCOL_NT1,1325 PROTOCOL_SMB21326 };1327 1328 /* security levels */1329 enum security_types {SEC_SHARE,SEC_USER,SEC_SERVER,SEC_DOMAIN,SEC_ADS};1330 1331 /* server roles */1332 enum server_types {1333 ROLE_STANDALONE,1334 ROLE_DOMAIN_MEMBER,1335 ROLE_DOMAIN_BDC,1336 ROLE_DOMAIN_PDC1337 };1338 1339 /* printing types */1340 enum printing_types {PRINT_BSD,PRINT_SYSV,PRINT_AIX,PRINT_HPUX,1341 PRINT_QNX,PRINT_PLP,PRINT_LPRNG,PRINT_SOFTQ,1342 PRINT_CUPS,PRINT_LPRNT,PRINT_LPROS2,PRINT_IPRINT1343 #if defined(DEVELOPER) || defined(ENABLE_BUILD_FARM_HACKS)1344 ,PRINT_TEST,PRINT_VLP1345 #endif /* DEVELOPER */1346 };1347 1348 /* LDAP SSL options */1349 enum ldap_ssl_types {LDAP_SSL_OFF, LDAP_SSL_START_TLS};1350 1351 /* LDAP PASSWD SYNC methods */1352 enum ldap_passwd_sync_types {LDAP_PASSWD_SYNC_ON, LDAP_PASSWD_SYNC_OFF, LDAP_PASSWD_SYNC_ONLY};1353 1354 /*1355 * This should be under the HAVE_KRB5 flag but since they're used1356 * in lp_kerberos_method(), they ned to be always available1357 * If you add any entries to KERBEROS_VERIFY defines, please modify USE.*KEYTAB macros1358 * so they remain accurate.1359 */1360 1361 #define KERBEROS_VERIFY_SECRETS 01362 #define KERBEROS_VERIFY_SYSTEM_KEYTAB 11363 #define KERBEROS_VERIFY_DEDICATED_KEYTAB 21364 #define KERBEROS_VERIFY_SECRETS_AND_KEYTAB 31365 531 1366 532 /* Remote architectures we know about. */ … … 1369 535 RA_SAMBA, RA_CIFSFS, RA_WINXP64, RA_OSX}; 1370 536 1371 /* case handling */ 1372 enum case_handling {CASE_LOWER,CASE_UPPER}; 1373 1374 /* ACL compatibility */ 1375 enum acl_compatibility {ACL_COMPAT_AUTO, ACL_COMPAT_WINNT, ACL_COMPAT_WIN2K}; 1376 /* 1377 * Global value meaing that the smb_uid field should be 537 /* 538 * Global value meaning that the smb_uid field should be 1378 539 * ingored (in share level security and protocol level == CORE) 1379 540 */ … … 1382 543 #define VUID_OFFSET 100 /* Amount to bias returned vuid numbers */ 1383 544 545 #define TID_FIELD_INVALID 0 546 547 #define FNUM_FIELD_INVALID 0 548 1384 549 /* 1385 550 * Size of buffer to use when moving files across filesystems. … … 1403 568 #define EXTENDED_OPLOCK_REQUEST(inbuf) ((SVAL(inbuf,smb_vwv2)&((1<<1)|(1<<2)))>>1) 1404 569 1405 /* Lock types. */1406 #define LOCKING_ANDX_SHARED_LOCK 0x11407 #define LOCKING_ANDX_OPLOCK_RELEASE 0x21408 #define LOCKING_ANDX_CHANGE_LOCKTYPE 0x41409 #define LOCKING_ANDX_CANCEL_LOCK 0x81410 #define LOCKING_ANDX_LARGE_FILES 0x101411 1412 570 /* 1413 571 * Bits we test with. … … 1415 573 */ 1416 574 1417 #define NO_OPLOCK 0x0 1418 #define EXCLUSIVE_OPLOCK 0x1 1419 #define BATCH_OPLOCK 0x2 1420 #define LEVEL_II_OPLOCK 0x4 575 #define NO_OPLOCK OPLOCK_NONE 576 #define EXCLUSIVE_OPLOCK OPLOCK_EXCLUSIVE 577 #define BATCH_OPLOCK OPLOCK_BATCH 578 #define LEVEL_II_OPLOCK OPLOCK_LEVEL_II 579 #define LEASE_OPLOCK 0x100 1421 580 1422 581 /* The following are Samba-private. */ 1423 582 #define INTERNAL_OPEN_ONLY 0x8 1424 #define FAKE_LEVEL_II_OPLOCK 0x10 /* Client requested no_oplock, but we have to 583 /* #define FAKE_LEVEL_II_OPLOCK 0x10 */ /* Not used anymore */ 584 /* Client requested no_oplock, but we have to 1425 585 * inform potential level2 holders on 1426 586 * write. */ 1427 #define DEFERRED_OPEN_ENTRY 0x20 1428 #define UNUSED_SHARE_MODE_ENTRY 0x40 1429 #define FORCE_OPLOCK_BREAK_TO_NONE 0x80 587 /* #define DEFERRED_OPEN_ENTRY 0x20 */ /* Not used anymore */ 588 /* #define UNUSED_SHARE_MODE_ENTRY 0x40 */ /* Not used anymore */ 589 /* #define FORCE_OPLOCK_BREAK_TO_NONE 0x80 */ /* Not used anymore */ 1430 590 1431 591 /* None of the following should ever appear in fsp->oplock_request. */ 1432 #define SAMBA_PRIVATE_OPLOCK_MASK (INTERNAL_OPEN_ONLY |DEFERRED_OPEN_ENTRY|UNUSED_SHARE_MODE_ENTRY|FORCE_OPLOCK_BREAK_TO_NONE)592 #define SAMBA_PRIVATE_OPLOCK_MASK (INTERNAL_OPEN_ONLY) 1433 593 1434 594 #define EXCLUSIVE_OPLOCK_TYPE(lck) ((lck) & ((unsigned int)EXCLUSIVE_OPLOCK|(unsigned int)BATCH_OPLOCK)) 1435 595 #define BATCH_OPLOCK_TYPE(lck) ((lck) & (unsigned int)BATCH_OPLOCK) 1436 #define LEVEL_II_OPLOCK_TYPE(lck) ((lck) & ( (unsigned int)LEVEL_II_OPLOCK|(unsigned int)FAKE_LEVEL_II_OPLOCK))596 #define LEVEL_II_OPLOCK_TYPE(lck) ((lck) & (unsigned int)LEVEL_II_OPLOCK) 1437 597 1438 598 /* kernel_oplock_message definition. … … 1497 657 KERNEL_OPLOCK_CAPABILITY, 1498 658 DMAPI_ACCESS_CAPABILITY, 1499 LEASE_CAPABILITY 659 LEASE_CAPABILITY, 660 DAC_OVERRIDE_CAPABILITY 1500 661 }; 1501 662 … … 1574 735 }; 1575 736 1576 typedef struct user_struct {1577 struct user_struct *next, *prev;1578 uint16 vuid; /* Tag for this entry. */1579 1580 char *session_keystr; /* used by utmp and pam session code.1581 TDB key string */1582 int homes_snum;1583 1584 struct auth_serversupplied_info *session_info;1585 1586 struct auth_ntlmssp_state *auth_ntlmssp_state;1587 } user_struct;1588 1589 struct unix_error_map {1590 int unix_error;1591 int dos_class;1592 int dos_code;1593 NTSTATUS nt_error;1594 };1595 1596 /*1597 Do you want session setups at user level security with a invalid1598 password to be rejected or allowed in as guest? WinNT rejects them1599 but it can be a pain as it means "net view" needs to use a password1600 1601 You have 3 choices in the setting of map_to_guest:1602 1603 "NEVER_MAP_TO_GUEST" means session setups with an invalid password1604 are rejected. This is the default.1605 1606 "MAP_TO_GUEST_ON_BAD_USER" means session setups with an invalid password1607 are rejected, unless the username does not exist, in which case it1608 is treated as a guest login1609 1610 "MAP_TO_GUEST_ON_BAD_PASSWORD" means session setups with an invalid password1611 are treated as a guest login1612 1613 Note that map_to_guest only has an effect in user or server1614 level security.1615 */1616 1617 #define NEVER_MAP_TO_GUEST 01618 #define MAP_TO_GUEST_ON_BAD_USER 11619 #define MAP_TO_GUEST_ON_BAD_PASSWORD 21620 #define MAP_TO_GUEST_ON_BAD_UID 31621 1622 737 #define SAFE_NETBIOS_CHARS ". -_" 1623 738 … … 1641 756 1642 757 struct ea_struct { 1643 uint8 flags;758 uint8_t flags; 1644 759 char *name; 1645 760 DATA_BLOB value; … … 1659 774 /* Prefix for xattrs storing streams. */ 1660 775 #define SAMBA_XATTR_MARKER "user.SAMBA_STREAMS" 1661 1662 /* map readonly options */1663 enum mapreadonly_options {MAP_READONLY_NO, MAP_READONLY_YES, MAP_READONLY_PERMISSIONS};1664 776 1665 777 /* usershare error codes. */ … … 1688 800 #define SAMBA_EXTENDED_INFO_VERSION_STRING_LENGTH 28 1689 801 struct smb_extended_info { 1690 uint32 samba_magic; /* Always SAMBA_EXTRA_INFO_MAGIC */1691 uint32 samba_version; /* Major/Minor/Release/Revision */1692 uint32 samba_subversion; /* Prerelease/RC/Vendor patch */802 uint32_t samba_magic; /* Always SAMBA_EXTRA_INFO_MAGIC */ 803 uint32_t samba_version; /* Major/Minor/Release/Revision */ 804 uint32_t samba_subversion; /* Prerelease/RC/Vendor patch */ 1693 805 NTTIME samba_gitcommitdate; 1694 806 char samba_version_string[SAMBA_EXTENDED_INFO_VERSION_STRING_LENGTH]; 1695 807 }; 1696 808 1697 /* time info */1698 struct smb_file_time {1699 struct timespec mtime;1700 struct timespec atime;1701 struct timespec ctime;1702 struct timespec create_time;1703 };1704 1705 /*1706 * unix_convert_flags1707 */1708 #define UCF_SAVE_LCOMP 0x000000011709 #define UCF_ALWAYS_ALLOW_WCARD_LCOMP 0x000000021710 #define UCF_COND_ALLOW_WCARD_LCOMP 0x000000041711 #define UCF_POSIX_PATHNAMES 0x000000081712 #define UCF_UNIX_NAME_LOOKUP 0x000000101713 #define UCF_CREATING_FILE 0x000000201714 1715 /*1716 * smb_filename1717 */1718 struct smb_filename {1719 char *base_name;1720 char *stream_name;1721 char *original_lcomp;1722 SMB_STRUCT_STAT st;1723 };1724 1725 /* struct for maintaining the child processes that get spawned from smbd */1726 struct child_pid {1727 struct child_pid *prev, *next;1728 pid_t pid;1729 };1730 1731 /* Used to keep track of deferred opens. */1732 struct deferred_open_record;1733 1734 /* Client-side offline caching policy types */1735 #define CSC_POLICY_MANUAL 01736 #define CSC_POLICY_DOCUMENTS 11737 #define CSC_POLICY_PROGRAMS 21738 #define CSC_POLICY_DISABLE 31739 1740 /* Used inside aio code. */1741 struct aio_extra;1742 1743 809 /* 1744 810 * Reasons for cache flush. … … 1746 812 1747 813 enum flush_reason_enum { 1748 SEEK_FLUSH, 1749 READ_FLUSH, 1750 WRITE_FLUSH, 1751 READRAW_FLUSH, 1752 OPLOCK_RELEASE_FLUSH, 1753 CLOSE_FLUSH, 1754 SYNC_FLUSH, 1755 SIZECHANGE_FLUSH, 1756 /* NUM_FLUSH_REASONS must remain the last value in the enumeration. */ 1757 NUM_FLUSH_REASONS}; 814 SAMBA_SEEK_FLUSH, 815 SAMBA_READ_FLUSH, 816 SAMBA_WRITE_FLUSH, 817 SAMBA_READRAW_FLUSH, 818 SAMBA_OPLOCK_RELEASE_FLUSH, 819 SAMBA_CLOSE_FLUSH, 820 SAMBA_SYNC_FLUSH, 821 SAMBA_SIZECHANGE_FLUSH, 822 }; 1758 823 1759 824 #endif /* _SMB_H */ -
vendor/current/source3/include/smb_acls.h
r414 r988 21 21 #define _SMB_ACLS_H 22 22 23 #include "librpc/gen_ndr/smb_acl.h" 24 25 struct vfs_handle_struct; 26 struct files_struct; 27 23 28 typedef int SMB_ACL_TYPE_T; 24 29 typedef mode_t *SMB_ACL_PERMSET_T; 25 30 typedef mode_t SMB_ACL_PERM_T; 26 #define SMB_ACL_READ 427 #define SMB_ACL_WRITE 228 #define SMB_ACL_EXECUTE 129 30 /* Types of ACLs. */31 enum smb_acl_tag_t {32 SMB_ACL_TAG_INVALID=0,33 SMB_ACL_USER=1,34 SMB_ACL_USER_OBJ,35 SMB_ACL_GROUP,36 SMB_ACL_GROUP_OBJ,37 SMB_ACL_OTHER,38 SMB_ACL_MASK39 };40 31 41 32 typedef enum smb_acl_tag_t SMB_ACL_TAG_T; 42 43 struct smb_acl_entry { 44 enum smb_acl_tag_t a_type; 45 SMB_ACL_PERM_T a_perm; 46 uid_t uid; 47 gid_t gid; 48 }; 49 50 typedef struct smb_acl_t { 51 int size; 52 int count; 53 int next; 54 struct smb_acl_entry acl[1]; 55 } *SMB_ACL_T; 33 typedef struct smb_acl_t *SMB_ACL_T; 56 34 57 35 typedef struct smb_acl_entry *SMB_ACL_ENTRY_T; 58 36 59 #define SMB_ACL_FIRST_ENTRY 0 60 #define SMB_ACL_NEXT_ENTRY 1 37 /* The following definitions come from lib/sysacls.c */ 61 38 62 #define SMB_ACL_TYPE_ACCESS 0 63 #define SMB_ACL_TYPE_DEFAULT 1 39 int sys_acl_get_entry(SMB_ACL_T acl_d, int entry_id, SMB_ACL_ENTRY_T *entry_p); 40 int sys_acl_get_tag_type(SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *type_p); 41 int sys_acl_get_permset(SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p); 42 void *sys_acl_get_qualifier(SMB_ACL_ENTRY_T entry_d); 43 int sys_acl_clear_perms(SMB_ACL_PERMSET_T permset_d); 44 int sys_acl_add_perm(SMB_ACL_PERMSET_T permset_d, SMB_ACL_PERM_T perm); 45 int sys_acl_get_perm(SMB_ACL_PERMSET_T permset_d, SMB_ACL_PERM_T perm); 46 char *sys_acl_to_text(const struct smb_acl_t *acl_d, ssize_t *len_p); 47 SMB_ACL_T sys_acl_init(TALLOC_CTX *mem_ctx); 48 int sys_acl_create_entry(SMB_ACL_T *acl_p, SMB_ACL_ENTRY_T *entry_p); 49 int sys_acl_set_tag_type(SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T tag_type); 50 int sys_acl_set_qualifier(SMB_ACL_ENTRY_T entry_d, void *qual_p); 51 int sys_acl_set_permset(SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T permset_d); 52 int sys_acl_free_text(char *text); 53 int sys_acl_valid(SMB_ACL_T acl_d); 54 SMB_ACL_T sys_acl_get_file(struct vfs_handle_struct *handle, 55 const char *path_p, SMB_ACL_TYPE_T type, 56 TALLOC_CTX *mem_ctx); 57 SMB_ACL_T sys_acl_get_fd(struct vfs_handle_struct *handle, struct files_struct *fsp, 58 TALLOC_CTX *mem_ctx); 59 int sys_acl_set_file(struct vfs_handle_struct *handle, 60 const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d); 61 int sys_acl_set_fd(struct vfs_handle_struct *handle, struct files_struct *fsp, 62 SMB_ACL_T acl_d); 63 int sys_acl_delete_def_file(struct vfs_handle_struct *handle, 64 const char *path); 65 int no_acl_syscall_error(int err); 64 66 65 67 #endif /* _SMB_ACLS_H */ -
vendor/current/source3/include/smb_krb5.h
r740 r988 1 /* 2 Unix SMB/CIFS implementation. 3 simple kerberos5 routines for active directory 4 Copyright (C) Andrew Tridgell 2001 5 Copyright (C) Luke Howard 2002-2003 6 Copyright (C) Andrew Bartlett <abartlet@samba.org> 2005 7 Copyright (C) Guenther Deschner 2005-2009 8 9 This program is free software; you can redistribute it and/or modify 10 it under the terms of the GNU General Public License as published by 11 the Free Software Foundation; either version 3 of the License, or 12 (at your option) any later version. 13 14 This program is distributed in the hope that it will be useful, 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 GNU General Public License for more details. 18 19 You should have received a copy of the GNU General Public License 20 along with this program. If not, see <http://www.gnu.org/licenses/>. 21 */ 22 23 #ifndef _HEADER_smb_krb5_h 24 #define _HEADER_smb_krb5_h 25 26 #define KRB5_PRIVATE 1 /* this file uses PRIVATE interfaces! */ 27 /* this file uses DEPRECATED interfaces! */ 28 29 #if defined(HAVE_KRB5_DEPRECATED_WITH_IDENTIFIER) 30 #define KRB5_DEPRECATED 1 31 #else 32 #define KRB5_DEPRECATED 33 #endif 34 35 #if HAVE_KRB5_H 36 #include <krb5.h> 37 #endif 38 39 #if HAVE_GSSAPI_GSSAPI_H 40 #include <gssapi/gssapi.h> 41 #elif HAVE_GSSAPI_GSSAPI_GENERIC_H 42 #include <gssapi/gssapi_generic.h> 43 #elif HAVE_GSSAPI_H 44 #include <gssapi.h> 45 #endif 46 47 #if HAVE_COM_ERR_H 48 #include <com_err.h> 49 #endif 50 51 #ifndef KRB5_ADDR_NETBIOS 52 #define KRB5_ADDR_NETBIOS 0x14 53 #endif 54 55 #ifndef KRB5KRB_ERR_RESPONSE_TOO_BIG 56 #define KRB5KRB_ERR_RESPONSE_TOO_BIG (-1765328332L) 57 #endif 58 59 /* Heimdal uses a slightly different name */ 60 #if defined(HAVE_ENCTYPE_ARCFOUR_HMAC_MD5) && !defined(HAVE_ENCTYPE_ARCFOUR_HMAC) 61 #define ENCTYPE_ARCFOUR_HMAC ENCTYPE_ARCFOUR_HMAC_MD5 62 #endif 63 64 /* The older versions of heimdal that don't have this 65 define don't seem to use it anyway. I'm told they 66 always use a subkey */ 67 #ifndef HAVE_AP_OPTS_USE_SUBKEY 68 #define AP_OPTS_USE_SUBKEY 0 69 #endif 70 71 #ifdef HAVE_KRB5 72 typedef struct { 73 #if defined(HAVE_MAGIC_IN_KRB5_ADDRESS) && defined(HAVE_ADDRTYPE_IN_KRB5_ADDRESS) /* MIT */ 74 krb5_address **addrs; 75 #elif defined(HAVE_KRB5_ADDRESSES) /* Heimdal */ 76 krb5_addresses *addrs; 77 #else 78 #error UNKNOWN_KRB5_ADDRESS_TYPE 79 #endif /* defined(HAVE_MAGIC_IN_KRB5_ADDRESS) && defined(HAVE_ADDRTYPE_IN_KRB5_ADDRESS) */ 80 } smb_krb5_addresses; 81 82 #ifdef HAVE_KRB5_KEYBLOCK_KEYVALUE /* Heimdal */ 83 #define KRB5_KEY_TYPE(k) ((k)->keytype) 84 #define KRB5_KEY_LENGTH(k) ((k)->keyvalue.length) 85 #define KRB5_KEY_DATA(k) ((k)->keyvalue.data) 86 #define KRB5_KEY_DATA_CAST void 87 #else /* MIT */ 88 #define KRB5_KEY_TYPE(k) ((k)->enctype) 89 #define KRB5_KEY_LENGTH(k) ((k)->length) 90 #define KRB5_KEY_DATA(k) ((k)->contents) 91 #define KRB5_KEY_DATA_CAST krb5_octet 92 #endif /* HAVE_KRB5_KEYBLOCK_KEYVALUE */ 93 94 #ifdef HAVE_KRB5_KEYTAB_ENTRY_KEY /* MIT */ 95 #define KRB5_KT_KEY(k) (&(k)->key) 96 #elif HAVE_KRB5_KEYTAB_ENTRY_KEYBLOCK /* Heimdal */ 97 #define KRB5_KT_KEY(k) (&(k)->keyblock) 98 #else 99 #error krb5_keytab_entry has no key or keyblock member 100 #endif /* HAVE_KRB5_KEYTAB_ENTRY_KEY */ 101 102 #endif /* HAVE_KRB5 */ 103 104 #include "krb5_protos.h" 105 106 #endif /* _HEADER_smb_krb5_h */ 1 #include "lib/krb5_wrap/krb5_samba.h" 2 #include "lib/krb5_wrap/gss_samba.h" -
vendor/current/source3/include/smb_ldap.h
r740 r988 45 45 #define LDAP_CONST const 46 46 #endif 47 #ifndef LDAP_OPT_SUCCESS 48 #define LDAP_OPT_SUCCESS 0 49 #endif 47 48 #ifdef HAVE_LDAP_PVT_H 49 #include <ldap_pvt.h> 50 #endif /* HAVE_LDAP_PVT_H */ 51 50 52 /* Solaris 8 and maybe other LDAP implementations spell this "..._INPROGRESS": */ 51 53 #if defined(LDAP_SASL_BIND_INPROGRESS) && !defined(LDAP_SASL_BIND_IN_PROGRESS) … … 58 60 #define LDAPS_PORT 636 59 61 #endif 60 61 /* function declarations not included in proto.h */62 LDAP *ldap_open_with_timeout(const char *server, int port, unsigned int to);63 62 64 63 #endif /* HAVE_LDAP_H */ … … 78 77 #endif 79 78 79 #define LDAP_DEFAULT_TIMEOUT 15 80 #define LDAP_CONNECTION_DEFAULT_TIMEOUT 2 81 #define LDAP_PAGE_SIZE 1000 82 83 #define ADS_PAGE_CTL_OID "1.2.840.113556.1.4.319" 84 85 /* 86 * Work around versions of the LDAP client libs that don't have the OIDs 87 * defined, or have them defined under the old name. 88 * This functionality is really a factor of the server, not the client 89 * 90 */ 91 92 #if defined(LDAP_EXOP_X_MODIFY_PASSWD) && !defined(LDAP_EXOP_MODIFY_PASSWD) 93 #define LDAP_EXOP_MODIFY_PASSWD LDAP_EXOP_X_MODIFY_PASSWD 94 #elif !defined(LDAP_EXOP_MODIFY_PASSWD) 95 #define LDAP_EXOP_MODIFY_PASSWD "1.3.6.1.4.1.4203.1.11.1" 96 #endif 97 98 #if defined(LDAP_EXOP_X_MODIFY_PASSWD_ID) && !defined(LDAP_EXOP_MODIFY_PASSWD_ID) 99 #define LDAP_TAG_EXOP_MODIFY_PASSWD_ID LDAP_EXOP_X_MODIFY_PASSWD_ID 100 #elif !defined(LDAP_EXOP_MODIFY_PASSWD_ID) 101 #define LDAP_TAG_EXOP_MODIFY_PASSWD_ID ((ber_tag_t) 0x80U) 102 #endif 103 104 #if defined(LDAP_EXOP_X_MODIFY_PASSWD_NEW) && !defined(LDAP_EXOP_MODIFY_PASSWD_NEW) 105 #define LDAP_TAG_EXOP_MODIFY_PASSWD_NEW LDAP_EXOP_X_MODIFY_PASSWD_NEW 106 #elif !defined(LDAP_EXOP_MODIFY_PASSWD_NEW) 107 #define LDAP_TAG_EXOP_MODIFY_PASSWD_NEW ((ber_tag_t) 0x82U) 108 #endif 109 80 110 #endif /* _SMB_LDAP_H */ -
vendor/current/source3/include/smb_macros.h
r740 r988 6 6 Copyright (C) Luke Kenneth Casson Leighton 1996-1999 7 7 Copyright (C) Paul Ashton 1998 - 1999 8 8 9 9 This program is free software; you can redistribute it and/or modify 10 10 it under the terms of the GNU General Public License as published by 11 11 the Free Software Foundation; either version 3 of the License, or 12 12 (at your option) any later version. 13 13 14 14 This program is distributed in the hope that it will be useful, 15 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 17 GNU General Public License for more details. 18 18 19 19 You should have received a copy of the GNU General Public License 20 20 along with this program. If not, see <http://www.gnu.org/licenses/>. … … 73 73 #define GUEST_OK(snum) (VALID_SNUM(snum) && lp_guest_ok(snum)) 74 74 #define GUEST_ONLY(snum) (VALID_SNUM(snum) && lp_guest_only(snum)) 75 #define CAN_SETDIR(snum) (!lp_no_set_dir(snum)) 76 #define CAN_PRINT(conn) ((conn) && lp_print_ok(SNUM(conn))) 75 #define CAN_PRINT(conn) ((conn) && lp_printable(SNUM(conn))) 77 76 #define MAP_HIDDEN(conn) ((conn) && lp_map_hidden(SNUM(conn))) 78 77 #define MAP_SYSTEM(conn) ((conn) && lp_map_system(SNUM(conn))) … … 105 104 #define SMB_LARGE_LKLEN_OFFSET_LOW(indx) (16 + (20 * (indx))) 106 105 107 #define ERROR_DOS(class,code) error_packet(outbuf,class,code,NT_STATUS_OK,__LINE__,__FILE__)108 106 #define ERROR_NT(status) error_packet(outbuf,0,0,status,__LINE__,__FILE__) 109 #define ERROR_FORCE_NT(status) error_packet(outbuf,-1,-1,status,__LINE__,__FILE__)110 107 #define ERROR_BOTH(status,class,code) error_packet(outbuf,class,code,status,__LINE__,__FILE__) 111 108 … … 124 121 /* Extra macros added by Ying Chen at IBM - speed increase by inlining. */ 125 122 #define smb_buf(buf) (((char *)(buf)) + smb_size + CVAL(buf,smb_wct)*2) 123 #define smb_buf_const(buf) (((const char *)(buf)) + smb_size + CVAL(buf,smb_wct)*2) 126 124 #define smb_buflen(buf) (SVAL(buf,smb_vwv0 + (int)CVAL(buf, smb_wct)*2)) 127 125 … … 134 132 #define smb_offset(p,buf) (PTR_DIFF(p,buf+4)) 135 133 136 #define smb_len(buf) (PVAL(buf,3)|(PVAL(buf,2)<<8)|((PVAL(buf,1)&1)<<16)) 137 #define _smb_setlen(buf,len) do { buf[0] = 0; buf[1] = ((len)&0x10000)>>16; \ 138 buf[2] = ((len)&0xFF00)>>8; buf[3] = (len)&0xFF; } while (0) 139 140 #define smb_len_large(buf) (PVAL(buf,3)|(PVAL(buf,2)<<8)|(PVAL(buf,1)<<16)) 141 #define _smb_setlen_large(buf,len) do { buf[0] = 0; buf[1] = ((len)&0xFF0000)>>16; \ 142 buf[2] = ((len)&0xFF00)>>8; buf[3] = (len)&0xFF; } while (0) 143 144 #define ENCRYPTION_REQUIRED(conn) ((conn) ? ((conn)->encrypt_level == Required) : false) 134 #define smb_len(buf) smb_len_nbt(buf) 135 #define _smb_setlen(buf, len) _smb_setlen_nbt(buf, len) 136 #define smb_setlen(buf, len) smb_setlen_nbt(buf, len) 137 138 #define smb_len_large(buf) smb_len_tcp(buf) 139 #define _smb_setlen_large(buf, len) _smb_setlen_tcp(buf, len) 140 141 #define ENCRYPTION_REQUIRED(conn) ((conn) ? ((conn)->encrypt_level == SMB_SIGNING_REQUIRED) : false) 145 142 #define IS_CONN_ENCRYPTED(conn) ((conn) ? (conn)->encrypted_tid : false) 146 143 … … 174 171 ********************************************************************/ 175 172 176 #define SERVER_HAS_UNIX_CIFS(c) ( (c)->capabilities& CAP_UNIX)173 #define SERVER_HAS_UNIX_CIFS(c) (smb1cli_conn_capabilities(c->conn) & CAP_UNIX) 177 174 178 175 /**************************************************************************** … … 182 179 #define IS_DIRECTORY_SEP(c) ((c) == '\\' || (c) == '/') 183 180 #define unix_format(fname) string_replace(fname,'\\','/') 184 #define unix_format_w(fname) string_replace_w(fname, UCS2_CHAR('\\'), UCS2_CHAR('/'))185 181 186 182 /**************************************************************************** … … 194 190 *****************************************************************************/ 195 191 196 #define IS_DC (lp_server_role()==ROLE_DOMAIN_PDC || lp_server_role()==ROLE_DOMAIN_BDC )192 #define IS_DC (lp_server_role()==ROLE_DOMAIN_PDC || lp_server_role()==ROLE_DOMAIN_BDC || lp_server_role() == ROLE_ACTIVE_DIRECTORY_DC) 197 193 198 194 /* … … 219 215 #define SMB_XMALLOC_ARRAY(type,count) (type *)smb_xmalloc_array(sizeof(type),(count)) 220 216 221 /* The new talloc is paranoid malloc checker safe. */222 223 #if 0224 225 Disable these now we have checked all code paths and ensured226 NULL returns on zero request. JRA.227 228 #define TALLOC(ctx, size) talloc_zeronull(ctx, size, __location__)229 #define TALLOC_P(ctx, type) (type *)talloc_zeronull(ctx, sizeof(type), #type)230 #define TALLOC_ARRAY(ctx, type, count) (type *)_talloc_array_zeronull(ctx, sizeof(type), count, #type)231 #define TALLOC_MEMDUP(ctx, ptr, size) _talloc_memdup_zeronull(ctx, ptr, size, __location__)232 #define TALLOC_ZERO(ctx, size) _talloc_zero_zeronull(ctx, size, __location__)233 #define TALLOC_ZERO_P(ctx, type) (type *)_talloc_zero_zeronull(ctx, sizeof(type), #type)234 #define TALLOC_ZERO_ARRAY(ctx, type, count) (type *)_talloc_zero_array_zeronull(ctx, sizeof(type), count, #type)235 #define TALLOC_SIZE(ctx, size) talloc_zeronull(ctx, size, __location__)236 #define TALLOC_ZERO_SIZE(ctx, size) _talloc_zero_zeronull(ctx, size, __location__)237 238 #else239 240 217 #define TALLOC(ctx, size) talloc_named_const(ctx, size, __location__) 241 #define TALLOC_P(ctx, type) (type *)talloc_named_const(ctx, sizeof(type), #type)242 #define TALLOC_ARRAY(ctx, type, count) (type *)_talloc_array(ctx, sizeof(type), count, #type)243 #define TALLOC_MEMDUP(ctx, ptr, size) _talloc_memdup(ctx, ptr, size, __location__)244 218 #define TALLOC_ZERO(ctx, size) _talloc_zero(ctx, size, __location__) 245 #define TALLOC_ZERO_P(ctx, type) (type *)_talloc_zero(ctx, sizeof(type), #type)246 #define TALLOC_ZERO_ARRAY(ctx, type, count) (type *)_talloc_zero_array(ctx, sizeof(type), count, #type)247 219 #define TALLOC_SIZE(ctx, size) talloc_named_const(ctx, size, __location__) 248 220 #define TALLOC_ZERO_SIZE(ctx, size) _talloc_zero(ctx, size, __location__) 249 221 250 #endif251 252 222 #define TALLOC_REALLOC(ctx, ptr, count) _talloc_realloc(ctx, ptr, count, __location__) 253 #define TALLOC_REALLOC_ARRAY(ctx, ptr, type, count) (type *)_talloc_realloc_array(ctx, ptr, sizeof(type), count, #type)254 223 #define talloc_destroy(ctx) talloc_free(ctx) 255 224 #ifndef TALLOC_FREE … … 314 283 do { \ 315 284 *(array) = ((mem_ctx) != NULL) ? \ 316 TALLOC_REALLOC_ARRAY(mem_ctx, (*(array)), type, (*(num))+1) : \285 talloc_realloc(mem_ctx, (*(array)), type, (*(num))+1) : \ 317 286 SMB_REALLOC_ARRAY((*(array)), type, (*(num))+1); \ 318 287 SMB_ASSERT((*(array)) != NULL); \ … … 324 293 add_to_large_array((mem_ctx), sizeof(type), &(elem), (void *)(array), (num), (size)); 325 294 326 #ifndef toupper_ascii_fast 327 /* Warning - this must only be called with 0 <= c < 128. IT WILL 328 * GIVE GARBAGE if c > 128 or c < 0. JRA. 329 */ 330 extern const char toupper_ascii_fast_table[]; 331 #define toupper_ascii_fast(c) toupper_ascii_fast_table[(unsigned int)(c)]; 332 #endif 295 #define trans_oob(bufsize, offset, length) \ 296 smb_buffer_oob(bufsize, offset, length) 333 297 334 298 #endif /* _SMB_MACROS_H */ -
vendor/current/source3/include/smbldap.h
r740 r988 22 22 #define _SMBLDAP_H 23 23 24 struct smbldap_state; 25 26 #include "smb_ldap.h" 24 #include "include/smb_ldap.h" 27 25 28 26 #ifdef HAVE_LDAP 29 27 30 /* specify schema versions between 2.2. and 3.0 */ 31 32 #define SCHEMAVER_SAMBAACCOUNT 1 33 #define SCHEMAVER_SAMBASAMACCOUNT 2 34 35 /* objectclass names */ 36 37 #define LDAP_OBJ_SAMBASAMACCOUNT "sambaSamAccount" 38 #define LDAP_OBJ_SAMBAACCOUNT "sambaAccount" 39 #define LDAP_OBJ_GROUPMAP "sambaGroupMapping" 40 #define LDAP_OBJ_DOMINFO "sambaDomain" 41 #define LDAP_OBJ_IDPOOL "sambaUnixIdPool" 42 #define LDAP_OBJ_IDMAP_ENTRY "sambaIdmapEntry" 43 #define LDAP_OBJ_SID_ENTRY "sambaSidEntry" 44 #define LDAP_OBJ_TRUST_PASSWORD "sambaTrustPassword" 45 #define LDAP_OBJ_TRUSTDOM_PASSWORD "sambaTrustedDomainPassword" 46 #define LDAP_OBJ_TRUSTED_DOMAIN "sambaTrustedDomain" 47 48 #define LDAP_OBJ_ACCOUNT "account" 49 #define LDAP_OBJ_POSIXACCOUNT "posixAccount" 50 #define LDAP_OBJ_POSIXGROUP "posixGroup" 51 #define LDAP_OBJ_OU "organizationalUnit" 52 53 /* some generic attributes that get reused a lot */ 54 55 #define LDAP_ATTRIBUTE_SID "sambaSID" 56 #define LDAP_ATTRIBUTE_UIDNUMBER "uidNumber" 57 #define LDAP_ATTRIBUTE_GIDNUMBER "gidNumber" 58 #define LDAP_ATTRIBUTE_SID_LIST "sambaSIDList" 59 60 /* attribute map table indexes */ 61 62 #define LDAP_ATTR_LIST_END 0 63 #define LDAP_ATTR_UID 1 64 #define LDAP_ATTR_UIDNUMBER 2 65 #define LDAP_ATTR_GIDNUMBER 3 66 #define LDAP_ATTR_UNIX_HOME 4 67 #define LDAP_ATTR_PWD_LAST_SET 5 68 #define LDAP_ATTR_PWD_CAN_CHANGE 6 69 #define LDAP_ATTR_PWD_MUST_CHANGE 7 70 #define LDAP_ATTR_LOGON_TIME 8 71 #define LDAP_ATTR_LOGOFF_TIME 9 72 #define LDAP_ATTR_KICKOFF_TIME 10 73 #define LDAP_ATTR_CN 11 74 #define LDAP_ATTR_DISPLAY_NAME 12 75 #define LDAP_ATTR_HOME_PATH 13 76 #define LDAP_ATTR_LOGON_SCRIPT 14 77 #define LDAP_ATTR_PROFILE_PATH 15 78 #define LDAP_ATTR_DESC 16 79 #define LDAP_ATTR_USER_WKS 17 80 #define LDAP_ATTR_USER_SID 18 81 #define LDAP_ATTR_USER_RID 18 82 #define LDAP_ATTR_PRIMARY_GROUP_SID 19 83 #define LDAP_ATTR_PRIMARY_GROUP_RID 20 84 #define LDAP_ATTR_LMPW 21 85 #define LDAP_ATTR_NTPW 22 86 #define LDAP_ATTR_DOMAIN 23 87 #define LDAP_ATTR_OBJCLASS 24 88 #define LDAP_ATTR_ACB_INFO 25 89 #define LDAP_ATTR_NEXT_USERRID 26 90 #define LDAP_ATTR_NEXT_GROUPRID 27 91 #define LDAP_ATTR_DOM_SID 28 92 #define LDAP_ATTR_HOME_DRIVE 29 93 #define LDAP_ATTR_GROUP_SID 30 94 #define LDAP_ATTR_GROUP_TYPE 31 95 #define LDAP_ATTR_SID 32 96 #define LDAP_ATTR_ALGORITHMIC_RID_BASE 33 97 #define LDAP_ATTR_NEXT_RID 34 98 #define LDAP_ATTR_BAD_PASSWORD_COUNT 35 99 #define LDAP_ATTR_LOGON_COUNT 36 100 #define LDAP_ATTR_MUNGED_DIAL 37 101 #define LDAP_ATTR_BAD_PASSWORD_TIME 38 102 #define LDAP_ATTR_PWD_HISTORY 39 103 #define LDAP_ATTR_SID_LIST 40 104 #define LDAP_ATTR_MOD_TIMESTAMP 41 105 #define LDAP_ATTR_LOGON_HOURS 42 106 #define LDAP_ATTR_TRUST_PASSWD_FLAGS 43 107 #define LDAP_ATTR_SN 44 108 109 110 typedef struct _attrib_map_entry { 111 int attrib; 112 const char *name; 113 } ATTRIB_MAP_ENTRY; 114 115 116 /* structures */ 117 118 extern ATTRIB_MAP_ENTRY attrib_map_v22[]; 119 extern ATTRIB_MAP_ENTRY attrib_map_to_delete_v22[]; 120 extern ATTRIB_MAP_ENTRY attrib_map_v30[]; 121 extern ATTRIB_MAP_ENTRY attrib_map_to_delete_v30[]; 122 extern ATTRIB_MAP_ENTRY dominfo_attr_list[]; 123 extern ATTRIB_MAP_ENTRY groupmap_attr_list[]; 124 extern ATTRIB_MAP_ENTRY groupmap_attr_list_to_delete[]; 125 extern ATTRIB_MAP_ENTRY idpool_attr_list[]; 126 extern ATTRIB_MAP_ENTRY sidmap_attr_list[]; 127 extern ATTRIB_MAP_ENTRY trustpw_attr_list[]; 128 129 130 /* Function declarations -- not included in proto.h so we don't 131 have to worry about LDAP structure types */ 132 133 NTSTATUS smbldap_init(TALLOC_CTX *mem_ctx, 134 struct event_context *event_ctx, 135 const char *location, 136 struct smbldap_state **smbldap_state); 137 138 const char* get_attr_key2string( ATTRIB_MAP_ENTRY table[], int key ); 139 const char** get_attr_list( TALLOC_CTX *mem_ctx, ATTRIB_MAP_ENTRY table[] ); 140 void smbldap_set_mod (LDAPMod *** modlist, int modop, const char *attribute, const char *value); 141 void smbldap_set_mod_blob(LDAPMod *** modlist, int modop, const char *attribute, const DATA_BLOB *newblob); 142 void smbldap_make_mod(LDAP *ldap_struct, LDAPMessage *existing, 143 LDAPMod ***mods, 144 const char *attribute, const char *newval); 145 void smbldap_make_mod_blob(LDAP *ldap_struct, LDAPMessage *existing, 146 LDAPMod ***mods, 147 const char *attribute, const DATA_BLOB *newblob); 148 bool smbldap_get_single_attribute (LDAP * ldap_struct, LDAPMessage * entry, 149 const char *attribute, char *value, 150 int max_len); 151 int smbldap_modify(struct smbldap_state *ldap_state, 152 const char *dn, 153 LDAPMod *attrs[]); 28 #include <talloc.h> 29 #include <tevent.h> 154 30 155 31 /** … … 169 45 char *bind_dn; 170 46 char *bind_secret; 47 int (*bind_callback)(LDAP *ldap_struct, struct smbldap_state *ldap_state, void *data); 48 void *bind_callback_data; 171 49 172 50 bool paged_results; … … 175 53 176 54 time_t last_use; /* monotonic */ 177 struct event_context *event_context;178 struct t imed_event*idle_event;55 struct tevent_context *tevent_context; 56 struct tevent_timer *idle_event; 179 57 180 58 struct timeval last_rebind; /* monotonic */ … … 217 95 }; 218 96 219 /* Functions shared between pdb_ldap.c and pdb_nds.c. */220 struct pdb_methods;221 NTSTATUS pdb_init_ldapsam_compat( struct pdb_methods **pdb_method, const char *location);222 void private_data_free_fn(void **result);223 int ldapsam_search_suffix_by_name(struct ldapsam_privates *ldap_state,224 const char *user,225 LDAPMessage ** result,226 const char **attr);227 NTSTATUS pdb_init_ldapsam( struct pdb_methods **pdb_method, const char *location);228 const char** get_userattr_list( TALLOC_CTX *mem_ctx, int schema_ver );229 230 char * smbldap_talloc_single_attribute(LDAP *ldap_struct, LDAPMessage *entry,231 const char *attribute,232 TALLOC_CTX *mem_ctx);233 char * smbldap_talloc_first_attribute(LDAP *ldap_struct, LDAPMessage *entry,234 const char *attribute,235 TALLOC_CTX *mem_ctx);236 char * smbldap_talloc_smallest_attribute(LDAP *ldap_struct, LDAPMessage *entry,237 const char *attribute,238 TALLOC_CTX *mem_ctx);239 bool smbldap_talloc_single_blob(TALLOC_CTX *mem_ctx, LDAP *ld,240 LDAPMessage *msg, const char *attrib,241 DATA_BLOB *blob);242 bool smbldap_pull_sid(LDAP *ld, LDAPMessage *msg, const char *attrib,243 struct dom_sid *sid);244 void talloc_autofree_ldapmsg(TALLOC_CTX *mem_ctx, LDAPMessage *result);245 void talloc_autofree_ldapmod(TALLOC_CTX *mem_ctx, LDAPMod **mod);246 char *smbldap_talloc_dn(TALLOC_CTX *mem_ctx, LDAP *ld,247 LDAPMessage *entry);248 LDAP *priv2ld(struct ldapsam_privates *priv);249 250 97 /* The following definitions come from lib/smbldap.c */ 251 98 252 int smb_ldap_start_tls(LDAP *ldap_struct, int version); 253 int smb_ldap_setup_full_conn(LDAP **ldap_struct, const char *uri); 99 NTSTATUS smbldap_init(TALLOC_CTX *mem_ctx, 100 struct tevent_context *tevent_ctx, 101 const char *location, 102 bool anon, 103 const char *bind_dn, 104 const char *bind_secret, 105 struct smbldap_state **smbldap_state); 106 107 void smbldap_set_mod (LDAPMod *** modlist, int modop, const char *attribute, const char *value); 108 void smbldap_set_mod_blob(LDAPMod *** modlist, int modop, const char *attribute, const DATA_BLOB *newblob); 109 void smbldap_make_mod(LDAP *ldap_struct, LDAPMessage *existing, 110 LDAPMod ***mods, 111 const char *attribute, const char *newval); 112 void smbldap_make_mod_blob(LDAP *ldap_struct, LDAPMessage *existing, 113 LDAPMod ***mods, 114 const char *attribute, const DATA_BLOB *newblob); 115 bool smbldap_get_single_attribute (LDAP * ldap_struct, LDAPMessage * entry, 116 const char *attribute, char *value, 117 int max_len); 118 int smbldap_modify(struct smbldap_state *ldap_state, 119 const char *dn, 120 LDAPMod *attrs[]); 121 int smbldap_start_tls(LDAP *ldap_struct, int version); 122 int smbldap_setup_full_conn(LDAP **ldap_struct, const char *uri); 254 123 int smbldap_search(struct smbldap_state *ldap_state, 255 124 const char *base, int scope, const char *filter, … … 271 140 LDAPMessage ** result); 272 141 void smbldap_free_struct(struct smbldap_state **ldap_state) ; 273 NTSTATUS smbldap_init(TALLOC_CTX *mem_ctx, struct event_context *event_ctx,274 const char *location,275 struct smbldap_state **smbldap_state);276 142 bool smbldap_has_control(LDAP *ld, const char *control); 277 143 bool smbldap_has_extension(LDAP *ld, const char *extension); 278 144 bool smbldap_has_naming_context(LDAP *ld, const char *naming_context); 279 145 bool smbldap_set_creds(struct smbldap_state *ldap_state, bool anon, const char *dn, const char *secret); 280 281 /* The following definitions come from lib/smbldap_util.c */ 282 283 NTSTATUS smbldap_search_domain_info(struct smbldap_state *ldap_state, 284 LDAPMessage ** result, const char *domain_name, 285 bool try_add); 146 char * smbldap_talloc_single_attribute(LDAP *ldap_struct, LDAPMessage *entry, 147 const char *attribute, 148 TALLOC_CTX *mem_ctx); 149 char * smbldap_talloc_first_attribute(LDAP *ldap_struct, LDAPMessage *entry, 150 const char *attribute, 151 TALLOC_CTX *mem_ctx); 152 char * smbldap_talloc_smallest_attribute(LDAP *ldap_struct, LDAPMessage *entry, 153 const char *attribute, 154 TALLOC_CTX *mem_ctx); 155 bool smbldap_talloc_single_blob(TALLOC_CTX *mem_ctx, LDAP *ld, 156 LDAPMessage *msg, const char *attrib, 157 DATA_BLOB *blob); 158 bool smbldap_pull_sid(LDAP *ld, LDAPMessage *msg, const char *attrib, 159 struct dom_sid *sid); 160 void smbldap_talloc_autofree_ldapmsg(TALLOC_CTX *mem_ctx, LDAPMessage *result); 161 void smbldap_talloc_autofree_ldapmod(TALLOC_CTX *mem_ctx, LDAPMod **mod); 162 char *smbldap_talloc_dn(TALLOC_CTX *mem_ctx, LDAP *ld, 163 LDAPMessage *entry); 286 164 287 165 #endif /* HAVE_LDAP */ 288 166 289 #define LDAP_DEFAULT_TIMEOUT 15290 #define LDAP_CONNECTION_DEFAULT_TIMEOUT 2291 #define LDAP_PAGE_SIZE 1024292 293 #define ADS_PAGE_CTL_OID "1.2.840.113556.1.4.319"294 295 /*296 * Work around versions of the LDAP client libs that don't have the OIDs297 * defined, or have them defined under the old name.298 * This functionality is really a factor of the server, not the client299 *300 */301 302 #if defined(LDAP_EXOP_X_MODIFY_PASSWD) && !defined(LDAP_EXOP_MODIFY_PASSWD)303 #define LDAP_EXOP_MODIFY_PASSWD LDAP_EXOP_X_MODIFY_PASSWD304 #elif !defined(LDAP_EXOP_MODIFY_PASSWD)305 #define LDAP_EXOP_MODIFY_PASSWD "1.3.6.1.4.1.4203.1.11.1"306 #endif307 308 #if defined(LDAP_EXOP_X_MODIFY_PASSWD_ID) && !defined(LDAP_EXOP_MODIFY_PASSWD_ID)309 #define LDAP_TAG_EXOP_MODIFY_PASSWD_ID LDAP_EXOP_X_MODIFY_PASSWD_ID310 #elif !defined(LDAP_EXOP_MODIFY_PASSWD_ID)311 #define LDAP_TAG_EXOP_MODIFY_PASSWD_ID ((ber_tag_t) 0x80U)312 #endif313 314 #if defined(LDAP_EXOP_X_MODIFY_PASSWD_NEW) && !defined(LDAP_EXOP_MODIFY_PASSWD_NEW)315 #define LDAP_TAG_EXOP_MODIFY_PASSWD_NEW LDAP_EXOP_X_MODIFY_PASSWD_NEW316 #elif !defined(LDAP_EXOP_MODIFY_PASSWD_NEW)317 #define LDAP_TAG_EXOP_MODIFY_PASSWD_NEW ((ber_tag_t) 0x82U)318 #endif319 320 167 #endif /* _SMBLDAP_H */ -
vendor/current/source3/include/smbprofile.h
r740 r988 1 1 #ifndef _PROFILE_H_ 2 2 #define _PROFILE_H_ 3 /* 3 /* 4 4 Unix SMB/CIFS implementation. 5 5 store smbd profiling information in shared memory … … 11 11 the Free Software Foundation; either version 3 of the License, or 12 12 (at your option) any later version. 13 13 14 14 This program is distributed in the hope that it will be useful, 15 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 17 GNU General Public License for more details. 18 18 19 19 You should have received a copy of the GNU General Public License 20 20 along with this program. If not, see <http://www.gnu.org/licenses/>. … … 22 22 */ 23 23 24 struct tevent_context; 25 26 #ifdef WITH_PROFILE 27 28 #define SMBPROFILE_STATS_ALL_SECTIONS \ 29 SMBPROFILE_STATS_START \ 30 \ 31 SMBPROFILE_STATS_SECTION_START(global, "SMBD loop") \ 32 SMBPROFILE_STATS_COUNT(connect) \ 33 SMBPROFILE_STATS_COUNT(disconnect) \ 34 SMBPROFILE_STATS_BASIC(idle) \ 35 SMBPROFILE_STATS_TIME(cpu_user) \ 36 SMBPROFILE_STATS_TIME(cpu_system) \ 37 SMBPROFILE_STATS_COUNT(request) \ 38 SMBPROFILE_STATS_BASIC(push_sec_ctx) \ 39 SMBPROFILE_STATS_BASIC(set_sec_ctx) \ 40 SMBPROFILE_STATS_BASIC(set_root_sec_ctx) \ 41 SMBPROFILE_STATS_BASIC(pop_sec_ctx) \ 42 SMBPROFILE_STATS_SECTION_END \ 43 \ 44 SMBPROFILE_STATS_SECTION_START(syscall, "System Calls") \ 45 SMBPROFILE_STATS_BASIC(syscall_opendir) \ 46 SMBPROFILE_STATS_BASIC(syscall_fdopendir) \ 47 SMBPROFILE_STATS_BASIC(syscall_readdir) \ 48 SMBPROFILE_STATS_BASIC(syscall_seekdir) \ 49 SMBPROFILE_STATS_BASIC(syscall_telldir) \ 50 SMBPROFILE_STATS_BASIC(syscall_rewinddir) \ 51 SMBPROFILE_STATS_BASIC(syscall_mkdir) \ 52 SMBPROFILE_STATS_BASIC(syscall_rmdir) \ 53 SMBPROFILE_STATS_BASIC(syscall_closedir) \ 54 SMBPROFILE_STATS_BASIC(syscall_open) \ 55 SMBPROFILE_STATS_BASIC(syscall_createfile) \ 56 SMBPROFILE_STATS_BASIC(syscall_close) \ 57 SMBPROFILE_STATS_BYTES(syscall_read) \ 58 SMBPROFILE_STATS_BYTES(syscall_pread) \ 59 SMBPROFILE_STATS_BYTES(syscall_asys_pread) \ 60 SMBPROFILE_STATS_BYTES(syscall_write) \ 61 SMBPROFILE_STATS_BYTES(syscall_pwrite) \ 62 SMBPROFILE_STATS_BYTES(syscall_asys_pwrite) \ 63 SMBPROFILE_STATS_BASIC(syscall_lseek) \ 64 SMBPROFILE_STATS_BYTES(syscall_sendfile) \ 65 SMBPROFILE_STATS_BYTES(syscall_recvfile) \ 66 SMBPROFILE_STATS_BASIC(syscall_rename) \ 67 SMBPROFILE_STATS_BASIC(syscall_rename_at) \ 68 SMBPROFILE_STATS_BASIC(syscall_fsync) \ 69 SMBPROFILE_STATS_BASIC(syscall_asys_fsync) \ 70 SMBPROFILE_STATS_BASIC(syscall_stat) \ 71 SMBPROFILE_STATS_BASIC(syscall_fstat) \ 72 SMBPROFILE_STATS_BASIC(syscall_lstat) \ 73 SMBPROFILE_STATS_BASIC(syscall_get_alloc_size) \ 74 SMBPROFILE_STATS_BASIC(syscall_unlink) \ 75 SMBPROFILE_STATS_BASIC(syscall_chmod) \ 76 SMBPROFILE_STATS_BASIC(syscall_fchmod) \ 77 SMBPROFILE_STATS_BASIC(syscall_chown) \ 78 SMBPROFILE_STATS_BASIC(syscall_fchown) \ 79 SMBPROFILE_STATS_BASIC(syscall_lchown) \ 80 SMBPROFILE_STATS_BASIC(syscall_chdir) \ 81 SMBPROFILE_STATS_BASIC(syscall_getwd) \ 82 SMBPROFILE_STATS_BASIC(syscall_ntimes) \ 83 SMBPROFILE_STATS_BASIC(syscall_ftruncate) \ 84 SMBPROFILE_STATS_BASIC(syscall_fallocate) \ 85 SMBPROFILE_STATS_BASIC(syscall_fcntl_lock) \ 86 SMBPROFILE_STATS_BASIC(syscall_kernel_flock) \ 87 SMBPROFILE_STATS_BASIC(syscall_linux_setlease) \ 88 SMBPROFILE_STATS_BASIC(syscall_fcntl_getlock) \ 89 SMBPROFILE_STATS_BASIC(syscall_readlink) \ 90 SMBPROFILE_STATS_BASIC(syscall_symlink) \ 91 SMBPROFILE_STATS_BASIC(syscall_link) \ 92 SMBPROFILE_STATS_BASIC(syscall_mknod) \ 93 SMBPROFILE_STATS_BASIC(syscall_realpath) \ 94 SMBPROFILE_STATS_BASIC(syscall_get_quota) \ 95 SMBPROFILE_STATS_BASIC(syscall_set_quota) \ 96 SMBPROFILE_STATS_BASIC(syscall_get_sd) \ 97 SMBPROFILE_STATS_BASIC(syscall_set_sd) \ 98 SMBPROFILE_STATS_BASIC(syscall_brl_lock) \ 99 SMBPROFILE_STATS_BASIC(syscall_brl_unlock) \ 100 SMBPROFILE_STATS_BASIC(syscall_brl_cancel) \ 101 SMBPROFILE_STATS_SECTION_END \ 102 \ 103 SMBPROFILE_STATS_SECTION_START(acl, "ACL Calls") \ 104 SMBPROFILE_STATS_BASIC(get_nt_acl) \ 105 SMBPROFILE_STATS_BASIC(fget_nt_acl) \ 106 SMBPROFILE_STATS_BASIC(fset_nt_acl) \ 107 SMBPROFILE_STATS_BASIC(chmod_acl) \ 108 SMBPROFILE_STATS_BASIC(fchmod_acl) \ 109 SMBPROFILE_STATS_SECTION_END \ 110 \ 111 SMBPROFILE_STATS_SECTION_START(statcache, "Stat Cache") \ 112 SMBPROFILE_STATS_COUNT(statcache_lookups) \ 113 SMBPROFILE_STATS_COUNT(statcache_misses) \ 114 SMBPROFILE_STATS_COUNT(statcache_hits) \ 115 SMBPROFILE_STATS_SECTION_END \ 116 \ 117 SMBPROFILE_STATS_SECTION_START(writecache, "Write Cache") \ 118 SMBPROFILE_STATS_COUNT(writecache_allocations) \ 119 SMBPROFILE_STATS_COUNT(writecache_deallocations) \ 120 SMBPROFILE_STATS_COUNT(writecache_cached_reads) \ 121 SMBPROFILE_STATS_COUNT(writecache_total_writes) \ 122 SMBPROFILE_STATS_COUNT(writecache_init_writes) \ 123 SMBPROFILE_STATS_COUNT(writecache_abutted_writes) \ 124 SMBPROFILE_STATS_COUNT(writecache_non_oplock_writes) \ 125 SMBPROFILE_STATS_COUNT(writecache_direct_writes) \ 126 SMBPROFILE_STATS_COUNT(writecache_cached_writes) \ 127 SMBPROFILE_STATS_COUNT(writecache_perfect_writes) \ 128 SMBPROFILE_STATS_COUNT(writecache_flush_reason_seek) \ 129 SMBPROFILE_STATS_COUNT(writecache_flush_reason_read) \ 130 SMBPROFILE_STATS_COUNT(writecache_flush_reason_readraw) \ 131 SMBPROFILE_STATS_COUNT(writecache_flush_reason_write) \ 132 SMBPROFILE_STATS_COUNT(writecache_flush_reason_oplock) \ 133 SMBPROFILE_STATS_COUNT(writecache_flush_reason_close) \ 134 SMBPROFILE_STATS_COUNT(writecache_flush_reason_sync) \ 135 SMBPROFILE_STATS_COUNT(writecache_flush_reason_sizechange) \ 136 SMBPROFILE_STATS_SECTION_END \ 137 \ 138 SMBPROFILE_STATS_SECTION_START(SMB, "SMB Calls") \ 139 SMBPROFILE_STATS_BASIC(SMBmkdir) \ 140 SMBPROFILE_STATS_BASIC(SMBrmdir) \ 141 SMBPROFILE_STATS_BASIC(SMBopen) \ 142 SMBPROFILE_STATS_BASIC(SMBcreate) \ 143 SMBPROFILE_STATS_BASIC(SMBclose) \ 144 SMBPROFILE_STATS_BASIC(SMBflush) \ 145 SMBPROFILE_STATS_BASIC(SMBunlink) \ 146 SMBPROFILE_STATS_BASIC(SMBmv) \ 147 SMBPROFILE_STATS_BASIC(SMBgetatr) \ 148 SMBPROFILE_STATS_BASIC(SMBsetatr) \ 149 SMBPROFILE_STATS_BASIC(SMBread) \ 150 SMBPROFILE_STATS_BASIC(SMBwrite) \ 151 SMBPROFILE_STATS_BASIC(SMBlock) \ 152 SMBPROFILE_STATS_BASIC(SMBunlock) \ 153 SMBPROFILE_STATS_BASIC(SMBctemp) \ 154 SMBPROFILE_STATS_BASIC(SMBmknew) \ 155 SMBPROFILE_STATS_BASIC(SMBcheckpath) \ 156 SMBPROFILE_STATS_BASIC(SMBexit) \ 157 SMBPROFILE_STATS_BASIC(SMBlseek) \ 158 SMBPROFILE_STATS_BASIC(SMBlockread) \ 159 SMBPROFILE_STATS_BASIC(SMBwriteunlock) \ 160 SMBPROFILE_STATS_BASIC(SMBreadbraw) \ 161 SMBPROFILE_STATS_BASIC(SMBreadBmpx) \ 162 SMBPROFILE_STATS_BASIC(SMBreadBs) \ 163 SMBPROFILE_STATS_BASIC(SMBwritebraw) \ 164 SMBPROFILE_STATS_BASIC(SMBwriteBmpx) \ 165 SMBPROFILE_STATS_BASIC(SMBwriteBs) \ 166 SMBPROFILE_STATS_BASIC(SMBwritec) \ 167 SMBPROFILE_STATS_BASIC(SMBsetattrE) \ 168 SMBPROFILE_STATS_BASIC(SMBgetattrE) \ 169 SMBPROFILE_STATS_BASIC(SMBlockingX) \ 170 SMBPROFILE_STATS_BASIC(SMBtrans) \ 171 SMBPROFILE_STATS_BASIC(SMBtranss) \ 172 SMBPROFILE_STATS_BASIC(SMBioctl) \ 173 SMBPROFILE_STATS_BASIC(SMBioctls) \ 174 SMBPROFILE_STATS_BASIC(SMBcopy) \ 175 SMBPROFILE_STATS_BASIC(SMBmove) \ 176 SMBPROFILE_STATS_BASIC(SMBecho) \ 177 SMBPROFILE_STATS_BASIC(SMBwriteclose) \ 178 SMBPROFILE_STATS_BASIC(SMBopenX) \ 179 SMBPROFILE_STATS_BASIC(SMBreadX) \ 180 SMBPROFILE_STATS_BASIC(SMBwriteX) \ 181 SMBPROFILE_STATS_BASIC(SMBtrans2) \ 182 SMBPROFILE_STATS_BASIC(SMBtranss2) \ 183 SMBPROFILE_STATS_BASIC(SMBfindclose) \ 184 SMBPROFILE_STATS_BASIC(SMBfindnclose) \ 185 SMBPROFILE_STATS_BASIC(SMBtcon) \ 186 SMBPROFILE_STATS_BASIC(SMBtdis) \ 187 SMBPROFILE_STATS_BASIC(SMBnegprot) \ 188 SMBPROFILE_STATS_BASIC(SMBsesssetupX) \ 189 SMBPROFILE_STATS_BASIC(SMBulogoffX) \ 190 SMBPROFILE_STATS_BASIC(SMBtconX) \ 191 SMBPROFILE_STATS_BASIC(SMBdskattr) \ 192 SMBPROFILE_STATS_BASIC(SMBsearch) \ 193 SMBPROFILE_STATS_BASIC(SMBffirst) \ 194 SMBPROFILE_STATS_BASIC(SMBfunique) \ 195 SMBPROFILE_STATS_BASIC(SMBfclose) \ 196 SMBPROFILE_STATS_BASIC(SMBnttrans) \ 197 SMBPROFILE_STATS_BASIC(SMBnttranss) \ 198 SMBPROFILE_STATS_BASIC(SMBntcreateX) \ 199 SMBPROFILE_STATS_BASIC(SMBntcancel) \ 200 SMBPROFILE_STATS_BASIC(SMBntrename) \ 201 SMBPROFILE_STATS_BASIC(SMBsplopen) \ 202 SMBPROFILE_STATS_BASIC(SMBsplwr) \ 203 SMBPROFILE_STATS_BASIC(SMBsplclose) \ 204 SMBPROFILE_STATS_BASIC(SMBsplretq) \ 205 SMBPROFILE_STATS_BASIC(SMBsends) \ 206 SMBPROFILE_STATS_BASIC(SMBsendb) \ 207 SMBPROFILE_STATS_BASIC(SMBfwdname) \ 208 SMBPROFILE_STATS_BASIC(SMBcancelf) \ 209 SMBPROFILE_STATS_BASIC(SMBgetmac) \ 210 SMBPROFILE_STATS_BASIC(SMBsendstrt) \ 211 SMBPROFILE_STATS_BASIC(SMBsendend) \ 212 SMBPROFILE_STATS_BASIC(SMBsendtxt) \ 213 SMBPROFILE_STATS_BASIC(SMBinvalid) \ 214 SMBPROFILE_STATS_SECTION_END \ 215 \ 216 SMBPROFILE_STATS_SECTION_START(Trans2, "Trans2 Calls") \ 217 SMBPROFILE_STATS_BASIC(Trans2_open) \ 218 SMBPROFILE_STATS_BASIC(Trans2_findfirst) \ 219 SMBPROFILE_STATS_BASIC(Trans2_findnext) \ 220 SMBPROFILE_STATS_BASIC(Trans2_qfsinfo) \ 221 SMBPROFILE_STATS_BASIC(Trans2_setfsinfo) \ 222 SMBPROFILE_STATS_BASIC(Trans2_qpathinfo) \ 223 SMBPROFILE_STATS_BASIC(Trans2_setpathinfo) \ 224 SMBPROFILE_STATS_BASIC(Trans2_qfileinfo) \ 225 SMBPROFILE_STATS_BASIC(Trans2_setfileinfo) \ 226 SMBPROFILE_STATS_BASIC(Trans2_fsctl) \ 227 SMBPROFILE_STATS_BASIC(Trans2_ioctl) \ 228 SMBPROFILE_STATS_BASIC(Trans2_findnotifyfirst) \ 229 SMBPROFILE_STATS_BASIC(Trans2_findnotifynext) \ 230 SMBPROFILE_STATS_BASIC(Trans2_mkdir) \ 231 SMBPROFILE_STATS_BASIC(Trans2_session_setup) \ 232 SMBPROFILE_STATS_BASIC(Trans2_get_dfs_referral) \ 233 SMBPROFILE_STATS_BASIC(Trans2_report_dfs_inconsistancy) \ 234 SMBPROFILE_STATS_SECTION_END \ 235 \ 236 SMBPROFILE_STATS_SECTION_START(NT_transact, "NT Transact Calls") \ 237 SMBPROFILE_STATS_BASIC(NT_transact_create) \ 238 SMBPROFILE_STATS_BASIC(NT_transact_ioctl) \ 239 SMBPROFILE_STATS_BASIC(NT_transact_set_security_desc) \ 240 SMBPROFILE_STATS_BASIC(NT_transact_notify_change) \ 241 SMBPROFILE_STATS_BASIC(NT_transact_rename) \ 242 SMBPROFILE_STATS_BASIC(NT_transact_query_security_desc) \ 243 SMBPROFILE_STATS_BASIC(NT_transact_get_user_quota) \ 244 SMBPROFILE_STATS_BASIC(NT_transact_set_user_quota) \ 245 SMBPROFILE_STATS_SECTION_END \ 246 \ 247 SMBPROFILE_STATS_SECTION_START(smb2, "SMB2 Calls") \ 248 SMBPROFILE_STATS_IOBYTES(smb2_negprot) \ 249 SMBPROFILE_STATS_IOBYTES(smb2_sesssetup) \ 250 SMBPROFILE_STATS_IOBYTES(smb2_logoff) \ 251 SMBPROFILE_STATS_IOBYTES(smb2_tcon) \ 252 SMBPROFILE_STATS_IOBYTES(smb2_tdis) \ 253 SMBPROFILE_STATS_IOBYTES(smb2_create) \ 254 SMBPROFILE_STATS_IOBYTES(smb2_close) \ 255 SMBPROFILE_STATS_IOBYTES(smb2_flush) \ 256 SMBPROFILE_STATS_IOBYTES(smb2_read) \ 257 SMBPROFILE_STATS_IOBYTES(smb2_write) \ 258 SMBPROFILE_STATS_IOBYTES(smb2_lock) \ 259 SMBPROFILE_STATS_IOBYTES(smb2_ioctl) \ 260 SMBPROFILE_STATS_IOBYTES(smb2_cancel) \ 261 SMBPROFILE_STATS_IOBYTES(smb2_keepalive) \ 262 SMBPROFILE_STATS_IOBYTES(smb2_find) \ 263 SMBPROFILE_STATS_IOBYTES(smb2_notify) \ 264 SMBPROFILE_STATS_IOBYTES(smb2_getinfo) \ 265 SMBPROFILE_STATS_IOBYTES(smb2_setinfo) \ 266 SMBPROFILE_STATS_IOBYTES(smb2_break) \ 267 SMBPROFILE_STATS_SECTION_END \ 268 \ 269 SMBPROFILE_STATS_END 270 24 271 /* this file defines the profile structure in the profile shared 25 272 memory area */ 26 273 27 #define PROF_SHMEM_KEY ((key_t)0x07021999)28 #define PROF_SHM_MAGIC 0x634998529 #define PROF_SHM_VERSION 1230 31 274 /* time values in the following structure are in microseconds */ 32 275 33 #define __profile_stats_value(which, domain) domain[which] 34 35 enum profile_stats_values 276 struct smbprofile_stats_count { 277 uint64_t count; /* number of events */ 278 }; 279 280 struct smbprofile_stats_time { 281 uint64_t time; /* microseconds */ 282 }; 283 284 struct smbprofile_stats_time_async { 285 uint64_t start; 286 struct smbprofile_stats_time *stats; 287 }; 288 289 struct smbprofile_stats_basic { 290 uint64_t count; /* number of events */ 291 uint64_t time; /* microseconds */ 292 }; 293 294 struct smbprofile_stats_basic_async { 295 uint64_t start; 296 struct smbprofile_stats_basic *stats; 297 }; 298 299 struct smbprofile_stats_bytes { 300 uint64_t count; /* number of events */ 301 uint64_t time; /* microseconds */ 302 uint64_t idle; /* idle time compared to 'time' microseconds */ 303 uint64_t bytes; /* bytes */ 304 }; 305 306 struct smbprofile_stats_bytes_async { 307 uint64_t start; 308 uint64_t idle_start; 309 uint64_t idle_time; 310 struct smbprofile_stats_bytes *stats; 311 }; 312 313 struct smbprofile_stats_iobytes { 314 uint64_t count; /* number of events */ 315 uint64_t time; /* microseconds */ 316 uint64_t idle; /* idle time compared to 'time' microseconds */ 317 uint64_t inbytes; /* bytes read */ 318 uint64_t outbytes; /* bytes written */ 319 }; 320 321 struct smbprofile_stats_iobytes_async { 322 uint64_t start; 323 uint64_t idle_start; 324 uint64_t idle_time; 325 struct smbprofile_stats_iobytes *stats; 326 }; 327 328 struct profile_stats { 329 uint64_t magic; 330 struct { 331 #define SMBPROFILE_STATS_START 332 #define SMBPROFILE_STATS_SECTION_START(name, display) 333 #define SMBPROFILE_STATS_COUNT(name) \ 334 struct smbprofile_stats_count name##_stats; 335 #define SMBPROFILE_STATS_TIME(name) \ 336 struct smbprofile_stats_time name##_stats; 337 #define SMBPROFILE_STATS_BASIC(name) \ 338 struct smbprofile_stats_basic name##_stats; 339 #define SMBPROFILE_STATS_BYTES(name) \ 340 struct smbprofile_stats_bytes name##_stats; 341 #define SMBPROFILE_STATS_IOBYTES(name) \ 342 struct smbprofile_stats_iobytes name##_stats; 343 #define SMBPROFILE_STATS_SECTION_END 344 #define SMBPROFILE_STATS_END 345 SMBPROFILE_STATS_ALL_SECTIONS 346 #undef SMBPROFILE_STATS_START 347 #undef SMBPROFILE_STATS_SECTION_START 348 #undef SMBPROFILE_STATS_COUNT 349 #undef SMBPROFILE_STATS_TIME 350 #undef SMBPROFILE_STATS_BASIC 351 #undef SMBPROFILE_STATS_BYTES 352 #undef SMBPROFILE_STATS_IOBYTES 353 #undef SMBPROFILE_STATS_SECTION_END 354 #undef SMBPROFILE_STATS_END 355 } values; 356 }; 357 358 #define _SMBPROFILE_COUNT_INCREMENT(_stats, _area, _v) do { \ 359 if (smbprofile_state.config.do_count) { \ 360 (_area)->values._stats.count += (_v); \ 361 smbprofile_dump_schedule(); \ 362 } \ 363 } while(0) 364 #define SMBPROFILE_COUNT_INCREMENT(_name, _area, _v) \ 365 _SMBPROFILE_COUNT_INCREMENT(_name##_stats, _area, _v) 366 367 #define SMBPROFILE_TIME_ASYNC_STATE(_async_name) \ 368 struct smbprofile_stats_time_async _async_name; 369 #define _SMBPROFILE_TIME_ASYNC_START(_stats, _area, _async) do { \ 370 (_async) = (struct smbprofile_stats_time_async) {}; \ 371 if (smbprofile_state.config.do_times) { \ 372 (_async).stats = &((_area)->values._stats), \ 373 (_async).start = profile_timestamp(); \ 374 } \ 375 } while(0) 376 #define SMBPROFILE_TIME_ASYNC_START(_name, _area, _async) \ 377 _SMBPROFILE_TIME_ASYNC_START(_name##_stats, _area, _async) 378 #define SMBPROFILE_TIME_ASYNC_END(_async) do { \ 379 if ((_async).start != 0) { \ 380 (_async).stats->time += profile_timestamp() - (_async).start; \ 381 (_async) = (struct smbprofile_stats_basic_async) {}; \ 382 smbprofile_dump_schedule(); \ 383 } \ 384 } while(0) 385 386 #define SMBPROFILE_BASIC_ASYNC_STATE(_async_name) \ 387 struct smbprofile_stats_basic_async _async_name; 388 #define _SMBPROFILE_BASIC_ASYNC_START(_stats, _area, _async) do { \ 389 (_async) = (struct smbprofile_stats_basic_async) {}; \ 390 if (smbprofile_state.config.do_count) { \ 391 if (smbprofile_state.config.do_times) { \ 392 (_async).start = profile_timestamp(); \ 393 (_async).stats = &((_area)->values._stats); \ 394 } \ 395 (_area)->values._stats.count += 1; \ 396 smbprofile_dump_schedule(); \ 397 } \ 398 } while(0) 399 #define SMBPROFILE_BASIC_ASYNC_START(_name, _area, _async) \ 400 _SMBPROFILE_BASIC_ASYNC_START(_name##_stats, _area, _async) 401 #define SMBPROFILE_BASIC_ASYNC_END(_async) do { \ 402 if ((_async).start != 0) { \ 403 (_async).stats->time += profile_timestamp() - (_async).start; \ 404 (_async) = (struct smbprofile_stats_basic_async) {}; \ 405 smbprofile_dump_schedule(); \ 406 } \ 407 } while(0) 408 409 #define _SMBPROFILE_TIMER_ASYNC_START(_stats, _area, _async) do { \ 410 (_async).stats = &((_area)->values._stats); \ 411 if (smbprofile_state.config.do_times) { \ 412 (_async).start = profile_timestamp(); \ 413 } \ 414 } while(0) 415 #define _SMBPROFILE_TIMER_ASYNC_SET_IDLE(_async) do { \ 416 if ((_async).start != 0) { \ 417 if ((_async).idle_start == 0) { \ 418 (_async).idle_start = profile_timestamp(); \ 419 } \ 420 } \ 421 } while(0) 422 #define _SMBPROFILE_TIMER_ASYNC_SET_BUSY(_async) do { \ 423 if ((_async).idle_start != 0) { \ 424 (_async).idle_time += \ 425 profile_timestamp() - (_async).idle_start; \ 426 (_async).idle_start = 0; \ 427 } \ 428 } while(0) 429 #define _SMBPROFILE_TIMER_ASYNC_END(_async) do { \ 430 if ((_async).start != 0) { \ 431 _SMBPROFILE_TIMER_ASYNC_SET_BUSY(_async); \ 432 (_async).stats->time += profile_timestamp() - (_async).start; \ 433 (_async).stats->idle += (_async).idle_time; \ 434 } \ 435 } while(0) 436 437 #define SMBPROFILE_BYTES_ASYNC_STATE(_async_name) \ 438 struct smbprofile_stats_bytes_async _async_name; 439 #define _SMBPROFILE_BYTES_ASYNC_START(_stats, _area, _async, _bytes) do { \ 440 (_async) = (struct smbprofile_stats_bytes_async) {}; \ 441 if (smbprofile_state.config.do_count) { \ 442 _SMBPROFILE_TIMER_ASYNC_START(_stats, _area, _async); \ 443 (_area)->values._stats.count += 1; \ 444 (_area)->values._stats.bytes += (_bytes); \ 445 smbprofile_dump_schedule(); \ 446 } \ 447 } while(0) 448 #define SMBPROFILE_BYTES_ASYNC_START(_name, _area, _async, _bytes) \ 449 _SMBPROFILE_BYTES_ASYNC_START(_name##_stats, _area, _async, _bytes) 450 #define SMBPROFILE_BYTES_ASYNC_SET_IDLE(_async) \ 451 _SMBPROFILE_TIMER_ASYNC_SET_IDLE(_async) 452 #define SMBPROFILE_BYTES_ASYNC_SET_BUSY(_async) \ 453 _SMBPROFILE_TIMER_ASYNC_SET_BUSY(_async) 454 #define SMBPROFILE_BYTES_ASYNC_END(_async) do { \ 455 if ((_async).stats != NULL) { \ 456 _SMBPROFILE_TIMER_ASYNC_END(_async); \ 457 (_async) = (struct smbprofile_stats_bytes_async) {}; \ 458 smbprofile_dump_schedule(); \ 459 } \ 460 } while(0) 461 462 #define SMBPROFILE_IOBYTES_ASYNC_STATE(_async_name) \ 463 struct smbprofile_stats_iobytes_async _async_name; 464 #define _SMBPROFILE_IOBYTES_ASYNC_START(_stats, _area, _async, _inbytes) do { \ 465 (_async) = (struct smbprofile_stats_iobytes_async) {}; \ 466 if (smbprofile_state.config.do_count) { \ 467 _SMBPROFILE_TIMER_ASYNC_START(_stats, _area, _async); \ 468 (_area)->values._stats.count += 1; \ 469 (_area)->values._stats.inbytes += (_inbytes); \ 470 smbprofile_dump_schedule(); \ 471 } \ 472 } while(0) 473 #define SMBPROFILE_IOBYTES_ASYNC_START(_name, _area, _async, _inbytes) \ 474 _SMBPROFILE_IOBYTES_ASYNC_START(_name##_stats, _area, _async, _inbytes) 475 #define SMBPROFILE_IOBYTES_ASYNC_SET_IDLE(_async) \ 476 _SMBPROFILE_TIMER_ASYNC_SET_IDLE(_async) 477 #define SMBPROFILE_IOBYTES_ASYNC_SET_BUSY(_async) \ 478 _SMBPROFILE_TIMER_ASYNC_SET_BUSY(_async) 479 #define SMBPROFILE_IOBYTES_ASYNC_END(_async, _outbytes) do { \ 480 if ((_async).stats != NULL) { \ 481 (_async).stats->outbytes += (_outbytes); \ 482 _SMBPROFILE_TIMER_ASYNC_END(_async); \ 483 (_async) = (struct smbprofile_stats_iobytes_async) {}; \ 484 smbprofile_dump_schedule(); \ 485 } \ 486 } while(0) 487 488 extern struct profile_stats *profile_p; 489 490 struct smbprofile_global_state { 491 struct { 492 struct tdb_wrap *db; 493 struct tevent_context *ev; 494 struct tevent_timer *te; 495 } internal; 496 497 struct { 498 bool do_count; 499 bool do_times; 500 } config; 501 502 struct { 503 struct profile_stats global; 504 } stats; 505 }; 506 507 extern struct smbprofile_global_state smbprofile_state; 508 509 void smbprofile_dump_schedule_timer(void); 510 void smbprofile_dump_setup(struct tevent_context *ev); 511 512 static inline void smbprofile_dump_schedule(void) 36 513 { 37 PR_VALUE_SMBD_IDLE = 0, 38 #define smbd_idle_count __profile_stats_value(PR_VALUE_SMBD_IDLE, count) 39 #define smbd_idle_time __profile_stats_value(PR_VALUE_SMBD_IDLE, time) 40 41 /* system call counters */ 42 PR_VALUE_SYSCALL_OPENDIR, 43 #define syscall_opendir_count __profile_stats_value(PR_VALUE_SYSCALL_OPENDIR, count) 44 #define syscall_opendir_time __profile_stats_value(PR_VALUE_SYSCALL_OPENDIR, time) 45 46 PR_VALUE_SYSCALL_FDOPENDIR, 47 #define syscall_fdopendir_count __profile_stats_value(PR_VALUE_SYSCALL_FDOPENDIR, count) 48 #define syscall_fdopendir_time __profile_stats_value(PR_VALUE_SYSCALL_FDOPENDIR, time) 49 50 PR_VALUE_SYSCALL_READDIR, 51 #define syscall_readdir_count __profile_stats_value(PR_VALUE_SYSCALL_READDIR, count) 52 #define syscall_readdir_time __profile_stats_value(PR_VALUE_SYSCALL_READDIR, time) 53 54 PR_VALUE_SYSCALL_SEEKDIR, 55 #define syscall_seekdir_count __profile_stats_value(PR_VALUE_SYSCALL_SEEKDIR, count) 56 #define syscall_seekdir_time __profile_stats_value(PR_VALUE_SYSCALL_SEEKDIR, time) 57 58 PR_VALUE_SYSCALL_TELLDIR, 59 #define syscall_telldir_count __profile_stats_value(PR_VALUE_SYSCALL_TELLDIR, count) 60 #define syscall_telldir_time __profile_stats_value(PR_VALUE_SYSCALL_TELLDIR, time) 61 62 PR_VALUE_SYSCALL_REWINDDIR, 63 #define syscall_rewinddir_count __profile_stats_value(PR_VALUE_SYSCALL_REWINDDIR, count) 64 #define syscall_rewinddir_time __profile_stats_value(PR_VALUE_SYSCALL_REWINDDIR, time) 65 66 PR_VALUE_SYSCALL_MKDIR, 67 #define syscall_mkdir_count __profile_stats_value(PR_VALUE_SYSCALL_MKDIR, count) 68 #define syscall_mkdir_time __profile_stats_value(PR_VALUE_SYSCALL_MKDIR, time) 69 70 PR_VALUE_SYSCALL_RMDIR, 71 #define syscall_rmdir_count __profile_stats_value(PR_VALUE_SYSCALL_RMDIR, count) 72 #define syscall_rmdir_time __profile_stats_value(PR_VALUE_SYSCALL_RMDIR, time) 73 74 PR_VALUE_SYSCALL_CLOSEDIR, 75 #define syscall_closedir_count __profile_stats_value(PR_VALUE_SYSCALL_CLOSEDIR, count) 76 #define syscall_closedir_time __profile_stats_value(PR_VALUE_SYSCALL_CLOSEDIR, time) 77 78 PR_VALUE_SYSCALL_OPEN, 79 #define syscall_open_count __profile_stats_value(PR_VALUE_SYSCALL_OPEN, count) 80 #define syscall_open_time __profile_stats_value(PR_VALUE_SYSCALL_OPEN, time) 81 82 PR_VALUE_SYSCALL_CREATEFILE, 83 #define syscall_createfile_count __profile_stats_value(PR_VALUE_SYSCALL_CREATEFILE, count) 84 #define syscall_createfile_time __profile_stats_value(PR_VALUE_SYSCALL_CREATEFILE, time) 85 86 PR_VALUE_SYSCALL_CLOSE, 87 #define syscall_close_count __profile_stats_value(PR_VALUE_SYSCALL_CLOSE, count) 88 #define syscall_close_time __profile_stats_value(PR_VALUE_SYSCALL_CLOSE, time) 89 90 PR_VALUE_SYSCALL_READ, 91 #define syscall_read_count __profile_stats_value(PR_VALUE_SYSCALL_READ, count) 92 #define syscall_read_time __profile_stats_value(PR_VALUE_SYSCALL_READ, time) 93 94 PR_VALUE_SYSCALL_PREAD, 95 #define syscall_pread_count __profile_stats_value(PR_VALUE_SYSCALL_PREAD, count) 96 #define syscall_pread_time __profile_stats_value(PR_VALUE_SYSCALL_PREAD, time) 97 98 PR_VALUE_SYSCALL_WRITE, 99 #define syscall_write_count __profile_stats_value(PR_VALUE_SYSCALL_WRITE, count) 100 #define syscall_write_time __profile_stats_value(PR_VALUE_SYSCALL_WRITE, time) 101 102 PR_VALUE_SYSCALL_PWRITE, 103 #define syscall_pwrite_count __profile_stats_value(PR_VALUE_SYSCALL_PWRITE, count) 104 #define syscall_pwrite_time __profile_stats_value(PR_VALUE_SYSCALL_PWRITE, time) 105 106 PR_VALUE_SYSCALL_LSEEK, 107 #define syscall_lseek_count __profile_stats_value(PR_VALUE_SYSCALL_LSEEK, count) 108 #define syscall_lseek_time __profile_stats_value(PR_VALUE_SYSCALL_LSEEK, time) 109 110 PR_VALUE_SYSCALL_SENDFILE, 111 #define syscall_sendfile_count __profile_stats_value(PR_VALUE_SYSCALL_SENDFILE, count) 112 #define syscall_sendfile_time __profile_stats_value(PR_VALUE_SYSCALL_SENDFILE, time) 113 114 PR_VALUE_SYSCALL_RECVFILE, 115 #define syscall_recvfile_count __profile_stats_value(PR_VALUE_SYSCALL_RECVFILE, count) 116 #define syscall_recvfile_time __profile_stats_value(PR_VALUE_SYSCALL_RECVFILE, time) 117 118 PR_VALUE_SYSCALL_RENAME, 119 #define syscall_rename_count __profile_stats_value(PR_VALUE_SYSCALL_RENAME, count) 120 #define syscall_rename_time __profile_stats_value(PR_VALUE_SYSCALL_RENAME, time) 121 122 PR_VALUE_SYSCALL_RENAME_AT, 123 #define syscall_rename_at_count __profile_stats_value(PR_VALUE_SYSCALL_RENAME_AT, count) 124 #define syscall_rename_at_time __profile_stats_value(PR_VALUE_SYSCALL_RENAME_AT, time) 125 126 PR_VALUE_SYSCALL_FSYNC, 127 #define syscall_fsync_count __profile_stats_value(PR_VALUE_SYSCALL_FSYNC, count) 128 #define syscall_fsync_time __profile_stats_value(PR_VALUE_SYSCALL_FSYNC, time) 129 130 PR_VALUE_SYSCALL_STAT, 131 #define syscall_stat_count __profile_stats_value(PR_VALUE_SYSCALL_STAT, count) 132 #define syscall_stat_time __profile_stats_value(PR_VALUE_SYSCALL_STAT, time) 133 134 PR_VALUE_SYSCALL_FSTAT, 135 #define syscall_fstat_count __profile_stats_value(PR_VALUE_SYSCALL_FSTAT, count) 136 #define syscall_fstat_time __profile_stats_value(PR_VALUE_SYSCALL_FSTAT, time) 137 138 PR_VALUE_SYSCALL_LSTAT, 139 #define syscall_lstat_count __profile_stats_value(PR_VALUE_SYSCALL_LSTAT, count) 140 #define syscall_lstat_time __profile_stats_value(PR_VALUE_SYSCALL_LSTAT, time) 141 142 PR_VALUE_SYSCALL_GET_ALLOC_SIZE, 143 #define syscall_get_alloc_size_count __profile_stats_value(PR_VALUE_SYSCALL_GET_ALLOC_SIZE, count) 144 #define syscall_get_alloc_size_time __profile_stats_value(PR_VALUE_SYSCALL_GET_ALLOC_SIZE, time) 145 146 PR_VALUE_SYSCALL_UNLINK, 147 #define syscall_unlink_count __profile_stats_value(PR_VALUE_SYSCALL_UNLINK, count) 148 #define syscall_unlink_time __profile_stats_value(PR_VALUE_SYSCALL_UNLINK, time) 149 150 PR_VALUE_SYSCALL_CHMOD, 151 #define syscall_chmod_count __profile_stats_value(PR_VALUE_SYSCALL_CHMOD, count) 152 #define syscall_chmod_time __profile_stats_value(PR_VALUE_SYSCALL_CHMOD, time) 153 154 PR_VALUE_SYSCALL_FCHMOD, 155 #define syscall_fchmod_count __profile_stats_value(PR_VALUE_SYSCALL_FCHMOD, count) 156 #define syscall_fchmod_time __profile_stats_value(PR_VALUE_SYSCALL_FCHMOD, time) 157 158 PR_VALUE_SYSCALL_CHOWN, 159 #define syscall_chown_count __profile_stats_value(PR_VALUE_SYSCALL_CHOWN, count) 160 #define syscall_chown_time __profile_stats_value(PR_VALUE_SYSCALL_CHOWN, time) 161 162 PR_VALUE_SYSCALL_FCHOWN, 163 #define syscall_fchown_count __profile_stats_value(PR_VALUE_SYSCALL_FCHOWN, count) 164 #define syscall_fchown_time __profile_stats_value(PR_VALUE_SYSCALL_FCHOWN, time) 165 166 PR_VALUE_SYSCALL_LCHOWN, 167 #define syscall_lchown_count __profile_stats_value(PR_VALUE_SYSCALL_LCHOWN, count) 168 #define syscall_lchown_time __profile_stats_value(PR_VALUE_SYSCALL_LCHOWN, time) 169 170 PR_VALUE_SYSCALL_CHDIR, 171 #define syscall_chdir_count __profile_stats_value(PR_VALUE_SYSCALL_CHDIR, count) 172 #define syscall_chdir_time __profile_stats_value(PR_VALUE_SYSCALL_CHDIR, time) 173 174 PR_VALUE_SYSCALL_GETWD, 175 #define syscall_getwd_count __profile_stats_value(PR_VALUE_SYSCALL_GETWD, count) 176 #define syscall_getwd_time __profile_stats_value(PR_VALUE_SYSCALL_GETWD, time) 177 178 PR_VALUE_SYSCALL_NTIMES, 179 #define syscall_ntimes_count __profile_stats_value(PR_VALUE_SYSCALL_NTIMES, count) 180 #define syscall_ntimes_time __profile_stats_value(PR_VALUE_SYSCALL_NTIMES, time) 181 182 PR_VALUE_SYSCALL_FTRUNCATE, 183 #define syscall_ftruncate_count __profile_stats_value(PR_VALUE_SYSCALL_FTRUNCATE, count) 184 #define syscall_ftruncate_time __profile_stats_value(PR_VALUE_SYSCALL_FTRUNCATE, time) 185 186 PR_VALUE_SYSCALL_FALLOCATE, 187 #define syscall_fallocate_count __profile_stats_value(PR_VALUE_SYSCALL_FALLOCATE, count) 188 #define syscall_fallocate_time __profile_stats_value(PR_VALUE_SYSCALL_FALLOCATE, time) 189 190 PR_VALUE_SYSCALL_FCNTL_LOCK, 191 #define syscall_fcntl_lock_count __profile_stats_value(PR_VALUE_SYSCALL_FCNTL_LOCK, count) 192 #define syscall_fcntl_lock_time __profile_stats_value(PR_VALUE_SYSCALL_FCNTL_LOCK, time) 193 194 PR_VALUE_SYSCALL_KERNEL_FLOCK, 195 #define syscall_kernel_flock_count __profile_stats_value(PR_VALUE_SYSCALL_KERNEL_FLOCK, count) 196 #define syscall_kernel_flock_time __profile_stats_value(PR_VALUE_SYSCALL_KERNEL_FLOCK, time) 197 198 PR_VALUE_SYSCALL_LINUX_SETLEASE, 199 #define syscall_linux_setlease_count __profile_stats_value(PR_VALUE_SYSCALL_LINUX_SETLEASE, count) 200 #define syscall_linux_setlease_time __profile_stats_value(PR_VALUE_SYSCALL_LINUX_SETLEASE, time) 201 202 PR_VALUE_SYSCALL_FCNTL_GETLOCK, 203 #define syscall_fcntl_getlock_count __profile_stats_value(PR_VALUE_SYSCALL_FCNTL_GETLOCK, count) 204 #define syscall_fcntl_getlock_time __profile_stats_value(PR_VALUE_SYSCALL_FCNTL_GETLOCK, time) 205 206 PR_VALUE_SYSCALL_READLINK, 207 #define syscall_readlink_count __profile_stats_value(PR_VALUE_SYSCALL_READLINK, count) 208 #define syscall_readlink_time __profile_stats_value(PR_VALUE_SYSCALL_READLINK, time) 209 210 PR_VALUE_SYSCALL_SYMLINK, 211 #define syscall_symlink_count __profile_stats_value(PR_VALUE_SYSCALL_SYMLINK, count) 212 #define syscall_symlink_time __profile_stats_value(PR_VALUE_SYSCALL_SYMLINK, time) 213 214 PR_VALUE_SYSCALL_LINK, 215 #define syscall_link_count __profile_stats_value(PR_VALUE_SYSCALL_LINK, count) 216 #define syscall_link_time __profile_stats_value(PR_VALUE_SYSCALL_LINK, time) 217 218 PR_VALUE_SYSCALL_MKNOD, 219 #define syscall_mknod_count __profile_stats_value(PR_VALUE_SYSCALL_MKNOD, count) 220 #define syscall_mknod_time __profile_stats_value(PR_VALUE_SYSCALL_MKNOD, time) 221 222 PR_VALUE_SYSCALL_REALPATH, 223 #define syscall_realpath_count __profile_stats_value(PR_VALUE_SYSCALL_REALPATH, count) 224 #define syscall_realpath_time __profile_stats_value(PR_VALUE_SYSCALL_REALPATH, time) 225 226 PR_VALUE_SYSCALL_GET_QUOTA, 227 #define syscall_get_quota_count __profile_stats_value(PR_VALUE_SYSCALL_GET_QUOTA, count) 228 #define syscall_get_quota_time __profile_stats_value(PR_VALUE_SYSCALL_GET_QUOTA, time) 229 230 PR_VALUE_SYSCALL_SET_QUOTA, 231 #define syscall_set_quota_count __profile_stats_value(PR_VALUE_SYSCALL_SET_QUOTA, count) 232 #define syscall_set_quota_time __profile_stats_value(PR_VALUE_SYSCALL_SET_QUOTA, time) 233 234 PR_VALUE_SYSCALL_GET_SD, 235 #define syscall_get_sd_count __profile_stats_value(PR_VALUE_SYSCALL_GET_SD, count) 236 #define syscall_get_sd_time __profile_stats_value(PR_VALUE_SYSCALL_GET_SD, time) 237 238 PR_VALUE_SYSCALL_SET_SD, 239 #define syscall_set_sd_count __profile_stats_value(PR_VALUE_SYSCALL_SET_SD, count) 240 #define syscall_set_sd_time __profile_stats_value(PR_VALUE_SYSCALL_SET_SD, time) 241 242 PR_VALUE_SYSCALL_BRL_LOCK, 243 #define syscall_brl_lock_count __profile_stats_value(PR_VALUE_SYSCALL_BRL_LOCK, count) 244 #define syscall_brl_lock_time __profile_stats_value(PR_VALUE_SYSCALL_BRL_LOCK, time) 245 246 PR_VALUE_SYSCALL_BRL_UNLOCK, 247 #define syscall_brl_unlock_count __profile_stats_value(PR_VALUE_SYSCALL_BRL_UNLOCK, count) 248 #define syscall_brl_unlock_time __profile_stats_value(PR_VALUE_SYSCALL_BRL_UNLOCK, time) 249 250 PR_VALUE_SYSCALL_BRL_CANCEL, 251 #define syscall_brl_cancel_count __profile_stats_value(PR_VALUE_SYSCALL_BRL_CANCEL, count) 252 #define syscall_brl_cancel_time __profile_stats_value(PR_VALUE_SYSCALL_BRL_CANCEL, time) 253 254 PR_VALUE_SYSCALL_STRICT_LOCK, 255 #define syscall_strict_lock_count __profile_stats_value(PR_VALUE_SYSCALL_STRICT_LOCK, count) 256 #define syscall_strict_lock_time __profile_stats_value(PR_VALUE_SYSCALL_STRICT_LOCK, time) 257 258 PR_VALUE_SYSCALL_STRICT_UNLOCK, 259 #define syscall_strict_unlock_count __profile_stats_value(PR_VALUE_SYSCALL_STRICT_UNLOCK, count) 260 #define syscall_strict_unlock_time __profile_stats_value(PR_VALUE_SYSCALL_STRICT_UNLOCK, time) 261 262 /* counters for individual SMB types */ 263 PR_VALUE_SMBMKDIR, 264 #define SMBmkdir_count __profile_stats_value(PR_VALUE_SMBMKDIR, count) 265 #define SMBmkdir_time __profile_stats_value(PR_VALUE_SMBMKDIR, time) 266 267 PR_VALUE_SMBRMDIR, 268 #define SMBrmdir_count __profile_stats_value(PR_VALUE_SMBRMDIR, count) 269 #define SMBrmdir_time __profile_stats_value(PR_VALUE_SMBRMDIR, time) 270 271 PR_VALUE_SMBOPEN, 272 #define SMBopen_count __profile_stats_value(PR_VALUE_SMBOPEN, count) 273 #define SMBopen_time __profile_stats_value(PR_VALUE_SMBOPEN, time) 274 275 PR_VALUE_SMBCREATE, 276 #define SMBcreate_count __profile_stats_value(PR_VALUE_SMBCREATE, count) 277 #define SMBcreate_time __profile_stats_value(PR_VALUE_SMBCREATE, time) 278 279 PR_VALUE_SMBCLOSE, 280 #define SMBclose_count __profile_stats_value(PR_VALUE_SMBCLOSE, count) 281 #define SMBclose_time __profile_stats_value(PR_VALUE_SMBCLOSE, time) 282 283 PR_VALUE_SMBFLUSH, 284 #define SMBflush_count __profile_stats_value(PR_VALUE_SMBFLUSH, count) 285 #define SMBflush_time __profile_stats_value(PR_VALUE_SMBFLUSH, time) 286 287 PR_VALUE_SMBUNLINK, 288 #define SMBunlink_count __profile_stats_value(PR_VALUE_SMBUNLINK, count) 289 #define SMBunlink_time __profile_stats_value(PR_VALUE_SMBUNLINK, time) 290 291 PR_VALUE_SMBMV, 292 #define SMBmv_count __profile_stats_value(PR_VALUE_SMBMV, count) 293 #define SMBmv_time __profile_stats_value(PR_VALUE_SMBMV, time) 294 295 PR_VALUE_SMBGETATR, 296 #define SMBgetatr_count __profile_stats_value(PR_VALUE_SMBGETATR, count) 297 #define SMBgetatr_time __profile_stats_value(PR_VALUE_SMBGETATR, time) 298 299 PR_VALUE_SMBSETATR, 300 #define SMBsetatr_count __profile_stats_value(PR_VALUE_SMBSETATR, count) 301 #define SMBsetatr_time __profile_stats_value(PR_VALUE_SMBSETATR, time) 302 303 PR_VALUE_SMBREAD, 304 #define SMBread_count __profile_stats_value(PR_VALUE_SMBREAD, count) 305 #define SMBread_time __profile_stats_value(PR_VALUE_SMBREAD, time) 306 307 PR_VALUE_SMBWRITE, 308 #define SMBwrite_count __profile_stats_value(PR_VALUE_SMBWRITE, count) 309 #define SMBwrite_time __profile_stats_value(PR_VALUE_SMBWRITE, time) 310 311 PR_VALUE_SMBLOCK, 312 #define SMBlock_count __profile_stats_value(PR_VALUE_SMBLOCK, count) 313 #define SMBlock_time __profile_stats_value(PR_VALUE_SMBLOCK, time) 314 315 PR_VALUE_SMBUNLOCK, 316 #define SMBunlock_count __profile_stats_value(PR_VALUE_SMBUNLOCK, count) 317 #define SMBunlock_time __profile_stats_value(PR_VALUE_SMBUNLOCK, time) 318 319 PR_VALUE_SMBCTEMP, 320 #define SMBctemp_count __profile_stats_value(PR_VALUE_SMBCTEMP, count) 321 #define SMBctemp_time __profile_stats_value(PR_VALUE_SMBCTEMP, time) 322 323 /* SMBmknew stats are currently combined with SMBcreate */ 324 PR_VALUE_SMBMKNEW, 325 #define SMBmknew_count __profile_stats_value(PR_VALUE_SMBMKNEW, count) 326 #define SMBmknew_time __profile_stats_value(PR_VALUE_SMBMKNEW, time) 327 328 PR_VALUE_SMBCHECKPATH, 329 #define SMBcheckpath_count __profile_stats_value(PR_VALUE_SMBCHECKPATH, count) 330 #define SMBcheckpath_time __profile_stats_value(PR_VALUE_SMBCHECKPATH, time) 331 332 PR_VALUE_SMBEXIT, 333 #define SMBexit_count __profile_stats_value(PR_VALUE_SMBEXIT, count) 334 #define SMBexit_time __profile_stats_value(PR_VALUE_SMBEXIT, time) 335 336 PR_VALUE_SMBLSEEK, 337 #define SMBlseek_count __profile_stats_value(PR_VALUE_SMBLSEEK, count) 338 #define SMBlseek_time __profile_stats_value(PR_VALUE_SMBLSEEK, time) 339 340 PR_VALUE_SMBLOCKREAD, 341 #define SMBlockread_count __profile_stats_value(PR_VALUE_SMBLOCKREAD, count) 342 #define SMBlockread_time __profile_stats_value(PR_VALUE_SMBLOCKREAD, time) 343 344 PR_VALUE_SMBWRITEUNLOCK, 345 #define SMBwriteunlock_count __profile_stats_value(PR_VALUE_SMBWRITEUNLOCK, count) 346 #define SMBwriteunlock_time __profile_stats_value(PR_VALUE_SMBWRITEUNLOCK, time) 347 348 PR_VALUE_SMBREADBRAW, 349 #define SMBreadbraw_count __profile_stats_value(PR_VALUE_SMBREADBRAW, count) 350 #define SMBreadbraw_time __profile_stats_value(PR_VALUE_SMBREADBRAW, time) 351 352 PR_VALUE_SMBREADBMPX, 353 #define SMBreadBmpx_count __profile_stats_value(PR_VALUE_SMBREADBMPX, count) 354 #define SMBreadBmpx_time __profile_stats_value(PR_VALUE_SMBREADBMPX, time) 355 356 PR_VALUE_SMBREADBS, 357 #define SMBreadBs_count __profile_stats_value(PR_VALUE_SMBREADBS, count) 358 #define SMBreadBs_time __profile_stats_value(PR_VALUE_SMBREADBS, time) 359 360 PR_VALUE_SMBWRITEBRAW, 361 #define SMBwritebraw_count __profile_stats_value(PR_VALUE_SMBWRITEBRAW, count) 362 #define SMBwritebraw_time __profile_stats_value(PR_VALUE_SMBWRITEBRAW, time) 363 364 PR_VALUE_SMBWRITEBMPX, 365 #define SMBwriteBmpx_count __profile_stats_value(PR_VALUE_SMBWRITEBMPX, count) 366 #define SMBwriteBmpx_time __profile_stats_value(PR_VALUE_SMBWRITEBMPX, time) 367 368 PR_VALUE_SMBWRITEBS, 369 #define SMBwriteBs_count __profile_stats_value(PR_VALUE_SMBWRITEBS, count) 370 #define SMBwriteBs_time __profile_stats_value(PR_VALUE_SMBWRITEBS, time) 371 372 PR_VALUE_SMBWRITEC, 373 #define SMBwritec_count __profile_stats_value(PR_VALUE_SMBWRITEC, count) 374 #define SMBwritec_time __profile_stats_value(PR_VALUE_SMBWRITEC, time) 375 376 PR_VALUE_SMBSETATTRE, 377 #define SMBsetattrE_count __profile_stats_value(PR_VALUE_SMBSETATTRE, count) 378 #define SMBsetattrE_time __profile_stats_value(PR_VALUE_SMBSETATTRE, time) 379 380 PR_VALUE_SMBGETATTRE, 381 #define SMBgetattrE_count __profile_stats_value(PR_VALUE_SMBGETATTRE, count) 382 #define SMBgetattrE_time __profile_stats_value(PR_VALUE_SMBGETATTRE, time) 383 384 PR_VALUE_SMBLOCKINGX, 385 #define SMBlockingX_count __profile_stats_value(PR_VALUE_SMBLOCKINGX, count) 386 #define SMBlockingX_time __profile_stats_value(PR_VALUE_SMBLOCKINGX, time) 387 388 PR_VALUE_SMBTRANS, 389 #define SMBtrans_count __profile_stats_value(PR_VALUE_SMBTRANS, count) 390 #define SMBtrans_time __profile_stats_value(PR_VALUE_SMBTRANS, time) 391 392 PR_VALUE_SMBTRANSS, 393 #define SMBtranss_count __profile_stats_value(PR_VALUE_SMBTRANSS, count) 394 #define SMBtranss_time __profile_stats_value(PR_VALUE_SMBTRANSS, time) 395 396 PR_VALUE_SMBIOCTL, 397 #define SMBioctl_count __profile_stats_value(PR_VALUE_SMBIOCTL, count) 398 #define SMBioctl_time __profile_stats_value(PR_VALUE_SMBIOCTL, time) 399 400 PR_VALUE_SMBIOCTLS, 401 #define SMBioctls_count __profile_stats_value(PR_VALUE_SMBIOCTLS, count) 402 #define SMBioctls_time __profile_stats_value(PR_VALUE_SMBIOCTLS, time) 403 404 PR_VALUE_SMBCOPY, 405 #define SMBcopy_count __profile_stats_value(PR_VALUE_SMBCOPY, count) 406 #define SMBcopy_time __profile_stats_value(PR_VALUE_SMBCOPY, time) 407 408 PR_VALUE_SMBMOVE, 409 #define SMBmove_count __profile_stats_value(PR_VALUE_SMBMOVE, count) 410 #define SMBmove_time __profile_stats_value(PR_VALUE_SMBMOVE, time) 411 412 PR_VALUE_SMBECHO, 413 #define SMBecho_count __profile_stats_value(PR_VALUE_SMBECHO, count) 414 #define SMBecho_time __profile_stats_value(PR_VALUE_SMBECHO, time) 415 416 PR_VALUE_SMBWRITECLOSE, 417 #define SMBwriteclose_count __profile_stats_value(PR_VALUE_SMBWRITECLOSE, count) 418 #define SMBwriteclose_time __profile_stats_value(PR_VALUE_SMBWRITECLOSE, time) 419 420 PR_VALUE_SMBOPENX, 421 #define SMBopenX_count __profile_stats_value(PR_VALUE_SMBOPENX, count) 422 #define SMBopenX_time __profile_stats_value(PR_VALUE_SMBOPENX, time) 423 424 PR_VALUE_SMBREADX, 425 #define SMBreadX_count __profile_stats_value(PR_VALUE_SMBREADX, count) 426 #define SMBreadX_time __profile_stats_value(PR_VALUE_SMBREADX, time) 427 428 PR_VALUE_SMBWRITEX, 429 #define SMBwriteX_count __profile_stats_value(PR_VALUE_SMBWRITEX, count) 430 #define SMBwriteX_time __profile_stats_value(PR_VALUE_SMBWRITEX, time) 431 432 PR_VALUE_SMBTRANS2, 433 #define SMBtrans2_count __profile_stats_value(PR_VALUE_SMBTRANS2, count) 434 #define SMBtrans2_time __profile_stats_value(PR_VALUE_SMBTRANS2, time) 435 436 PR_VALUE_SMBTRANSS2, 437 #define SMBtranss2_count __profile_stats_value(PR_VALUE_SMBTRANSS2, count) 438 #define SMBtranss2_time __profile_stats_value(PR_VALUE_SMBTRANSS2, time) 439 440 PR_VALUE_SMBFINDCLOSE, 441 #define SMBfindclose_count __profile_stats_value(PR_VALUE_SMBFINDCLOSE, count) 442 #define SMBfindclose_time __profile_stats_value(PR_VALUE_SMBFINDCLOSE, time) 443 444 PR_VALUE_SMBFINDNCLOSE, 445 #define SMBfindnclose_count __profile_stats_value(PR_VALUE_SMBFINDNCLOSE, count) 446 #define SMBfindnclose_time __profile_stats_value(PR_VALUE_SMBFINDNCLOSE, time) 447 448 PR_VALUE_SMBTCON, 449 #define SMBtcon_count __profile_stats_value(PR_VALUE_SMBTCON, count) 450 #define SMBtcon_time __profile_stats_value(PR_VALUE_SMBTCON, time) 451 452 PR_VALUE_SMBTDIS, 453 #define SMBtdis_count __profile_stats_value(PR_VALUE_SMBTDIS, count) 454 #define SMBtdis_time __profile_stats_value(PR_VALUE_SMBTDIS, time) 455 456 PR_VALUE_SMBNEGPROT, 457 #define SMBnegprot_count __profile_stats_value(PR_VALUE_SMBNEGPROT, count) 458 #define SMBnegprot_time __profile_stats_value(PR_VALUE_SMBNEGPROT, time) 459 460 PR_VALUE_SMBSESSSETUPX, 461 #define SMBsesssetupX_count __profile_stats_value(PR_VALUE_SMBSESSSETUPX, count) 462 #define SMBsesssetupX_time __profile_stats_value(PR_VALUE_SMBSESSSETUPX, time) 463 464 PR_VALUE_SMBULOGOFFX, 465 #define SMBulogoffX_count __profile_stats_value(PR_VALUE_SMBULOGOFFX, count) 466 #define SMBulogoffX_time __profile_stats_value(PR_VALUE_SMBULOGOFFX, time) 467 468 PR_VALUE_SMBTCONX, 469 #define SMBtconX_count __profile_stats_value(PR_VALUE_SMBTCONX, count) 470 #define SMBtconX_time __profile_stats_value(PR_VALUE_SMBTCONX, time) 471 472 PR_VALUE_SMBDSKATTR, 473 #define SMBdskattr_count __profile_stats_value(PR_VALUE_SMBDSKATTR, count) 474 #define SMBdskattr_time __profile_stats_value(PR_VALUE_SMBDSKATTR, time) 475 476 PR_VALUE_SMBSEARCH, 477 #define SMBsearch_count __profile_stats_value(PR_VALUE_SMBSEARCH, count) 478 #define SMBsearch_time __profile_stats_value(PR_VALUE_SMBSEARCH, time) 479 480 /* SBMffirst stats combined with SMBsearch */ 481 PR_VALUE_SMBFFIRST, 482 #define SMBffirst_count __profile_stats_value(PR_VALUE_SMBFFIRST, count) 483 #define SMBffirst_time __profile_stats_value(PR_VALUE_SMBFFIRST, time) 484 485 /* SBMfunique stats combined with SMBsearch */ 486 PR_VALUE_SMBFUNIQUE, 487 #define SMBfunique_count __profile_stats_value(PR_VALUE_SMBFUNIQUE, count) 488 #define SMBfunique_time __profile_stats_value(PR_VALUE_SMBFUNIQUE, time) 489 490 PR_VALUE_SMBFCLOSE, 491 #define SMBfclose_count __profile_stats_value(PR_VALUE_SMBFCLOSE, count) 492 #define SMBfclose_time __profile_stats_value(PR_VALUE_SMBFCLOSE, time) 493 494 PR_VALUE_SMBNTTRANS, 495 #define SMBnttrans_count __profile_stats_value(PR_VALUE_SMBNTTRANS, count) 496 #define SMBnttrans_time __profile_stats_value(PR_VALUE_SMBNTTRANS, time) 497 498 PR_VALUE_SMBNTTRANSS, 499 #define SMBnttranss_count __profile_stats_value(PR_VALUE_SMBNTTRANSS, count) 500 #define SMBnttranss_time __profile_stats_value(PR_VALUE_SMBNTTRANSS, time) 501 502 PR_VALUE_SMBNTCREATEX, 503 #define SMBntcreateX_count __profile_stats_value(PR_VALUE_SMBNTCREATEX, count) 504 #define SMBntcreateX_time __profile_stats_value(PR_VALUE_SMBNTCREATEX, time) 505 506 PR_VALUE_SMBNTCANCEL, 507 #define SMBntcancel_count __profile_stats_value(PR_VALUE_SMBNTCANCEL, count) 508 #define SMBntcancel_time __profile_stats_value(PR_VALUE_SMBNTCANCEL, time) 509 510 PR_VALUE_SMBNTRENAME, 511 #define SMBntrename_count __profile_stats_value(PR_VALUE_SMBNTRENAME, count) 512 #define SMBntrename_time __profile_stats_value(PR_VALUE_SMBNTRENAME, time) 513 514 PR_VALUE_SMBSPLOPEN, 515 #define SMBsplopen_count __profile_stats_value(PR_VALUE_SMBSPLOPEN, count) 516 #define SMBsplopen_time __profile_stats_value(PR_VALUE_SMBSPLOPEN, time) 517 518 PR_VALUE_SMBSPLWR, 519 #define SMBsplwr_count __profile_stats_value(PR_VALUE_SMBSPLWR, count) 520 #define SMBsplwr_time __profile_stats_value(PR_VALUE_SMBSPLWR, time) 521 522 PR_VALUE_SMBSPLCLOSE, 523 #define SMBsplclose_count __profile_stats_value(PR_VALUE_SMBSPLCLOSE, count) 524 #define SMBsplclose_time __profile_stats_value(PR_VALUE_SMBSPLCLOSE, time) 525 526 PR_VALUE_SMBSPLRETQ, 527 #define SMBsplretq_count __profile_stats_value(PR_VALUE_SMBSPLRETQ, count) 528 #define SMBsplretq_time __profile_stats_value(PR_VALUE_SMBSPLRETQ, time) 529 530 PR_VALUE_SMBSENDS, 531 #define SMBsends_count __profile_stats_value(PR_VALUE_SMBSENDS, count) 532 #define SMBsends_time __profile_stats_value(PR_VALUE_SMBSENDS, time) 533 534 PR_VALUE_SMBSENDB, 535 #define SMBsendb_count __profile_stats_value(PR_VALUE_SMBSENDB, count) 536 #define SMBsendb_time __profile_stats_value(PR_VALUE_SMBSENDB, time) 537 538 PR_VALUE_SMBFWDNAME, 539 #define SMBfwdname_count __profile_stats_value(PR_VALUE_SMBFWDNAME, count) 540 #define SMBfwdname_time __profile_stats_value(PR_VALUE_SMBFWDNAME, time) 541 542 PR_VALUE_SMBCANCELF, 543 #define SMBcancelf_count __profile_stats_value(PR_VALUE_SMBCANCELF, count) 544 #define SMBcancelf_time __profile_stats_value(PR_VALUE_SMBCANCELF, time) 545 546 PR_VALUE_SMBGETMAC, 547 #define SMBgetmac_count __profile_stats_value(PR_VALUE_SMBGETMAC, count) 548 #define SMBgetmac_time __profile_stats_value(PR_VALUE_SMBGETMAC, time) 549 550 PR_VALUE_SMBSENDSTRT, 551 #define SMBsendstrt_count __profile_stats_value(PR_VALUE_SMBSENDSTRT, count) 552 #define SMBsendstrt_time __profile_stats_value(PR_VALUE_SMBSENDSTRT, time) 553 554 PR_VALUE_SMBSENDEND, 555 #define SMBsendend_count __profile_stats_value(PR_VALUE_SMBSENDEND, count) 556 #define SMBsendend_time __profile_stats_value(PR_VALUE_SMBSENDEND, time) 557 558 PR_VALUE_SMBSENDTXT, 559 #define SMBsendtxt_count __profile_stats_value(PR_VALUE_SMBSENDTXT, count) 560 #define SMBsendtxt_time __profile_stats_value(PR_VALUE_SMBSENDTXT, time) 561 562 PR_VALUE_SMBINVALID, 563 #define SMBinvalid_count __profile_stats_value(PR_VALUE_SMBINVALID, count) 564 #define SMBinvalid_time __profile_stats_value(PR_VALUE_SMBINVALID, time) 565 566 /* Pathworks setdir command */ 567 PR_VALUE_PATHWORKS_SETDIR, 568 #define pathworks_setdir_count __profile_stats_value(PR_VALUE_PATHWORKS_SETDIR, count) 569 #define pathworks_setdir_time __profile_stats_value(PR_VALUE_PATHWORKS_SETDIR, time) 570 571 /* These are the TRANS2 sub commands */ 572 PR_VALUE_TRANS2_OPEN, 573 #define Trans2_open_count __profile_stats_value(PR_VALUE_TRANS2_OPEN, count) 574 #define Trans2_open_time __profile_stats_value(PR_VALUE_TRANS2_OPEN, time) 575 576 PR_VALUE_TRANS2_FINDFIRST, 577 #define Trans2_findfirst_count __profile_stats_value(PR_VALUE_TRANS2_FINDFIRST, count) 578 #define Trans2_findfirst_time __profile_stats_value(PR_VALUE_TRANS2_FINDFIRST, time) 579 580 PR_VALUE_TRANS2_FINDNEXT, 581 #define Trans2_findnext_count __profile_stats_value(PR_VALUE_TRANS2_FINDNEXT, count) 582 #define Trans2_findnext_time __profile_stats_value(PR_VALUE_TRANS2_FINDNEXT, time) 583 584 PR_VALUE_TRANS2_QFSINFO, 585 #define Trans2_qfsinfo_count __profile_stats_value(PR_VALUE_TRANS2_QFSINFO, count) 586 #define Trans2_qfsinfo_time __profile_stats_value(PR_VALUE_TRANS2_QFSINFO, time) 587 588 PR_VALUE_TRANS2_SETFSINFO, 589 #define Trans2_setfsinfo_count __profile_stats_value(PR_VALUE_TRANS2_SETFSINFO, count) 590 #define Trans2_setfsinfo_time __profile_stats_value(PR_VALUE_TRANS2_SETFSINFO, time) 591 592 PR_VALUE_TRANS2_QPATHINFO, 593 #define Trans2_qpathinfo_count __profile_stats_value(PR_VALUE_TRANS2_QPATHINFO, count) 594 #define Trans2_qpathinfo_time __profile_stats_value(PR_VALUE_TRANS2_QPATHINFO, time) 595 596 PR_VALUE_TRANS2_SETPATHINFO, 597 #define Trans2_setpathinfo_count __profile_stats_value(PR_VALUE_TRANS2_SETPATHINFO, count) 598 #define Trans2_setpathinfo_time __profile_stats_value(PR_VALUE_TRANS2_SETPATHINFO, time) 599 600 PR_VALUE_TRANS2_QFILEINFO, 601 #define Trans2_qfileinfo_count __profile_stats_value(PR_VALUE_TRANS2_QFILEINFO, count) 602 #define Trans2_qfileinfo_time __profile_stats_value(PR_VALUE_TRANS2_QFILEINFO, time) 603 604 PR_VALUE_TRANS2_SETFILEINFO, 605 #define Trans2_setfileinfo_count __profile_stats_value(PR_VALUE_TRANS2_SETFILEINFO, count) 606 #define Trans2_setfileinfo_time __profile_stats_value(PR_VALUE_TRANS2_SETFILEINFO, time) 607 608 PR_VALUE_TRANS2_FSCTL, 609 #define Trans2_fsctl_count __profile_stats_value(PR_VALUE_TRANS2_FSCTL, count) 610 #define Trans2_fsctl_time __profile_stats_value(PR_VALUE_TRANS2_FSCTL, time) 611 612 PR_VALUE_TRANS2_IOCTL, 613 #define Trans2_ioctl_count __profile_stats_value(PR_VALUE_TRANS2_IOCTL, count) 614 #define Trans2_ioctl_time __profile_stats_value(PR_VALUE_TRANS2_IOCTL, time) 615 616 PR_VALUE_TRANS2_FINDNOTIFYFIRST, 617 #define Trans2_findnotifyfirst_count __profile_stats_value(PR_VALUE_TRANS2_FINDNOTIFYFIRST, count) 618 #define Trans2_findnotifyfirst_time __profile_stats_value(PR_VALUE_TRANS2_FINDNOTIFYFIRST, time) 619 620 PR_VALUE_TRANS2_FINDNOTIFYNEXT, 621 #define Trans2_findnotifynext_count __profile_stats_value(PR_VALUE_TRANS2_FINDNOTIFYNEXT, count) 622 #define Trans2_findnotifynext_time __profile_stats_value(PR_VALUE_TRANS2_FINDNOTIFYNEXT, time) 623 624 PR_VALUE_TRANS2_MKDIR, 625 #define Trans2_mkdir_count __profile_stats_value(PR_VALUE_TRANS2_MKDIR, count) 626 #define Trans2_mkdir_time __profile_stats_value(PR_VALUE_TRANS2_MKDIR, time) 627 628 PR_VALUE_TRANS2_SESSION_SETUP, 629 #define Trans2_session_setup_count __profile_stats_value(PR_VALUE_TRANS2_SESSION_SETUP, count) 630 #define Trans2_session_setup_time __profile_stats_value(PR_VALUE_TRANS2_SESSION_SETUP, time) 631 632 PR_VALUE_TRANS2_GET_DFS_REFERRAL, 633 #define Trans2_get_dfs_referral_count __profile_stats_value(PR_VALUE_TRANS2_GET_DFS_REFERRAL, count) 634 #define Trans2_get_dfs_referral_time __profile_stats_value(PR_VALUE_TRANS2_GET_DFS_REFERRAL, time) 635 636 PR_VALUE_TRANS2_REPORT_DFS_INCONSISTANCY, 637 #define Trans2_report_dfs_inconsistancy_count __profile_stats_value(PR_VALUE_TRANS2_REPORT_DFS_INCONSISTANCY, count) 638 #define Trans2_report_dfs_inconsistancy_time __profile_stats_value(PR_VALUE_TRANS2_REPORT_DFS_INCONSISTANCY, time) 639 640 /* These are the NT transact sub commands. */ 641 PR_VALUE_NT_TRANSACT_CREATE, 642 #define NT_transact_create_count __profile_stats_value(PR_VALUE_NT_TRANSACT_CREATE, count) 643 #define NT_transact_create_time __profile_stats_value(PR_VALUE_NT_TRANSACT_CREATE, time) 644 645 PR_VALUE_NT_TRANSACT_IOCTL, 646 #define NT_transact_ioctl_count __profile_stats_value(PR_VALUE_NT_TRANSACT_IOCTL, count) 647 #define NT_transact_ioctl_time __profile_stats_value(PR_VALUE_NT_TRANSACT_IOCTL, time) 648 649 PR_VALUE_NT_TRANSACT_SET_SECURITY_DESC, 650 #define NT_transact_set_security_desc_count __profile_stats_value(PR_VALUE_NT_TRANSACT_SET_SECURITY_DESC, count) 651 #define NT_transact_set_security_desc_time __profile_stats_value(PR_VALUE_NT_TRANSACT_SET_SECURITY_DESC, time) 652 653 PR_VALUE_NT_TRANSACT_NOTIFY_CHANGE, 654 #define NT_transact_notify_change_count __profile_stats_value(PR_VALUE_NT_TRANSACT_NOTIFY_CHANGE, count) 655 #define NT_transact_notify_change_time __profile_stats_value(PR_VALUE_NT_TRANSACT_NOTIFY_CHANGE, time) 656 657 PR_VALUE_NT_TRANSACT_RENAME, 658 #define NT_transact_rename_count __profile_stats_value(PR_VALUE_NT_TRANSACT_RENAME, count) 659 #define NT_transact_rename_time __profile_stats_value(PR_VALUE_NT_TRANSACT_RENAME, time) 660 661 PR_VALUE_NT_TRANSACT_QUERY_SECURITY_DESC, 662 #define NT_transact_query_security_desc_count __profile_stats_value(PR_VALUE_NT_TRANSACT_QUERY_SECURITY_DESC, count) 663 #define NT_transact_query_security_desc_time __profile_stats_value(PR_VALUE_NT_TRANSACT_QUERY_SECURITY_DESC, time) 664 665 PR_VALUE_NT_TRANSACT_GET_USER_QUOTA, 666 #define NT_transact_get_user_quota_count __profile_stats_value(PR_VALUE_NT_TRANSACT_GET_USER_QUOTA, count) 667 #define NT_transact_get_user_quota_time __profile_stats_value(PR_VALUE_NT_TRANSACT_GET_USER_QUOTA, time) 668 669 PR_VALUE_NT_TRANSACT_SET_USER_QUOTA, 670 #define NT_transact_set_user_quota_count __profile_stats_value(PR_VALUE_NT_TRANSACT_SET_USER_QUOTA, count) 671 #define NT_transact_set_user_quota_time __profile_stats_value(PR_VALUE_NT_TRANSACT_SET_USER_QUOTA, time) 672 673 /* These are ACL manipulation calls */ 674 PR_VALUE_GET_NT_ACL, 675 #define get_nt_acl_count __profile_stats_value(PR_VALUE_GET_NT_ACL, count) 676 #define get_nt_acl_time __profile_stats_value(PR_VALUE_GET_NT_ACL, time) 677 678 PR_VALUE_FGET_NT_ACL, 679 #define fget_nt_acl_count __profile_stats_value(PR_VALUE_FGET_NT_ACL, count) 680 #define fget_nt_acl_time __profile_stats_value(PR_VALUE_FGET_NT_ACL, time) 681 682 PR_VALUE_FSET_NT_ACL, 683 #define fset_nt_acl_count __profile_stats_value(PR_VALUE_FSET_NT_ACL, count) 684 #define fset_nt_acl_time __profile_stats_value(PR_VALUE_FSET_NT_ACL, time) 685 686 PR_VALUE_CHMOD_ACL, 687 #define chmod_acl_count __profile_stats_value(PR_VALUE_CHMOD_ACL, count) 688 #define chmod_acl_time __profile_stats_value(PR_VALUE_CHMOD_ACL, time) 689 690 PR_VALUE_FCHMOD_ACL, 691 #define fchmod_acl_count __profile_stats_value(PR_VALUE_FCHMOD_ACL, count) 692 #define fchmod_acl_time __profile_stats_value(PR_VALUE_FCHMOD_ACL, time) 693 694 /* These are nmbd stats */ 695 PR_VALUE_NAME_RELEASE, 696 #define name_release_count __profile_stats_value(PR_VALUE_NAME_RELEASE, count) 697 #define name_release_time __profile_stats_value(PR_VALUE_NAME_RELEASE, time) 698 699 PR_VALUE_NAME_REFRESH, 700 #define name_refresh_count __profile_stats_value(PR_VALUE_NAME_REFRESH, count) 701 #define name_refresh_time __profile_stats_value(PR_VALUE_NAME_REFRESH, time) 702 703 PR_VALUE_NAME_REGISTRATION, 704 #define name_registration_count __profile_stats_value(PR_VALUE_NAME_REGISTRATION, count) 705 #define name_registration_time __profile_stats_value(PR_VALUE_NAME_REGISTRATION, time) 706 707 PR_VALUE_NODE_STATUS, 708 #define node_status_count __profile_stats_value(PR_VALUE_NODE_STATUS, count) 709 #define node_status_time __profile_stats_value(PR_VALUE_NODE_STATUS, time) 710 711 PR_VALUE_NAME_QUERY, 712 #define name_query_count __profile_stats_value(PR_VALUE_NAME_QUERY, count) 713 #define name_query_time __profile_stats_value(PR_VALUE_NAME_QUERY, time) 714 715 PR_VALUE_HOST_ANNOUNCE, 716 #define host_announce_count __profile_stats_value(PR_VALUE_HOST_ANNOUNCE, count) 717 #define host_announce_time __profile_stats_value(PR_VALUE_HOST_ANNOUNCE, time) 718 719 PR_VALUE_WORKGROUP_ANNOUNCE, 720 #define workgroup_announce_count __profile_stats_value(PR_VALUE_WORKGROUP_ANNOUNCE, count) 721 #define workgroup_announce_time __profile_stats_value(PR_VALUE_WORKGROUP_ANNOUNCE, time) 722 723 PR_VALUE_LOCAL_MASTER_ANNOUNCE, 724 #define local_master_announce_count __profile_stats_value(PR_VALUE_LOCAL_MASTER_ANNOUNCE, count) 725 #define local_master_announce_time __profile_stats_value(PR_VALUE_LOCAL_MASTER_ANNOUNCE, time) 726 727 PR_VALUE_MASTER_BROWSER_ANNOUNCE, 728 #define master_browser_announce_count __profile_stats_value(PR_VALUE_MASTER_BROWSER_ANNOUNCE, count) 729 #define master_browser_announce_time __profile_stats_value(PR_VALUE_MASTER_BROWSER_ANNOUNCE, time) 730 731 PR_VALUE_LM_HOST_ANNOUNCE, 732 #define lm_host_announce_count __profile_stats_value(PR_VALUE_LM_HOST_ANNOUNCE, count) 733 #define lm_host_announce_time __profile_stats_value(PR_VALUE_LM_HOST_ANNOUNCE, time) 734 735 PR_VALUE_GET_BACKUP_LIST, 736 #define get_backup_list_count __profile_stats_value(PR_VALUE_GET_BACKUP_LIST, count) 737 #define get_backup_list_time __profile_stats_value(PR_VALUE_GET_BACKUP_LIST, time) 738 739 PR_VALUE_RESET_BROWSER, 740 #define reset_browser_count __profile_stats_value(PR_VALUE_RESET_BROWSER, count) 741 #define reset_browser_time __profile_stats_value(PR_VALUE_RESET_BROWSER, time) 742 743 PR_VALUE_ANNOUNCE_REQUEST, 744 #define announce_request_count __profile_stats_value(PR_VALUE_ANNOUNCE_REQUEST, count) 745 #define announce_request_time __profile_stats_value(PR_VALUE_ANNOUNCE_REQUEST, time) 746 747 PR_VALUE_LM_ANNOUNCE_REQUEST, 748 #define lm_announce_request_count __profile_stats_value(PR_VALUE_LM_ANNOUNCE_REQUEST, count) 749 #define lm_announce_request_time __profile_stats_value(PR_VALUE_LM_ANNOUNCE_REQUEST, time) 750 751 PR_VALUE_DOMAIN_LOGON, 752 #define domain_logon_count __profile_stats_value(PR_VALUE_DOMAIN_LOGON, count) 753 #define domain_logon_time __profile_stats_value(PR_VALUE_DOMAIN_LOGON, time) 754 755 PR_VALUE_SYNC_BROWSE_LISTS, 756 #define sync_browse_lists_count __profile_stats_value(PR_VALUE_SYNC_BROWSE_LISTS, count) 757 #define sync_browse_lists_time __profile_stats_value(PR_VALUE_SYNC_BROWSE_LISTS, time) 758 759 PR_VALUE_RUN_ELECTIONS, 760 #define run_elections_count __profile_stats_value(PR_VALUE_RUN_ELECTIONS, count) 761 #define run_elections_time __profile_stats_value(PR_VALUE_RUN_ELECTIONS, time) 762 763 PR_VALUE_ELECTION, 764 #define election_count __profile_stats_value(PR_VALUE_ELECTION, count) 765 #define election_time __profile_stats_value(PR_VALUE_ELECTION, time) 766 767 PR_VALUE_SMB2_NEGPROT, 768 #define smb2_negprot_count __profile_stats_value(PR_VALUE_SMB2_NEGPROT, count) 769 #define smb2_negprot_time __profile_stats_value(PR_VALUE_SMB2_NEGPROT, time) 770 771 PR_VALUE_SMB2_SESSSETUP, 772 #define smb2_sesssetup_count __profile_stats_value(PR_VALUE_SMB2_SESSSETUP, count) 773 #define smb2_sesssetup_time __profile_stats_value(PR_VALUE_SMB2_SESSSETUP, time) 774 775 PR_VALUE_SMB2_LOGOFF, 776 #define smb2_logoff_count __profile_stats_value(PR_VALUE_SMB2_LOGOFF, count) 777 #define smb2_logoff_time __profile_stats_value(PR_VALUE_SMB2_LOGOFF, time) 778 779 PR_VALUE_SMB2_TCON, 780 #define smb2_tcon_count __profile_stats_value(PR_VALUE_SMB2_TCON, count) 781 #define smb2_tcon_time __profile_stats_value(PR_VALUE_SMB2_TCON, time) 782 783 PR_VALUE_SMB2_TDIS, 784 #define smb2_tdis_count __profile_stats_value(PR_VALUE_SMB2_TDIS, count) 785 #define smb2_tdis_time __profile_stats_value(PR_VALUE_SMB2_TDIS, time) 786 787 PR_VALUE_SMB2_CREATE, 788 #define smb2_create_count __profile_stats_value(PR_VALUE_SMB2_CREATE, count) 789 #define smb2_create_time __profile_stats_value(PR_VALUE_SMB2_CREATE, time) 790 791 PR_VALUE_SMB2_CLOSE, 792 #define smb2_close_count __profile_stats_value(PR_VALUE_SMB2_CLOSE, count) 793 #define smb2_close_time __profile_stats_value(PR_VALUE_SMB2_CLOSE, time) 794 795 PR_VALUE_SMB2_FLUSH, 796 #define smb2_flush_count __profile_stats_value(PR_VALUE_SMB2_FLUSH, count) 797 #define smb2_flush_time __profile_stats_value(PR_VALUE_SMB2_FLUSH, time) 798 799 PR_VALUE_SMB2_READ, 800 #define smb2_read_count __profile_stats_value(PR_VALUE_SMB2_READ, count) 801 #define smb2_read_time __profile_stats_value(PR_VALUE_SMB2_READ, time) 802 803 PR_VALUE_SMB2_WRITE, 804 #define smb2_write_count __profile_stats_value(PR_VALUE_SMB2_WRITE, count) 805 #define smb2_write_time __profile_stats_value(PR_VALUE_SMB2_WRITE, time) 806 807 PR_VALUE_SMB2_LOCK, 808 #define smb2_lock_count __profile_stats_value(PR_VALUE_SMB2_LOCK, count) 809 #define smb2_lock_time __profile_stats_value(PR_VALUE_SMB2_LOCK, time) 810 811 PR_VALUE_SMB2_IOCTL, 812 #define smb2_ioctl_count __profile_stats_value(PR_VALUE_SMB2_IOCTL, count) 813 #define smb2_ioctl_time __profile_stats_value(PR_VALUE_SMB2_IOCTL, time) 814 815 PR_VALUE_SMB2_CANCEL, 816 #define smb2_cancel_count __profile_stats_value(PR_VALUE_SMB2_CANCEL, count) 817 #define smb2_cancel_time __profile_stats_value(PR_VALUE_SMB2_CANCEL, time) 818 819 PR_VALUE_SMB2_KEEPALIVE, 820 #define smb2_keepalive_count __profile_stats_value(PR_VALUE_SMB2_KEEPALIVE, count) 821 #define smb2_keepalive_time __profile_stats_value(PR_VALUE_SMB2_KEEPALIVE, time) 822 823 PR_VALUE_SMB2_FIND, 824 #define smb2_find_count __profile_stats_value(PR_VALUE_SMB2_FIND, count) 825 #define smb2_find_time __profile_stats_value(PR_VALUE_SMB2_FIND, time) 826 827 PR_VALUE_SMB2_NOTIFY, 828 #define smb2_notify_count __profile_stats_value(PR_VALUE_SMB2_NOTIFY, count) 829 #define smb2_notify_time __profile_stats_value(PR_VALUE_SMB2_NOTIFY, time) 830 831 PR_VALUE_SMB2_GETINFO, 832 #define smb2_getinfo_count __profile_stats_value(PR_VALUE_SMB2_GETINFO, count) 833 #define smb2_getinfo_time __profile_stats_value(PR_VALUE_SMB2_GETINFO, time) 834 835 PR_VALUE_SMB2_SETINFO, 836 #define smb2_setinfo_count __profile_stats_value(PR_VALUE_SMB2_SETINFO, count) 837 #define smb2_setinfo_time __profile_stats_value(PR_VALUE_SMB2_SETINFO, time) 838 839 PR_VALUE_SMB2_BREAK, 840 #define smb2_break_count __profile_stats_value(PR_VALUE_SMB2_BREAK, count) 841 #define smb2_break_time __profile_stats_value(PR_VALUE_SMB2_BREAK, time) 842 843 /* This mist remain the last value. */ 844 PR_VALUE_MAX 845 }; /* enum profile_stats_values */ 846 847 const char * profile_value_name(enum profile_stats_values val); 848 849 struct profile_stats { 850 /* general counters */ 851 unsigned smb_count; /* how many SMB packets we have processed */ 852 unsigned uid_changes; /* how many times we change our effective uid */ 853 854 /* system call and protocol operation counters and cumulative times */ 855 unsigned count[PR_VALUE_MAX]; 856 unsigned time[PR_VALUE_MAX]; 857 858 /* cumulative byte counts */ 859 unsigned syscall_pread_bytes; 860 unsigned syscall_pwrite_bytes; 861 unsigned syscall_read_bytes; 862 unsigned syscall_write_bytes; 863 unsigned syscall_sendfile_bytes; 864 unsigned syscall_recvfile_bytes; 865 866 /* stat cache counters */ 867 unsigned statcache_lookups; 868 unsigned statcache_misses; 869 unsigned statcache_hits; 870 871 /* write cache counters */ 872 unsigned writecache_read_hits; 873 unsigned writecache_abutted_writes; 874 unsigned writecache_total_writes; 875 unsigned writecache_non_oplock_writes; 876 unsigned writecache_direct_writes; 877 unsigned writecache_init_writes; 878 unsigned writecache_flushed_writes[NUM_FLUSH_REASONS]; 879 unsigned writecache_num_perfect_writes; 880 unsigned writecache_num_write_caches; 881 unsigned writecache_allocated_write_caches; 882 }; 883 884 struct profile_header { 885 int prof_shm_magic; 886 int prof_shm_version; 887 struct profile_stats stats; 888 }; 889 890 extern struct profile_header *profile_h; 891 extern struct profile_stats *profile_p; 892 extern bool do_profile_flag; 893 extern bool do_profile_times; 894 895 #ifdef WITH_PROFILE 896 897 /* these are helper macros - do not call them directly in the code 898 * use the DO_PROFILE_* START_PROFILE and END_PROFILE ones 899 * below which test for the profile flage first 900 */ 901 #define INC_PROFILE_COUNT(x) profile_p->x++ 902 #define DEC_PROFILE_COUNT(x) profile_p->x-- 903 #define ADD_PROFILE_COUNT(x,y) profile_p->x += (y) 514 if (likely(smbprofile_state.internal.te != NULL)) { 515 return; 516 } 517 518 if (unlikely(smbprofile_state.internal.ev == NULL)) { 519 return; 520 } 521 522 smbprofile_dump_schedule_timer(); 523 } 524 525 static inline bool smbprofile_dump_pending(void) 526 { 527 if (smbprofile_state.internal.te == NULL) { 528 return false; 529 } 530 531 return true; 532 } 533 534 void smbprofile_dump(void); 535 536 void smbprofile_cleanup(pid_t pid, pid_t dst); 537 void smbprofile_stats_accumulate(struct profile_stats *acc, 538 const struct profile_stats *add); 539 void smbprofile_collect(struct profile_stats *stats); 904 540 905 541 static inline uint64_t profile_timestamp(void) … … 913 549 } 914 550 915 /* end of helper macros */916 917 551 #define DO_PROFILE_INC(x) \ 918 if (do_profile_flag) { \ 919 INC_PROFILE_COUNT(x); \ 920 } 921 922 #define DO_PROFILE_DEC(x) \ 923 if (do_profile_flag) { \ 924 DEC_PROFILE_COUNT(x); \ 925 } 926 927 #define DO_PROFILE_DEC_INC(x,y) \ 928 if (do_profile_flag) { \ 929 DEC_PROFILE_COUNT(x); \ 930 INC_PROFILE_COUNT(y); \ 931 } 932 933 #define DO_PROFILE_ADD(x,n) \ 934 if (do_profile_flag) { \ 935 ADD_PROFILE_COUNT(x,n); \ 936 } 552 _SMBPROFILE_COUNT_INCREMENT(x##_stats, profile_p, 1); \ 937 553 938 554 #define START_PROFILE(x) \ 939 uint64_t __profstamp_##x = 0; \ 940 if (do_profile_flag) { \ 941 __profstamp_##x = do_profile_times ? profile_timestamp() : 0;\ 942 INC_PROFILE_COUNT(x##_count); \ 943 } 555 struct smbprofile_stats_basic_async __profasync_##x = {}; \ 556 _SMBPROFILE_BASIC_ASYNC_START(x##_stats, profile_p, __profasync_##x); 944 557 945 558 #define START_PROFILE_BYTES(x,n) \ 946 uint64_t __profstamp_##x = 0; \ 947 if (do_profile_flag) { \ 948 __profstamp_##x = do_profile_times ? profile_timestamp() : 0;\ 949 INC_PROFILE_COUNT(x##_count); \ 950 ADD_PROFILE_COUNT(x##_bytes, n); \ 951 } 559 struct smbprofile_stats_bytes_async __profasync_##x = {}; \ 560 _SMBPROFILE_BYTES_ASYNC_START(x##_stats, profile_p, __profasync_##x, n); 952 561 953 562 #define END_PROFILE(x) \ 954 if (do_profile_times) { \ 955 ADD_PROFILE_COUNT(x##_time, \ 956 profile_timestamp() - __profstamp_##x); \ 957 } 563 SMBPROFILE_BASIC_ASYNC_END(__profasync_##x) 564 565 #define END_PROFILE_BYTES(x) \ 566 SMBPROFILE_BYTES_ASYNC_END(__profasync_##x) 567 958 568 #else /* WITH_PROFILE */ 959 569 570 #define SMBPROFILE_COUNT_INCREMENT(_name, _area, _v) 571 572 #define SMBPROFILE_TIME_ASYNC_STATE(_async_name) 573 #define SMBPROFILE_TIME_ASYNC_START(_name, _area, _async) 574 #define SMBPROFILE_TIME_ASYNC_END(_async) 575 576 #define SMBPROFILE_BASIC_ASYNC_STATE(_async_name) 577 #define SMBPROFILE_BASIC_ASYNC_START(_name, _area, _async) 578 #define SMBPROFILE_BASIC_ASYNC_END(_async) 579 580 #define SMBPROFILE_BYTES_ASYNC_STATE(_async_name) 581 #define SMBPROFILE_BYTES_ASYNC_START(_name, _area, _async, _inbytes) 582 #define SMBPROFILE_BYTES_ASYNC_SET_IDLE(_async) 583 #define SMBPROFILE_BYTES_ASYNC_SET_BUSY(_async) 584 #define SMBPROFILE_BYTES_ASYNC_END(_async) 585 586 #define SMBPROFILE_IOBYTES_ASYNC_STATE(_async_name) 587 #define SMBPROFILE_IOBYTES_ASYNC_START(_name, _area, _async, _inbytes) 588 #define SMBPROFILE_IOBYTES_ASYNC_SET_IDLE(_async) 589 #define SMBPROFILE_IOBYTES_ASYNC_SET_BUSY(_async) 590 #define SMBPROFILE_IOBYTES_ASYNC_END(_async, _outbytes) 591 960 592 #define DO_PROFILE_INC(x) 961 #define DO_PROFILE_DEC(x)962 #define DO_PROFILE_DEC_INC(x,y)963 #define DO_PROFILE_ADD(x,n)964 593 #define START_PROFILE(x) 965 594 #define START_PROFILE_BYTES(x,n) 966 595 #define END_PROFILE(x) 596 #define END_PROFILE_BYTES(x) 597 598 static inline bool smbprofile_dump_pending(void) 599 { 600 return false; 601 } 602 603 static inline void smbprofile_dump_setup(struct tevent_context *ev) 604 { 605 return; 606 } 607 608 static inline void smbprofile_dump(void) 609 { 610 return; 611 } 612 613 static inline void smbprofile_cleanup(pid_t pid, pid_t dst) 614 { 615 return; 616 } 617 967 618 #endif /* WITH_PROFILE */ 968 619 … … 970 621 971 622 void set_profile_level(int level, struct server_id src); 623 624 struct messaging_context; 972 625 bool profile_setup(struct messaging_context *msg_ctx, bool rdonly); 973 626 -
vendor/current/source3/include/srvstr.h
r414 r988 20 20 #define srvstr_pull_talloc(ctx, base_ptr, smb_flags2, dest, src, src_len, flags) \ 21 21 pull_string_talloc(ctx, base_ptr, smb_flags2, dest, src, src_len, flags) 22 23 /* pull a string from the smb_buf part of a packet. In this case the24 string can either be null terminated or it can be terminated by the25 end of the smbbuf area26 */27 28 #define srvstr_pull_req_talloc(ctx, req_, dest, src, flags) \29 pull_string_talloc(ctx, req_->inbuf, req_->flags2, dest, src, \30 smbreq_bufrem(req_, src), flags) -
vendor/current/source3/include/tldap.h
r740 r988 23 23 #include <talloc.h> 24 24 #include <tevent.h> 25 #include "lib/util/data_blob.h" 25 26 26 27 struct tldap_context; -
vendor/current/source3/include/trans2.h
r740 r988 282 282 #define TYPE_MOUNTED 0x20 283 283 #define TYPE_VIRTUAL 0x40 284 285 /* SMB_FS_SECTOR_SIZE_INFORMATION values */ 286 #define SSINFO_FLAGS_ALIGNED_DEVICE 0x00000001 287 #define SSINFO_FLAGS_PARTITION_ALIGNED_ON_DEVICE 0x00000002 288 #define SSINFO_FLAGS_NO_SEEK_PENALTY 0x00000004 289 #define SSINFO_FLAGS_TRIM_ENABLED 0x00000008 290 291 #define SSINFO_OFFSET_UNKNOWN 0xffffffff 284 292 285 293 /* NT passthrough levels... */ … … 334 342 #define SMB_FS_FULL_SIZE_INFORMATION 1007 335 343 #define SMB_FS_OBJECTID_INFORMATION 1008 344 #define SMB_FS_SECTOR_SIZE_INFORMATION 1011 336 345 337 346 /* SMB_FS_DEVICE_INFORMATION device types. */ … … 356 365 #define FLAG_TRANS2_FIND_BACKUP_INTENT 0x10 357 366 358 /* UNIX CIFS Extensions - created by HP */359 /*360 * UNIX CIFS Extensions have the range 0x200 - 0x2FF reserved.361 * Supposedly Microsoft have agreed to this.362 */363 364 #define MIN_UNIX_INFO_LEVEL 0x200365 #define MAX_UNIX_INFO_LEVEL 0x2FF366 367 #define INFO_LEVEL_IS_UNIX(level) (((level) >= MIN_UNIX_INFO_LEVEL) && ((level) <= MAX_UNIX_INFO_LEVEL))368 369 #define SMB_QUERY_FILE_UNIX_BASIC 0x200 /* UNIX File Info*/370 #define SMB_SET_FILE_UNIX_BASIC 0x200371 #define SMB_SET_FILE_UNIX_INFO2 0x20B /* UNIX File Info2 */372 373 #define SMB_MODE_NO_CHANGE 0xFFFFFFFF /* file mode value which */374 /* means "don't change it" */375 #define SMB_UID_NO_CHANGE 0xFFFFFFFF376 #define SMB_GID_NO_CHANGE 0xFFFFFFFF377 378 #define SMB_SIZE_NO_CHANGE_LO 0xFFFFFFFF379 #define SMB_SIZE_NO_CHANGE_HI 0xFFFFFFFF380 381 #define SMB_TIME_NO_CHANGE_LO 0xFFFFFFFF382 #define SMB_TIME_NO_CHANGE_HI 0xFFFFFFFF383 384 /*385 Offset Size Name386 0 LARGE_INTEGER EndOfFile File size387 8 LARGE_INTEGER Blocks Number of bytes used on disk (st_blocks).388 16 LARGE_INTEGER CreationTime Creation time389 24 LARGE_INTEGER LastAccessTime Last access time390 32 LARGE_INTEGER LastModificationTime Last modification time391 40 LARGE_INTEGER Uid Numeric user id for the owner392 48 LARGE_INTEGER Gid Numeric group id of owner393 56 ULONG Type Enumeration specifying the pathname type:394 0 -- File395 1 -- Directory396 2 -- Symbolic link397 3 -- Character device398 4 -- Block device399 5 -- FIFO (named pipe)400 6 -- Unix domain socket401 402 60 LARGE_INTEGER devmajor Major device number if type is device403 68 LARGE_INTEGER devminor Minor device number if type is device404 76 LARGE_INTEGER uniqueid This is a server-assigned unique id for the file. The client405 will typically map this onto an inode number. The scope of406 uniqueness is the share.407 84 LARGE_INTEGER permissions Standard UNIX file permissions - see below.408 92 LARGE_INTEGER nlinks The number of directory entries that map to this entry409 (number of hard links)410 411 100 - end.412 */413 414 #define SMB_FILE_UNIX_BASIC_SIZE 100415 416 /* UNIX filetype mappings. */417 418 #define UNIX_TYPE_FILE 0419 #define UNIX_TYPE_DIR 1420 #define UNIX_TYPE_SYMLINK 2421 #define UNIX_TYPE_CHARDEV 3422 #define UNIX_TYPE_BLKDEV 4423 #define UNIX_TYPE_FIFO 5424 #define UNIX_TYPE_SOCKET 6425 #define UNIX_TYPE_UNKNOWN 0xFFFFFFFF426 427 /*428 * Oh this is fun. "Standard UNIX permissions" has no429 * meaning in POSIX. We need to define the mapping onto430 * and off the wire as this was not done in the original HP431 * spec. JRA.432 */433 434 #define UNIX_X_OTH 0000001435 #define UNIX_W_OTH 0000002436 #define UNIX_R_OTH 0000004437 #define UNIX_X_GRP 0000010438 #define UNIX_W_GRP 0000020439 #define UNIX_R_GRP 0000040440 #define UNIX_X_USR 0000100441 #define UNIX_W_USR 0000200442 #define UNIX_R_USR 0000400443 #define UNIX_STICKY 0001000444 #define UNIX_SET_GID 0002000445 #define UNIX_SET_UID 0004000446 447 /* Masks for the above */448 #define UNIX_OTH_MASK 0000007449 #define UNIX_GRP_MASK 0000070450 #define UNIX_USR_MASK 0000700451 #define UNIX_PERM_MASK 0000777452 #define UNIX_EXTRA_MASK 0007000453 #define UNIX_ALL_MASK 0007777454 455 /* Flags for chflags (CIFS_UNIX_EXTATTR_CAP capability) and456 * SMB_QUERY_FILE_UNIX_INFO2.457 */458 #define EXT_SECURE_DELETE 0x00000001459 #define EXT_ENABLE_UNDELETE 0x00000002460 #define EXT_SYNCHRONOUS 0x00000004461 #define EXT_IMMUTABLE 0x00000008462 #define EXT_OPEN_APPEND_ONLY 0x00000010463 #define EXT_DO_NOT_BACKUP 0x00000020464 #define EXT_NO_UPDATE_ATIME 0x00000040465 #define EXT_HIDDEN 0x00000080466 467 #define SMB_QUERY_FILE_UNIX_LINK 0x201468 #define SMB_SET_FILE_UNIX_LINK 0x201469 #define SMB_SET_FILE_UNIX_HLINK 0x203470 /* SMB_QUERY_POSIX_ACL 0x204 see below */471 #define SMB_QUERY_XATTR 0x205 /* need for non-user XATTRs */472 #define SMB_QUERY_ATTR_FLAGS 0x206 /* chflags, chattr */473 #define SMB_SET_ATTR_FLAGS 0x206474 #define SMB_QUERY_POSIX_PERMISSION 0x207475 /* Only valid for qfileinfo */476 #define SMB_QUERY_POSIX_LOCK 0x208477 /* Only valid for setfileinfo */478 #define SMB_SET_POSIX_LOCK 0x208479 480 /* The set info levels for POSIX path operations. */481 #define SMB_POSIX_PATH_OPEN 0x209482 #define SMB_POSIX_PATH_UNLINK 0x20A483 484 #define SMB_QUERY_FILE_UNIX_INFO2 0x20B /* UNIX File Info2 */485 #define SMB_SET_FILE_UNIX_INFO2 0x20B486 487 /*488 SMB_QUERY_FILE_UNIX_INFO2 is SMB_QUERY_FILE_UNIX_BASIC with create489 time and file flags appended. The corresponding info level for490 findfirst/findnext is SMB_FIND_FILE_UNIX_INFO2.491 Size Offset Value492 ---------------------493 0 LARGE_INTEGER EndOfFile File size494 8 LARGE_INTEGER Blocks Number of blocks used on disk495 16 LARGE_INTEGER ChangeTime Attribute change time496 24 LARGE_INTEGER LastAccessTime Last access time497 32 LARGE_INTEGER LastModificationTime Last modification time498 40 LARGE_INTEGER Uid Numeric user id for the owner499 48 LARGE_INTEGER Gid Numeric group id of owner500 56 ULONG Type Enumeration specifying the file type501 60 LARGE_INTEGER devmajor Major device number if type is device502 68 LARGE_INTEGER devminor Minor device number if type is device503 76 LARGE_INTEGER uniqueid This is a server-assigned unique id504 84 LARGE_INTEGER permissions Standard UNIX permissions505 92 LARGE_INTEGER nlinks Number of hard links506 100 LARGE_INTEGER CreationTime Create/birth time507 108 ULONG FileFlags File flags enumeration508 112 ULONG FileFlagsMask Mask of valid flags509 */510 511 /* Transact 2 Find First levels */512 #define SMB_FIND_FILE_UNIX 0x202513 #define SMB_FIND_FILE_UNIX_INFO2 0x20B /* UNIX File Info2 */514 515 #define SMB_FILE_UNIX_INFO2_SIZE 116516 517 /*518 Info level for TRANS2_QFSINFO - returns version of CIFS UNIX extensions, plus519 64-bits worth of capability fun :-).520 Use the same info level for TRANS2_SETFSINFO521 */522 523 #define SMB_QUERY_CIFS_UNIX_INFO 0x200524 #define SMB_SET_CIFS_UNIX_INFO 0x200525 526 /* Returns or sets the following.527 528 UINT16 major version number529 UINT16 minor version number530 LARGE_INTEGER capability bitfield531 532 */533 534 #define CIFS_UNIX_MAJOR_VERSION 1535 #define CIFS_UNIX_MINOR_VERSION 0536 537 #define CIFS_UNIX_FCNTL_LOCKS_CAP 0x1538 #define CIFS_UNIX_POSIX_ACLS_CAP 0x2539 #define CIFS_UNIX_XATTTR_CAP 0x4 /* for support of other xattr540 namespaces such as system,541 security and trusted */542 #define CIFS_UNIX_EXTATTR_CAP 0x8 /* for support of chattr543 (chflags) and lsattr */544 #define CIFS_UNIX_POSIX_PATHNAMES_CAP 0x10 /* Use POSIX pathnames on the wire. */545 #define CIFS_UNIX_POSIX_PATH_OPERATIONS_CAP 0x20 /* We can cope with POSIX open/mkdir/unlink etc. */546 #define CIFS_UNIX_LARGE_READ_CAP 0x40 /* We can cope with 24 bit reads in readX. */547 #define CIFS_UNIX_LARGE_WRITE_CAP 0x80 /* We can cope with 24 bit writes in writeX. */548 #define CIFS_UNIX_TRANSPORT_ENCRYPTION_CAP 0x100 /* We can do SPNEGO negotiations for encryption. */549 #define CIFS_UNIX_TRANSPORT_ENCRYPTION_MANDATORY_CAP 0x200 /* We *must* SPNEGO negotiations for encryption. */550 551 #define SMB_QUERY_POSIX_FS_INFO 0x201552 553 /* Returns FILE_SYSTEM_POSIX_INFO struct as follows554 (NB For undefined values return -1 in that field)555 le32 OptimalTransferSize; bsize on some os, iosize on other os, This556 is a hint to the client about best size. Server557 can return -1 if no preference, ie if SMB558 negotiated size is adequate for optimal559 read/write performance560 le32 BlockSize; (often 512 bytes) NB: BlockSize * TotalBlocks = disk space561 le64 TotalBlocks; redundant with other infolevels but easy to ret here562 le64 BlocksAvail; although redundant, easy to return563 le64 UserBlocksAvail; bavail564 le64 TotalFileNodes;565 le64 FreeFileNodes;566 le64 FileSysIdentifier; fsid567 (NB statfs field Namelen comes from FILE_SYSTEM_ATTRIBUTE_INFO call)568 (NB statfs field flags can come from FILE_SYSTEM_DEVICE_INFO call)569 */570 571 #define SMB_QUERY_POSIX_WHO_AM_I 0x202 /* QFS Info */572 /* returns:573 __u32 flags; 0 = Authenticated user 1 = GUEST574 __u32 mask; which flags bits server understands ie 0x0001575 __u64 unix_user_id;576 __u64 unix_user_gid;577 __u32 number_of_supplementary_gids; may be zero578 __u32 number_of_sids; may be zero579 __u32 length_of_sid_array; in bytes - may be zero580 __u32 pad; reserved - MBZ581 __u64 gid_array[0]; may be empty582 __u8 * psid_list may be empty583 */584 585 /* ... more as we think of them :-). */586 587 /* SMB POSIX ACL definitions. */588 /* Wire format is (all little endian) :589 590 [2 bytes] - Version number.591 [2 bytes] - Number of ACE entries to follow.592 [2 bytes] - Number of default ACE entries to follow.593 -------------------------------------594 ^595 |596 ACE entries597 |598 v599 -------------------------------------600 ^601 |602 Default ACE entries603 |604 v605 -------------------------------------606 607 Where an ACE entry looks like :608 609 [1 byte] - Entry type.610 611 Entry types are :612 613 ACL_USER_OBJ 0x01614 ACL_USER 0x02615 ACL_GROUP_OBJ 0x04616 ACL_GROUP 0x08617 ACL_MASK 0x10618 ACL_OTHER 0x20619 620 [1 byte] - permissions (perm_t)621 622 perm_t types are :623 624 ACL_READ 0x04625 ACL_WRITE 0x02626 ACL_EXECUTE 0x01627 628 [8 bytes] - uid/gid to apply this permission to.629 630 In the same format as the uid/gid fields in the other631 UNIX extensions definitions. Use 0xFFFFFFFFFFFFFFFF for632 the MASK and OTHER entry types.633 634 If the Number of ACE entries for either file or default ACE's635 is set to 0xFFFF this means ignore this kind of ACE (and the636 number of entries sent will be zero.637 638 */639 640 #define SMB_QUERY_POSIX_WHOAMI 0x202641 642 enum smb_whoami_flags {643 SMB_WHOAMI_GUEST = 0x1 /* Logged in as (or squashed to) guest */644 };645 646 /* Mask of which WHOAMI bits are valid. This should make it easier for clients647 * to cope with servers that have different sets of WHOAMI flags (as more get648 * added).649 */650 #define SMB_WHOAMI_MASK 0x00000001651 652 /*653 SMBWhoami - Query the user mapping performed by the server for the654 connected tree. This is a subcommand of the TRANS2_QFSINFO.655 656 Returns:657 4 bytes unsigned - mapping flags (smb_whoami_flags)658 4 bytes unsigned - flags mask659 660 8 bytes unsigned - primary UID661 8 bytes unsigned - primary GID662 4 bytes unsigned - number of supplementary GIDs663 4 bytes unsigned - number of SIDs664 4 bytes unsigned - SID list byte count665 4 bytes - pad / reserved (must be zero)666 667 8 bytes unsigned[] - list of GIDs (may be empty)668 struct dom_sid[] - list of SIDs (may be empty)669 */670 671 /*672 * The following trans2 is done between client and server673 * as a FSINFO call to set up the encryption state for transport674 * encryption.675 * This is a subcommand of the TRANS2_QFSINFO.676 *677 * The request looks like :678 *679 * [data block] -> SPNEGO framed GSSAPI request.680 *681 * The reply looks like :682 *683 * [data block] -> SPNEGO framed GSSAPI reply - if error684 * is NT_STATUS_OK then we're done, if it's685 * NT_STATUS_MORE_PROCESSING_REQUIRED then the686 * client needs to keep going. If it's an687 * error it can be any NT_STATUS error.688 *689 */690 691 #define SMB_REQUEST_TRANSPORT_ENCRYPTION 0x203 /* QFSINFO */692 693 694 /* The query/set info levels for POSIX ACLs. */695 #define SMB_QUERY_POSIX_ACL 0x204696 #define SMB_SET_POSIX_ACL 0x204697 698 /* Current on the wire ACL version. */699 #define SMB_POSIX_ACL_VERSION 1700 701 /* ACE entry type. */702 #define SMB_POSIX_ACL_USER_OBJ 0x01703 #define SMB_POSIX_ACL_USER 0x02704 #define SMB_POSIX_ACL_GROUP_OBJ 0x04705 #define SMB_POSIX_ACL_GROUP 0x08706 #define SMB_POSIX_ACL_MASK 0x10707 #define SMB_POSIX_ACL_OTHER 0x20708 709 /* perm_t types. */710 #define SMB_POSIX_ACL_READ 0x04711 #define SMB_POSIX_ACL_WRITE 0x02712 #define SMB_POSIX_ACL_EXECUTE 0x01713 714 #define SMB_POSIX_ACL_HEADER_SIZE 6715 #define SMB_POSIX_ACL_ENTRY_SIZE 10716 717 #define SMB_POSIX_IGNORE_ACE_ENTRIES 0xFFFF718 719 /* Definition of data block of SMB_SET_POSIX_LOCK */720 /*721 [2 bytes] lock_type - 0 = Read, 1 = Write, 2 = Unlock722 [2 bytes] lock_flags - 1 = Wait (only valid for setlock)723 [4 bytes] pid = locking context.724 [8 bytes] start = unsigned 64 bits.725 [8 bytes] length = unsigned 64 bits.726 */727 728 #define POSIX_LOCK_TYPE_OFFSET 0729 #define POSIX_LOCK_FLAGS_OFFSET 2730 #define POSIX_LOCK_PID_OFFSET 4731 #define POSIX_LOCK_START_OFFSET 8732 #define POSIX_LOCK_LEN_OFFSET 16733 #define POSIX_LOCK_DATA_SIZE 24734 735 #define POSIX_LOCK_FLAG_NOWAIT 0736 #define POSIX_LOCK_FLAG_WAIT 1737 738 #define POSIX_LOCK_TYPE_READ 0739 #define POSIX_LOCK_TYPE_WRITE 1740 #define POSIX_LOCK_TYPE_UNLOCK 2741 742 /* SMB_POSIX_PATH_OPEN "open_mode" definitions. */743 #define SMB_O_RDONLY 0x1744 #define SMB_O_WRONLY 0x2745 #define SMB_O_RDWR 0x4746 747 #define SMB_ACCMODE 0x7748 749 #define SMB_O_CREAT 0x10750 #define SMB_O_EXCL 0x20751 #define SMB_O_TRUNC 0x40752 #define SMB_O_APPEND 0x80753 #define SMB_O_SYNC 0x100754 #define SMB_O_DIRECTORY 0x200755 #define SMB_O_NOFOLLOW 0x400756 #define SMB_O_DIRECT 0x800757 758 /* Definition of request data block for SMB_POSIX_PATH_OPEN */759 /*760 [4 bytes] flags (as smb_ntcreate_Flags).761 [4 bytes] open_mode - SMB_O_xxx flags above.762 [8 bytes] mode_t (permissions) - same encoding as "Standard UNIX permissions" above in SMB_SET_FILE_UNIX_BASIC.763 [2 bytes] ret_info_level - optimization. Info level to be returned.764 */765 766 /* Definition of reply data block for SMB_POSIX_PATH_OPEN */767 768 #define SMB_NO_INFO_LEVEL_RETURNED 0xFFFF769 770 /*771 [2 bytes] - flags field. Identical to flags reply for oplock response field in SMBNTCreateX)772 [2 bytes] - FID returned.773 [4 bytes] - CreateAction (same as in NTCreateX response).774 [2 bytes] - reply info level - as requested or 0xFFFF if not available.775 [2 bytes] - padding (must be zero)776 [n bytes] - info level reply - if available.777 */778 779 /* Definition of request data block for SMB_POSIX_UNLINK */780 /*781 [2 bytes] flags (defined below).782 */783 784 #define SMB_POSIX_UNLINK_FILE_TARGET 0785 #define SMB_POSIX_UNLINK_DIRECTORY_TARGET 1786 787 367 #endif -
vendor/current/source3/include/transfer_file.h
r414 r988 25 25 void *out_file, 26 26 size_t n, 27 ssize_t (* read_fn)(void *, void *, size_t),28 ssize_t (* write_fn)(void *, const void *, size_t));27 ssize_t (*pread_fn)(void *, void *, size_t, off_t), 28 ssize_t (*pwrite_fn)(void *, const void *, size_t, off_t)); 29 29 30 SMB_OFF_T transfer_file(int infd, int outfd, SMB_OFF_Tn);30 off_t transfer_file(int infd, int outfd, off_t n); 31 31 32 32 #endif /* __TRANSFER_FILE_H__ */ -
vendor/current/source3/include/util_tdb.h
r740 r988 27 27 #include "../../lib/util/util_tdb.h" 28 28 29 int tdb_chainlock_with_timeout( struct tdb_context *tdb, TDB_DATA key,30 unsigned int timeout);31 int tdb_lock_bystring_with_timeout(struct tdb_context *tdb, const char *keyval,32 int timeout);33 int tdb_read_lock_bystring_with_timeout(TDB_CONTEXT *tdb, const char *keyval,34 unsigned int timeout);35 36 29 int tdb_trans_store_bystring(TDB_CONTEXT *tdb, const char *keystr, 37 30 TDB_DATA data, int flags); … … 40 33 int tdb_trans_delete(struct tdb_context *tdb, TDB_DATA key); 41 34 42 int tdb_unpack(const uint8 *buf, int bufsize, const char *fmt, ...); 43 size_t tdb_pack(uint8 *buf, int bufsize, const char *fmt, ...); 44 bool tdb_pack_append(TALLOC_CTX *mem_ctx, uint8 **buf, size_t *len, 35 /* 36 * The tdb_unpack() and tdb_pack[_append]() helpers are deprecated. Consider 37 * using idl/ndr for marshalling of complex data types instead. 38 */ 39 int tdb_unpack(const uint8_t *buf, int bufsize, const char *fmt, ...); 40 size_t tdb_pack(uint8_t *buf, int bufsize, const char *fmt, ...); 41 bool tdb_pack_append(TALLOC_CTX *mem_ctx, uint8_t **buf, size_t *len, 45 42 const char *fmt, ...); 46 43 … … 52 49 int tdb_data_cmp(TDB_DATA t1, TDB_DATA t2); 53 50 51 char *tdb_data_string(TALLOC_CTX *mem_ctx, TDB_DATA d); 52 53 /**************************************************************************** 54 Lock a chain, with timeout. 55 ****************************************************************************/ 56 int tdb_chainlock_with_timeout( struct tdb_context *tdb, TDB_DATA key, 57 unsigned int timeout); 58 59 /**************************************************************************** 60 Lock a chain by string, with timeout Return non-zero if lock failed. 61 ****************************************************************************/ 62 int tdb_lock_bystring_with_timeout(struct tdb_context *tdb, const char *keyval, 63 int timeout); 64 65 /**************************************************************************** 66 Readlock a chain by string, with timeout Return non-zero if lock failed. 67 ****************************************************************************/ 68 int tdb_read_lock_bystring_with_timeout(TDB_CONTEXT *tdb, const char *keyval, 69 unsigned int timeout); 70 71 54 72 #endif /* __TDBUTIL_H__ */ -
vendor/current/source3/include/vfs.h
r740 r988 7 7 Copyright (C) Stefan (metze) Metzmacher 2003 8 8 Copyright (C) Volker Lendecke 2009 9 9 10 10 This program is free software; you can redistribute it and/or modify 11 11 it under the terms of the GNU General Public License as published by 12 12 the Free Software Foundation; either version 3 of the License, or 13 13 (at your option) any later version. 14 14 15 15 This program is distributed in the hope that it will be useful, 16 16 but WITHOUT ANY WARRANTY; without even the implied warranty of 17 17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 18 GNU General Public License for more details. 19 19 20 20 You should have received a copy of the GNU General Public License 21 21 along with this program. If not, see <http://www.gnu.org/licenses/>. … … 135 135 /* Leave at 28 - not yet released. Add fdopendir. JRA. */ 136 136 /* Leave at 28 - not yet released. Rename open function to open_fn. - gd */ 137 #define SMB_VFS_INTERFACE_VERSION 28 137 /* Leave at 28 - not yet released. Make getwd function always return malloced memory. JRA. */ 138 /* Bump to version 29 - Samba 3.6.0 will ship with interface version 28. */ 139 /* Leave at 29 - not yet releases. Add fsctl. Richard Sharpe */ 140 /* Leave at 29 - not yet released. add SMB_VFS_GET_DFS_REFERRAL() - metze */ 141 /* Leave at 29 - not yet released. Remove l{list,get,set,remove}xattr - abartlet */ 142 /* Leave at 29 - not yet released. move to plain off_t - abartlet */ 143 /* Leave at 29 - not yet released. Remove sys_acl functions other than set and get - abartlet */ 144 /* Leave at 29 - not yet released. Added backup_intent bool to files_struct - JRA */ 145 /* Leave at 29 - not yet released. Add durable handle functions - metze/obnox */ 146 /* Leave at 29 - not yet released. Added sys_acl_blob_get_file and sys_acl_blob_get_fd */ 147 /* Bump to version 30 - Samba 4.0.0 will ship with interface version 30 */ 148 /* Leave at 30 - not yet released. Added conn->cwd to save vfs_GetWd() calls. */ 149 /* Leave at 30 - not yet released. Changed sys_acl_blob_get_file interface to remove type */ 150 /* Bump to version 31 - Samba 4.1.0 will ship with interface version 31 */ 151 /* Leave at 31 - not yet released. Make struct vuid_cache_entry in 152 connection_struct a pointer. */ 153 /* Leave at 31 - not yet released. Add share_access to vuid_cache_entry. */ 154 /* Leave at 31 - not yet released. add SMB_VFS_COPY_CHUNK() */ 155 /* Leave at 31 - not yet released. Remove the unused 156 fsp->pending_break_messages array */ 157 /* Leave at 31 - not yet released. add SMB_VFS_[GET/SET]_COMPRESSION() */ 158 159 /* Bump to version 32 - Samba 4.2 will ship with that. */ 160 /* Version 32 - Add "lease" to CREATE_FILE operation */ 161 /* Version 32 - Add "lease" to struct files_struct */ 162 /* Version 32 - Add SMB_VFS_READDIR_ATTR() */ 163 /* Version 32 - Add in and out create context blobs to create_file */ 164 /* Version 32 - Remove unnecessary SMB_VFS_DISK_FREE() small_query parameter */ 165 /* Bump to version 33 - Samba 4.3 will ship with that. */ 166 /* Version 33 - change fallocate mode flags param from enum->uint32_t */ 167 /* Version 33 - Add snapshot create/delete calls */ 168 /* Version 33 - Add OS X SMB2 AAPL copyfile extension flag to fsp */ 169 /* Version 33 - Remove notify_watch_fn */ 170 /* Bump to version 34 - Samba 4.4 will ship with that */ 171 /* Version 34 - Remove bool posix_open, add uint64_t posix_flags */ 172 /* Version 34 - Added bool posix_pathnames to struct smb_request */ 173 174 #define SMB_VFS_INTERFACE_VERSION 34 138 175 139 176 /* … … 155 192 struct blocking_lock_record; 156 193 struct smb_filename; 157 158 #define VFS_FIND(__fn__) while (handle->fns->__fn__==NULL) { \ 194 struct dfs_GetDFSReferral; 195 196 typedef union unid_t { 197 uid_t uid; 198 gid_t gid; 199 } unid_t; 200 201 struct fd_handle { 202 size_t ref_count; 203 int fd; 204 uint64_t position_information; 205 off_t pos; 206 uint32_t private_options; /* NT Create options, but we only look at 207 * NTCREATEX_OPTIONS_PRIVATE_DENY_DOS and 208 * NTCREATEX_OPTIONS_PRIVATE_DENY_FCB and 209 * NTCREATEX_OPTIONS_PRIVATE_DELETE_ON_CLOSE 210 * for print files *only*, where 211 * DELETE_ON_CLOSE is not stored in the share 212 * mode database. 213 */ 214 unsigned long gen_id; 215 }; 216 217 struct fsp_lease { 218 size_t ref_count; 219 struct smbd_server_connection *sconn; 220 struct tevent_timer *timeout; 221 struct smb2_lease lease; 222 }; 223 224 typedef struct files_struct { 225 struct files_struct *next, *prev; 226 uint64_t fnum; 227 struct smbXsrv_open *op; 228 struct connection_struct *conn; 229 struct fd_handle *fh; 230 unsigned int num_smb_operations; 231 struct file_id file_id; 232 uint64_t initial_allocation_size; /* Faked up initial allocation on disk. */ 233 uint16_t file_pid; 234 uint64_t vuid; /* SMB2 compat */ 235 struct write_cache *wcp; 236 struct timeval open_time; 237 uint32_t access_mask; /* NTCreateX access bits (FILE_READ_DATA etc.) */ 238 uint32_t share_access; /* NTCreateX share constants (FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE). */ 239 240 bool update_write_time_triggered; 241 struct tevent_timer *update_write_time_event; 242 bool update_write_time_on_close; 243 struct timespec close_write_time; 244 bool write_time_forced; 245 246 int oplock_type; 247 struct fsp_lease *lease; /* Not yet used. Placeholder for leases. */ 248 int sent_oplock_break; 249 struct tevent_timer *oplock_timeout; 250 struct lock_struct last_lock_failure; 251 int current_lock_count; /* Count the number of outstanding locks and pending locks. */ 252 253 bool can_lock; 254 bool can_read; 255 bool can_write; 256 bool modified; 257 bool is_directory; 258 bool aio_write_behind; 259 bool initial_delete_on_close; /* Only set at NTCreateX if file was created. */ 260 bool delete_on_close; 261 uint64_t posix_flags; 262 bool is_sparse; 263 bool backup_intent; /* Handle was successfully opened with backup intent 264 and opener has privilege to do so. */ 265 bool aapl_copyfile_supported; 266 struct smb_filename *fsp_name; 267 uint32_t name_hash; /* Jenkins hash of full pathname. */ 268 uint64_t mid; /* Mid of the operation that created us. */ 269 270 struct vfs_fsp_data *vfs_extension; 271 struct fake_file_handle *fake_file_handle; 272 273 struct notify_change_buf *notify; 274 275 struct files_struct *base_fsp; /* placeholder for delete on close */ 276 277 /* 278 * Read-only cached brlock record, thrown away when the 279 * brlock.tdb seqnum changes. This avoids fetching data from 280 * the brlock.tdb on every read/write call. 281 */ 282 int brlock_seqnum; 283 struct byte_range_lock *brlock_rec; 284 285 struct dptr_struct *dptr; 286 287 /* if not NULL, means this is a print file */ 288 struct print_file_data *print_file; 289 290 unsigned num_aio_requests; 291 struct tevent_req **aio_requests; 292 293 /* 294 * If a close request comes in while we still have aio_requests 295 * around, we need to hold back the close. When all aio_requests are 296 * done, the aio completion routines need tevent_wait_done() on 297 * this. A bit ugly, but before we have close_file() fully async 298 * possibly the simplest approach. Thanks, Jeremy for the idea. 299 */ 300 struct tevent_req *deferred_close; 301 } files_struct; 302 303 #define FSP_POSIX_FLAGS_OPEN 0x01 304 #define FSP_POSIX_FLAGS_RENAME 0x02 305 #define FSP_POSIX_FLAGS_PATHNAMES 0x04 306 307 #define FSP_POSIX_FLAGS_ALL \ 308 (FSP_POSIX_FLAGS_OPEN | \ 309 FSP_POSIX_FLAGS_PATHNAMES | \ 310 FSP_POSIX_FLAGS_RENAME) 311 312 struct vuid_cache_entry { 313 struct auth_session_info *session_info; 314 uint64_t vuid; /* SMB2 compat */ 315 bool read_only; 316 uint32_t share_access; 317 }; 318 319 struct vuid_cache { 320 unsigned int next_entry; 321 struct vuid_cache_entry array[VUID_CACHE_SIZE]; 322 }; 323 324 typedef struct { 325 char *name; 326 bool is_wild; 327 } name_compare_entry; 328 329 struct dfree_cached_info { 330 time_t last_dfree_time; 331 uint64_t dfree_ret; 332 uint64_t bsize; 333 uint64_t dfree; 334 uint64_t dsize; 335 }; 336 337 struct share_params { 338 int service; 339 }; 340 341 typedef struct connection_struct { 342 struct connection_struct *next, *prev; 343 struct smbd_server_connection *sconn; /* can be NULL */ 344 struct smbXsrv_tcon *tcon; /* can be NULL */ 345 uint32_t cnum; /* an index passed over the wire */ 346 struct share_params *params; 347 bool force_user; 348 struct vuid_cache *vuid_cache; 349 bool printer; 350 bool ipc; 351 bool read_only; /* Attributes for the current user of the share. */ 352 uint32_t share_access; 353 /* Does this filesystem honor 354 sub second timestamps on files 355 and directories when setting time ? */ 356 enum timestamp_set_resolution ts_res; 357 char *connectpath; 358 char *origpath; 359 char *cwd; /* Working directory. */ 360 361 struct vfs_handle_struct *vfs_handles; /* for the new plugins */ 362 363 /* 364 * This represents the user information on this connection. Depending 365 * on the vuid using this tid, this might change per SMB request. 366 */ 367 struct auth_session_info *session_info; 368 369 /* 370 * If the "force group" parameter is set, this is the primary gid that 371 * may be used in the users token, depending on the vuid using this tid. 372 */ 373 gid_t force_group_gid; 374 375 uint64_t vuid; /* vuid of user who *opened* this connection, or UID_FIELD_INVALID */ 376 377 time_t lastused; 378 time_t lastused_count; 379 int num_files_open; 380 unsigned int num_smb_operations; /* Count of smb operations on this tree. */ 381 int encrypt_level; 382 bool encrypted_tid; 383 384 /* Semantics requested by the client or forced by the server config. */ 385 bool case_sensitive; 386 bool case_preserve; 387 bool short_case_preserve; 388 389 /* Semantics provided by the underlying filesystem. */ 390 int fs_capabilities; 391 /* Device number of the directory of the share mount. 392 Used to ensure unique FileIndex returns. */ 393 SMB_DEV_T base_share_dev; 394 395 name_compare_entry *hide_list; /* Per-share list of files to return as hidden. */ 396 name_compare_entry *veto_list; /* Per-share list of files to veto (never show). */ 397 name_compare_entry *veto_oplock_list; /* Per-share list of files to refuse oplocks on. */ 398 name_compare_entry *aio_write_behind_list; /* Per-share list of files to use aio write behind on. */ 399 struct dfree_cached_info *dfree_info; 400 struct trans_state *pending_trans; 401 402 struct rpc_pipe_client *spoolss_pipe; 403 404 } connection_struct; 405 406 struct smbd_smb2_request; 407 struct privilege_paths; 408 409 struct smb_request { 410 uint8_t cmd; 411 uint16_t flags2; 412 uint16_t smbpid; 413 uint64_t mid; /* For compatibility with SMB2. */ 414 uint32_t seqnum; 415 uint64_t vuid; /* For compatibility with SMB2. */ 416 uint32_t tid; 417 uint8_t wct; 418 const uint16_t *vwv; 419 uint16_t buflen; 420 const uint8_t *buf; 421 const uint8_t *inbuf; 422 423 /* 424 * Async handling in the main smb processing loop is directed by 425 * outbuf: reply_xxx routines indicate sync behaviour by putting their 426 * reply into "outbuf". If they leave it as NULL, they take care of it 427 * themselves, possibly later. 428 * 429 * If async handling is wanted, the reply_xxx routine must make sure 430 * that it talloc_move()s the smb_req somewhere else. 431 */ 432 uint8_t *outbuf; 433 434 size_t unread_bytes; 435 bool encrypted; 436 connection_struct *conn; 437 struct smbd_server_connection *sconn; 438 struct smbXsrv_connection *xconn; 439 struct smb_perfcount_data pcd; 440 441 /* 442 * Chained request handling 443 */ 444 struct files_struct *chain_fsp; 445 446 /* 447 * state information for async smb handling 448 */ 449 void *async_priv; 450 451 /* 452 * Back pointer to smb2 request. 453 */ 454 struct smbd_smb2_request *smb2req; 455 456 /* 457 * Pathnames used if request done 458 * under privilege. 459 */ 460 struct privilege_paths *priv_paths; 461 462 /* 463 * Request list for chained requests, we're part of it. 464 */ 465 struct smb_request **chain; 466 467 struct timeval request_time; 468 469 bool posix_pathnames; 470 }; 471 472 /* 473 * Info about an alternate data stream 474 */ 475 476 struct stream_struct { 477 off_t size; 478 off_t alloc_size; 479 char *name; 480 }; 481 482 /* time info */ 483 struct smb_file_time { 484 struct timespec mtime; 485 struct timespec atime; 486 struct timespec ctime; 487 struct timespec create_time; 488 }; 489 490 /* 491 * smb_filename 492 */ 493 struct smb_filename { 494 char *base_name; 495 char *stream_name; 496 char *original_lcomp; 497 SMB_STRUCT_STAT st; 498 }; 499 500 #define VFS_FIND(__fn__) while (handle->fns->__fn__##_fn==NULL) { \ 159 501 handle = handle->next; \ 160 502 } … … 165 507 }; 166 508 167 enum vfs_fallocate_ mode{168 VFS_FALLOCATE_ EXTEND_SIZE = 0,169 VFS_FALLOCATE_ KEEP_SIZE = 1509 enum vfs_fallocate_flags { 510 VFS_FALLOCATE_FL_KEEP_SIZE = 0x0001, 511 VFS_FALLOCATE_FL_PUNCH_HOLE = 0x0002, 170 512 }; 171 513 … … 182 524 183 525 int (*connect_fn)(struct vfs_handle_struct *handle, const char *service, const char *user); 184 void (*disconnect )(struct vfs_handle_struct *handle);185 uint64_t (*disk_free )(struct vfs_handle_struct *handle, const char *path, bool small_query, uint64_t *bsize,526 void (*disconnect_fn)(struct vfs_handle_struct *handle); 527 uint64_t (*disk_free_fn)(struct vfs_handle_struct *handle, const char *path, uint64_t *bsize, 186 528 uint64_t *dfree, uint64_t *dsize); 187 int (*get_quota)(struct vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt); 188 int (*set_quota)(struct vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt); 189 int (*get_shadow_copy_data)(struct vfs_handle_struct *handle, struct files_struct *fsp, struct shadow_copy_data *shadow_copy_data, bool labels); 190 int (*statvfs)(struct vfs_handle_struct *handle, const char *path, struct vfs_statvfs_struct *statbuf); 191 uint32_t (*fs_capabilities)(struct vfs_handle_struct *handle, enum timestamp_set_resolution *p_ts_res); 529 int (*get_quota_fn)(struct vfs_handle_struct *handle, const char *path, 530 enum SMB_QUOTA_TYPE qtype, unid_t id, 531 SMB_DISK_QUOTA *qt); 532 int (*set_quota_fn)(struct vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt); 533 int (*get_shadow_copy_data_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, struct shadow_copy_data *shadow_copy_data, bool labels); 534 int (*statvfs_fn)(struct vfs_handle_struct *handle, const char *path, struct vfs_statvfs_struct *statbuf); 535 uint32_t (*fs_capabilities_fn)(struct vfs_handle_struct *handle, enum timestamp_set_resolution *p_ts_res); 536 537 /* 538 * Note: that "struct dfs_GetDFSReferral *r" 539 * needs to be a valid TALLOC_CTX 540 */ 541 NTSTATUS (*get_dfs_referrals_fn)(struct vfs_handle_struct *handle, 542 struct dfs_GetDFSReferral *r); 192 543 193 544 /* Directory operations */ 194 545 195 SMB_STRUCT_DIR *(*opendir)(struct vfs_handle_struct *handle, const char *fname, const char *mask, uint32attributes);196 SMB_STRUCT_DIR *(*fdopendir)(struct vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32attributes);197 SMB_STRUCT_DIRENT *(*readdir)(struct vfs_handle_struct *handle,198 SMB_STRUCT_DIR *dirp,199 200 void (*seekdir )(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp, long offset);201 long (*telldir )(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp);202 void (*rewind_dir )(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp);203 int (*mkdir )(struct vfs_handle_struct *handle, const char *path, mode_t mode);204 int (*rmdir )(struct vfs_handle_struct *handle, const char *path);205 int (*closedir )(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dir);206 void (*init_search_op )(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp);546 DIR *(*opendir_fn)(struct vfs_handle_struct *handle, const char *fname, const char *mask, uint32_t attributes); 547 DIR *(*fdopendir_fn)(struct vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32_t attributes); 548 struct dirent *(*readdir_fn)(struct vfs_handle_struct *handle, 549 DIR *dirp, 550 SMB_STRUCT_STAT *sbuf); 551 void (*seekdir_fn)(struct vfs_handle_struct *handle, DIR *dirp, long offset); 552 long (*telldir_fn)(struct vfs_handle_struct *handle, DIR *dirp); 553 void (*rewind_dir_fn)(struct vfs_handle_struct *handle, DIR *dirp); 554 int (*mkdir_fn)(struct vfs_handle_struct *handle, const char *path, mode_t mode); 555 int (*rmdir_fn)(struct vfs_handle_struct *handle, const char *path); 556 int (*closedir_fn)(struct vfs_handle_struct *handle, DIR *dir); 557 void (*init_search_op_fn)(struct vfs_handle_struct *handle, DIR *dirp); 207 558 208 559 /* File operations */ … … 211 562 struct smb_filename *smb_fname, files_struct *fsp, 212 563 int flags, mode_t mode); 213 NTSTATUS (*create_file)(struct vfs_handle_struct *handle, 214 struct smb_request *req, 215 uint16_t root_dir_fid, 216 struct smb_filename *smb_fname, 217 uint32_t access_mask, 218 uint32_t share_access, 219 uint32_t create_disposition, 220 uint32_t create_options, 221 uint32_t file_attributes, 222 uint32_t oplock_request, 223 uint64_t allocation_size, 224 uint32_t private_flags, 225 struct security_descriptor *sd, 226 struct ea_list *ea_list, 227 files_struct **result, 228 int *pinfo); 564 NTSTATUS (*create_file_fn)(struct vfs_handle_struct *handle, 565 struct smb_request *req, 566 uint16_t root_dir_fid, 567 struct smb_filename *smb_fname, 568 uint32_t access_mask, 569 uint32_t share_access, 570 uint32_t create_disposition, 571 uint32_t create_options, 572 uint32_t file_attributes, 573 uint32_t oplock_request, 574 struct smb2_lease *lease, 575 uint64_t allocation_size, 576 uint32_t private_flags, 577 struct security_descriptor *sd, 578 struct ea_list *ea_list, 579 files_struct **result, 580 int *pinfo, 581 const struct smb2_create_blobs *in_context_blobs, 582 struct smb2_create_blobs *out_context_blobs); 229 583 int (*close_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp); 230 ssize_t (*vfs_read)(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n); 231 ssize_t (*pread)(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n, SMB_OFF_T offset); 232 ssize_t (*write)(struct vfs_handle_struct *handle, struct files_struct *fsp, const void *data, size_t n); 233 ssize_t (*pwrite)(struct vfs_handle_struct *handle, struct files_struct *fsp, const void *data, size_t n, SMB_OFF_T offset); 234 SMB_OFF_T (*lseek)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_OFF_T offset, int whence); 235 ssize_t (*sendfile)(struct vfs_handle_struct *handle, int tofd, files_struct *fromfsp, const DATA_BLOB *header, SMB_OFF_T offset, size_t count); 236 ssize_t (*recvfile)(struct vfs_handle_struct *handle, int fromfd, files_struct *tofsp, SMB_OFF_T offset, size_t count); 237 int (*rename)(struct vfs_handle_struct *handle, 238 const struct smb_filename *smb_fname_src, 239 const struct smb_filename *smb_fname_dst); 240 int (*fsync)(struct vfs_handle_struct *handle, struct files_struct *fsp); 241 int (*stat)(struct vfs_handle_struct *handle, struct smb_filename *smb_fname); 242 int (*fstat)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_STAT *sbuf); 243 int (*lstat)(struct vfs_handle_struct *handle, struct smb_filename *smb_filename); 244 uint64_t (*get_alloc_size)(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_STAT *sbuf); 245 int (*unlink)(struct vfs_handle_struct *handle, 246 const struct smb_filename *smb_fname); 247 int (*chmod)(struct vfs_handle_struct *handle, const char *path, mode_t mode); 248 int (*fchmod)(struct vfs_handle_struct *handle, struct files_struct *fsp, mode_t mode); 249 int (*chown)(struct vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid); 250 int (*fchown)(struct vfs_handle_struct *handle, struct files_struct *fsp, uid_t uid, gid_t gid); 251 int (*lchown)(struct vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid); 252 int (*chdir)(struct vfs_handle_struct *handle, const char *path); 253 char *(*getwd)(struct vfs_handle_struct *handle, char *buf); 254 int (*ntimes)(struct vfs_handle_struct *handle, 255 const struct smb_filename *smb_fname, 256 struct smb_file_time *ft); 257 int (*ftruncate)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_OFF_T offset); 258 int (*fallocate)(struct vfs_handle_struct *handle, 259 struct files_struct *fsp, 260 enum vfs_fallocate_mode mode, 261 SMB_OFF_T offset, 262 SMB_OFF_T len); 263 bool (*lock)(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type); 264 int (*kernel_flock)(struct vfs_handle_struct *handle, struct files_struct *fsp, 265 uint32 share_mode, uint32_t access_mask); 266 int (*linux_setlease)(struct vfs_handle_struct *handle, struct files_struct *fsp, int leasetype); 267 bool (*getlock)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid); 268 int (*symlink)(struct vfs_handle_struct *handle, const char *oldpath, const char *newpath); 269 int (*vfs_readlink)(struct vfs_handle_struct *handle, const char *path, char *buf, size_t bufsiz); 270 int (*link)(struct vfs_handle_struct *handle, const char *oldpath, const char *newpath); 271 int (*mknod)(struct vfs_handle_struct *handle, const char *path, mode_t mode, SMB_DEV_T dev); 272 char *(*realpath)(struct vfs_handle_struct *handle, const char *path); 273 NTSTATUS (*notify_watch)(struct vfs_handle_struct *handle, 274 struct sys_notify_context *ctx, 275 struct notify_entry *e, 276 void (*callback)(struct sys_notify_context *ctx, 277 void *private_data, 278 struct notify_event *ev), 279 void *private_data, void *handle_p); 280 int (*chflags)(struct vfs_handle_struct *handle, const char *path, unsigned int flags); 281 struct file_id (*file_id_create)(struct vfs_handle_struct *handle, 282 const SMB_STRUCT_STAT *sbuf); 283 284 NTSTATUS (*streaminfo)(struct vfs_handle_struct *handle, 584 ssize_t (*read_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n); 585 ssize_t (*pread_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n, off_t offset); 586 struct tevent_req *(*pread_send_fn)(struct vfs_handle_struct *handle, 587 TALLOC_CTX *mem_ctx, 588 struct tevent_context *ev, 589 struct files_struct *fsp, 590 void *data, 591 size_t n, off_t offset); 592 ssize_t (*pread_recv_fn)(struct tevent_req *req, int *err); 593 ssize_t (*write_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, const void *data, size_t n); 594 ssize_t (*pwrite_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, const void *data, size_t n, off_t offset); 595 struct tevent_req *(*pwrite_send_fn)(struct vfs_handle_struct *handle, 596 TALLOC_CTX *mem_ctx, 597 struct tevent_context *ev, 598 struct files_struct *fsp, 599 const void *data, 600 size_t n, off_t offset); 601 ssize_t (*pwrite_recv_fn)(struct tevent_req *req, int *err); 602 off_t (*lseek_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, off_t offset, int whence); 603 ssize_t (*sendfile_fn)(struct vfs_handle_struct *handle, int tofd, files_struct *fromfsp, const DATA_BLOB *header, off_t offset, size_t count); 604 ssize_t (*recvfile_fn)(struct vfs_handle_struct *handle, int fromfd, files_struct *tofsp, off_t offset, size_t count); 605 int (*rename_fn)(struct vfs_handle_struct *handle, 606 const struct smb_filename *smb_fname_src, 607 const struct smb_filename *smb_fname_dst); 608 int (*fsync_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp); 609 struct tevent_req *(*fsync_send_fn)(struct vfs_handle_struct *handle, 610 TALLOC_CTX *mem_ctx, 611 struct tevent_context *ev, 612 struct files_struct *fsp); 613 int (*fsync_recv_fn)(struct tevent_req *req, int *err); 614 int (*stat_fn)(struct vfs_handle_struct *handle, struct smb_filename *smb_fname); 615 int (*fstat_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_STAT *sbuf); 616 int (*lstat_fn)(struct vfs_handle_struct *handle, struct smb_filename *smb_filename); 617 uint64_t (*get_alloc_size_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_STAT *sbuf); 618 int (*unlink_fn)(struct vfs_handle_struct *handle, 619 const struct smb_filename *smb_fname); 620 int (*chmod_fn)(struct vfs_handle_struct *handle, const char *path, mode_t mode); 621 int (*fchmod_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, mode_t mode); 622 int (*chown_fn)(struct vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid); 623 int (*fchown_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, uid_t uid, gid_t gid); 624 int (*lchown_fn)(struct vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid); 625 int (*chdir_fn)(struct vfs_handle_struct *handle, const char *path); 626 char *(*getwd_fn)(struct vfs_handle_struct *handle); 627 int (*ntimes_fn)(struct vfs_handle_struct *handle, 628 const struct smb_filename *smb_fname, 629 struct smb_file_time *ft); 630 int (*ftruncate_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, off_t offset); 631 int (*fallocate_fn)(struct vfs_handle_struct *handle, 632 struct files_struct *fsp, 633 uint32_t mode, 634 off_t offset, 635 off_t len); 636 bool (*lock_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, off_t offset, off_t count, int type); 637 int (*kernel_flock_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, 638 uint32_t share_mode, uint32_t access_mask); 639 int (*linux_setlease_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, int leasetype); 640 bool (*getlock_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, off_t *poffset, off_t *pcount, int *ptype, pid_t *ppid); 641 int (*symlink_fn)(struct vfs_handle_struct *handle, const char *oldpath, const char *newpath); 642 int (*readlink_fn)(struct vfs_handle_struct *handle, const char *path, char *buf, size_t bufsiz); 643 int (*link_fn)(struct vfs_handle_struct *handle, const char *oldpath, const char *newpath); 644 int (*mknod_fn)(struct vfs_handle_struct *handle, const char *path, mode_t mode, SMB_DEV_T dev); 645 char *(*realpath_fn)(struct vfs_handle_struct *handle, const char *path); 646 int (*chflags_fn)(struct vfs_handle_struct *handle, const char *path, unsigned int flags); 647 struct file_id (*file_id_create_fn)(struct vfs_handle_struct *handle, 648 const SMB_STRUCT_STAT *sbuf); 649 struct tevent_req *(*copy_chunk_send_fn)(struct vfs_handle_struct *handle, 650 TALLOC_CTX *mem_ctx, 651 struct tevent_context *ev, 652 struct files_struct *src_fsp, 653 off_t src_off, 654 struct files_struct *dest_fsp, 655 off_t dest_off, 656 off_t num); 657 NTSTATUS (*copy_chunk_recv_fn)(struct vfs_handle_struct *handle, 658 struct tevent_req *req, 659 off_t *copied); 660 NTSTATUS (*get_compression_fn)(struct vfs_handle_struct *handle, 661 TALLOC_CTX *mem_ctx, 662 struct files_struct *fsp, 663 struct smb_filename *smb_fname, 664 uint16_t *_compression_fmt); 665 NTSTATUS (*set_compression_fn)(struct vfs_handle_struct *handle, 666 TALLOC_CTX *mem_ctx, 667 struct files_struct *fsp, 668 uint16_t compression_fmt); 669 NTSTATUS (*snap_check_path_fn)(struct vfs_handle_struct *handle, 670 TALLOC_CTX *mem_ctx, 671 const char *service_path, 672 char **base_volume); 673 NTSTATUS (*snap_create_fn)(struct vfs_handle_struct *handle, 674 TALLOC_CTX *mem_ctx, 675 const char *base_volume, 676 time_t *tstamp, 677 bool rw, 678 char **base_path, 679 char **snap_path); 680 NTSTATUS (*snap_delete_fn)(struct vfs_handle_struct *handle, 681 TALLOC_CTX *mem_ctx, 682 char *base_path, 683 char *snap_path); 684 685 NTSTATUS (*streaminfo_fn)(struct vfs_handle_struct *handle, 686 struct files_struct *fsp, 687 const char *fname, 688 TALLOC_CTX *mem_ctx, 689 unsigned int *num_streams, 690 struct stream_struct **streams); 691 692 int (*get_real_filename_fn)(struct vfs_handle_struct *handle, 693 const char *path, 694 const char *name, 695 TALLOC_CTX *mem_ctx, 696 char **found_name); 697 698 const char *(*connectpath_fn)(struct vfs_handle_struct *handle, 699 const char *filename); 700 701 NTSTATUS (*brl_lock_windows_fn)(struct vfs_handle_struct *handle, 702 struct byte_range_lock *br_lck, 703 struct lock_struct *plock, 704 bool blocking_lock); 705 706 bool (*brl_unlock_windows_fn)(struct vfs_handle_struct *handle, 707 struct messaging_context *msg_ctx, 708 struct byte_range_lock *br_lck, 709 const struct lock_struct *plock); 710 711 bool (*brl_cancel_windows_fn)(struct vfs_handle_struct *handle, 712 struct byte_range_lock *br_lck, 713 struct lock_struct *plock); 714 715 bool (*strict_lock_fn)(struct vfs_handle_struct *handle, 285 716 struct files_struct *fsp, 286 const char *fname, 287 TALLOC_CTX *mem_ctx, 288 unsigned int *num_streams, 289 struct stream_struct **streams); 290 291 int (*get_real_filename)(struct vfs_handle_struct *handle, 292 const char *path, 293 const char *name, 294 TALLOC_CTX *mem_ctx, 295 char **found_name); 296 297 const char *(*connectpath)(struct vfs_handle_struct *handle, 298 const char *filename); 299 300 NTSTATUS (*brl_lock_windows)(struct vfs_handle_struct *handle, 301 struct byte_range_lock *br_lck, 302 struct lock_struct *plock, 303 bool blocking_lock, 304 struct blocking_lock_record *blr); 305 306 bool (*brl_unlock_windows)(struct vfs_handle_struct *handle, 307 struct messaging_context *msg_ctx, 308 struct byte_range_lock *br_lck, 309 const struct lock_struct *plock); 310 311 bool (*brl_cancel_windows)(struct vfs_handle_struct *handle, 312 struct byte_range_lock *br_lck, 313 struct lock_struct *plock, 314 struct blocking_lock_record *blr); 315 316 bool (*strict_lock)(struct vfs_handle_struct *handle, 317 struct files_struct *fsp, 318 struct lock_struct *plock); 319 320 void (*strict_unlock)(struct vfs_handle_struct *handle, 321 struct files_struct *fsp, 322 struct lock_struct *plock); 323 324 NTSTATUS (*translate_name)(struct vfs_handle_struct *handle, 325 const char *name, 326 enum vfs_translate_direction direction, 717 struct lock_struct *plock); 718 719 void (*strict_unlock_fn)(struct vfs_handle_struct *handle, 720 struct files_struct *fsp, 721 struct lock_struct *plock); 722 723 NTSTATUS (*translate_name_fn)(struct vfs_handle_struct *handle, 724 const char *name, 725 enum vfs_translate_direction direction, 726 TALLOC_CTX *mem_ctx, 727 char **mapped_name); 728 729 NTSTATUS (*fsctl_fn)(struct vfs_handle_struct *handle, 730 struct files_struct *fsp, 731 TALLOC_CTX *ctx, 732 uint32_t function, 733 uint16_t req_flags, 734 const uint8_t *_in_data, 735 uint32_t in_len, 736 uint8_t **_out_data, 737 uint32_t max_out_len, 738 uint32_t *out_len); 739 740 /* NT ACL operations. */ 741 742 NTSTATUS (*fget_nt_acl_fn)(struct vfs_handle_struct *handle, 743 struct files_struct *fsp, 744 uint32_t security_info, 327 745 TALLOC_CTX *mem_ctx, 328 char **mapped_name);329 330 /* NT ACL operations. */331 332 NTSTATUS (*fget_nt_acl)(struct vfs_handle_struct *handle,333 struct files_struct *fsp,334 uint32 security_info,335 struct security_descriptor **ppdesc);336 NTSTATUS (*get_nt_acl)(struct vfs_handle_struct *handle,337 const char *name,338 uint32 security_info, 339 struct security_descriptor **ppdesc);340 NTSTATUS (*fset_nt_acl)(struct vfs_handle_struct *handle,341 struct files_struct *fsp,342 uint32 security_info_sent,343 const struct security_descriptor *psd);746 struct security_descriptor **ppdesc); 747 NTSTATUS (*get_nt_acl_fn)(struct vfs_handle_struct *handle, 748 const char *name, 749 uint32_t security_info, 750 TALLOC_CTX *mem_ctx, 751 struct security_descriptor **ppdesc); 752 NTSTATUS (*fset_nt_acl_fn)(struct vfs_handle_struct *handle, 753 struct files_struct *fsp, 754 uint32_t security_info_sent, 755 const struct security_descriptor *psd); 756 757 NTSTATUS (*audit_file_fn)(struct vfs_handle_struct *handle, 758 struct smb_filename *file, 759 struct security_acl *sacl, 760 uint32_t access_requested, 761 uint32_t access_denied); 344 762 345 763 /* POSIX ACL operations. */ 346 764 347 int (*chmod_acl)(struct vfs_handle_struct *handle, const char *name, mode_t mode); 348 int (*fchmod_acl)(struct vfs_handle_struct *handle, struct files_struct *fsp, mode_t mode); 349 350 int (*sys_acl_get_entry)(struct vfs_handle_struct *handle, SMB_ACL_T theacl, int entry_id, SMB_ACL_ENTRY_T *entry_p); 351 int (*sys_acl_get_tag_type)(struct vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *tag_type_p); 352 int (*sys_acl_get_permset)(struct vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p); 353 void * (*sys_acl_get_qualifier)(struct vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d); 354 SMB_ACL_T (*sys_acl_get_file)(struct vfs_handle_struct *handle, const char *path_p, SMB_ACL_TYPE_T type); 355 SMB_ACL_T (*sys_acl_get_fd)(struct vfs_handle_struct *handle, struct files_struct *fsp); 356 int (*sys_acl_clear_perms)(struct vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset); 357 int (*sys_acl_add_perm)(struct vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm); 358 char * (*sys_acl_to_text)(struct vfs_handle_struct *handle, SMB_ACL_T theacl, ssize_t *plen); 359 SMB_ACL_T (*sys_acl_init)(struct vfs_handle_struct *handle, int count); 360 int (*sys_acl_create_entry)(struct vfs_handle_struct *handle, SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry); 361 int (*sys_acl_set_tag_type)(struct vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype); 362 int (*sys_acl_set_qualifier)(struct vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, void *qual); 363 int (*sys_acl_set_permset)(struct vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset); 364 int (*sys_acl_valid)(struct vfs_handle_struct *handle, SMB_ACL_T theacl ); 365 int (*sys_acl_set_file)(struct vfs_handle_struct *handle, const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl); 366 int (*sys_acl_set_fd)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_ACL_T theacl); 367 int (*sys_acl_delete_def_file)(struct vfs_handle_struct *handle, const char *path); 368 int (*sys_acl_get_perm)(struct vfs_handle_struct *handle, SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm); 369 int (*sys_acl_free_text)(struct vfs_handle_struct *handle, char *text); 370 int (*sys_acl_free_acl)(struct vfs_handle_struct *handle, SMB_ACL_T posix_acl); 371 int (*sys_acl_free_qualifier)(struct vfs_handle_struct *handle, void *qualifier, SMB_ACL_TAG_T tagtype); 765 int (*chmod_acl_fn)(struct vfs_handle_struct *handle, const char *name, mode_t mode); 766 int (*fchmod_acl_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, mode_t mode); 767 768 SMB_ACL_T (*sys_acl_get_file_fn)(struct vfs_handle_struct *handle, 769 const char *path_p, 770 SMB_ACL_TYPE_T type, 771 TALLOC_CTX *mem_ctx); 772 SMB_ACL_T (*sys_acl_get_fd_fn)(struct vfs_handle_struct *handle, 773 struct files_struct *fsp, 774 TALLOC_CTX *mem_ctx); 775 int (*sys_acl_blob_get_file_fn)(struct vfs_handle_struct *handle, 776 const char *path_p, 777 TALLOC_CTX *mem_ctx, 778 char **blob_description, 779 DATA_BLOB *blob); 780 int (*sys_acl_blob_get_fd_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, 781 TALLOC_CTX *mem_ctx, char **blob_description, 782 DATA_BLOB *blob); 783 int (*sys_acl_set_file_fn)(struct vfs_handle_struct *handle, const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl); 784 int (*sys_acl_set_fd_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_ACL_T theacl); 785 int (*sys_acl_delete_def_file_fn)(struct vfs_handle_struct *handle, const char *path); 372 786 373 787 /* EA operations. */ 374 ssize_t (*getxattr)(struct vfs_handle_struct *handle,const char *path, const char *name, void *value, size_t size); 375 ssize_t (*lgetxattr)(struct vfs_handle_struct *handle,const char *path, const char *name, void *value, size_t size); 376 ssize_t (*fgetxattr)(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, void *value, size_t size); 377 ssize_t (*listxattr)(struct vfs_handle_struct *handle, const char *path, char *list, size_t size); 378 ssize_t (*llistxattr)(struct vfs_handle_struct *handle, const char *path, char *list, size_t size); 379 ssize_t (*flistxattr)(struct vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size); 380 int (*removexattr)(struct vfs_handle_struct *handle, const char *path, const char *name); 381 int (*lremovexattr)(struct vfs_handle_struct *handle, const char *path, const char *name); 382 int (*fremovexattr)(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name); 383 int (*setxattr)(struct vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags); 384 int (*lsetxattr)(struct vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags); 385 int (*fsetxattr)(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, const void *value, size_t size, int flags); 788 ssize_t (*getxattr_fn)(struct vfs_handle_struct *handle,const char *path, const char *name, void *value, size_t size); 789 ssize_t (*fgetxattr_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, void *value, size_t size); 790 ssize_t (*listxattr_fn)(struct vfs_handle_struct *handle, const char *path, char *list, size_t size); 791 ssize_t (*flistxattr_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size); 792 int (*removexattr_fn)(struct vfs_handle_struct *handle, const char *path, const char *name); 793 int (*fremovexattr_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name); 794 int (*setxattr_fn)(struct vfs_handle_struct *handle, const char *path, const char *name, const void *value, size_t size, int flags); 795 int (*fsetxattr_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, const void *value, size_t size, int flags); 386 796 387 797 /* aio operations */ 388 int (*aio_read)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); 389 int (*aio_write)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); 390 ssize_t (*aio_return_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); 391 int (*aio_cancel)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); 392 int (*aio_error_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); 393 int (*aio_fsync)(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_STRUCT_AIOCB *aiocb); 394 int (*aio_suspend)(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_AIOCB * const aiocb[], int n, const struct timespec *timeout); 395 bool (*aio_force)(struct vfs_handle_struct *handle, struct files_struct *fsp); 798 bool (*aio_force_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp); 396 799 397 800 /* offline operations */ 398 bool (*is_offline )(struct vfs_handle_struct *handle,801 bool (*is_offline_fn)(struct vfs_handle_struct *handle, 399 802 const struct smb_filename *fname, 400 803 SMB_STRUCT_STAT *sbuf); 401 int (*set_offline )(struct vfs_handle_struct *handle,804 int (*set_offline_fn)(struct vfs_handle_struct *handle, 402 805 const struct smb_filename *fname); 806 807 /* durable handle operations */ 808 NTSTATUS (*durable_cookie_fn)(struct vfs_handle_struct *handle, 809 struct files_struct *fsp, 810 TALLOC_CTX *mem_ctx, 811 DATA_BLOB *cookie); 812 NTSTATUS (*durable_disconnect_fn)(struct vfs_handle_struct *handle, 813 struct files_struct *fsp, 814 const DATA_BLOB old_cookie, 815 TALLOC_CTX *mem_ctx, 816 DATA_BLOB *new_cookie); 817 NTSTATUS (*durable_reconnect_fn)(struct vfs_handle_struct *handle, 818 struct smb_request *smb1req, 819 struct smbXsrv_open *op, 820 const DATA_BLOB old_cookie, 821 TALLOC_CTX *mem_ctx, 822 struct files_struct **fsp, 823 DATA_BLOB *new_cookie); 824 825 NTSTATUS (*readdir_attr_fn)(struct vfs_handle_struct *handle, 826 const struct smb_filename *fname, 827 TALLOC_CTX *mem_ctx, 828 struct readdir_attr_data **attr_data); 403 829 }; 404 830 … … 422 848 typedef struct vfs_statvfs_struct { 423 849 /* For undefined recommended transfer size return -1 in that field */ 424 uint32 OptimalTransferSize; /* bsize on some os, iosize on other os */425 uint32 BlockSize;850 uint32_t OptimalTransferSize; /* bsize on some os, iosize on other os */ 851 uint32_t BlockSize; 426 852 427 853 /* … … 506 932 void smb_vfs_call_disconnect(struct vfs_handle_struct *handle); 507 933 uint64_t smb_vfs_call_disk_free(struct vfs_handle_struct *handle, 508 const char *path, bool small_query, 509 uint64_t *bsize, uint64_t *dfree, 510 uint64_t *dsize); 511 int smb_vfs_call_get_quota(struct vfs_handle_struct *handle, 934 const char *path, uint64_t *bsize, 935 uint64_t *dfree, uint64_t *dsize); 936 int smb_vfs_call_get_quota(struct vfs_handle_struct *handle, const char *path, 512 937 enum SMB_QUOTA_TYPE qtype, unid_t id, 513 938 SMB_DISK_QUOTA *qt); … … 522 947 struct vfs_statvfs_struct *statbuf); 523 948 uint32_t smb_vfs_call_fs_capabilities(struct vfs_handle_struct *handle, 524 enum timestamp_set_resolution *p_ts_res); 525 SMB_STRUCT_DIR *smb_vfs_call_opendir(struct vfs_handle_struct *handle, 949 enum timestamp_set_resolution *p_ts_res); 950 /* 951 * Note: that "struct dfs_GetDFSReferral *r" needs to be a valid TALLOC_CTX 952 */ 953 NTSTATUS smb_vfs_call_get_dfs_referrals(struct vfs_handle_struct *handle, 954 struct dfs_GetDFSReferral *r); 955 DIR *smb_vfs_call_opendir(struct vfs_handle_struct *handle, 526 956 const char *fname, const char *mask, 527 uint32 attributes);528 SMB_STRUCT_DIR *smb_vfs_call_fdopendir(struct vfs_handle_struct *handle,957 uint32_t attributes); 958 DIR *smb_vfs_call_fdopendir(struct vfs_handle_struct *handle, 529 959 struct files_struct *fsp, 530 960 const char *mask, 531 uint32 attributes);532 SMB_STRUCT_DIRENT*smb_vfs_call_readdir(struct vfs_handle_struct *handle,533 SMB_STRUCT_DIR *dirp,961 uint32_t attributes); 962 struct dirent *smb_vfs_call_readdir(struct vfs_handle_struct *handle, 963 DIR *dirp, 534 964 SMB_STRUCT_STAT *sbuf); 535 965 void smb_vfs_call_seekdir(struct vfs_handle_struct *handle, 536 SMB_STRUCT_DIR *dirp, long offset);966 DIR *dirp, long offset); 537 967 long smb_vfs_call_telldir(struct vfs_handle_struct *handle, 538 SMB_STRUCT_DIR *dirp);968 DIR *dirp); 539 969 void smb_vfs_call_rewind_dir(struct vfs_handle_struct *handle, 540 SMB_STRUCT_DIR *dirp);970 DIR *dirp); 541 971 int smb_vfs_call_mkdir(struct vfs_handle_struct *handle, const char *path, 542 972 mode_t mode); 543 973 int smb_vfs_call_rmdir(struct vfs_handle_struct *handle, const char *path); 544 974 int smb_vfs_call_closedir(struct vfs_handle_struct *handle, 545 SMB_STRUCT_DIR *dir);975 DIR *dir); 546 976 void smb_vfs_call_init_search_op(struct vfs_handle_struct *handle, 547 SMB_STRUCT_DIR *dirp);977 DIR *dirp); 548 978 int smb_vfs_call_open(struct vfs_handle_struct *handle, 549 979 struct smb_filename *smb_fname, struct files_struct *fsp, … … 559 989 uint32_t file_attributes, 560 990 uint32_t oplock_request, 991 struct smb2_lease *lease, 561 992 uint64_t allocation_size, 562 993 uint32_t private_flags, … … 564 995 struct ea_list *ea_list, 565 996 files_struct **result, 566 int *pinfo); 567 int smb_vfs_call_close_fn(struct vfs_handle_struct *handle, 568 struct files_struct *fsp); 569 ssize_t smb_vfs_call_vfs_read(struct vfs_handle_struct *handle, 570 struct files_struct *fsp, void *data, size_t n); 997 int *pinfo, 998 const struct smb2_create_blobs *in_context_blobs, 999 struct smb2_create_blobs *out_context_blobs); 1000 int smb_vfs_call_close(struct vfs_handle_struct *handle, 1001 struct files_struct *fsp); 1002 ssize_t smb_vfs_call_read(struct vfs_handle_struct *handle, 1003 struct files_struct *fsp, void *data, size_t n); 571 1004 ssize_t smb_vfs_call_pread(struct vfs_handle_struct *handle, 572 1005 struct files_struct *fsp, void *data, size_t n, 573 SMB_OFF_T offset); 1006 off_t offset); 1007 struct tevent_req *smb_vfs_call_pread_send(struct vfs_handle_struct *handle, 1008 TALLOC_CTX *mem_ctx, 1009 struct tevent_context *ev, 1010 struct files_struct *fsp, 1011 void *data, 1012 size_t n, off_t offset); 1013 ssize_t SMB_VFS_PREAD_RECV(struct tevent_req *req, int *perrno); 1014 574 1015 ssize_t smb_vfs_call_write(struct vfs_handle_struct *handle, 575 1016 struct files_struct *fsp, const void *data, … … 577 1018 ssize_t smb_vfs_call_pwrite(struct vfs_handle_struct *handle, 578 1019 struct files_struct *fsp, const void *data, 579 size_t n, SMB_OFF_T offset); 580 SMB_OFF_T smb_vfs_call_lseek(struct vfs_handle_struct *handle, 581 struct files_struct *fsp, SMB_OFF_T offset, 1020 size_t n, off_t offset); 1021 struct tevent_req *smb_vfs_call_pwrite_send(struct vfs_handle_struct *handle, 1022 TALLOC_CTX *mem_ctx, 1023 struct tevent_context *ev, 1024 struct files_struct *fsp, 1025 const void *data, 1026 size_t n, off_t offset); 1027 ssize_t SMB_VFS_PWRITE_RECV(struct tevent_req *req, int *perrno); 1028 1029 off_t smb_vfs_call_lseek(struct vfs_handle_struct *handle, 1030 struct files_struct *fsp, off_t offset, 582 1031 int whence); 583 1032 ssize_t smb_vfs_call_sendfile(struct vfs_handle_struct *handle, int tofd, 584 1033 files_struct *fromfsp, const DATA_BLOB *header, 585 SMB_OFF_Toffset, size_t count);1034 off_t offset, size_t count); 586 1035 ssize_t smb_vfs_call_recvfile(struct vfs_handle_struct *handle, int fromfd, 587 files_struct *tofsp, SMB_OFF_Toffset,1036 files_struct *tofsp, off_t offset, 588 1037 size_t count); 589 1038 int smb_vfs_call_rename(struct vfs_handle_struct *handle, … … 592 1041 int smb_vfs_call_fsync(struct vfs_handle_struct *handle, 593 1042 struct files_struct *fsp); 1043 1044 struct tevent_req *smb_vfs_call_fsync_send(struct vfs_handle_struct *handle, 1045 TALLOC_CTX *mem_ctx, 1046 struct tevent_context *ev, 1047 struct files_struct *fsp); 1048 int SMB_VFS_FSYNC_RECV(struct tevent_req *req, int *perrno); 1049 594 1050 int smb_vfs_call_stat(struct vfs_handle_struct *handle, 595 1051 struct smb_filename *smb_fname); … … 614 1070 uid_t uid, gid_t gid); 615 1071 int smb_vfs_call_chdir(struct vfs_handle_struct *handle, const char *path); 616 char *smb_vfs_call_getwd(struct vfs_handle_struct *handle , char *buf);1072 char *smb_vfs_call_getwd(struct vfs_handle_struct *handle); 617 1073 int smb_vfs_call_ntimes(struct vfs_handle_struct *handle, 618 1074 const struct smb_filename *smb_fname, 619 1075 struct smb_file_time *ft); 620 1076 int smb_vfs_call_ftruncate(struct vfs_handle_struct *handle, 621 struct files_struct *fsp, SMB_OFF_Toffset);1077 struct files_struct *fsp, off_t offset); 622 1078 int smb_vfs_call_fallocate(struct vfs_handle_struct *handle, 623 struct files_struct *fsp,624 enum vfs_fallocate_modemode,625 SMB_OFF_Toffset,626 SMB_OFF_Tlen);1079 struct files_struct *fsp, 1080 uint32_t mode, 1081 off_t offset, 1082 off_t len); 627 1083 bool smb_vfs_call_lock(struct vfs_handle_struct *handle, 628 struct files_struct *fsp, int op, SMB_OFF_Toffset,629 SMB_OFF_Tcount, int type);1084 struct files_struct *fsp, int op, off_t offset, 1085 off_t count, int type); 630 1086 int smb_vfs_call_kernel_flock(struct vfs_handle_struct *handle, 631 struct files_struct *fsp, uint32 share_mode,1087 struct files_struct *fsp, uint32_t share_mode, 632 1088 uint32_t access_mask); 633 1089 int smb_vfs_call_linux_setlease(struct vfs_handle_struct *handle, 634 1090 struct files_struct *fsp, int leasetype); 635 1091 bool smb_vfs_call_getlock(struct vfs_handle_struct *handle, 636 struct files_struct *fsp, SMB_OFF_T*poffset,637 SMB_OFF_T*pcount, int *ptype, pid_t *ppid);1092 struct files_struct *fsp, off_t *poffset, 1093 off_t *pcount, int *ptype, pid_t *ppid); 638 1094 int smb_vfs_call_symlink(struct vfs_handle_struct *handle, const char *oldpath, 639 1095 const char *newpath); 640 int smb_vfs_call_ vfs_readlink(struct vfs_handle_struct *handle,641 1096 int smb_vfs_call_readlink(struct vfs_handle_struct *handle, 1097 const char *path, char *buf, size_t bufsiz); 642 1098 int smb_vfs_call_link(struct vfs_handle_struct *handle, const char *oldpath, 643 1099 const char *newpath); … … 645 1101 mode_t mode, SMB_DEV_T dev); 646 1102 char *smb_vfs_call_realpath(struct vfs_handle_struct *handle, const char *path); 647 NTSTATUS smb_vfs_call_notify_watch(struct vfs_handle_struct *handle,648 struct sys_notify_context *ctx,649 struct notify_entry *e,650 void (*callback)(struct sys_notify_context *ctx,651 void *private_data,652 struct notify_event *ev),653 void *private_data, void *handle_p);654 1103 int smb_vfs_call_chflags(struct vfs_handle_struct *handle, const char *path, 655 1104 unsigned int flags); … … 670 1119 struct byte_range_lock *br_lck, 671 1120 struct lock_struct *plock, 672 bool blocking_lock, 673 struct blocking_lock_record *blr); 1121 bool blocking_lock); 674 1122 bool smb_vfs_call_brl_unlock_windows(struct vfs_handle_struct *handle, 675 1123 struct messaging_context *msg_ctx, … … 678 1126 bool smb_vfs_call_brl_cancel_windows(struct vfs_handle_struct *handle, 679 1127 struct byte_range_lock *br_lck, 680 struct lock_struct *plock, 681 struct blocking_lock_record *blr); 1128 struct lock_struct *plock); 682 1129 bool smb_vfs_call_strict_lock(struct vfs_handle_struct *handle, 683 1130 struct files_struct *fsp, … … 691 1138 TALLOC_CTX *mem_ctx, 692 1139 char **mapped_name); 1140 NTSTATUS smb_vfs_call_fsctl(struct vfs_handle_struct *handle, 1141 struct files_struct *fsp, 1142 TALLOC_CTX *ctx, 1143 uint32_t function, 1144 uint16_t req_flags, 1145 const uint8_t *_in_data, 1146 uint32_t in_len, 1147 uint8_t **_out_data, 1148 uint32_t max_out_len, 1149 uint32_t *out_len); 1150 struct tevent_req *smb_vfs_call_copy_chunk_send(struct vfs_handle_struct *handle, 1151 TALLOC_CTX *mem_ctx, 1152 struct tevent_context *ev, 1153 struct files_struct *src_fsp, 1154 off_t src_off, 1155 struct files_struct *dest_fsp, 1156 off_t dest_off, 1157 off_t num); 1158 NTSTATUS smb_vfs_call_copy_chunk_recv(struct vfs_handle_struct *handle, 1159 struct tevent_req *req, 1160 off_t *copied); 1161 NTSTATUS smb_vfs_call_get_compression(struct vfs_handle_struct *handle, 1162 TALLOC_CTX *mem_ctx, 1163 struct files_struct *fsp, 1164 struct smb_filename *smb_fname, 1165 uint16_t *_compression_fmt); 1166 NTSTATUS smb_vfs_call_set_compression(struct vfs_handle_struct *handle, 1167 TALLOC_CTX *mem_ctx, 1168 struct files_struct *fsp, 1169 uint16_t compression_fmt); 1170 NTSTATUS smb_vfs_call_snap_check_path(vfs_handle_struct *handle, 1171 TALLOC_CTX *mem_ctx, 1172 const char *service_path, 1173 char **base_volume); 1174 NTSTATUS smb_vfs_call_snap_create(struct vfs_handle_struct *handle, 1175 TALLOC_CTX *mem_ctx, 1176 const char *base_volume, 1177 time_t *tstamp, 1178 bool rw, 1179 char **base_path, 1180 char **snap_path); 1181 NTSTATUS smb_vfs_call_snap_delete(struct vfs_handle_struct *handle, 1182 TALLOC_CTX *mem_ctx, 1183 char *base_path, 1184 char *snap_path); 693 1185 NTSTATUS smb_vfs_call_fget_nt_acl(struct vfs_handle_struct *handle, 694 1186 struct files_struct *fsp, 695 uint32 security_info, 1187 uint32_t security_info, 1188 TALLOC_CTX *mem_ctx, 696 1189 struct security_descriptor **ppdesc); 697 1190 NTSTATUS smb_vfs_call_get_nt_acl(struct vfs_handle_struct *handle, 698 1191 const char *name, 699 uint32 security_info, 1192 uint32_t security_info, 1193 TALLOC_CTX *mem_ctx, 700 1194 struct security_descriptor **ppdesc); 701 1195 NTSTATUS smb_vfs_call_fset_nt_acl(struct vfs_handle_struct *handle, 702 1196 struct files_struct *fsp, 703 uint32 security_info_sent,1197 uint32_t security_info_sent, 704 1198 const struct security_descriptor *psd); 1199 NTSTATUS smb_vfs_call_audit_file(struct vfs_handle_struct *handle, 1200 struct smb_filename *file, 1201 struct security_acl *sacl, 1202 uint32_t access_requested, 1203 uint32_t access_denied); 705 1204 int smb_vfs_call_chmod_acl(struct vfs_handle_struct *handle, const char *name, 706 1205 mode_t mode); 707 1206 int smb_vfs_call_fchmod_acl(struct vfs_handle_struct *handle, 708 1207 struct files_struct *fsp, mode_t mode); 709 int smb_vfs_call_sys_acl_get_entry(struct vfs_handle_struct *handle,710 SMB_ACL_T theacl, int entry_id,711 SMB_ACL_ENTRY_T *entry_p);712 int smb_vfs_call_sys_acl_get_tag_type(struct vfs_handle_struct *handle,713 SMB_ACL_ENTRY_T entry_d,714 SMB_ACL_TAG_T *tag_type_p);715 int smb_vfs_call_sys_acl_get_permset(struct vfs_handle_struct *handle,716 SMB_ACL_ENTRY_T entry_d,717 SMB_ACL_PERMSET_T *permset_p);718 void * smb_vfs_call_sys_acl_get_qualifier(struct vfs_handle_struct *handle,719 SMB_ACL_ENTRY_T entry_d);720 1208 SMB_ACL_T smb_vfs_call_sys_acl_get_file(struct vfs_handle_struct *handle, 721 1209 const char *path_p, 722 SMB_ACL_TYPE_T type); 1210 SMB_ACL_TYPE_T type, 1211 TALLOC_CTX *mem_ctx); 723 1212 SMB_ACL_T smb_vfs_call_sys_acl_get_fd(struct vfs_handle_struct *handle, 724 struct files_struct *fsp); 725 int smb_vfs_call_sys_acl_clear_perms(struct vfs_handle_struct *handle, 726 SMB_ACL_PERMSET_T permset); 727 int smb_vfs_call_sys_acl_add_perm(struct vfs_handle_struct *handle, 728 SMB_ACL_PERMSET_T permset, 729 SMB_ACL_PERM_T perm); 730 char * smb_vfs_call_sys_acl_to_text(struct vfs_handle_struct *handle, 731 SMB_ACL_T theacl, ssize_t *plen); 732 SMB_ACL_T smb_vfs_call_sys_acl_init(struct vfs_handle_struct *handle, 733 int count); 734 int smb_vfs_call_sys_acl_create_entry(struct vfs_handle_struct *handle, 735 SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry); 736 int smb_vfs_call_sys_acl_set_tag_type(struct vfs_handle_struct *handle, 737 SMB_ACL_ENTRY_T entry, 738 SMB_ACL_TAG_T tagtype); 739 int smb_vfs_call_sys_acl_set_qualifier(struct vfs_handle_struct *handle, 740 SMB_ACL_ENTRY_T entry, void *qual); 741 int smb_vfs_call_sys_acl_set_permset(struct vfs_handle_struct *handle, 742 SMB_ACL_ENTRY_T entry, 743 SMB_ACL_PERMSET_T permset); 744 int smb_vfs_call_sys_acl_valid(struct vfs_handle_struct *handle, 745 SMB_ACL_T theacl); 1213 struct files_struct *fsp, 1214 TALLOC_CTX *mem_ctx); 1215 int smb_vfs_call_sys_acl_blob_get_file(struct vfs_handle_struct *handle, 1216 const char *path_p, 1217 TALLOC_CTX *mem_ctx, 1218 char **blob_description, 1219 DATA_BLOB *blob); 1220 int smb_vfs_call_sys_acl_blob_get_fd(struct vfs_handle_struct *handle, 1221 struct files_struct *fsp, 1222 TALLOC_CTX *mem_ctx, 1223 char **blob_description, 1224 DATA_BLOB *blob); 746 1225 int smb_vfs_call_sys_acl_set_file(struct vfs_handle_struct *handle, 747 1226 const char *name, SMB_ACL_TYPE_T acltype, … … 751 1230 int smb_vfs_call_sys_acl_delete_def_file(struct vfs_handle_struct *handle, 752 1231 const char *path); 753 int smb_vfs_call_sys_acl_get_perm(struct vfs_handle_struct *handle,754 SMB_ACL_PERMSET_T permset,755 SMB_ACL_PERM_T perm);756 int smb_vfs_call_sys_acl_free_text(struct vfs_handle_struct *handle,757 char *text);758 int smb_vfs_call_sys_acl_free_acl(struct vfs_handle_struct *handle,759 SMB_ACL_T posix_acl);760 int smb_vfs_call_sys_acl_free_qualifier(struct vfs_handle_struct *handle,761 void *qualifier, SMB_ACL_TAG_T tagtype);762 1232 ssize_t smb_vfs_call_getxattr(struct vfs_handle_struct *handle, 763 1233 const char *path, const char *name, void *value, 764 1234 size_t size); 765 ssize_t smb_vfs_call_lgetxattr(struct vfs_handle_struct *handle,766 const char *path, const char *name, void *value,767 size_t size);768 1235 ssize_t smb_vfs_call_fgetxattr(struct vfs_handle_struct *handle, 769 1236 struct files_struct *fsp, const char *name, … … 778 1245 int smb_vfs_call_removexattr(struct vfs_handle_struct *handle, 779 1246 const char *path, const char *name); 780 int smb_vfs_call_lremovexattr(struct vfs_handle_struct *handle,781 const char *path, const char *name);782 1247 int smb_vfs_call_fremovexattr(struct vfs_handle_struct *handle, 783 1248 struct files_struct *fsp, const char *name); … … 791 1256 struct files_struct *fsp, const char *name, 792 1257 const void *value, size_t size, int flags); 793 int smb_vfs_call_aio_read(struct vfs_handle_struct *handle,794 struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb);795 int smb_vfs_call_aio_write(struct vfs_handle_struct *handle,796 struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb);797 ssize_t smb_vfs_call_aio_return_fn(struct vfs_handle_struct *handle,798 struct files_struct *fsp,799 SMB_STRUCT_AIOCB *aiocb);800 int smb_vfs_call_aio_cancel(struct vfs_handle_struct *handle,801 struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb);802 int smb_vfs_call_aio_error_fn(struct vfs_handle_struct *handle,803 struct files_struct *fsp,804 SMB_STRUCT_AIOCB *aiocb);805 int smb_vfs_call_aio_fsync(struct vfs_handle_struct *handle,806 struct files_struct *fsp, int op,807 SMB_STRUCT_AIOCB *aiocb);808 int smb_vfs_call_aio_suspend(struct vfs_handle_struct *handle,809 struct files_struct *fsp,810 const SMB_STRUCT_AIOCB * const aiocb[], int n,811 const struct timespec *timeout);812 1258 bool smb_vfs_call_aio_force(struct vfs_handle_struct *handle, 813 1259 struct files_struct *fsp); … … 817 1263 int smb_vfs_call_set_offline(struct vfs_handle_struct *handle, 818 1264 const struct smb_filename *fname); 1265 NTSTATUS smb_vfs_call_durable_cookie(struct vfs_handle_struct *handle, 1266 struct files_struct *fsp, 1267 TALLOC_CTX *mem_ctx, 1268 DATA_BLOB *cookie); 1269 NTSTATUS smb_vfs_call_durable_disconnect(struct vfs_handle_struct *handle, 1270 struct files_struct *fsp, 1271 const DATA_BLOB old_cookie, 1272 TALLOC_CTX *mem_ctx, 1273 DATA_BLOB *new_cookie); 1274 NTSTATUS smb_vfs_call_durable_reconnect(struct vfs_handle_struct *handle, 1275 struct smb_request *smb1req, 1276 struct smbXsrv_open *op, 1277 const DATA_BLOB old_cookie, 1278 TALLOC_CTX *mem_ctx, 1279 struct files_struct **fsp, 1280 DATA_BLOB *new_cookie); 1281 NTSTATUS smb_vfs_call_readdir_attr(struct vfs_handle_struct *handle, 1282 const struct smb_filename *fname, 1283 TALLOC_CTX *mem_ctx, 1284 struct readdir_attr_data **attr_data); 1285 1286 NTSTATUS smb_register_vfs(int version, const char *name, 1287 const struct vfs_fn_pointers *fns); 1288 void *vfs_add_fsp_extension_notype(vfs_handle_struct *handle, 1289 files_struct *fsp, size_t ext_size, 1290 void (*destroy_fn)(void *p_data)); 1291 void vfs_remove_fsp_extension(vfs_handle_struct *handle, files_struct *fsp); 1292 void vfs_remove_all_fsp_extensions(struct files_struct *fsp); 1293 void *vfs_memctx_fsp_extension(vfs_handle_struct *handle, files_struct *fsp); 1294 void *vfs_fetch_fsp_extension(vfs_handle_struct *handle, files_struct *fsp); 819 1295 820 1296 #endif /* _VFS_H */ -
vendor/current/source3/include/vfs_macros.h
r740 r988 22 22 #define _VFS_MACROS_H 23 23 24 /******************************************************************* 25 Don't access conn->vfs.ops.* directly!!! 26 Use this macros! 27 (Fixes should go also into the vfs_opaque_* and vfs_next_* macros!) 28 ********************************************************************/ 24 /* 25 * These macros SMB_VFS_<FOO> (and SMB_VFS_NEXT_<FOO>) are our 26 * interface for the VFS. 27 * 28 * Don't access conn->vfs_handles[->next]->fns->* directly! 29 */ 29 30 30 31 /* Disk operations */ … … 39 40 smb_vfs_call_disconnect((handle)->next) 40 41 41 #define SMB_VFS_DISK_FREE(conn, path, small_query,bsize, dfree ,dsize) \42 smb_vfs_call_disk_free((conn)->vfs_handles, (path), ( small_query), (bsize), (dfree), (dsize))43 #define SMB_VFS_NEXT_DISK_FREE(handle, path, small_query,bsize, dfree ,dsize)\44 smb_vfs_call_disk_free((handle)->next, (path), ( small_query), (bsize), (dfree), (dsize))45 46 #define SMB_VFS_GET_QUOTA(conn, qtype, id, qt)\47 smb_vfs_call_get_quota((conn)->vfs_handles, ( qtype), (id), (qt))48 #define SMB_VFS_NEXT_GET_QUOTA(handle, qtype, id, qt)\49 smb_vfs_call_get_quota((handle)->next, ( qtype), (id), (qt))42 #define SMB_VFS_DISK_FREE(conn, path, bsize, dfree ,dsize) \ 43 smb_vfs_call_disk_free((conn)->vfs_handles, (path), (bsize), (dfree), (dsize)) 44 #define SMB_VFS_NEXT_DISK_FREE(handle, path, bsize, dfree ,dsize)\ 45 smb_vfs_call_disk_free((handle)->next, (path), (bsize), (dfree), (dsize)) 46 47 #define SMB_VFS_GET_QUOTA(conn, path, qtype, id, qt) \ 48 smb_vfs_call_get_quota((conn)->vfs_handles, (path), (qtype), (id), (qt)) 49 #define SMB_VFS_NEXT_GET_QUOTA(handle, path, qtype, id, qt) \ 50 smb_vfs_call_get_quota((handle)->next, (path), (qtype), (id), (qt)) 50 51 51 52 #define SMB_VFS_SET_QUOTA(conn, qtype, id, qt) \ … … 68 69 #define SMB_VFS_NEXT_FS_CAPABILITIES(handle, p_ts_res) \ 69 70 smb_vfs_call_fs_capabilities((handle)->next, (p_ts_res)) 71 72 /* 73 * Note: that "struct dfs_GetDFSReferral *r" 74 * needs to be a valid TALLOC_CTX 75 */ 76 #define SMB_VFS_GET_DFS_REFERRALS(conn, r) \ 77 smb_vfs_call_get_dfs_referrals((conn)->vfs_handles, (r)) 78 #define SMB_VFS_NEXT_GET_DFS_REFERRALS(handle, r) \ 79 smb_vfs_call_get_dfs_referrals((handle)->next, (r)) 70 80 71 81 /* Directory operations */ … … 127 137 128 138 #define SMB_VFS_CREATE_FILE(conn, req, root_dir_fid, smb_fname, access_mask, share_access, create_disposition, \ 129 create_options, file_attributes, oplock_request, allocation_size, private_flags, sd, ea_list, result, pinfo) \ 130 smb_vfs_call_create_file((conn)->vfs_handles, (req), (root_dir_fid), (smb_fname), (access_mask), (share_access), (create_disposition), \ 131 (create_options), (file_attributes), (oplock_request), (allocation_size), (private_flags), (sd), (ea_list), (result), (pinfo)) 139 create_options, file_attributes, oplock_request, lease, allocation_size, private_flags, sd, ea_list, result, pinfo, in_context_blobs, out_context_blobs) \ 140 smb_vfs_call_create_file((conn)->vfs_handles, (req), (root_dir_fid), (smb_fname), (access_mask), (share_access), (create_disposition), \ 141 (create_options), (file_attributes), (oplock_request), (lease), (allocation_size), (private_flags), (sd), (ea_list), (result), (pinfo), \ 142 (in_context_blobs), (out_context_blobs)) 132 143 #define SMB_VFS_NEXT_CREATE_FILE(handle, req, root_dir_fid, smb_fname, access_mask, share_access, create_disposition, \ 133 create_options, file_attributes, oplock_request, allocation_size, private_flags, sd, ea_list, result, pinfo) \144 create_options, file_attributes, oplock_request, lease, allocation_size, private_flags, sd, ea_list, result, pinfo, in_context_blobs, out_context_blobs) \ 134 145 smb_vfs_call_create_file((handle)->next, (req), (root_dir_fid), (smb_fname), (access_mask), (share_access), (create_disposition), \ 135 (create_options), (file_attributes), (oplock_request), (allocation_size), (private_flags), (sd), (ea_list), (result), (pinfo)) 146 (create_options), (file_attributes), (oplock_request), (lease), (allocation_size), (private_flags), (sd), (ea_list), (result), (pinfo), \ 147 (in_context_blobs), (out_context_blobs)) 136 148 137 149 #define SMB_VFS_CLOSE(fsp) \ 138 smb_vfs_call_close _fn((fsp)->conn->vfs_handles, (fsp))150 smb_vfs_call_close((fsp)->conn->vfs_handles, (fsp)) 139 151 #define SMB_VFS_NEXT_CLOSE(handle, fsp) \ 140 smb_vfs_call_close _fn((handle)->next, (fsp))152 smb_vfs_call_close((handle)->next, (fsp)) 141 153 142 154 #define SMB_VFS_READ(fsp, data, n) \ 143 smb_vfs_call_ vfs_read((fsp)->conn->vfs_handles, (fsp), (data), (n))155 smb_vfs_call_read((fsp)->conn->vfs_handles, (fsp), (data), (n)) 144 156 #define SMB_VFS_NEXT_READ(handle, fsp, data, n) \ 145 smb_vfs_call_ vfs_read((handle)->next, (fsp), (data), (n))157 smb_vfs_call_read((handle)->next, (fsp), (data), (n)) 146 158 147 159 #define SMB_VFS_PREAD(fsp, data, n, off) \ … … 150 162 smb_vfs_call_pread((handle)->next, (fsp), (data), (n), (off)) 151 163 164 #define SMB_VFS_PREAD_SEND(mem_ctx, ev, fsp, data, n, off) \ 165 smb_vfs_call_pread_send((fsp)->conn->vfs_handles, (mem_ctx), (ev), \ 166 (fsp), (data), (n), (off)) 167 #define SMB_VFS_NEXT_PREAD_SEND(mem_ctx, ev, handle, fsp, data, n, off) \ 168 smb_vfs_call_pread_send((handle)->next, (mem_ctx), (ev), (fsp), \ 169 (data), (n), (off)) 170 152 171 #define SMB_VFS_WRITE(fsp, data, n) \ 153 172 smb_vfs_call_write((fsp)->conn->vfs_handles, (fsp), (data), (n)) … … 160 179 smb_vfs_call_pwrite((handle)->next, (fsp), (data), (n), (off)) 161 180 181 #define SMB_VFS_PWRITE_SEND(mem_ctx, ev, fsp, data, n, off) \ 182 smb_vfs_call_pwrite_send((fsp)->conn->vfs_handles, (mem_ctx), (ev), \ 183 (fsp), (data), (n), (off)) 184 #define SMB_VFS_NEXT_PWRITE_SEND(mem_ctx, ev, handle, fsp, data, n, off) \ 185 smb_vfs_call_pwrite_send((handle)->next, (mem_ctx), (ev), (fsp), \ 186 (data), (n), (off)) 187 162 188 #define SMB_VFS_LSEEK(fsp, offset, whence) \ 163 189 smb_vfs_call_lseek((fsp)->conn->vfs_handles, (fsp), (offset), (whence)) … … 185 211 smb_vfs_call_fsync((handle)->next, (fsp)) 186 212 213 #define SMB_VFS_FSYNC_SEND(mem_ctx, ev, fsp) \ 214 smb_vfs_call_fsync_send((fsp)->conn->vfs_handles, (mem_ctx), (ev), \ 215 (fsp)) 216 #define SMB_VFS_NEXT_FSYNC_SEND(mem_ctx, ev, handle, fsp) \ 217 smb_vfs_call_fsync_send((handle)->next, (mem_ctx), (ev), (fsp)) 218 187 219 #define SMB_VFS_STAT(conn, smb_fname) \ 188 220 smb_vfs_call_stat((conn)->vfs_handles, (smb_fname)) … … 240 272 smb_vfs_call_chdir((handle)->next, (path)) 241 273 242 #define SMB_VFS_GETWD(conn , buf) \243 smb_vfs_call_getwd((conn)->vfs_handles , (buf))244 #define SMB_VFS_NEXT_GETWD(handle , buf) \245 smb_vfs_call_getwd((handle)->next , (buf))274 #define SMB_VFS_GETWD(conn) \ 275 smb_vfs_call_getwd((conn)->vfs_handles) 276 #define SMB_VFS_NEXT_GETWD(handle) \ 277 smb_vfs_call_getwd((handle)->next) 246 278 247 279 #define SMB_VFS_NTIMES(conn, path, ts) \ … … 286 318 287 319 #define SMB_VFS_READLINK(conn, path, buf, bufsiz) \ 288 smb_vfs_call_ vfs_readlink((conn)->vfs_handles, (path), (buf), (bufsiz))320 smb_vfs_call_readlink((conn)->vfs_handles, (path), (buf), (bufsiz)) 289 321 #define SMB_VFS_NEXT_READLINK(handle, path, buf, bufsiz) \ 290 smb_vfs_call_ vfs_readlink((handle)->next, (path), (buf), (bufsiz))322 smb_vfs_call_readlink((handle)->next, (path), (buf), (bufsiz)) 291 323 292 324 #define SMB_VFS_LINK(conn, oldpath, newpath) \ … … 305 337 smb_vfs_call_realpath((handle)->next, (path)) 306 338 307 #define SMB_VFS_NOTIFY_WATCH(conn, ctx, e, callback, private_data, handle_p) \308 smb_vfs_call_notify_watch((conn)->vfs_handles, (ctx), (e), (callback), (private_data), (handle_p))309 #define SMB_VFS_NEXT_NOTIFY_WATCH(conn, ctx, e, callback, private_data, handle_p) \310 smb_vfs_call_notify_watch((conn)->next, (ctx), (e), (callback), (private_data), (handle_p))311 312 339 #define SMB_VFS_CHFLAGS(conn, path, flags) \ 313 340 smb_vfs_call_chflags((conn)->vfs_handles, (path), (flags)) … … 335 362 smb_vfs_call_connectpath((conn)->next, (fname)) 336 363 337 #define SMB_VFS_BRL_LOCK_WINDOWS(conn, br_lck, plock, blocking_lock , blr) \338 smb_vfs_call_brl_lock_windows((conn)->vfs_handles, (br_lck), (plock), (blocking_lock) , (blr))339 #define SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle, br_lck, plock, blocking_lock , blr) \340 smb_vfs_call_brl_lock_windows((handle)->next, (br_lck), (plock), (blocking_lock) , (blr))364 #define SMB_VFS_BRL_LOCK_WINDOWS(conn, br_lck, plock, blocking_lock) \ 365 smb_vfs_call_brl_lock_windows((conn)->vfs_handles, (br_lck), (plock), (blocking_lock)) 366 #define SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle, br_lck, plock, blocking_lock) \ 367 smb_vfs_call_brl_lock_windows((handle)->next, (br_lck), (plock), (blocking_lock)) 341 368 342 369 #define SMB_VFS_BRL_UNLOCK_WINDOWS(conn, msg_ctx, br_lck, plock) \ … … 345 372 smb_vfs_call_brl_unlock_windows((handle)->next, (msg_ctx), (br_lck), (plock)) 346 373 347 #define SMB_VFS_BRL_CANCEL_WINDOWS(conn, br_lck, plock , blr) \348 smb_vfs_call_brl_cancel_windows((conn)->vfs_handles, (br_lck), (plock) , (blr))349 #define SMB_VFS_NEXT_BRL_CANCEL_WINDOWS(handle, br_lck, plock , blr) \350 smb_vfs_call_brl_cancel_windows((handle)->next, (br_lck), (plock) , (blr))374 #define SMB_VFS_BRL_CANCEL_WINDOWS(conn, br_lck, plock) \ 375 smb_vfs_call_brl_cancel_windows((conn)->vfs_handles, (br_lck), (plock)) 376 #define SMB_VFS_NEXT_BRL_CANCEL_WINDOWS(handle, br_lck, plock) \ 377 smb_vfs_call_brl_cancel_windows((handle)->next, (br_lck), (plock)) 351 378 352 379 #define SMB_VFS_STRICT_LOCK(conn, fsp, plock) \ … … 365 392 smb_vfs_call_translate_name((handle)->next, (name), (direction), (mem_ctx), (mapped_name)) 366 393 367 #define SMB_VFS_NEXT_STRICT_UNLOCK(handle, fsp, plock) \ 368 smb_vfs_call_strict_unlock((handle)->next, (fsp), (plock)) 369 370 #define SMB_VFS_FGET_NT_ACL(fsp, security_info, ppdesc) \ 371 smb_vfs_call_fget_nt_acl((fsp)->conn->vfs_handles, (fsp), (security_info), (ppdesc)) 372 #define SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, ppdesc) \ 373 smb_vfs_call_fget_nt_acl((handle)->next, (fsp), (security_info), (ppdesc)) 374 375 #define SMB_VFS_GET_NT_ACL(conn, name, security_info, ppdesc) \ 376 smb_vfs_call_get_nt_acl((conn)->vfs_handles, (name), (security_info), (ppdesc)) 377 #define SMB_VFS_NEXT_GET_NT_ACL(handle, name, security_info, ppdesc) \ 378 smb_vfs_call_get_nt_acl((handle)->next, (name), (security_info), (ppdesc)) 394 #define SMB_VFS_FSCTL(fsp, ctx, function, req_flags, in_data, in_len, out_data, max_out_len, out_len) \ 395 smb_vfs_call_fsctl((fsp)->conn->vfs_handles, (fsp), (ctx), (function), (req_flags), (in_data), (in_len), (out_data), (max_out_len), (out_len)) 396 397 #define SMB_VFS_NEXT_FSCTL(handle, fsp, ctx, function, req_flags, in_data, in_len, out_data, max_out_len, out_len) \ 398 smb_vfs_call_fsctl((handle)->next, (fsp), (ctx), (function), (req_flags), (in_data), (in_len), (out_data), (max_out_len), (out_len)) 399 400 #define SMB_VFS_COPY_CHUNK_SEND(conn, mem_ctx, ev, src_fsp, src_off, dest_fsp, dest_off, num) \ 401 smb_vfs_call_copy_chunk_send((conn)->vfs_handles, (mem_ctx), (ev), (src_fsp), (src_off), (dest_fsp), (dest_off), (num)) 402 #define SMB_VFS_NEXT_COPY_CHUNK_SEND(handle, mem_ctx, ev, src_fsp, src_off, dest_fsp, dest_off, num) \ 403 smb_vfs_call_copy_chunk_send((handle)->next, (mem_ctx), (ev), (src_fsp), (src_off), (dest_fsp), (dest_off), (num)) 404 405 #define SMB_VFS_COPY_CHUNK_RECV(conn, req, copied) \ 406 smb_vfs_call_copy_chunk_recv((conn)->vfs_handles, (req), (copied)) 407 #define SMB_VFS_NEXT_COPY_CHUNK_RECV(handle, req, copied) \ 408 smb_vfs_call_copy_chunk_recv((handle)->next, (req), (copied)) 409 410 #define SMB_VFS_GET_COMPRESSION(conn, mem_ctx, fsp, smb_fname, _compression_fmt) \ 411 smb_vfs_call_get_compression((conn)->vfs_handles, (mem_ctx), (fsp), (smb_fname), (_compression_fmt)) 412 #define SMB_VFS_NEXT_GET_COMPRESSION(handle, mem_ctx, fsp, smb_fname, _compression_fmt) \ 413 smb_vfs_call_get_compression((handle)->next, (mem_ctx), (fsp), (smb_fname), (_compression_fmt)) 414 415 #define SMB_VFS_SET_COMPRESSION(conn, mem_ctx, fsp, compression_fmt) \ 416 smb_vfs_call_set_compression((conn)->vfs_handles, (mem_ctx), (fsp), (compression_fmt)) 417 #define SMB_VFS_NEXT_SET_COMPRESSION(handle, mem_ctx, fsp, compression_fmt) \ 418 smb_vfs_call_set_compression((handle)->next, (mem_ctx), (fsp), (compression_fmt)) 419 420 #define SMB_VFS_SNAP_CHECK_PATH(conn, mem_ctx, service_path, base_volume) \ 421 smb_vfs_call_snap_check_path((conn)->vfs_handles, (mem_ctx), (service_path), (base_volume)) 422 #define SMB_VFS_NEXT_SNAP_CHECK_PATH(handle, mem_ctx, service_path, base_volume) \ 423 smb_vfs_call_snap_check_path((handle)->next, (mem_ctx), (service_path), (base_volume)) 424 425 #define SMB_VFS_SNAP_CREATE(conn, mem_ctx, base_volume, tstamp, rw, base_path, snap_path) \ 426 smb_vfs_call_snap_create((conn)->vfs_handles, (mem_ctx), (base_volume), (tstamp), (rw), (base_path), (snap_path)) 427 #define SMB_VFS_NEXT_SNAP_CREATE(handle, mem_ctx, base_volume, tstamp, rw, base_path, snap_path) \ 428 smb_vfs_call_snap_create((handle)->next, (mem_ctx), (base_volume), (tstamp), (rw), (base_path), (snap_path)) 429 430 #define SMB_VFS_SNAP_DELETE(conn, mem_ctx, base_path, snap_path) \ 431 smb_vfs_call_snap_delete((conn)->vfs_handles, (mem_ctx), (base_path), (snap_path)) 432 #define SMB_VFS_NEXT_SNAP_DELETE(handle, mem_ctx, base_path, snap_path) \ 433 smb_vfs_call_snap_delete((handle)->next, (mem_ctx), (base_path), (snap_path)) 434 435 #define SMB_VFS_FGET_NT_ACL(fsp, security_info, mem_ctx, ppdesc) \ 436 smb_vfs_call_fget_nt_acl((fsp)->conn->vfs_handles, (fsp), (security_info), (mem_ctx), (ppdesc)) 437 #define SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, mem_ctx, ppdesc) \ 438 smb_vfs_call_fget_nt_acl((handle)->next, (fsp), (security_info), (mem_ctx), (ppdesc)) 439 440 #define SMB_VFS_GET_NT_ACL(conn, name, security_info, mem_ctx, ppdesc) \ 441 smb_vfs_call_get_nt_acl((conn)->vfs_handles, (name), (security_info), (mem_ctx), (ppdesc)) 442 #define SMB_VFS_NEXT_GET_NT_ACL(handle, name, security_info, mem_ctx, ppdesc) \ 443 smb_vfs_call_get_nt_acl((handle)->next, (name), (security_info), (mem_ctx), (ppdesc)) 444 445 #define SMB_VFS_AUDIT_FILE(conn, name, sacl, access_requested, access_denied) \ 446 smb_vfs_call_audit_file((conn)->vfs_handles, (name), (sacl), (access_requested), (access_denied)) 447 #define SMB_VFS_NEXT_AUDIT_FILE(handle, name, sacl, access_requested, access_denied) \ 448 smb_vfs_call_audit_file((handle)->next, (name), (sacl), (access_requested), (access_denied)) 379 449 380 450 #define SMB_VFS_FSET_NT_ACL(fsp, security_info_sent, psd) \ … … 393 463 smb_vfs_call_fchmod_acl((handle)->next, (fsp), (mode)) 394 464 395 #define SMB_VFS_SYS_ACL_GET_ENTRY(conn, theacl, entry_id, entry_p) \ 396 smb_vfs_call_sys_acl_get_entry((conn)->vfs_handles, (theacl), (entry_id), (entry_p)) 397 #define SMB_VFS_NEXT_SYS_ACL_GET_ENTRY(handle, theacl, entry_id, entry_p) \ 398 smb_vfs_call_sys_acl_get_entry((handle)->next, (theacl), (entry_id), (entry_p)) 399 400 #define SMB_VFS_SYS_ACL_GET_TAG_TYPE(conn, entry_d, tag_type_p) \ 401 smb_vfs_call_sys_acl_get_tag_type((conn)->vfs_handles, (entry_d), (tag_type_p)) 402 #define SMB_VFS_NEXT_SYS_ACL_GET_TAG_TYPE(handle, entry_d, tag_type_p) \ 403 smb_vfs_call_sys_acl_get_tag_type((handle)->next, (entry_d), (tag_type_p)) 404 405 #define SMB_VFS_SYS_ACL_GET_PERMSET(conn, entry_d, permset_p) \ 406 smb_vfs_call_sys_acl_get_permset((conn)->vfs_handles, (entry_d), (permset_p)) 407 #define SMB_VFS_NEXT_SYS_ACL_GET_PERMSET(handle, entry_d, permset_p) \ 408 smb_vfs_call_sys_acl_get_permset((handle)->next, (entry_d), (permset_p)) 409 410 #define SMB_VFS_SYS_ACL_GET_QUALIFIER(conn, entry_d) \ 411 smb_vfs_call_sys_acl_get_qualifier((conn)->vfs_handles, (entry_d)) 412 #define SMB_VFS_NEXT_SYS_ACL_GET_QUALIFIER(handle, entry_d) \ 413 smb_vfs_call_sys_acl_get_qualifier((handle)->next, (entry_d)) 414 415 #define SMB_VFS_SYS_ACL_GET_FILE(conn, path_p, type) \ 416 smb_vfs_call_sys_acl_get_file((conn)->vfs_handles, (path_p), (type)) 417 #define SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, path_p, type) \ 418 smb_vfs_call_sys_acl_get_file((handle)->next, (path_p), (type)) 419 420 #define SMB_VFS_SYS_ACL_GET_FD(fsp) \ 421 smb_vfs_call_sys_acl_get_fd((fsp)->conn->vfs_handles, (fsp)) 422 #define SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp) \ 423 smb_vfs_call_sys_acl_get_fd((handle)->next, (fsp)) 424 425 #define SMB_VFS_SYS_ACL_CLEAR_PERMS(conn, permset) \ 426 smb_vfs_call_sys_acl_clear_perms((conn)->vfs_handles, (permset)) 427 #define SMB_VFS_NEXT_SYS_ACL_CLEAR_PERMS(handle, permset) \ 428 smb_vfs_call_sys_acl_clear_perms((handle)->next, (permset)) 429 430 #define SMB_VFS_SYS_ACL_ADD_PERM(conn, permset, perm) \ 431 smb_vfs_call_sys_acl_add_perm((conn)->vfs_handles, (permset), (perm)) 432 #define SMB_VFS_NEXT_SYS_ACL_ADD_PERM(handle, permset, perm) \ 433 smb_vfs_call_sys_acl_add_perm((handle)->next, (permset), (perm)) 434 435 #define SMB_VFS_SYS_ACL_TO_TEXT(conn, theacl, plen) \ 436 smb_vfs_call_sys_acl_to_text((conn)->vfs_handles, (theacl), (plen)) 437 #define SMB_VFS_NEXT_SYS_ACL_TO_TEXT(handle, theacl, plen) \ 438 smb_vfs_call_sys_acl_to_text((handle)->next, (theacl), (plen)) 439 440 #define SMB_VFS_SYS_ACL_INIT(conn, count) \ 441 smb_vfs_call_sys_acl_init((conn)->vfs_handles, (count)) 442 #define SMB_VFS_NEXT_SYS_ACL_INIT(handle, count) \ 443 smb_vfs_call_sys_acl_init((handle)->next, (count)) 444 445 #define SMB_VFS_SYS_ACL_CREATE_ENTRY(conn, pacl, pentry) \ 446 smb_vfs_call_sys_acl_create_entry((conn)->vfs_handles, (pacl), (pentry)) 447 #define SMB_VFS_NEXT_SYS_ACL_CREATE_ENTRY(handle, pacl, pentry) \ 448 smb_vfs_call_sys_acl_create_entry((handle)->next, (pacl), (pentry)) 449 450 #define SMB_VFS_SYS_ACL_SET_TAG_TYPE(conn, entry, tagtype) \ 451 smb_vfs_call_sys_acl_set_tag_type((conn)->vfs_handles, (entry), (tagtype)) 452 #define SMB_VFS_NEXT_SYS_ACL_SET_TAG_TYPE(handle, entry, tagtype) \ 453 smb_vfs_call_sys_acl_set_tag_type((handle)->next, (entry), (tagtype)) 454 455 #define SMB_VFS_SYS_ACL_SET_QUALIFIER(conn, entry, qual) \ 456 smb_vfs_call_sys_acl_set_qualifier((conn)->vfs_handles, (entry), (qual)) 457 #define SMB_VFS_NEXT_SYS_ACL_SET_QUALIFIER(handle, entry, qual) \ 458 smb_vfs_call_sys_acl_set_qualifier((handle)->next, (entry), (qual)) 459 460 #define SMB_VFS_SYS_ACL_SET_PERMSET(conn, entry, permset) \ 461 smb_vfs_call_sys_acl_set_permset((conn)->vfs_handles, (entry), (permset)) 462 #define SMB_VFS_NEXT_SYS_ACL_SET_PERMSET(handle, entry, permset) \ 463 smb_vfs_call_sys_acl_set_permset((handle)->next, (entry), (permset)) 464 465 #define SMB_VFS_SYS_ACL_VALID(conn, theacl) \ 466 smb_vfs_call_sys_acl_valid((conn)->vfs_handles, (theacl)) 467 #define SMB_VFS_NEXT_SYS_ACL_VALID(handle, theacl) \ 468 smb_vfs_call_sys_acl_valid((handle)->next, (theacl)) 465 #define SMB_VFS_SYS_ACL_GET_FILE(conn, path_p, type, mem_ctx) \ 466 smb_vfs_call_sys_acl_get_file((conn)->vfs_handles, (path_p), (type), (mem_ctx)) 467 #define SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, path_p, type, mem_ctx) \ 468 smb_vfs_call_sys_acl_get_file((handle)->next, (path_p), (type), (mem_ctx)) 469 470 #define SMB_VFS_SYS_ACL_GET_FD(fsp, mem_ctx) \ 471 smb_vfs_call_sys_acl_get_fd((fsp)->conn->vfs_handles, (fsp), (mem_ctx)) 472 #define SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp, mem_ctx) \ 473 smb_vfs_call_sys_acl_get_fd((handle)->next, (fsp), (mem_ctx)) 474 475 #define SMB_VFS_SYS_ACL_BLOB_GET_FILE(conn, path_p, mem_ctx, blob_description, blob) \ 476 smb_vfs_call_sys_acl_blob_get_file((conn)->vfs_handles, (path_p), (mem_ctx), (blob_description), (blob)) 477 #define SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FILE(handle, path_p, mem_ctx, blob_description, blob) \ 478 smb_vfs_call_sys_acl_blob_get_file((handle)->next, (path_p), (mem_ctx), (blob_description), (blob)) 479 480 #define SMB_VFS_SYS_ACL_BLOB_GET_FD(fsp, mem_ctx, blob_description, blob) \ 481 smb_vfs_call_sys_acl_blob_get_fd((fsp)->conn->vfs_handles, (fsp), (mem_ctx), (blob_description), (blob)) 482 #define SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FD(handle, fsp, mem_ctx, blob_description, blob) \ 483 smb_vfs_call_sys_acl_blob_get_fd((handle)->next, (fsp), mem_ctx, (blob_description), (blob)) 469 484 470 485 #define SMB_VFS_SYS_ACL_SET_FILE(conn, name, acltype, theacl) \ … … 483 498 smb_vfs_call_sys_acl_delete_def_file((handle)->next, (path)) 484 499 485 #define SMB_VFS_SYS_ACL_GET_PERM(conn, permset, perm) \486 smb_vfs_call_sys_acl_get_perm((conn)->vfs_handles, (permset), (perm))487 #define SMB_VFS_NEXT_SYS_ACL_GET_PERM(handle, permset, perm) \488 smb_vfs_call_sys_acl_get_perm((handle)->next, (permset), (perm))489 490 #define SMB_VFS_SYS_ACL_FREE_TEXT(conn, text) \491 smb_vfs_call_sys_acl_free_text((conn)->vfs_handles, (text))492 #define SMB_VFS_NEXT_SYS_ACL_FREE_TEXT(handle, text) \493 smb_vfs_call_sys_acl_free_text((handle)->next, (text))494 495 #define SMB_VFS_SYS_ACL_FREE_ACL(conn, posix_acl) \496 smb_vfs_call_sys_acl_free_acl((conn)->vfs_handles, (posix_acl))497 #define SMB_VFS_NEXT_SYS_ACL_FREE_ACL(handle, posix_acl) \498 smb_vfs_call_sys_acl_free_acl((handle)->next, (posix_acl))499 500 #define SMB_VFS_SYS_ACL_FREE_QUALIFIER(conn, qualifier, tagtype) \501 smb_vfs_call_sys_acl_free_qualifier((conn)->vfs_handles, (qualifier), (tagtype))502 #define SMB_VFS_NEXT_SYS_ACL_FREE_QUALIFIER(handle, qualifier, tagtype) \503 smb_vfs_call_sys_acl_free_qualifier((handle)->next, (qualifier), (tagtype))504 505 500 #define SMB_VFS_GETXATTR(conn,path,name,value,size) \ 506 501 smb_vfs_call_getxattr((conn)->vfs_handles,(path),(name),(value),(size)) … … 508 503 smb_vfs_call_getxattr((handle)->next,(path),(name),(value),(size)) 509 504 510 #define SMB_VFS_LGETXATTR(conn,path,name,value,size) \511 smb_vfs_call_lgetxattr((conn)->vfs_handles,(path),(name),(value),(size))512 #define SMB_VFS_NEXT_LGETXATTR(handle,path,name,value,size) \513 smb_vfs_call_lgetxattr((handle)->next,(path),(name),(value),(size))514 515 505 #define SMB_VFS_FGETXATTR(fsp,name,value,size) \ 516 506 smb_vfs_call_fgetxattr((fsp)->conn->vfs_handles, (fsp), (name),(value),(size)) … … 523 513 smb_vfs_call_listxattr((handle)->next,(path),(list),(size)) 524 514 525 #define SMB_VFS_LLISTXATTR(conn,path,list,size) \526 smb_vfs_call_llistxattr((conn)->vfs_handles,(path),(list),(size))527 #define SMB_VFS_NEXT_LLISTXATTR(handle,path,list,size) \528 smb_vfs_call_llistxattr((handle)->next,(path),(list),(size))529 530 515 #define SMB_VFS_FLISTXATTR(fsp,list,size) \ 531 516 smb_vfs_call_flistxattr((fsp)->conn->vfs_handles, (fsp), (list),(size)) … … 538 523 smb_vfs_call_removexattr((handle)->next,(path),(name)) 539 524 540 #define SMB_VFS_LREMOVEXATTR(conn,path,name) \541 smb_vfs_call_lremovexattr((conn)->vfs_handles,(path),(name))542 #define SMB_VFS_NEXT_LREMOVEXATTR(handle,path,name) \543 smb_vfs_call_lremovexattr((handle)->next,(path),(name))544 545 525 #define SMB_VFS_FREMOVEXATTR(fsp,name) \ 546 526 smb_vfs_call_fremovexattr((fsp)->conn->vfs_handles, (fsp), (name)) … … 553 533 smb_vfs_call_setxattr((handle)->next,(path),(name),(value),(size),(flags)) 554 534 555 #define SMB_VFS_LSETXATTR(conn,path,name,value,size,flags) \556 smb_vfs_call_lsetxattr((conn)->vfs_handles,(path),(name),(value),(size),(flags))557 #define SMB_VFS_NEXT_LSETXATTR(handle,path,name,value,size,flags) \558 smb_vfs_call_lsetxattr((handle)->next,(path),(name),(value),(size),(flags))559 560 535 #define SMB_VFS_FSETXATTR(fsp,name,value,size,flags) \ 561 536 smb_vfs_call_fsetxattr((fsp)->conn->vfs_handles, (fsp), (name),(value),(size),(flags)) … … 563 538 smb_vfs_call_fsetxattr((handle)->next,(fsp),(name),(value),(size),(flags)) 564 539 565 #define SMB_VFS_AIO_READ(fsp,aiocb) \566 smb_vfs_call_aio_read((fsp)->conn->vfs_handles, (fsp), (aiocb))567 #define SMB_VFS_NEXT_AIO_READ(handle,fsp,aiocb) \568 smb_vfs_call_aio_read((handle)->next,(fsp),(aiocb))569 570 #define SMB_VFS_AIO_WRITE(fsp,aiocb) \571 smb_vfs_call_aio_write((fsp)->conn->vfs_handles, (fsp), (aiocb))572 #define SMB_VFS_NEXT_AIO_WRITE(handle,fsp,aiocb) \573 smb_vfs_call_aio_write((handle)->next,(fsp),(aiocb))574 575 #define SMB_VFS_AIO_RETURN(fsp,aiocb) \576 smb_vfs_call_aio_return_fn((fsp)->conn->vfs_handles, (fsp), (aiocb))577 #define SMB_VFS_NEXT_AIO_RETURN(handle,fsp,aiocb) \578 smb_vfs_call_aio_return_fn((handle)->next,(fsp),(aiocb))579 580 #define SMB_VFS_AIO_CANCEL(fsp,aiocb) \581 smb_vfs_call_aio_cancel((fsp)->conn->vfs_handles, (fsp), (aiocb))582 #define SMB_VFS_NEXT_AIO_CANCEL(handle,fsp,aiocb) \583 smb_vfs_call_aio_cancel((handle)->next,(fsp),(aiocb))584 585 #define SMB_VFS_AIO_ERROR(fsp,aiocb) \586 smb_vfs_call_aio_error_fn((fsp)->conn->vfs_handles, (fsp),(aiocb))587 #define SMB_VFS_NEXT_AIO_ERROR(handle,fsp,aiocb) \588 smb_vfs_call_aio_error_fn((handle)->next,(fsp),(aiocb))589 590 #define SMB_VFS_AIO_FSYNC(fsp,op,aiocb) \591 smb_vfs_call_aio_fsync((fsp)->conn->vfs_handles, (fsp), (op),(aiocb))592 #define SMB_VFS_NEXT_AIO_FSYNC(handle,fsp,op,aiocb) \593 smb_vfs_call_aio_fsync((handle)->next,(fsp),(op),(aiocb))594 595 #define SMB_VFS_AIO_SUSPEND(fsp,aiocb,n,ts) \596 smb_vfs_call_aio_suspend((fsp)->conn->vfs_handles, (fsp),(aiocb),(n),(ts))597 #define SMB_VFS_NEXT_AIO_SUSPEND(handle,fsp,aiocb,n,ts) \598 smb_vfs_call_aio_suspend((handle)->next,(fsp),(aiocb),(n),(ts))599 600 540 #define SMB_VFS_AIO_FORCE(fsp) \ 601 541 smb_vfs_call_aio_force((fsp)->conn->vfs_handles, (fsp)) … … 613 553 smb_vfs_call_set_offline((handle)->next, (fname)) 614 554 555 /* durable handle operations */ 556 557 #define SMB_VFS_DURABLE_COOKIE(fsp, mem_ctx, cookie) \ 558 smb_vfs_call_durable_cookie((fsp)->conn->vfs_handles, \ 559 (fsp), (mem_ctx), (cookie)) 560 #define SMB_VFS_NEXT_DURABLE_COOKIE(handle, fsp, mem_ctx, cookie) \ 561 smb_vfs_call_durable_cookie((handle)->next, \ 562 (fsp), (mem_ctx), (cookie)) 563 564 #define SMB_VFS_DURABLE_DISCONNECT(fsp, old_cookie, mem_ctx, new_cookie) \ 565 smb_vfs_call_durable_disconnect((fsp)->conn->vfs_handles, \ 566 (fsp), (old_cookie), (mem_ctx), (new_cookie)) 567 #define SMB_VFS_NEXT_DURABLE_DISCONNECT(handle, fsp, old_cookie, mem_ctx, new_cookie) \ 568 smb_vfs_call_durable_disconnect((handle)->next, \ 569 (fsp), (old_cookie), (mem_ctx), (new_cookie)) 570 571 #define SMB_VFS_DURABLE_RECONNECT(conn, smb1req, op, old_cookie, mem_ctx, fsp, new_cookie) \ 572 smb_vfs_call_durable_reconnect((conn)->vfs_handles, \ 573 (smb1req), (op), (old_cookie), \ 574 (mem_ctx), (fsp), (new_cookie)) 575 #define SMB_VFS_NEXT_DURABLE_RECONNECT(handle, smb1req, op, old_cookie, mem_ctx, fsp, new_cookie) \ 576 smb_vfs_call_durable_reconnect((handle)->next, \ 577 (smb1req), (op), (old_cookie), \ 578 (mem_ctx), (fsp), (new_cookie)) 579 580 #define SMB_VFS_READDIR_ATTR(conn, fname, mem_ctx, attr_data) \ 581 smb_vfs_call_readdir_attr((conn)->vfs_handles, (fname), (mem_ctx), (attr_data)) 582 #define SMB_VFS_NEXT_READDIR_ATTR(conn, fname, mem_ctx, attr_data) \ 583 smb_vfs_call_readdir_attr((handle)->next, (fname), (mem_ctx), (attr_data)) 584 615 585 #endif /* _VFS_MACROS_H */
Note:
See TracChangeset
for help on using the changeset viewer.