Fix bug #7155 - valgrind Conditional jump or move depends on uninitialised value...
[ira/wip.git] / source3 / smbd / globals.h
index 338398968a05fbd54252e7830f9130c550085a8f..3cc967f4fd3164bb4ae8599e4b01307a14a66f8e 100644 (file)
@@ -131,7 +131,6 @@ extern int conn_ctx_stack_ndx;
 struct vfs_init_function_entry;
 extern struct vfs_init_function_entry *backends;
 extern char *sparse_buf;
-extern char *LastDir;
 
 /* Current number of oplocks we have outstanding. */
 extern int32_t exclusive_oplocks_open;
@@ -184,7 +183,7 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn,
                               TALLOC_CTX *mem_ctx,
                               uint16_t info_level,
                               files_struct *fsp,
-                              const struct smb_filename *smb_fname,
+                              struct smb_filename *smb_fname,
                               bool delete_pending,
                               struct timespec write_time_ts,
                               bool ms_dfs_link,
@@ -234,6 +233,35 @@ bool smbd_dirptr_get_entry(TALLOC_CTX *ctx,
                           uint32_t *_mode,
                           long *_prev_offset);
 
+bool smbd_dirptr_lanman2_entry(TALLOC_CTX *ctx,
+                              connection_struct *conn,
+                              struct dptr_struct *dirptr,
+                              uint16 flags2,
+                              const char *path_mask,
+                              uint32 dirtype,
+                              int info_level,
+                              int requires_resume_key,
+                              bool dont_descend,
+                              bool ask_sharemode,
+                              uint8_t align,
+                              bool do_pad,
+                              char **ppdata,
+                              char *base_data,
+                              char *end_data,
+                              int space_remaining,
+                              bool *out_of_space,
+                              bool *got_exact_match,
+                              int *_last_entry_off,
+                              struct ea_list *name_list);
+
+NTSTATUS smbd_check_open_rights(struct connection_struct *conn,
+                               const struct smb_filename *smb_fname,
+                               uint32_t access_mask,
+                               uint32_t *access_granted);
+
+void smbd_notify_cancel_by_smbreq(struct smbd_server_connection *sconn,
+                                 const struct smb_request *smbreq);
+
 void smbd_server_connection_terminate_ex(struct smbd_server_connection *sconn,
                                         const char *reason,
                                         const char *location);
@@ -243,7 +271,7 @@ void smbd_server_connection_terminate_ex(struct smbd_server_connection *sconn,
 bool smbd_is_smb2_header(const uint8_t *inbuf, size_t size);
 
 void reply_smb2002(struct smb_request *req, uint16_t choice);
-void smbd_smb2_first_negprot(struct smbd_server_connection *conn,
+void smbd_smb2_first_negprot(struct smbd_server_connection *sconn,
                             const uint8_t *inbuf, size_t size);
 
 NTSTATUS smbd_smb2_request_error_ex(struct smbd_smb2_request *req,
@@ -264,7 +292,8 @@ NTSTATUS smbd_smb2_send_oplock_break(struct smbd_server_connection *sconn,
                                     uint64_t file_id_volatile,
                                     uint8_t oplock_level);
 
-NTSTATUS smbd_smb2_request_pending_queue(struct smbd_smb2_request *req);
+NTSTATUS smbd_smb2_request_pending_queue(struct smbd_smb2_request *req,
+                                        struct tevent_req *subreq);
 
 NTSTATUS smbd_smb2_request_check_session(struct smbd_smb2_request *req);
 NTSTATUS smbd_smb2_request_check_tcon(struct smbd_smb2_request *req);
@@ -296,7 +325,7 @@ struct smbd_smb2_request {
        TALLOC_CTX *mem_pool;
        struct smbd_smb2_request **parent;
 
-       struct smbd_server_connection *conn;
+       struct smbd_server_connection *sconn;
 
        /* the session the request operates on, maybe NULL */
        struct smbd_smb2_session *session;
@@ -311,6 +340,12 @@ struct smbd_smb2_request {
 
        NTSTATUS next_status;
 
+       /*
+        * The sub request for async backend calls.
+        * This is used for SMB2 Cancel.
+        */
+       struct tevent_req *subreq;
+
        struct {
                /* the NBT header is not allocated */
                uint8_t nbt_hdr[4];
@@ -361,7 +396,7 @@ struct smbd_server_connection;
 
 struct smbd_smb2_session {
        struct smbd_smb2_session *prev, *next;
-       struct smbd_server_connection *conn;
+       struct smbd_server_connection *sconn;
        NTSTATUS status;
        uint64_t vuid;
        AUTH_NTLMSSP_STATE *auth_ntlmssp_state;