/* The following definitions come from lib/conn_tdb.c */
-struct db_record *connections_fetch_record(TALLOC_CTX *mem_ctx,
- TDB_DATA key);
struct db_record *connections_fetch_entry(TALLOC_CTX *mem_ctx,
connection_struct *conn,
const char *name);
const struct connections_data *data,
void *private_data),
void *private_data);
+int connections_forall_read(int (*fn)(const struct connections_key *key,
+ const struct connections_data *data,
+ void *private_data),
+ void *private_data);
bool connections_init(bool rw);
/* The following definitions come from lib/dbwrap_util.c */
pid_t procid_to_pid(const struct server_id *proc);
void set_my_vnn(uint32 vnn);
uint32 get_my_vnn(void);
+void set_my_unique_id(uint64_t unique_id);
struct server_id pid_to_procid(pid_t pid);
struct server_id procid_self(void);
-struct server_id server_id_self(void);
bool procid_equal(const struct server_id *p1, const struct server_id *p2);
bool cluster_id_equal(const struct server_id *id1,
const struct server_id *id2);
const struct sockaddr_storage *psa);
char *print_canonical_sockaddr(TALLOC_CTX *ctx,
const struct sockaddr_storage *pss);
-void set_sockaddr_port(struct sockaddr *psa, uint16_t port);
const char *client_name(int fd);
int get_socket_port(int fd);
const char *client_addr(int fd, char *addr, size_t addrlen);
const char *dnsdomain,
struct dns_rr_ns **nslist,
int *numns);
-bool sitename_store(const char *realm, const char *sitename);
-char *sitename_fetch(const char *realm);
-bool stored_sitename_changed(const char *realm, const char *sitename);
NTSTATUS ads_dns_query_dcs(TALLOC_CTX *ctx,
const char *realm,
const char *sitename,
const struct dcerpc_binding *binding,
struct epm_tower *tower);
-/* The following definitions come from librpc/rpc/dcerpc.c */
-
-struct rpc_request *dcerpc_ndr_request_send(struct dcerpc_pipe *p, const struct GUID *object,
- const struct ndr_interface_table *table, uint32_t opnum,
- TALLOC_CTX *mem_ctx, void *r);
-NTSTATUS dcerpc_ndr_request_recv(struct rpc_request *req);
-_PUBLIC_ NTSTATUS dcerpc_pipe_connect(TALLOC_CTX *parent_ctx, struct dcerpc_pipe **pp,
- const char *binding_string, const struct ndr_interface_table *table,
- struct cli_credentials *credentials, struct event_context *ev,
- struct loadparm_context *lp_ctx);
-
/* The following definitions come from libsmb/cliconnect.c */
ADS_STATUS cli_session_setup_spnego(struct cli_state *cli, const char *user,
NTSTATUS cli_echo(struct cli_state *cli, uint16_t num_echos, DATA_BLOB data);
bool cli_ucs2(struct cli_state *cli);
bool is_andx_req(uint8_t cmd);
+NTSTATUS cli_smb(TALLOC_CTX *mem_ctx, struct cli_state *cli,
+ uint8_t smb_command, uint8_t additional_flags,
+ uint8_t wct, uint16_t *vwv,
+ uint32_t num_bytes, const uint8_t *bytes,
+ struct tevent_req **result_parent,
+ uint8_t min_wct, uint8_t *pwct, uint16_t **pvwv,
+ uint32_t *pnum_bytes, uint8_t **pbytes);
/* The following definitions come from libsmb/clierror.c */
struct timespec *write_time,
struct timespec *change_time,
SMB_INO_T *ino);
-bool cli_qpathinfo_basic( struct cli_state *cli, const char *name,
- SMB_STRUCT_STAT *sbuf, uint32 *attributes );
+NTSTATUS cli_qpathinfo_basic(struct cli_state *cli, const char *name,
+ SMB_STRUCT_STAT *sbuf, uint32 *attributes);
bool cli_qfileinfo_test(struct cli_state *cli, uint16_t fnum, int level, char **poutdata, uint32 *poutlen);
NTSTATUS cli_qpathinfo_alt_name(struct cli_state *cli, const char *fname, fstring alt_name);
bool login_cache_init(void);
bool login_cache_shutdown(void);
-LOGIN_CACHE * login_cache_read(struct samu *sampass);
-bool login_cache_write(const struct samu *sampass, LOGIN_CACHE entry);
+bool login_cache_read(struct samu *sampass, struct login_cache *entry);
+bool login_cache_write(const struct samu *sampass,
+ const struct login_cache *entry);
bool login_cache_delentry(const struct samu *sampass);
/* The following definitions come from passdb/lookup_sid.c */
bool secrets_store_local_schannel_key(uint8_t schannel_key[16]);
bool secrets_fetch_local_schannel_key(uint8_t schannel_key[16]);
-/* The following definitions come from passdb/secrets_schannel.c */
-
-TDB_CONTEXT *open_schannel_session_store(TALLOC_CTX *mem_ctx);
-NTSTATUS schannel_fetch_session_key(TALLOC_CTX *mem_ctx,
- const char *computer_name,
- struct netlogon_creds_CredentialState **pcreds);
-NTSTATUS schannel_store_session_key(TALLOC_CTX *mem_ctx,
- struct netlogon_creds_CredentialState *creds);
-
/* The following definitions come from passdb/util_builtin.c */
bool lookup_builtin_rid(TALLOC_CTX *mem_ctx, uint32 rid, const char **name);
const char *value_name,
uint32_t offered,
enum winreg_Type *type,
- union spoolss_PrinterData *data);
+ uint32_t *needed_p,
+ uint8_t **data_p);
WERROR rpccli_spoolss_enumprinterkey(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
struct policy_handle *handle,
bool yield_connection(connection_struct *conn, const char *name);
int count_current_connections( const char *sharename, bool clear );
-int count_all_current_connections(void);
bool claim_connection(connection_struct *conn, const char *name,
uint32 msg_flags);
bool register_message_flags(bool doreg, uint32 msg_flags);
void file_init(void);
void file_close_user(int vuid);
void file_dump_open_table(void);
-struct files_struct *file_walk_table(
+struct files_struct *files_forall(
struct files_struct *(*fn)(struct files_struct *fsp,
void *private_data),
void *private_data);
/* The following definitions come from smbd/open.c */
-NTSTATUS smb1_file_se_access_check(const struct security_descriptor *sd,
- const NT_USER_TOKEN *token,
- uint32_t access_desired,
- uint32_t *access_granted);
+NTSTATUS smb1_file_se_access_check(connection_struct *conn,
+ const struct security_descriptor *sd,
+ const NT_USER_TOKEN *token,
+ uint32_t access_desired,
+ uint32_t *access_granted);
NTSTATUS fd_close(files_struct *fsp);
void change_file_owner_to_parent(connection_struct *conn,
const char *inherit_from_dir,
uint32 *paccess_mask,
uint32 *pshare_mode,
uint32 *pcreate_disposition,
- uint32 *pcreate_options);
+ uint32 *pcreate_options,
+ uint32_t *pprivate_flags);
NTSTATUS open_file_fchmod(struct smb_request *req, connection_struct *conn,
struct smb_filename *smb_fname,
files_struct **result);
uint32_t file_attributes,
uint32_t oplock_request,
uint64_t allocation_size,
+ uint32_t private_flags,
struct security_descriptor *sd,
struct ea_list *ea_list,
enum security_ace_type *pacl_type,
mode_t perms,
bool directory_ace);
-NTSTATUS unpack_nt_owners(int snum, uid_t *puser, gid_t *pgrp, uint32 security_info_sent, const SEC_DESC *psd);
+NTSTATUS unpack_nt_owners(connection_struct *conn, uid_t *puser, gid_t *pgrp, uint32 security_info_sent, const SEC_DESC *psd);
SMB_ACL_T free_empty_sys_acl(connection_struct *conn, SMB_ACL_T the_acl);
NTSTATUS posix_fget_nt_acl(struct files_struct *fsp, uint32_t security_info,
SEC_DESC **ppdesc);
void session_yield(user_struct *vuser);
int list_sessions(TALLOC_CTX *mem_ctx, struct sessionid **session_list);
+/* The following definitions come from lib/sessionid_tdb.c */
+
+bool sessionid_init(void);
+struct db_record *sessionid_fetch_record(TALLOC_CTX *mem_ctx, const char *key);
+int sessionid_traverse(int (*fn)(struct db_record *rec, const char *key,
+ struct sessionid *session,
+ void *private_data),
+ void *private_data);
+int sessionid_traverse_read(int (*fn)(const char *key,
+ struct sessionid *session,
+ void *private_data),
+ void *private_data);
+
/* The following definitions come from smbd/sesssetup.c */
NTSTATUS parse_spnego_mechanisms(DATA_BLOB blob_in,
void unbecome_root(void);
bool become_user(connection_struct *conn, uint16 vuid);
bool unbecome_user(void);
+uid_t get_current_uid(connection_struct *conn);
+gid_t get_current_gid(connection_struct *conn);
+const UNIX_USER_TOKEN *get_current_utok(connection_struct *conn);
+const NT_USER_TOKEN *get_current_nttok(connection_struct *conn);
+uint16_t get_current_vuid(connection_struct *conn);
/* The following definitions come from smbd/utmp.c */