/* The following definitions come from smbd/signing.c */
struct smbXsrv_connection;
+struct dcesrv_context;
bool srv_check_sign_mac(struct smbXsrv_connection *conn,
const char *inbuf, uint32_t *seqnum, bool trusted_channel);
struct timespec *date,
bool check_descend,
bool ask_sharemode);
-bool is_visible_file(connection_struct *conn, const char *dir_path, const char *name, SMB_STRUCT_STAT *pst, bool use_veto);
+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);
struct smb_Dir *OpenDir(TALLOC_CTX *mem_ctx,
connection_struct *conn,
const struct smb_filename *smb_fname,
mode_t unix_mode(connection_struct *conn, int dosmode,
const struct smb_filename *smb_fname,
- const char *inherit_from_dir);
+ struct smb_filename *smb_fname_parent);
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);
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);
+int file_set_dosmode(connection_struct *conn,
+ struct smb_filename *smb_fname,
+ uint32_t dosmode,
+ struct smb_filename *parent_dir,
+ bool newfile);
NTSTATUS file_set_sparse(connection_struct *conn,
struct files_struct *fsp,
bool sparse);
/* The following definitions come from smbd/file_access.c */
bool can_delete_file_in_directory(connection_struct *conn,
- const struct smb_filename *smb_fname);
+ struct files_struct *dirfsp,
+ const struct smb_filename *smb_fname);
bool can_write_to_file(connection_struct *conn,
- const struct smb_filename *smb_fname);
-bool directory_has_default_acl(connection_struct *conn, const char *fname);
+ const struct smb_filename *smb_fname);
+bool directory_has_default_acl(connection_struct *conn,
+ struct files_struct *dirfsp,
+ struct smb_filename *smb_fname);
NTSTATUS can_set_delete_on_close(files_struct *fsp, uint32_t dosmode);
/* The following definitions come from smbd/fileio.c */
int get_real_filename(connection_struct *conn, const char *path,
const char *name, TALLOC_CTX *mem_ctx,
char **found_name);
+char *get_original_lcomp(TALLOC_CTX *ctx,
+ connection_struct *conn,
+ const char *filename_in,
+ uint32_t ucf_flags);
NTSTATUS filename_convert(TALLOC_CTX *mem_ctx,
connection_struct *conn,
const char *name_in,
NTSTATUS file_new(struct smb_request *req, connection_struct *conn,
files_struct **result);
void file_close_conn(connection_struct *conn);
-void file_close_pid(struct smbd_server_connection *sconn, uint16_t smbpid,
- uint64_t vuid);
bool file_init_global(void);
bool file_init(struct smbd_server_connection *sconn);
void file_close_user(struct smbd_server_connection *sconn, uint64_t vuid);
const struct smb_filename *smb_fname_in);
size_t fsp_fullbasepath(struct files_struct *fsp, char *buf, size_t buflen);
+NTSTATUS create_internal_dirfsp_at(connection_struct *conn,
+ struct files_struct *dirfsp,
+ const struct smb_filename *smb_dname,
+ struct files_struct **_fsp);
+
+NTSTATUS open_internal_dirfsp_at(connection_struct *conn,
+ struct files_struct *dirfsp,
+ const struct smb_filename *smb_dname,
+ struct files_struct **_fsp);
+
/* The following definitions come from smbd/ipc.c */
NTSTATUS nt_status_np_pipe(NTSTATUS status);
/* The following definitions come from smbd/msdfs.c */
+bool parse_msdfs_symlink(TALLOC_CTX *ctx,
+ bool shuffle_referrals,
+ const char *target,
+ struct referral **preflist,
+ size_t *refcount);
bool is_msdfs_link(connection_struct *conn,
struct smb_filename *smb_fname);
struct junction_map;
int flags, mode_t mode);
NTSTATUS fd_close(files_struct *fsp);
void change_file_owner_to_parent(connection_struct *conn,
- const char *inherit_from_dir,
+ struct smb_filename *inherit_from_dir,
files_struct *fsp);
-bool is_stat_open(uint32_t access_mask);
+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,
const struct file_id *id,
const struct share_mode_entry *exclusive,
const struct smb_filename *smb_fname,
mode_t *mode);
int inherit_access_posix_acl(connection_struct *conn,
- const char *inherit_from_dir,
+ struct smb_filename *inherit_from_dir,
const struct smb_filename *smb_fname,
mode_t mode);
NTSTATUS set_unix_posix_default_acl(connection_struct *conn,
NTSTATUS set_unix_posix_acl(connection_struct *conn, files_struct *fsp,
uint16_t num_acls,
const char *pdata);
-NTSTATUS get_nt_acl_no_snum(TALLOC_CTX *ctx,
- struct auth_session_info *session_info,
- const char *fname,
- uint32_t security_info_wanted,
- struct security_descriptor **sd);
int posix_sys_acl_blob_get_file(vfs_handle_struct *handle,
const struct smb_filename *smb_fname,
TALLOC_CTX *mem_ctx,
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 rename_internals_fsp(connection_struct *conn,
files_struct *fsp,
const struct smb_filename *smb_fname_dst_in,
+ const char *dst_original_lcomp,
uint32_t attrs,
bool replace_if_exists);
NTSTATUS rename_internals(TALLOC_CTX *ctx,
struct smb_request *req,
struct smb_filename *smb_fname_src,
struct smb_filename *smb_fname_dst,
+ const char *dst_original_lcomp,
uint32_t attrs,
bool replace_if_exists,
bool src_has_wild,
/* The following definitions come from smbd/service.c */
bool set_conn_connectpath(connection_struct *conn, const char *connectpath);
+bool canonicalize_connect_path(connection_struct *conn);
NTSTATUS set_conn_force_user_group(connection_struct *conn, int snum);
void set_current_case_sensitive(connection_struct *conn, uint16_t flags);
bool chdir_current_service(connection_struct *conn);
void reply_trans2(struct smb_request *req);
void reply_transs2(struct smb_request *req);
+enum perm_type {
+ PERM_NEW_FILE,
+ PERM_NEW_DIR,
+ PERM_EXISTING_FILE,
+ PERM_EXISTING_DIR
+};
+
+NTSTATUS unix_perms_from_wire(connection_struct *conn,
+ const SMB_STRUCT_STAT *psbuf,
+ uint32_t perms,
+ enum perm_type ptype,
+ mode_t *ret_perms);
+
/* The following definitions come from smbd/uid.c */
bool change_to_guest(void);