TALLOC_CTX *mem_ctx,
const struct auth_usersupplied_info *user_info,
struct auth_serversupplied_info **server_info);
+NTSTATUS check_sam_security_info3(const DATA_BLOB *challenge,
+ TALLOC_CTX *mem_ctx,
+ const struct auth_usersupplied_info *user_info,
+ struct netr_SamInfo3 **pinfo3);
NTSTATUS auth_sam_init(void);
/* The following definitions come from auth/auth_server.c */
/* The following definitions come from auth/auth_util.c */
NTSTATUS make_user_info_map(struct auth_usersupplied_info **user_info,
- const char *smb_name,
- const char *client_domain,
+ const char *smb_name,
+ const char *client_domain,
const char *workstation_name,
- DATA_BLOB *lm_pwd, DATA_BLOB *nt_pwd,
- DATA_BLOB *lm_interactive_pwd, DATA_BLOB *nt_interactive_pwd,
- DATA_BLOB *plaintext,
- bool encrypted);
+ DATA_BLOB *lm_pwd,
+ DATA_BLOB *nt_pwd,
+ const struct samr_Password *lm_interactive_pwd,
+ const struct samr_Password *nt_interactive_pwd,
+ const char *plaintext,
+ enum auth_password_state password_state);
bool make_user_info_netlogon_network(struct auth_usersupplied_info **user_info,
const char *smb_name,
const char *client_domain,
NTSTATUS make_server_info_system(TALLOC_CTX *mem_ctx,
struct auth_serversupplied_info **server_info);
bool copy_current_user(struct current_user *dst, struct current_user *src);
-struct passwd *smb_getpwnam( TALLOC_CTX *mem_ctx, char *domuser,
+struct passwd *smb_getpwnam( TALLOC_CTX *mem_ctx, const char *domuser,
fstring save_username, bool create );
NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
const char *sent_nt_username,
/* The following definitions come from auth/user_info.c */
-NTSTATUS make_user_info(struct auth_usersupplied_info **user_info,
+NTSTATUS make_user_info(struct auth_usersupplied_info **ret_user_info,
const char *smb_name,
const char *internal_username,
const char *client_domain,
const char *workstation_name,
const DATA_BLOB *lm_pwd,
const DATA_BLOB *nt_pwd,
- const DATA_BLOB *lm_interactive_pwd,
- const DATA_BLOB *nt_interactive_pwd,
- const DATA_BLOB *plaintext,
- bool encrypted);
+ const struct samr_Password *lm_interactive_pwd,
+ const struct samr_Password *nt_interactive_pwd,
+ const char *plaintext_password,
+ enum auth_password_state password_state);
void free_user_info(struct auth_usersupplied_info **user_info);
/* The following definitions come from auth/auth_winbind.c */
bool smb_pam_claim_session(char *user, char *tty, char *rhost);
bool smb_pam_close_session(char *user, char *tty, char *rhost);
-NTSTATUS smb_pam_accountcheck(const char * user);
+NTSTATUS smb_pam_accountcheck(const char *user, const char *rhost);
NTSTATUS smb_pam_passcheck(const char * user, const char * password);
bool smb_pam_passchange(const char * user, const char * oldpassword, const char * newpassword);
-NTSTATUS smb_pam_accountcheck(const char * user);
bool smb_pam_claim_session(char *user, char *tty, char *rhost);
bool smb_pam_close_session(char *in_user, char *tty, char *rhost);
void dfs_unlogin(void);
NTSTATUS pass_check(const struct passwd *pass, const char *user, const char *password,
- int pwlen, bool (*fn) (const char *, const char *), bool run_cracker);
+ bool run_cracker);
/* The following definitions come from auth/token_util.c */
const char **allow_list,
const char *cname,
const char *caddr);
-bool check_access(int sock, const char **allow_list, const char **deny_list);
/* The following definitions come from passdb/account_pol.c */
int sys_get_xfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp);
int sys_set_xfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp);
+int sys_get_nfs_quota(const char *path, const char *bdev,
+ enum SMB_QUOTA_TYPE qtype,
+ unid_t id, SMB_DISK_QUOTA *dp);
+int sys_set_nfs_quota(const char *path, const char *bdev,
+ enum SMB_QUOTA_TYPE qtype,
+ unid_t id, SMB_DISK_QUOTA *dp);
+
/* The following definitions come from lib/system.c */
void *sys_memalign( size_t align, size_t size );
NTSTATUS read_smb_length_return_keepalive(int fd, char *inbuf,
unsigned int timeout,
size_t *len);
-NTSTATUS read_smb_length(int fd, char *inbuf, unsigned int timeout,
- size_t *len);
NTSTATUS receive_smb_raw(int fd,
char *buffer,
size_t buflen,
bool cli_state_seqnum_remove(struct cli_state *cli,
uint16_t mid);
bool cli_receive_smb(struct cli_state *cli);
-ssize_t cli_receive_smb_data(struct cli_state *cli, char *buffer, size_t len);
bool cli_receive_smb_readX_header(struct cli_state *cli);
bool cli_send_smb(struct cli_state *cli);
bool cli_send_smb_direct_writeX(struct cli_state *cli,
uint16_t *pfid);
uint8_t *smb_bytes_push_str(uint8_t *buf, bool ucs2, const char *str,
size_t str_len, size_t *pconverted_size);
+uint8_t *smb_bytes_push_bytes(uint8_t *buf, uint8_t prefix,
+ const uint8_t *bytes, size_t num_bytes);
struct tevent_req *cli_open_create(TALLOC_CTX *mem_ctx,
struct event_context *ev,
struct cli_state *cli, const char *fname,
/* The following definitions come from libsmb/clilist.c */
-int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute,
- void (*fn)(const char *, struct file_info *, const char *,
- void *), void *state);
-int cli_list_old(struct cli_state *cli,const char *Mask,uint16 attribute,
- void (*fn)(const char *, struct file_info *, const char *,
- void *), void *state);
+NTSTATUS cli_list_old(struct cli_state *cli,const char *Mask,uint16 attribute,
+ void (*fn)(const char *, struct file_info *,
+ const char *, void *), void *state);
+NTSTATUS cli_list_trans(struct cli_state *cli, const char *mask,
+ uint16_t attribute, int info_level,
+ void (*fn)(const char *mnt, struct file_info *finfo,
+ const char *mask, void *private_data),
+ void *private_data);
+struct tevent_req *cli_list_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct cli_state *cli,
+ const char *mask,
+ uint16_t attribute,
+ uint16_t info_level);
+NTSTATUS cli_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
+ struct file_info **finfo, size_t *num_finfo);
NTSTATUS cli_list(struct cli_state *cli,const char *Mask,uint16 attribute,
void (*fn)(const char *, struct file_info *, const char *,
void *), void *state);
uint32_t max_rdata,
uint8_t **rdata, uint32_t *num_rdata);
+struct tevent_req *cli_flush_send(TALLOC_CTX *mem_ctx,
+ struct event_context *ev,
+ struct cli_state *cli,
+ uint16_t fnum);
+NTSTATUS cli_flush_recv(struct tevent_req *req);
+NTSTATUS cli_flush(TALLOC_CTX *mem_ctx, struct cli_state *cli, uint16_t fnum);
+
/* The following definitions come from libsmb/clirap2.c */
struct rap_group_info_1;
struct rap_user_info_1;
bool lp_winbind_rpc_only(void);
bool lp_create_krb5_conf(void);
const char *lp_idmap_backend(void);
-char *lp_idmap_alloc_backend(void);
+bool lp_idmap_read_only(void);
int lp_idmap_cache_time(void);
int lp_idmap_negative_cache_time(void);
int lp_keepalive(void);
bool lp_null_passwords(void);
bool lp_obey_pam_restrictions(void);
bool lp_encrypted_passwords(void);
-bool lp_update_encrypted(void);
int lp_client_schannel(void);
int lp_server_schannel(void);
bool lp_syslog_only(void);
void gfree_loadparm(void);
void lp_set_in_client(bool b);
bool lp_is_in_client(void);
-bool lp_load_ex(const char *pszFname,
- bool global_only,
- bool save_defaults,
- bool add_ipc,
- bool initialize_globals,
- bool allow_include_registry,
- bool allow_registry_shares);
bool lp_load(const char *pszFname,
bool global_only,
bool save_defaults,
/* The following definitions come from printing/load.c */
-void load_printers(void);
+void load_printers(struct tevent_context *ev,
+ struct messaging_context *msg_ctx);
/* The following definitions come from printing/lpq_parse.c */
void notify_job_status(struct tevent_context *ev,
struct messaging_context *msg_ctx,
const char *sharename, uint32 jobid, uint32 status);
-void notify_job_total_bytes(const char *sharename, uint32 jobid,
+void notify_job_total_bytes(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ const char *sharename, uint32 jobid,
uint32 size);
-void notify_job_total_pages(const char *sharename, uint32 jobid,
+void notify_job_total_pages(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ const char *sharename, uint32 jobid,
uint32 pages);
-void notify_job_username(const char *sharename, uint32 jobid, char *name);
-void notify_job_name(const char *sharename, uint32 jobid, char *name);
-void notify_job_submitted(const char *sharename, uint32 jobid,
+void notify_job_username(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ const char *sharename, uint32 jobid, char *name);
+void notify_job_name(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ const char *sharename, uint32 jobid, char *name);
+void notify_job_submitted(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ const char *sharename, uint32 jobid,
time_t submitted);
-void notify_printer_driver(int snum, const char *driver_name);
-void notify_printer_comment(int snum, const char *comment);
-void notify_printer_sharename(int snum, const char *share_name);
-void notify_printer_printername(int snum, const char *printername);
-void notify_printer_port(int snum, const char *port_name);
-void notify_printer_location(int snum, const char *location);
-void notify_printer_byname( const char *printername, uint32 change, const char *value );
+void notify_printer_driver(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ int snum, const char *driver_name);
+void notify_printer_comment(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ int snum, const char *comment);
+void notify_printer_sharename(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ int snum, const char *share_name);
+void notify_printer_printername(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ int snum, const char *printername);
+void notify_printer_port(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ int snum, const char *port_name);
+void notify_printer_location(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ int snum, const char *location);
+void notify_printer_byname(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ const char *printername, uint32 change,
+ const char *value);
/* The following definitions come from printing/pcap.c */
-void pcap_cache_reload(void);
+void pcap_cache_reload(struct tevent_context *ev,
+ struct messaging_context *msg_ctx);
bool pcap_printername_ok(const char *printername);
/* The following definitions come from printing/printing.c */
struct rpc_pipe_client **presult);
struct pipes_struct *make_internal_rpc_pipe_p(TALLOC_CTX *mem_ctx,
const struct ndr_syntax_id *syntax,
- const char *client_address,
+ struct client_address *client_id,
struct auth_serversupplied_info *server_info,
struct messaging_context *msg_ctx);
NTSTATUS rpc_pipe_open_internal(TALLOC_CTX *mem_ctx,
const struct ndr_syntax_id *abstract_syntax,
struct auth_serversupplied_info *serversupplied_info,
+ struct client_address *client_id,
struct messaging_context *msg_ctx,
struct rpc_pipe_client **presult);
NTSTATUS rpc_connect_spoolss_pipe(connection_struct *conn,
NTSTATUS cli_get_session_key(TALLOC_CTX *mem_ctx,
struct rpc_pipe_client *cli,
DATA_BLOB *session_key);
-NTSTATUS rpc_pipe_open_local(TALLOC_CTX *mem_ctx,
- struct rpc_cli_smbd_conn *conn,
- const struct ndr_syntax_id *syntax,
- struct rpc_pipe_client **presult);
/* The following definitions come from rpc_client/rpc_transport_np.c */
const struct ndr_syntax_id *interface,
const struct api_struct *cmds, int size);
bool is_known_pipename(const char *cli_filename, struct ndr_syntax_id *syntax);
-bool api_pipe_bind_req(struct pipes_struct *p, struct ncacn_packet *pkt);
-bool api_pipe_alter_context(struct pipes_struct *p, struct ncacn_packet *pkt);
-void free_pipe_rpc_context( PIPE_RPC_FNS *list );
-bool api_pipe_request(struct pipes_struct *p, struct ncacn_packet *pkt);
/* The following definitions come from rpc_server/srv_pipe_hnd.c */
NTSTATUS np_open(TALLOC_CTX *mem_ctx, const char *name,
const struct tsocket_address *local_address,
const struct tsocket_address *remote_address,
+ struct client_address *client_id,
struct auth_serversupplied_info *server_info,
struct messaging_context *msg_ctx,
struct fake_file_handle **phandle);
uint32_t msg_type,
struct server_id server_id,
DATA_BLOB *data);
-void update_monitored_printq_cache( void );
+void update_monitored_printq_cache(struct messaging_context *msg_ctx);
void reset_all_printerdata(struct messaging_context *msg,
void *private_data,
uint32_t msg_type,
void smbd_setup_sig_term_handler(void);
void smbd_setup_sig_hup_handler(struct tevent_context *ev,
struct messaging_context *msg_ctx);
-bool srv_send_smb(int fd, char *buffer,
+bool srv_send_smb(struct smbd_server_connection *sconn, char *buffer,
bool no_signing, uint32_t seqnum,
bool do_encrypt,
struct smb_perfcount_data *pcd);
size_t req_wct_ofs(struct smb_request *req);
void chain_reply(struct smb_request *req);
bool req_is_in_chain(struct smb_request *req);
-void check_reload(time_t t);
-void smbd_process(void);
+void smbd_process(struct smbd_server_connection *sconn);
/* The following definitions come from smbd/quotas.c */
/* The following definitions come from smbd/server.c */
int smbd_server_fd(void);
-int get_client_fd(void);
struct event_context *smbd_event_context(void);
struct messaging_context *smbd_messaging_context(void);
struct memcache *smbd_memcache(void);
void reload_printers(struct messaging_context *msg_ctx);
-bool reload_services(struct messaging_context *msg_ctx, bool test);
+bool reload_services(struct messaging_context *msg_ctx, int smb_sock,
+ bool test);
void exit_server(const char *const explanation);
void exit_server_cleanly(const char *const explanation);
void exit_server_fault(void);
/* The following definitions come from smbd/session.c */
bool session_init(void);
-bool session_claim(struct server_id pid, user_struct *vuser);
+bool session_claim(struct smbd_server_connection *sconn, user_struct *vuser);
void session_yield(user_struct *vuser);
int list_sessions(TALLOC_CTX *mem_ctx, struct sessionid **session_list);
bool idmap_is_online(void);
NTSTATUS smb_register_idmap(int version, const char *name,
struct idmap_methods *methods);
-NTSTATUS smb_register_idmap_alloc(int version, const char *name,
- struct idmap_alloc_methods *methods);
void idmap_close(void);
NTSTATUS idmap_init_cache(void);
NTSTATUS idmap_allocate_uid(struct unixid *id);
NTSTATUS idmap_allocate_gid(struct unixid *id);
-NTSTATUS idmap_set_uid_hwm(struct unixid *id);
-NTSTATUS idmap_set_gid_hwm(struct unixid *id);
NTSTATUS idmap_backends_unixid_to_sid(const char *domname,
struct id_map *id);
NTSTATUS idmap_backends_sid_to_unixid(const char *domname,
struct id_map *id);
NTSTATUS idmap_new_mapping(const struct dom_sid *psid, enum id_type type,
struct unixid *pxid);
-NTSTATUS idmap_set_mapping(const struct id_map *map);
-NTSTATUS idmap_remove_mapping(const struct id_map *map);
/* The following definitions come from winbindd/idmap_cache.c */
/* The following definitions come from winbindd/idmap_tdb.c */
-NTSTATUS idmap_alloc_tdb_init(void);
NTSTATUS idmap_tdb_init(void);
/* The following definitions come from winbindd/idmap_util.c */
NTSTATUS idmap_gid_to_sid(const char *domname, struct dom_sid *sid, gid_t gid);
NTSTATUS idmap_sid_to_uid(const char *dom_name, struct dom_sid *sid, uid_t *uid);
NTSTATUS idmap_sid_to_gid(const char *domname, struct dom_sid *sid, gid_t *gid);
+bool idmap_unix_id_is_in_range(uint32_t id, struct idmap_domain *dom);
/* The following definitions come from winbindd/nss_info.c */