Revert "s3: vfs: add user_vfs_evg to connection_struct"
[samba.git] / source3 / smbd / proto.h
index 2851d6d5f7df623eb51c575bf02c3f5c621c983b..eb35a94862ac82b249527d5a3475a4c0526d47ca 100644 (file)
@@ -146,6 +146,9 @@ NTSTATUS delete_all_streams(connection_struct *conn,
 bool recursive_rmdir(TALLOC_CTX *ctx,
                     connection_struct *conn,
                     struct smb_filename *smb_dname);
+bool has_other_nonposix_opens(struct share_mode_lock *lck,
+                             struct files_struct *fsp,
+                             struct server_id self);
 
 /* The following definitions come from smbd/conn.c  */
 
@@ -260,6 +263,11 @@ mode_t unix_mode(connection_struct *conn, int dosmode,
 uint32_t dos_mode_msdfs(connection_struct *conn,
                      const struct smb_filename *smb_fname);
 uint32_t dos_mode(connection_struct *conn, struct smb_filename *smb_fname);
+struct tevent_req *dos_mode_at_send(TALLOC_CTX *mem_ctx,
+                                   struct tevent_context *ev,
+                                   files_struct *dir_fsp,
+                                   struct smb_filename *smb_fname);
+NTSTATUS dos_mode_at_recv(struct tevent_req *req, uint32_t *dosmode);
 int file_set_dosmode(connection_struct *conn, struct smb_filename *smb_fname,
                     uint32_t dosmode, const char *parent_dir, bool newfile);
 NTSTATUS file_set_sparse(connection_struct *conn,
@@ -290,6 +298,10 @@ struct timespec get_change_timespec(connection_struct *conn,
                                struct files_struct *fsp,
                                const struct smb_filename *smb_fname);
 
+NTSTATUS parse_dos_attribute_blob(struct smb_filename *smb_fname,
+                                 DATA_BLOB blob,
+                                 uint32_t *pattr);
+
 /* The following definitions come from smbd/error.c  */
 
 bool use_nt_status(void);
@@ -353,6 +365,7 @@ NTSTATUS filename_convert(TALLOC_CTX *mem_ctx,
                        connection_struct *conn,
                        const char *name_in,
                        uint32_t ucf_flags,
+                       time_t *twrp,
                        bool *ppath_contains_wcard,
                        struct smb_filename **pp_smb_fname);
 NTSTATUS filename_convert_with_privilege(TALLOC_CTX *mem_ctx,
@@ -390,7 +403,6 @@ struct files_struct *file_find_one_fsp_from_lease_key(
        struct smbd_server_connection *sconn,
        const struct smb2_lease_key *lease_key);
 bool file_find_subpath(files_struct *dir_fsp);
-void file_sync_all(connection_struct *conn);
 void fsp_free(files_struct *fsp);
 void file_free(struct smb_request *req, files_struct *fsp);
 files_struct *file_fsp(struct smb_request *req, uint16_t fid);
@@ -586,7 +598,6 @@ int fam_watch(TALLOC_CTX *mem_ctx,
 
 struct notify_context *notify_init(
        TALLOC_CTX *mem_ctx, struct messaging_context *msg,
-       struct tevent_context *ev,
        struct smbd_server_connection *sconn,
        void (*callback)(struct smbd_server_connection *sconn,
                         void *, struct timespec,
@@ -632,6 +643,20 @@ NTSTATUS smbd_do_query_security_desc(connection_struct *conn,
                                        uint32_t max_data_count,
                                        uint8_t **ppmarshalled_sd,
                                        size_t *psd_size);
+#ifdef HAVE_SYS_QUOTAS
+
+struct smb2_query_quota_info;
+
+NTSTATUS smbd_do_query_getinfo_quota(TALLOC_CTX *mem_ctx,
+                                    files_struct *fsp,
+                                    bool restart_scan,
+                                    bool return_single,
+                                    uint32_t sid_list_length,
+                                    DATA_BLOB *sidbuffer,
+                                    uint32_t max_data_count,
+                                    uint8_t **p_data,
+                                    uint32_t *p_data_size);
+#endif
 void reply_nttrans(struct smb_request *req);
 void reply_nttranss(struct smb_request *req);
 
@@ -732,10 +757,6 @@ void message_to_share_mode_entry(struct file_id *id,
 bool init_oplocks(struct smbd_server_connection *sconn);
 void init_kernel_oplocks(struct smbd_server_connection *sconn);
 
-/* The following definitions come from smbd/oplock_irix.c  */
-
-struct kernel_oplocks *irix_init_kernel_oplocks(struct smbd_server_connection *sconn);
-
 /* The following definitions come from smbd/oplock_linux.c  */
 
 void linux_set_lease_capability(void);
@@ -1061,7 +1082,8 @@ void smbd_exit_server_cleanly(const char *const reason) _NORETURN_;
 
 bool set_conn_connectpath(connection_struct *conn, const char *connectpath);
 NTSTATUS set_conn_force_user_group(connection_struct *conn, int snum);
-bool set_current_service(connection_struct *conn, uint16_t flags, bool do_chdir);
+void set_current_case_sensitive(connection_struct *conn, uint16_t flags);
+bool chdir_current_service(connection_struct *conn);
 void load_registry_shares(void);
 int add_home_service(const char *service, const char *username, const char *homedir);
 int find_service(TALLOC_CTX *ctx, const char *service, char **p_service_out);
@@ -1189,12 +1211,19 @@ void reply_transs2(struct smb_request *req);
 
 /* The following definitions come from smbd/uid.c  */
 
+#define smbd_impersonate_debug_create(main_ev, name, dbg_lvl) \
+       _smbd_impersonate_debug_create(main_ev, name, dbg_lvl, __location__)
+struct tevent_context *_smbd_impersonate_debug_create(struct tevent_context *main_ev,
+                                                     const char *name,
+                                                     int dbg_lvl,
+                                                     const char *location);
 bool change_to_guest(void);
 NTSTATUS check_user_share_access(connection_struct *conn,
                                const struct auth_session_info *session_info,
                                uint32_t *p_share_access,
                                bool *p_readonly_share);
 bool change_to_user(connection_struct *conn, uint64_t vuid);
+bool change_to_user_by_fsp(struct files_struct *fsp);
 bool smbd_change_to_root_user(void);
 bool smbd_become_authenticated_pipe_user(struct auth_session_info *session_info);
 bool smbd_unbecome_authenticated_pipe_user(void);
@@ -1202,7 +1231,10 @@ void become_root(void);
 void unbecome_root(void);
 void smbd_become_root(void);
 void smbd_unbecome_root(void);
+bool become_guest(void);
+void unbecome_guest(void);
 bool become_user(connection_struct *conn, uint64_t vuid);
+bool become_user_by_fsp(struct files_struct *fsp);
 bool become_user_by_session(connection_struct *conn,
                            const struct auth_session_info *session_info);
 bool unbecome_user(void);
@@ -1212,6 +1244,17 @@ const struct security_unix_token *get_current_utok(connection_struct *conn);
 const struct security_token *get_current_nttok(connection_struct *conn);
 uint64_t get_current_vuid(connection_struct *conn);
 
+struct tevent_context *smbd_impersonate_conn_vuid_create(
+                               struct tevent_context *main_ev,
+                               struct connection_struct *conn,
+                               uint64_t vuid);
+struct tevent_context *smbd_impersonate_conn_sess_create(
+                               struct tevent_context *main_ev,
+                               struct connection_struct *conn,
+                               struct auth_session_info *session_info);
+struct tevent_context *smbd_impersonate_root_create(struct tevent_context *main_ev);
+struct tevent_context *smbd_impersonate_guest_create(struct tevent_context *main_ev);
+
 /* The following definitions come from smbd/utmp.c  */
 
 void sys_utmp_claim(const char *username, const char *hostname,