From 1ef69fcf21400a72ad34198aaa9cf8a1afbbb9ec Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Sun, 18 May 2008 22:58:07 +0200 Subject: build: freeze proto.h Michael (This used to be commit ff7f0cad2eb108daa61a910cd9171ab0811a5f60) --- source3/include/proto.h | 10475 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 10475 insertions(+) create mode 100644 source3/include/proto.h (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h new file mode 100644 index 00000000000..1d4e68a15b9 --- /dev/null +++ b/source3/include/proto.h @@ -0,0 +1,10475 @@ +/* + * Unix SMB/CIFS implementation. + * collected prototypes header + * + * frozen from "make proto" in May 2008 + * + * Copyright (C) Michael Adam 2008 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#ifndef _PROTO_H_ +#define _PROTO_H_ + + +/* The following definitions come from auth/auth.c */ + +NTSTATUS smb_register_auth(int version, const char *name, auth_init_function init); +bool load_auth_module(struct auth_context *auth_context, + const char *module, auth_methods **ret) ; +NTSTATUS make_auth_context_subsystem(struct auth_context **auth_context) ; +NTSTATUS make_auth_context_fixed(struct auth_context **auth_context, uchar chal[8]) ; + +/* The following definitions come from auth/auth_builtin.c */ + +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); +bool password_ok(const char *smb_name, DATA_BLOB password_blob); + +/* The following definitions come from auth/auth_domain.c */ + +NTSTATUS auth_domain_init(void) ; + +/* The following definitions come from auth/auth_ntlmssp.c */ + +NTSTATUS auth_ntlmssp_start(AUTH_NTLMSSP_STATE **auth_ntlmssp_state); +void auth_ntlmssp_end(AUTH_NTLMSSP_STATE **auth_ntlmssp_state); +NTSTATUS auth_ntlmssp_update(AUTH_NTLMSSP_STATE *auth_ntlmssp_state, + const DATA_BLOB request, DATA_BLOB *reply) ; + +/* The following definitions come from auth/auth_sam.c */ + +NTSTATUS auth_sam_init(void); + +/* The following definitions come from auth/auth_server.c */ + +NTSTATUS auth_server_init(void); + +/* The following definitions come from auth/auth_unix.c */ + +NTSTATUS auth_unix_init(void); + +/* The following definitions come from auth/auth_util.c */ + +NTSTATUS make_user_info_map(auth_usersupplied_info **user_info, + const char *smb_name, + const char *client_domain, + const char *wksta_name, + DATA_BLOB *lm_pwd, DATA_BLOB *nt_pwd, + 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, + const char *smb_name, + const char *client_domain, + const char *wksta_name, + uint32 logon_parameters, + const uchar *lm_network_pwd, + int lm_pwd_len, + const uchar *nt_network_pwd, + int nt_pwd_len); +bool make_user_info_netlogon_interactive(auth_usersupplied_info **user_info, + const char *smb_name, + const char *client_domain, + const char *wksta_name, + uint32 logon_parameters, + const uchar chal[8], + 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, + 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, + 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, + struct samu *sampass); +NTSTATUS create_local_token(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, + char **found_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, + char *unix_username, + struct passwd *pwd); +NTSTATUS make_serverinfo_from_username(TALLOC_CTX *mem_ctx, + const char *username, + bool is_guest, + struct auth_serversupplied_info **presult); +struct auth_serversupplied_info *copy_serverinfo(TALLOC_CTX *mem_ctx, + auth_serversupplied_info *src); +bool init_guest_info(void); +NTSTATUS make_server_info_guest(TALLOC_CTX *mem_ctx, + 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 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); +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/auth_winbind.c */ + +NTSTATUS auth_winbind_init(void); + +/* The following definitions come from auth/pampass.c */ + +bool smb_pam_claim_session(char *user, char *tty, char *rhost); +bool smb_pam_close_session(char *user, char *tty, char *rhost); +NTSTATUS smb_pam_accountcheck(const char * user); +NTSTATUS smb_pam_passcheck(const char * user, const char * password); +bool smb_pam_passchange(const char * user, const char * oldpassword, const char * newpassword); +NTSTATUS smb_pam_accountcheck(const char * user); +bool smb_pam_claim_session(char *user, char *tty, char *rhost); +bool smb_pam_close_session(char *in_user, char *tty, char *rhost); + +/* The following definitions come from auth/pass_check.c */ + +void dfs_unlogin(void); +NTSTATUS pass_check(const struct passwd *pass, const char *user, const char *password, + int pwlen, bool (*fn) (const char *, const char *), bool run_cracker); + +/* The following definitions come from auth/token_util.c */ + +bool nt_token_check_sid ( const DOM_SID *sid, const NT_USER_TOKEN *token ); +bool nt_token_check_domain_rid( NT_USER_TOKEN *token, uint32 rid ); +NT_USER_TOKEN *get_root_nt_token( void ); +NTSTATUS add_aliases(const DOM_SID *domain_sid, + struct nt_user_token *token); +struct nt_user_token *create_local_nt_token(TALLOC_CTX *mem_ctx, + const DOM_SID *user_sid, + bool is_guest, + int num_groupsids, + const DOM_SID *groupsids); +void debug_nt_user_token(int dbg_class, int dbg_lev, NT_USER_TOKEN *token); +void debug_unix_user_token(int dbg_class, int dbg_lev, uid_t uid, gid_t gid, + int n_groups, gid_t *groups); + +/* The following definitions come from dynconfig.c */ + +const char *get_dyn_CONFIGFILE(void); +const char *set_dyn_CONFIGFILE(const char *newpath); +const char *get_dyn_LOGFILEBASE(void); +const char *set_dyn_LOGFILEBASE(const char *newpath); +const char *get_dyn_LMHOSTSFILE(void); +const char *set_dyn_LMHOSTSFILE(const char *newpath); +const char *get_dyn_CODEPAGEDIR(void); +const char *set_dyn_CODEPAGEDIR(const char *newpath); +const char *get_dyn_LIBDIR(void); +const char *set_dyn_LIBDIR(const char *newpath); +const char *get_dyn_SHLIBEXT(void); +const char *set_dyn_SHLIBEXT(const char *newpath); +const char *get_dyn_LOCKDIR(void); +const char *set_dyn_LOCKDIR(const char *newpath); +const char *get_dyn_PIDDIR(void); +const char *set_dyn_PIDDIR(const char *newpath); +const char *get_dyn_SMB_PASSWD_FILE(void); +const char *set_dyn_SMB_PASSWD_FILE(const char *newpath); +const char *get_dyn_PRIVATE_DIR(void); +const char *set_dyn_PRIVATE_DIR(const char *newpath); +const char *get_dyn_STATEDIR(void); +const char *get_dyn_CACHEDIR(void); + +/* The following definitions come from groupdb/mapping.c */ + +NTSTATUS add_initial_entry(gid_t gid, const char *sid, enum lsa_SidType sid_name_use, const char *nt_name, const char *comment); +bool get_domain_group_from_sid(DOM_SID sid, GROUP_MAP *map); +int smb_create_group(const char *unix_group, gid_t *new_gid); +int smb_delete_group(const char *unix_group); +int smb_set_primary_group(const char *unix_group, const char* unix_user); +int smb_add_user_group(const char *unix_group, const char *unix_user); +int smb_delete_user_group(const char *unix_group, const char *unix_user); +NTSTATUS pdb_default_getgrsid(struct pdb_methods *methods, GROUP_MAP *map, + DOM_SID sid); +NTSTATUS pdb_default_getgrgid(struct pdb_methods *methods, GROUP_MAP *map, + gid_t gid); +NTSTATUS pdb_default_getgrnam(struct pdb_methods *methods, GROUP_MAP *map, + const char *name); +NTSTATUS pdb_default_add_group_mapping_entry(struct pdb_methods *methods, + GROUP_MAP *map); +NTSTATUS pdb_default_update_group_mapping_entry(struct pdb_methods *methods, + GROUP_MAP *map); +NTSTATUS pdb_default_delete_group_mapping_entry(struct pdb_methods *methods, + DOM_SID sid); +NTSTATUS pdb_default_enum_group_mapping(struct pdb_methods *methods, + const DOM_SID *sid, enum lsa_SidType sid_name_use, + GROUP_MAP **pp_rmap, size_t *p_num_entries, + bool unix_only); +NTSTATUS pdb_default_create_alias(struct pdb_methods *methods, + const char *name, uint32 *rid); +NTSTATUS pdb_default_delete_alias(struct pdb_methods *methods, + const DOM_SID *sid); +NTSTATUS pdb_default_get_aliasinfo(struct pdb_methods *methods, + const DOM_SID *sid, + struct acct_info *info); +NTSTATUS pdb_default_set_aliasinfo(struct pdb_methods *methods, + const DOM_SID *sid, + struct acct_info *info); +NTSTATUS pdb_default_add_aliasmem(struct pdb_methods *methods, + const DOM_SID *alias, const DOM_SID *member); +NTSTATUS pdb_default_del_aliasmem(struct pdb_methods *methods, + const DOM_SID *alias, const DOM_SID *member); +NTSTATUS pdb_default_enum_aliasmem(struct pdb_methods *methods, + const DOM_SID *alias, DOM_SID **pp_members, + size_t *p_num_members); +NTSTATUS pdb_default_alias_memberships(struct pdb_methods *methods, + TALLOC_CTX *mem_ctx, + const DOM_SID *domain_sid, + const DOM_SID *members, + size_t num_members, + uint32 **pp_alias_rids, + size_t *p_num_alias_rids); +NTSTATUS pdb_nop_getgrsid(struct pdb_methods *methods, GROUP_MAP *map, + DOM_SID sid); +NTSTATUS pdb_nop_getgrgid(struct pdb_methods *methods, GROUP_MAP *map, + gid_t gid); +NTSTATUS pdb_nop_getgrnam(struct pdb_methods *methods, GROUP_MAP *map, + const char *name); +NTSTATUS pdb_nop_add_group_mapping_entry(struct pdb_methods *methods, + GROUP_MAP *map); +NTSTATUS pdb_nop_update_group_mapping_entry(struct pdb_methods *methods, + GROUP_MAP *map); +NTSTATUS pdb_nop_delete_group_mapping_entry(struct pdb_methods *methods, + DOM_SID sid); +NTSTATUS pdb_nop_enum_group_mapping(struct pdb_methods *methods, + enum lsa_SidType sid_name_use, + GROUP_MAP **rmap, size_t *num_entries, + bool unix_only); +bool pdb_get_dom_grp_info(const DOM_SID *sid, struct acct_info *info); +bool pdb_set_dom_grp_info(const 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); + +/* The following definitions come from intl/lang_tdb.c */ + +bool lang_tdb_init(const char *lang); +const char *lang_msg(const char *msgid); +void lang_msg_free(const char *msgstr); +char *lang_tdb_current(void); + +/* The following definitions come from lib/access.c */ + +bool allow_access(const char **deny_list, + const char **allow_list, + const char *cname, + const char *caddr); +bool check_access(int sock, const char **allow_list, const char **deny_list); + +/* The following definitions come from lib/account_pol.c */ + +void account_policy_names_list(const char ***names, int *num_names); +const char *decode_account_policy_name(int field); +const char *get_account_policy_attr(int field); +const char *account_policy_get_desc(int field); +int account_policy_name_to_fieldnum(const char *name); +bool account_policy_get_default(int account_policy, uint32 *val); +bool init_account_policy(void); +bool account_policy_get(int field, uint32 *value); +bool account_policy_set(int field, uint32 value); +bool cache_account_policy_set(int field, uint32 value); +bool cache_account_policy_get(int field, uint32 *value); +struct db_context *get_account_pol_db( void ); + +/* The following definitions come from lib/adt_tree.c */ + + +/* The following definitions come from lib/afs.c */ + +char *afs_createtoken_str(const char *username, const char *cell); +bool afs_login(connection_struct *conn); +bool afs_login(connection_struct *conn); +char *afs_createtoken_str(const char *username, const char *cell); + +/* The following definitions come from lib/afs_settoken.c */ + +int afs_syscall( int subcall, + char * path, + int cmd, + char * cmarg, + int follow); +bool afs_settoken_str(const char *token_string); +bool afs_settoken_str(const char *token_string); + +/* The following definitions come from lib/arc4.c */ + +void smb_arc4_init(unsigned char arc4_state_out[258], const unsigned char *key, size_t keylen); +void smb_arc4_crypt(unsigned char arc4_state_inout[258], unsigned char *data, size_t len); + +/* The following definitions come from lib/audit.c */ + +const char *audit_category_str(uint32 category); +const char *audit_param_str(uint32 category); +const char *audit_description_str(uint32 category); +bool get_audit_category_from_param(const char *param, uint32 *audit_category); +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); +bool bitmap_clear(struct bitmap *bm, unsigned i); +bool bitmap_query(struct bitmap *bm, unsigned i); +int bitmap_find(struct bitmap *bm, unsigned ofs); + +/* The following definitions come from lib/charcnv.c */ + +char lp_failed_convert_char(void); +void lazy_initialize_conv(void); +void gfree_charcnv(void); +void init_iconv(void); +size_t convert_string(charset_t from, charset_t to, + void const *src, size_t srclen, + void *dest, size_t destlen, bool allow_bad_conv); +bool convert_string_allocate(TALLOC_CTX *ctx, charset_t from, charset_t to, + void const *src, size_t srclen, void *dst, + size_t *converted_size, bool allow_bad_conv); +size_t convert_string_talloc(TALLOC_CTX *ctx, charset_t from, charset_t to, + void const *src, size_t srclen, void *dst, + bool allow_bad_conv); +size_t unix_strupper(const char *src, size_t srclen, char *dest, size_t destlen); +char *strdup_upper(const char *s); +char *talloc_strdup_upper(TALLOC_CTX *ctx, const char *s); +size_t unix_strlower(const char *src, size_t srclen, char *dest, size_t destlen); +char *strdup_lower(const char *s); +char *talloc_strdup_lower(TALLOC_CTX *ctx, const char *s); +size_t ucs2_align(const void *base_ptr, const void *p, int flags); +size_t push_ascii(void *dest, const char *src, size_t dest_len, int flags); +size_t push_ascii_fstring(void *dest, const char *src); +size_t push_ascii_nstring(void *dest, const char *src); +size_t push_ascii_allocate(char **dest, const char *src); +size_t pull_ascii(char *dest, const void *src, size_t dest_len, size_t src_len, int flags); +size_t pull_ascii_fstring(char *dest, const void *src); +size_t pull_ascii_nstring(char *dest, size_t dest_len, const void *src); +size_t push_ucs2(const void *base_ptr, void *dest, const char *src, size_t dest_len, int flags); +size_t push_ucs2_talloc(TALLOC_CTX *ctx, smb_ucs2_t **dest, const char *src); +size_t push_ucs2_allocate(smb_ucs2_t **dest, const char *src); +size_t push_utf8_fstring(void *dest, const char *src); +size_t push_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src); +size_t push_utf8_allocate(char **dest, const char *src); +size_t pull_ucs2(const void *base_ptr, char *dest, const void *src, size_t dest_len, size_t src_len, int flags); +size_t pull_ucs2_base_talloc(TALLOC_CTX *ctx, + const void *base_ptr, + char **ppdest, + const void *src, + size_t src_len, + int flags); +size_t pull_ucs2_fstring(char *dest, const void *src); +size_t pull_ucs2_talloc(TALLOC_CTX *ctx, char **dest, const smb_ucs2_t *src); +size_t pull_ucs2_allocate(char **dest, const smb_ucs2_t *src); +size_t pull_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src); +size_t pull_utf8_allocate(char **dest, const char *src); +size_t pull_ascii_talloc(TALLOC_CTX *ctx, char **dest, const char *src); +size_t push_string_fn(const char *function, unsigned int line, + const void *base_ptr, uint16 flags2, + void *dest, const char *src, + size_t dest_len, int flags); +size_t pull_string_fn(const char *function, + unsigned int line, + const void *base_ptr, + uint16 smb_flags2, + char *dest, + const void *src, + size_t dest_len, + size_t src_len, + int flags); +size_t pull_string_talloc_fn(const char *function, + unsigned int line, + TALLOC_CTX *ctx, + const void *base_ptr, + uint16 smb_flags2, + char **ppdest, + const void *src, + size_t src_len, + int flags); +size_t align_string(const void *base_ptr, const char *p, int flags); +codepoint_t next_codepoint(const char *str, size_t *size); + +/* The following definitions come from lib/clobber.c */ + +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); +int connections_traverse(int (*fn)(struct db_record *rec, + void *private_data), + void *private_data); +int connections_forall(int (*fn)(struct db_record *rec, + 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/crc32.c */ + +uint32 crc32_calc_buffer(const char *buf, size_t size); + +/* The following definitions come from lib/data_blob.c */ + +DATA_BLOB data_blob(const void *p, size_t length); +DATA_BLOB data_blob_talloc(TALLOC_CTX *mem_ctx, const void *p, size_t length); +void data_blob_free(DATA_BLOB *d); +void data_blob_clear(DATA_BLOB *d); +void data_blob_clear_free(DATA_BLOB *d); +DATA_BLOB data_blob_string_const(const char *str); +DATA_BLOB data_blob_const(const void *p, size_t length); +DATA_BLOB data_blob_talloc_zero(TALLOC_CTX *mem_ctx, size_t length); +_PUBLIC_ char *data_blob_hex_string(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob); + +/* The following definitions come from lib/dbwrap_util.c */ + +int32_t dbwrap_fetch_int32(struct db_context *db, const char *keystr); +int dbwrap_store_int32(struct db_context *db, const char *keystr, int32_t v); +bool dbwrap_fetch_uint32(struct db_context *db, const char *keystr, + uint32_t *val); +bool dbwrap_store_uint32(struct db_context *db, const char *keystr, uint32_t v); +uint32_t dbwrap_change_uint32_atomic(struct db_context *db, const char *keystr, + uint32_t *oldval, uint32_t change_val); +int32 dbwrap_change_int32_atomic(struct db_context *db, const char *keystr, + int32 *oldval, int32 change_val); +NTSTATUS dbwrap_trans_store(struct db_context *db, TDB_DATA key, TDB_DATA dbuf, + int flag); +NTSTATUS dbwrap_trans_delete(struct db_context *db, TDB_DATA key); +NTSTATUS dbwrap_trans_store_int32(struct db_context *db, const char *keystr, + int32_t v); +NTSTATUS dbwrap_trans_store_uint32(struct db_context *db, const char *keystr, + uint32_t v); +NTSTATUS dbwrap_trans_store_bystring(struct db_context *db, const char *key, + TDB_DATA data, int flags); +NTSTATUS dbwrap_trans_delete_bystring(struct db_context *db, const char *key); + +/* The following definitions come from lib/debug.c */ + +void gfree_debugsyms(void); +const char *debug_classname_from_index(int ndx); +int debug_add_class(const char *classname); +int debug_lookup_classname(const char *classname); +bool debug_parse_levels(const char *params_str); +void debug_init(void); +void debug_register_msgs(struct messaging_context *msg_ctx); +void setup_logging(const char *pname, bool interactive); +void debug_set_logfile(const char *name); +bool reopen_logs( void ); +void force_check_log_size( void ); +bool need_to_check_log_size( void ); +void check_log_size( void ); +void dbgflush( void ); +bool dbghdr(int level, int cls, const char *file, const char *func, int line); +TALLOC_CTX *debug_ctx(void); + +/* The following definitions come from lib/display_sec.c */ + +char *get_sec_mask_str(TALLOC_CTX *ctx, uint32 type); +void display_sec_access(SEC_ACCESS *info); +void display_sec_ace_flags(uint8_t flags); +void display_sec_ace(SEC_ACE *ace); +void display_sec_acl(SEC_ACL *sec_acl); +void display_acl_type(uint16 type); +void display_sec_desc(SEC_DESC *sec); + +/* The following definitions come from lib/dmallocmsg.c */ + +void register_dmalloc_msgs(struct messaging_context *msg_ctx); + +/* The following definitions come from lib/dprintf.c */ + +void display_set_stderr(void); + +/* The following definitions come from lib/errmap_unix.c */ + +NTSTATUS map_nt_error_from_unix(int unix_error); + +/* The following definitions come from lib/events.c */ + +struct timed_event *event_add_timed(struct event_context *event_ctx, + TALLOC_CTX *mem_ctx, + struct timeval when, + const char *event_name, + void (*handler)(struct event_context *event_ctx, + struct timed_event *te, + const struct timeval *now, + void *private_data), + void *private_data); +struct fd_event *event_add_fd(struct event_context *event_ctx, + TALLOC_CTX *mem_ctx, + int fd, uint16_t flags, + void (*handler)(struct event_context *event_ctx, + struct fd_event *event, + uint16 flags, + void *private_data), + void *private_data); +void event_fd_set_writeable(struct fd_event *fde); +void event_fd_set_not_writeable(struct fd_event *fde); +void event_fd_set_readable(struct fd_event *fde); +void event_fd_set_not_readable(struct fd_event *fde); +bool event_add_to_select_args(struct event_context *event_ctx, + const struct timeval *now, + fd_set *read_fds, fd_set *write_fds, + struct timeval *timeout, int *maxfd); +bool events_pending(struct event_context *event_ctx); +bool run_events(struct event_context *event_ctx, + int selrtn, fd_set *read_fds, fd_set *write_fds); +struct timeval *get_timed_events_timeout(struct event_context *event_ctx, + struct timeval *to_ret); +int event_loop_once(struct event_context *ev); +struct event_context *event_context_init(TALLOC_CTX *mem_ctx); +int set_event_dispatch_time(struct event_context *event_ctx, + const char *event_name, struct timeval when); +int cancel_named_event(struct event_context *event_ctx, + const char *event_name); +void dump_event_list(struct event_context *event_ctx); + +/* The following definitions come from lib/fault.c */ + +void fault_setup(void (*fn)(void *)); +void dump_core_setup(const char *progname); + +/* The following definitions come from lib/file_id.c */ + +struct file_id file_id_create_dev(SMB_DEV_T dev, SMB_INO_T inode); +struct file_id vfs_file_id_from_sbuf(connection_struct *conn, const SMB_STRUCT_STAT *sbuf); +bool file_id_equal(const struct file_id *id1, const struct file_id *id2); +const char *file_id_string_tos(const struct file_id *id); +void push_file_id_16(char *buf, const struct file_id *id); +void pull_file_id_16(char *buf, struct file_id *id); + +/* The following definitions come from lib/fsusage.c */ + +int sys_fsusage(const char *path, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize); + +/* The following definitions come from lib/gencache.c */ + +bool gencache_init(void); +bool gencache_shutdown(void); +bool gencache_set(const char *keystr, const char *value, time_t timeout); +bool gencache_del(const char *keystr); +bool gencache_get(const char *keystr, char **valstr, time_t *timeout); +bool gencache_get_data_blob(const char *keystr, DATA_BLOB *blob, bool *expired); +bool gencache_set_data_blob(const char *keystr, const DATA_BLOB *blob, time_t timeout); +void gencache_iterate(void (*fn)(const char* key, const char *value, time_t timeout, void* dptr), + void* data, const char* keystr_pattern); +int gencache_lock_entry( const char *key ); +void gencache_unlock_entry( const char *key ); + +/* The following definitions come from lib/genrand.c */ + +void set_rand_reseed_callback(void (*fn)(int *)); +void set_need_random_reseed(void); +void generate_random_buffer( unsigned char *out, int len); +char *generate_random_str(size_t len); + +/* The following definitions come from lib/hmacmd5.c */ + +void hmac_md5_init_rfc2104(const unsigned char *key, int key_len, HMACMD5Context *ctx); +void hmac_md5_init_limK_to_64(const unsigned char* key, int key_len, + HMACMD5Context *ctx); +void hmac_md5_update(const unsigned char *text, int text_len, HMACMD5Context *ctx); +void hmac_md5_final(unsigned char *digest, HMACMD5Context *ctx); +void hmac_md5( unsigned char key[16], const unsigned char *data, int data_len, + unsigned char *digest); + +/* The following definitions come from lib/iconv.c */ + +NTSTATUS smb_register_charset(struct charset_functions *funcs) ; +size_t smb_iconv(smb_iconv_t cd, + const char **inbuf, size_t *inbytesleft, + char **outbuf, size_t *outbytesleft); +smb_iconv_t smb_iconv_open(const char *tocode, const char *fromcode); +int smb_iconv_close (smb_iconv_t cd); + +/* The following definitions come from lib/interface.c */ + +bool ismyaddr(const struct sockaddr_storage *ip); +bool ismyip_v4(struct in_addr ip); +bool is_local_net(const struct sockaddr_storage *from); +void setup_linklocal_scope_id(struct sockaddr_storage *pss); +bool is_local_net_v4(struct in_addr from); +int iface_count(void); +int iface_count_v4(void); +const struct in_addr *first_ipv4_iface(void); +struct interface *get_interface(int n); +const struct sockaddr_storage *iface_n_sockaddr_storage(int n); +const struct in_addr *iface_n_ip_v4(int n); +const struct in_addr *iface_n_bcast_v4(int n); +const struct sockaddr_storage *iface_n_bcast(int n); +const struct sockaddr_storage *iface_ip(const struct sockaddr_storage *ip); +bool iface_local(const struct sockaddr_storage *ip); +void load_interfaces(void); +void gfree_interfaces(void); +bool interfaces_changed(void); + +/* The following definitions come from lib/ldap_debug_handler.c */ + +void init_ldap_debugging(void); + +/* The following definitions come from lib/ldap_escape.c */ + +char *escape_ldap_string_alloc(const char *s); +char *escape_rdn_val_string_alloc(const char *s); + +/* The following definitions come from lib/md4.c */ + +void mdfour(unsigned char *out, const unsigned char *in, int n); + +/* The following definitions come from lib/md5.c */ + +void MD5Init(struct MD5Context *ctx); +void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len); +void MD5Final(unsigned char digest[16], struct MD5Context *ctx); + +/* The following definitions come from lib/module.c */ + +NTSTATUS smb_load_module(const char *module_name); +int smb_load_modules(const char **modules); +NTSTATUS smb_probe_module(const char *subsystem, const char *module); +NTSTATUS smb_load_module(const char *module_name); +int smb_load_modules(const char **modules); +NTSTATUS smb_probe_module(const char *subsystem, const char *module); +void init_modules(void); + +/* The following definitions come from lib/ms_fnmatch.c */ + +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); +void pidfile_create(const char *program_name); + +/* The following definitions come from lib/popt_common.c */ + + +/* The following definitions come from lib/privileges.c */ + +bool get_privileges_for_sids(SE_PRIV *privileges, DOM_SID *slist, int scount); +NTSTATUS privilege_enumerate_accounts(DOM_SID **sids, int *num_sids); +NTSTATUS privilege_enum_sids(const SE_PRIV *mask, TALLOC_CTX *mem_ctx, + DOM_SID **sids, int *num_sids); +bool grant_privilege(const DOM_SID *sid, const SE_PRIV *priv_mask); +bool grant_privilege_by_name(DOM_SID *sid, const char *name); +bool revoke_privilege(const DOM_SID *sid, const SE_PRIV *priv_mask); +bool revoke_all_privileges( DOM_SID *sid ); +bool revoke_privilege_by_name(DOM_SID *sid, const char *name); +NTSTATUS privilege_create_account(const DOM_SID *sid ); +NTSTATUS privilege_set_init(PRIVILEGE_SET *priv_set); +NTSTATUS privilege_set_init_by_ctx(TALLOC_CTX *mem_ctx, PRIVILEGE_SET *priv_set); +void privilege_set_free(PRIVILEGE_SET *priv_set); +NTSTATUS dup_luid_attr(TALLOC_CTX *mem_ctx, LUID_ATTR **new_la, LUID_ATTR *old_la, int count); +bool is_privileged_sid( const DOM_SID *sid ); +bool grant_all_privileges( const DOM_SID *sid ); + +/* The following definitions come from lib/privileges_basic.c */ + +bool se_priv_copy( SE_PRIV *dst, const SE_PRIV *src ); +bool se_priv_put_all_privileges(SE_PRIV *mask); +void se_priv_add( SE_PRIV *mask, const SE_PRIV *addpriv ); +void se_priv_remove( SE_PRIV *mask, const SE_PRIV *removepriv ); +bool se_priv_equal( const SE_PRIV *mask1, const SE_PRIV *mask2 ); +bool se_priv_from_name( const char *name, SE_PRIV *mask ); +void dump_se_priv( int dbg_cl, int dbg_lvl, const SE_PRIV *mask ); +bool is_privilege_assigned(const SE_PRIV *privileges, + const SE_PRIV *check); +const char* get_privilege_dispname( const char *name ); +bool user_has_privileges(const NT_USER_TOKEN *token, const SE_PRIV *privilege); +bool user_has_any_privilege(NT_USER_TOKEN *token, const SE_PRIV *privilege); +int count_all_privileges( void ); +LUID_ATTR get_privilege_luid( SE_PRIV *mask ); +const char *luid_to_privilege_name(const LUID *set); +bool se_priv_to_privilege_set( PRIVILEGE_SET *set, SE_PRIV *mask ); +bool privilege_set_to_se_priv( SE_PRIV *mask, struct lsa_PrivilegeSet *privset ); + +/* The following definitions come from lib/readline.c */ + +char *smb_readline(const char *prompt, void (*callback)(void), + char **(completion_fn)(const char *text, int start, int end)); +const char *smb_readline_get_line_buffer(void); +void smb_readline_ca_char(char c); +int cmd_history(void); + +/* The following definitions come from lib/recvfile.c */ + +ssize_t sys_recvfile(int fromfd, + int tofd, + SMB_OFF_T offset, + size_t count); +ssize_t sys_recvfile(int fromfd, + int tofd, + SMB_OFF_T offset, + size_t count); +ssize_t drain_socket(int sockfd, size_t count); + +/* The following definitions come from lib/secace.c */ + +bool sec_ace_object(uint8 type); +void sec_ace_copy(SEC_ACE *ace_dest, SEC_ACE *ace_src); +void init_sec_ace(SEC_ACE *t, const DOM_SID *sid, enum security_ace_type type, + uint32 mask, uint8 flag); +NTSTATUS sec_ace_add_sid(TALLOC_CTX *ctx, SEC_ACE **pp_new, SEC_ACE *old, unsigned *num, DOM_SID *sid, uint32 mask); +NTSTATUS sec_ace_mod_sid(SEC_ACE *ace, size_t num, DOM_SID *sid, uint32 mask); +NTSTATUS sec_ace_del_sid(TALLOC_CTX *ctx, SEC_ACE **pp_new, SEC_ACE *old, uint32 *num, DOM_SID *sid); +bool sec_ace_equal(SEC_ACE *s1, SEC_ACE *s2); +int nt_ace_inherit_comp( SEC_ACE *a1, SEC_ACE *a2); +int nt_ace_canon_comp( SEC_ACE *a1, SEC_ACE *a2); +void dacl_sort_into_canonical_order(SEC_ACE *srclist, unsigned int num_aces); +bool token_sid_in_ace(const NT_USER_TOKEN *token, const SEC_ACE *ace); + +/* The following definitions come from lib/secacl.c */ + +SEC_ACL *make_sec_acl(TALLOC_CTX *ctx, enum security_acl_revision revision, + int num_aces, SEC_ACE *ace_list); +SEC_ACL *dup_sec_acl(TALLOC_CTX *ctx, SEC_ACL *src); +bool sec_acl_equal(SEC_ACL *s1, SEC_ACL *s2); + +/* The following definitions come from lib/secdesc.c */ + +bool sec_desc_equal(SEC_DESC *s1, SEC_DESC *s2); +SEC_DESC_BUF *sec_desc_merge(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, + const DOM_SID *owner_sid, const DOM_SID *grp_sid, + SEC_ACL *sacl, SEC_ACL *dacl, size_t *sd_size); +SEC_DESC *dup_sec_desc(TALLOC_CTX *ctx, const SEC_DESC *src); +NTSTATUS marshall_sec_desc(TALLOC_CTX *mem_ctx, + struct security_descriptor *secdesc, + uint8 **data, size_t *len); +NTSTATUS unmarshall_sec_desc(TALLOC_CTX *mem_ctx, uint8 *data, size_t len, + struct security_descriptor **psecdesc); +SEC_DESC *make_standard_sec_desc(TALLOC_CTX *ctx, const DOM_SID *owner_sid, const DOM_SID *grp_sid, + SEC_ACL *dacl, size_t *sd_size); +SEC_DESC_BUF *make_sec_desc_buf(TALLOC_CTX *ctx, size_t len, SEC_DESC *sec_desc); +SEC_DESC_BUF *dup_sec_desc_buf(TALLOC_CTX *ctx, SEC_DESC_BUF *src); +NTSTATUS sec_desc_add_sid(TALLOC_CTX *ctx, SEC_DESC **psd, DOM_SID *sid, uint32 mask, size_t *sd_size); +NTSTATUS sec_desc_mod_sid(SEC_DESC *sd, DOM_SID *sid, uint32 mask); +NTSTATUS sec_desc_del_sid(TALLOC_CTX *ctx, SEC_DESC **psd, DOM_SID *sid, size_t *sd_size); +SEC_DESC_BUF *se_create_child_secdesc(TALLOC_CTX *ctx, SEC_DESC *parent_ctr, + bool child_container); +void init_sec_access(uint32 *t, uint32 mask); + +/* The following definitions come from lib/select.c */ + +void sys_select_signal(char c); +int sys_select(int maxfd, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *tval); +int sys_select_intr(int maxfd, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *tval); + +/* The following definitions come from lib/sendfile.c */ + +ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count); +ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count); +ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count); +ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count); +ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count); +ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count); +ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count); + +/* The following definitions come from lib/server_mutex.c */ + +struct named_mutex *grab_named_mutex(TALLOC_CTX *mem_ctx, const char *name, + int timeout); + +/* The following definitions come from lib/sharesec.c */ + +SEC_DESC *get_share_security_default( TALLOC_CTX *ctx, size_t *psize, uint32 def_access); +SEC_DESC *get_share_security( TALLOC_CTX *ctx, const char *servicename, + size_t *psize); +bool set_share_security(const char *share_name, SEC_DESC *psd); +bool delete_share_security(const char *servicename); +bool share_access_check(const NT_USER_TOKEN *token, const char *sharename, + uint32 desired_access); +bool parse_usershare_acl(TALLOC_CTX *ctx, const char *acl_str, SEC_DESC **ppsd); + +/* The following definitions come from lib/signal.c */ + +void BlockSignals(bool block,int signum); +void (*CatchSignal(int signum,void (*handler)(int )))(int); +void CatchChild(void); +void CatchChildLeaveStatus(void); + +/* The following definitions come from lib/smbldap.c */ + +int smb_ldap_start_tls(LDAP *ldap_struct, int version); +int smb_ldap_setup_conn(LDAP **ldap_struct, const char *uri); +int smb_ldap_upgrade_conn(LDAP *ldap_struct, int *new_version) ; +int smb_ldap_setup_full_conn(LDAP **ldap_struct, const char *uri); +int smbldap_search(struct smbldap_state *ldap_state, + const char *base, int scope, const char *filter, + const char *attrs[], int attrsonly, + LDAPMessage **res); +int smbldap_search_paged(struct smbldap_state *ldap_state, + const char *base, int scope, const char *filter, + const char **attrs, int attrsonly, int pagesize, + LDAPMessage **res, void **cookie); +int smbldap_modify(struct smbldap_state *ldap_state, const char *dn, LDAPMod *attrs[]); +int smbldap_add(struct smbldap_state *ldap_state, const char *dn, LDAPMod *attrs[]); +int smbldap_delete(struct smbldap_state *ldap_state, const char *dn); +int smbldap_extended_operation(struct smbldap_state *ldap_state, + LDAP_CONST char *reqoid, struct berval *reqdata, + LDAPControl **serverctrls, LDAPControl **clientctrls, + char **retoidp, struct berval **retdatap); +int smbldap_search_suffix (struct smbldap_state *ldap_state, + const char *filter, const char **search_attr, + LDAPMessage ** result); +void smbldap_free_struct(struct smbldap_state **ldap_state) ; +NTSTATUS smbldap_init(TALLOC_CTX *mem_ctx, struct event_context *event_ctx, + const char *location, + struct smbldap_state **smbldap_state); +char *smbldap_get_dn(LDAP *ld, LDAPMessage *entry); +bool smbldap_has_control(LDAP *ld, const char *control); +bool smbldap_has_extension(LDAP *ld, const char *extension); +bool smbldap_has_naming_context(LDAP *ld, const char *naming_context); +bool smbldap_set_creds(struct smbldap_state *ldap_state, bool anon, const char *dn, const char *secret); + +/* The following definitions come from lib/smbldap_util.c */ + +NTSTATUS smbldap_search_domain_info(struct smbldap_state *ldap_state, + LDAPMessage ** result, const char *domain_name, + bool try_add); + +/* The following definitions come from lib/smbrun.c */ + +int smbrun_no_sanitize(const char *cmd, int *outfd); +int smbrun(const char *cmd, int *outfd); +int smbrunsecret(const char *cmd, const char *secret); + +/* The following definitions come from lib/sock_exec.c */ + +int sock_exec(const char *prog); + +/* The following definitions come from lib/substitute.c */ + +void free_local_machine_name(void); +bool set_local_machine_name(const char *local_name, bool perm); +const char *get_local_machine_name(void); +bool set_remote_machine_name(const char *remote_name, bool perm); +const char *get_remote_machine_name(void); +void sub_set_smb_name(const char *name); +void set_current_user_info(const char *smb_name, const char *unix_name, + const char *full_name, const char *domain); +const char *get_current_username(void); +void standard_sub_basic(const char *smb_name, const char *domain_name, + char *str, size_t len); +char *talloc_sub_basic(TALLOC_CTX *mem_ctx, const char *smb_name, + const char *domain_name, const char *str); +char *alloc_sub_basic(const char *smb_name, const char *domain_name, + const char *str); +char *talloc_sub_specified(TALLOC_CTX *mem_ctx, + const char *input_string, + const char *username, + const char *domain, + uid_t uid, + gid_t gid); +char *talloc_sub_advanced(TALLOC_CTX *mem_ctx, + const char *servicename, const char *user, + const char *connectpath, gid_t gid, + const char *smb_name, const char *domain_name, + const char *str); +void standard_sub_advanced(const char *servicename, const char *user, + const char *connectpath, gid_t gid, + const char *smb_name, const char *domain_name, + char *str, size_t len); +char *standard_sub_conn(TALLOC_CTX *ctx, connection_struct *conn, const char *str); + +/* The following definitions come from lib/sysacls.c */ + +int sys_acl_get_entry(SMB_ACL_T acl_d, int entry_id, SMB_ACL_ENTRY_T *entry_p); +int sys_acl_get_tag_type(SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *type_p); +int sys_acl_get_permset(SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p); +void *sys_acl_get_qualifier(SMB_ACL_ENTRY_T entry_d); +int sys_acl_clear_perms(SMB_ACL_PERMSET_T permset_d); +int sys_acl_add_perm(SMB_ACL_PERMSET_T permset_d, SMB_ACL_PERM_T perm); +int sys_acl_get_perm(SMB_ACL_PERMSET_T permset_d, SMB_ACL_PERM_T perm); +char *sys_acl_to_text(SMB_ACL_T acl_d, ssize_t *len_p); +SMB_ACL_T sys_acl_init(int count); +int sys_acl_create_entry(SMB_ACL_T *acl_p, SMB_ACL_ENTRY_T *entry_p); +int sys_acl_set_tag_type(SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T tag_type); +int sys_acl_set_qualifier(SMB_ACL_ENTRY_T entry_d, void *qual_p); +int sys_acl_set_permset(SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T permset_d); +int sys_acl_free_text(char *text); +int sys_acl_free_acl(SMB_ACL_T acl_d) ; +int sys_acl_free_qualifier(void *qual, SMB_ACL_TAG_T tagtype); +int sys_acl_valid(SMB_ACL_T acl_d); +SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle, + const char *path_p, SMB_ACL_TYPE_T type); +SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp); +int sys_acl_set_file(vfs_handle_struct *handle, + const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d); +int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, + SMB_ACL_T acl_d); +int sys_acl_delete_def_file(vfs_handle_struct *handle, + const char *path); +SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle, + const char *path_p, SMB_ACL_TYPE_T type); +SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp); +int sys_acl_set_file(vfs_handle_struct *handle, + const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d); +int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, + SMB_ACL_T acl_d); +int sys_acl_delete_def_file(vfs_handle_struct *handle, + const char *path); +SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle, + const char *path_p, SMB_ACL_TYPE_T type); +SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp); +int sys_acl_set_file(vfs_handle_struct *handle, + const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d); +int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, + SMB_ACL_T acl_d); +int sys_acl_delete_def_file(vfs_handle_struct *handle, + const char *path); +SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle, + const char *path_p, SMB_ACL_TYPE_T type); +SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp); +int sys_acl_set_file(vfs_handle_struct *handle, + const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d); +int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, + SMB_ACL_T acl_d); +int sys_acl_delete_def_file(vfs_handle_struct *handle, + const char *path); +SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle, + const char *path_p, SMB_ACL_TYPE_T type); +SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp); +int sys_acl_set_file(vfs_handle_struct *handle, + const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d); +int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, + SMB_ACL_T acl_d); +int sys_acl_delete_def_file(vfs_handle_struct *handle, + const char *path); +SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle, + const char *path_p, SMB_ACL_TYPE_T type); +SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp); +int sys_acl_set_file(vfs_handle_struct *handle, + const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d); +int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, + SMB_ACL_T acl_d); +int sys_acl_delete_def_file(vfs_handle_struct *handle, + const char *path); +SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle, + const char *path_p, SMB_ACL_TYPE_T type); +SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp); +int sys_acl_set_file(vfs_handle_struct *handle, + const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d); +int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, + SMB_ACL_T acl_d); +int sys_acl_delete_def_file(vfs_handle_struct *handle, + const char *path); +int no_acl_syscall_error(int err); + +/* The following definitions come from lib/sysquotas.c */ + +int sys_get_quota(const char *path, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp); +int sys_set_quota(const char *path, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp); + +/* The following definitions come from lib/sysquotas_4A.c */ + +int sys_get_vfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp); +int sys_set_vfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp); + +/* The following definitions come from lib/sysquotas_linux.c */ + +int sys_get_vfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp); +int sys_set_vfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp); + +/* The following definitions come from lib/sysquotas_xfs.c */ + +int sys_get_xfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp); +int sys_set_xfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp); + +/* The following definitions come from lib/system.c */ + +void *sys_memalign( size_t align, size_t size ); +int sys_usleep(long usecs); +ssize_t sys_read(int fd, void *buf, size_t count); +ssize_t sys_write(int fd, const void *buf, size_t count); +ssize_t sys_pread(int fd, void *buf, size_t count, SMB_OFF_T off); +ssize_t sys_pwrite(int fd, const void *buf, size_t count, SMB_OFF_T off); +ssize_t sys_send(int s, const void *msg, size_t len, int flags); +ssize_t sys_sendto(int s, const void *msg, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); +ssize_t sys_recv(int fd, void *buf, size_t count, int flags); +ssize_t sys_recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen); +int sys_fcntl_ptr(int fd, int cmd, void *arg); +int sys_fcntl_long(int fd, int cmd, long arg); +int sys_stat(const char *fname,SMB_STRUCT_STAT *sbuf); +int sys_fstat(int fd,SMB_STRUCT_STAT *sbuf); +int sys_lstat(const char *fname,SMB_STRUCT_STAT *sbuf); +int sys_ftruncate(int fd, SMB_OFF_T offset); +SMB_OFF_T sys_lseek(int fd, SMB_OFF_T offset, int whence); +int sys_fseek(FILE *fp, SMB_OFF_T offset, int whence); +SMB_OFF_T sys_ftell(FILE *fp); +int sys_creat(const char *path, mode_t mode); +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); +SMB_STRUCT_DIR *sys_opendir(const char *name); +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); +void sys_rewinddir(SMB_STRUCT_DIR *dirp); +int sys_closedir(SMB_STRUCT_DIR *dirp); +int sys_mknod(const char *path, mode_t mode, SMB_DEV_T dev); +char *sys_realpath(const char *path, char *resolved_path); +int sys_waitpid(pid_t pid,int *status,int options); +char *sys_getwd(char *s); +int sys_symlink(const char *oldpath, const char *newpath); +int sys_readlink(const char *path, char *buf, size_t bufsiz); +int sys_link(const char *oldpath, const char *newpath); +int sys_chown(const char *fname,uid_t uid,gid_t gid); +int sys_lchown(const char *fname,uid_t uid,gid_t gid); +int sys_chroot(const char *dname); +void set_effective_capability(enum smbd_capability capability); +void drop_effective_capability(enum smbd_capability capability); +long sys_random(void); +void sys_srandom(unsigned int seed); +int groups_max(void); +int sys_getgroups(int setlen, gid_t *gidset); +int sys_setgroups(gid_t UNUSED(primary_gid), int setlen, gid_t *gidset); +void sys_setpwent(void); +struct passwd *sys_getpwent(void); +void sys_endpwent(void); +struct passwd *sys_getpwnam(const char *name); +struct passwd *sys_getpwuid(uid_t uid); +struct group *sys_getgrnam(const char *name); +struct group *sys_getgrgid(gid_t gid); +pid_t sys_fork(void); +pid_t sys_getpid(void); +int sys_popen(const char *command); +int sys_pclose(int fd); +void *sys_dlopen(const char *name, int flags); +void *sys_dlsym(void *handle, const char *symbol); +int sys_dlclose (void *handle); +const char *sys_dlerror(void); +int sys_dup2(int oldfd, int newfd) ; +ssize_t sys_getxattr (const char *path, const char *name, void *value, size_t size); +ssize_t sys_lgetxattr (const char *path, const char *name, void *value, size_t size); +ssize_t sys_fgetxattr (int filedes, const char *name, void *value, size_t size); +ssize_t sys_listxattr (const char *path, char *list, size_t size); +ssize_t sys_llistxattr (const char *path, char *list, size_t size); +ssize_t sys_flistxattr (int filedes, char *list, size_t size); +int sys_removexattr (const char *path, const char *name); +int sys_lremovexattr (const char *path, const char *name); +int sys_fremovexattr (int filedes, const char *name); +int sys_setxattr (const char *path, const char *name, const void *value, size_t size, int flags); +int sys_lsetxattr (const char *path, const char *name, const void *value, size_t size, int flags); +int sys_fsetxattr (int filedes, const char *name, const void *value, size_t size, int flags); +uint32 unix_dev_major(SMB_DEV_T dev); +uint32 unix_dev_minor(SMB_DEV_T dev); +int sys_aio_read(SMB_STRUCT_AIOCB *aiocb); +int sys_aio_write(SMB_STRUCT_AIOCB *aiocb); +ssize_t sys_aio_return(SMB_STRUCT_AIOCB *aiocb); +int sys_aio_cancel(int fd, SMB_STRUCT_AIOCB *aiocb); +int sys_aio_error(const SMB_STRUCT_AIOCB *aiocb); +int sys_aio_fsync(int op, SMB_STRUCT_AIOCB *aiocb); +int sys_aio_suspend(const SMB_STRUCT_AIOCB * const cblist[], int n, const struct timespec *timeout); +int sys_aio_read(SMB_STRUCT_AIOCB *aiocb); +int sys_aio_write(SMB_STRUCT_AIOCB *aiocb); +ssize_t sys_aio_return(SMB_STRUCT_AIOCB *aiocb); +int sys_aio_cancel(int fd, SMB_STRUCT_AIOCB *aiocb); +int sys_aio_error(const SMB_STRUCT_AIOCB *aiocb); +int sys_aio_fsync(int op, SMB_STRUCT_AIOCB *aiocb); +int sys_aio_suspend(const SMB_STRUCT_AIOCB * const cblist[], int n, const struct timespec *timeout); +int sys_getpeereid( int s, uid_t *uid); +int sys_getnameinfo(const struct sockaddr *psa, + socklen_t salen, + char *host, + size_t hostlen, + char *service, + size_t servlen, + int flags); +int sys_connect(int fd, const struct sockaddr * addr); + +/* The following definitions come from lib/system_smbd.c */ + +bool getgroups_unix_user(TALLOC_CTX *mem_ctx, const char *user, + gid_t primary_gid, + gid_t **ret_groups, size_t *p_ngroups); + +/* The following definitions come from lib/tallocmsg.c */ + +void register_msg_pool_usage(struct messaging_context *msg_ctx); + +/* The following definitions come from lib/time.c */ + +time_t get_time_t_max(void); +void GetTimeOfDay(struct timeval *tval); +time_t nt_time_to_unix(NTTIME nt); +void unix_to_nt_time(NTTIME *nt, time_t t); +bool null_time(time_t t); +bool null_nttime(NTTIME t); +bool null_timespec(struct timespec ts); +void push_dos_date(uint8_t *buf, int offset, time_t unixdate, int zone_offset); +void push_dos_date2(uint8_t *buf,int offset,time_t unixdate, int zone_offset); +void push_dos_date3(uint8_t *buf,int offset,time_t unixdate, int zone_offset); +time_t pull_dos_date(const uint8_t *date_ptr, int zone_offset); +time_t pull_dos_date2(const uint8_t *date_ptr, int zone_offset); +time_t pull_dos_date3(const uint8_t *date_ptr, int zone_offset); +char *http_timestring(time_t t); +char *timestring(TALLOC_CTX *mem_ctx, time_t t); +const char *nt_time_string(TALLOC_CTX *mem_ctx, NTTIME nt); +NTTIME nttime_from_string(const char *s); +int64_t usec_time_diff(struct timeval *tv1, struct timeval *tv2); +struct timeval timeval_zero(void); +bool timeval_is_zero(const struct timeval *tv); +struct timeval timeval_current(void); +struct timeval timeval_set(uint32_t secs, uint32_t usecs); +struct timeval timeval_add(const struct timeval *tv, + uint32_t secs, uint32_t usecs); +struct timeval timeval_sum(const struct timeval *tv1, + const struct timeval *tv2); +struct timeval timeval_current_ofs(uint32_t secs, uint32_t usecs); +int timeval_compare(const struct timeval *tv1, const struct timeval *tv2); +bool timeval_expired(const struct timeval *tv); +double timeval_elapsed2(const struct timeval *tv1, const struct timeval *tv2); +double timeval_elapsed(const struct timeval *tv); +struct timeval timeval_min(const struct timeval *tv1, + const struct timeval *tv2); +struct timeval timeval_max(const struct timeval *tv1, + const struct timeval *tv2); +struct timeval timeval_until(const struct timeval *tv1, + const struct timeval *tv2); +NTTIME timeval_to_nttime(const struct timeval *tv); +uint32 convert_time_t_to_uint32(time_t t); +time_t convert_uint32_to_time_t(uint32 u); +int get_time_zone(time_t t); +bool nt_time_is_zero(const NTTIME *nt); +time_t generalized_to_unix_time(const char *str); +int get_server_zone_offset(void); +int set_server_zone_offset(time_t t); +char *current_timestring(TALLOC_CTX *ctx, bool hires); +void srv_put_dos_date(char *buf,int offset,time_t unixdate); +void srv_put_dos_date2(char *buf,int offset, time_t unixdate); +void srv_put_dos_date3(char *buf,int offset,time_t unixdate); +void put_long_date_timespec(char *p, struct timespec ts); +void put_long_date(char *p, time_t t); +time_t get_create_time(const SMB_STRUCT_STAT *st,bool fake_dirs); +struct timespec get_create_timespec(const SMB_STRUCT_STAT *st,bool fake_dirs); +struct timespec get_atimespec(const SMB_STRUCT_STAT *pst); +void set_atimespec(SMB_STRUCT_STAT *pst, struct timespec ts); +struct timespec get_mtimespec(const SMB_STRUCT_STAT *pst); +void set_mtimespec(SMB_STRUCT_STAT *pst, struct timespec ts); +struct timespec get_ctimespec(const SMB_STRUCT_STAT *pst); +void set_ctimespec(SMB_STRUCT_STAT *pst, struct timespec ts); +void dos_filetime_timespec(struct timespec *tsp); +time_t srv_make_unix_date(const void *date_ptr); +time_t srv_make_unix_date2(const void *date_ptr); +time_t srv_make_unix_date3(const void *date_ptr); +time_t convert_timespec_to_time_t(struct timespec ts); +struct timespec convert_time_t_to_timespec(time_t t); +struct timespec convert_timeval_to_timespec(const struct timeval tv); +struct timeval convert_timespec_to_timeval(const struct timespec ts); +struct timespec timespec_current(void); +struct timespec timespec_min(const struct timespec *ts1, + const struct timespec *ts2); +int timespec_compare(const struct timespec *ts1, const struct timespec *ts2); +struct timespec interpret_long_date(const char *p); +void cli_put_dos_date(struct cli_state *cli, char *buf, int offset, time_t unixdate); +void cli_put_dos_date2(struct cli_state *cli, char *buf, int offset, time_t unixdate); +void cli_put_dos_date3(struct cli_state *cli, char *buf, int offset, time_t unixdate); +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); +struct timespec nt_time_to_unix_timespec(NTTIME *nt); +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); +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); + +/* The following definitions come from lib/ufc.c */ + +char *ufc_crypt(const char *key,const char *salt); + +/* The following definitions come from lib/username.c */ + +char *get_user_home_dir(TALLOC_CTX *mem_ctx, const char *user); +struct passwd *Get_Pwnam_alloc(TALLOC_CTX *mem_ctx, const char *user); + +/* The following definitions come from lib/util.c */ + +bool set_global_myname(const char *myname); +const char *global_myname(void); +bool set_global_myworkgroup(const char *myworkgroup); +const char *lp_workgroup(void); +bool set_global_scope(const char *scope); +const char *global_scope(void); +void gfree_names(void); +void gfree_all( void ); +const char *my_netbios_names(int i); +bool set_netbios_aliases(const char **str_array); +bool init_names(void); +const char *get_cmdline_auth_info_username(void); +void set_cmdline_auth_info_username(const char *username); +const char *get_cmdline_auth_info_password(void); +void set_cmdline_auth_info_password(const char *password); +bool set_cmdline_auth_info_signing_state(const char *arg); +int get_cmdline_auth_info_signing_state(void); +bool get_cmdline_auth_info_use_kerberos(void); +void set_cmdline_auth_info_use_krb5_ticket(void); +void set_cmdline_auth_info_smb_encrypt(void); +void set_cmdline_auth_info_use_machine_account(void); +bool get_cmdline_auth_info_got_pass(void); +bool get_cmdline_auth_info_smb_encrypt(void); +bool get_cmdline_auth_info_use_machine_account(void); +bool get_cmdline_auth_info_copy(struct user_auth_info *info); +bool set_cmdline_auth_info_machine_account_creds(void); +const char *tmpdir(void); +bool add_gid_to_array_unique(TALLOC_CTX *mem_ctx, gid_t gid, + gid_t **gids, size_t *num_gids); +const char *get_numlist(const char *p, uint32 **num, int *count); +bool file_exist(const char *fname,SMB_STRUCT_STAT *sbuf); +bool socket_exist(const char *fname); +time_t file_modtime(const char *fname); +bool directory_exist(char *dname,SMB_STRUCT_STAT *st); +SMB_OFF_T get_file_size(char *file_name); +char *attrib_string(uint16 mode); +void show_msg(char *buf); +void smb_set_enclen(char *buf,int len,uint16 enc_ctx_num); +void smb_setlen(char *buf,int len); +int set_message_bcc(char *buf,int num_bytes); +ssize_t message_push_blob(uint8 **outbuf, DATA_BLOB blob); +char *unix_clean_name(TALLOC_CTX *ctx, const char *s); +char *clean_name(TALLOC_CTX *ctx, const char *s); +void close_low_fds(bool stderr_too); +ssize_t write_data_at_offset(int fd, const char *buffer, size_t N, SMB_OFF_T pos); +int set_blocking(int fd, bool set); +void smb_msleep(unsigned int t); +void become_daemon(bool Fork, bool no_process_group); +bool reinit_after_fork(struct messaging_context *msg_ctx, + bool parent_longlived); +bool yesno(const char *p); +void *malloc_(size_t size); +void *malloc_array(size_t el_size, unsigned int count); +void *memalign_array(size_t el_size, size_t align, unsigned int count); +void *calloc_array(size_t size, size_t nmemb); +void *Realloc(void *p, size_t size, bool free_old_on_error); +void *realloc_array(void *p, size_t el_size, unsigned int count, bool free_old_on_error); +void add_to_large_array(TALLOC_CTX *mem_ctx, size_t element_size, + void *element, void *_array, uint32 *num_elements, + ssize_t *array_size); +void safe_free(void *p); +char *get_myname(TALLOC_CTX *ctx); +char *get_mydnsdomname(TALLOC_CTX *ctx); +int interpret_protocol(const char *str,int def); +char *automount_lookup(TALLOC_CTX *ctx, const char *user_name); +char *automount_lookup(TALLOC_CTX *ctx, const char *user_name); +bool process_exists(const struct server_id pid); +bool process_exists_by_pid(pid_t pid); +const char *uidtoname(uid_t uid); +char *gidtoname(gid_t gid); +uid_t nametouid(const char *name); +gid_t nametogid(const char *name); +void smb_panic(const char *const why); +void log_stack_trace(void); +const char *readdirname(SMB_STRUCT_DIR *p); +bool is_in_path(const char *name, name_compare_entry *namelist, bool case_sensitive); +void set_namearray(name_compare_entry **ppname_array, const char *namelist); +void free_namearray(name_compare_entry *name_array); +bool fcntl_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type); +bool fcntl_getlock(int fd, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid); +bool is_myname(const char *s); +bool is_myworkgroup(const char *s); +void ra_lanman_string( const char *native_lanman ); +const char *get_remote_arch_str(void); +void set_remote_arch(enum remote_arch_types type); +enum remote_arch_types get_remote_arch(void); +void print_asc(int level, const unsigned char *buf,int len); +void dump_data(int level, const unsigned char *buf1,int len); +void dump_data_pw(const char *msg, const uchar * data, size_t len); +const char *tab_depth(int level, int depth); +int str_checksum(const char *s); +void zero_free(void *p, size_t size); +int set_maxfiles(int requested_max); +int smb_mkstemp(char *name_template); +void *smb_xmalloc_array(size_t size, unsigned int count); +void *smb_xmemdup(const void *p, size_t size); +char *smb_xstrdup(const char *s); +char *smb_xstrndup(const char *s, size_t n); +void *memdup(const void *p, size_t size); +char *myhostname(void); +char *lock_path(const char *name); +char *pid_path(const char *name); +char *lib_path(const char *name); +char *data_path(const char *name); +char *state_path(const char *name); +const char *shlib_ext(void); +char *parent_dirname(const char *path); +bool parent_dirname_talloc(TALLOC_CTX *mem_ctx, const char *dir, + char **parent, const char **name); +bool ms_has_wild(const char *s); +bool ms_has_wild_w(const smb_ucs2_t *s); +bool mask_match(const char *string, const char *pattern, bool is_case_sensitive); +bool mask_match_search(const char *string, const char *pattern, bool is_case_sensitive); +bool mask_match_list(const char *string, char **list, int listLen, bool is_case_sensitive); +bool unix_wild_match(const char *pattern, const char *string); +bool name_to_fqdn(fstring fqdn, const char *name); +void *talloc_check_name_abort(const void *ptr, const char *name); +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); +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); +bool procid_is_me(const struct server_id *pid); +struct server_id interpret_pid(const char *pid_string); +char *procid_str(TALLOC_CTX *mem_ctx, const struct server_id *pid); +char *procid_str_static(const struct server_id *pid); +bool procid_valid(const struct server_id *pid); +bool procid_is_local(const struct server_id *pid); +int this_is_smp(void); +bool is_offset_safe(const char *buf_base, size_t buf_len, char *ptr, size_t off); +char *get_safe_ptr(const char *buf_base, size_t buf_len, char *ptr, size_t off); +char *get_safe_str_ptr(const char *buf_base, size_t buf_len, char *ptr, size_t off); +int get_safe_SVAL(const char *buf_base, size_t buf_len, char *ptr, size_t off, int failval); +int get_safe_IVAL(const char *buf_base, size_t buf_len, char *ptr, size_t off, int failval); +void split_domain_user(TALLOC_CTX *mem_ctx, + const char *full_name, + char **domain, + char