Changeset 988 for vendor/current/source3/smbd/proto.h
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/smbd/proto.h
r860 r988 49 49 /* The following definitions come from smbd/signing.c */ 50 50 51 struct smbd_server_connection; 52 bool srv_check_sign_mac(struct smbd_server_connection *conn, 51 struct smbXsrv_connection; 52 53 bool srv_check_sign_mac(struct smbXsrv_connection *conn, 53 54 const char *inbuf, uint32_t *seqnum, bool trusted_channel); 54 void srv_calculate_sign_mac(struct smb d_server_connection *conn,55 void srv_calculate_sign_mac(struct smbXsrv_connection *conn, 55 56 char *outbuf, uint32_t seqnum); 56 void srv_cancel_sign_response(struct smbd_server_connection *conn); 57 bool srv_init_signing(struct smbd_server_connection *conn); 58 void srv_set_signing_negotiated(struct smbd_server_connection *conn); 59 bool srv_is_signing_active(struct smbd_server_connection *conn); 60 bool srv_is_signing_negotiated(struct smbd_server_connection *conn); 61 void srv_set_signing(struct smbd_server_connection *conn, 57 void srv_cancel_sign_response(struct smbXsrv_connection *conn); 58 bool srv_init_signing(struct smbXsrv_connection *conn); 59 void srv_set_signing_negotiated(struct smbXsrv_connection *conn, 60 bool allowed, bool mandatory); 61 bool srv_is_signing_active(struct smbXsrv_connection *conn); 62 bool srv_is_signing_negotiated(struct smbXsrv_connection *conn); 63 void srv_set_signing(struct smbXsrv_connection *conn, 62 64 const DATA_BLOB user_session_key, 63 65 const DATA_BLOB response); … … 65 67 /* The following definitions come from smbd/aio.c */ 66 68 69 int get_outstanding_aio_calls(void); 70 void increment_outstanding_aio_calls(void); 71 void decrement_outstanding_aio_calls(void); 72 struct aio_extra; 73 bool aio_write_through_requested(struct aio_extra *aio_ex); 67 74 NTSTATUS schedule_aio_read_and_X(connection_struct *conn, 68 75 struct smb_request *req, 69 files_struct *fsp, SMB_OFF_Tstartpos,76 files_struct *fsp, off_t startpos, 70 77 size_t smb_maxcnt); 71 78 NTSTATUS schedule_aio_write_and_X(connection_struct *conn, 72 79 struct smb_request *req, 73 files_struct *fsp, c har *data,74 SMB_OFF_Tstartpos,80 files_struct *fsp, const char *data, 81 off_t startpos, 75 82 size_t numtowrite); 76 83 NTSTATUS schedule_smb2_aio_read(connection_struct *conn, … … 79 86 TALLOC_CTX *ctx, 80 87 DATA_BLOB *preadbuf, 81 SMB_OFF_Tstartpos,88 off_t startpos, 82 89 size_t smb_maxcnt); 83 90 NTSTATUS schedule_aio_smb2_write(connection_struct *conn, … … 87 94 DATA_BLOB in_data, 88 95 bool write_through); 89 int wait_for_aio_completion(files_struct *fsp); 90 void cancel_aio_by_fsp(files_struct *fsp); 91 void smbd_aio_complete_aio_ex(struct aio_extra *aio_ex); 96 bool cancel_smb2_aio(struct smb_request *smbreq); 97 bool aio_add_req_to_fsp(files_struct *fsp, struct tevent_req *req); 92 98 93 99 /* The following definitions come from smbd/blocking.c */ 94 100 95 void brl_timeout_fn(struct event_context *event_ctx,96 struct t imed_event*te,101 void brl_timeout_fn(struct tevent_context *event_ctx, 102 struct tevent_timer *te, 97 103 struct timeval now, 98 104 void *private_data); … … 111 117 uint64_t count, 112 118 uint64_t blocking_smblctx); 119 void smbd_cancel_pending_lock_requests_by_fid(files_struct *fsp, 120 struct byte_range_lock *br_lck, 121 enum file_close_type close_type); 113 122 void cancel_pending_lock_requests_by_fid(files_struct *fsp, 114 123 struct byte_range_lock *br_lck, … … 137 146 DATA_BLOB *data); 138 147 NTSTATUS delete_all_streams(connection_struct *conn, const char *fname); 148 bool recursive_rmdir(TALLOC_CTX *ctx, 149 connection_struct *conn, 150 struct smb_filename *smb_dname); 139 151 140 152 /* The following definitions come from smbd/conn.c */ 141 153 142 void conn_init(struct smbd_server_connection *sconn);143 154 int conn_num_open(struct smbd_server_connection *sconn); 144 bool conn_snum_used(int snum); 145 connection_struct *conn_find(struct smbd_server_connection *sconn, 146 unsigned cnum); 155 bool conn_snum_used(struct smbd_server_connection *sconn, int snum); 147 156 connection_struct *conn_new(struct smbd_server_connection *sconn); 148 bool conn_close_all(struct smbd_server_connection *sconn);149 157 bool conn_idle_all(struct smbd_server_connection *sconn, time_t t); 150 void conn_clear_vuid_caches(struct smbd_server_connection *sconn, uint 16vuid);158 void conn_clear_vuid_caches(struct smbd_server_connection *sconn, uint64_t vuid); 151 159 void conn_free(connection_struct *conn); 160 void conn_force_tdis(struct smbd_server_connection *sconn, const char *sharename); 152 161 void msg_force_tdis(struct messaging_context *msg, 153 162 void *private_data, … … 158 167 /* The following definitions come from smbd/connection.c */ 159 168 160 bool yield_connection(connection_struct *conn, const char *name); 161 int count_current_connections( const char *sharename, bool clear ); 162 bool claim_connection(connection_struct *conn, const char *name); 169 int count_current_connections(const char *sharename, bool verify); 170 bool connections_snum_used(struct smbd_server_connection *unused, int snum); 163 171 164 172 /* The following definitions come from smbd/dfree.c */ 165 173 166 uint64_t sys_disk_free(connection_struct *conn, const char *path, bool small_query,174 uint64_t sys_disk_free(connection_struct *conn, const char *path, 167 175 uint64_t *bsize,uint64_t *dfree,uint64_t *dsize); 168 176 uint64_t get_dfree_info(connection_struct *conn, 169 177 const char *path, 170 bool small_query,171 178 uint64_t *bsize, 172 179 uint64_t *dfree, … … 175 182 /* The following definitions come from smbd/dir.c */ 176 183 177 bool make_dir_struct(TALLOC_CTX *ctx,178 char *buf,179 const char *mask,180 const char *fname,181 SMB_OFF_T size,182 uint32 mode,183 time_t date,184 bool uc);185 184 bool init_dptrs(struct smbd_server_connection *sconn); 186 c har *dptr_path(struct smbd_server_connection *sconn, int key);187 c har *dptr_wcard(struct smbd_server_connection *sconn, int key);188 uint16 dptr_attr(struct smbd_server_connection *sconn, int key);185 const char *dptr_path(struct smbd_server_connection *sconn, int key); 186 const char *dptr_wcard(struct smbd_server_connection *sconn, int key); 187 uint16_t dptr_attr(struct smbd_server_connection *sconn, int key); 189 188 void dptr_close(struct smbd_server_connection *sconn, int *key); 190 189 void dptr_closecnum(connection_struct *conn); 191 190 void dptr_idlecnum(connection_struct *conn); 192 191 void dptr_closepath(struct smbd_server_connection *sconn, 193 char *path,uint16 spid); 194 NTSTATUS dptr_create(connection_struct *conn, files_struct *fsp, 195 const char *path, bool old_handle, bool expect_close,uint16 spid, 196 const char *wcard, bool wcard_has_wild, uint32 attr, struct dptr_struct **dptr_ret); 192 char *path,uint16_t spid); 193 NTSTATUS dptr_create(connection_struct *conn, 194 struct smb_request *req, 195 files_struct *fsp, 196 const char *path, bool old_handle, bool expect_close,uint16_t spid, 197 const char *wcard, bool wcard_has_wild, uint32_t attr, struct dptr_struct **dptr_ret); 197 198 void dptr_CloseDir(files_struct *fsp); 198 199 void dptr_SeekDir(struct dptr_struct *dptr, long offset); … … 200 201 bool dptr_has_wild(struct dptr_struct *dptr); 201 202 int dptr_dnum(struct dptr_struct *dptr); 202 char *dptr_ReadDirName(TALLOC_CTX *ctx, 203 struct dptr_struct *dptr, 204 long *poffset, 205 SMB_STRUCT_STAT *pst); 203 bool dptr_get_priv(struct dptr_struct *dptr); 204 void dptr_set_priv(struct dptr_struct *dptr); 206 205 bool dptr_SearchDir(struct dptr_struct *dptr, const char *name, long *poffset, SMB_STRUCT_STAT *pst); 207 void dptr_DirCacheAdd(struct dptr_struct *dptr, const char *name, long offset);208 206 void dptr_init_search_op(struct dptr_struct *dptr); 209 207 bool dptr_fill(struct smbd_server_connection *sconn, … … 213 211 struct dptr_struct *dptr_fetch_lanman2(struct smbd_server_connection *sconn, 214 212 int dptr_num); 215 bool dir_check_ftype(connection_struct *conn, uint32 mode, uint32 dirtype);216 213 bool get_dir_entry(TALLOC_CTX *ctx, 217 214 struct dptr_struct *dirptr, 218 215 const char *mask, 219 uint32 dirtype,216 uint32_t dirtype, 220 217 char **pp_fname_out, 221 SMB_OFF_T*size,222 uint32 *mode,218 off_t *size, 219 uint32_t *mode, 223 220 struct timespec *date, 224 221 bool check_descend, … … 226 223 bool is_visible_file(connection_struct *conn, const char *dir_path, const char *name, SMB_STRUCT_STAT *pst, bool use_veto); 227 224 struct smb_Dir *OpenDir(TALLOC_CTX *mem_ctx, connection_struct *conn, 228 const char *name, const char *mask, uint32 attr);225 const char *name, const char *mask, uint32_t attr); 229 226 const char *ReadDirName(struct smb_Dir *dirp, long *poffset, 230 227 SMB_STRUCT_STAT *sbuf, char **talloced); … … 232 229 void SeekDir(struct smb_Dir *dirp, long offset); 233 230 long TellDir(struct smb_Dir *dirp); 234 void DirCacheAdd(struct smb_Dir *dirp, const char *name, long offset);235 231 bool SearchDir(struct smb_Dir *dirp, const char *name, long *poffset); 236 232 NTSTATUS can_delete_directory(struct connection_struct *conn, 237 233 const char *dirname); 234 bool have_file_open_below(connection_struct *conn, 235 const struct smb_filename *name); 238 236 239 237 /* The following definitions come from smbd/dmapi.c */ … … 243 241 bool dmapi_new_session(void); 244 242 bool dmapi_destroy_session(void); 245 uint32 dmapi_file_flags(const char * const path);243 uint32_t dmapi_file_flags(const char * const path); 246 244 247 245 /* The following definitions come from smbd/dnsregister.c */ … … 256 254 const struct smb_filename *smb_fname, 257 255 const char *inherit_from_dir); 258 uint32 dos_mode_msdfs(connection_struct *conn,256 uint32_t dos_mode_msdfs(connection_struct *conn, 259 257 const struct smb_filename *smb_fname); 260 258 int dos_attributes_to_stat_dos_flags(uint32_t dosmode); 261 uint32 dos_mode(connection_struct *conn, struct smb_filename *smb_fname);259 uint32_t dos_mode(connection_struct *conn, struct smb_filename *smb_fname); 262 260 int file_set_dosmode(connection_struct *conn, struct smb_filename *smb_fname, 263 uint32 dosmode, const char *parent_dir, bool newfile);261 uint32_t dosmode, const char *parent_dir, bool newfile); 264 262 NTSTATUS file_set_sparse(connection_struct *conn, 265 263 struct files_struct *fsp, … … 286 284 287 285 bool use_nt_status(void); 288 void error_packet_set(char *outbuf, uint8 eclass, uint32ecode, NTSTATUS ntstatus, int line, const char *file);289 int error_packet(char *outbuf, uint8 eclass, uint32ecode, NTSTATUS ntstatus, int line, const char *file);286 void error_packet_set(char *outbuf, uint8_t eclass, uint32_t ecode, NTSTATUS ntstatus, int line, const char *file); 287 int error_packet(char *outbuf, uint8_t eclass, uint32_t ecode, NTSTATUS ntstatus, int line, const char *file); 290 288 void reply_nt_error(struct smb_request *req, NTSTATUS ntstatus, 291 289 int line, const char *file); 292 void reply_force_dos_error(struct smb_request *req, uint8 eclass, uint32ecode,290 void reply_force_dos_error(struct smb_request *req, uint8_t eclass, uint32_t ecode, 293 291 int line, const char *file); 294 void reply_both_error(struct smb_request *req, uint8 eclass, uint32ecode,292 void reply_both_error(struct smb_request *req, uint8_t eclass, uint32_t ecode, 295 293 NTSTATUS status, int line, const char *file); 296 294 void reply_openerror(struct smb_request *req, NTSTATUS status); … … 298 296 /* The following definitions come from smbd/file_access.c */ 299 297 300 bool can_access_file_acl(struct connection_struct *conn,301 const struct smb_filename *smb_fname,302 uint32_t access_mask);303 298 bool can_delete_file_in_directory(connection_struct *conn, 304 299 const struct smb_filename *smb_fname); 305 bool can_access_file_data(connection_struct *conn,306 const struct smb_filename *smb_fname,307 uint32 access_mask);308 300 bool can_write_to_file(connection_struct *conn, 309 301 const struct smb_filename *smb_fname); 310 302 bool directory_has_default_acl(connection_struct *conn, const char *fname); 303 NTSTATUS can_set_delete_on_close(files_struct *fsp, uint32_t dosmode); 311 304 312 305 /* The following definitions come from smbd/fileio.c */ 313 306 314 ssize_t read_file(files_struct *fsp,char *data, SMB_OFF_Tpos,size_t n);315 void update_write_time_handler(struct event_context *ctx,316 struct t imed_event*te,307 ssize_t read_file(files_struct *fsp,char *data,off_t pos,size_t n); 308 void update_write_time_handler(struct tevent_context *ctx, 309 struct tevent_timer *te, 317 310 struct timeval now, 318 311 void *private_data); 319 312 void trigger_write_time_update(struct files_struct *fsp); 320 313 void trigger_write_time_update_immediate(struct files_struct *fsp); 314 void mark_file_modified(files_struct *fsp); 321 315 ssize_t write_file(struct smb_request *req, 322 316 files_struct *fsp, 323 317 const char *data, 324 SMB_OFF_Tpos,318 off_t pos, 325 319 size_t n); 326 320 void delete_write_cache(files_struct *fsp); 327 void set_filelen_write_cache(files_struct *fsp, SMB_OFF_Tfile_size);321 void set_filelen_write_cache(files_struct *fsp, off_t file_size); 328 322 ssize_t flush_write_cache(files_struct *fsp, enum flush_reason_enum reason); 329 323 NTSTATUS sync_file(connection_struct *conn, files_struct *fsp, bool write_through); … … 337 331 struct smb_filename **smb_fname, 338 332 uint32_t ucf_flags); 339 NTSTATUS check_veto_path(connection_struct *conn, const char *name);340 333 NTSTATUS check_name(connection_struct *conn, const char *name); 341 334 int get_real_filename(connection_struct *conn, const char *path, … … 349 342 bool *ppath_contains_wcard, 350 343 struct smb_filename **pp_smb_fname); 344 NTSTATUS filename_convert_with_privilege(TALLOC_CTX *mem_ctx, 345 connection_struct *conn, 346 struct smb_request *smbreq, 347 const char *name_in, 348 uint32_t ucf_flags, 349 bool *ppath_contains_wcard, 350 struct smb_filename **pp_smb_fname); 351 351 352 352 /* The following definitions come from smbd/files.c */ 353 353 354 NTSTATUS fsp_new(struct connection_struct *conn, TALLOC_CTX *mem_ctx, 355 files_struct **result); 354 356 NTSTATUS file_new(struct smb_request *req, connection_struct *conn, 355 357 files_struct **result); 356 358 void file_close_conn(connection_struct *conn); 357 void file_close_pid(struct smbd_server_connection *sconn, uint16 smbpid, 358 int vuid); 359 void file_close_pid(struct smbd_server_connection *sconn, uint16_t smbpid, 360 uint64_t vuid); 361 bool file_init_global(void); 359 362 bool file_init(struct smbd_server_connection *sconn); 360 void file_close_user(struct smbd_server_connection *sconn, int vuid);363 void file_close_user(struct smbd_server_connection *sconn, uint64_t vuid); 361 364 struct files_struct *files_forall( 362 365 struct smbd_server_connection *sconn, … … 370 373 struct file_id id); 371 374 files_struct *file_find_di_next(files_struct *start_fsp); 375 struct files_struct *file_find_one_fsp_from_lease_key( 376 struct smbd_server_connection *sconn, 377 const struct smb2_lease_key *lease_key); 372 378 bool file_find_subpath(files_struct *dir_fsp); 373 379 void file_sync_all(connection_struct *conn); 380 void fsp_free(files_struct *fsp); 374 381 void file_free(struct smb_request *req, files_struct *fsp); 375 files_struct *file_fsp(struct smb_request *req, uint16 fid); 376 uint64_t fsp_persistent_id(const struct files_struct *fsp); 382 files_struct *file_fsp(struct smb_request *req, uint16_t fid); 383 struct files_struct *file_fsp_get(struct smbd_smb2_request *smb2req, 384 uint64_t persistent_id, 385 uint64_t volatile_id); 377 386 struct files_struct *file_fsp_smb2(struct smbd_smb2_request *smb2req, 378 387 uint64_t persistent_id, 379 388 uint64_t volatile_id); 380 389 NTSTATUS dup_file_fsp(struct smb_request *req, files_struct *from, 381 uint32 access_mask, uint32share_access,382 uint32 create_options, files_struct *to);390 uint32_t access_mask, uint32_t share_access, 391 uint32_t create_options, files_struct *to); 383 392 NTSTATUS file_name_hash(connection_struct *conn, 384 393 const char *name, uint32_t *p_name_hash); 385 394 NTSTATUS fsp_set_smb_fname(struct files_struct *fsp, 386 395 const struct smb_filename *smb_fname_in); 396 const struct GUID *fsp_client_guid(const files_struct *fsp); 397 uint32_t fsp_lease_type(struct files_struct *fsp); 387 398 388 399 /* The following definitions come from smbd/ipc.c */ 389 400 401 NTSTATUS nt_status_np_pipe(NTSTATUS status); 390 402 void send_trans_reply(connection_struct *conn, 391 403 struct smb_request *req, … … 398 410 /* The following definitions come from smbd/lanman.c */ 399 411 400 void api_reply(connection_struct *conn, uint 16vuid,412 void api_reply(connection_struct *conn, uint64_t vuid, 401 413 struct smb_request *req, 402 414 char *data, char *params, … … 448 460 NTSTATUS get_referred_path(TALLOC_CTX *ctx, 449 461 const char *dfs_path, 462 bool allow_broken_path, 450 463 struct junction_map *jucn, 451 464 int *consumedcntp, … … 457 470 bool create_junction(TALLOC_CTX *ctx, 458 471 const char *dfs_path, 472 bool allow_broken_path, 459 473 struct junction_map *jucn); 460 474 bool create_msdfs_link(const struct junction_map *jucn); 461 475 bool remove_msdfs_link(const struct junction_map *jucn); 462 476 struct junction_map *enum_msdfs_links(TALLOC_CTX *ctx, size_t *p_num_jn); 463 NTSTATUS resolve_dfspath(TALLOC_CTX *ctx,464 connection_struct *conn,465 bool dfs_pathnames,466 const char *name_in,467 char **pp_name_out);468 477 NTSTATUS resolve_dfspath_wcard(TALLOC_CTX *ctx, 469 478 connection_struct *conn, … … 471 480 const char *name_in, 472 481 bool allow_wcards, 482 bool allow_broken_path, 473 483 char **pp_name_out, 474 484 bool *ppath_contains_wcard); 475 485 NTSTATUS create_conn_struct(TALLOC_CTX *ctx, 486 struct tevent_context *ev, 487 struct messaging_context *msg, 488 connection_struct **pconn, 489 int snum, 490 const char *path, 491 const struct auth_session_info *session_info); 492 NTSTATUS create_conn_struct_cwd(TALLOC_CTX *ctx, 493 struct tevent_context *ev, 494 struct messaging_context *msg, 476 495 connection_struct **pconn, 477 496 int snum, 478 497 const char *path, 479 const struct auth_se rversupplied_info *session_info,498 const struct auth_session_info *session_info, 480 499 char **poldcwd); 481 500 … … 486 505 /* The following definitions come from smbd/notify.c */ 487 506 507 bool change_notify_fsp_has_changes(struct files_struct *fsp); 488 508 void change_notify_reply(struct smb_request *req, 489 509 NTSTATUS error_code, … … 493 513 NTSTATUS error_code, 494 514 uint8_t *buf, size_t len)); 495 NTSTATUS change_notify_create(struct files_struct *fsp, uint32 filter,515 NTSTATUS change_notify_create(struct files_struct *fsp, uint32_t filter, 496 516 bool recursive); 497 517 NTSTATUS change_notify_add_request(struct smb_request *req, 498 uint32 max_param,499 uint32 filter, bool recursive,518 uint32_t max_param, 519 uint32_t filter, bool recursive, 500 520 struct files_struct *fsp, 501 521 void (*reply_fn)(struct smb_request *req, 502 522 NTSTATUS error_code, 503 523 uint8_t *buf, size_t len)); 524 void smbd_notify_cancel_deleted(struct messaging_context *msg, 525 void *private_data, uint32_t msg_type, 526 struct server_id server_id, DATA_BLOB *data); 504 527 void remove_pending_change_notify_requests_by_mid( 505 528 struct smbd_server_connection *sconn, uint64_t mid); 506 529 void remove_pending_change_notify_requests_by_fid(files_struct *fsp, 507 530 NTSTATUS status); 508 void notify_fname(connection_struct *conn, uint32 action, uint32filter,531 void notify_fname(connection_struct *conn, uint32_t action, uint32_t filter, 509 532 const char *path); 510 char *notify_filter_string(TALLOC_CTX *mem_ctx, uint32 filter); 511 struct sys_notify_context *sys_notify_context_create(connection_struct *conn, 512 TALLOC_CTX *mem_ctx, 513 struct event_context *ev); 514 NTSTATUS sys_notify_watch(struct sys_notify_context *ctx, 515 struct notify_entry *e, 516 void (*callback)(struct sys_notify_context *ctx, 517 void *private_data, 518 struct notify_event *ev), 519 void *private_data, void *handle); 533 char *notify_filter_string(TALLOC_CTX *mem_ctx, uint32_t filter); 534 struct sys_notify_context *sys_notify_context_create(TALLOC_CTX *mem_ctx, 535 struct tevent_context *ev); 520 536 521 537 /* The following definitions come from smbd/notify_inotify.c */ 522 538 523 NTSTATUS inotify_watch(struct sys_notify_context *ctx, 524 struct notify_entry *e, 525 void (*callback)(struct sys_notify_context *ctx, 526 void *private_data, 527 struct notify_event *ev), 528 void *private_data, 529 void *handle_p); 539 int inotify_watch(TALLOC_CTX *mem_ctx, 540 struct sys_notify_context *ctx, 541 const char *path, 542 uint32_t *filter, 543 uint32_t *subdir_filter, 544 void (*callback)(struct sys_notify_context *ctx, 545 void *private_data, 546 struct notify_event *ev), 547 void *private_data, 548 void *handle_p); 549 550 int _fam_watch(TALLOC_CTX *mem_ctx, 551 struct sys_notify_context *ctx, 552 const char *path, 553 uint32_t *filter, 554 uint32_t *subdir_filter, 555 void (*callback)(struct sys_notify_context *ctx, 556 void *private_data, 557 struct notify_event *ev), 558 void *private_data, 559 void *handle_p); 560 530 561 531 562 /* The following definitions come from smbd/notify_internal.c */ 532 563 533 struct notify_context *notify_init(TALLOC_CTX *mem_ctx, struct server_id server,564 struct notify_context *notify_init(TALLOC_CTX *mem_ctx, 534 565 struct messaging_context *messaging_ctx, 535 struct event_context *ev,536 connection_struct *conn); 537 bool notify_internal_parent_init(TALLOC_CTX *mem_ctx); 538 NTSTATUS notify_add(struct notify_context *notify, struct notify_entry *e0,539 void (*callback)(void *,const struct notify_event *),566 struct tevent_context *ev); 567 NTSTATUS notify_add(struct notify_context *notify, 568 const char *path, uint32_t filter, uint32_t subdir_filter, 569 void (*callback)(void *, struct timespec, 570 const struct notify_event *), 540 571 void *private_data); 541 572 NTSTATUS notify_remove(struct notify_context *notify, void *private_data); 542 NTSTATUS notify_remove_onelevel(struct notify_context *notify,543 const struct file_id *fid,544 void *private_data);545 void notify_onelevel(struct notify_context *notify, uint32_t action,546 uint32_t filter, struct file_id fid, const char *name);547 573 void notify_trigger(struct notify_context *notify, 548 uint32_t action, uint32_t filter, const char *path); 574 uint32_t action, uint32_t filter, 575 const char *dir, const char *path); 576 577 struct notify_instance; 578 NTSTATUS notify_walk(struct notify_context *notify, 579 bool (*fn)(const char *path, struct server_id server, 580 const struct notify_instance *instance, 581 void *private_data), 582 void *private_data); 549 583 550 584 /* The following definitions come from smbd/ntquotas.c */ … … 557 591 /* The following definitions come from smbd/nttrans.c */ 558 592 559 void send_nt_replies(connection_struct *conn,560 struct smb_request *req, NTSTATUS nt_error,561 char *params, int paramsize,562 char *pdata, int datasize);563 593 void reply_ntcreate_and_X(struct smb_request *req); 564 594 NTSTATUS set_sd(files_struct *fsp, struct security_descriptor *psd, … … 566 596 NTSTATUS set_sd_blob(files_struct *fsp, uint8_t *data, uint32_t sd_len, 567 597 uint32_t security_info_sent); 568 NTSTATUS smb_fsctl(struct files_struct *fsp,569 TALLOC_CTX *ctx,570 uint32_t function,571 uint16_t req_flags, /* Needed for UNICODE ... */572 const uint8_t *_in_data,573 uint32_t in_len,574 uint8_t **_out_data,575 uint32_t max_out_len,576 uint32_t *out_len);577 598 struct ea_list *read_nttrans_ea_list(TALLOC_CTX *ctx, const char *pdata, size_t data_size); 578 599 void reply_ntcancel(struct smb_request *req); … … 590 611 /* The following definitions come from smbd/open.c */ 591 612 592 NTSTATUS smb1_file_se_access_check(connection_struct *conn, 593 const struct security_descriptor *sd, 594 const struct security_token *token, 595 uint32_t access_desired, 596 uint32_t *access_granted); 613 NTSTATUS smbd_check_access_rights(struct connection_struct *conn, 614 const struct smb_filename *smb_fname, 615 bool use_privs, 616 uint32_t access_mask); 617 NTSTATUS fd_open(struct connection_struct *conn, files_struct *fsp, 618 int flags, mode_t mode); 597 619 NTSTATUS fd_close(files_struct *fsp); 598 620 void change_file_owner_to_parent(connection_struct *conn, … … 603 625 const char *fname, 604 626 SMB_STRUCT_STAT *psbuf); 605 bool is_stat_open(uint32 access_mask); 606 bool request_timed_out(struct timeval request_time, 607 struct timeval timeout); 608 bool open_match_attributes(connection_struct *conn, 609 uint32 old_dos_attr, 610 uint32 new_dos_attr, 611 mode_t existing_unx_mode, 612 mode_t new_unx_mode, 613 mode_t *returned_unx_mode); 614 NTSTATUS fcb_or_dos_open(struct smb_request *req, 615 connection_struct *conn, 616 files_struct *fsp_to_dup_into, 617 const struct smb_filename *smb_fname, 618 struct file_id id, 619 uint16 file_pid, 620 uint16 vuid, 621 uint32 access_mask, 622 uint32 share_access, 623 uint32 create_options); 624 void remove_deferred_open_entry(struct file_id id, uint64_t mid, 625 struct server_id pid); 626 NTSTATUS open_file_fchmod(connection_struct *conn, 627 struct smb_filename *smb_fname, 628 files_struct **result); 629 bool check_same_stat(const SMB_STRUCT_STAT *sbuf1, 630 const SMB_STRUCT_STAT *sbuf2); 627 bool is_stat_open(uint32_t access_mask); 628 NTSTATUS send_break_message(struct messaging_context *msg_ctx, 629 const struct share_mode_entry *exclusive, 630 uint16_t break_to); 631 struct deferred_open_record; 632 bool is_deferred_open_async(const struct deferred_open_record *rec); 631 633 NTSTATUS create_directory(connection_struct *conn, struct smb_request *req, 632 634 struct smb_filename *smb_dname); … … 638 640 NTSTATUS open_streams_for_delete(connection_struct *conn, 639 641 const char *fname); 642 int find_share_mode_lease(struct share_mode_data *d, 643 const struct GUID *client_guid, 644 const struct smb2_lease_key *key); 645 struct share_mode_lease; 646 struct fsp_lease *find_fsp_lease(files_struct *new_fsp, 647 const struct smb2_lease_key *key, 648 const struct share_mode_lease *l); 640 649 NTSTATUS create_file_default(connection_struct *conn, 641 650 struct smb_request *req, … … 648 657 uint32_t file_attributes, 649 658 uint32_t oplock_request, 659 struct smb2_lease *lease, 650 660 uint64_t allocation_size, 651 661 uint32_t private_flags, 652 662 struct security_descriptor *sd, 653 663 struct ea_list *ea_list, 654 655 664 files_struct **result, 656 int *pinfo); 665 int *pinfo, 666 const struct smb2_create_blobs *in_context_blobs, 667 struct smb2_create_blobs *out_context_blobs); 668 657 669 NTSTATUS get_relative_fid_filename(connection_struct *conn, 658 670 struct smb_request *req, … … 663 675 /* The following definitions come from smbd/oplock.c */ 664 676 665 int32 get_number_of_exclusive_open_oplocks(void); 677 uint32_t map_oplock_to_lease_type(uint16_t op_type); 678 uint32_t get_lease_type(struct share_mode_data *d, struct share_mode_entry *e); 679 bool update_num_read_oplocks(files_struct *fsp, struct share_mode_lock *lck); 680 666 681 void break_kernel_oplock(struct messaging_context *msg_ctx, files_struct *fsp); 667 bool set_file_oplock(files_struct *fsp, int oplock_type); 668 void release_file_oplock(files_struct *fsp); 682 NTSTATUS set_file_oplock(files_struct *fsp); 669 683 bool remove_oplock(files_struct *fsp); 670 684 bool downgrade_oplock(files_struct *fsp); 671 bool should_notify_deferred_opens(void);672 void break_level2_to_none_async(files_struct *fsp); 673 void reply_to_oplock_break_requests(files_struct *fsp);674 void process_oplock_async_level2_break_message(struct messaging_context *msg_ctx,675 void *private_data,676 uint32_t msg_type,677 struct server_id src,678 DATA_BLOB *data);685 bool fsp_lease_update(struct share_mode_lock *lck, 686 const struct GUID *client_guid, 687 struct fsp_lease *lease); 688 NTSTATUS downgrade_lease(struct smbXsrv_connection *xconn, 689 uint32_t num_file_ids, 690 const struct file_id *ids, 691 const struct smb2_lease_key *key, 692 uint32_t lease_state); 679 693 void contend_level2_oplocks_begin(files_struct *fsp, 680 694 enum level2_contention_type type); 681 695 void contend_level2_oplocks_end(files_struct *fsp, 682 696 enum level2_contention_type type); 697 void smbd_contend_level2_oplocks_begin(files_struct *fsp, 698 enum level2_contention_type type); 699 void smbd_contend_level2_oplocks_end(files_struct *fsp, 700 enum level2_contention_type type); 683 701 void share_mode_entry_to_message(char *msg, const struct share_mode_entry *e); 684 void message_to_share_mode_entry(struct share_mode_entry *e, char *msg); 685 bool init_oplocks(struct messaging_context *msg_ctx); 702 void message_to_share_mode_entry(struct share_mode_entry *e, const char *msg); 703 bool init_oplocks(struct smbd_server_connection *sconn); 704 void init_kernel_oplocks(struct smbd_server_connection *sconn); 686 705 687 706 /* The following definitions come from smbd/oplock_irix.c */ 688 707 689 struct kernel_oplocks *irix_init_kernel_oplocks( TALLOC_CTX *mem_ctx);708 struct kernel_oplocks *irix_init_kernel_oplocks(struct smbd_server_connection *sconn); 690 709 691 710 /* The following definitions come from smbd/oplock_linux.c */ … … 694 713 int linux_set_lease_sighandler(int fd); 695 714 int linux_setlease(int fd, int leasetype); 696 struct kernel_oplocks *linux_init_kernel_oplocks(TALLOC_CTX *mem_ctx) ; 697 698 /* The following definitions come from smbd/oplock_onefs.c */ 699 700 struct kernel_oplocks *onefs_init_kernel_oplocks(TALLOC_CTX *mem_ctx); 715 struct kernel_oplocks *linux_init_kernel_oplocks(struct smbd_server_connection *sconn); 701 716 702 717 /* The following definitions come from smbd/password.c */ 703 718 704 user_struct *get_valid_user_struct(struct smbd_server_connection *sconn, 705 uint16 vuid); 706 bool is_partial_auth_vuid(struct smbd_server_connection *sconn, uint16 vuid); 707 user_struct *get_partial_auth_user_struct(struct smbd_server_connection *sconn, 708 uint16 vuid); 709 void invalidate_vuid(struct smbd_server_connection *sconn, uint16 vuid); 710 void invalidate_all_vuids(struct smbd_server_connection *sconn); 711 int register_initial_vuid(struct smbd_server_connection *sconn); 719 struct user_struct *get_valid_user_struct(struct smbd_server_connection *sconn, 720 uint64_t vuid); 721 void invalidate_vuid(struct smbd_server_connection *sconn, uint64_t vuid); 712 722 int register_homes_share(const char *username); 713 int register_existing_vuid(struct smbd_server_connection *sconn,714 uint16 vuid,715 struct auth_serversupplied_info *session_info,716 DATA_BLOB response_blob,717 const char *smb_name);718 void add_session_user(struct smbd_server_connection *sconn, const char *user);719 void add_session_workgroup(struct smbd_server_connection *sconn,720 const char *workgroup);721 const char *get_session_workgroup(struct smbd_server_connection *sconn);722 bool authorise_login(struct smbd_server_connection *sconn,723 int snum, fstring user, DATA_BLOB password,724 bool *guest);725 723 726 724 /* The following definitions come from smbd/pipes.c */ … … 736 734 737 735 void create_file_sids(const SMB_STRUCT_STAT *psbuf, struct dom_sid *powner_sid, struct dom_sid *pgroup_sid); 738 bool nt4_compatible_acls(void);739 736 uint32_t map_canon_ace_perms(int snum, 740 737 enum security_ace_type *pacl_type, 741 738 mode_t perms, 742 739 bool directory_ace); 743 NTSTATUS unpack_nt_owners(connection_struct *conn, uid_t *puser, gid_t *pgrp, uint32 security_info_sent, const struct security_descriptor *psd);740 NTSTATUS unpack_nt_owners(connection_struct *conn, uid_t *puser, gid_t *pgrp, uint32_t security_info_sent, const struct security_descriptor *psd); 744 741 bool current_user_in_group(connection_struct *conn, gid_t gid); 745 742 SMB_ACL_T free_empty_sys_acl(connection_struct *conn, SMB_ACL_T the_acl); 746 743 NTSTATUS posix_fget_nt_acl(struct files_struct *fsp, uint32_t security_info, 744 TALLOC_CTX *mem_ctx, 747 745 struct security_descriptor **ppdesc); 748 746 NTSTATUS posix_get_nt_acl(struct connection_struct *conn, const char *name, 749 uint32_t security_info, struct security_descriptor **ppdesc); 747 uint32_t security_info, 748 TALLOC_CTX *mem_ctx, 749 struct security_descriptor **ppdesc); 750 750 NTSTATUS try_chown(files_struct *fsp, uid_t uid, gid_t gid); 751 NTSTATUS append_parent_acl(files_struct *fsp, 752 const struct security_descriptor *pcsd, 753 struct security_descriptor **pp_new_sd); 754 NTSTATUS set_nt_acl(files_struct *fsp, uint32 security_info_sent, const struct security_descriptor *psd); 751 NTSTATUS set_nt_acl(files_struct *fsp, uint32_t security_info_sent, const struct security_descriptor *psd); 755 752 int get_acl_group_bits( connection_struct *conn, const char *fname, mode_t *mode ); 756 753 int chmod_acl(connection_struct *conn, const char *name, mode_t mode); … … 760 757 bool set_unix_posix_default_acl(connection_struct *conn, const char *fname, 761 758 const SMB_STRUCT_STAT *psbuf, 762 uint16 num_def_acls, const char *pdata); 763 bool set_unix_posix_acl(connection_struct *conn, files_struct *fsp, const char *fname, uint16 num_acls, const char *pdata); 764 struct security_descriptor *get_nt_acl_no_snum( TALLOC_CTX *ctx, const char *fname); 759 uint16_t num_def_acls, const char *pdata); 760 bool set_unix_posix_acl(connection_struct *conn, files_struct *fsp, const char *fname, uint16_t num_acls, const char *pdata); 761 NTSTATUS get_nt_acl_no_snum( TALLOC_CTX *ctx, const char *fname, 762 uint32_t security_info_wanted, 763 struct security_descriptor **sd); 765 764 NTSTATUS make_default_filesystem_acl(TALLOC_CTX *ctx, 766 765 const char *name, 767 766 SMB_STRUCT_STAT *psbuf, 768 767 struct security_descriptor **ppdesc); 768 int posix_sys_acl_blob_get_file(vfs_handle_struct *handle, 769 const char *path_p, 770 TALLOC_CTX *mem_ctx, 771 char **blob_description, 772 DATA_BLOB *blob); 773 int posix_sys_acl_blob_get_fd(vfs_handle_struct *handle, 774 files_struct *fsp, 775 TALLOC_CTX *mem_ctx, 776 char **blob_description, 777 DATA_BLOB *blob); 769 778 770 779 /* The following definitions come from smbd/process.c */ 771 780 772 bool srv_send_smb(struct smbd_server_connection *sconn, char *buffer, 781 void smbd_setup_sig_term_handler(struct smbd_server_connection *sconn); 782 void smbd_setup_sig_hup_handler(struct smbd_server_connection *sconn); 783 bool srv_send_smb(struct smbXsrv_connection *xconn, char *buffer, 773 784 bool no_signing, uint32_t seqnum, 774 785 bool do_encrypt, … … 778 789 int num_bytes, 779 790 bool zero); 780 void remove_deferred_open_message_smb(uint64_t mid); 781 void schedule_deferred_open_message_smb(uint64_t mid); 782 bool open_was_deferred(uint64_t mid); 791 void remove_deferred_open_message_smb(struct smbXsrv_connection *xconn, 792 uint64_t mid); 793 bool schedule_deferred_open_message_smb(struct smbXsrv_connection *xconn, 794 uint64_t mid); 795 bool open_was_deferred(struct smbXsrv_connection *xconn, uint64_t mid); 783 796 bool get_deferred_open_message_state(struct smb_request *smbreq, 784 797 struct timeval *p_request_time, 785 void **pp_state);798 struct deferred_open_record **open_rec); 786 799 bool push_deferred_open_message_smb(struct smb_request *req, 787 struct timeval request_time, 788 struct timeval timeout, 789 struct file_id id, 790 char *private_data, 791 size_t priv_len); 792 struct idle_event *event_add_idle(struct event_context *event_ctx, 793 TALLOC_CTX *mem_ctx, 794 struct timeval interval, 795 const char *name, 796 bool (*handler)(const struct timeval *now, 797 void *private_data), 798 void *private_data); 800 struct timeval request_time, 801 struct timeval timeout, 802 struct file_id id, 803 struct deferred_open_record *open_rec); 799 804 NTSTATUS allow_new_trans(struct trans_state *list, uint64_t mid); 800 void reply_outbuf(struct smb_request *req, uint8 num_words, uint32 num_bytes); 805 void reply_outbuf(struct smb_request *req, uint8_t num_words, uint32_t num_bytes); 806 void smb_request_done(struct smb_request *req); 801 807 const char *smb_fn_name(int type); 802 void add_to_common_flags2(uint32 v);803 void remove_from_common_flags2(uint32 v);808 void add_to_common_flags2(uint32_t v); 809 void remove_from_common_flags2(uint32_t v); 804 810 void construct_reply_common_req(struct smb_request *req, char *outbuf); 805 size_t req_wct_ofs(struct smb_request *req); 806 void chain_reply(struct smb_request *req); 807 bool req_is_in_chain(struct smb_request *req); 808 void smbd_process(struct smbd_server_connection *sconn); 809 bool fork_echo_handler(struct smbd_server_connection *sconn); 811 bool smb1_is_chain(const uint8_t *buf); 812 bool smb1_walk_chain(const uint8_t *buf, 813 bool (*fn)(uint8_t cmd, 814 uint8_t wct, const uint16_t *vwv, 815 uint16_t num_bytes, const uint8_t *bytes, 816 void *private_data), 817 void *private_data); 818 unsigned smb1_chain_length(const uint8_t *buf); 819 bool smb1_parse_chain(TALLOC_CTX *mem_ctx, const uint8_t *buf, 820 struct smbXsrv_connection *xconn, 821 bool encrypted, uint32_t seqnum, 822 struct smb_request ***reqs, unsigned *num_reqs); 823 bool req_is_in_chain(const struct smb_request *req); 824 void smbd_process(struct tevent_context *ev_ctx, 825 struct messaging_context *msg_ctx, 826 int sock_fd, 827 bool interactive); 828 bool fork_echo_handler(struct smbXsrv_connection *xconn); 810 829 811 830 /* The following definitions come from smbd/quotas.c */ 812 831 813 bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize); 814 bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize); 815 bool disk_quotas(const char *path, 816 uint64_t *bsize, 817 uint64_t *dfree, 818 uint64_t *dsize); 819 bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize); 820 bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize); 821 bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize); 832 bool disk_quotas(connection_struct *conn, const char *path, uint64_t *bsize, 833 uint64_t *dfree, uint64_t *dsize); 822 834 bool disk_quotas_vxfs(const char *name, char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize); 823 bool disk_quotas(const char *path,uint64_t *bsize,uint64_t *dfree,uint64_t *dsize);824 bool disk_quotas(const char *path,uint64_t *bsize,uint64_t *dfree,uint64_t *dsize);825 835 826 836 /* The following definitions come from smbd/reply.c */ … … 831 841 size_t srvstr_get_path_wcard(TALLOC_CTX *ctx, 832 842 const char *inbuf, 833 uint16 smb_flags2, 843 uint16_t smb_flags2, 844 char **pp_dest, 845 const char *src, 846 size_t src_len, 847 int flags, 848 NTSTATUS *err, 849 bool *contains_wcard); 850 size_t srvstr_get_path_wcard_posix(TALLOC_CTX *ctx, 851 const char *inbuf, 852 uint16_t smb_flags2, 834 853 char **pp_dest, 835 854 const char *src, … … 840 859 size_t srvstr_get_path(TALLOC_CTX *ctx, 841 860 const char *inbuf, 842 uint16 smb_flags2, 861 uint16_t smb_flags2, 862 char **pp_dest, 863 const char *src, 864 size_t src_len, 865 int flags, 866 NTSTATUS *err); 867 size_t srvstr_get_path_posix(TALLOC_CTX *ctx, 868 const char *inbuf, 869 uint16_t smb_flags2, 843 870 char **pp_dest, 844 871 const char *src, … … 852 879 char **pp_dest, const char *src, int flags, 853 880 NTSTATUS *err); 881 size_t srvstr_pull_req_talloc(TALLOC_CTX *ctx, struct smb_request *req, 882 char **dest, const uint8_t *src, int flags); 854 883 bool check_fsp_open(connection_struct *conn, struct smb_request *req, 855 884 files_struct *fsp); … … 858 887 bool check_fsp_ntquota_handle(connection_struct *conn, struct smb_request *req, 859 888 files_struct *fsp); 860 void reply_special(struct smb d_server_connection *sconn, char *inbuf, size_t inbuf_len);889 void reply_special(struct smbXsrv_connection *xconn, char *inbuf, size_t inbuf_size); 861 890 void reply_tcon(struct smb_request *req); 862 891 void reply_tcon_and_X(struct smb_request *req); 863 void reply_unknown_new(struct smb_request *req, uint8 type);892 void reply_unknown_new(struct smb_request *req, uint8_t type); 864 893 void reply_ioctl(struct smb_request *req); 865 894 void reply_checkpath(struct smb_request *req); … … 875 904 void reply_ctemp(struct smb_request *req); 876 905 NTSTATUS unlink_internals(connection_struct *conn, struct smb_request *req, 877 uint32 dirtype, struct smb_filename *smb_fname,906 uint32_t dirtype, struct smb_filename *smb_fname, 878 907 bool has_wild); 879 908 void reply_unlink(struct smb_request *req); 880 ssize_t fake_sendfile(files_struct *fsp, SMB_OFF_T startpos, size_t nread); 881 void sendfile_short_send(files_struct *fsp, 882 ssize_t nread, 883 size_t headersize, 884 size_t smb_maxcnt); 909 ssize_t fake_sendfile(struct smbXsrv_connection *xconn, files_struct *fsp, 910 off_t startpos, size_t nread); 911 ssize_t sendfile_short_send(struct smbXsrv_connection *xconn, 912 files_struct *fsp, 913 ssize_t nread, 914 size_t headersize, 915 size_t smb_maxcnt); 885 916 void reply_readbraw(struct smb_request *req); 886 917 void reply_lockread(struct smb_request *req); … … 891 922 void reply_writeunlock(struct smb_request *req); 892 923 void reply_write(struct smb_request *req); 893 bool is_valid_writeX_buffer(struct smb d_server_connection *sconn,924 bool is_valid_writeX_buffer(struct smbXsrv_connection *xconn, 894 925 const uint8_t *inbuf); 895 926 void reply_write_and_X(struct smb_request *req); … … 912 943 files_struct *fsp, 913 944 const struct smb_filename *smb_fname_dst_in, 914 uint32 attrs,945 uint32_t attrs, 915 946 bool replace_if_exists); 916 947 NTSTATUS rename_internals(TALLOC_CTX *ctx, … … 919 950 struct smb_filename *smb_fname_src, 920 951 struct smb_filename *smb_fname_dst, 921 uint32 attrs,952 uint32_t attrs, 922 953 bool replace_if_exists, 923 954 bool src_has_wild, … … 938 969 bool large_file_format); 939 970 uint64_t get_lock_offset(const uint8_t *data, int data_offset, 940 bool large_file_format , bool *err);971 bool large_file_format); 941 972 void reply_lockingX(struct smb_request *req); 942 973 void reply_readbmpx(struct smb_request *req); … … 949 980 /* The following definitions come from smbd/seal.c */ 950 981 951 uint16_t srv_enc_ctx(void);952 982 bool is_encrypted_packet(const uint8_t *inbuf); 953 void srv_free_enc_buffer(char *buf); 954 NTSTATUS srv_decrypt_buffer(char *buf); 955 NTSTATUS srv_encrypt_buffer(char *buf, char **buf_out); 983 void srv_free_enc_buffer(struct smbXsrv_connection *xconn, char *buf); 984 NTSTATUS srv_decrypt_buffer(struct smbXsrv_connection *xconn, char *buf); 985 NTSTATUS srv_encrypt_buffer(struct smbXsrv_connection *xconn, char *buf, 986 char **buf_out); 956 987 NTSTATUS srv_request_encryption_setup(connection_struct *conn, 957 988 unsigned char **ppdata, … … 960 991 size_t *p_param_size); 961 992 NTSTATUS srv_encryption_start(connection_struct *conn); 962 void server_encryption_shutdown( void);993 void server_encryption_shutdown(struct smbXsrv_connection *xconn); 963 994 964 995 /* The following definitions come from smbd/sec_ctx.c */ … … 970 1001 bool pop_sec_ctx(void); 971 1002 void init_sec_ctx(void); 1003 const struct security_token *sec_ctx_active_token(void); 972 1004 973 1005 /* The following definitions come from smbd/server.c */ 974 1006 975 struct event_context *smbd_event_context(void);976 struct messaging_context *smbd_messaging_context(void);977 1007 struct memcache *smbd_memcache(void); 978 void reload_printers(struct tevent_context *ev, 979 struct messaging_context *msg_ctx); 980 void reload_printers_full(struct tevent_context *ev, 981 struct messaging_context *msg_ctx); 982 bool reload_services(struct messaging_context *msg_ctx, int smb_sock,1008 bool snum_is_shared_printer(int snum); 1009 void delete_and_reload_printers(struct tevent_context *ev, 1010 struct messaging_context *msg_ctx); 1011 bool reload_services(struct smbd_server_connection *sconn, 1012 bool (*snumused) (struct smbd_server_connection *, int), 983 1013 bool test); 984 void exit_server(const char *const explanation); 985 void exit_server_cleanly(const char *const explanation); 986 void exit_server_fault(void); 1014 1015 /* The following definitions come from smbd/server_exit.c */ 1016 1017 void smbd_exit_server(const char *reason) _NORETURN_; 1018 void smbd_exit_server_cleanly(const char *const reason) _NORETURN_; 987 1019 988 1020 /* The following definitions come from smbd/service.c */ … … 990 1022 bool set_conn_connectpath(connection_struct *conn, const char *connectpath); 991 1023 NTSTATUS set_conn_force_user_group(connection_struct *conn, int snum); 992 bool set_current_service(connection_struct *conn, uint16 flags, bool do_chdir);1024 bool set_current_service(connection_struct *conn, uint16_t flags, bool do_chdir); 993 1025 void load_registry_shares(void); 994 1026 int add_home_service(const char *service, const char *username, const char *homedir); 995 1027 int find_service(TALLOC_CTX *ctx, const char *service, char **p_service_out); 996 struct smbd_smb2_tcon; 997 connection_struct *make_connection_smb2(struct smbd_server_connection *sconn, 998 struct smbd_smb2_tcon *tcon, 999 user_struct *vuser, 1000 DATA_BLOB password, 1028 connection_struct *make_connection_smb2(struct smbd_smb2_request *req, 1029 struct smbXsrv_tcon *tcon, 1030 int snum, 1031 struct user_struct *vuser, 1001 1032 const char *pdev, 1002 1033 NTSTATUS *pstatus); 1003 connection_struct *make_connection(struct smbd_server_connection *sconn, 1004 const char *service_in, DATA_BLOB password, 1005 const char *pdev, uint16 vuid, 1034 connection_struct *make_connection(struct smb_request *req, 1035 NTTIME now, 1036 const char *service_in, 1037 const char *pdev, uint64_t vuid, 1006 1038 NTSTATUS *status); 1007 void close_cnum(connection_struct *conn, uint 16vuid);1039 void close_cnum(connection_struct *conn, uint64_t vuid); 1008 1040 1009 1041 /* The following definitions come from smbd/session.c */ 1010 1042 struct sessionid; 1043 struct smbXsrv_session; 1011 1044 bool session_init(void); 1012 bool session_claim(struct smb d_server_connection *sconn, user_struct *vuser);1013 void session_yield( user_struct *vuser);1045 bool session_claim(struct smbXsrv_session *session); 1046 void session_yield(struct smbXsrv_session *session); 1014 1047 int list_sessions(TALLOC_CTX *mem_ctx, struct sessionid **session_list); 1048 int find_sessions(TALLOC_CTX *mem_ctx, const char *username, 1049 const char *machine, struct sessionid **session_list); 1015 1050 1016 1051 /* The following definitions come from smbd/sesssetup.c */ 1017 1052 1018 NTSTATUS do_map_to_guest(NTSTATUS status,1019 struct auth_serversupplied_info **session_info,1020 const char *user, const char *domain);1021 1022 NTSTATUS parse_spnego_mechanisms(TALLOC_CTX *ctx,1023 DATA_BLOB blob_in,1024 DATA_BLOB *pblob_out,1025 char **kerb_mechOID);1026 1053 void reply_sesssetup_and_X(struct smb_request *req); 1027 1054 … … 1042 1069 /* The following definitions come from smbd/srvstr.c */ 1043 1070 1044 size_t srvstr_push_fn(const char *function, unsigned int line, 1045 const char *base_ptr, uint16 smb_flags2, void *dest, 1046 const char *src, int dest_len, int flags); 1047 ssize_t message_push_string(uint8 **outbuf, const char *str, int flags); 1071 NTSTATUS srvstr_push_fn(const char *base_ptr, uint16_t smb_flags2, void *dest, 1072 const char *src, int dest_len, int flags, size_t *ret_len); 1073 ssize_t message_push_string(uint8_t **outbuf, const char *str, int flags); 1048 1074 1049 1075 /* The following definitions come from smbd/statcache.c */ … … 1058 1084 char **pp_start, 1059 1085 SMB_STRUCT_STAT *pst); 1086 void smbd_send_stat_cache_delete_message(struct messaging_context *msg_ctx, 1087 const char *name); 1060 1088 void send_stat_cache_delete_message(struct messaging_context *msg_ctx, 1061 1089 const char *name); … … 1071 1099 /* The following definitions come from smbd/trans2.c */ 1072 1100 1101 NTSTATUS check_access_fsp(const struct files_struct *fsp, 1102 uint32_t access_mask); 1103 NTSTATUS check_access(connection_struct *conn, 1104 files_struct *fsp, 1105 const struct smb_filename *smb_fname, 1106 uint32_t access_mask); 1073 1107 uint64_t smb_roundup(connection_struct *conn, uint64_t val); 1074 1108 uint64_t get_FileIndex(connection_struct *conn, const SMB_STRUCT_STAT *psbuf); 1109 bool samba_private_attr_name(const char *unix_ea_name); 1075 1110 NTSTATUS get_ea_value(TALLOC_CTX *mem_ctx, connection_struct *conn, 1076 1111 files_struct *fsp, const char *fname, … … 1084 1119 void send_trans2_replies(connection_struct *conn, 1085 1120 struct smb_request *req, 1121 NTSTATUS status, 1086 1122 const char *params, 1087 1123 int paramsize, … … 1109 1145 1110 1146 bool change_to_guest(void); 1111 void conn_clear_vuid_cache(connection_struct *conn, uint16_t vuid); 1112 bool change_to_user(connection_struct *conn, uint16 vuid); 1113 bool change_to_user_by_session(connection_struct *conn, 1114 const struct auth_serversupplied_info *session_info); 1115 bool change_to_root_user(void); 1116 bool become_authenticated_pipe_user(struct auth_serversupplied_info *session_info); 1117 bool unbecome_authenticated_pipe_user(void); 1147 NTSTATUS check_user_share_access(connection_struct *conn, 1148 const struct auth_session_info *session_info, 1149 uint32_t *p_share_access, 1150 bool *p_readonly_share); 1151 bool change_to_user(connection_struct *conn, uint64_t vuid); 1152 bool smbd_change_to_root_user(void); 1153 bool smbd_become_authenticated_pipe_user(struct auth_session_info *session_info); 1154 bool smbd_unbecome_authenticated_pipe_user(void); 1118 1155 void become_root(void); 1119 1156 void unbecome_root(void); 1120 bool become_user(connection_struct *conn, uint16 vuid); 1157 void smbd_become_root(void); 1158 void smbd_unbecome_root(void); 1159 bool become_user(connection_struct *conn, uint64_t vuid); 1121 1160 bool become_user_by_session(connection_struct *conn, 1122 const struct auth_se rversupplied_info *session_info);1161 const struct auth_session_info *session_info); 1123 1162 bool unbecome_user(void); 1124 1163 uid_t get_current_uid(connection_struct *conn); … … 1126 1165 const struct security_unix_token *get_current_utok(connection_struct *conn); 1127 1166 const struct security_token *get_current_nttok(connection_struct *conn); 1128 uint 16_t get_current_vuid(connection_struct *conn);1167 uint64_t get_current_vuid(connection_struct *conn); 1129 1168 1130 1169 /* The following definitions come from smbd/utmp.c */ 1131 1170 1132 1171 void sys_utmp_claim(const char *username, const char *hostname, 1133 const char *ip_addr_str, 1134 const char *id_str, int id_num); 1172 const char *id_str, int id_num); 1135 1173 void sys_utmp_yield(const char *username, const char *hostname, 1136 const char *ip_addr_str, 1137 const char *id_str, int id_num); 1138 void sys_utmp_yield(const char *username, const char *hostname, 1139 const char *ip_addr_str, 1140 const char *id_str, int id_num); 1141 void sys_utmp_claim(const char *username, const char *hostname, 1142 const char *ip_addr_str, 1143 const char *id_str, int id_num); 1174 const char *id_str, int id_num); 1144 1175 1145 1176 /* The following definitions come from smbd/vfs.c */ 1146 1177 1147 NTSTATUS smb_register_vfs(int version, const char *name,1148 const struct vfs_fn_pointers *fns);1149 1178 bool vfs_init_custom(connection_struct *conn, const char *vfs_object); 1150 void *vfs_add_fsp_extension_notype(vfs_handle_struct *handle,1151 files_struct *fsp, size_t ext_size,1152 void (*destroy_fn)(void *p_data));1153 void vfs_remove_fsp_extension(vfs_handle_struct *handle, files_struct *fsp);1154 void *vfs_memctx_fsp_extension(vfs_handle_struct *handle, files_struct *fsp);1155 void *vfs_fetch_fsp_extension(vfs_handle_struct *handle, files_struct *fsp);1156 1179 bool smbd_vfs_init(connection_struct *conn); 1157 1180 NTSTATUS vfs_file_exist(connection_struct *conn, struct smb_filename *smb_fname); 1158 1181 ssize_t vfs_read_data(files_struct *fsp, char *buf, size_t byte_count); 1159 ssize_t vfs_pread_data(files_struct *fsp, char *buf,1160 size_t byte_count, SMB_OFF_T offset);1161 1182 ssize_t vfs_write_data(struct smb_request *req, 1162 1183 files_struct *fsp, … … 1167 1188 const char *buffer, 1168 1189 size_t N, 1169 SMB_OFF_Toffset);1190 off_t offset); 1170 1191 int vfs_allocate_file_space(files_struct *fsp, uint64_t len); 1171 int vfs_set_filelen(files_struct *fsp, SMB_OFF_Tlen);1172 int vfs_slow_fallocate(files_struct *fsp, SMB_OFF_T offset, SMB_OFF_Tlen);1173 int vfs_fill_sparse(files_struct *fsp, SMB_OFF_Tlen);1174 SMB_OFF_T vfs_transfer_file(files_struct *in, files_struct *out, SMB_OFF_Tn);1192 int vfs_set_filelen(files_struct *fsp, off_t len); 1193 int vfs_slow_fallocate(files_struct *fsp, off_t offset, off_t len); 1194 int vfs_fill_sparse(files_struct *fsp, off_t len); 1195 off_t vfs_transfer_file(files_struct *in, files_struct *out, off_t n); 1175 1196 const char *vfs_readdirname(connection_struct *conn, void *p, 1176 1197 SMB_STRUCT_STAT *sbuf, char **talloced); … … 1178 1199 char *vfs_GetWd(TALLOC_CTX *ctx, connection_struct *conn); 1179 1200 NTSTATUS check_reduced_name(connection_struct *conn, const char *fname); 1180 int vfs_stat_smb_fname(struct connection_struct *conn, const char *fname, 1181 SMB_STRUCT_STAT *psbuf); 1182 int vfs_lstat_smb_fname(struct connection_struct *conn, const char *fname, 1201 NTSTATUS check_reduced_name_with_privilege(connection_struct *conn, 1202 const char *fname, 1203 struct smb_request *smbreq); 1204 int vfs_stat_smb_basename(struct connection_struct *conn, const char *fname, 1183 1205 SMB_STRUCT_STAT *psbuf); 1184 1206 NTSTATUS vfs_stat_fsp(files_struct *fsp); … … 1196 1218 uint16_t port); 1197 1219 1198 /* The following definitions come from smbd/msg_idmap.c */ 1199 1200 void msg_idmap_register_msgs(struct messaging_context *ctx); 1220 /* The following definitions come from smbd/smb2_create.c */ 1221 1222 NTSTATUS vfs_default_durable_cookie(struct files_struct *fsp, 1223 TALLOC_CTX *mem_ctx, 1224 DATA_BLOB *cookie_blob); 1225 NTSTATUS vfs_default_durable_disconnect(struct files_struct *fsp, 1226 const DATA_BLOB old_cookie, 1227 TALLOC_CTX *mem_ctx, 1228 DATA_BLOB *new_cookie); 1229 NTSTATUS vfs_default_durable_reconnect(struct connection_struct *conn, 1230 struct smb_request *smb1req, 1231 struct smbXsrv_open *op, 1232 const DATA_BLOB old_cookie, 1233 TALLOC_CTX *mem_ctx, 1234 files_struct **result, 1235 DATA_BLOB *new_cookie); 1201 1236 1202 1237 #endif /* _SMBD_PROTO_H_ */
Note:
See TracChangeset
for help on using the changeset viewer.