uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
uint64_t get_dfree_info(connection_struct *conn, struct smb_filename *fname,
uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
+void flush_dfree_cache(void);
/* The following definitions come from smbd/dir.c */
/* The following definitions come from smbd/fileio.c */
ssize_t read_file(files_struct *fsp,char *data,off_t pos,size_t n);
-void update_write_time_handler(struct tevent_context *ctx,
- struct tevent_timer *te,
- struct timeval now,
- void *private_data);
+void fsp_flush_write_time_update(struct files_struct *fsp);
void trigger_write_time_update(struct files_struct *fsp);
void trigger_write_time_update_immediate(struct files_struct *fsp);
void mark_file_modified(files_struct *fsp);
bool allow_broken_path,
char **pp_name_out,
bool *ppath_contains_wcard);
-NTSTATUS create_conn_struct(TALLOC_CTX *ctx,
- struct tevent_context *ev,
- struct messaging_context *msg,
- connection_struct **pconn,
- int snum,
- const char *path,
- const struct auth_session_info *session_info);
-NTSTATUS create_conn_struct_cwd(TALLOC_CTX *ctx,
- struct tevent_context *ev,
- struct messaging_context *msg,
- connection_struct **pconn,
+struct connection_struct;
+struct smb_filename;
+struct conn_struct_tos {
+ struct connection_struct *conn;
+ struct smb_filename *oldcwd_fname;
+};
+NTSTATUS create_conn_struct_tos(struct messaging_context *msg,
int snum,
const char *path,
const struct auth_session_info *session_info,
- struct smb_filename **poldcwd_fname);
+ struct conn_struct_tos **_c);
+NTSTATUS create_conn_struct_tos_cwd(struct messaging_context *msg,
+ int snum,
+ const char *path,
+ const struct auth_session_info *session_info,
+ struct conn_struct_tos **_c);
/* The following definitions come from smbd/negprot.c */
struct notify_context *notify_init(
TALLOC_CTX *mem_ctx, struct messaging_context *msg,
- struct tevent_context *ev,
struct smbd_server_connection *sconn,
void (*callback)(struct smbd_server_connection *sconn,
void *, struct timespec,
/* The following definitions come from smbd/process.c */
-void smbd_setup_sig_term_handler(struct smbd_server_connection *sconn);
-void smbd_setup_sig_hup_handler(struct smbd_server_connection *sconn);
bool srv_send_smb(struct smbXsrv_connection *xconn, char *buffer,
bool no_signing, uint32_t seqnum,
bool do_encrypt,
struct memcache *smbd_memcache(void);
bool snum_is_shared_printer(int snum);
-void delete_and_reload_printers(struct tevent_context *ev,
- struct messaging_context *msg_ctx);
+void delete_and_reload_printers(void);
bool reload_services(struct smbd_server_connection *sconn,
bool (*snumused) (struct smbd_server_connection *, int),
bool test);
bool set_conn_connectpath(connection_struct *conn, const char *connectpath);
NTSTATUS set_conn_force_user_group(connection_struct *conn, int snum);
-bool set_current_service(connection_struct *conn, uint16_t flags, bool do_chdir);
+void set_current_case_sensitive(connection_struct *conn, uint16_t flags);
+bool chdir_current_service(connection_struct *conn);
void load_registry_shares(void);
int add_home_service(const char *service, const char *username, const char *homedir);
int find_service(TALLOC_CTX *ctx, const char *service, char **p_service_out);
/* 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,
uint32_t *p_share_access,
bool *p_readonly_share);
bool change_to_user(connection_struct *conn, uint64_t vuid);
+bool change_to_user_by_fsp(struct files_struct *fsp);
bool smbd_change_to_root_user(void);
bool smbd_become_authenticated_pipe_user(struct auth_session_info *session_info);
bool smbd_unbecome_authenticated_pipe_user(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,
const struct auth_session_info *session_info);
bool unbecome_user(void);
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);
+
/* The following definitions come from smbd/utmp.c */
void sys_utmp_claim(const char *username, const char *hostname,