s3: Cache the username map in gencache
[kai/samba.git] / source3 / include / proto.h
index d956ede4c964e58612aecb3bc5fe4447233c6876..71962ae93c6b244e0dd8e7a4ea0ccb666ed89ffd 100644 (file)
@@ -38,7 +38,9 @@ NTSTATUS auth_builtin_init(void);
 
 /* The following definitions come from auth/auth_compat.c  */
 
-NTSTATUS check_plaintext_password(const char *smb_name, DATA_BLOB plaintext_password, auth_serversupplied_info **server_info);
+NTSTATUS check_plaintext_password(const char *smb_name,
+                                 DATA_BLOB plaintext_password,
+                                 struct auth_serversupplied_info **server_info);
 bool password_ok(struct auth_context *actx, bool global_encrypted,
                 const char *session_workgroup,
                 const char *smb_name, DATA_BLOB password_blob);
@@ -59,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  */
@@ -71,7 +77,7 @@ NTSTATUS auth_unix_init(void);
 
 /* The following definitions come from auth/auth_util.c  */
 
-NTSTATUS make_user_info_map(auth_usersupplied_info **user_info, 
+NTSTATUS make_user_info_map(struct auth_usersupplied_info **user_info,
                            const char *smb_name, 
                            const char *client_domain, 
                            const char *wksta_name, 
@@ -79,7 +85,7 @@ NTSTATUS make_user_info_map(auth_usersupplied_info **user_info,
                            DATA_BLOB *lm_interactive_pwd, DATA_BLOB *nt_interactive_pwd,
                            DATA_BLOB *plaintext, 
                            bool encrypted);
-bool make_user_info_netlogon_network(auth_usersupplied_info **user_info, 
+bool make_user_info_netlogon_network(struct auth_usersupplied_info **user_info,
                                     const char *smb_name, 
                                     const char *client_domain, 
                                     const char *wksta_name, 
@@ -88,7 +94,7 @@ bool make_user_info_netlogon_network(auth_usersupplied_info **user_info,
                                     int lm_pwd_len,
                                     const uchar *nt_network_pwd,
                                     int nt_pwd_len);
-bool make_user_info_netlogon_interactive(auth_usersupplied_info **user_info, 
+bool make_user_info_netlogon_interactive(struct auth_usersupplied_info **user_info,
                                         const char *smb_name, 
                                         const char *client_domain, 
                                         const char *wksta_name, 
@@ -97,19 +103,19 @@ bool make_user_info_netlogon_interactive(auth_usersupplied_info **user_info,
                                         const uchar lm_interactive_pwd[16], 
                                         const uchar nt_interactive_pwd[16], 
                                         const uchar *dc_sess_key);
-bool make_user_info_for_reply(auth_usersupplied_info **user_info, 
+bool make_user_info_for_reply(struct auth_usersupplied_info **user_info,
                              const char *smb_name, 
                              const char *client_domain,
                              const uint8 chal[8],
                              DATA_BLOB plaintext_password);
-NTSTATUS make_user_info_for_reply_enc(auth_usersupplied_info **user_info, 
+NTSTATUS make_user_info_for_reply_enc(struct auth_usersupplied_info **user_info,
                                       const char *smb_name,
                                       const char *client_domain, 
                                       DATA_BLOB lm_resp, DATA_BLOB nt_resp);
-bool make_user_info_guest(auth_usersupplied_info **user_info) ;
-NTSTATUS make_server_info_sam(auth_serversupplied_info **server_info, 
+bool make_user_info_guest(struct auth_usersupplied_info **user_info) ;
+NTSTATUS make_server_info_sam(struct auth_serversupplied_info **server_info,
                              struct samu *sampass);
-NTSTATUS create_local_token(auth_serversupplied_info *server_info);
+NTSTATUS create_local_token(struct auth_serversupplied_info *server_info);
 NTSTATUS create_token_from_username(TALLOC_CTX *mem_ctx, const char *username,
                                    bool is_guest,
                                    uid_t *uid, gid_t *gid,
@@ -117,7 +123,7 @@ NTSTATUS create_token_from_username(TALLOC_CTX *mem_ctx, const char *username,
                                    struct nt_user_token **token);
 bool user_in_group_sid(const char *username, const DOM_SID *group_sid);
 bool user_in_group(const char *username, const char *groupname);
-NTSTATUS make_server_info_pw(auth_serversupplied_info **server_info, 
+NTSTATUS make_server_info_pw(struct auth_serversupplied_info **server_info,
                              char *unix_username,
                             struct passwd *pwd);
 NTSTATUS make_serverinfo_from_username(TALLOC_CTX *mem_ctx,
@@ -125,33 +131,53 @@ NTSTATUS make_serverinfo_from_username(TALLOC_CTX *mem_ctx,
                                       bool is_guest,
                                       struct auth_serversupplied_info **presult);
 struct auth_serversupplied_info *copy_serverinfo(TALLOC_CTX *mem_ctx,
-                                                const auth_serversupplied_info *src);
+                                                const struct auth_serversupplied_info *src);
 bool init_guest_info(void);
 bool server_info_set_session_key(struct auth_serversupplied_info *info,
                                 DATA_BLOB session_key);
 NTSTATUS make_server_info_guest(TALLOC_CTX *mem_ctx,
-                               auth_serversupplied_info **server_info);
+                               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,
                             fstring save_username, bool create );
 NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx, 
                                const char *sent_nt_username,
                                const char *domain,
-                               auth_serversupplied_info **server_info, 
+                               struct auth_serversupplied_info **server_info,
                                struct netr_SamInfo3 *info3);
 NTSTATUS make_server_info_wbcAuthUserInfo(TALLOC_CTX *mem_ctx,
                                          const char *sent_nt_username,
                                          const char *domain,
                                          const struct wbcAuthUserInfo *info,
-                                         auth_serversupplied_info **server_info);
-void free_user_info(auth_usersupplied_info **user_info);
+                                         struct auth_serversupplied_info **server_info);
+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);
@@ -332,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);
@@ -418,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);
@@ -431,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  */
@@ -1059,14 +1085,12 @@ void cli_put_dos_date3(struct cli_state *cli, char *buf, int offset, time_t unix
 time_t cli_make_unix_date(struct cli_state *cli, const void *date_ptr);
 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);
-bool nt_time_equals(const NTTIME *nt1, const NTTIME *nt2);
 void TimeInit(void);
 void get_process_uptime(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);
 void unix_to_nt_time_abs(NTTIME *nt, time_t t);
-bool null_mtime(time_t mtime);
 const char *time_to_asc(const time_t t);
 const char *display_time(NTTIME nttime);
 bool nt_time_is_set(const NTTIME *nt);
@@ -1105,6 +1129,9 @@ const char *get_cmdline_auth_info_password(const struct user_auth_info *auth_inf
 bool set_cmdline_auth_info_signing_state(struct user_auth_info *auth_info,
                                         const char *arg);
 int get_cmdline_auth_info_signing_state(const struct user_auth_info *auth_info);
+void set_cmdline_auth_info_use_ccache(struct user_auth_info *auth_info,
+                                     bool b);
+bool get_cmdline_auth_info_use_ccache(const struct user_auth_info *auth_info);
 void set_cmdline_auth_info_use_kerberos(struct user_auth_info *auth_info,
                                        bool b);
 bool get_cmdline_auth_info_use_kerberos(const struct user_auth_info *auth_info);
@@ -1140,7 +1167,6 @@ void smb_msleep(unsigned int t);
 NTSTATUS reinit_after_fork(struct messaging_context *msg_ctx,
                       struct event_context *ev_ctx,
                       bool parent_longlived);
-bool yesno(const char *p);
 void *malloc_(size_t size);
 void *memalign_array(size_t el_size, size_t align, unsigned int count);
 void *calloc_array(size_t size, size_t nmemb);
@@ -1201,9 +1227,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);
@@ -1266,10 +1292,14 @@ struct passwd *getpwuid_alloc(TALLOC_CTX *mem_ctx, uid_t uid) ;
 /* The following definitions come from lib/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);
+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  */
 
@@ -1288,7 +1318,6 @@ void security_acl_map_generic(struct security_acl *sa, const struct generic_mapp
 void se_map_standard(uint32 *access_mask, struct standard_mapping *mapping);
 NTSTATUS se_access_check(const SEC_DESC *sd, const NT_USER_TOKEN *token,
                     uint32 acc_desired, uint32 *acc_granted);
-NTSTATUS samr_make_sam_obj_sd(TALLOC_CTX *ctx, SEC_DESC **psd, size_t *sd_size);
 
 /* The following definitions come from lib/util_sec.c  */
 
@@ -1319,7 +1348,6 @@ char *sid_string_talloc(TALLOC_CTX *mem_ctx, const DOM_SID *sid);
 char *sid_string_dbg(const DOM_SID *sid);
 char *sid_string_tos(const DOM_SID *sid);
 bool string_to_sid(DOM_SID *sidout, const char *sidstr);
-DOM_SID *string_sid_talloc(TALLOC_CTX *mem_ctx, const char *sidstr);
 bool sid_append_rid(DOM_SID *sid, uint32 rid);
 bool sid_compose(DOM_SID *dst, const DOM_SID *domain_sid, uint32 rid);
 bool sid_split_rid(DOM_SID *sid, uint32 *rid);
@@ -1372,7 +1400,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 +1602,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 +1777,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,
@@ -1795,6 +1820,8 @@ char* kerberos_standard_des_salt( void );
 bool kerberos_secrets_store_des_salt( const char* salt );
 char* kerberos_secrets_fetch_des_salt( void );
 char *kerberos_get_default_realm_from_ccache( void );
+char *kerberos_get_realm_from_hostname(const char *hostname);
+
 bool kerberos_secrets_store_salting_principal(const char *service,
                                              int enctype,
                                              const char *principal);
@@ -2117,35 +2144,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, 
@@ -2325,6 +2323,13 @@ NTSTATUS cli_echo_recv(struct tevent_req *req);
 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  */
 
@@ -2338,6 +2343,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  */
 
@@ -2706,8 +2712,8 @@ struct tevent_req *cli_get_fs_attr_info_send(TALLOC_CTX *mem_ctx,
                                             struct cli_state *cli);
 NTSTATUS cli_get_fs_attr_info_recv(struct tevent_req *req, uint32_t *fs_attr);
 NTSTATUS cli_get_fs_attr_info(struct cli_state *cli, uint32_t *fs_attr);
-bool cli_get_fs_volume_info_old(struct cli_state *cli, fstring volume_name, uint32 *pserial_number);
-bool cli_get_fs_volume_info(struct cli_state *cli, fstring volume_name, uint32 *pserial_number, time_t *pdate);
+NTSTATUS cli_get_fs_volume_info(struct cli_state *cli, fstring volume_name,
+                               uint32 *pserial_number, time_t *pdate);
 bool cli_get_fs_full_size_info(struct cli_state *cli,
                                uint64_t *total_allocation_units,
                                uint64_t *caller_allocation_units,
@@ -2837,8 +2843,8 @@ bool cli_qfileinfo(struct cli_state *cli, uint16_t fnum,
                    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);
 
@@ -2877,14 +2883,14 @@ bool cli_ns_check_server_type(struct cli_state *cli, char *workgroup, uint32 sty
 bool cli_NetWkstaUserLogoff(struct cli_state *cli, const char *user, const char *workstation);
 int cli_NetPrintQEnum(struct cli_state *cli,
                void (*qfn)(const char*,uint16,uint16,uint16,const char*,const char*,const char*,const char*,const char*,uint16,uint16),
-               void (*jfn)(uint16,const char*,const char*,const char*,const char*,uint16,uint16,const char*,uint_t,uint_t,const char*));
+               void (*jfn)(uint16,const char*,const char*,const char*,const char*,uint16,uint16,const char*,unsigned int,unsigned int,const char*));
 int cli_NetPrintQGetInfo(struct cli_state *cli, const char *printer,
        void (*qfn)(const char*,uint16,uint16,uint16,const char*,const char*,const char*,const char*,const char*,uint16,uint16),
-       void (*jfn)(uint16,const char*,const char*,const char*,const char*,uint16,uint16,const char*,uint_t,uint_t,const char*));
+       void (*jfn)(uint16,const char*,const char*,const char*,const char*,uint16,uint16,const char*,unsigned int,unsigned int,const char*));
 int cli_RNetServiceEnum(struct cli_state *cli, void (*fn)(const char *, const char *, void *), void *state);
-int cli_NetSessionEnum(struct cli_state *cli, void (*fn)(char *, char *, uint16, uint16, uint16, uint_t, uint_t, uint_t, char *));
+int cli_NetSessionEnum(struct cli_state *cli, void (*fn)(char *, char *, uint16, uint16, uint16, unsigned int, unsigned int, unsigned int, char *));
 int cli_NetSessionGetInfo(struct cli_state *cli, const char *workstation,
-               void (*fn)(const char *, const char *, uint16, uint16, uint16, uint_t, uint_t, uint_t, const char *));
+               void (*fn)(const char *, const char *, uint16, uint16, uint16, unsigned int, unsigned int, unsigned int, const char *));
 int cli_NetSessionDel(struct cli_state *cli, const char *workstation);
 int cli_NetConnectionEnum(struct cli_state *cli, const char *qualifier,
                        void (*fn)(uint16_t conid, uint16_t contype,
@@ -3221,38 +3227,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  */
@@ -3306,7 +3321,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);
@@ -3495,12 +3510,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);
@@ -3961,6 +3976,7 @@ const char *lp_logon_drive(void);
 const char *lp_logon_home(void);
 char *lp_remote_announce(void);
 char *lp_remote_browse_sync(void);
+bool lp_nmbd_bind_explicit_broadcast(void);
 const char **lp_wins_server_list(void);
 const char **lp_interfaces(void);
 const char *lp_socket_address(void);
@@ -3982,6 +3998,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);
@@ -4032,6 +4049,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);
@@ -4125,6 +4143,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 );
@@ -4147,6 +4168,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 );
@@ -4217,6 +4239,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 );
@@ -4275,6 +4298,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);
@@ -4326,6 +4350,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);
@@ -4390,6 +4415,7 @@ void lp_set_posix_default_cifsx_readwrite_locktype(enum brl_flavour val);
 int lp_min_receive_file_size(void);
 char* lp_perfcount_module(void);
 void lp_set_passdb_backend(const char *backend);
+void widelinks_warning(int snum);
 
 /* The following definitions come from param/util.c  */
 
@@ -4400,8 +4426,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  */
@@ -4573,7 +4600,6 @@ struct event_context *pdb_get_event_context(void);
 NTSTATUS make_pdb_method_name(struct pdb_methods **methods, const char *selected);
 struct pdb_domain_info *pdb_get_domain_info(TALLOC_CTX *mem_ctx);
 bool pdb_getsampwnam(struct samu *sam_acct, const char *username) ;
-bool guest_user_info( struct samu *user );
 bool pdb_getsampwsid(struct samu *sam_acct, const DOM_SID *sid) ;
 NTSTATUS pdb_create_user(TALLOC_CTX *mem_ctx, const char *name, uint32 flags,
                         uint32 *rid);
@@ -4740,15 +4766,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);
@@ -4788,6 +4805,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  */
 
@@ -4912,7 +4930,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  */
 
@@ -4931,6 +4952,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  */
 
@@ -5303,6 +5325,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);
@@ -5396,7 +5419,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  */
 
@@ -5433,9 +5455,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  */
 
@@ -5579,7 +5598,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,
@@ -6060,19 +6080,18 @@ 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  */
 
@@ -6089,8 +6108,8 @@ 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);
+void remove_pending_lock_requests_by_mid(uint64_t mid);
+bool blocking_lock_was_deferred(uint64_t mid);
 struct blocking_lock_record *blocking_lock_cancel(files_struct *fsp,
                        uint32 lock_pid,
                        uint64_t offset,
@@ -6118,6 +6137,9 @@ NTSTATUS pass_oem_change(char *user,
                         uchar password_encrypted_with_nt_hash[516],
                         const uchar old_nt_hash_encrypted[16],
                         enum samPwdChangeReason *reject_reason);
+bool password_in_history(uint8_t nt_pw[NT_HASH_LEN],
+                        uint32_t pw_history_len,
+                        const uint8_t *pw_history);
 NTSTATUS check_password_complexity(const char *username,
                                   const char *password,
                                   enum samPwdChangeReason *samr_reject_reason);
@@ -6157,7 +6179,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);
@@ -6386,7 +6407,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);
@@ -6494,6 +6515,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,
@@ -6526,7 +6548,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,
@@ -6558,6 +6580,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);
@@ -6592,10 +6615,11 @@ 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,
@@ -6629,7 +6653,8 @@ 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);
 NTSTATUS open_file_fchmod(struct smb_request *req, connection_struct *conn,
                          struct smb_filename *smb_fname,
                          files_struct **result);
@@ -6654,6 +6679,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,
 
@@ -6715,7 +6741,7 @@ void invalidate_all_vuids(struct smbd_server_connection *sconn);
 int register_initial_vuid(struct smbd_server_connection *sconn);
 int register_existing_vuid(struct smbd_server_connection *sconn,
                        uint16 vuid,
-                       auth_serversupplied_info *server_info,
+                       struct auth_serversupplied_info *server_info,
                        DATA_BLOB response_blob,
                        const char *smb_name);
 void add_session_user(struct smbd_server_connection *sconn, const char *user);
@@ -6748,7 +6774,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);
@@ -6783,15 +6809,13 @@ int srv_set_message(char *buf,
                         int num_words,
                         int num_bytes,
                         bool zero);
-void init_smb_request(struct smb_request *req,
-                       const uint8 *inbuf,
-                       size_t unread_bytes,
-                       bool encrypted);
-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,
+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(uint64_t mid,
+                               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,
                               char *private_data, size_t priv_len);
@@ -6802,7 +6826,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);
@@ -7010,6 +7034,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,
@@ -7103,6 +7140,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  */