Fix inode generation so nautilus can count total dir size correctly
[samba.git] / source3 / include / proto.h
index ff0156dc1ff874cc3a1fcdb74cb13dfe9b6f1575..a261310ea2e8942d533e2f755b256e1b60ceea71 100644 (file)
@@ -691,6 +691,7 @@ SEC_DESC_BUF *dup_sec_desc_buf(TALLOC_CTX *ctx, SEC_DESC_BUF *src);
 NTSTATUS sec_desc_add_sid(TALLOC_CTX *ctx, SEC_DESC **psd, DOM_SID *sid, uint32 mask, size_t *sd_size);
 NTSTATUS sec_desc_mod_sid(SEC_DESC *sd, DOM_SID *sid, uint32 mask);
 NTSTATUS sec_desc_del_sid(TALLOC_CTX *ctx, SEC_DESC **psd, DOM_SID *sid, size_t *sd_size);
+bool sd_has_inheritable_components(const SEC_DESC *parent_ctr, bool container);
 NTSTATUS se_create_child_secdesc(TALLOC_CTX *ctx,
                                         SEC_DESC **ppsd,
                                        size_t *psize,
@@ -927,10 +928,14 @@ int sys_fcntl_ptr(int fd, int cmd, void *arg);
 int sys_fcntl_long(int fd, int cmd, long arg);
 void update_stat_ex_mtime(struct stat_ex *dst, struct timespec write_ts);
 void update_stat_ex_create_time(struct stat_ex *dst, struct timespec create_time);
-int sys_stat(const char *fname,SMB_STRUCT_STAT *sbuf);
-int sys_fstat(int fd,SMB_STRUCT_STAT *sbuf);
-int sys_lstat(const char *fname,SMB_STRUCT_STAT *sbuf);
+int sys_stat(const char *fname, SMB_STRUCT_STAT *sbuf,
+            bool fake_dir_create_times);
+int sys_fstat(int fd, SMB_STRUCT_STAT *sbuf,
+             bool fake_dir_create_times);
+int sys_lstat(const char *fname,SMB_STRUCT_STAT *sbuf,
+             bool fake_dir_create_times);
 int sys_ftruncate(int fd, SMB_OFF_T offset);
+int sys_posix_fallocate(int fd, SMB_OFF_T offset, SMB_OFF_T len);
 SMB_OFF_T sys_lseek(int fd, SMB_OFF_T offset, int whence);
 int sys_fseek(FILE *fp, SMB_OFF_T offset, int whence);
 SMB_OFF_T sys_ftell(FILE *fp);
@@ -1025,6 +1030,7 @@ bool nt_time_is_zero(const NTTIME *nt);
 time_t generalized_to_unix_time(const char *str);
 int get_server_zone_offset(void);
 int set_server_zone_offset(time_t t);
+char *timeval_string(TALLOC_CTX *ctx, const struct timeval *tp, bool hires);
 char *current_timestring(TALLOC_CTX *ctx, bool hires);
 void srv_put_dos_date(char *buf,int offset,time_t unixdate);
 void srv_put_dos_date2(char *buf,int offset, time_t unixdate);
@@ -1101,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);
@@ -1117,9 +1126,9 @@ struct user_auth_info *get_cmdline_auth_info_copy(TALLOC_CTX *mem_ctx,
                                                 const struct user_auth_info *info);
 bool set_cmdline_auth_info_machine_account_creds(struct user_auth_info *auth_info);
 void set_cmdline_auth_info_getpass(struct user_auth_info *auth_info);
-bool file_exist_stat(const char *fname,SMB_STRUCT_STAT *sbuf);
+bool file_exist_stat(const char *fname,SMB_STRUCT_STAT *sbuf,
+                    bool fake_dir_create_times);
 bool socket_exist(const char *fname);
-bool directory_exist_stat(char *dname,SMB_STRUCT_STAT *st);
 uint64_t get_file_size_stat(const SMB_STRUCT_STAT *sbuf);
 SMB_OFF_T get_file_size(char *file_name);
 char *attrib_string(uint16 mode);
@@ -1170,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);
@@ -1229,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  */
 
@@ -1259,8 +1272,6 @@ struct passwd *getpwuid_alloc(TALLOC_CTX *mem_ctx, uid_t uid) ;
 /* The following definitions come from lib/util_reg.c  */
 
 const char *reg_type_lookup(enum winreg_Type type);
-WERROR reg_pull_multi_sz(TALLOC_CTX *mem_ctx, const void *buf, size_t len,
-                        uint32 *num_values, char ***values);
 bool push_reg_sz(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, const char *s);
 bool push_reg_multi_sz(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, const char **a);
 bool pull_reg_sz(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob, const char **s);
@@ -1532,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);
@@ -1790,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);
@@ -1800,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  */
 
@@ -2089,21 +2105,9 @@ WERROR reg_apply_registry_entry(TALLOC_CTX *mem_ctx,
 #include "librpc/gen_ndr/ndr_svcctl.h"
 #include "librpc/gen_ndr/ndr_winreg.h"
 #include "librpc/gen_ndr/ndr_wkssvc.h"
-
-#include "librpc/gen_ndr/srv_dfs.h"
-#include "librpc/gen_ndr/srv_dssetup.h"
-#include "librpc/gen_ndr/srv_echo.h"
-#include "librpc/gen_ndr/srv_eventlog.h"
-#include "librpc/gen_ndr/srv_initshutdown.h"
-#include "librpc/gen_ndr/srv_lsa.h"
-#include "librpc/gen_ndr/srv_netlogon.h"
-#include "librpc/gen_ndr/srv_ntsvcs.h"
-#include "librpc/gen_ndr/srv_samr.h"
-#include "librpc/gen_ndr/srv_srvsvc.h"
-#include "librpc/gen_ndr/srv_svcctl.h"
-#include "librpc/gen_ndr/srv_winreg.h"
-#include "librpc/gen_ndr/srv_wkssvc.h"
-#include "librpc/gen_ndr/srv_spoolss.h"
+#include "librpc/gen_ndr/ndr_drsuapi.h"
+#include "librpc/gen_ndr/ndr_spoolss.h"
+#include "librpc/gen_ndr/ndr_initshutdown.h"
 
 #include "librpc/ndr/libndr.h"
 
@@ -2337,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  */
 
@@ -3052,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  */
@@ -3193,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  */
 
@@ -3416,8 +3419,7 @@ int brl_forall(void (*fn)(struct file_id id, struct server_id pid,
               void *private_data);
 struct byte_range_lock *brl_get_locks(TALLOC_CTX *mem_ctx,
                                        files_struct *fsp);
-struct byte_range_lock *brl_get_locks_readonly(TALLOC_CTX *mem_ctx,
-                                       files_struct *fsp);
+struct byte_range_lock *brl_get_locks_readonly(files_struct *fsp);
 void brl_register_msgs(struct messaging_context *msg_ctx);
 
 /* The following definitions come from locking/locking.c  */
@@ -3495,8 +3497,7 @@ bool del_share_mode(struct share_mode_lock *lck, files_struct *fsp);
 void del_deferred_open_entry(struct share_mode_lock *lck, uint16 mid);
 bool remove_share_oplock(struct share_mode_lock *lck, files_struct *fsp);
 bool downgrade_share_oplock(struct share_mode_lock *lck, files_struct *fsp);
-NTSTATUS can_set_delete_on_close(files_struct *fsp, bool delete_on_close,
-                                uint32 dosmode);
+NTSTATUS can_set_delete_on_close(files_struct *fsp, uint32 dosmode);
 void set_delete_on_close_token(struct share_mode_lock *lck, const UNIX_USER_TOKEN *tok);
 void set_delete_on_close_lck(struct share_mode_lock *lck, bool delete_on_close, const UNIX_USER_TOKEN *tok);
 bool set_delete_on_close(files_struct *fsp, bool delete_on_close, const UNIX_USER_TOKEN *tok);
@@ -3954,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);
@@ -4003,6 +4005,7 @@ char *lp_ldap_suffix(void);
 char *lp_ldap_admin_dn(void);
 int lp_ldap_ssl(void);
 bool lp_ldap_ssl_ads(void);
+int lp_ldap_deref(void);
 int lp_ldap_follow_referral(void);
 int lp_ldap_passwd_sync(void);
 bool lp_ldap_delete_dn(void);
@@ -4208,7 +4211,7 @@ bool lp_recursive_veto_delete(int );
 bool lp_dos_filemode(int );
 bool lp_dos_filetimes(int );
 bool lp_dos_filetime_resolution(int );
-bool lp_fake_dir_create_times(void);
+bool lp_fake_dir_create_times(int);
 bool lp_blocking_locks(int );
 bool lp_inherit_perms(int );
 bool lp_inherit_acls(int );
@@ -4382,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  */
 
@@ -4715,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);
@@ -4780,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  */
 
@@ -4822,11 +4828,10 @@ void update_a_form(nt_forms_struct **list, struct spoolss_AddFormInfo1 *form, in
 int get_ntdrivers(fstring **list, const char *architecture, uint32 version);
 const char *get_short_archi(const char *long_archi);
 WERROR clean_up_driver_struct(struct pipes_struct *rpc_pipe,
-                             NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract,
-                             uint32 level);
+                             struct spoolss_AddDriverInfoCtr *r);
 WERROR move_driver_to_download_area(struct pipes_struct *p,
-                                   NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract,
-                                   uint32 level, WERROR *perr);
+                                   struct spoolss_AddDriverInfoCtr *r,
+                                   WERROR *perr);
 int pack_devicemode(NT_DEVICEMODE *nt_devmode, uint8 *buf, int buflen);
 uint32 del_a_printer(const char *sharename);
 NT_DEVICEMODE *construct_nt_devicemode(const fstring default_devicename);
@@ -4862,14 +4867,20 @@ WERROR get_a_printer_search( Printer_entry *print_hnd,
                        uint32 level,
                        const char *sharename);
 uint32 free_a_printer(NT_PRINTER_INFO_LEVEL **pp_printer, uint32 level);
-uint32 add_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL driver, uint32 level);
-WERROR get_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL *driver, uint32_t level,
-                           const char *drivername, const char *architecture, uint32_t version);
-uint32 free_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL driver, uint32 level);
-bool printer_driver_in_use ( NT_PRINTER_DRIVER_INFO_LEVEL_3 *info_3 );
-bool printer_driver_files_in_use ( NT_PRINTER_DRIVER_INFO_LEVEL_3 *info );
+uint32_t add_a_printer_driver(TALLOC_CTX *mem_ctx,
+                             struct spoolss_AddDriverInfoCtr *r,
+                             char **driver_name,
+                             uint32_t *version);
+WERROR get_a_printer_driver(TALLOC_CTX *mem_ctx,
+                           struct spoolss_DriverInfo8 **driver_p,
+                           const char *drivername, const char *architecture,
+                           uint32_t version);
+uint32_t free_a_printer_driver(struct spoolss_DriverInfo8 *driver);
+bool printer_driver_in_use(const struct spoolss_DriverInfo8 *r);
+bool printer_driver_files_in_use(TALLOC_CTX *mem_ctx,
+                                struct spoolss_DriverInfo8 *r);
 WERROR delete_printer_driver(struct pipes_struct *rpc_pipe,
-                            NT_PRINTER_DRIVER_INFO_LEVEL_3 *info_3,
+                            const struct spoolss_DriverInfo8 *r,
                             uint32 version, bool delete_files );
 WERROR nt_printing_setsec(const char *sharename, SEC_DESC_BUF *secdesc_ctr);
 bool nt_printing_getsec(TALLOC_CTX *ctx, const char *sharename, SEC_DESC_BUF **secdesc_ctr);
@@ -5250,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);
@@ -5261,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);
@@ -5290,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);
@@ -5413,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  */
 
@@ -5561,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,
@@ -5587,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  */
 
@@ -6100,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  */
@@ -6265,9 +6286,7 @@ void error_packet_set(char *outbuf, uint8 eclass, uint32 ecode, NTSTATUS ntstatu
 int error_packet(char *outbuf, uint8 eclass, uint32 ecode, NTSTATUS ntstatus, int line, const char *file);
 void reply_nt_error(struct smb_request *req, NTSTATUS ntstatus,
                    int line, const char *file);
-void reply_force_nt_error(struct smb_request *req, NTSTATUS ntstatus,
-                         int line, const char *file);
-void reply_dos_error(struct smb_request *req, uint8 eclass, uint32 ecode,
+void reply_force_dos_error(struct smb_request *req, uint8 eclass, uint32 ecode,
                    int line, const char *file);
 void reply_both_error(struct smb_request *req, uint8 eclass, uint32 ecode,
                      NTSTATUS status, int line, const char *file);
@@ -6452,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,
@@ -6475,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,
@@ -6573,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);
@@ -6611,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,
@@ -6622,9 +6643,6 @@ void msg_file_was_renamed(struct messaging_context *msg,
                          uint32_t msg_type,
                          struct server_id server_id,
                          DATA_BLOB *data);
-struct case_semantics_state;
-struct case_semantics_state *set_posix_case_semantics(TALLOC_CTX *mem_ctx,
-                                                     connection_struct *conn);
 NTSTATUS open_streams_for_delete(connection_struct *conn,
                                 const char *fname);
 NTSTATUS create_file_default(connection_struct *conn,
@@ -6646,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  */
 
@@ -6728,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,
@@ -6750,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  */
 
@@ -6845,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);
@@ -6889,9 +6916,6 @@ void reply_printclose(struct smb_request *req);
 void reply_printqueue(struct smb_request *req);
 void reply_printwrite(struct smb_request *req);
 void reply_mkdir(struct smb_request *req);
-NTSTATUS rmdir_internals(TALLOC_CTX *ctx,
-                       connection_struct *conn,
-                       struct smb_filename *smb_dname);
 void reply_rmdir(struct smb_request *req);
 NTSTATUS rename_internals_fsp(connection_struct *conn,
                        files_struct *fsp,
@@ -7043,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);
@@ -7285,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,