Fix inode generation so nautilus can count total dir size correctly
[samba.git] / source3 / include / proto.h
index b6c10eab68a6cdf83b8f8fa070ac3809ab181108..a261310ea2e8942d533e2f755b256e1b60ceea71 100644 (file)
@@ -1107,6 +1107,9 @@ const char *get_cmdline_auth_info_password(const struct user_auth_info *auth_inf
 bool set_cmdline_auth_info_signing_state(struct user_auth_info *auth_info,
                                         const char *arg);
 int get_cmdline_auth_info_signing_state(const struct user_auth_info *auth_info);
+void set_cmdline_auth_info_use_ccache(struct user_auth_info *auth_info,
+                                     bool b);
+bool get_cmdline_auth_info_use_ccache(const struct user_auth_info *auth_info);
 void set_cmdline_auth_info_use_kerberos(struct user_auth_info *auth_info,
                                        bool b);
 bool get_cmdline_auth_info_use_kerberos(const struct user_auth_info *auth_info);
@@ -1176,6 +1179,7 @@ void set_remote_arch(enum remote_arch_types type);
 enum remote_arch_types get_remote_arch(void);
 const char *tab_depth(int level, int depth);
 int str_checksum(const char *s);
+unsigned int jenkins_hash(TDB_DATA *key);
 void zero_free(void *p, size_t size);
 int set_maxfiles(int requested_max);
 int smb_mkstemp(char *name_template);
@@ -1235,6 +1239,9 @@ bool is_valid_policy_hnd(const struct policy_handle *hnd);
 bool policy_hnd_equal(const struct policy_handle *hnd1,
                      const struct policy_handle *hnd2);
 const char *strip_hostname(const char *s);
+bool tevent_req_poll_ntstatus(struct tevent_req *req,
+                             struct tevent_context *ev,
+                             NTSTATUS *status);
 
 /* The following definitions come from lib/util_file.c  */
 
@@ -1536,6 +1543,8 @@ char *strnrchr_m(const char *s, char c, unsigned int n);
 char *strstr_m(const char *src, const char *findstr);
 void strlower_m(char *s);
 void strupper_m(char *s);
+size_t strlen_m_ext(const char *s, const charset_t dst_charset);
+size_t strlen_m_ext_term(const char *s, const charset_t dst_charset);
 size_t strlen_m(const char *s);
 size_t strlen_m_term(const char *s);
 size_t strlen_m_term_null(const char *s);
@@ -1794,6 +1803,8 @@ char* kerberos_standard_des_salt( void );
 bool kerberos_secrets_store_des_salt( const char* salt );
 char* kerberos_secrets_fetch_des_salt( void );
 char *kerberos_get_default_realm_from_ccache( void );
+char *kerberos_get_realm_from_hostname(const char *hostname);
+
 bool kerberos_secrets_store_salting_principal(const char *service,
                                              int enctype,
                                              const char *principal);
@@ -1804,7 +1815,8 @@ int kerberos_kinit_password(const char *principal,
 bool create_local_private_krb5_conf_for_domain(const char *realm,
                                                const char *domain,
                                                const char *sitename,
-                                               struct sockaddr_storage *pss);
+                                               struct sockaddr_storage *pss,
+                                               const char *kdc_name);
 
 /* The following definitions come from libads/kerberos_keytab.c  */
 
@@ -2329,6 +2341,7 @@ bool cli_is_dos_error(struct cli_state *cli);
 NTSTATUS cli_get_nt_error(struct cli_state *cli);
 void cli_set_nt_error(struct cli_state *cli, NTSTATUS status);
 void cli_reset_error(struct cli_state *cli);
+bool cli_state_is_connected(struct cli_state *cli);
 
 /* The following definitions come from libsmb/clifile.c  */
 
@@ -3044,8 +3057,6 @@ NTSTATUS cli_trans(TALLOC_CTX *mem_ctx, struct cli_state *cli,
 NTSTATUS check_negative_conn_cache_timeout( const char *domain, const char *server, unsigned int failed_cache_timeout );
 NTSTATUS check_negative_conn_cache( const char *domain, const char *server);
 void add_failed_connection_entry(const char *domain, const char *server, NTSTATUS result) ;
-void delete_negative_conn_cache(const char *domain, const char *server);
-void flush_negative_conn_cache( void );
 void flush_negative_conn_cache_for_domain(const char *domain);
 
 /* The following definitions come from ../librpc/rpc/dcerpc_error.c  */
@@ -3185,9 +3196,9 @@ struct packet_struct *receive_dgram_packet(int fd, int t,
 bool match_mailslot_name(struct packet_struct *p, const char *mailslot_name);
 int matching_len_bits(unsigned char *p1, unsigned char *p2, size_t len);
 void sort_query_replies(char *data, int n, struct in_addr ip);
-char *name_mangle(TALLOC_CTX *mem_ctx, char *In, char name_type);
-int name_extract(char *buf,int ofs, fstring name);
-int name_len(char *s1);
+char *name_mangle(TALLOC_CTX *mem_ctx, const char *In, char name_type);
+int name_extract(unsigned char *buf,size_t buf_len, unsigned int ofs, fstring name);
+int name_len(unsigned char *s1, size_t buf_len);
 
 /* The following definitions come from libsmb/nterr.c  */
 
@@ -3944,6 +3955,7 @@ const char *lp_logon_drive(void);
 const char *lp_logon_home(void);
 char *lp_remote_announce(void);
 char *lp_remote_browse_sync(void);
+bool lp_nmbd_bind_explicit_broadcast(void);
 const char **lp_wins_server_list(void);
 const char **lp_interfaces(void);
 const char *lp_socket_address(void);
@@ -4373,6 +4385,7 @@ void lp_set_posix_default_cifsx_readwrite_locktype(enum brl_flavour val);
 int lp_min_receive_file_size(void);
 char* lp_perfcount_module(void);
 void lp_set_passdb_backend(const char *backend);
+void widelinks_warning(int snum);
 
 /* The following definitions come from param/util.c  */
 
@@ -4706,6 +4719,7 @@ bool secrets_delete_machine_password(const char *domain);
 bool secrets_delete_machine_password_ex(const char *domain);
 bool secrets_delete_domain_sid(const char *domain);
 bool secrets_store_machine_password(const char *pass, const char *domain, enum netr_SchannelType sec_channel);
+char *secrets_fetch_prev_machine_password(const char *domain);
 char *secrets_fetch_machine_password(const char *domain,
                                     time_t *pass_last_set_time,
                                     enum netr_SchannelType *channel);
@@ -4771,6 +4785,7 @@ void load_printers(void);
 bool parse_lpq_entry(enum printing_types printing_type,char *line,
                     print_queue_struct *buf,
                     print_status_struct *status,bool first);
+uint32_t print_parse_jobid(const char *fname);
 
 /* The following definitions come from printing/notify.c  */
 
@@ -5246,6 +5261,7 @@ NTSTATUS rpccli_netlogon_sam_network_logon(struct rpc_pipe_client *cli,
                                           const char *domain,
                                           const char *workstation,
                                           const uint8 chal[8],
+                                          uint16_t validation_level,
                                           DATA_BLOB lm_response,
                                           DATA_BLOB nt_response,
                                           struct netr_SamInfo3 **info3);
@@ -5257,6 +5273,7 @@ NTSTATUS rpccli_netlogon_sam_network_logon_ex(struct rpc_pipe_client *cli,
                                              const char *domain,
                                              const char *workstation,
                                              const uint8 chal[8],
+                                             uint16_t validation_level,
                                              DATA_BLOB lm_response,
                                              DATA_BLOB nt_response,
                                              struct netr_SamInfo3 **info3);
@@ -5286,6 +5303,7 @@ NTSTATUS rpc_pipe_bind(struct rpc_pipe_client *cli,
                       struct cli_pipe_auth_data *auth);
 unsigned int rpccli_set_timeout(struct rpc_pipe_client *cli,
                                unsigned int timeout);
+bool rpccli_is_connected(struct rpc_pipe_client *rpc_cli);
 bool rpccli_get_pwd_hash(struct rpc_pipe_client *cli, uint8_t nt_hash[16]);
 NTSTATUS rpccli_anon_bind_data(TALLOC_CTX *mem_ctx,
                               struct cli_pipe_auth_data **presult);
@@ -5409,6 +5427,7 @@ NTSTATUS rpc_transport_smbd_init(TALLOC_CTX *mem_ctx,
                                 struct rpc_cli_smbd_conn *conn,
                                 const struct ndr_syntax_id *abstract_syntax,
                                 struct rpc_cli_transport **presult);
+struct cli_state *rpc_pipe_smbd_smb_conn(struct rpc_pipe_client *p);
 
 /* The following definitions come from rpc_client/rpc_transport_sock.c  */
 
@@ -5557,7 +5576,8 @@ WERROR rpccli_spoolss_getprinterdata(struct rpc_pipe_client *cli,
                                     const char *value_name,
                                     uint32_t offered,
                                     enum winreg_Type *type,
-                                    union spoolss_PrinterData *data);
+                                    uint32_t *needed_p,
+                                    uint8_t **data_p);
 WERROR rpccli_spoolss_enumprinterkey(struct rpc_pipe_client *cli,
                                     TALLOC_CTX *mem_ctx,
                                     struct policy_handle *handle,
@@ -5583,6 +5603,8 @@ WERROR pull_spoolss_PrinterData(TALLOC_CTX *mem_ctx,
 WERROR push_spoolss_PrinterData(TALLOC_CTX *mem_ctx, DATA_BLOB *blob,
                                enum winreg_Type type,
                                union spoolss_PrinterData *data);
+void spoolss_printerinfo2_to_setprinterinfo2(const struct spoolss_PrinterInfo2 *i,
+                                            struct spoolss_SetPrinterInfo2 *s);
 
 /* The following definitions come from rpc_client/init_lsa.c  */
 
@@ -6096,6 +6118,9 @@ NTSTATUS pass_oem_change(char *user,
                         uchar password_encrypted_with_nt_hash[516],
                         const uchar old_nt_hash_encrypted[16],
                         uint32 *reject_reason);
+bool password_in_history(uint8_t nt_pw[NT_HASH_LEN],
+                        uint32_t pw_history_len,
+                        const uint8_t *pw_history);
 NTSTATUS change_oem_password(struct samu *hnd, char *old_passwd, char *new_passwd, bool as_root, uint32 *samr_reject_reason);
 
 /* The following definitions come from smbd/close.c  */
@@ -6446,6 +6471,7 @@ bool is_msdfs_link(connection_struct *conn,
                const char *path,
                SMB_STRUCT_STAT *sbufp);
 NTSTATUS get_referred_path(TALLOC_CTX *ctx,
+                       struct auth_serversupplied_info *server_info,
                        const char *dfs_path,
                        struct junction_map *jucn,
                        int *consumedcntp,
@@ -6469,6 +6495,7 @@ NTSTATUS resolve_dfspath_wcard(TALLOC_CTX *ctx,
                                connection_struct *conn,
                                bool dfs_pathnames,
                                const char *name_in,
+                               bool allow_wcards,
                                char **pp_name_out,
                                bool *ppath_contains_wcard);
 NTSTATUS create_conn_struct(TALLOC_CTX *ctx,
@@ -6567,7 +6594,8 @@ void reply_nttranss(struct smb_request *req);
 
 /* The following definitions come from smbd/open.c  */
 
-NTSTATUS smb1_file_se_access_check(const struct security_descriptor *sd,
+NTSTATUS smb1_file_se_access_check(connection_struct *conn,
+                         const struct security_descriptor *sd,
                           const NT_USER_TOKEN *token,
                           uint32_t access_desired,
                           uint32_t *access_granted);
@@ -6605,10 +6633,9 @@ bool map_open_params_to_ntcreate(const struct smb_filename *smb_fname,
                                 uint32 *pshare_mode,
                                 uint32 *pcreate_disposition,
                                 uint32 *pcreate_options);
-NTSTATUS open_file_fchmod(struct smb_request *req, connection_struct *conn,
+NTSTATUS open_file_fchmod(connection_struct *conn,
                          struct smb_filename *smb_fname,
                          files_struct **result);
-NTSTATUS close_file_fchmod(struct smb_request *req, files_struct *fsp);
 NTSTATUS create_directory(connection_struct *conn, struct smb_request *req,
                          struct smb_filename *smb_dname);
 void msg_file_was_renamed(struct messaging_context *msg,
@@ -6637,7 +6664,8 @@ NTSTATUS create_file_default(connection_struct *conn,
 NTSTATUS get_relative_fid_filename(connection_struct *conn,
                                   struct smb_request *req,
                                   uint16_t root_dir_fid,
-                                  struct smb_filename *smb_fname);
+                                  const struct smb_filename *smb_fname,
+                                  struct smb_filename **smb_fname_out);
 
 /* The following definitions come from smbd/oplock.c  */
 
@@ -6719,6 +6747,10 @@ void reply_pipe_close(connection_struct *conn, struct smb_request *req);
 
 void create_file_sids(const SMB_STRUCT_STAT *psbuf, DOM_SID *powner_sid, DOM_SID *pgroup_sid);
 bool nt4_compatible_acls(void);
+uint32_t map_canon_ace_perms(int snum,
+                                enum security_ace_type *pacl_type,
+                                mode_t perms,
+                                bool directory_ace);
 NTSTATUS unpack_nt_owners(int snum, uid_t *puser, gid_t *pgrp, uint32 security_info_sent, const SEC_DESC *psd);
 SMB_ACL_T free_empty_sys_acl(connection_struct *conn, SMB_ACL_T the_acl);
 NTSTATUS posix_fget_nt_acl(struct files_struct *fsp, uint32_t security_info,
@@ -6741,6 +6773,10 @@ bool set_unix_posix_default_acl(connection_struct *conn, const char *fname,
                                uint16 num_def_acls, const char *pdata);
 bool set_unix_posix_acl(connection_struct *conn, files_struct *fsp, const char *fname, uint16 num_acls, const char *pdata);
 SEC_DESC *get_nt_acl_no_snum( TALLOC_CTX *ctx, const char *fname);
+NTSTATUS make_default_filesystem_acl(TALLOC_CTX *ctx,
+                                       const char *name,
+                                       SMB_STRUCT_STAT *psbuf,
+                                       SEC_DESC **ppdesc);
 
 /* The following definitions come from smbd/process.c  */
 
@@ -6836,7 +6872,7 @@ bool check_fsp_ntquota_handle(connection_struct *conn, struct smb_request *req,
                              files_struct *fsp);
 bool fsp_belongs_conn(connection_struct *conn, struct smb_request *req,
                      files_struct *fsp);
-void reply_special(char *inbuf);
+void reply_special(char *inbuf, size_t inbuf_len);
 void reply_tcon(struct smb_request *req);
 void reply_tcon_and_X(struct smb_request *req);
 void reply_unknown_new(struct smb_request *req, uint8 type);
@@ -7031,6 +7067,7 @@ int sys_statvfs(const char *path, vfs_statvfs_struct *statbuf);
 /* The following definitions come from smbd/trans2.c  */
 
 uint64_t smb_roundup(connection_struct *conn, uint64_t val);
+uint64_t get_FileIndex(connection_struct *conn, const SMB_STRUCT_STAT *psbuf);
 NTSTATUS get_ea_value(TALLOC_CTX *mem_ctx, connection_struct *conn,
                      files_struct *fsp, const char *fname,
                      const char *ea_name, struct ea_struct *pea);
@@ -7273,6 +7310,28 @@ struct tevent_req *fncall_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
                               void *private_data);
 int fncall_recv(struct tevent_req *req, int *perr);
 
+struct tevent_req *smbsock_connect_send(TALLOC_CTX *mem_ctx,
+                                       struct tevent_context *ev,
+                                       const struct sockaddr_storage *addr,
+                                       const char *called_name,
+                                       const char *calling_name);
+NTSTATUS smbsock_connect_recv(struct tevent_req *req, int *sock,
+                             uint16_t *port);
+NTSTATUS smbsock_connect(const struct sockaddr_storage *addr,
+                        const char *called_name, const char *calling_name,
+                        int *pfd, uint16_t *port);
+
+struct tevent_req *smbsock_any_connect_send(TALLOC_CTX *mem_ctx,
+                                           struct tevent_context *ev,
+                                           const struct sockaddr_storage *addrs,
+                                           const char **called_names,
+                                           size_t num_addrs);
+NTSTATUS smbsock_any_connect_recv(struct tevent_req *req, int *pfd,
+                                 size_t *chosen_index, uint16_t *port);
+NTSTATUS smbsock_any_connect(const struct sockaddr_storage *addrs,
+                            const char **called_names, size_t num_addrs,
+                            int *pfd, size_t *chosen_index, uint16_t *port);
+
 /* The following definitions come from rpc_server/srv_samr_nt.c */
 NTSTATUS access_check_object( SEC_DESC *psd, NT_USER_TOKEN *token,
                                SE_PRIV *rights, uint32 rights_mask,