s3: VFS: Default. Move vfs_read_data() out of source3/smbd/vfs.c to the printing...
[kai/samba-autobuild/.git] / source3 / smbd / proto.h
index 88ba6f9d3e48bfc8b5a73e48257d4ce2c820fd67..81350469c28e1ce771fa5ee6b47d48b8779aa3f2 100644 (file)
@@ -207,7 +207,6 @@ int dptr_dnum(struct dptr_struct *dptr);
 bool dptr_get_priv(struct dptr_struct *dptr);
 void dptr_set_priv(struct dptr_struct *dptr);
 bool dptr_SearchDir(struct dptr_struct *dptr, const char *name, long *poffset, SMB_STRUCT_STAT *pst);
-void dptr_init_search_op(struct dptr_struct *dptr);
 bool dptr_fill(struct smbd_server_connection *sconn,
               char *buf1,unsigned int key);
 struct dptr_struct *dptr_fetch(struct smbd_server_connection *sconn,
@@ -345,7 +344,8 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
                      const char *orig_path,
                      struct smb_filename **smb_fname,
                      uint32_t ucf_flags);
-NTSTATUS check_name(connection_struct *conn, const char *name);
+NTSTATUS check_name(connection_struct *conn,
+                       const struct smb_filename *smb_fname);
 int get_real_filename(connection_struct *conn, const char *path,
                      const char *name, TALLOC_CTX *mem_ctx,
                      char **found_name);
@@ -468,8 +468,7 @@ void reply_sendend(struct smb_request *req);
 /* The following definitions come from smbd/msdfs.c  */
 
 bool is_msdfs_link(connection_struct *conn,
-               const char *path,
-               SMB_STRUCT_STAT *sbufp);
+               struct smb_filename *smb_fname);
 struct junction_map;
 NTSTATUS get_referred_path(TALLOC_CTX *ctx,
                           const char *dfs_path,
@@ -511,7 +510,7 @@ NTSTATUS create_conn_struct_cwd(TALLOC_CTX *ctx,
                                int snum,
                                const char *path,
                                const struct auth_session_info *session_info,
-                               char **poldcwd);
+                               struct smb_filename **poldcwd_fname);
 
 /* The following definitions come from smbd/negprot.c  */
 
@@ -650,14 +649,11 @@ NTSTATUS fd_close(files_struct *fsp);
 void change_file_owner_to_parent(connection_struct *conn,
                                 const char *inherit_from_dir,
                                 files_struct *fsp);
-NTSTATUS change_dir_owner_to_parent(connection_struct *conn,
-                                   const char *inherit_from_dir,
-                                   const char *fname,
-                                   SMB_STRUCT_STAT *psbuf);
 bool is_stat_open(uint32_t access_mask);
 NTSTATUS send_break_message(struct messaging_context *msg_ctx,
-                               const struct share_mode_entry *exclusive,
-                               uint16_t break_to);
+                           const struct file_id *id,
+                           const struct share_mode_entry *exclusive,
+                           uint16_t break_to);
 struct deferred_open_record;
 bool is_deferred_open_async(const struct deferred_open_record *rec);
 NTSTATUS create_directory(connection_struct *conn, struct smb_request *req,
@@ -727,8 +723,11 @@ void smbd_contend_level2_oplocks_begin(files_struct *fsp,
                                  enum level2_contention_type type);
 void smbd_contend_level2_oplocks_end(files_struct *fsp,
                                enum level2_contention_type type);
-void share_mode_entry_to_message(char *msg, const struct share_mode_entry *e);
-void message_to_share_mode_entry(struct share_mode_entry *e, const char *msg);
+void share_mode_entry_to_message(char *msg, const struct file_id *id,
+                                const struct share_mode_entry *e);
+void message_to_share_mode_entry(struct file_id *id,
+                                struct share_mode_entry *e,
+                                const char *msg);
 bool init_oplocks(struct smbd_server_connection *sconn);
 void init_kernel_oplocks(struct smbd_server_connection *sconn);
 
@@ -778,20 +777,29 @@ NTSTATUS posix_get_nt_acl(struct connection_struct *conn,
                        struct security_descriptor **ppdesc);
 NTSTATUS try_chown(files_struct *fsp, uid_t uid, gid_t gid);
 NTSTATUS set_nt_acl(files_struct *fsp, uint32_t security_info_sent, const struct security_descriptor *psd);
-int get_acl_group_bits( connection_struct *conn, const char *fname, mode_t *mode );
-int chmod_acl(connection_struct *conn, const char *name, mode_t mode);
-int inherit_access_posix_acl(connection_struct *conn, const char *inherit_from_dir,
-                      const char *name, mode_t mode);
+int get_acl_group_bits( connection_struct *conn,
+                       const struct smb_filename *smb_fname,
+                       mode_t *mode);
+int chmod_acl(connection_struct *conn,
+                       const struct smb_filename *smb_fname,
+                       mode_t mode);
+int inherit_access_posix_acl(connection_struct *conn,
+                       const char *inherit_from_dir,
+                       const struct smb_filename *smb_fname,
+                       mode_t mode);
 int fchmod_acl(files_struct *fsp, mode_t mode);
 bool set_unix_posix_default_acl(connection_struct *conn,
                                const struct smb_filename *smb_fname,
                                uint16_t num_def_acls, const char *pdata);
-bool set_unix_posix_acl(connection_struct *conn, files_struct *fsp, const char *fname, uint16_t num_acls, const char *pdata);
+bool set_unix_posix_acl(connection_struct *conn, files_struct *fsp,
+                               const struct smb_filename *smb_fname,
+                               uint16_t num_acls,
+                               const char *pdata);
 NTSTATUS get_nt_acl_no_snum( TALLOC_CTX *ctx, const char *fname,
                             uint32_t security_info_wanted,
                             struct security_descriptor **sd);
 int posix_sys_acl_blob_get_file(vfs_handle_struct *handle,
-                               const char *path_p,
+                               const struct smb_filename *smb_fname,
                                TALLOC_CTX *mem_ctx,
                                char **blob_description,
                                DATA_BLOB *blob);
@@ -801,6 +809,17 @@ int posix_sys_acl_blob_get_fd(vfs_handle_struct *handle,
                              char **blob_description,
                              DATA_BLOB *blob);
 
+enum default_acl_style {DEFAULT_ACL_POSIX, DEFAULT_ACL_WINDOWS, DEFAULT_ACL_EVERYONE};
+
+const struct enum_list *get_default_acl_style_list(void);
+
+NTSTATUS make_default_filesystem_acl(
+       TALLOC_CTX *ctx,
+       enum default_acl_style acl_style,
+       const char *name,
+       SMB_STRUCT_STAT *psbuf,
+       struct security_descriptor **ppdesc);
+
 /* The following definitions come from smbd/process.c  */
 
 void smbd_setup_sig_term_handler(struct smbd_server_connection *sconn);
@@ -1134,8 +1153,10 @@ uint64_t get_FileIndex(connection_struct *conn, const SMB_STRUCT_STAT *psbuf);
 void aapl_force_zero_file_id(struct smbd_server_connection *sconn);
 bool samba_private_attr_name(const char *unix_ea_name);
 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);
+                       files_struct *fsp,
+                       const struct smb_filename *smb_fname,
+                       const char *ea_name,
+                       struct ea_struct *pea);
 NTSTATUS get_ea_names_from_file(TALLOC_CTX *mem_ctx,
                        connection_struct *conn,
                        files_struct *fsp,
@@ -1207,7 +1228,6 @@ void sys_utmp_yield(const char *username, const char *hostname,
 bool vfs_init_custom(connection_struct *conn, const char *vfs_object);
 bool smbd_vfs_init(connection_struct *conn);
 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_write_data(struct smb_request *req,
                        files_struct *fsp,
                        const char *buffer,
@@ -1224,13 +1244,14 @@ int vfs_fill_sparse(files_struct *fsp, off_t len);
 off_t vfs_transfer_file(files_struct *in, files_struct *out, off_t n);
 const char *vfs_readdirname(connection_struct *conn, void *p,
                            SMB_STRUCT_STAT *sbuf, char **talloced);
-int vfs_ChDir(connection_struct *conn, const char *path);
-char *vfs_GetWd(TALLOC_CTX *ctx, connection_struct *conn);
+int vfs_ChDir(connection_struct *conn,
+                       const struct smb_filename *smb_fname);
+struct smb_filename *vfs_GetWd(TALLOC_CTX *ctx, connection_struct *conn);
 NTSTATUS check_reduced_name(connection_struct *conn,
-                       const char *cwd_name,
-                       const char *fname);
+                       const struct smb_filename *cwd_fname,
+                       const struct smb_filename *smb_fname);
 NTSTATUS check_reduced_name_with_privilege(connection_struct *conn,
-                       const char *fname,
+                       const struct smb_filename *smb_fname,
                        struct smb_request *smbreq);
 int vfs_stat_smb_basename(struct connection_struct *conn,
                        const struct smb_filename *smb_fname_in,