smbd: Make find_share_mode_lease() static
[kai/samba-autobuild/.git] / source3 / smbd / proto.h
index 2a41d9d..a5c55c6 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  */
 
@@ -261,7 +264,7 @@ 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 smb_vfs_ev_glue *evg,
+                                   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);
@@ -362,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,
@@ -399,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);
@@ -539,7 +542,9 @@ void change_notify_reply(struct smb_request *req,
 void notify_callback(struct smbd_server_connection *sconn,
                     void *private_data, struct timespec when,
                     const struct notify_event *e);
-NTSTATUS change_notify_create(struct files_struct *fsp, uint32_t filter,
+NTSTATUS change_notify_create(struct files_struct *fsp,
+                             uint32_t max_buffer_size,
+                             uint32_t filter,
                              bool recursive);
 NTSTATUS change_notify_add_request(struct smb_request *req,
                                uint32_t max_param,
@@ -686,13 +691,16 @@ void msg_file_was_renamed(struct messaging_context *msg,
                          uint32_t msg_type,
                          struct server_id server_id,
                          DATA_BLOB *data);
-int find_share_mode_lease(struct share_mode_data *d,
-                         const struct GUID *client_guid,
-                         const struct smb2_lease_key *key);
 struct share_mode_lease;
-struct fsp_lease *find_fsp_lease(files_struct *new_fsp,
+NTSTATUS update_share_mode_lease_from_db(
+       struct share_mode_data *d,
+       const struct GUID *client_guid,
+       const struct smb2_lease_key *lease_key);
+struct fsp_lease *find_fsp_lease(struct files_struct *new_fsp,
                                 const struct smb2_lease_key *key,
-                                const struct share_mode_lease *l);
+                                uint32_t current_state,
+                                uint16_t lease_version,
+                                uint16_t lease_epoch);
 NTSTATUS create_file_default(connection_struct *conn,
                             struct smb_request *req,
                             uint16_t root_dir_fid,
@@ -1208,12 +1216,6 @@ 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,
@@ -1228,8 +1230,6 @@ 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,
@@ -1241,30 +1241,6 @@ 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);
-
-struct pthreadpool_tevent *smbd_impersonate_tp_current_create(
-                               TALLOC_CTX *mem_ctx,
-                               struct pthreadpool_tevent *sync_tp,
-                               struct connection_struct *conn,
-                               uint64_t vuid, bool chdir_safe,
-                               const struct security_unix_token *unix_token);
-struct pthreadpool_tevent *smbd_impersonate_tp_become_create(
-                                       TALLOC_CTX *mem_ctx,
-                                       struct pthreadpool_tevent *sync_tp,
-                                       bool chdir_safe,
-                                       void (*become_fn)(void),
-                                       void (*unbecome_fn)(void));
-
 /* The following definitions come from smbd/utmp.c  */
 
 void sys_utmp_claim(const char *username, const char *hostname,