s3-spoolss: make several notify functions static.
[ira/wip.git] / source3 / include / proto.h
index 63270e14fa48bad6b742c564247a2db20b8cfb04..e16cae5b2b7d91020f73655f484a14ea9b48eb8e 100644 (file)
@@ -61,6 +61,10 @@ NTSTATUS auth_ntlmssp_update(AUTH_NTLMSSP_STATE *auth_ntlmssp_state,
 
 /* The following definitions come from auth/auth_sam.c  */
 
+NTSTATUS check_sam_security(const DATA_BLOB *challenge,
+                           TALLOC_CTX *mem_ctx,
+                           const struct auth_usersupplied_info *user_info,
+                           struct auth_serversupplied_info **server_info);
 NTSTATUS auth_sam_init(void);
 
 /* The following definitions come from auth/auth_server.c  */
@@ -150,10 +154,30 @@ void free_user_info(struct auth_usersupplied_info **user_info);
 bool make_auth_methods(struct auth_context *auth_context, auth_methods **auth_method) ;
 bool is_trusted_domain(const char* dom_name);
 
+/* The following definitions come from auth/user_info.c  */
+
+NTSTATUS make_user_info(struct auth_usersupplied_info **user_info,
+                       const char *smb_name,
+                       const char *internal_username,
+                       const char *client_domain,
+                       const char *domain,
+                       const char *wksta_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);
+void free_user_info(struct auth_usersupplied_info **user_info);
+
 /* The following definitions come from auth/auth_winbind.c  */
 
 NTSTATUS auth_winbind_init(void);
 
+/* The following definitions come from auth/server_info.c  */
+
+struct auth_serversupplied_info *make_server_info(TALLOC_CTX *mem_ctx);
+
 /* The following definitions come from auth/auth_wbc.c  */
 
 NTSTATUS auth_wbc_init(void);
@@ -334,8 +358,6 @@ const char *audit_policy_str(TALLOC_CTX *mem_ctx, uint32 policy);
 
 /* The following definitions come from lib/bitmap.c  */
 
-struct bitmap *bitmap_allocate(int n);
-void bitmap_free(struct bitmap *bm);
 struct bitmap *bitmap_talloc(TALLOC_CTX *mem_ctx, int n);
 int bitmap_copy(struct bitmap * const dst, const struct bitmap * const src);
 bool bitmap_set(struct bitmap *bm, unsigned i);
@@ -420,8 +442,6 @@ void clobber_region(const char *fn, unsigned int line, char *dest, size_t len);
 
 /* 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);
@@ -433,6 +453,10 @@ int connections_forall(int (*fn)(struct db_record *rec,
                                 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  */
@@ -669,7 +693,8 @@ ssize_t drain_socket(int sockfd, size_t count);
 /* The following definitions come from lib/secdesc.c  */
 
 uint32_t get_sec_info(const SEC_DESC *sd);
-SEC_DESC_BUF *sec_desc_merge(TALLOC_CTX *ctx, SEC_DESC_BUF *new_sdb, SEC_DESC_BUF *old_sdb);
+SEC_DESC *sec_desc_merge(TALLOC_CTX *ctx, SEC_DESC *new_sdb, SEC_DESC *old_sdb);
+SEC_DESC_BUF *sec_desc_merge_buf(TALLOC_CTX *ctx, SEC_DESC_BUF *new_sdb, SEC_DESC_BUF *old_sdb);
 SEC_DESC *make_sec_desc(TALLOC_CTX *ctx,
                        enum security_descriptor_revision revision,
                        uint16 type,
@@ -1063,6 +1088,7 @@ time_t cli_make_unix_date2(struct cli_state *cli, const void *date_ptr);
 time_t cli_make_unix_date3(struct cli_state *cli, const void *date_ptr);
 void TimeInit(void);
 void get_process_uptime(struct timeval *ret_time);
+void get_startup_time(struct timeval *ret_time);
 time_t nt_time_to_unix_abs(const NTTIME *nt);
 time_t uint64s_nt_time_to_unix_abs(const uint64_t *src);
 void unix_timespec_to_nt_time(NTTIME *nt, struct timespec ts);
@@ -1203,9 +1229,9 @@ uint32 map_share_mode_to_deny_mode(uint32 share_access, uint32 private_options);
 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);
@@ -1265,13 +1291,17 @@ void flush_pwnam_cache(void);
 struct passwd *getpwnam_alloc(TALLOC_CTX *mem_ctx, const char *name);
 struct passwd *getpwuid_alloc(TALLOC_CTX *mem_ctx, uid_t uid) ;
 
-/* The following definitions come from lib/util_reg.c  */
+/* The following definitions come from ..libcli/registry/util_reg.c  */
 
-const char *reg_type_lookup(enum winreg_Type type);
-bool push_reg_sz(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, const char *s);
-bool push_reg_multi_sz(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, const char **a);
-bool pull_reg_sz(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob, const char **s);
-bool pull_reg_multi_sz(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob, const char ***a);
+const char *str_regtype(int type);
+bool push_reg_sz(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *ic,
+                DATA_BLOB *blob, const char *s);
+bool push_reg_multi_sz(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *ic,
+                      DATA_BLOB *blob, const char **a);
+bool pull_reg_sz(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *ic,
+                const DATA_BLOB *blob, const char **s);
+bool pull_reg_multi_sz(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *ic,
+                      const DATA_BLOB *blob, const char ***a);
 
 /* The following definitions come from lib/util_reg_api.c  */
 
@@ -1372,7 +1402,6 @@ char *print_sockaddr(char *dest,
                        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);
@@ -1575,6 +1604,7 @@ bool validate_net_name( const char *name,
                int max_len);
 char *escape_shell_string(const char *src);
 char **str_list_make_v3(TALLOC_CTX *mem_ctx, const char *string, const char *sep);
+char *sanitize_username(TALLOC_CTX *mem_ctx, const char *username);
 
 /* The following definitions come from lib/util_unistr.c  */
 
@@ -1749,9 +1779,6 @@ NTSTATUS ads_dns_lookup_ns(TALLOC_CTX *ctx,
                                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,
@@ -2080,27 +2107,8 @@ WERROR reg_apply_registry_entry(TALLOC_CTX *mem_ctx,
                                uint32_t flags);
 
 
-#include "librpc/gen_ndr/ndr_dfs.h"
-#include "librpc/gen_ndr/ndr_dssetup.h"
-#include "librpc/gen_ndr/ndr_echo.h"
-#include "librpc/gen_ndr/ndr_eventlog.h"
 #include "librpc/gen_ndr/ndr_krb5pac.h"
-#include "librpc/gen_ndr/ndr_lsa.h"
-#include "librpc/gen_ndr/ndr_misc.h"
-#include "librpc/gen_ndr/ndr_netlogon.h"
-#include "librpc/gen_ndr/ndr_notify.h"
-#include "librpc/gen_ndr/ndr_ntsvcs.h"
-#include "librpc/gen_ndr/ndr_samr.h"
-#include "librpc/gen_ndr/ndr_security.h"
-#include "librpc/gen_ndr/ndr_srvsvc.h"
-#include "librpc/gen_ndr/ndr_svcctl.h"
-#include "librpc/gen_ndr/ndr_winreg.h"
-#include "librpc/gen_ndr/ndr_wkssvc.h"
-#include "librpc/gen_ndr/ndr_drsuapi.h"
 #include "librpc/gen_ndr/ndr_spoolss.h"
-#include "librpc/gen_ndr/ndr_initshutdown.h"
-
-#include "librpc/ndr/libndr.h"
 
 /* The following definitions come from librpc/ndr/util.c  */
 
@@ -2119,35 +2127,6 @@ extern const struct ndr_syntax_id null_ndr_syntax_id;
 
 char *dom_sid_string(TALLOC_CTX *mem_ctx, const struct dom_sid *sid);
 
-/* The following definitions come from librpc/rpc/binding.c  */
-
-const char *epm_floor_string(TALLOC_CTX *mem_ctx, struct epm_floor *epm_floor);
-_PUBLIC_ char *dcerpc_binding_string(TALLOC_CTX *mem_ctx, const struct dcerpc_binding *b);
-_PUBLIC_ NTSTATUS dcerpc_parse_binding(TALLOC_CTX *mem_ctx, const char *s, struct dcerpc_binding **b_out);
-_PUBLIC_ NTSTATUS dcerpc_floor_get_lhs_data(const struct epm_floor *epm_floor,
-                                           struct ndr_syntax_id *syntax);
-const char *dcerpc_floor_get_rhs_data(TALLOC_CTX *mem_ctx, struct epm_floor *epm_floor);
-enum dcerpc_transport_t dcerpc_transport_by_endpoint_protocol(int prot);
-_PUBLIC_ enum dcerpc_transport_t dcerpc_transport_by_tower(const struct epm_tower *tower);
-_PUBLIC_ const char *derpc_transport_string_by_transport(enum dcerpc_transport_t t);
-_PUBLIC_ NTSTATUS dcerpc_binding_from_tower(TALLOC_CTX *mem_ctx, 
-                                  struct epm_tower *tower, 
-                                  struct dcerpc_binding **b_out);
-_PUBLIC_ NTSTATUS dcerpc_binding_build_tower(TALLOC_CTX *mem_ctx,
-                                            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, 
@@ -2347,6 +2326,7 @@ bool cli_is_dos_error(struct cli_state *cli);
 NTSTATUS cli_get_nt_error(struct cli_state *cli);
 void cli_set_nt_error(struct cli_state *cli, NTSTATUS status);
 void cli_reset_error(struct cli_state *cli);
+bool cli_state_is_connected(struct cli_state *cli);
 
 /* The following definitions come from libsmb/clifile.c  */
 
@@ -2852,9 +2832,12 @@ bool cli_qfileinfo_test(struct cli_state *cli, uint16_t fnum, int level, char **
 NTSTATUS cli_qpathinfo_alt_name(struct cli_state *cli, const char *fname, fstring alt_name);
 
 /* The following definitions come from libsmb/clirap2.c  */
+struct rap_group_info_1;
+struct rap_user_info_1;
+struct rap_share_info_2;
 
 int cli_NetGroupDelete(struct cli_state *cli, const char *group_name);
-int cli_NetGroupAdd(struct cli_state *cli, RAP_GROUP_INFO_1 *grinfo);
+int cli_NetGroupAdd(struct cli_state *cli, struct rap_group_info_1 *grinfo);
 int cli_RNetGroupEnum(struct cli_state *cli, void (*fn)(const char *, const char *, void *), void *state);
 int cli_RNetGroupEnum0(struct cli_state *cli,
                       void (*fn)(const char *, void *),
@@ -2864,7 +2847,7 @@ int cli_NetGroupAddUser(struct cli_state * cli, const char *group_name, const ch
 int cli_NetGroupGetUsers(struct cli_state * cli, const char *group_name, void (*fn)(const char *, void *), void *state );
 int cli_NetUserGetGroups(struct cli_state * cli, const char *user_name, void (*fn)(const char *, void *), void *state );
 int cli_NetUserDelete(struct cli_state *cli, const char * user_name );
-int cli_NetUserAdd(struct cli_state *cli, RAP_USER_INFO_1 * userinfo );
+int cli_NetUserAdd(struct cli_state *cli, struct rap_user_info_1 * userinfo );
 int cli_RNetUserEnum(struct cli_state *cli, void (*fn)(const char *, const char *, const char *, const char *, void *), void *state);
 int cli_RNetUserEnum0(struct cli_state *cli,
                      void (*fn)(const char *, void *),
@@ -2875,7 +2858,7 @@ int cli_NetFileEnum(struct cli_state *cli, const char * user,
                    const char * base_path,
                    void (*fn)(const char *, const char *, uint16, uint16,
                               uint32));
-int cli_NetShareAdd(struct cli_state *cli, RAP_SHARE_INFO_2 * sinfo );
+int cli_NetShareAdd(struct cli_state *cli, struct rap_share_info_2 * sinfo );
 int cli_NetShareDelete(struct cli_state *cli, const char * share_name );
 bool cli_get_pdc_name(struct cli_state *cli, const char *workgroup, char **pdc_name);
 bool cli_get_server_domain(struct cli_state *cli);
@@ -3230,38 +3213,47 @@ NTSTATUS nt_status_squash(NTSTATUS nt_status);
 void debug_ntlmssp_flags(uint32 neg_flags);
 NTSTATUS ntlmssp_set_username(struct ntlmssp_state *ntlmssp_state, const char *user) ;
 NTSTATUS ntlmssp_set_hashes(struct ntlmssp_state *ntlmssp_state,
-               const unsigned char lm_hash[16],
-               const unsigned char nt_hash[16]) ;
+                           const uint8_t lm_hash[16],
+                           const uint8_t nt_hash[16]) ;
 NTSTATUS ntlmssp_set_password(struct ntlmssp_state *ntlmssp_state, const char *password) ;
 NTSTATUS ntlmssp_set_domain(struct ntlmssp_state *ntlmssp_state, const char *domain) ;
-NTSTATUS ntlmssp_set_workstation(struct ntlmssp_state *ntlmssp_state, const char *workstation) ;
 void ntlmssp_want_feature_list(struct ntlmssp_state *ntlmssp_state, char *feature_list);
-void ntlmssp_want_feature(struct ntlmssp_state *ntlmssp_state, uint32 feature);
+void ntlmssp_want_feature(struct ntlmssp_state *ntlmssp_state, uint32_t feature);
 NTSTATUS ntlmssp_update(struct ntlmssp_state *ntlmssp_state,
                        const DATA_BLOB in, DATA_BLOB *out) ;
 void ntlmssp_end(struct ntlmssp_state **ntlmssp_state);
 DATA_BLOB ntlmssp_weaken_keys(struct ntlmssp_state *ntlmssp_state, TALLOC_CTX *mem_ctx);
-NTSTATUS ntlmssp_server_start(struct ntlmssp_state **ntlmssp_state);
-NTSTATUS ntlmssp_client_start(struct ntlmssp_state **ntlmssp_state);
+NTSTATUS ntlmssp_server_start(TALLOC_CTX *mem_ctx,
+                             bool is_standalone,
+                             const char *netbios_name,
+                             const char *netbios_domain,
+                             const char *dns_name,
+                             const char *dns_domain,
+                             struct ntlmssp_state **ntlmssp_state);
+NTSTATUS ntlmssp_client_start(TALLOC_CTX *mem_ctx,
+                             const char *netbios_name,
+                             const char *netbios_domain,
+                             bool use_ntlmv2,
+                             struct ntlmssp_state **_ntlmssp_state);
 
 /* The following definitions come from libsmb/ntlmssp_sign.c  */
 
 NTSTATUS ntlmssp_sign_packet(struct ntlmssp_state *ntlmssp_state,
-                                   const uchar *data, size_t length, 
-                                   const uchar *whole_pdu, size_t pdu_length, 
-                                   DATA_BLOB *sig) ;
+                            const uint8_t *data, size_t length,
+                            const uint8_t *whole_pdu, size_t pdu_length,
+                            DATA_BLOB *sig);
 NTSTATUS ntlmssp_check_packet(struct ntlmssp_state *ntlmssp_state,
-                               const uchar *data, size_t length, 
-                               const uchar *whole_pdu, size_t pdu_length, 
-                               const DATA_BLOB *sig) ;
+                             const uint8_t *data, size_t length,
+                             const uint8_t *whole_pdu, size_t pdu_length,
+                             const DATA_BLOB *sig) ;
 NTSTATUS ntlmssp_seal_packet(struct ntlmssp_state *ntlmssp_state,
-                            uchar *data, size_t length,
-                            uchar *whole_pdu, size_t pdu_length,
+                            uint8_t *data, size_t length,
+                            const uint8_t *whole_pdu, size_t pdu_length,
                             DATA_BLOB *sig);
 NTSTATUS ntlmssp_unseal_packet(struct ntlmssp_state *ntlmssp_state,
-                               uchar *data, size_t length,
-                               uchar *whole_pdu, size_t pdu_length,
-                               DATA_BLOB *sig);
+                              uint8_t *data, size_t length,
+                              const uint8_t *whole_pdu, size_t pdu_length,
+                              const DATA_BLOB *sig);
 NTSTATUS ntlmssp_sign_init(struct ntlmssp_state *ntlmssp_state);
 
 /* The following definitions come from libsmb/passchange.c  */
@@ -3315,7 +3307,7 @@ void cli_set_signing_negotiated(struct cli_state *cli);
 
 struct smbd_server_connection;
 bool srv_check_sign_mac(struct smbd_server_connection *conn,
-                       const char *inbuf, uint32_t *seqnum);
+                       const char *inbuf, uint32_t *seqnum, bool trusted_channel);
 void srv_calculate_sign_mac(struct smbd_server_connection *conn,
                            char *outbuf, uint32_t seqnum);
 void srv_cancel_sign_response(struct smbd_server_connection *conn);
@@ -3504,12 +3496,12 @@ bool is_valid_share_mode_entry(const struct share_mode_entry *e);
 bool is_deferred_open_entry(const struct share_mode_entry *e);
 bool is_unused_share_mode_entry(const struct share_mode_entry *e);
 void set_share_mode(struct share_mode_lock *lck, files_struct *fsp,
-                   uid_t uid, uint16 mid, uint16 op_type);
-void add_deferred_open(struct share_mode_lock *lck, uint16 mid,
+                   uid_t uid, uint64_t mid, uint16 op_type);
+void add_deferred_open(struct share_mode_lock *lck, uint64_t mid,
                       struct timeval request_time,
                       struct file_id id);
 bool del_share_mode(struct share_mode_lock *lck, files_struct *fsp);
-void del_deferred_open_entry(struct share_mode_lock *lck, uint16 mid);
+void del_deferred_open_entry(struct share_mode_lock *lck, uint64_t mid);
 bool remove_share_oplock(struct share_mode_lock *lck, files_struct *fsp);
 bool downgrade_share_oplock(struct share_mode_lock *lck, files_struct *fsp);
 NTSTATUS can_set_delete_on_close(files_struct *fsp, uint32 dosmode);
@@ -3992,6 +3984,7 @@ char *lp_addmachine_script(void);
 char *lp_shutdown_script(void);
 char *lp_abort_shutdown_script(void);
 char *lp_username_map_script(void);
+int lp_username_map_cache_time(void);
 char *lp_check_password_script(void);
 char *lp_wins_hook(void);
 const char *lp_template_homedir(void);
@@ -4042,6 +4035,7 @@ bool lp_usershare_allow_guests(void);
 bool lp_usershare_owner_only(void);
 bool lp_disable_netbios(void);
 bool lp_reset_on_zero_vc(void);
+bool lp_log_writeable_files_on_exit(void);
 bool lp_ms_add_printer_wizard(void);
 bool lp_dns_proxy(void);
 bool lp_wins_support(void);
@@ -4135,6 +4129,9 @@ int lp_lock_spin_time(void);
 int lp_usershare_max_shares(void);
 const char *lp_socket_options(void);
 int lp_config_backend(void);
+int lp_smb2_max_read(void);
+int lp_smb2_max_write(void);
+int lp_smb2_max_trans(void);
 char *lp_preexec(int );
 char *lp_postexec(int );
 char *lp_rootpreexec(int );
@@ -4157,6 +4154,7 @@ const char *lp_ctdbd_socket(void);
 const char **lp_cluster_addresses(void);
 bool lp_clustering(void);
 int lp_ctdb_timeout(void);
+int lp_ctdb_locktime_warn_threshold(void);
 char *lp_printcommand(int );
 char *lp_lpqcommand(int );
 char *lp_lprmcommand(int );
@@ -4227,6 +4225,7 @@ bool lp_dos_filemode(int );
 bool lp_dos_filetimes(int );
 bool lp_dos_filetime_resolution(int );
 bool lp_fake_dir_create_times(int);
+bool lp_async_smb_echo_handler(void);
 bool lp_blocking_locks(int );
 bool lp_inherit_perms(int );
 bool lp_inherit_acls(int );
@@ -4285,6 +4284,7 @@ unsigned long lp_parm_ulong(int snum, const char *type, const char *option, unsi
 bool lp_parm_bool(int snum, const char *type, const char *option, bool def);
 int lp_parm_enum(int snum, const char *type, const char *option,
                 const struct enum_list *_enum, int def);
+char *canonicalize_servicename(TALLOC_CTX *ctx, const char *src);
 bool lp_add_home(const char *pszHomename, int iDefaultService,
                 const char *user, const char *pszHomedir);
 int lp_add_service(const char *pszService, int iDefaultService);
@@ -4336,6 +4336,7 @@ enum usershare_err parse_usershare_file(TALLOC_CTX *ctx,
                        int numlines,
                        char **pp_sharepath,
                        char **pp_comment,
+                       char **pp_cp_share_name,
                        SEC_DESC **ppsd,
                        bool *pallow_guest);
 int load_usershare_service(const char *servicename);
@@ -4411,8 +4412,9 @@ char* get_string_param( const char* param );
 
 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  */
@@ -4750,15 +4752,6 @@ bool secrets_delete_generic(const char *owner, const char *key);
 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);
@@ -4798,6 +4791,7 @@ void load_printers(void);
 bool parse_lpq_entry(enum printing_types printing_type,char *line,
                     print_queue_struct *buf,
                     print_status_struct *status,bool first);
+uint32_t print_parse_jobid(const char *fname);
 
 /* The following definitions come from printing/notify.c  */
 
@@ -4817,12 +4811,12 @@ 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,
                          time_t submitted);
-void notify_printer_driver(int snum, char *driver_name);
-void notify_printer_comment(int snum, char *comment);
-void notify_printer_sharename(int snum, char *share_name);
-void notify_printer_printername(int snum, char *printername);
-void notify_printer_port(int snum, char *port_name);
-void notify_printer_location(int snum, char *location);
+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 );
 
 /* The following definitions come from printing/nt_printing.c  */
@@ -4849,6 +4843,11 @@ uint32 del_a_printer(const char *sharename);
 NT_DEVICEMODE *construct_nt_devicemode(const fstring default_devicename);
 void free_nt_devicemode(NT_DEVICEMODE **devmode_ptr);
 int unpack_devicemode(NT_DEVICEMODE **nt_devmode, const uint8 *buf, int buflen);
+WERROR spoolss_create_default_devmode(TALLOC_CTX *mem_ctx,
+                                     const char *devicename,
+                                     struct spoolss_DeviceMode **devmode);
+WERROR spoolss_create_default_secdesc(TALLOC_CTX *mem_ctx,
+                                     struct spoolss_security_descriptor **secdesc);
 int add_new_printer_key( NT_PRINTER_DATA *data, const char *name );
 int delete_printer_key( NT_PRINTER_DATA *data, const char *name );
 int lookup_printerkey( NT_PRINTER_DATA *data, const char *name );
@@ -4879,6 +4878,8 @@ WERROR get_a_printer_search( Printer_entry *print_hnd,
                        uint32 level,
                        const char *sharename);
 uint32 free_a_printer(NT_PRINTER_INFO_LEVEL **pp_printer, uint32 level);
+bool driver_info_ctr_to_info8(struct spoolss_AddDriverInfoCtr *r,
+                             struct spoolss_DriverInfo8 *_info8);
 uint32_t add_a_printer_driver(TALLOC_CTX *mem_ctx,
                              struct spoolss_AddDriverInfoCtr *r,
                              char **driver_name,
@@ -4922,7 +4923,10 @@ bool aix_cache_reload(void);
 /* The following definitions come from printing/print_cups.c  */
 
 bool cups_cache_reload(void);
-bool cups_pull_comment_location(NT_PRINTER_INFO_LEVEL_2 *printer);
+bool cups_pull_comment_location(TALLOC_CTX *mem_ctx,
+                               const char *printername,
+                               char **comment,
+                               char **location);
 
 /* The following definitions come from printing/print_generic.c  */
 
@@ -4941,6 +4945,7 @@ NTSTATUS print_fsp_open(struct smb_request *req, connection_struct *conn,
                        const char *fname,
                        uint16_t current_vuid, files_struct *fsp);
 void print_fsp_end(files_struct *fsp, enum file_close_type close_type);
+SMB_OFF_T printfile_offset(files_struct *fsp, SMB_OFF_T offset);
 
 /* The following definitions come from printing/printing.c  */
 
@@ -4958,8 +4963,8 @@ bool print_job_exists(const char* sharename, uint32 jobid);
 int print_job_fd(const char* sharename, uint32 jobid);
 char *print_job_fname(const char* sharename, uint32 jobid);
 NT_DEVICEMODE *print_job_devmode(const char* sharename, uint32 jobid);
-bool print_job_set_place(const char *sharename, uint32 jobid, int place);
-bool print_job_set_name(const char *sharename, uint32 jobid, char *name);
+bool print_job_set_name(const char *sharename, uint32 jobid, const char *name);
+bool print_job_get_name(TALLOC_CTX *mem_ctx, const char *sharename, uint32_t jobid, char **name);
 bool print_job_delete(struct auth_serversupplied_info *server_info, int snum,
                      uint32 jobid, WERROR *errcode);
 bool print_job_pause(struct auth_serversupplied_info *server_info, int snum,
@@ -5313,6 +5318,7 @@ NTSTATUS rpc_pipe_bind(struct rpc_pipe_client *cli,
                       struct cli_pipe_auth_data *auth);
 unsigned int rpccli_set_timeout(struct rpc_pipe_client *cli,
                                unsigned int timeout);
+bool rpccli_is_connected(struct rpc_pipe_client *rpc_cli);
 bool rpccli_get_pwd_hash(struct rpc_pipe_client *cli, uint8_t nt_hash[16]);
 NTSTATUS rpccli_anon_bind_data(TALLOC_CTX *mem_ctx,
                               struct cli_pipe_auth_data **presult);
@@ -5406,7 +5412,6 @@ NTSTATUS rpc_transport_np_init(TALLOC_CTX *mem_ctx, struct cli_state *cli,
                               const struct ndr_syntax_id *abstract_syntax,
                               struct rpc_cli_transport **presult);
 struct cli_state *rpc_pipe_np_smb_conn(struct rpc_pipe_client *p);
-void rpccli_close_np_fd(struct rpc_pipe_client *p);
 
 /* The following definitions come from rpc_client/rpc_transport_smbd.c  */
 
@@ -5443,9 +5448,6 @@ struct cli_state *rpc_pipe_smbd_smb_conn(struct rpc_pipe_client *p);
 
 NTSTATUS rpc_transport_sock_init(TALLOC_CTX *mem_ctx, int fd,
                                 struct rpc_cli_transport **presult);
-int rpccli_set_sock_timeout(struct rpc_pipe_client *rpccli, int timeout);
-void rpccli_close_sock_fd(struct rpc_pipe_client *rpccli);
-bool rpc_pipe_tcp_connection_ok(struct rpc_pipe_client *rpccli);
 
 /* The following definitions come from rpc_client/cli_samr.c  */
 
@@ -5589,7 +5591,8 @@ WERROR rpccli_spoolss_getprinterdata(struct rpc_pipe_client *cli,
                                     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,
@@ -5756,41 +5759,6 @@ void init_rpc_hdr_auth(RPC_HDR_AUTH *rai,
                                uint32 auth_context_id);
 bool smb_io_rpc_hdr_auth(const char *desc, RPC_HDR_AUTH *rai, prs_struct *ps, int depth);
 
-/* The following definitions come from lib/eventlog/eventlog.c  */
-
-TDB_CONTEXT *elog_init_tdb( char *tdbfilename );
-char *elog_tdbname(TALLOC_CTX *ctx, const char *name );
-int elog_tdb_size( TDB_CONTEXT * tdb, int *MaxSize, int *Retention );
-bool prune_eventlog( TDB_CONTEXT * tdb );
-ELOG_TDB *elog_open_tdb( const char *logname, bool force_clear, bool read_only );
-int elog_close_tdb( ELOG_TDB *etdb, bool force_close );
-bool parse_logentry( TALLOC_CTX *mem_ctx, char *line, struct eventlog_Record_tdb *entry, bool * eor );
-size_t fixup_eventlog_record_tdb(struct eventlog_Record_tdb *r);
-struct eventlog_Record_tdb *evlog_pull_record_tdb(TALLOC_CTX *mem_ctx,
-                                                 TDB_CONTEXT *tdb,
-                                                 uint32_t record_number);
-NTSTATUS evlog_push_record_tdb(TALLOC_CTX *mem_ctx,
-                              TDB_CONTEXT *tdb,
-                              struct eventlog_Record_tdb *r,
-                              uint32_t *record_number);
-NTSTATUS evlog_push_record(TALLOC_CTX *mem_ctx,
-                          TDB_CONTEXT *tdb,
-                          struct EVENTLOGRECORD *r,
-                          uint32_t *record_number);
-struct EVENTLOGRECORD *evlog_pull_record(TALLOC_CTX *mem_ctx,
-                                        TDB_CONTEXT *tdb,
-                                        uint32_t record_number);
-NTSTATUS evlog_evt_entry_to_tdb_entry(TALLOC_CTX *mem_ctx,
-                                     const struct EVENTLOGRECORD *e,
-                                     struct eventlog_Record_tdb *t);
-NTSTATUS evlog_tdb_entry_to_evt_entry(TALLOC_CTX *mem_ctx,
-                                     const struct eventlog_Record_tdb *t,
-                                     struct EVENTLOGRECORD *e);
-NTSTATUS evlog_convert_tdb_to_evt(TALLOC_CTX *mem_ctx,
-                                 ELOG_TDB *etdb,
-                                 DATA_BLOB *blob_p,
-                                 uint32_t *num_records_p);
-
 /* The following definitions come from rpc_server/srv_eventlog_nt.c  */
 
 /* The following definitions come from rpc_server/srv_lsa_hnd.c  */
@@ -5924,75 +5892,6 @@ bool convert_devicemode(const char *printername,
 WERROR set_printer_dataex(NT_PRINTER_INFO_LEVEL *printer,
                          const char *key, const char *value,
                          uint32_t type, uint8_t *data, int real_len);
-void spoolss_notify_server_name(int snum,
-                                      struct spoolss_Notify *data,
-                                      print_queue_struct *queue,
-                                      NT_PRINTER_INFO_LEVEL *printer,
-                                      TALLOC_CTX *mem_ctx);
-void spoolss_notify_printer_name(int snum,
-                                       struct spoolss_Notify *data,
-                                       print_queue_struct *queue,
-                                       NT_PRINTER_INFO_LEVEL *printer,
-                                       TALLOC_CTX *mem_ctx);
-void spoolss_notify_share_name(int snum,
-                                     struct spoolss_Notify *data,
-                                     print_queue_struct *queue,
-                                     NT_PRINTER_INFO_LEVEL *printer,
-                                     TALLOC_CTX *mem_ctx);
-void spoolss_notify_port_name(int snum,
-                                    struct spoolss_Notify *data,
-                                    print_queue_struct *queue,
-                                    NT_PRINTER_INFO_LEVEL *printer,
-                                    TALLOC_CTX *mem_ctx);
-void spoolss_notify_driver_name(int snum,
-                                      struct spoolss_Notify *data,
-                                      print_queue_struct *queue,
-                                      NT_PRINTER_INFO_LEVEL *printer,
-                                      TALLOC_CTX *mem_ctx);
-void spoolss_notify_comment(int snum,
-                                  struct spoolss_Notify *data,
-                                  print_queue_struct *queue,
-                                  NT_PRINTER_INFO_LEVEL *printer,
-                                  TALLOC_CTX *mem_ctx);
-void spoolss_notify_location(int snum,
-                                   struct spoolss_Notify *data,
-                                   print_queue_struct *queue,
-                                   NT_PRINTER_INFO_LEVEL *printer,
-                                   TALLOC_CTX *mem_ctx);
-void spoolss_notify_sepfile(int snum,
-                                  struct spoolss_Notify *data,
-                                  print_queue_struct *queue,
-                                  NT_PRINTER_INFO_LEVEL *printer,
-                                  TALLOC_CTX *mem_ctx);
-void spoolss_notify_print_processor(int snum,
-                                          struct spoolss_Notify *data,
-                                          print_queue_struct *queue,
-                                          NT_PRINTER_INFO_LEVEL *printer,
-                                          TALLOC_CTX *mem_ctx);
-void spoolss_notify_parameters(int snum,
-                                     struct spoolss_Notify *data,
-                                     print_queue_struct *queue,
-                                     NT_PRINTER_INFO_LEVEL *printer,
-                                     TALLOC_CTX *mem_ctx);
-void spoolss_notify_datatype(int snum,
-                                   struct spoolss_Notify *data,
-                                   print_queue_struct *queue,
-                                   NT_PRINTER_INFO_LEVEL *printer,
-                                   TALLOC_CTX *mem_ctx);
-void spoolss_notify_attributes(int snum,
-                                     struct spoolss_Notify *data,
-                                     print_queue_struct *queue,
-                                     NT_PRINTER_INFO_LEVEL *printer,
-                                     TALLOC_CTX *mem_ctx);
-void spoolss_notify_cjobs(int snum,
-                                struct spoolss_Notify *data,
-                                print_queue_struct *queue,
-                                NT_PRINTER_INFO_LEVEL *printer,
-                                TALLOC_CTX *mem_ctx);
-void construct_info_data(struct spoolss_Notify *info_data,
-                        enum spoolss_NotifyType type,
-                        uint16_t field,
-                        int id);
 struct spoolss_DeviceMode *construct_dev_mode(TALLOC_CTX *mem_ctx,
                                              const char *servicename);
 bool add_printer_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, NT_PRINTER_INFO_LEVEL *printer);
@@ -6070,22 +5969,27 @@ struct regval_ctr *svcctl_fetch_regvalues( const char *name, NT_USER_TOKEN *toke
 
 /* The following definitions come from smbd/aio.c  */
 
-void initialize_async_io_handler(void);
-bool schedule_aio_read_and_X(connection_struct *conn,
+NTSTATUS schedule_aio_read_and_X(connection_struct *conn,
                             struct smb_request *req,
                             files_struct *fsp, SMB_OFF_T startpos,
                             size_t smb_maxcnt);
-bool schedule_aio_write_and_X(connection_struct *conn,
+NTSTATUS schedule_aio_write_and_X(connection_struct *conn,
                              struct smb_request *req,
                              files_struct *fsp, char *data,
                              SMB_OFF_T startpos,
                              size_t numtowrite);
 int wait_for_aio_completion(files_struct *fsp);
 void cancel_aio_by_fsp(files_struct *fsp);
-void smbd_aio_complete_mid(unsigned int mid);
+void smbd_aio_complete_mid(uint64_t mid);
 
 /* The following definitions come from smbd/blocking.c  */
 
+void brl_timeout_fn(struct event_context *event_ctx,
+               struct timed_event *te,
+               struct timeval now,
+               void *private_data);
+struct timeval timeval_brl_min(const struct timeval *tv1,
+                       const struct timeval *tv2);
 void process_blocking_lock_queue(void);
 bool push_blocking_lock_request( struct byte_range_lock *br_lck,
                struct smb_request *req,
@@ -6099,9 +6003,9 @@ bool push_blocking_lock_request( struct byte_range_lock *br_lck,
                uint64_t count,
                uint32 blocking_pid);
 void cancel_pending_lock_requests_by_fid(files_struct *fsp, struct byte_range_lock *br_lck);
-void remove_pending_lock_requests_by_mid(int mid);
-bool blocking_lock_was_deferred(int mid);
-struct blocking_lock_record *blocking_lock_cancel(files_struct *fsp,
+void remove_pending_lock_requests_by_mid_smb1(uint64_t mid);
+bool blocking_lock_was_deferred_smb1(uint64_t mid);
+struct blocking_lock_record *blocking_lock_cancel_smb1(files_struct *fsp,
                        uint32 lock_pid,
                        uint64_t offset,
                        uint64_t count,
@@ -6170,7 +6074,6 @@ void msg_force_tdis(struct messaging_context *msg,
 
 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);
@@ -6399,7 +6302,7 @@ void file_close_pid(uint16 smbpid, int vuid);
 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);
@@ -6507,6 +6410,7 @@ NTSTATUS resolve_dfspath_wcard(TALLOC_CTX *ctx,
                                connection_struct *conn,
                                bool dfs_pathnames,
                                const char *name_in,
+                               bool allow_wcards,
                                char **pp_name_out,
                                bool *ppath_contains_wcard);
 NTSTATUS create_conn_struct(TALLOC_CTX *ctx,
@@ -6539,7 +6443,7 @@ NTSTATUS change_notify_add_request(struct smb_request *req,
                                void (*reply_fn)(struct smb_request *req,
                                        NTSTATUS error_code,
                                        uint8_t *buf, size_t len));
-void remove_pending_change_notify_requests_by_mid(uint16 mid);
+void remove_pending_change_notify_requests_by_mid(uint64_t mid);
 void remove_pending_change_notify_requests_by_fid(files_struct *fsp,
                                                  NTSTATUS status);
 void notify_fname(connection_struct *conn, uint32 action, uint32 filter,
@@ -6571,6 +6475,7 @@ struct notify_context *notify_init(TALLOC_CTX *mem_ctx, struct server_id server,
                                   struct messaging_context *messaging_ctx,
                                   struct event_context *ev,
                                   connection_struct *conn);
+bool notify_internal_parent_init(void);
 NTSTATUS notify_add(struct notify_context *notify, struct notify_entry *e0,
                    void (*callback)(void *, const struct notify_event *), 
                    void *private_data);
@@ -6597,18 +6502,28 @@ void send_nt_replies(connection_struct *conn,
                     char *params, int paramsize,
                     char *pdata, int datasize);
 void reply_ntcreate_and_X(struct smb_request *req);
+NTSTATUS set_sd(files_struct *fsp, uint8_t *data, uint32_t sd_len,
+                       uint32_t security_info_sent);
 struct ea_list *read_nttrans_ea_list(TALLOC_CTX *ctx, const char *pdata, size_t data_size);
 void reply_ntcancel(struct smb_request *req);
 void reply_ntrename(struct smb_request *req);
+NTSTATUS smbd_do_query_security_desc(connection_struct *conn,
+                                       TALLOC_CTX *mem_ctx,
+                                       files_struct *fsp,
+                                       uint32_t security_info_wanted,
+                                       uint32_t max_data_count,
+                                       uint8_t **ppmarshalled_sd,
+                                       size_t *psd_size);
 void reply_nttrans(struct smb_request *req);
 void reply_nttranss(struct smb_request *req);
 
 /* 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,
@@ -6642,7 +6557,9 @@ bool map_open_params_to_ntcreate(const struct smb_filename *smb_fname,
                                 uint32 *paccess_mask,
                                 uint32 *pshare_mode,
                                 uint32 *pcreate_disposition,
-                                uint32 *pcreate_options);
+                                uint32 *pcreate_options,
+                                uint32_t *pprivate_flags);
+void remove_deferred_open_entry(struct file_id id, uint64_t mid);
 NTSTATUS open_file_fchmod(struct smb_request *req, connection_struct *conn,
                          struct smb_filename *smb_fname,
                          files_struct **result);
@@ -6667,6 +6584,7 @@ NTSTATUS create_file_default(connection_struct *conn,
                             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,
 
@@ -6761,7 +6679,7 @@ uint32_t map_canon_ace_perms(int snum,
                                 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);
@@ -6796,14 +6714,18 @@ int srv_set_message(char *buf,
                         int num_words,
                         int num_bytes,
                         bool zero);
-void remove_deferred_open_smb_message(uint16 mid);
-void schedule_deferred_open_smb_message(uint16 mid);
-bool open_was_deferred(uint16 mid);
-struct pending_message_list *get_open_deferred_message(uint16 mid);
-bool push_deferred_smb_message(struct smb_request *req,
-                              struct timeval request_time,
-                              struct timeval timeout,
-                              char *private_data, size_t priv_len);
+void remove_deferred_open_message_smb(uint64_t mid);
+void schedule_deferred_open_message_smb(uint64_t mid);
+bool open_was_deferred(uint64_t mid);
+bool get_deferred_open_message_state(struct smb_request *smbreq,
+                               struct timeval *p_request_time,
+                               void **pp_state);
+bool push_deferred_open_message_smb(struct smb_request *req,
+                               struct timeval request_time,
+                               struct timeval timeout,
+                               struct file_id id,
+                               char *private_data,
+                               size_t priv_len);
 struct idle_event *event_add_idle(struct event_context *event_ctx,
                                  TALLOC_CTX *mem_ctx,
                                  struct timeval interval,
@@ -6811,7 +6733,7 @@ struct idle_event *event_add_idle(struct event_context *event_ctx,
                                  bool (*handler)(const struct timeval *now,
                                                  void *private_data),
                                  void *private_data);
-NTSTATUS allow_new_trans(struct trans_state *list, int mid);
+NTSTATUS allow_new_trans(struct trans_state *list, uint64_t mid);
 void reply_outbuf(struct smb_request *req, uint8 num_words, uint32 num_bytes);
 const char *smb_fn_name(int type);
 void add_to_common_flags2(uint32 v);
@@ -7019,6 +6941,19 @@ bool session_claim(user_struct *vuser);
 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,
@@ -7112,6 +7047,11 @@ void become_root(void);
 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  */