s3-spoolss: add rpccli_spoolss_getprinterdriver convenience wrapper.
[ira/wip.git] / source3 / include / proto.h
index 8726e9792717966ab03b85afe40dcfbba27d72f7..7f4907cd9674df9702646f8e672d236d5db19bf6 100644 (file)
@@ -40,6 +40,7 @@ NTSTATUS auth_builtin_init(void);
 
 NTSTATUS check_plaintext_password(const char *smb_name, DATA_BLOB plaintext_password, auth_serversupplied_info **server_info);
 bool password_ok(struct auth_context *actx, bool global_encrypted,
+                const char *session_workgroup,
                 const char *smb_name, DATA_BLOB password_blob);
 
 /* The following definitions come from auth/auth_domain.c  */
@@ -230,7 +231,8 @@ NTSTATUS pdb_default_add_aliasmem(struct pdb_methods *methods,
 NTSTATUS pdb_default_del_aliasmem(struct pdb_methods *methods,
                                  const DOM_SID *alias, const DOM_SID *member);
 NTSTATUS pdb_default_enum_aliasmem(struct pdb_methods *methods,
-                                  const DOM_SID *alias, DOM_SID **pp_members,
+                                  const DOM_SID *alias, TALLOC_CTX *mem_ctx,
+                                  DOM_SID **pp_members,
                                   size_t *p_num_members);
 NTSTATUS pdb_default_alias_memberships(struct pdb_methods *methods,
                                       TALLOC_CTX *mem_ctx,
@@ -464,6 +466,7 @@ void debug_message(struct messaging_context *msg_ctx, void *private_data, uint32
 void debug_init(void);
 void debug_register_msgs(struct messaging_context *msg_ctx);
 void setup_logging(const char *pname, bool interactive);
+void setup_logging_stdout( void );
 void debug_set_logfile(const char *name);
 bool reopen_logs( void );
 void force_check_log_size( void );
@@ -581,6 +584,7 @@ int nt_status_to_pam(NTSTATUS nt_status);
 
 pid_t pidfile_pid(const char *name);
 void pidfile_create(const char *program_name);
+void pidfile_unlink(void);
 
 /* The following definitions come from lib/popt_common.c  */
 
@@ -1415,6 +1419,16 @@ struct tevent_req *getaddrinfo_send(TALLOC_CTX *mem_ctx,
                                    const char *service,
                                    const struct addrinfo *hints);
 int getaddrinfo_recv(struct tevent_req *req, struct addrinfo **res);
+struct tevent_req *tstream_read_packet_send(TALLOC_CTX *mem_ctx,
+                                           struct tevent_context *ev,
+                                           struct tstream_context *stream,
+                                           size_t initial,
+                                           ssize_t (*more)(uint8_t *buf,
+                                                           size_t buflen,
+                                                           void *private_data),
+                                           void *private_data);
+ssize_t tstream_read_packet_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
+                                uint8_t **pbuf, int *perrno);
 
 /* The following definitions come from lib/util_str.c  */
 
@@ -2246,7 +2260,7 @@ bool cli_dfs_get_referral(TALLOC_CTX *ctx,
                        const char *path,
                        CLIENT_DFS_REFERRAL**refs,
                        size_t *num_refs,
-                       uint16 *consumed);
+                       size_t *consumed);
 bool cli_resolve_path(TALLOC_CTX *ctx,
                        const char *mountpt,
                        const struct user_auth_info *dfs_auth_info,
@@ -2493,7 +2507,13 @@ struct tevent_req *cli_close_send(TALLOC_CTX *mem_ctx,
                                  struct cli_state *cli, uint16_t fnum);
 NTSTATUS cli_close_recv(struct tevent_req *req);
 NTSTATUS cli_close(struct cli_state *cli, uint16_t fnum);
-bool cli_ftruncate(struct cli_state *cli, uint16_t fnum, uint64_t size);
+struct tevent_req *cli_ftruncate_send(TALLOC_CTX *mem_ctx,
+                                       struct event_context *ev,
+                                       struct cli_state *cli,
+                                       uint16_t fnum,
+                                       uint64_t size);
+NTSTATUS cli_ftruncate_recv(struct tevent_req *req);
+NTSTATUS cli_ftruncate(struct cli_state *cli, uint16_t fnum, uint64_t size);
 NTSTATUS cli_locktype(struct cli_state *cli, uint16_t fnum,
                      uint32_t offset, uint32_t len,
                      int timeout, unsigned char locktype);
@@ -2574,7 +2594,19 @@ struct tevent_req *cli_dskattr_send(TALLOC_CTX *mem_ctx,
 NTSTATUS cli_dskattr_recv(struct tevent_req *req, int *bsize, int *total,
                          int *avail);
 NTSTATUS cli_dskattr(struct cli_state *cli, int *bsize, int *total, int *avail);
-int cli_ctemp(struct cli_state *cli, const char *path, char **tmp_path);
+struct tevent_req *cli_ctemp_send(TALLOC_CTX *mem_ctx,
+                               struct event_context *ev,
+                               struct cli_state *cli,
+                               const char *path);
+NTSTATUS cli_ctemp_recv(struct tevent_req *req,
+                       TALLOC_CTX *ctx,
+                       uint16_t *pfnum,
+                       char **outfile);
+NTSTATUS cli_ctemp(struct cli_state *cli,
+                       TALLOC_CTX *ctx,
+                       const char *path,
+                       uint16_t *pfnum,
+                       char **out_path);
 NTSTATUS cli_raw_ioctl(struct cli_state *cli, uint16_t fnum, uint32_t code, DATA_BLOB *blob);
 bool cli_set_ea_path(struct cli_state *cli, const char *path, const char *ea_name, const char *ea_val, size_t ea_len);
 bool cli_set_ea_fnum(struct cli_state *cli, uint16_t fnum, const char *ea_name, const char *ea_val, size_t ea_len);
@@ -3487,7 +3519,6 @@ bool release_posix_lock_posix_flavour(files_struct *fsp,
 
 /* The following definitions come from modules/vfs_default.c  */
 
-int vfswrap_lstat(vfs_handle_struct *handle,  const char *path, SMB_STRUCT_STAT *sbuf);
 ssize_t vfswrap_llistxattr(struct vfs_handle_struct *handle, const char *path, char *list, size_t size);
 ssize_t vfswrap_flistxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size);
 NTSTATUS vfs_default_init(void);
@@ -4540,7 +4571,7 @@ NTSTATUS pdb_get_aliasinfo(const DOM_SID *sid, struct acct_info *info);
 NTSTATUS pdb_set_aliasinfo(const DOM_SID *sid, struct acct_info *info);
 NTSTATUS pdb_add_aliasmem(const DOM_SID *alias, const DOM_SID *member);
 NTSTATUS pdb_del_aliasmem(const DOM_SID *alias, const DOM_SID *member);
-NTSTATUS pdb_enum_aliasmem(const DOM_SID *alias,
+NTSTATUS pdb_enum_aliasmem(const DOM_SID *alias, TALLOC_CTX *mem_ctx,
                           DOM_SID **pp_members, size_t *p_num_members);
 NTSTATUS pdb_enum_alias_memberships(TALLOC_CTX *mem_ctx,
                                    const DOM_SID *domain_sid,
@@ -4565,7 +4596,7 @@ bool pdb_uid_to_sid(uid_t uid, DOM_SID *sid);
 bool pdb_gid_to_sid(gid_t gid, DOM_SID *sid);
 bool pdb_sid_to_id(const DOM_SID *sid, union unid_t *id,
                   enum lsa_SidType *type);
-bool pdb_rid_algorithm(void);
+uint32_t pdb_capabilities(void);
 bool pdb_new_rid(uint32 *rid);
 bool initialize_password_db(bool reload, struct event_context *event_ctx);
 struct pdb_search *pdb_search_init(TALLOC_CTX *mem_ctx,
@@ -5402,6 +5433,13 @@ WERROR rpccli_spoolss_openprinter_ex(struct rpc_pipe_client *cli,
                                     const char *printername,
                                     uint32_t access_desired,
                                     struct policy_handle *handle);
+WERROR rpccli_spoolss_getprinterdriver(struct rpc_pipe_client *cli,
+                                      TALLOC_CTX *mem_ctx,
+                                      struct policy_handle *handle,
+                                      const char *architecture,
+                                      uint32_t level,
+                                      uint32_t offered,
+                                      union spoolss_DriverInfo *info);
 WERROR rpccli_spoolss_getprinterdriver2(struct rpc_pipe_client *cli,
                                        TALLOC_CTX *mem_ctx,
                                        struct policy_handle *handle,
@@ -5533,88 +5571,14 @@ void init_lsa_AsciiStringLarge(struct lsa_AsciiStringLarge *name, const char *s)
 
 /* The following definitions come from rpc_client/init_netlogon.c  */
 
-void init_netr_SamBaseInfo(struct netr_SamBaseInfo *r,
-                          NTTIME last_logon,
-                          NTTIME last_logoff,
-                          NTTIME acct_expiry,
-                          NTTIME last_password_change,
-                          NTTIME allow_password_change,
-                          NTTIME force_password_change,
-                          const char *account_name,
-                          const char *full_name,
-                          const char *logon_script,
-                          const char *profile_path,
-                          const char *home_directory,
-                          const char *home_drive,
-                          uint16_t logon_count,
-                          uint16_t bad_password_count,
-                          uint32_t rid,
-                          uint32_t primary_gid,
-                          struct samr_RidWithAttributeArray groups,
-                          uint32_t user_flags,
-                          struct netr_UserSessionKey key,
-                          const char *logon_server,
-                          const char *domain,
-                          struct dom_sid2 *domain_sid,
-                          struct netr_LMSessionKey LMSessKey,
-                          uint32_t acct_flags);
-void init_netr_SamInfo3(struct netr_SamInfo3 *r,
-                       NTTIME last_logon,
-                       NTTIME last_logoff,
-                       NTTIME acct_expiry,
-                       NTTIME last_password_change,
-                       NTTIME allow_password_change,
-                       NTTIME force_password_change,
-                       const char *account_name,
-                       const char *full_name,
-                       const char *logon_script,
-                       const char *profile_path,
-                       const char *home_directory,
-                       const char *home_drive,
-                       uint16_t logon_count,
-                       uint16_t bad_password_count,
-                       uint32_t rid,
-                       uint32_t primary_gid,
-                       struct samr_RidWithAttributeArray groups,
-                       uint32_t user_flags,
-                       struct netr_UserSessionKey key,
-                       const char *logon_server,
-                       const char *domain,
-                       struct dom_sid2 *domain_sid,
-                       struct netr_LMSessionKey LMSessKey,
-                       uint32_t acct_flags,
-                       uint32_t sidcount,
-                       struct netr_SidAttr *sids);
+NTSTATUS serverinfo_to_SamInfo2(struct auth_serversupplied_info *server_info,
+                               uint8_t *pipe_session_key,
+                               size_t pipe_session_key_len,
+                               struct netr_SamInfo2 *sam2);
 NTSTATUS serverinfo_to_SamInfo3(struct auth_serversupplied_info *server_info,
                                uint8_t *pipe_session_key,
                                size_t pipe_session_key_len,
                                struct netr_SamInfo3 *sam3);
-void init_netr_IdentityInfo(struct netr_IdentityInfo *r,
-                           const char *domain_name,
-                           uint32_t parameter_control,
-                           uint32_t logon_id_low,
-                           uint32_t logon_id_high,
-                           const char *account_name,
-                           const char *workstation);
-void init_netr_NetworkInfo(struct netr_NetworkInfo *r,
-                          const char *domain_name,
-                          uint32_t parameter_control,
-                          uint32_t logon_id_low,
-                          uint32_t logon_id_high,
-                          const char *account_name,
-                          const char *workstation,
-                          uint8_t challenge[8],
-                          struct netr_ChallengeResponse nt,
-                          struct netr_ChallengeResponse lm);
-void init_netr_PasswordInfo(struct netr_PasswordInfo *r,
-                           const char *domain_name,
-                           uint32_t parameter_control,
-                           uint32_t logon_id_low,
-                           uint32_t logon_id_high,
-                           const char *account_name,
-                           const char *workstation,
-                           struct samr_Password lmpassword,
-                           struct samr_Password ntpassword);
 void init_netr_CryptPassword(const char *pwd,
                             unsigned char session_key[16],
                             struct netr_CryptPassword *pwd_buf);
@@ -6155,16 +6119,18 @@ NTSTATUS delete_all_streams(connection_struct *conn, const char *fname);
 
 /* The following definitions come from smbd/conn.c  */
 
-void conn_init(void);
-int conn_num_open(void);
+void conn_init(struct smbd_server_connection *sconn);
+int conn_num_open(struct smbd_server_connection *sconn);
 bool conn_snum_used(int snum);
-connection_struct *conn_find(unsigned cnum);
-connection_struct *conn_new(void);
-bool conn_close_all(void);
-bool conn_idle_all(time_t t);
-void conn_clear_vuid_caches(uint16 vuid);
+connection_struct *conn_find(struct smbd_server_connection *sconn,
+                            unsigned cnum);
+connection_struct *conn_new(struct smbd_server_connection *sconn);
+bool conn_close_all(struct smbd_server_connection *sconn);
+bool conn_idle_all(struct smbd_server_connection *sconn, time_t t);
+void conn_clear_vuid_caches(struct smbd_server_connection *sconn, uint16 vuid);
 void conn_free_internal(connection_struct *conn);
-void conn_free(connection_struct *conn);
+void conn_free(struct smbd_server_connection *sconn,
+              connection_struct *conn);
 void msg_force_tdis(struct messaging_context *msg,
                    void *private_data,
                    uint32_t msg_type,
@@ -6268,15 +6234,15 @@ bool smbd_setup_mdns_registration(struct tevent_context *ev,
 
 mode_t unix_mode(connection_struct *conn, int dosmode, const char *fname,
                 const char *inherit_from_dir);
-uint32 dos_mode_msdfs(connection_struct *conn, const char *path,SMB_STRUCT_STAT *sbuf);
+uint32 dos_mode_msdfs(connection_struct *conn, const char *path, const SMB_STRUCT_STAT *sbuf);
 int dos_attributes_to_stat_dos_flags(uint32_t dosmode);
-uint32 dos_mode(connection_struct *conn, const char *path,SMB_STRUCT_STAT *sbuf);
+uint32 dos_mode(connection_struct *conn, const char *path, const SMB_STRUCT_STAT *sbuf);
 int file_set_dosmode(connection_struct *conn, const char *fname,
                     uint32 dosmode, SMB_STRUCT_STAT *st,
                     const char *parent_dir,
                     bool newfile);
 int file_ntimes(connection_struct *conn, const char *fname,
-               struct smb_file_time *ft);
+               struct smb_file_time *ft, const SMB_STRUCT_STAT *psbuf);
 bool set_sticky_write_time_path(connection_struct *conn, const char *fname,
                         struct file_id fileid, const struct timespec mtime);
 bool set_sticky_write_time_fsp(struct files_struct *fsp, const struct timespec mtime);
@@ -6313,11 +6279,15 @@ NTSTATUS close_fake_file(struct smb_request *req, files_struct *fsp);
 /* The following definitions come from smbd/file_access.c  */
 
 bool can_access_file_acl(struct connection_struct *conn,
-                               const char * fname,
-                               uint32_t access_mask);
-bool can_delete_file_in_directory(connection_struct *conn, const char *fname);
-bool can_access_file_data(connection_struct *conn, const char *fname, SMB_STRUCT_STAT *psbuf, uint32 access_mask);
-bool can_write_to_file(connection_struct *conn, const char *fname, SMB_STRUCT_STAT *psbuf);
+                        const struct smb_filename *smb_fname,
+                        uint32_t access_mask);
+bool can_delete_file_in_directory(connection_struct *conn,
+                                 struct smb_filename *smb_fname);
+bool can_access_file_data(connection_struct *conn,
+                         const struct smb_filename *smb_fname,
+                         uint32 access_mask);
+bool can_write_to_file(connection_struct *conn,
+                      const struct smb_filename *smb_fname);
 bool directory_has_default_acl(connection_struct *conn, const char *fname);
 
 /* The following definitions come from smbd/fileio.c  */
@@ -6340,6 +6310,22 @@ int fsp_stat(files_struct *fsp, SMB_STRUCT_STAT *pst);
 
 NTSTATUS get_full_smb_filename(TALLOC_CTX *ctx, const struct smb_filename *smb_fname,
                              char **full_name);
+NTSTATUS create_synthetic_smb_fname(TALLOC_CTX *ctx, const char *base_name,
+                                   const char *stream_name,
+                                   const SMB_STRUCT_STAT *psbuf,
+                                   struct smb_filename **smb_fname_out);
+NTSTATUS create_synthetic_smb_fname_split(TALLOC_CTX *ctx,
+                                         const char *fname,
+                                         const SMB_STRUCT_STAT *psbuf,
+                                         struct smb_filename **smb_fname_out);
+int vfs_stat_smb_fname(struct connection_struct *conn, const char *fname,
+                      SMB_STRUCT_STAT *psbuf);
+int vfs_lstat_smb_fname(struct connection_struct *conn, const char *fname,
+                       SMB_STRUCT_STAT *psbuf);
+const char *smb_fname_str_dbg(const struct smb_filename *smb_fname);
+NTSTATUS copy_smb_filename(TALLOC_CTX *ctx,
+                          const struct smb_filename *smb_fname_in,
+                          struct smb_filename **smb_fname_out);
 NTSTATUS unix_convert(TALLOC_CTX *ctx,
                      connection_struct *conn,
                      const char *orig_path,
@@ -6349,6 +6335,12 @@ NTSTATUS check_name(connection_struct *conn, const char *name);
 int get_real_filename(connection_struct *conn, const char *path,
                      const char *name, TALLOC_CTX *mem_ctx,
                      char **found_name);
+NTSTATUS filename_convert(TALLOC_CTX *mem_ctx,
+                       connection_struct *conn,
+                       bool dfs_path,
+                       const char *name_in,
+                       struct smb_filename **pp_smb_fname,
+                       char **pp_name);
 
 /* The following definitions come from smbd/files.c  */
 
@@ -6427,7 +6419,7 @@ const struct mangle_fns *posix_mangle_init(void);
 
 /* The following definitions come from smbd/map_username.c  */
 
-bool map_username(fstring user);
+bool map_username(struct smbd_server_connection *sconn, fstring user);
 
 /* The following definitions come from smbd/message.c  */
 
@@ -6481,14 +6473,22 @@ void reply_negprot(struct smb_request *req);
 /* The following definitions come from smbd/notify.c  */
 
 void change_notify_reply(connection_struct *conn,
-                        struct smb_request *req, uint32 max_param,
-                        struct notify_change_buf *notify_buf);
+                        struct smb_request *req,
+                        NTSTATUS error_code,
+                        uint32_t max_param,
+                        struct notify_change_buf *notify_buf,
+                        void (*reply_fn)(struct smb_request *req,
+                               NTSTATUS error_code,
+                               uint8_t *buf, size_t len));
 NTSTATUS change_notify_create(struct files_struct *fsp, uint32 filter,
                              bool recursive);
 NTSTATUS change_notify_add_request(struct smb_request *req,
                                uint32 max_param,
                                uint32 filter, bool recursive,
-                               struct files_struct *fsp);
+                               struct files_struct *fsp,
+                               void (*reply_fn)(struct smb_request *req,
+                                       NTSTATUS error_code,
+                                       uint8_t *buf, size_t len));
 void remove_pending_change_notify_requests_by_mid(uint16 mid);
 void remove_pending_change_notify_requests_by_fid(files_struct *fsp,
                                                  NTSTATUS status);
@@ -6547,6 +6547,8 @@ void send_nt_replies(connection_struct *conn,
                     char *params, int paramsize,
                     char *pdata, int datasize);
 bool is_ntfs_stream_name(const char *fname);
+bool is_ntfs_stream_smb_fname(const struct smb_filename *smb_fname);
+bool is_ntfs_default_stream_smb_fname(const struct smb_filename *smb_fname);
 void reply_ntcreate_and_X(struct smb_request *req);
 void reply_ntcancel(struct smb_request *req);
 void reply_ntrename(struct smb_request *req);
@@ -6572,7 +6574,6 @@ bool is_stat_open(uint32 access_mask);
 bool request_timed_out(struct timeval request_time,
                       struct timeval timeout);
 bool open_match_attributes(connection_struct *conn,
-                          const char *path,
                           uint32 old_dos_attr,
                           uint32 new_dos_attr,
                           mode_t existing_unx_mode,
@@ -6597,7 +6598,8 @@ NTSTATUS open_file_fchmod(struct smb_request *req, connection_struct *conn,
                          const char *fname,
                          SMB_STRUCT_STAT *psbuf, files_struct **result);
 NTSTATUS close_file_fchmod(struct smb_request *req, files_struct *fsp);
-NTSTATUS create_directory(connection_struct *conn, struct smb_request *req, const char *directory);
+NTSTATUS create_directory(connection_struct *conn, struct smb_request *req,
+                         struct smb_filename *smb_dname);
 void msg_file_was_renamed(struct messaging_context *msg,
                          void *private_data,
                          uint32_t msg_type,
@@ -6611,8 +6613,7 @@ NTSTATUS open_streams_for_delete(connection_struct *conn,
 NTSTATUS create_file_default(connection_struct *conn,
                             struct smb_request *req,
                             uint16_t root_dir_fid,
-                            const char *fname,
-                            uint32_t create_file_flags,
+                            struct smb_filename * smb_fname,
                             uint32_t access_mask,
                             uint32_t share_access,
                             uint32_t create_disposition,
@@ -6624,12 +6625,11 @@ NTSTATUS create_file_default(connection_struct *conn,
                             struct ea_list *ea_list,
 
                             files_struct **result,
-                            int *pinfo,
-                            SMB_STRUCT_STAT *psbuf);
+                            int *pinfo);
 NTSTATUS get_relative_fid_filename(connection_struct *conn,
                                   struct smb_request *req,
                                   uint16_t root_dir_fid,
-                                  const char *fname, char **new_fname);
+                                  struct smb_filename *smb_fname);
 
 /* The following definitions come from smbd/oplock.c  */
 
@@ -6672,22 +6672,29 @@ struct kernel_oplocks *onefs_init_kernel_oplocks(TALLOC_CTX *mem_ctx);
 
 /* The following definitions come from smbd/password.c  */
 
-user_struct *get_valid_user_struct(uint16 vuid);
-bool is_partial_auth_vuid(uint16 vuid);
-user_struct *get_partial_auth_user_struct(uint16 vuid);
-void invalidate_vuid(uint16 vuid);
-void invalidate_all_vuids(void);
-int register_initial_vuid(void);
-int register_existing_vuid(uint16 vuid,
+user_struct *get_valid_user_struct(struct smbd_server_connection *sconn,
+                                  uint16 vuid);
+bool is_partial_auth_vuid(struct smbd_server_connection *sconn, uint16 vuid);
+user_struct *get_partial_auth_user_struct(struct smbd_server_connection *sconn,
+                                         uint16 vuid);
+void invalidate_vuid(struct smbd_server_connection *sconn, uint16 vuid);
+void invalidate_all_vuids(struct smbd_server_connection *sconn);
+int register_initial_vuid(struct smbd_server_connection *sconn);
+int register_existing_vuid(struct smbd_server_connection *sconn,
+                       uint16 vuid,
                        auth_serversupplied_info *server_info,
                        DATA_BLOB response_blob,
                        const char *smb_name);
-void add_session_user(const char *user);
-void add_session_workgroup(const char *workgroup);
-const char *get_session_workgroup(void);
-bool user_in_netgroup(const char *user, const char *ngname);
-bool user_in_list(const char *user,const char **list);
-bool authorise_login(int snum, fstring user, DATA_BLOB password,
+void add_session_user(struct smbd_server_connection *sconn, const char *user);
+void add_session_workgroup(struct smbd_server_connection *sconn,
+                          const char *workgroup);
+const char *get_session_workgroup(struct smbd_server_connection *sconn);
+bool user_in_netgroup(struct smbd_server_connection *sconn,
+                     const char *user, const char *ngname);
+bool user_in_list(struct smbd_server_connection *sconn,
+                 const char *user,const char **list);
+bool authorise_login(struct smbd_server_connection *sconn,
+                    int snum, fstring user, DATA_BLOB password,
                     bool *guest);
 
 /* The following definitions come from smbd/pipes.c  */
@@ -6885,8 +6892,8 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx,
 void reply_mv(struct smb_request *req);
 NTSTATUS copy_file(TALLOC_CTX *ctx,
                        connection_struct *conn,
-                       const char *src,
-                       const char *dest1,
+                       struct smb_filename *smb_fname_src,
+                       struct smb_filename *smb_fname_dst,
                        int ofun,
                        int count,
                        bool target_is_directory);
@@ -6949,10 +6956,17 @@ bool set_current_service(connection_struct *conn, uint16 flags, bool do_chdir);
 void load_registry_shares(void);
 int add_home_service(const char *service, const char *username, const char *homedir);
 int find_service(fstring service);
-connection_struct *make_connection(const char *service_in, DATA_BLOB password, 
+connection_struct *make_connection_snum(struct smbd_server_connection *sconn,
+                                       int snum, user_struct *vuser,
+                                       DATA_BLOB password,
+                                       const char *pdev,
+                                       NTSTATUS *pstatus);
+connection_struct *make_connection(struct smbd_server_connection *sconn,
+                                  const char *service_in, DATA_BLOB password,
                                   const char *pdev, uint16 vuid,
                                   NTSTATUS *status);
-void close_cnum(connection_struct *conn, uint16 vuid);
+void close_cnum(struct smbd_server_connection *sconn,
+               connection_struct *conn, uint16 vuid);
 
 /* The following definitions come from smbd/session.c  */
 
@@ -7017,7 +7031,8 @@ NTSTATUS get_ea_value(TALLOC_CTX *mem_ctx, connection_struct *conn,
 NTSTATUS get_ea_names_from_file(TALLOC_CTX *mem_ctx, connection_struct *conn,
                                files_struct *fsp, const char *fname,
                                char ***pnames, size_t *pnum_names);
-NTSTATUS set_ea(connection_struct *conn, files_struct *fsp, const char *fname, struct ea_list *ea_list);
+NTSTATUS set_ea(connection_struct *conn, files_struct *fsp,
+               const struct smb_filename *smb_fname, struct ea_list *ea_list);
 struct ea_list *read_ea_list_entry(TALLOC_CTX *ctx, const char *pdata, size_t data_size, size_t *pbytes_used);
 void send_trans2_replies(connection_struct *conn,
                        struct smb_request *req,
@@ -7029,8 +7044,8 @@ void send_trans2_replies(connection_struct *conn,
 unsigned char *create_volume_objectid(connection_struct *conn, unsigned char objid[16]);
 NTSTATUS hardlink_internals(TALLOC_CTX *ctx,
                connection_struct *conn,
-               const char *oldname_in,
-               const char *newname_in);
+               const struct smb_filename *smb_fname_old,
+               const struct smb_filename *smb_fname_new);
 NTSTATUS smb_set_file_time(connection_struct *conn,
                           files_struct *fsp,
                           const char *fname,
@@ -7081,9 +7096,7 @@ void vfs_remove_fsp_extension(vfs_handle_struct *handle, files_struct *fsp);
 void *vfs_memctx_fsp_extension(vfs_handle_struct *handle, files_struct *fsp);
 void *vfs_fetch_fsp_extension(vfs_handle_struct *handle, files_struct *fsp);
 bool smbd_vfs_init(connection_struct *conn);
-bool vfs_directory_exist(connection_struct *conn, const char *dname, SMB_STRUCT_STAT *st);
-bool vfs_object_exist(connection_struct *conn,const char *fname,SMB_STRUCT_STAT *sbuf);
-bool vfs_file_exist(connection_struct *conn, const char *fname,SMB_STRUCT_STAT *sbuf);
+NTSTATUS vfs_file_exist(connection_struct *conn, struct smb_filename *smb_fname);
 ssize_t vfs_read_data(files_struct *fsp, char *buf, size_t byte_count);
 ssize_t vfs_pread_data(files_struct *fsp, char *buf,
                 size_t byte_count, SMB_OFF_T offset);