s3-auth Rename auth_serversupplied_info varaiables: server_info -> session_info
[amitay/samba.git] / source3 / include / proto.h
index ddb5c5e68b71a7845dbf85374717b831ab8be2e8..31ebd375187ea43daa5b9ff85b19bf008c17c96e 100644 (file)
@@ -57,9 +57,9 @@ NTSTATUS auth_netlogond_init(void);
 
 /* The following definitions come from auth/auth_ntlmssp.c  */
 
-NTSTATUS auth_ntlmssp_steal_server_info(TALLOC_CTX *mem_ctx,
+NTSTATUS auth_ntlmssp_steal_session_info(TALLOC_CTX *mem_ctx,
                                struct auth_ntlmssp_state *auth_ntlmssp_state,
-                               struct auth_serversupplied_info **server_info);
+                               struct auth_serversupplied_info **session_info);
 NTSTATUS auth_ntlmssp_start(struct auth_ntlmssp_state **auth_ntlmssp_state);
 
 
@@ -143,14 +143,14 @@ NTSTATUS make_serverinfo_from_username(TALLOC_CTX *mem_ctx,
 struct auth_serversupplied_info *copy_serverinfo(TALLOC_CTX *mem_ctx,
                                                 const struct auth_serversupplied_info *src);
 bool init_guest_info(void);
-bool init_system_info(void);
-bool server_info_set_session_key(struct auth_serversupplied_info *info,
+NTSTATUS init_system_info(void);
+bool session_info_set_session_key(struct auth_serversupplied_info *info,
                                 DATA_BLOB session_key);
 NTSTATUS make_server_info_guest(TALLOC_CTX *mem_ctx,
                                struct auth_serversupplied_info **server_info);
-NTSTATUS make_server_info_system(TALLOC_CTX *mem_ctx,
-                                struct auth_serversupplied_info **server_info);
-const struct auth_serversupplied_info *get_server_info_system(void);
+NTSTATUS make_session_info_system(TALLOC_CTX *mem_ctx,
+                                struct auth_serversupplied_info **session_info);
+const struct auth_serversupplied_info *get_session_info_system(void);
 bool copy_current_user(struct current_user *dst, struct current_user *src);
 struct passwd *smb_getpwnam( TALLOC_CTX *mem_ctx, const char *domuser,
                             char **p_save_username, bool create );
@@ -334,10 +334,6 @@ bool pdb_get_dom_grp_info(const struct dom_sid *sid, struct acct_info *info);
 bool pdb_set_dom_grp_info(const struct dom_sid *sid, const struct acct_info *info);
 NTSTATUS pdb_create_builtin_alias(uint32 rid);
 
-/* The following definitions come from groupdb/mapping_ldb.c  */
-
-const struct mapping_backend *groupdb_ldb_init(void);
-
 /* The following definitions come from groupdb/mapping_tdb.c  */
 
 const struct mapping_backend *groupdb_tdb_init(void);
@@ -413,7 +409,6 @@ int bitmap_find(struct bitmap *bm, unsigned ofs);
 
 /* The following definitions come from lib/charcnv.c  */
 
-NTSTATUS smb_register_charset(struct charset_functions *funcs);
 char lp_failed_convert_char(void);
 void lazy_initialize_conv(void);
 void gfree_charcnv(void);
@@ -608,13 +603,6 @@ int ms_fnmatch(const char *pattern, const char *string, bool translate_pattern,
               bool is_case_sensitive);
 int gen_fnmatch(const char *pattern, const char *string);
 
-/* The following definitions come from lib/pam_errors.c  */
-
-NTSTATUS pam_to_nt_status(int pam_error);
-int nt_status_to_pam(NTSTATUS nt_status);
-NTSTATUS pam_to_nt_status(int pam_error);
-int nt_status_to_pam(NTSTATUS nt_status);
-
 /* The following definitions come from lib/pidfile.c  */
 
 pid_t pidfile_pid(const char *name);
@@ -897,6 +885,7 @@ int sys_open(const char *path, int oflag, mode_t mode);
 FILE *sys_fopen(const char *path, const char *type);
 void kernel_flock(int fd, uint32 share_mode, uint32 access_mask);
 SMB_STRUCT_DIR *sys_opendir(const char *name);
+SMB_STRUCT_DIR *sys_fdopendir(int fd);
 SMB_STRUCT_DIRENT *sys_readdir(SMB_STRUCT_DIR *dirp);
 void sys_seekdir(SMB_STRUCT_DIR *dirp, long offset);
 long sys_telldir(SMB_STRUCT_DIR *dirp);
@@ -1186,9 +1175,6 @@ void *_talloc_memdup_zeronull(const void *t, const void *p, size_t size, const c
 void *_talloc_array_zeronull(const void *ctx, size_t el_size, unsigned count, const char *name);
 void *_talloc_zero_array_zeronull(const void *ctx, size_t el_size, unsigned count, const char *name);
 void *talloc_zeronull(const void *context, size_t size, const char *name);
-bool is_valid_policy_hnd(const struct policy_handle *hnd);
-bool policy_hnd_equal(const struct policy_handle *hnd1,
-                     const struct policy_handle *hnd2);
 const char *strip_hostname(const char *s);
 bool tevent_req_poll_ntstatus(struct tevent_req *req,
                              struct tevent_context *ev,
@@ -1487,15 +1473,10 @@ char *sanitize_username(TALLOC_CTX *mem_ctx, const char *username);
 
 void gfree_case_tables(void);
 void load_case_tables(void);
-void init_valid_table(void);
 size_t dos_PutUniCode(char *dst,const char *src, size_t len, bool null_terminate);
 char *skip_unibuf(char *src, size_t len);
 int rpcstr_push(void *dest, const char *src, size_t dest_len, int flags);
 int rpcstr_push_talloc(TALLOC_CTX *ctx, smb_ucs2_t **dest, const char *src);
-smb_ucs2_t toupper_w(smb_ucs2_t val);
-smb_ucs2_t tolower_w( smb_ucs2_t val );
-bool islower_w(smb_ucs2_t c);
-bool isupper_w(smb_ucs2_t c);
 bool isvalid83_w(smb_ucs2_t c);
 size_t strlen_w(const smb_ucs2_t *src);
 size_t strnlen_w(const smb_ucs2_t *src, size_t max);
@@ -1579,15 +1560,6 @@ void wins_srv_tags_free(char **list);
 struct in_addr wins_srv_ip_tag(const char *tag, struct in_addr src_ip);
 unsigned wins_srv_count_tag(const char *tag);
 
-/* The following definitions come from librpc/ndr/util.c  */
-
-enum ndr_err_code ndr_push_server_id(struct ndr_push *ndr, int ndr_flags, const struct server_id *r);
-enum ndr_err_code ndr_pull_server_id(struct ndr_pull *ndr, int ndr_flags, struct server_id *r);
-void ndr_print_server_id(struct ndr_print *ndr, const char *name, const struct server_id *r);
-_PUBLIC_ void ndr_print_sockaddr_storage(struct ndr_print *ndr, const char *name, const struct sockaddr_storage *ss);
-const char *ndr_errstr(enum ndr_err_code err);
-extern const struct ndr_syntax_id null_ndr_syntax_id;
-
 /* The following definitions come from libsmb/cliconnect.c  */
 
 ADS_STATUS cli_session_setup_spnego(struct cli_state *cli, const char *user, 
@@ -2615,24 +2587,6 @@ NTSTATUS check_negative_conn_cache( const char *domain, const char *server);
 void add_failed_connection_entry(const char *domain, const char *server, NTSTATUS result) ;
 void flush_negative_conn_cache_for_domain(const char *domain);
 
-/* The following definitions come from ../librpc/rpc/dcerpc_error.c  */
-
-const char *dcerpc_errstr(TALLOC_CTX *mem_ctx, uint32_t fault_code);
-NTSTATUS dcerpc_fault_to_nt_status(uint32_t fault_code);
-
-/* The following definitions come from ../librpc/rpc/dcerpc_util.c  */
-
-void dcerpc_set_frag_length(DATA_BLOB *blob, uint16_t v);
-uint16_t dcerpc_get_frag_length(const DATA_BLOB *blob);
-void dcerpc_set_auth_length(DATA_BLOB *blob, uint16_t v);
-uint8_t dcerpc_get_endian_flag(DATA_BLOB *blob);
-NTSTATUS dcerpc_pull_auth_trailer(struct ncacn_packet *pkt,
-                                 TALLOC_CTX *mem_ctx,
-                                 DATA_BLOB *pkt_trailer,
-                                 struct dcerpc_auth *auth,
-                                 uint32_t *auth_length,
-                                 bool auth_data_only);
-
 /* The following definitions come from libsmb/dsgetdcname.c  */
 
 struct netr_DsRGetDCNameInfo;
@@ -3775,6 +3729,8 @@ const char *pdb_get_comment(const struct samu *sampass);
 const char *pdb_get_munged_dial(const struct samu *sampass);
 uint16_t pdb_get_bad_password_count(const struct samu *sampass);
 uint16_t pdb_get_logon_count(const struct samu *sampass);
+uint16_t pdb_get_country_code(const struct samu *sampass);
+uint16_t pdb_get_code_page(const struct samu *sampass);
 uint32_t pdb_get_unknown_6(const struct samu *sampass);
 void *pdb_get_backend_private_data(const struct samu *sampass, const struct pdb_methods *my_methods);
 bool pdb_set_acct_ctrl(struct samu *sampass, uint32_t acct_ctrl, enum pdb_value_state flag);
@@ -3809,8 +3765,13 @@ bool pdb_set_pw_history(struct samu *sampass, const uint8_t *pwd, uint32_t histo
 bool pdb_set_plaintext_pw_only(struct samu *sampass, const char *password, enum pdb_value_state flag);
 bool pdb_set_bad_password_count(struct samu *sampass, uint16_t bad_password_count, enum pdb_value_state flag);
 bool pdb_set_logon_count(struct samu *sampass, uint16_t logon_count, enum pdb_value_state flag);
+bool pdb_set_country_code(struct samu *sampass, uint16_t country_code,
+                         enum pdb_value_state flag);
+bool pdb_set_code_page(struct samu *sampass, uint16_t code_page,
+                      enum pdb_value_state flag);
 bool pdb_set_unknown_6(struct samu *sampass, uint32_t unkn, enum pdb_value_state flag);
-bool pdb_set_hours(struct samu *sampass, const uint8_t *hours, enum pdb_value_state flag);
+bool pdb_set_hours(struct samu *sampass, const uint8 *hours, int hours_len,
+                  enum pdb_value_state flag);
 bool pdb_set_backend_private_data(struct samu *sampass, void *private_data, 
                                   void (*free_fn)(void **), 
                                   const struct pdb_methods *my_methods, 
@@ -3907,12 +3868,19 @@ bool pdb_set_trusteddom_pw(const char* domain, const char* pwd,
 bool pdb_del_trusteddom_pw(const char *domain);
 NTSTATUS pdb_enum_trusteddoms(TALLOC_CTX *mem_ctx, uint32_t *num_domains,
                              struct trustdom_info ***domains);
+NTSTATUS pdb_get_trusted_domain(TALLOC_CTX *mem_ctx, const char *domain,
+                               struct pdb_trusted_domain **td);
+NTSTATUS pdb_get_trusted_domain_by_sid(TALLOC_CTX *mem_ctx, struct dom_sid *sid,
+                               struct pdb_trusted_domain **td);
+NTSTATUS pdb_set_trusted_domain(const char* domain,
+                               const struct pdb_trusted_domain *td);
+NTSTATUS pdb_del_trusted_domain(const char *domain);
+NTSTATUS pdb_enum_trusted_domains(TALLOC_CTX *mem_ctx, uint32_t *num_domains,
+                                 struct pdb_trusted_domain ***domains);
 NTSTATUS make_pdb_method( struct pdb_methods **methods ) ;
 
 /* The following definitions come from passdb/pdb_ldap.c  */
 
-struct ldapsam_privates;
-
 const char** get_userattr_list( TALLOC_CTX *mem_ctx, int schema_ver );
 NTSTATUS pdb_init_ldapsam_compat(struct pdb_methods **pdb_method, const char *location);
 NTSTATUS pdb_init_ldapsam(struct pdb_methods **pdb_method, const char *location);
@@ -3933,6 +3901,10 @@ int pdb_nds_set_password(
        const char *pwd );
 NTSTATUS pdb_nds_init(void);
 
+/* The following definitions come from passdb/pdb_nds.c  */
+
+NTSTATUS pdb_ipa_init(void);
+
 /* The following definitions come from passdb/pdb_smbpasswd.c  */
 
 NTSTATUS pdb_smbpasswd_init(void) ;
@@ -4118,15 +4090,16 @@ NTSTATUS rpc_pipe_open_tcp(TALLOC_CTX *mem_ctx, const char *host,
 NTSTATUS rpc_pipe_open_ncalrpc(TALLOC_CTX *mem_ctx, const char *socket_path,
                               const struct ndr_syntax_id *abstract_syntax,
                               struct rpc_pipe_client **presult);
+struct dcerpc_binding_handle *rpccli_bh_create(struct rpc_pipe_client *c);
 struct pipes_struct *make_internal_rpc_pipe_p(TALLOC_CTX *mem_ctx,
                                              const struct ndr_syntax_id *syntax,
                                              struct client_address *client_id,
-                                             const struct auth_serversupplied_info *server_info,
+                                             const struct auth_serversupplied_info *session_info,
                                              struct messaging_context *msg_ctx);
 NTSTATUS rpcint_binding_handle(TALLOC_CTX *mem_ctx,
                               const struct ndr_interface_table *ndr_table,
                               struct client_address *client_id,
-                              const struct auth_serversupplied_info *server_info,
+                              const struct auth_serversupplied_info *session_info,
                               struct messaging_context *msg_ctx,
                               struct dcerpc_binding_handle **binding_handle);
 NTSTATUS rpc_pipe_open_internal(TALLOC_CTX *mem_ctx,
@@ -4137,7 +4110,7 @@ NTSTATUS rpc_pipe_open_internal(TALLOC_CTX *mem_ctx,
                                struct rpc_pipe_client **presult);
 NTSTATUS rpc_pipe_open_interface(TALLOC_CTX *mem_ctx,
                                 const struct ndr_syntax_id *syntax,
-                                const struct auth_serversupplied_info *server_info,
+                                const struct auth_serversupplied_info *session_info,
                                 struct client_address *client_id,
                                 struct messaging_context *msg_ctx,
                                 struct rpc_pipe_client **cli_pipe);
@@ -4334,7 +4307,7 @@ NTSTATUS np_open(TALLOC_CTX *mem_ctx, const char *name,
                 const struct tsocket_address *local_address,
                 const struct tsocket_address *remote_address,
                 struct client_address *client_id,
-                struct auth_serversupplied_info *server_info,
+                struct auth_serversupplied_info *session_info,
                 struct messaging_context *msg_ctx,
                 struct fake_file_handle **phandle);
 bool np_read_in_progress(struct fake_file_handle *handle);
@@ -4557,9 +4530,10 @@ void dptr_closecnum(connection_struct *conn);
 void dptr_idlecnum(connection_struct *conn);
 void dptr_closepath(struct smbd_server_connection *sconn,
                    char *path,uint16 spid);
-NTSTATUS dptr_create(connection_struct *conn, const char *path, bool old_handle, bool expect_close,uint16 spid,
+NTSTATUS dptr_create(connection_struct *conn, files_struct *fsp,
+               const char *path, bool old_handle, bool expect_close,uint16 spid,
                const char *wcard, bool wcard_has_wild, uint32 attr, struct dptr_struct **dptr_ret);
-int dptr_CloseDir(struct dptr_struct *dptr);
+void dptr_CloseDir(files_struct *fsp);
 void dptr_SeekDir(struct dptr_struct *dptr, long offset);
 long dptr_TellDir(struct dptr_struct *dptr);
 bool dptr_has_wild(struct dptr_struct *dptr);
@@ -4880,7 +4854,7 @@ NTSTATUS create_conn_struct(TALLOC_CTX *ctx,
                                connection_struct **pconn,
                                int snum,
                                const char *path,
-                               const struct auth_serversupplied_info *server_info,
+                               const struct auth_serversupplied_info *session_info,
                                char **poldcwd);
 
 /* The following definitions come from smbd/negprot.c  */
@@ -5110,7 +5084,7 @@ int register_initial_vuid(struct smbd_server_connection *sconn);
 int register_homes_share(const char *username);
 int register_existing_vuid(struct smbd_server_connection *sconn,
                        uint16 vuid,
-                       struct auth_serversupplied_info *server_info,
+                       struct auth_serversupplied_info *session_info,
                        DATA_BLOB response_blob,
                        const char *smb_name);
 void add_session_user(struct smbd_server_connection *sconn, const char *user);
@@ -5434,7 +5408,7 @@ int sessionid_traverse_read(int (*fn)(const char *key,
 /* The following definitions come from smbd/sesssetup.c  */
 
 NTSTATUS do_map_to_guest(NTSTATUS status,
-               struct auth_serversupplied_info **server_info,
+               struct auth_serversupplied_info **session_info,
                const char *user, const char *domain);
 
 NTSTATUS parse_spnego_mechanisms(TALLOC_CTX *ctx,