NTSTATUS smbd_do_locks_try(
struct files_struct *fsp,
- enum brl_flavour lock_flav,
uint16_t num_locks,
struct smbd_lock_element *locks,
uint16_t *blocker_idx,
struct files_struct *fsp,
uint32_t lock_timeout,
bool large_offset,
- enum brl_flavour lock_flav,
uint16_t num_locks,
struct smbd_lock_element *locks);
NTSTATUS smbd_smb1_do_locks_recv(struct tevent_req *req);
bool smbd_smb1_brl_finish_by_lock(
struct files_struct *fsp,
bool large_offset,
- enum brl_flavour lock_flav,
struct smbd_lock_element lock,
NTSTATUS finish_status);
bool smbd_smb1_brl_finish_by_mid(
/* The following definitions come from smbd/close.c */
void set_close_write_time(struct files_struct *fsp, struct timespec ts);
-NTSTATUS close_file(struct smb_request *req, files_struct *fsp,
- enum file_close_type close_type);
+NTSTATUS close_file_smb(struct smb_request *req,
+ struct files_struct *fsp,
+ enum file_close_type close_type);
+NTSTATUS close_file_free(struct smb_request *req,
+ struct files_struct **_fsp,
+ enum file_close_type close_type);
void msg_close_file(struct messaging_context *msg_ctx,
void *private_data,
uint32_t msg_type,
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_case_sensitive(struct dptr_struct *dptr);
bool dptr_SearchDir(struct dptr_struct *dptr, const char *name, long *poffset, SMB_STRUCT_STAT *pst);
bool dptr_fill(struct smbd_server_connection *sconn,
char *buf1,unsigned int key);
files_struct *dptr_fetch_fsp(struct smbd_server_connection *sconn,
char *buf,int *num);
+struct smb_Dir;
+struct files_struct *dir_hnd_fetch_fsp(struct smb_Dir *dir_hnd);
files_struct *dptr_fetch_lanman2_fsp(struct smbd_server_connection *sconn,
int dptr_num);
bool get_dir_entry(TALLOC_CTX *ctx,
bool check_descend,
bool ask_sharemode);
struct smb_Dir;
-bool is_visible_file(connection_struct *conn,
- struct smb_Dir *dir_hnd,
- const char *name,
- SMB_STRUCT_STAT *pst,
- bool use_veto);
+bool is_visible_fsp(files_struct *fsp);
struct smb_Dir *OpenDir(TALLOC_CTX *mem_ctx,
connection_struct *conn,
const struct smb_filename *smb_fname,
void RewindDir(struct smb_Dir *dir_hnd, long *poffset);
void SeekDir(struct smb_Dir *dirp, long offset);
long TellDir(struct smb_Dir *dirp);
-bool SearchDir(struct smb_Dir *dirp, const char *name, long *poffset);
NTSTATUS can_delete_directory(struct connection_struct *conn,
const char *dirname);
bool have_file_open_below(connection_struct *conn,
NTSTATUS file_set_sparse(connection_struct *conn,
struct files_struct *fsp,
bool sparse);
-int file_ntimes(connection_struct *conn, const struct smb_filename *smb_fname,
+int file_ntimes(connection_struct *conn,
+ files_struct *fsp,
struct smb_file_time *ft);
bool set_sticky_write_time_path(struct file_id fileid, struct timespec mtime);
bool set_sticky_write_time_fsp(struct files_struct *fsp,
const struct smb_filename *smb_fname,
uint32_t dosmode);
-NTSTATUS set_create_timespec_ea(connection_struct *conn,
- const struct smb_filename *smb_fname,
+NTSTATUS set_create_timespec_ea(struct files_struct *fsp,
struct timespec create_time);
struct timespec get_create_timespec(connection_struct *conn,
bool can_delete_file_in_directory(connection_struct *conn,
struct files_struct *dirfsp,
const struct smb_filename *smb_fname);
-bool can_write_to_file(connection_struct *conn,
- struct files_struct *dirfsp,
- const struct smb_filename *smb_fname);
-bool directory_has_default_acl(connection_struct *conn,
- struct files_struct *dirfsp,
- struct smb_filename *smb_fname);
+bool can_write_to_fsp(struct files_struct *fsp);
+bool directory_has_default_acl_fsp(struct files_struct *fsp);
NTSTATUS can_set_delete_on_close(files_struct *fsp, uint32_t dosmode);
/* The following definitions come from smbd/fileio.c */
NTTIME twrp,
struct smb_filename **smb_fname,
uint32_t ucf_flags);
-NTSTATUS check_name(connection_struct *conn,
- const struct smb_filename *smb_fname);
NTSTATUS canonicalize_snapshot_path(struct smb_filename *smb_fname,
uint32_t ucf_flags,
NTTIME twrp);
-int get_real_filename(connection_struct *conn,
- struct smb_filename *path,
- const char *name,
- TALLOC_CTX *mem_ctx,
- char **found_name);
int get_real_filename_full_scan(connection_struct *conn,
const char *path,
const char *name,
uint32_t ucf_flags,
NTTIME twrp,
struct smb_filename **pp_smb_fname);
-NTSTATUS filename_convert_with_privilege(TALLOC_CTX *mem_ctx,
- connection_struct *conn,
- struct smb_request *smbreq,
- const char *name_in,
- uint32_t ucf_flags,
- struct smb_filename **pp_smb_fname);
+NTSTATUS filename_convert_smb1_search_path(TALLOC_CTX *ctx,
+ connection_struct *conn,
+ const char *name_in,
+ uint32_t ucf_flags,
+ struct smb_filename **_smb_fname_out,
+ char **_mask_out);
/* The following definitions come from smbd/files.c */
struct smbd_server_connection *sconn,
const struct smb2_lease_key *lease_key);
bool file_find_subpath(files_struct *dir_fsp);
+void fsp_unbind_smb(struct smb_request *req, files_struct *fsp);
void file_free(struct smb_request *req, files_struct *fsp);
files_struct *file_fsp(struct smb_request *req, uint16_t fid);
struct files_struct *file_fsp_get(struct smbd_smb2_request *smb2req,
NTSTATUS fsp_set_smb_fname(struct files_struct *fsp,
const struct smb_filename *smb_fname_in);
size_t fsp_fullbasepath(struct files_struct *fsp, char *buf, size_t buflen);
+void fsp_set_base_fsp(struct files_struct *fsp, struct files_struct *base_fsp);
+bool fsp_is_alternate_stream(const struct files_struct *fsp);
NTSTATUS create_internal_fsp(connection_struct *conn,
const struct smb_filename *smb_fname,
NTSTATUS move_smb_fname_fsp_link(struct smb_filename *smb_fname_dst,
struct smb_filename *smb_fname_src);
+NTSTATUS synthetic_pathref(TALLOC_CTX *mem_ctx,
+ struct files_struct *dirfsp,
+ const char *base_name,
+ const char *stream_name,
+ const SMB_STRUCT_STAT *psbuf,
+ NTTIME twrp,
+ uint32_t flags,
+ struct smb_filename **_smb_fname);
+
+NTSTATUS parent_pathref(TALLOC_CTX *mem_ctx,
+ struct files_struct *dirfsp,
+ const struct smb_filename *smb_fname,
+ struct smb_filename **_parent,
+ struct smb_filename **_atname);
+
/* The following definitions come from smbd/ipc.c */
NTSTATUS nt_status_np_pipe(NTSTATUS status);
const char *target,
struct referral **preflist,
size_t *refcount);
-bool is_msdfs_link(connection_struct *conn,
- struct smb_filename *smb_fname);
+bool is_msdfs_link(struct files_struct *dirfsp,
+ struct smb_filename *smb_fname);
struct junction_map;
NTSTATUS get_referred_path(TALLOC_CTX *ctx,
struct auth_session_info *session_info,
const char *name_in,
uint32_t ucf_flags,
bool allow_broken_path,
+ NTTIME *twrp,
char **pp_name_out);
struct connection_struct;
struct smb_filename;
+
+NTSTATUS create_conn_struct_cwd(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct messaging_context *msg,
+ const struct auth_session_info *session_info,
+ int snum,
+ const char *path,
+ struct connection_struct **c);
struct conn_struct_tos {
struct connection_struct *conn;
struct smb_filename *oldcwd_fname;
uint32_t max_data_count,
uint8_t **ppmarshalled_sd,
size_t *psd_size);
+NTSTATUS copy_internals(TALLOC_CTX *ctx,
+ connection_struct *conn,
+ struct smb_request *req,
+ struct smb_filename *smb_fname_src,
+ struct smb_filename *smb_fname_dst,
+ uint32_t attrs);
#ifdef HAVE_SYS_QUOTAS
struct smb2_query_quota_info;
/* The following definitions come from smbd/open.c */
-NTSTATUS smbd_check_access_rights(struct connection_struct *conn,
- struct files_struct *dirfsp,
- const struct smb_filename *smb_fname,
- bool use_privs,
- uint32_t access_mask);
-NTSTATUS smbd_check_access_rights_fsp(struct files_struct *fsp,
+NTSTATUS smbd_check_access_rights_fsp(struct files_struct *dirfsp,
+ struct files_struct *fsp,
bool use_privs,
uint32_t access_mask);
-NTSTATUS check_parent_access(struct connection_struct *conn,
- struct files_struct *dirfsp,
- struct smb_filename *smb_fname,
+NTSTATUS check_parent_access_fsp(struct files_struct *fsp,
uint32_t access_mask);
NTSTATUS fd_openat(const struct files_struct *dirfsp,
struct smb_filename *smb_fname,
files_struct *fsp,
int flags, mode_t mode);
NTSTATUS fd_close(files_struct *fsp);
-void change_file_owner_to_parent(connection_struct *conn,
- struct smb_filename *inherit_from_dir,
- files_struct *fsp);
bool is_oplock_stat_open(uint32_t access_mask);
bool is_lease_stat_open(uint32_t access_mask);
NTSTATUS send_break_message(struct messaging_context *msg_ctx,
NTSTATUS posix_fget_nt_acl(struct files_struct *fsp, uint32_t security_info,
TALLOC_CTX *mem_ctx,
struct security_descriptor **ppdesc);
-NTSTATUS posix_get_nt_acl(struct connection_struct *conn,
- const struct smb_filename *smb_fname_in,
- uint32_t security_info,
- TALLOC_CTX *mem_ctx,
- 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,
bool req_is_in_chain(const struct smb_request *req);
void smbd_process(struct tevent_context *ev_ctx,
struct messaging_context *msg_ctx,
- struct dcesrv_context *dce_ctx,
int sock_fd,
bool interactive);
bool fork_echo_handler(struct smbXsrv_connection *xconn);
NTSTATUS unlink_internals(connection_struct *conn,
struct smb_request *req,
uint32_t dirtype,
- struct smb_filename *smb_fname,
- bool has_wcard);
+ struct smb_filename *smb_fname);
void reply_unlink(struct smb_request *req);
ssize_t fake_sendfile(struct smbXsrv_connection *xconn, files_struct *fsp,
off_t startpos, size_t nread);
connection_struct *conn,
struct smb_request *req,
struct smb_filename *smb_fname_src,
- const char *src_original_lcomp,
struct smb_filename *smb_fname_dst,
const char *dst_original_lcomp,
uint32_t attrs,
NTTIME twrp,
bool case_sensitive);
bool stat_cache_lookup(connection_struct *conn,
- bool posix_paths,
char **pp_name,
char **pp_dirpath,
char **pp_start,
void send_stat_cache_delete_message(struct messaging_context *msg_ctx,
const char *name);
void stat_cache_delete(const char *name);
-struct TDB_DATA;
-unsigned int fast_string_hash(struct TDB_DATA *key);
bool reset_stat_cache( void );
/* The following definitions come from smbd/statvfs.c */
/* The following definitions come from smbd/trans2.c */
+NTSTATUS refuse_symlink_fsp(const struct files_struct *fsp);
NTSTATUS check_access_fsp(struct files_struct *fsp,
uint32_t access_mask);
uint64_t smb_roundup(connection_struct *conn, uint64_t val);
bool samba_private_attr_name(const char *unix_ea_name);
-NTSTATUS get_ea_value(TALLOC_CTX *mem_ctx, connection_struct *conn,
+NTSTATUS get_ea_value_fsp(TALLOC_CTX *mem_ctx,
+ files_struct *fsp,
+ const char *ea_name,
+ struct ea_struct *pea);
+NTSTATUS get_ea_names_from_fsp(TALLOC_CTX *mem_ctx,
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,
- const struct smb_filename *smb_fname,
char ***pnames,
size_t *pnum_names);
NTSTATUS set_ea(connection_struct *conn, files_struct *fsp,
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,
NTSTATUS status,
NTSTATUS check_reduced_name(connection_struct *conn,
const struct smb_filename *cwd_fname,
const struct smb_filename *smb_fname);
-NTSTATUS check_reduced_name_with_privilege(connection_struct *conn,
- const struct smb_filename *smb_fname,
- struct smb_request *smbreq);
int vfs_stat(struct connection_struct *conn,
struct smb_filename *smb_fname);
int vfs_stat_smb_basename(struct connection_struct *conn,
const struct smb_filename *smb_fname_in,
SMB_STRUCT_STAT *psbuf);
NTSTATUS vfs_stat_fsp(files_struct *fsp);
-NTSTATUS vfs_streaminfo(connection_struct *conn,
- struct files_struct *fsp,
- const struct smb_filename *smb_fname,
+NTSTATUS vfs_fstreaminfo(struct files_struct *fsp,
TALLOC_CTX *mem_ctx,
unsigned int *num_streams,
struct stream_struct **streams);
files_struct **result,
DATA_BLOB *new_cookie);
+/* The following definitions come from smbd/smb2_posix.c */
+DATA_BLOB smb2_posix_cc_info(TALLOC_CTX *mem_ctx,
+ connection_struct *conn,
+ uint32_t reparse_tag,
+ const SMB_STRUCT_STAT *psbuf);
+DATA_BLOB store_smb2_posix_info(TALLOC_CTX *mem_ctx,
+ connection_struct *conn,
+ const SMB_STRUCT_STAT *psbuf,
+ uint32_t reparse_tag,
+ uint32_t dos_attributes);
+
#endif /* _SMBD_PROTO_H_ */