2 * Unix SMB/CIFS implementation.
3 * collected prototypes header
5 * frozen from "make proto" in May 2008
7 * Copyright (C) Michael Adam 2008
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 3 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, see <http://www.gnu.org/licenses/>.
27 /* The following definitions come from auth/auth.c */
29 NTSTATUS
smb_register_auth(int version
, const char *name
, auth_init_function init
);
30 bool load_auth_module(struct auth_context
*auth_context
,
31 const char *module
, auth_methods
**ret
) ;
32 NTSTATUS
make_auth_context_subsystem(struct auth_context
**auth_context
) ;
33 NTSTATUS
make_auth_context_fixed(struct auth_context
**auth_context
, uchar chal
[8]) ;
35 /* The following definitions come from auth/auth_builtin.c */
37 NTSTATUS
auth_builtin_init(void);
39 /* The following definitions come from auth/auth_compat.c */
41 NTSTATUS
check_plaintext_password(const char *smb_name
, DATA_BLOB plaintext_password
, auth_serversupplied_info
**server_info
);
42 bool password_ok(const char *smb_name
, DATA_BLOB password_blob
);
44 /* The following definitions come from auth/auth_domain.c */
46 void attempt_machine_password_change(void);
47 NTSTATUS
auth_domain_init(void);
49 NTSTATUS
auth_netlogond_init(void);
51 /* The following definitions come from auth/auth_ntlmssp.c */
53 NTSTATUS
auth_ntlmssp_start(AUTH_NTLMSSP_STATE
**auth_ntlmssp_state
);
54 void auth_ntlmssp_end(AUTH_NTLMSSP_STATE
**auth_ntlmssp_state
);
55 NTSTATUS
auth_ntlmssp_update(AUTH_NTLMSSP_STATE
*auth_ntlmssp_state
,
56 const DATA_BLOB request
, DATA_BLOB
*reply
) ;
58 /* The following definitions come from auth/auth_sam.c */
60 NTSTATUS
auth_sam_init(void);
62 /* The following definitions come from auth/auth_server.c */
64 NTSTATUS
auth_server_init(void);
66 /* The following definitions come from auth/auth_unix.c */
68 NTSTATUS
auth_unix_init(void);
70 /* The following definitions come from auth/auth_util.c */
72 NTSTATUS
make_user_info_map(auth_usersupplied_info
**user_info
,
74 const char *client_domain
,
75 const char *wksta_name
,
76 DATA_BLOB
*lm_pwd
, DATA_BLOB
*nt_pwd
,
77 DATA_BLOB
*lm_interactive_pwd
, DATA_BLOB
*nt_interactive_pwd
,
80 bool make_user_info_netlogon_network(auth_usersupplied_info
**user_info
,
82 const char *client_domain
,
83 const char *wksta_name
,
84 uint32 logon_parameters
,
85 const uchar
*lm_network_pwd
,
87 const uchar
*nt_network_pwd
,
89 bool make_user_info_netlogon_interactive(auth_usersupplied_info
**user_info
,
91 const char *client_domain
,
92 const char *wksta_name
,
93 uint32 logon_parameters
,
95 const uchar lm_interactive_pwd
[16],
96 const uchar nt_interactive_pwd
[16],
97 const uchar
*dc_sess_key
);
98 bool make_user_info_for_reply(auth_usersupplied_info
**user_info
,
100 const char *client_domain
,
102 DATA_BLOB plaintext_password
);
103 NTSTATUS
make_user_info_for_reply_enc(auth_usersupplied_info
**user_info
,
104 const char *smb_name
,
105 const char *client_domain
,
106 DATA_BLOB lm_resp
, DATA_BLOB nt_resp
);
107 bool make_user_info_guest(auth_usersupplied_info
**user_info
) ;
108 NTSTATUS
make_server_info_sam(auth_serversupplied_info
**server_info
,
109 struct samu
*sampass
);
110 NTSTATUS
create_local_token(auth_serversupplied_info
*server_info
);
111 NTSTATUS
create_token_from_username(TALLOC_CTX
*mem_ctx
, const char *username
,
113 uid_t
*uid
, gid_t
*gid
,
114 char **found_username
,
115 struct nt_user_token
**token
);
116 bool user_in_group_sid(const char *username
, const DOM_SID
*group_sid
);
117 bool user_in_group(const char *username
, const char *groupname
);
118 NTSTATUS
make_server_info_pw(auth_serversupplied_info
**server_info
,
121 NTSTATUS
make_serverinfo_from_username(TALLOC_CTX
*mem_ctx
,
122 const char *username
,
124 struct auth_serversupplied_info
**presult
);
125 struct auth_serversupplied_info
*copy_serverinfo(TALLOC_CTX
*mem_ctx
,
126 const auth_serversupplied_info
*src
);
127 bool init_guest_info(void);
128 bool server_info_set_session_key(struct auth_serversupplied_info
*info
,
129 DATA_BLOB session_key
);
130 NTSTATUS
make_server_info_guest(TALLOC_CTX
*mem_ctx
,
131 auth_serversupplied_info
**server_info
);
132 bool copy_current_user(struct current_user
*dst
, struct current_user
*src
);
133 struct passwd
*smb_getpwnam( TALLOC_CTX
*mem_ctx
, char *domuser
,
134 fstring save_username
, bool create
);
135 NTSTATUS
make_server_info_info3(TALLOC_CTX
*mem_ctx
,
136 const char *sent_nt_username
,
138 auth_serversupplied_info
**server_info
,
139 struct netr_SamInfo3
*info3
);
140 NTSTATUS
make_server_info_wbcAuthUserInfo(TALLOC_CTX
*mem_ctx
,
141 const char *sent_nt_username
,
143 const struct wbcAuthUserInfo
*info
,
144 auth_serversupplied_info
**server_info
);
145 void free_user_info(auth_usersupplied_info
**user_info
);
146 bool make_auth_methods(struct auth_context
*auth_context
, auth_methods
**auth_method
) ;
147 bool is_trusted_domain(const char* dom_name
);
149 /* The following definitions come from auth/auth_winbind.c */
151 NTSTATUS
auth_winbind_init(void);
153 /* The following definitions come from auth/auth_wbc.c */
155 NTSTATUS
auth_wbc_init(void);
157 /* The following definitions come from auth/pampass.c */
159 bool smb_pam_claim_session(char *user
, char *tty
, char *rhost
);
160 bool smb_pam_close_session(char *user
, char *tty
, char *rhost
);
161 NTSTATUS
smb_pam_accountcheck(const char * user
);
162 NTSTATUS
smb_pam_passcheck(const char * user
, const char * password
);
163 bool smb_pam_passchange(const char * user
, const char * oldpassword
, const char * newpassword
);
164 NTSTATUS
smb_pam_accountcheck(const char * user
);
165 bool smb_pam_claim_session(char *user
, char *tty
, char *rhost
);
166 bool smb_pam_close_session(char *in_user
, char *tty
, char *rhost
);
168 /* The following definitions come from auth/pass_check.c */
170 void dfs_unlogin(void);
171 NTSTATUS
pass_check(const struct passwd
*pass
, const char *user
, const char *password
,
172 int pwlen
, bool (*fn
) (const char *, const char *), bool run_cracker
);
174 /* The following definitions come from auth/token_util.c */
176 bool nt_token_check_sid ( const DOM_SID
*sid
, const NT_USER_TOKEN
*token
);
177 bool nt_token_check_domain_rid( NT_USER_TOKEN
*token
, uint32 rid
);
178 NT_USER_TOKEN
*get_root_nt_token( void );
179 NTSTATUS
add_aliases(const DOM_SID
*domain_sid
,
180 struct nt_user_token
*token
);
181 NTSTATUS
create_builtin_users(const DOM_SID
*sid
);
182 NTSTATUS
create_builtin_administrators(const DOM_SID
*sid
);
183 struct nt_user_token
*create_local_nt_token(TALLOC_CTX
*mem_ctx
,
184 const DOM_SID
*user_sid
,
187 const DOM_SID
*groupsids
);
188 void debug_nt_user_token(int dbg_class
, int dbg_lev
, NT_USER_TOKEN
*token
);
189 void debug_unix_user_token(int dbg_class
, int dbg_lev
, uid_t uid
, gid_t gid
,
190 int n_groups
, gid_t
*groups
);
192 /* The following definitions come from groupdb/mapping.c */
194 NTSTATUS
add_initial_entry(gid_t gid
, const char *sid
, enum lsa_SidType sid_name_use
, const char *nt_name
, const char *comment
);
195 bool get_domain_group_from_sid(DOM_SID sid
, GROUP_MAP
*map
);
196 int smb_create_group(const char *unix_group
, gid_t
*new_gid
);
197 int smb_delete_group(const char *unix_group
);
198 int smb_set_primary_group(const char *unix_group
, const char* unix_user
);
199 int smb_add_user_group(const char *unix_group
, const char *unix_user
);
200 int smb_delete_user_group(const char *unix_group
, const char *unix_user
);
201 NTSTATUS
pdb_default_getgrsid(struct pdb_methods
*methods
, GROUP_MAP
*map
,
203 NTSTATUS
pdb_default_getgrgid(struct pdb_methods
*methods
, GROUP_MAP
*map
,
205 NTSTATUS
pdb_default_getgrnam(struct pdb_methods
*methods
, GROUP_MAP
*map
,
207 NTSTATUS
pdb_default_add_group_mapping_entry(struct pdb_methods
*methods
,
209 NTSTATUS
pdb_default_update_group_mapping_entry(struct pdb_methods
*methods
,
211 NTSTATUS
pdb_default_delete_group_mapping_entry(struct pdb_methods
*methods
,
213 NTSTATUS
pdb_default_enum_group_mapping(struct pdb_methods
*methods
,
214 const DOM_SID
*sid
, enum lsa_SidType sid_name_use
,
215 GROUP_MAP
**pp_rmap
, size_t *p_num_entries
,
217 NTSTATUS
pdb_default_create_alias(struct pdb_methods
*methods
,
218 const char *name
, uint32
*rid
);
219 NTSTATUS
pdb_default_delete_alias(struct pdb_methods
*methods
,
221 NTSTATUS
pdb_default_get_aliasinfo(struct pdb_methods
*methods
,
223 struct acct_info
*info
);
224 NTSTATUS
pdb_default_set_aliasinfo(struct pdb_methods
*methods
,
226 struct acct_info
*info
);
227 NTSTATUS
pdb_default_add_aliasmem(struct pdb_methods
*methods
,
228 const DOM_SID
*alias
, const DOM_SID
*member
);
229 NTSTATUS
pdb_default_del_aliasmem(struct pdb_methods
*methods
,
230 const DOM_SID
*alias
, const DOM_SID
*member
);
231 NTSTATUS
pdb_default_enum_aliasmem(struct pdb_methods
*methods
,
232 const DOM_SID
*alias
, DOM_SID
**pp_members
,
233 size_t *p_num_members
);
234 NTSTATUS
pdb_default_alias_memberships(struct pdb_methods
*methods
,
236 const DOM_SID
*domain_sid
,
237 const DOM_SID
*members
,
239 uint32
**pp_alias_rids
,
240 size_t *p_num_alias_rids
);
241 NTSTATUS
pdb_nop_getgrsid(struct pdb_methods
*methods
, GROUP_MAP
*map
,
243 NTSTATUS
pdb_nop_getgrgid(struct pdb_methods
*methods
, GROUP_MAP
*map
,
245 NTSTATUS
pdb_nop_getgrnam(struct pdb_methods
*methods
, GROUP_MAP
*map
,
247 NTSTATUS
pdb_nop_add_group_mapping_entry(struct pdb_methods
*methods
,
249 NTSTATUS
pdb_nop_update_group_mapping_entry(struct pdb_methods
*methods
,
251 NTSTATUS
pdb_nop_delete_group_mapping_entry(struct pdb_methods
*methods
,
253 NTSTATUS
pdb_nop_enum_group_mapping(struct pdb_methods
*methods
,
254 enum lsa_SidType sid_name_use
,
255 GROUP_MAP
**rmap
, size_t *num_entries
,
257 bool pdb_get_dom_grp_info(const DOM_SID
*sid
, struct acct_info
*info
);
258 bool pdb_set_dom_grp_info(const DOM_SID
*sid
, const struct acct_info
*info
);
259 NTSTATUS
pdb_create_builtin_alias(uint32 rid
);
261 /* The following definitions come from groupdb/mapping_ldb.c */
263 const struct mapping_backend
*groupdb_ldb_init(void);
265 /* The following definitions come from groupdb/mapping_tdb.c */
267 const struct mapping_backend
*groupdb_tdb_init(void);
269 /* The following definitions come from intl/lang_tdb.c */
271 bool lang_tdb_init(const char *lang
);
272 const char *lang_msg(const char *msgid
);
273 void lang_msg_free(const char *msgstr
);
274 char *lang_tdb_current(void);
276 /* The following definitions come from lib/access.c */
278 bool client_match(const char *tok
, const void *item
);
279 bool list_match(const char **list
,const void *item
,
280 bool (*match_fn
)(const char *, const void *));
281 bool allow_access(const char **deny_list
,
282 const char **allow_list
,
285 bool check_access(int sock
, const char **allow_list
, const char **deny_list
);
287 /* The following definitions come from lib/account_pol.c */
289 void account_policy_names_list(const char ***names
, int *num_names
);
290 const char *decode_account_policy_name(int field
);
291 const char *get_account_policy_attr(int field
);
292 const char *account_policy_get_desc(int field
);
293 int account_policy_name_to_fieldnum(const char *name
);
294 bool account_policy_get_default(int account_policy
, uint32
*val
);
295 bool init_account_policy(void);
296 bool account_policy_get(int field
, uint32
*value
);
297 bool account_policy_set(int field
, uint32 value
);
298 bool cache_account_policy_set(int field
, uint32 value
);
299 bool cache_account_policy_get(int field
, uint32
*value
);
300 struct db_context
*get_account_pol_db( void );
302 /* The following definitions come from lib/adt_tree.c */
305 /* The following definitions come from lib/afs.c */
307 char *afs_createtoken_str(const char *username
, const char *cell
);
308 bool afs_login(connection_struct
*conn
);
309 bool afs_login(connection_struct
*conn
);
310 char *afs_createtoken_str(const char *username
, const char *cell
);
312 /* The following definitions come from lib/afs_settoken.c */
314 int afs_syscall( int subcall
,
319 bool afs_settoken_str(const char *token_string
);
320 bool afs_settoken_str(const char *token_string
);
322 /* The following definitions come from lib/audit.c */
324 const char *audit_category_str(uint32 category
);
325 const char *audit_param_str(uint32 category
);
326 const char *audit_description_str(uint32 category
);
327 bool get_audit_category_from_param(const char *param
, uint32
*audit_category
);
328 const char *audit_policy_str(TALLOC_CTX
*mem_ctx
, uint32 policy
);
330 /* The following definitions come from lib/bitmap.c */
332 struct bitmap
*bitmap_allocate(int n
);
333 void bitmap_free(struct bitmap
*bm
);
334 struct bitmap
*bitmap_talloc(TALLOC_CTX
*mem_ctx
, int n
);
335 int bitmap_copy(struct bitmap
* const dst
, const struct bitmap
* const src
);
336 bool bitmap_set(struct bitmap
*bm
, unsigned i
);
337 bool bitmap_clear(struct bitmap
*bm
, unsigned i
);
338 bool bitmap_query(struct bitmap
*bm
, unsigned i
);
339 int bitmap_find(struct bitmap
*bm
, unsigned ofs
);
341 /* The following definitions come from lib/charcnv.c */
343 NTSTATUS
smb_register_charset(struct charset_functions
*funcs
);
344 char lp_failed_convert_char(void);
345 void lazy_initialize_conv(void);
346 void gfree_charcnv(void);
347 void init_iconv(void);
348 size_t convert_string(charset_t from
, charset_t to
,
349 void const *src
, size_t srclen
,
350 void *dest
, size_t destlen
, bool allow_bad_conv
);
351 size_t unix_strupper(const char *src
, size_t srclen
, char *dest
, size_t destlen
);
352 char *talloc_strdup_upper(TALLOC_CTX
*ctx
, const char *s
);
353 char *strupper_talloc(TALLOC_CTX
*ctx
, const char *s
);
354 size_t unix_strlower(const char *src
, size_t srclen
, char *dest
, size_t destlen
);
355 char *talloc_strdup_lower(TALLOC_CTX
*ctx
, const char *s
);
356 char *strlower_talloc(TALLOC_CTX
*ctx
, const char *s
);
357 size_t ucs2_align(const void *base_ptr
, const void *p
, int flags
);
358 size_t push_ascii(void *dest
, const char *src
, size_t dest_len
, int flags
);
359 size_t push_ascii_fstring(void *dest
, const char *src
);
360 size_t push_ascii_nstring(void *dest
, const char *src
);
361 size_t pull_ascii(char *dest
, const void *src
, size_t dest_len
, size_t src_len
, int flags
);
362 size_t pull_ascii_fstring(char *dest
, const void *src
);
363 size_t pull_ascii_nstring(char *dest
, size_t dest_len
, const void *src
);
364 size_t push_ucs2(const void *base_ptr
, void *dest
, const char *src
, size_t dest_len
, int flags
);
365 size_t push_utf8_fstring(void *dest
, const char *src
);
366 bool push_utf8_talloc(TALLOC_CTX
*ctx
, char **dest
, const char *src
,
367 size_t *converted_size
);
368 size_t pull_ucs2(const void *base_ptr
, char *dest
, const void *src
, size_t dest_len
, size_t src_len
, int flags
);
369 size_t pull_ucs2_base_talloc(TALLOC_CTX
*ctx
,
370 const void *base_ptr
,
375 size_t pull_ucs2_fstring(char *dest
, const void *src
);
376 bool push_ucs2_talloc(TALLOC_CTX
*ctx
, smb_ucs2_t
**dest
, const char *src
,
377 size_t *converted_size
);
378 bool pull_utf8_talloc(TALLOC_CTX
*ctx
, char **dest
, const char *src
,
379 size_t *converted_size
);
380 bool pull_ucs2_talloc(TALLOC_CTX
*ctx
, char **dest
, const smb_ucs2_t
*src
,
381 size_t *converted_size
);
382 bool pull_ascii_talloc(TALLOC_CTX
*ctx
, char **dest
, const char *src
,
383 size_t *converted_size
);
384 size_t push_string_check_fn(const char *function
, unsigned int line
,
385 void *dest
, const char *src
,
386 size_t dest_len
, int flags
);
387 size_t push_string_base(const char *function
, unsigned int line
,
388 const char *base
, uint16 flags2
,
389 void *dest
, const char *src
,
390 size_t dest_len
, int flags
);
391 size_t pull_string_fn(const char *function
,
393 const void *base_ptr
,
400 size_t pull_string_talloc_fn(const char *function
,
403 const void *base_ptr
,
409 size_t align_string(const void *base_ptr
, const char *p
, int flags
);
410 codepoint_t
next_codepoint(const char *str
, size_t *size
);
412 /* The following definitions come from lib/clobber.c */
414 void clobber_region(const char *fn
, unsigned int line
, char *dest
, size_t len
);
416 /* The following definitions come from lib/conn_tdb.c */
418 struct db_record
*connections_fetch_record(TALLOC_CTX
*mem_ctx
,
420 struct db_record
*connections_fetch_entry(TALLOC_CTX
*mem_ctx
,
421 connection_struct
*conn
,
423 int connections_traverse(int (*fn
)(struct db_record
*rec
,
426 int connections_forall(int (*fn
)(struct db_record
*rec
,
427 const struct connections_key
*key
,
428 const struct connections_data
*data
,
431 bool connections_init(bool rw
);
433 /* The following definitions come from lib/dbwrap_util.c */
435 int32_t dbwrap_fetch_int32(struct db_context
*db
, const char *keystr
);
436 int dbwrap_store_int32(struct db_context
*db
, const char *keystr
, int32_t v
);
437 bool dbwrap_fetch_uint32(struct db_context
*db
, const char *keystr
,
439 int dbwrap_store_uint32(struct db_context
*db
, const char *keystr
, uint32_t v
);
440 uint32_t dbwrap_change_uint32_atomic(struct db_context
*db
, const char *keystr
,
441 uint32_t *oldval
, uint32_t change_val
);
442 int32
dbwrap_change_int32_atomic(struct db_context
*db
, const char *keystr
,
443 int32
*oldval
, int32 change_val
);
444 NTSTATUS
dbwrap_trans_store(struct db_context
*db
, TDB_DATA key
, TDB_DATA dbuf
,
446 NTSTATUS
dbwrap_trans_delete(struct db_context
*db
, TDB_DATA key
);
447 NTSTATUS
dbwrap_trans_store_int32(struct db_context
*db
, const char *keystr
,
449 NTSTATUS
dbwrap_trans_store_uint32(struct db_context
*db
, const char *keystr
,
451 NTSTATUS
dbwrap_trans_store_bystring(struct db_context
*db
, const char *key
,
452 TDB_DATA data
, int flags
);
453 NTSTATUS
dbwrap_trans_delete_bystring(struct db_context
*db
, const char *key
);
455 /* The following definitions come from lib/debug.c */
457 void gfree_debugsyms(void);
458 const char *debug_classname_from_index(int ndx
);
459 int debug_add_class(const char *classname
);
460 int debug_lookup_classname(const char *classname
);
461 bool debug_parse_levels(const char *params_str
);
462 void debug_message(struct messaging_context
*msg_ctx
, void *private_data
, uint32_t msg_type
, struct server_id src
, DATA_BLOB
*data
);
463 void debug_init(void);
464 void debug_register_msgs(struct messaging_context
*msg_ctx
);
465 void setup_logging(const char *pname
, bool interactive
);
466 void debug_set_logfile(const char *name
);
467 bool reopen_logs( void );
468 void force_check_log_size( void );
469 bool need_to_check_log_size( void );
470 void check_log_size( void );
471 void dbgflush( void );
472 bool dbghdrclass(int level
, int cls
, const char *location
, const char *func
);
473 bool dbghdr(int level
, const char *location
, const char *func
);
474 TALLOC_CTX
*debug_ctx(void);
476 /* The following definitions come from lib/display_sec.c */
478 char *get_sec_mask_str(TALLOC_CTX
*ctx
, uint32 type
);
479 void display_sec_access(uint32_t *info
);
480 void display_sec_ace_flags(uint8_t flags
);
481 void display_sec_ace(SEC_ACE
*ace
);
482 void display_sec_acl(SEC_ACL
*sec_acl
);
483 void display_acl_type(uint16 type
);
484 void display_sec_desc(SEC_DESC
*sec
);
486 /* The following definitions come from lib/dmallocmsg.c */
488 void register_dmalloc_msgs(struct messaging_context
*msg_ctx
);
490 /* The following definitions come from lib/dprintf.c */
492 void display_set_stderr(void);
494 /* The following definitions come from lib/errmap_unix.c */
496 NTSTATUS
map_nt_error_from_unix(int unix_error
);
497 int map_errno_from_nt_status(NTSTATUS status
);
499 /* The following definitions come from lib/fault.c */
500 void fault_setup(void (*fn
)(void *));
501 void dump_core_setup(const char *progname
);
503 /* The following definitions come from lib/file_id.c */
505 struct file_id
vfs_file_id_from_sbuf(connection_struct
*conn
, const SMB_STRUCT_STAT
*sbuf
);
506 bool file_id_equal(const struct file_id
*id1
, const struct file_id
*id2
);
507 const char *file_id_string_tos(const struct file_id
*id
);
508 void push_file_id_16(char *buf
, const struct file_id
*id
);
509 void push_file_id_24(char *buf
, const struct file_id
*id
);
510 void pull_file_id_24(char *buf
, struct file_id
*id
);
512 /* The following definitions come from lib/gencache.c */
514 bool gencache_init(void);
515 bool gencache_shutdown(void);
516 bool gencache_set(const char *keystr
, const char *value
, time_t timeout
);
517 bool gencache_del(const char *keystr
);
518 bool gencache_get(const char *keystr
, char **valstr
, time_t *timeout
);
519 bool gencache_get_data_blob(const char *keystr
, DATA_BLOB
*blob
, bool *expired
);
520 bool gencache_set_data_blob(const char *keystr
, const DATA_BLOB
*blob
, time_t timeout
);
521 void gencache_iterate(void (*fn
)(const char* key
, const char *value
, time_t timeout
, void* dptr
),
522 void* data
, const char* keystr_pattern
);
523 int gencache_lock_entry( const char *key
);
524 void gencache_unlock_entry( const char *key
);
526 /* The following definitions come from lib/interface.c */
528 bool ismyaddr(const struct sockaddr
*ip
);
529 bool ismyip_v4(struct in_addr ip
);
530 bool is_local_net(const struct sockaddr
*from
);
531 void setup_linklocal_scope_id(struct sockaddr
*pss
);
532 bool is_local_net_v4(struct in_addr from
);
533 int iface_count(void);
534 int iface_count_v4_nl(void);
535 const struct in_addr
*first_ipv4_iface(void);
536 struct interface
*get_interface(int n
);
537 const struct sockaddr_storage
*iface_n_sockaddr_storage(int n
);
538 const struct in_addr
*iface_n_ip_v4(int n
);
539 const struct in_addr
*iface_n_bcast_v4(int n
);
540 const struct sockaddr_storage
*iface_n_bcast(int n
);
541 const struct sockaddr_storage
*iface_ip(const struct sockaddr
*ip
);
542 bool iface_local(const struct sockaddr
*ip
);
543 void load_interfaces(void);
544 void gfree_interfaces(void);
545 bool interfaces_changed(void);
547 /* The following definitions come from lib/ldap_debug_handler.c */
549 void init_ldap_debugging(void);
551 /* The following definitions come from lib/ldap_escape.c */
553 char *escape_ldap_string_alloc(const char *s
);
554 char *escape_rdn_val_string_alloc(const char *s
);
556 /* The following definitions come from lib/module.c */
558 NTSTATUS
smb_load_module(const char *module_name
);
559 int smb_load_modules(const char **modules
);
560 NTSTATUS
smb_probe_module(const char *subsystem
, const char *module
);
561 NTSTATUS
smb_load_module(const char *module_name
);
562 int smb_load_modules(const char **modules
);
563 NTSTATUS
smb_probe_module(const char *subsystem
, const char *module
);
564 void init_modules(void);
566 /* The following definitions come from lib/ms_fnmatch.c */
568 int ms_fnmatch(const char *pattern
, const char *string
, bool translate_pattern
,
569 bool is_case_sensitive
);
570 int gen_fnmatch(const char *pattern
, const char *string
);
572 /* The following definitions come from lib/pam_errors.c */
574 NTSTATUS
pam_to_nt_status(int pam_error
);
575 int nt_status_to_pam(NTSTATUS nt_status
);
576 NTSTATUS
pam_to_nt_status(int pam_error
);
577 int nt_status_to_pam(NTSTATUS nt_status
);
579 /* The following definitions come from lib/pidfile.c */
581 pid_t
pidfile_pid(const char *name
);
582 void pidfile_create(const char *program_name
);
584 /* The following definitions come from lib/popt_common.c */
586 void popt_common_set_auth_info(struct user_auth_info
*auth_info
);
588 /* The following definitions come from lib/privileges.c */
590 bool get_privileges_for_sids(SE_PRIV
*privileges
, DOM_SID
*slist
, int scount
);
591 NTSTATUS
privilege_enumerate_accounts(DOM_SID
**sids
, int *num_sids
);
592 NTSTATUS
privilege_enum_sids(const SE_PRIV
*mask
, TALLOC_CTX
*mem_ctx
,
593 DOM_SID
**sids
, int *num_sids
);
594 bool grant_privilege(const DOM_SID
*sid
, const SE_PRIV
*priv_mask
);
595 bool grant_privilege_by_name(DOM_SID
*sid
, const char *name
);
596 bool revoke_privilege(const DOM_SID
*sid
, const SE_PRIV
*priv_mask
);
597 bool revoke_all_privileges( DOM_SID
*sid
);
598 bool revoke_privilege_by_name(DOM_SID
*sid
, const char *name
);
599 NTSTATUS
privilege_create_account(const DOM_SID
*sid
);
600 NTSTATUS
privilege_delete_account(const struct dom_sid
*sid
);
601 NTSTATUS
privilege_set_init(PRIVILEGE_SET
*priv_set
);
602 NTSTATUS
privilege_set_init_by_ctx(TALLOC_CTX
*mem_ctx
, PRIVILEGE_SET
*priv_set
);
603 void privilege_set_free(PRIVILEGE_SET
*priv_set
);
604 NTSTATUS
dup_luid_attr(TALLOC_CTX
*mem_ctx
, LUID_ATTR
**new_la
, LUID_ATTR
*old_la
, int count
);
605 bool is_privileged_sid( const DOM_SID
*sid
);
606 bool grant_all_privileges( const DOM_SID
*sid
);
608 /* The following definitions come from lib/privileges_basic.c */
610 bool se_priv_copy( SE_PRIV
*dst
, const SE_PRIV
*src
);
611 bool se_priv_put_all_privileges(SE_PRIV
*mask
);
612 void se_priv_add( SE_PRIV
*mask
, const SE_PRIV
*addpriv
);
613 void se_priv_remove( SE_PRIV
*mask
, const SE_PRIV
*removepriv
);
614 bool se_priv_equal( const SE_PRIV
*mask1
, const SE_PRIV
*mask2
);
615 bool se_priv_from_name( const char *name
, SE_PRIV
*mask
);
616 void dump_se_priv( int dbg_cl
, int dbg_lvl
, const SE_PRIV
*mask
);
617 bool is_privilege_assigned(const SE_PRIV
*privileges
,
618 const SE_PRIV
*check
);
619 const char* get_privilege_dispname( const char *name
);
620 bool user_has_privileges(const NT_USER_TOKEN
*token
, const SE_PRIV
*privilege
);
621 bool user_has_any_privilege(NT_USER_TOKEN
*token
, const SE_PRIV
*privilege
);
622 int count_all_privileges( void );
623 LUID_ATTR
get_privilege_luid( SE_PRIV
*mask
);
624 const char *luid_to_privilege_name(const LUID
*set
);
625 bool se_priv_to_privilege_set( PRIVILEGE_SET
*set
, SE_PRIV
*mask
);
626 bool privilege_set_to_se_priv( SE_PRIV
*mask
, struct lsa_PrivilegeSet
*privset
);
628 /* The following definitions come from lib/readline.c */
630 void smb_readline_done(void);
631 char *smb_readline(const char *prompt
, void (*callback
)(void),
632 char **(completion_fn
)(const char *text
, int start
, int end
));
633 const char *smb_readline_get_line_buffer(void);
634 void smb_readline_ca_char(char c
);
635 int cmd_history(void);
637 /* The following definitions come from lib/recvfile.c */
639 ssize_t
sys_recvfile(int fromfd
,
643 ssize_t
sys_recvfile(int fromfd
,
647 ssize_t
drain_socket(int sockfd
, size_t count
);
649 /* The following definitions come from lib/secdesc.c */
651 uint32_t get_sec_info(const SEC_DESC
*sd
);
652 SEC_DESC_BUF
*sec_desc_merge(TALLOC_CTX
*ctx
, SEC_DESC_BUF
*new_sdb
, SEC_DESC_BUF
*old_sdb
);
653 SEC_DESC
*make_sec_desc(TALLOC_CTX
*ctx
,
654 enum security_descriptor_revision revision
,
656 const DOM_SID
*owner_sid
, const DOM_SID
*grp_sid
,
657 SEC_ACL
*sacl
, SEC_ACL
*dacl
, size_t *sd_size
);
658 SEC_DESC
*dup_sec_desc(TALLOC_CTX
*ctx
, const SEC_DESC
*src
);
659 NTSTATUS
marshall_sec_desc(TALLOC_CTX
*mem_ctx
,
660 struct security_descriptor
*secdesc
,
661 uint8
**data
, size_t *len
);
662 NTSTATUS
marshall_sec_desc_buf(TALLOC_CTX
*mem_ctx
,
663 struct sec_desc_buf
*secdesc_buf
,
664 uint8_t **data
, size_t *len
);
665 NTSTATUS
unmarshall_sec_desc(TALLOC_CTX
*mem_ctx
, uint8
*data
, size_t len
,
666 struct security_descriptor
**psecdesc
);
667 NTSTATUS
unmarshall_sec_desc_buf(TALLOC_CTX
*mem_ctx
, uint8_t *data
, size_t len
,
668 struct sec_desc_buf
**psecdesc_buf
);
669 SEC_DESC
*make_standard_sec_desc(TALLOC_CTX
*ctx
, const DOM_SID
*owner_sid
, const DOM_SID
*grp_sid
,
670 SEC_ACL
*dacl
, size_t *sd_size
);
671 SEC_DESC_BUF
*make_sec_desc_buf(TALLOC_CTX
*ctx
, size_t len
, SEC_DESC
*sec_desc
);
672 SEC_DESC_BUF
*dup_sec_desc_buf(TALLOC_CTX
*ctx
, SEC_DESC_BUF
*src
);
673 NTSTATUS
sec_desc_add_sid(TALLOC_CTX
*ctx
, SEC_DESC
**psd
, DOM_SID
*sid
, uint32 mask
, size_t *sd_size
);
674 NTSTATUS
sec_desc_mod_sid(SEC_DESC
*sd
, DOM_SID
*sid
, uint32 mask
);
675 NTSTATUS
sec_desc_del_sid(TALLOC_CTX
*ctx
, SEC_DESC
**psd
, DOM_SID
*sid
, size_t *sd_size
);
676 NTSTATUS
se_create_child_secdesc(TALLOC_CTX
*ctx
,
679 const SEC_DESC
*parent_ctr
,
680 const DOM_SID
*owner_sid
,
681 const DOM_SID
*group_sid
,
683 NTSTATUS
se_create_child_secdesc_buf(TALLOC_CTX
*ctx
,
684 SEC_DESC_BUF
**ppsdb
,
685 const SEC_DESC
*parent_ctr
,
688 /* The following definitions come from lib/select.c */
690 void sys_select_signal(char c
);
691 int sys_select(int maxfd
, fd_set
*readfds
, fd_set
*writefds
, fd_set
*errorfds
, struct timeval
*tval
);
692 int sys_select_intr(int maxfd
, fd_set
*readfds
, fd_set
*writefds
, fd_set
*errorfds
, struct timeval
*tval
);
694 /* The following definitions come from lib/sendfile.c */
696 ssize_t
sys_sendfile(int tofd
, int fromfd
, const DATA_BLOB
*header
, SMB_OFF_T offset
, size_t count
);
698 /* The following definitions come from lib/server_mutex.c */
700 struct named_mutex
*grab_named_mutex(TALLOC_CTX
*mem_ctx
, const char *name
,
703 /* The following definitions come from lib/sharesec.c */
705 SEC_DESC
*get_share_security_default( TALLOC_CTX
*ctx
, size_t *psize
, uint32 def_access
);
706 SEC_DESC
*get_share_security( TALLOC_CTX
*ctx
, const char *servicename
,
708 bool set_share_security(const char *share_name
, SEC_DESC
*psd
);
709 bool delete_share_security(const char *servicename
);
710 bool share_access_check(const NT_USER_TOKEN
*token
, const char *sharename
,
711 uint32 desired_access
);
712 bool parse_usershare_acl(TALLOC_CTX
*ctx
, const char *acl_str
, SEC_DESC
**ppsd
);
714 /* The following definitions come from lib/smbldap.c */
716 int smb_ldap_start_tls(LDAP
*ldap_struct
, int version
);
717 int smb_ldap_setup_conn(LDAP
**ldap_struct
, const char *uri
);
718 int smb_ldap_upgrade_conn(LDAP
*ldap_struct
, int *new_version
) ;
719 int smb_ldap_setup_full_conn(LDAP
**ldap_struct
, const char *uri
);
720 int smbldap_search(struct smbldap_state
*ldap_state
,
721 const char *base
, int scope
, const char *filter
,
722 const char *attrs
[], int attrsonly
,
724 int smbldap_search_paged(struct smbldap_state
*ldap_state
,
725 const char *base
, int scope
, const char *filter
,
726 const char **attrs
, int attrsonly
, int pagesize
,
727 LDAPMessage
**res
, void **cookie
);
728 int smbldap_modify(struct smbldap_state
*ldap_state
, const char *dn
, LDAPMod
*attrs
[]);
729 int smbldap_add(struct smbldap_state
*ldap_state
, const char *dn
, LDAPMod
*attrs
[]);
730 int smbldap_delete(struct smbldap_state
*ldap_state
, const char *dn
);
731 int smbldap_extended_operation(struct smbldap_state
*ldap_state
,
732 LDAP_CONST
char *reqoid
, struct berval
*reqdata
,
733 LDAPControl
**serverctrls
, LDAPControl
**clientctrls
,
734 char **retoidp
, struct berval
**retdatap
);
735 int smbldap_search_suffix (struct smbldap_state
*ldap_state
,
736 const char *filter
, const char **search_attr
,
737 LDAPMessage
** result
);
738 void smbldap_free_struct(struct smbldap_state
**ldap_state
) ;
739 NTSTATUS
smbldap_init(TALLOC_CTX
*mem_ctx
, struct event_context
*event_ctx
,
740 const char *location
,
741 struct smbldap_state
**smbldap_state
);
742 bool smbldap_has_control(LDAP
*ld
, const char *control
);
743 bool smbldap_has_extension(LDAP
*ld
, const char *extension
);
744 bool smbldap_has_naming_context(LDAP
*ld
, const char *naming_context
);
745 bool smbldap_set_creds(struct smbldap_state
*ldap_state
, bool anon
, const char *dn
, const char *secret
);
747 /* The following definitions come from lib/smbldap_util.c */
749 NTSTATUS
smbldap_search_domain_info(struct smbldap_state
*ldap_state
,
750 LDAPMessage
** result
, const char *domain_name
,
753 /* The following definitions come from lib/smbrun.c */
755 int smbrun_no_sanitize(const char *cmd
, int *outfd
);
756 int smbrun(const char *cmd
, int *outfd
);
757 int smbrunsecret(const char *cmd
, const char *secret
);
759 /* The following definitions come from lib/sock_exec.c */
761 int sock_exec(const char *prog
);
763 /* The following definitions come from lib/substitute.c */
765 void free_local_machine_name(void);
766 bool set_local_machine_name(const char *local_name
, bool perm
);
767 const char *get_local_machine_name(void);
768 bool set_remote_machine_name(const char *remote_name
, bool perm
);
769 const char *get_remote_machine_name(void);
770 void sub_set_smb_name(const char *name
);
771 void set_current_user_info(const char *smb_name
, const char *unix_name
,
773 const char *get_current_username(void);
774 void standard_sub_basic(const char *smb_name
, const char *domain_name
,
775 char *str
, size_t len
);
776 char *talloc_sub_basic(TALLOC_CTX
*mem_ctx
, const char *smb_name
,
777 const char *domain_name
, const char *str
);
778 char *alloc_sub_basic(const char *smb_name
, const char *domain_name
,
780 char *talloc_sub_specified(TALLOC_CTX
*mem_ctx
,
781 const char *input_string
,
782 const char *username
,
786 char *talloc_sub_advanced(TALLOC_CTX
*mem_ctx
,
787 const char *servicename
, const char *user
,
788 const char *connectpath
, gid_t gid
,
789 const char *smb_name
, const char *domain_name
,
791 void standard_sub_advanced(const char *servicename
, const char *user
,
792 const char *connectpath
, gid_t gid
,
793 const char *smb_name
, const char *domain_name
,
794 char *str
, size_t len
);
795 char *standard_sub_conn(TALLOC_CTX
*ctx
, connection_struct
*conn
, const char *str
);
797 /* The following definitions come from lib/sysacls.c */
799 int sys_acl_get_entry(SMB_ACL_T acl_d
, int entry_id
, SMB_ACL_ENTRY_T
*entry_p
);
800 int sys_acl_get_tag_type(SMB_ACL_ENTRY_T entry_d
, SMB_ACL_TAG_T
*type_p
);
801 int sys_acl_get_permset(SMB_ACL_ENTRY_T entry_d
, SMB_ACL_PERMSET_T
*permset_p
);
802 void *sys_acl_get_qualifier(SMB_ACL_ENTRY_T entry_d
);
803 int sys_acl_clear_perms(SMB_ACL_PERMSET_T permset_d
);
804 int sys_acl_add_perm(SMB_ACL_PERMSET_T permset_d
, SMB_ACL_PERM_T perm
);
805 int sys_acl_get_perm(SMB_ACL_PERMSET_T permset_d
, SMB_ACL_PERM_T perm
);
806 char *sys_acl_to_text(SMB_ACL_T acl_d
, ssize_t
*len_p
);
807 SMB_ACL_T
sys_acl_init(int count
);
808 int sys_acl_create_entry(SMB_ACL_T
*acl_p
, SMB_ACL_ENTRY_T
*entry_p
);
809 int sys_acl_set_tag_type(SMB_ACL_ENTRY_T entry_d
, SMB_ACL_TAG_T tag_type
);
810 int sys_acl_set_qualifier(SMB_ACL_ENTRY_T entry_d
, void *qual_p
);
811 int sys_acl_set_permset(SMB_ACL_ENTRY_T entry_d
, SMB_ACL_PERMSET_T permset_d
);
812 int sys_acl_free_text(char *text
);
813 int sys_acl_free_acl(SMB_ACL_T acl_d
) ;
814 int sys_acl_free_qualifier(void *qual
, SMB_ACL_TAG_T tagtype
);
815 int sys_acl_valid(SMB_ACL_T acl_d
);
816 SMB_ACL_T
sys_acl_get_file(vfs_handle_struct
*handle
,
817 const char *path_p
, SMB_ACL_TYPE_T type
);
818 SMB_ACL_T
sys_acl_get_fd(vfs_handle_struct
*handle
, files_struct
*fsp
);
819 int sys_acl_set_file(vfs_handle_struct
*handle
,
820 const char *name
, SMB_ACL_TYPE_T type
, SMB_ACL_T acl_d
);
821 int sys_acl_set_fd(vfs_handle_struct
*handle
, files_struct
*fsp
,
823 int sys_acl_delete_def_file(vfs_handle_struct
*handle
,
825 SMB_ACL_T
sys_acl_get_file(vfs_handle_struct
*handle
,
826 const char *path_p
, SMB_ACL_TYPE_T type
);
827 SMB_ACL_T
sys_acl_get_fd(vfs_handle_struct
*handle
, files_struct
*fsp
);
828 int sys_acl_set_file(vfs_handle_struct
*handle
,
829 const char *name
, SMB_ACL_TYPE_T type
, SMB_ACL_T acl_d
);
830 int sys_acl_set_fd(vfs_handle_struct
*handle
, files_struct
*fsp
,
832 int sys_acl_delete_def_file(vfs_handle_struct
*handle
,
834 SMB_ACL_T
sys_acl_get_file(vfs_handle_struct
*handle
,
835 const char *path_p
, SMB_ACL_TYPE_T type
);
836 SMB_ACL_T
sys_acl_get_fd(vfs_handle_struct
*handle
, files_struct
*fsp
);
837 int sys_acl_set_file(vfs_handle_struct
*handle
,
838 const char *name
, SMB_ACL_TYPE_T type
, SMB_ACL_T acl_d
);
839 int sys_acl_set_fd(vfs_handle_struct
*handle
, files_struct
*fsp
,
841 int sys_acl_delete_def_file(vfs_handle_struct
*handle
,
843 SMB_ACL_T
sys_acl_get_file(vfs_handle_struct
*handle
,
844 const char *path_p
, SMB_ACL_TYPE_T type
);
845 SMB_ACL_T
sys_acl_get_fd(vfs_handle_struct
*handle
, files_struct
*fsp
);
846 int sys_acl_set_file(vfs_handle_struct
*handle
,
847 const char *name
, SMB_ACL_TYPE_T type
, SMB_ACL_T acl_d
);
848 int sys_acl_set_fd(vfs_handle_struct
*handle
, files_struct
*fsp
,
850 int sys_acl_delete_def_file(vfs_handle_struct
*handle
,
852 SMB_ACL_T
sys_acl_get_file(vfs_handle_struct
*handle
,
853 const char *path_p
, SMB_ACL_TYPE_T type
);
854 SMB_ACL_T
sys_acl_get_fd(vfs_handle_struct
*handle
, files_struct
*fsp
);
855 int sys_acl_set_file(vfs_handle_struct
*handle
,
856 const char *name
, SMB_ACL_TYPE_T type
, SMB_ACL_T acl_d
);
857 int sys_acl_set_fd(vfs_handle_struct
*handle
, files_struct
*fsp
,
859 int sys_acl_delete_def_file(vfs_handle_struct
*handle
,
861 SMB_ACL_T
sys_acl_get_file(vfs_handle_struct
*handle
,
862 const char *path_p
, SMB_ACL_TYPE_T type
);
863 SMB_ACL_T
sys_acl_get_fd(vfs_handle_struct
*handle
, files_struct
*fsp
);
864 int sys_acl_set_file(vfs_handle_struct
*handle
,
865 const char *name
, SMB_ACL_TYPE_T type
, SMB_ACL_T acl_d
);
866 int sys_acl_set_fd(vfs_handle_struct
*handle
, files_struct
*fsp
,
868 int sys_acl_delete_def_file(vfs_handle_struct
*handle
,
870 SMB_ACL_T
sys_acl_get_file(vfs_handle_struct
*handle
,
871 const char *path_p
, SMB_ACL_TYPE_T type
);
872 SMB_ACL_T
sys_acl_get_fd(vfs_handle_struct
*handle
, files_struct
*fsp
);
873 int sys_acl_set_file(vfs_handle_struct
*handle
,
874 const char *name
, SMB_ACL_TYPE_T type
, SMB_ACL_T acl_d
);
875 int sys_acl_set_fd(vfs_handle_struct
*handle
, files_struct
*fsp
,
877 int sys_acl_delete_def_file(vfs_handle_struct
*handle
,
879 int no_acl_syscall_error(int err
);
881 /* The following definitions come from lib/sysquotas.c */
883 int sys_get_quota(const char *path
, enum SMB_QUOTA_TYPE qtype
, unid_t id
, SMB_DISK_QUOTA
*dp
);
884 int sys_set_quota(const char *path
, enum SMB_QUOTA_TYPE qtype
, unid_t id
, SMB_DISK_QUOTA
*dp
);
886 /* The following definitions come from lib/sysquotas_*.c */
888 int sys_get_vfs_quota(const char *path
, const char *bdev
, enum SMB_QUOTA_TYPE qtype
, unid_t id
, SMB_DISK_QUOTA
*dp
);
889 int sys_set_vfs_quota(const char *path
, const char *bdev
, enum SMB_QUOTA_TYPE qtype
, unid_t id
, SMB_DISK_QUOTA
*dp
);
891 int sys_get_xfs_quota(const char *path
, const char *bdev
, enum SMB_QUOTA_TYPE qtype
, unid_t id
, SMB_DISK_QUOTA
*dp
);
892 int sys_set_xfs_quota(const char *path
, const char *bdev
, enum SMB_QUOTA_TYPE qtype
, unid_t id
, SMB_DISK_QUOTA
*dp
);
894 /* The following definitions come from lib/system.c */
896 void *sys_memalign( size_t align
, size_t size
);
897 int sys_usleep(long usecs
);
898 ssize_t
sys_read(int fd
, void *buf
, size_t count
);
899 ssize_t
sys_write(int fd
, const void *buf
, size_t count
);
900 ssize_t
sys_writev(int fd
, const struct iovec
*iov
, int iovcnt
);
901 ssize_t
sys_pread(int fd
, void *buf
, size_t count
, SMB_OFF_T off
);
902 ssize_t
sys_pwrite(int fd
, const void *buf
, size_t count
, SMB_OFF_T off
);
903 ssize_t
sys_send(int s
, const void *msg
, size_t len
, int flags
);
904 ssize_t
sys_sendto(int s
, const void *msg
, size_t len
, int flags
, const struct sockaddr
*to
, socklen_t tolen
);
905 ssize_t
sys_recv(int fd
, void *buf
, size_t count
, int flags
);
906 ssize_t
sys_recvfrom(int s
, void *buf
, size_t len
, int flags
, struct sockaddr
*from
, socklen_t
*fromlen
);
907 int sys_fcntl_ptr(int fd
, int cmd
, void *arg
);
908 int sys_fcntl_long(int fd
, int cmd
, long arg
);
909 int sys_stat(const char *fname
,SMB_STRUCT_STAT
*sbuf
);
910 int sys_fstat(int fd
,SMB_STRUCT_STAT
*sbuf
);
911 int sys_lstat(const char *fname
,SMB_STRUCT_STAT
*sbuf
);
912 int sys_ftruncate(int fd
, SMB_OFF_T offset
);
913 SMB_OFF_T
sys_lseek(int fd
, SMB_OFF_T offset
, int whence
);
914 int sys_fseek(FILE *fp
, SMB_OFF_T offset
, int whence
);
915 SMB_OFF_T
sys_ftell(FILE *fp
);
916 int sys_creat(const char *path
, mode_t mode
);
917 int sys_open(const char *path
, int oflag
, mode_t mode
);
918 FILE *sys_fopen(const char *path
, const char *type
);
919 void kernel_flock(int fd
, uint32 share_mode
);
920 SMB_STRUCT_DIR
*sys_opendir(const char *name
);
921 SMB_STRUCT_DIRENT
*sys_readdir(SMB_STRUCT_DIR
*dirp
);
922 void sys_seekdir(SMB_STRUCT_DIR
*dirp
, long offset
);
923 long sys_telldir(SMB_STRUCT_DIR
*dirp
);
924 void sys_rewinddir(SMB_STRUCT_DIR
*dirp
);
925 int sys_closedir(SMB_STRUCT_DIR
*dirp
);
926 int sys_mknod(const char *path
, mode_t mode
, SMB_DEV_T dev
);
927 int sys_waitpid(pid_t pid
,int *status
,int options
);
928 char *sys_getwd(char *s
);
929 void set_effective_capability(enum smbd_capability capability
);
930 void drop_effective_capability(enum smbd_capability capability
);
931 long sys_random(void);
932 void sys_srandom(unsigned int seed
);
933 int groups_max(void);
934 int sys_getgroups(int setlen
, gid_t
*gidset
);
935 int sys_setgroups(gid_t
UNUSED(primary_gid
), int setlen
, gid_t
*gidset
);
936 void sys_setpwent(void);
937 struct passwd
*sys_getpwent(void);
938 void sys_endpwent(void);
939 struct passwd
*sys_getpwnam(const char *name
);
940 struct passwd
*sys_getpwuid(uid_t uid
);
941 struct group
*sys_getgrnam(const char *name
);
942 struct group
*sys_getgrgid(gid_t gid
);
943 int sys_popen(const char *command
);
944 int sys_pclose(int fd
);
945 ssize_t
sys_getxattr (const char *path
, const char *name
, void *value
, size_t size
);
946 ssize_t
sys_lgetxattr (const char *path
, const char *name
, void *value
, size_t size
);
947 ssize_t
sys_fgetxattr (int filedes
, const char *name
, void *value
, size_t size
);
948 ssize_t
sys_listxattr (const char *path
, char *list
, size_t size
);
949 ssize_t
sys_llistxattr (const char *path
, char *list
, size_t size
);
950 ssize_t
sys_flistxattr (int filedes
, char *list
, size_t size
);
951 int sys_removexattr (const char *path
, const char *name
);
952 int sys_lremovexattr (const char *path
, const char *name
);
953 int sys_fremovexattr (int filedes
, const char *name
);
954 int sys_setxattr (const char *path
, const char *name
, const void *value
, size_t size
, int flags
);
955 int sys_lsetxattr (const char *path
, const char *name
, const void *value
, size_t size
, int flags
);
956 int sys_fsetxattr (int filedes
, const char *name
, const void *value
, size_t size
, int flags
);
957 uint32
unix_dev_major(SMB_DEV_T dev
);
958 uint32
unix_dev_minor(SMB_DEV_T dev
);
959 int sys_aio_read(SMB_STRUCT_AIOCB
*aiocb
);
960 int sys_aio_write(SMB_STRUCT_AIOCB
*aiocb
);
961 ssize_t
sys_aio_return(SMB_STRUCT_AIOCB
*aiocb
);
962 int sys_aio_cancel(int fd
, SMB_STRUCT_AIOCB
*aiocb
);
963 int sys_aio_error(const SMB_STRUCT_AIOCB
*aiocb
);
964 int sys_aio_fsync(int op
, SMB_STRUCT_AIOCB
*aiocb
);
965 int sys_aio_suspend(const SMB_STRUCT_AIOCB
* const cblist
[], int n
, const struct timespec
*timeout
);
966 int sys_aio_read(SMB_STRUCT_AIOCB
*aiocb
);
967 int sys_aio_write(SMB_STRUCT_AIOCB
*aiocb
);
968 ssize_t
sys_aio_return(SMB_STRUCT_AIOCB
*aiocb
);
969 int sys_aio_cancel(int fd
, SMB_STRUCT_AIOCB
*aiocb
);
970 int sys_aio_error(const SMB_STRUCT_AIOCB
*aiocb
);
971 int sys_aio_fsync(int op
, SMB_STRUCT_AIOCB
*aiocb
);
972 int sys_aio_suspend(const SMB_STRUCT_AIOCB
* const cblist
[], int n
, const struct timespec
*timeout
);
973 int sys_getpeereid( int s
, uid_t
*uid
);
974 int sys_getnameinfo(const struct sockaddr
*psa
,
981 int sys_connect(int fd
, const struct sockaddr
* addr
);
983 /* The following definitions come from lib/system_smbd.c */
985 bool getgroups_unix_user(TALLOC_CTX
*mem_ctx
, const char *user
,
987 gid_t
**ret_groups
, size_t *p_ngroups
);
989 /* The following definitions come from lib/tallocmsg.c */
991 void register_msg_pool_usage(struct messaging_context
*msg_ctx
);
993 /* The following definitions come from lib/time.c */
995 void push_dos_date(uint8_t *buf
, int offset
, time_t unixdate
, int zone_offset
);
996 void push_dos_date2(uint8_t *buf
,int offset
,time_t unixdate
, int zone_offset
);
997 void push_dos_date3(uint8_t *buf
,int offset
,time_t unixdate
, int zone_offset
);
998 time_t pull_dos_date(const uint8_t *date_ptr
, int zone_offset
);
999 time_t pull_dos_date2(const uint8_t *date_ptr
, int zone_offset
);
1000 time_t pull_dos_date3(const uint8_t *date_ptr
, int zone_offset
);
1001 uint32
convert_time_t_to_uint32(time_t t
);
1002 time_t convert_uint32_to_time_t(uint32 u
);
1003 bool nt_time_is_zero(const NTTIME
*nt
);
1004 time_t generalized_to_unix_time(const char *str
);
1005 int get_server_zone_offset(void);
1006 int set_server_zone_offset(time_t t
);
1007 char *current_timestring(TALLOC_CTX
*ctx
, bool hires
);
1008 void srv_put_dos_date(char *buf
,int offset
,time_t unixdate
);
1009 void srv_put_dos_date2(char *buf
,int offset
, time_t unixdate
);
1010 void srv_put_dos_date3(char *buf
,int offset
,time_t unixdate
);
1011 void put_long_date_timespec(char *p
, struct timespec ts
);
1012 void put_long_date(char *p
, time_t t
);
1013 struct timespec
get_create_timespec(const SMB_STRUCT_STAT
*st
,bool fake_dirs
);
1014 struct timespec
get_atimespec(const SMB_STRUCT_STAT
*pst
);
1015 void set_atimespec(SMB_STRUCT_STAT
*pst
, struct timespec ts
);
1016 struct timespec
get_mtimespec(const SMB_STRUCT_STAT
*pst
);
1017 void set_mtimespec(SMB_STRUCT_STAT
*pst
, struct timespec ts
);
1018 struct timespec
get_ctimespec(const SMB_STRUCT_STAT
*pst
);
1019 void set_ctimespec(SMB_STRUCT_STAT
*pst
, struct timespec ts
);
1020 void dos_filetime_timespec(struct timespec
*tsp
);
1021 time_t make_unix_date2(const void *date_ptr
, int zone_offset
);
1022 time_t make_unix_date3(const void *date_ptr
, int zone_offset
);
1023 time_t srv_make_unix_date(const void *date_ptr
);
1024 time_t srv_make_unix_date2(const void *date_ptr
);
1025 time_t srv_make_unix_date3(const void *date_ptr
);
1026 time_t convert_timespec_to_time_t(struct timespec ts
);
1027 struct timespec
convert_time_t_to_timespec(time_t t
);
1028 struct timespec
convert_timeval_to_timespec(const struct timeval tv
);
1029 struct timeval
convert_timespec_to_timeval(const struct timespec ts
);
1030 struct timespec
timespec_current(void);
1031 struct timespec
timespec_min(const struct timespec
*ts1
,
1032 const struct timespec
*ts2
);
1033 int timespec_compare(const struct timespec
*ts1
, const struct timespec
*ts2
);
1034 struct timespec
interpret_long_date(const char *p
);
1035 void cli_put_dos_date(struct cli_state
*cli
, char *buf
, int offset
, time_t unixdate
);
1036 void cli_put_dos_date2(struct cli_state
*cli
, char *buf
, int offset
, time_t unixdate
);
1037 void cli_put_dos_date3(struct cli_state
*cli
, char *buf
, int offset
, time_t unixdate
);
1038 time_t cli_make_unix_date(struct cli_state
*cli
, const void *date_ptr
);
1039 time_t cli_make_unix_date2(struct cli_state
*cli
, const void *date_ptr
);
1040 time_t cli_make_unix_date3(struct cli_state
*cli
, const void *date_ptr
);
1041 bool nt_time_equals(const NTTIME
*nt1
, const NTTIME
*nt2
);
1042 void TimeInit(void);
1043 void get_process_uptime(struct timeval
*ret_time
);
1044 time_t nt_time_to_unix_abs(const NTTIME
*nt
);
1045 time_t uint64s_nt_time_to_unix_abs(const uint64_t *src
);
1046 void unix_timespec_to_nt_time(NTTIME
*nt
, struct timespec ts
);
1047 void unix_to_nt_time_abs(NTTIME
*nt
, time_t t
);
1048 bool null_mtime(time_t mtime
);
1049 const char *time_to_asc(const time_t t
);
1050 const char *display_time(NTTIME nttime
);
1051 bool nt_time_is_set(const NTTIME
*nt
);
1053 /* The following definitions come from lib/username.c */
1055 char *get_user_home_dir(TALLOC_CTX
*mem_ctx
, const char *user
);
1056 struct passwd
*Get_Pwnam_alloc(TALLOC_CTX
*mem_ctx
, const char *user
);
1058 /* The following definitions come from lib/util.c */
1060 bool all_zero(const uint8_t *ptr
, size_t size
);
1061 bool set_global_myname(const char *myname
);
1062 const char *global_myname(void);
1063 bool set_global_myworkgroup(const char *myworkgroup
);
1064 const char *lp_workgroup(void);
1065 bool set_global_scope(const char *scope
);
1066 const char *global_scope(void);
1067 void gfree_names(void);
1068 void gfree_all( void );
1069 const char *my_netbios_names(int i
);
1070 bool set_netbios_aliases(const char **str_array
);
1071 bool init_names(void);
1072 struct user_auth_info
*user_auth_info_init(TALLOC_CTX
*mem_ctx
);
1073 const char *get_cmdline_auth_info_username(const struct user_auth_info
*auth_info
);
1074 void set_cmdline_auth_info_username(struct user_auth_info
*auth_info
,
1075 const char *username
);
1076 void set_cmdline_auth_info_password(struct user_auth_info
*auth_info
,
1077 const char *password
);
1078 const char *get_cmdline_auth_info_password(const struct user_auth_info
*auth_info
);
1079 bool set_cmdline_auth_info_signing_state(struct user_auth_info
*auth_info
,
1081 int get_cmdline_auth_info_signing_state(const struct user_auth_info
*auth_info
);
1082 void set_cmdline_auth_info_use_kerberos(struct user_auth_info
*auth_info
,
1084 bool get_cmdline_auth_info_use_kerberos(const struct user_auth_info
*auth_info
);
1085 void set_cmdline_auth_info_fallback_after_kerberos(struct user_auth_info
*auth_info
,
1087 bool get_cmdline_auth_info_fallback_after_kerberos(const struct user_auth_info
*auth_info
);
1088 void set_cmdline_auth_info_use_krb5_ticket(struct user_auth_info
*auth_info
);
1089 void set_cmdline_auth_info_smb_encrypt(struct user_auth_info
*auth_info
);
1090 void set_cmdline_auth_info_use_machine_account(struct user_auth_info
*auth_info
);
1091 bool get_cmdline_auth_info_got_pass(const struct user_auth_info
*auth_info
);
1092 bool get_cmdline_auth_info_smb_encrypt(const struct user_auth_info
*auth_info
);
1093 bool get_cmdline_auth_info_use_machine_account(const struct user_auth_info
*auth_info
);
1094 struct user_auth_info
*get_cmdline_auth_info_copy(TALLOC_CTX
*mem_ctx
,
1095 const struct user_auth_info
*info
);
1096 bool set_cmdline_auth_info_machine_account_creds(struct user_auth_info
*auth_info
);
1097 void set_cmdline_auth_info_getpass(struct user_auth_info
*auth_info
);
1098 bool add_gid_to_array_unique(TALLOC_CTX
*mem_ctx
, gid_t gid
,
1099 gid_t
**gids
, size_t *num_gids
);
1100 bool file_exist_stat(const char *fname
,SMB_STRUCT_STAT
*sbuf
);
1101 bool socket_exist(const char *fname
);
1102 bool directory_exist_stat(char *dname
,SMB_STRUCT_STAT
*st
);
1103 uint64_t get_file_size_stat(const SMB_STRUCT_STAT
*sbuf
);
1104 SMB_OFF_T
get_file_size(char *file_name
);
1105 char *attrib_string(uint16 mode
);
1106 void show_msg(char *buf
);
1107 void smb_set_enclen(char *buf
,int len
,uint16 enc_ctx_num
);
1108 void smb_setlen(char *buf
,int len
);
1109 int set_message_bcc(char *buf
,int num_bytes
);
1110 ssize_t
message_push_blob(uint8
**outbuf
, DATA_BLOB blob
);
1111 char *unix_clean_name(TALLOC_CTX
*ctx
, const char *s
);
1112 char *clean_name(TALLOC_CTX
*ctx
, const char *s
);
1113 ssize_t
write_data_at_offset(int fd
, const char *buffer
, size_t N
, SMB_OFF_T pos
);
1114 int set_blocking(int fd
, bool set
);
1115 void smb_msleep(unsigned int t
);
1116 bool reinit_after_fork(struct messaging_context
*msg_ctx
,
1117 struct event_context
*ev_ctx
,
1118 bool parent_longlived
);
1119 bool yesno(const char *p
);
1120 void *malloc_(size_t size
);
1121 void *memalign_array(size_t el_size
, size_t align
, unsigned int count
);
1122 void *calloc_array(size_t size
, size_t nmemb
);
1123 void *Realloc(void *p
, size_t size
, bool free_old_on_error
);
1124 void add_to_large_array(TALLOC_CTX
*mem_ctx
, size_t element_size
,
1125 void *element
, void *_array
, uint32
*num_elements
,
1126 ssize_t
*array_size
);
1127 char *get_myname(TALLOC_CTX
*ctx
);
1128 char *get_mydnsdomname(TALLOC_CTX
*ctx
);
1129 int interpret_protocol(const char *str
,int def
);
1130 char *automount_lookup(TALLOC_CTX
*ctx
, const char *user_name
);
1131 char *automount_lookup(TALLOC_CTX
*ctx
, const char *user_name
);
1132 bool process_exists(const struct server_id pid
);
1133 const char *uidtoname(uid_t uid
);
1134 char *gidtoname(gid_t gid
);
1135 uid_t
nametouid(const char *name
);
1136 gid_t
nametogid(const char *name
);
1137 void smb_panic(const char *const why
);
1138 void log_stack_trace(void);
1139 const char *readdirname(SMB_STRUCT_DIR
*p
);
1140 bool is_in_path(const char *name
, name_compare_entry
*namelist
, bool case_sensitive
);
1141 void set_namearray(name_compare_entry
**ppname_array
, const char *namelist
);
1142 void free_namearray(name_compare_entry
*name_array
);
1143 bool fcntl_lock(int fd
, int op
, SMB_OFF_T offset
, SMB_OFF_T count
, int type
);
1144 bool fcntl_getlock(int fd
, SMB_OFF_T
*poffset
, SMB_OFF_T
*pcount
, int *ptype
, pid_t
*ppid
);
1145 bool is_myname(const char *s
);
1146 bool is_myworkgroup(const char *s
);
1147 void ra_lanman_string( const char *native_lanman
);
1148 const char *get_remote_arch_str(void);
1149 void set_remote_arch(enum remote_arch_types type
);
1150 enum remote_arch_types
get_remote_arch(void);
1151 const char *tab_depth(int level
, int depth
);
1152 int str_checksum(const char *s
);
1153 void zero_free(void *p
, size_t size
);
1154 int set_maxfiles(int requested_max
);
1155 int smb_mkstemp(char *name_template
);
1156 void *smb_xmalloc_array(size_t size
, unsigned int count
);
1157 char *myhostname(void);
1158 char *lock_path(const char *name
);
1159 char *pid_path(const char *name
);
1160 char *lib_path(const char *name
);
1161 char *modules_path(const char *name
);
1162 char *data_path(const char *name
);
1163 char *state_path(const char *name
);
1164 char *cache_path(const char *name
);
1165 const char *shlib_ext(void);
1166 bool parent_dirname(TALLOC_CTX
*mem_ctx
, const char *dir
, char **parent
,
1168 bool ms_has_wild(const char *s
);
1169 bool ms_has_wild_w(const smb_ucs2_t
*s
);
1170 bool mask_match(const char *string
, const char *pattern
, bool is_case_sensitive
);
1171 bool mask_match_search(const char *string
, const char *pattern
, bool is_case_sensitive
);
1172 bool mask_match_list(const char *string
, char **list
, int listLen
, bool is_case_sensitive
);
1173 bool unix_wild_match(const char *pattern
, const char *string
);
1174 bool name_to_fqdn(fstring fqdn
, const char *name
);
1175 void *talloc_append_blob(TALLOC_CTX
*mem_ctx
, void *buf
, DATA_BLOB blob
);
1176 uint32
map_share_mode_to_deny_mode(uint32 share_access
, uint32 private_options
);
1177 pid_t
procid_to_pid(const struct server_id
*proc
);
1178 void set_my_vnn(uint32 vnn
);
1179 uint32
get_my_vnn(void);
1180 struct server_id
pid_to_procid(pid_t pid
);
1181 struct server_id
procid_self(void);
1182 struct server_id
server_id_self(void);
1183 bool procid_equal(const struct server_id
*p1
, const struct server_id
*p2
);
1184 bool cluster_id_equal(const struct server_id
*id1
,
1185 const struct server_id
*id2
);
1186 bool procid_is_me(const struct server_id
*pid
);
1187 struct server_id
interpret_pid(const char *pid_string
);
1188 char *procid_str(TALLOC_CTX
*mem_ctx
, const struct server_id
*pid
);
1189 char *procid_str_static(const struct server_id
*pid
);
1190 bool procid_valid(const struct server_id
*pid
);
1191 bool procid_is_local(const struct server_id
*pid
);
1192 int this_is_smp(void);
1193 bool trans_oob(uint32_t bufsize
, uint32_t offset
, uint32_t length
);
1194 bool is_offset_safe(const char *buf_base
, size_t buf_len
, char *ptr
, size_t off
);
1195 char *get_safe_ptr(const char *buf_base
, size_t buf_len
, char *ptr
, size_t off
);
1196 char *get_safe_str_ptr(const char *buf_base
, size_t buf_len
, char *ptr
, size_t off
);
1197 int get_safe_SVAL(const char *buf_base
, size_t buf_len
, char *ptr
, size_t off
, int failval
);
1198 int get_safe_IVAL(const char *buf_base
, size_t buf_len
, char *ptr
, size_t off
, int failval
);
1199 void split_domain_user(TALLOC_CTX
*mem_ctx
,
1200 const char *full_name
,
1203 void *_talloc_zero_zeronull(const void *ctx
, size_t size
, const char *name
);
1204 void *_talloc_memdup_zeronull(const void *t
, const void *p
, size_t size
, const char *name
);
1205 void *_talloc_array_zeronull(const void *ctx
, size_t el_size
, unsigned count
, const char *name
);
1206 void *_talloc_zero_array_zeronull(const void *ctx
, size_t el_size
, unsigned count
, const char *name
);
1207 void *talloc_zeronull(const void *context
, size_t size
, const char *name
);
1208 NTSTATUS
split_ntfs_stream_name(TALLOC_CTX
*mem_ctx
, const char *fname
,
1209 char **pbase
, char **pstream
);
1210 bool is_valid_policy_hnd(const struct policy_handle
*hnd
);
1211 bool policy_hnd_equal(const struct policy_handle
*hnd1
,
1212 const struct policy_handle
*hnd2
);
1213 const char *strip_hostname(const char *s
);
1215 /* The following definitions come from lib/util_file.c */
1217 char **file_lines_pload(const char *syscmd
, int *numlines
);
1218 void file_lines_free(char **lines
);
1220 /* The following definitions come from lib/util_nscd.c */
1222 void smb_nscd_flush_user_cache(void);
1223 void smb_nscd_flush_group_cache(void);
1225 /* The following definitions come from lib/util_nttoken.c */
1227 NT_USER_TOKEN
*dup_nt_token(TALLOC_CTX
*mem_ctx
, const NT_USER_TOKEN
*ptoken
);
1228 NTSTATUS
merge_nt_token(TALLOC_CTX
*mem_ctx
,
1229 const struct nt_user_token
*token_1
,
1230 const struct nt_user_token
*token_2
,
1231 struct nt_user_token
**token_out
);
1232 bool token_sid_in_ace(const NT_USER_TOKEN
*token
, const SEC_ACE
*ace
);
1234 /* The following definitions come from lib/util_pw.c */
1236 struct passwd
*tcopy_passwd(TALLOC_CTX
*mem_ctx
, const struct passwd
*from
) ;
1237 void flush_pwnam_cache(void);
1238 struct passwd
*getpwnam_alloc(TALLOC_CTX
*mem_ctx
, const char *name
);
1239 struct passwd
*getpwuid_alloc(TALLOC_CTX
*mem_ctx
, uid_t uid
) ;
1241 /* The following definitions come from lib/util_reg.c */
1243 const char *reg_type_lookup(enum winreg_Type type
);
1244 WERROR
reg_pull_multi_sz(TALLOC_CTX
*mem_ctx
, const void *buf
, size_t len
,
1245 uint32
*num_values
, char ***values
);
1247 /* The following definitions come from lib/util_reg_api.c */
1249 WERROR
registry_pull_value(TALLOC_CTX
*mem_ctx
,
1250 struct registry_value
**pvalue
,
1251 enum winreg_Type type
, uint8
*data
,
1252 uint32 size
, uint32 length
);
1253 WERROR
registry_push_value(TALLOC_CTX
*mem_ctx
,
1254 const struct registry_value
*value
,
1255 DATA_BLOB
*presult
);
1257 /* The following definitions come from lib/util_seaccess.c */
1259 void se_map_generic(uint32
*access_mask
, const struct generic_mapping
*mapping
);
1260 void security_acl_map_generic(struct security_acl
*sa
, const struct generic_mapping
*mapping
);
1261 void se_map_standard(uint32
*access_mask
, struct standard_mapping
*mapping
);
1262 NTSTATUS
se_access_check(const SEC_DESC
*sd
, const NT_USER_TOKEN
*token
,
1263 uint32 acc_desired
, uint32
*acc_granted
);
1264 NTSTATUS
samr_make_sam_obj_sd(TALLOC_CTX
*ctx
, SEC_DESC
**psd
, size_t *sd_size
);
1266 /* The following definitions come from lib/util_sec.c */
1268 void sec_init(void);
1269 uid_t
sec_initial_uid(void);
1270 gid_t
sec_initial_gid(void);
1271 bool non_root_mode(void);
1272 void gain_root_privilege(void);
1273 void gain_root_group_privilege(void);
1274 void set_effective_uid(uid_t uid
);
1275 void set_effective_gid(gid_t gid
);
1276 void save_re_uid(void);
1277 void restore_re_uid_fromroot(void);
1278 void restore_re_uid(void);
1279 void save_re_gid(void);
1280 void restore_re_gid(void);
1281 int set_re_uid(void);
1282 void become_user_permanently(uid_t uid
, gid_t gid
);
1283 bool is_setuid_root(void) ;
1285 /* The following definitions come from lib/util_sid.c */
1287 const char *sid_type_lookup(uint32 sid_type
) ;
1288 NT_USER_TOKEN
*get_system_token(void) ;
1289 const char *get_global_sam_name(void) ;
1290 char *sid_to_fstring(fstring sidstr_out
, const DOM_SID
*sid
);
1291 char *sid_string_talloc(TALLOC_CTX
*mem_ctx
, const DOM_SID
*sid
);
1292 char *sid_string_dbg(const DOM_SID
*sid
);
1293 char *sid_string_tos(const DOM_SID
*sid
);
1294 bool string_to_sid(DOM_SID
*sidout
, const char *sidstr
);
1295 DOM_SID
*string_sid_talloc(TALLOC_CTX
*mem_ctx
, const char *sidstr
);
1296 bool sid_append_rid(DOM_SID
*sid
, uint32 rid
);
1297 bool sid_compose(DOM_SID
*dst
, const DOM_SID
*domain_sid
, uint32 rid
);
1298 bool sid_split_rid(DOM_SID
*sid
, uint32
*rid
);
1299 bool sid_peek_rid(const DOM_SID
*sid
, uint32
*rid
);
1300 bool sid_peek_check_rid(const DOM_SID
*exp_dom_sid
, const DOM_SID
*sid
, uint32
*rid
);
1301 void sid_copy(DOM_SID
*dst
, const DOM_SID
*src
);
1302 bool sid_linearize(char *outbuf
, size_t len
, const DOM_SID
*sid
);
1303 bool sid_parse(const char *inbuf
, size_t len
, DOM_SID
*sid
);
1304 int sid_compare(const DOM_SID
*sid1
, const DOM_SID
*sid2
);
1305 int sid_compare_domain(const DOM_SID
*sid1
, const DOM_SID
*sid2
);
1306 bool sid_equal(const DOM_SID
*sid1
, const DOM_SID
*sid2
);
1307 bool non_mappable_sid(DOM_SID
*sid
);
1308 char *sid_binstring(const DOM_SID
*sid
);
1309 char *sid_binstring_hex(const DOM_SID
*sid
);
1310 DOM_SID
*sid_dup_talloc(TALLOC_CTX
*ctx
, const DOM_SID
*src
);
1311 NTSTATUS
add_sid_to_array(TALLOC_CTX
*mem_ctx
, const DOM_SID
*sid
,
1312 DOM_SID
**sids
, size_t *num
);
1313 NTSTATUS
add_sid_to_array_unique(TALLOC_CTX
*mem_ctx
, const DOM_SID
*sid
,
1314 DOM_SID
**sids
, size_t *num_sids
);
1315 void del_sid_from_array(const DOM_SID
*sid
, DOM_SID
**sids
, size_t *num
);
1316 bool add_rid_to_array_unique(TALLOC_CTX
*mem_ctx
,
1317 uint32 rid
, uint32
**pp_rids
, size_t *p_num
);
1318 bool is_null_sid(const DOM_SID
*sid
);
1319 bool is_sid_in_token(const NT_USER_TOKEN
*token
, const DOM_SID
*sid
);
1320 NTSTATUS
sid_array_from_info3(TALLOC_CTX
*mem_ctx
,
1321 const struct netr_SamInfo3
*info3
,
1322 DOM_SID
**user_sids
,
1323 size_t *num_user_sids
,
1324 bool include_user_group_rid
,
1325 bool skip_ressource_groups
);
1327 /* The following definitions come from lib/util_sock.c */
1329 bool interpret_string_addr_internal(struct addrinfo
**ppres
,
1330 const char *str
, int flags
);
1331 bool is_broadcast_addr(const struct sockaddr
*pss
);
1332 bool interpret_string_addr(struct sockaddr_storage
*pss
,
1335 bool is_loopback_ip_v4(struct in_addr ip
);
1336 bool is_loopback_addr(const struct sockaddr
*pss
);
1337 bool is_zero_addr(const struct sockaddr
*pss
);
1338 void zero_ip_v4(struct in_addr
*ip
);
1339 void zero_sockaddr(struct sockaddr_storage
*pss
);
1340 void in_addr_to_sockaddr_storage(struct sockaddr_storage
*ss
,
1342 bool same_net(const struct sockaddr
*ip1
,
1343 const struct sockaddr
*ip2
,
1344 const struct sockaddr
*mask
);
1345 bool sockaddr_equal(const struct sockaddr
*ip1
,
1346 const struct sockaddr
*ip2
);
1347 bool is_address_any(const struct sockaddr
*psa
);
1348 uint16_t get_sockaddr_port(const struct sockaddr_storage
*pss
);
1349 char *print_sockaddr(char *dest
,
1351 const struct sockaddr_storage
*psa
);
1352 char *print_canonical_sockaddr(TALLOC_CTX
*ctx
,
1353 const struct sockaddr_storage
*pss
);
1354 void set_sockaddr_port(struct sockaddr
*psa
, uint16_t port
);
1355 const char *client_name(int fd
);
1356 int get_socket_port(int fd
);
1357 const char *client_addr(int fd
, char *addr
, size_t addrlen
);
1358 const char *client_socket_addr(int fd
, char *addr
, size_t addr_len
);
1359 int client_socket_port(int fd
);
1360 void set_smb_read_error(enum smb_read_errors
*pre
,
1361 enum smb_read_errors newerr
);
1362 void cond_set_smb_read_error(enum smb_read_errors
*pre
,
1363 enum smb_read_errors newerr
);
1364 bool is_a_socket(int fd
);
1365 void set_socket_options(int fd
, const char *options
);
1366 ssize_t
read_udp_v4_socket(int fd
,
1369 struct sockaddr_storage
*psa
);
1370 NTSTATUS
read_socket_with_timeout(int fd
, char *buf
,
1371 size_t mincnt
, size_t maxcnt
,
1372 unsigned int time_out
,
1374 NTSTATUS
read_data(int fd
, char *buffer
, size_t N
);
1375 ssize_t
write_data(int fd
, const char *buffer
, size_t N
);
1376 ssize_t
write_data_iov(int fd
, const struct iovec
*orig_iov
, int iovcnt
);
1377 bool send_keepalive(int client
);
1378 NTSTATUS
read_smb_length_return_keepalive(int fd
, char *inbuf
,
1379 unsigned int timeout
,
1381 NTSTATUS
read_smb_length(int fd
, char *inbuf
, unsigned int timeout
,
1383 NTSTATUS
receive_smb_raw(int fd
,
1386 unsigned int timeout
,
1389 int open_socket_in(int type
,
1392 const struct sockaddr_storage
*psock
,
1394 NTSTATUS
open_socket_out(const struct sockaddr_storage
*pss
, uint16_t port
,
1395 int timeout
, int *pfd
);
1396 struct tevent_req
*open_socket_out_send(TALLOC_CTX
*mem_ctx
,
1397 struct event_context
*ev
,
1398 const struct sockaddr_storage
*pss
,
1401 NTSTATUS
open_socket_out_recv(struct tevent_req
*req
, int *pfd
);
1402 struct tevent_req
*open_socket_out_defer_send(TALLOC_CTX
*mem_ctx
,
1403 struct event_context
*ev
,
1404 struct timeval wait_time
,
1405 const struct sockaddr_storage
*pss
,
1408 NTSTATUS
open_socket_out_defer_recv(struct tevent_req
*req
, int *pfd
);
1409 bool open_any_socket_out(struct sockaddr_storage
*addrs
, int num_addrs
,
1410 int timeout
, int *fd_index
, int *fd
);
1411 int open_udp_socket(const char *host
, int port
);
1412 const char *get_peer_name(int fd
, bool force_lookup
);
1413 const char *get_peer_addr(int fd
, char *addr
, size_t addr_len
);
1414 int create_pipe_sock(const char *socket_dir
,
1415 const char *socket_name
,
1417 const char *get_mydnsfullname(void);
1418 bool is_myname_or_ipaddr(const char *s
);
1419 struct tevent_req
*getaddrinfo_send(TALLOC_CTX
*mem_ctx
,
1420 struct tevent_context
*ev
,
1421 struct fncall_context
*ctx
,
1423 const char *service
,
1424 const struct addrinfo
*hints
);
1425 int getaddrinfo_recv(struct tevent_req
*req
, struct addrinfo
**res
);
1427 /* The following definitions come from lib/util_str.c */
1429 bool next_token(const char **ptr
, char *buff
, const char *sep
, size_t bufsize
);
1430 bool next_token_talloc(TALLOC_CTX
*ctx
,
1434 bool next_token_no_ltrim_talloc(TALLOC_CTX
*ctx
,
1438 int StrCaseCmp(const char *s
, const char *t
);
1439 int StrnCaseCmp(const char *s
, const char *t
, size_t len
);
1440 bool strnequal(const char *s1
,const char *s2
,size_t n
);
1441 bool strcsequal(const char *s1
,const char *s2
);
1442 void strnorm(char *s
, int case_default
);
1443 bool strisnormal(const char *s
, int case_default
);
1444 char *push_skip_string(char *buf
);
1445 char *skip_string(const char *base
, size_t len
, char *buf
);
1446 size_t str_charnum(const char *s
);
1447 size_t str_ascii_charnum(const char *s
);
1448 bool trim_char(char *s
,char cfront
,char cback
);
1449 bool strhasupper(const char *s
);
1450 bool strhaslower(const char *s
);
1451 char *safe_strcpy_fn(const char *fn
,
1456 char *safe_strcat_fn(const char *fn
,
1461 char *alpha_strcpy_fn(const char *fn
,
1465 const char *other_safe_chars
,
1467 char *StrnCpy_fn(const char *fn
, int line
,char *dest
,const char *src
,size_t n
);
1468 bool in_list(const char *s
, const char *list
, bool casesensitive
);
1469 void string_free(char **s
);
1470 bool string_set(char **dest
,const char *src
);
1471 void string_sub2(char *s
,const char *pattern
, const char *insert
, size_t len
,
1472 bool remove_unsafe_characters
, bool replace_once
,
1473 bool allow_trailing_dollar
);
1474 void string_sub_once(char *s
, const char *pattern
,
1475 const char *insert
, size_t len
);
1476 void string_sub(char *s
,const char *pattern
, const char *insert
, size_t len
);
1477 void fstring_sub(char *s
,const char *pattern
,const char *insert
);
1478 char *realloc_string_sub2(char *string
,
1479 const char *pattern
,
1481 bool remove_unsafe_characters
,
1482 bool allow_trailing_dollar
);
1483 char *realloc_string_sub(char *string
,
1484 const char *pattern
,
1485 const char *insert
);
1486 char *talloc_string_sub2(TALLOC_CTX
*mem_ctx
, const char *src
,
1487 const char *pattern
,
1489 bool remove_unsafe_characters
,
1491 bool allow_trailing_dollar
);
1492 char *talloc_string_sub(TALLOC_CTX
*mem_ctx
,
1494 const char *pattern
,
1495 const char *insert
);
1496 void all_string_sub(char *s
,const char *pattern
,const char *insert
, size_t len
);
1497 char *talloc_all_string_sub(TALLOC_CTX
*ctx
,
1499 const char *pattern
,
1500 const char *insert
);
1501 char *octal_string(int i
);
1502 char *string_truncate(char *s
, unsigned int length
);
1503 char *strchr_m(const char *src
, char c
);
1504 char *strrchr_m(const char *s
, char c
);
1505 char *strnrchr_m(const char *s
, char c
, unsigned int n
);
1506 char *strstr_m(const char *src
, const char *findstr
);
1507 void strlower_m(char *s
);
1508 void strupper_m(char *s
);
1509 size_t strlen_m(const char *s
);
1510 size_t strlen_m_term(const char *s
);
1511 size_t strlen_m_term_null(const char *s
);
1512 char *binary_string_rfc2254(char *buf
, int len
);
1513 char *binary_string(char *buf
, int len
);
1514 int fstr_sprintf(fstring s
, const char *fmt
, ...);
1515 bool str_list_sub_basic( char **list
, const char *smb_name
,
1516 const char *domain_name
);
1517 bool str_list_substitute(char **list
, const char *pattern
, const char *insert
);
1518 bool str_list_check(const char **list
, const char *s
);
1519 bool str_list_check_ci(const char **list
, const char *s
);
1521 char *ipstr_list_make(char **ipstr_list
,
1522 const struct ip_service
*ip_list
,
1524 int ipstr_list_parse(const char *ipstr_list
, struct ip_service
**ip_list
);
1525 void ipstr_list_free(char* ipstr_list
);
1526 void rfc1738_unescape(char *buf
);
1527 DATA_BLOB
base64_decode_data_blob(const char *s
);
1528 void base64_decode_inplace(char *s
);
1529 char *base64_encode_data_blob(TALLOC_CTX
*mem_ctx
, DATA_BLOB data
);
1530 uint64_t STR_TO_SMB_BIG_UINT(const char *nptr
, const char **entptr
);
1531 SMB_OFF_T
conv_str_size(const char * str
);
1532 void string_append(char **left
, const char *right
);
1533 bool add_string_to_array(TALLOC_CTX
*mem_ctx
,
1534 const char *str
, const char ***strings
,
1536 void sprintf_append(TALLOC_CTX
*mem_ctx
, char **string
, ssize_t
*len
,
1537 size_t *bufsize
, const char *fmt
, ...);
1538 int asprintf_strupper_m(char **strp
, const char *fmt
, ...);
1539 char *talloc_asprintf_strupper_m(TALLOC_CTX
*t
, const char *fmt
, ...);
1540 char *talloc_asprintf_strlower_m(TALLOC_CTX
*t
, const char *fmt
, ...);
1541 char *sstring_sub(const char *src
, char front
, char back
);
1542 bool validate_net_name( const char *name
,
1543 const char *invalid_chars
,
1545 char *escape_shell_string(const char *src
);
1546 char **str_list_make_v3(TALLOC_CTX
*mem_ctx
, const char *string
, const char *sep
);
1548 /* The following definitions come from lib/util_unistr.c */
1550 void gfree_case_tables(void);
1551 void load_case_tables(void);
1552 void init_valid_table(void);
1553 size_t dos_PutUniCode(char *dst
,const char *src
, size_t len
, bool null_terminate
);
1554 char *skip_unibuf(char *src
, size_t len
);
1555 int rpcstr_pull(char* dest
, void *src
, int dest_len
, int src_len
, int flags
);
1556 int rpcstr_pull_talloc(TALLOC_CTX
*ctx
,
1561 int rpcstr_push(void *dest
, const char *src
, size_t dest_len
, int flags
);
1562 int rpcstr_push_talloc(TALLOC_CTX
*ctx
, smb_ucs2_t
**dest
, const char *src
);
1563 smb_ucs2_t
toupper_w(smb_ucs2_t val
);
1564 smb_ucs2_t
tolower_w( smb_ucs2_t val
);
1565 bool islower_w(smb_ucs2_t c
);
1566 bool isupper_w(smb_ucs2_t c
);
1567 bool isvalid83_w(smb_ucs2_t c
);
1568 size_t strlen_w(const smb_ucs2_t
*src
);
1569 size_t strnlen_w(const smb_ucs2_t
*src
, size_t max
);
1570 smb_ucs2_t
*strchr_w(const smb_ucs2_t
*s
, smb_ucs2_t c
);
1571 smb_ucs2_t
*strchr_wa(const smb_ucs2_t
*s
, char c
);
1572 smb_ucs2_t
*strrchr_w(const smb_ucs2_t
*s
, smb_ucs2_t c
);
1573 smb_ucs2_t
*strnrchr_w(const smb_ucs2_t
*s
, smb_ucs2_t c
, unsigned int n
);
1574 smb_ucs2_t
*strstr_w(const smb_ucs2_t
*s
, const smb_ucs2_t
*ins
);
1575 bool strlower_w(smb_ucs2_t
*s
);
1576 bool strupper_w(smb_ucs2_t
*s
);
1577 void strnorm_w(smb_ucs2_t
*s
, int case_default
);
1578 int strcmp_w(const smb_ucs2_t
*a
, const smb_ucs2_t
*b
);
1579 int strncmp_w(const smb_ucs2_t
*a
, const smb_ucs2_t
*b
, size_t len
);
1580 int strcasecmp_w(const smb_ucs2_t
*a
, const smb_ucs2_t
*b
);
1581 int strncasecmp_w(const smb_ucs2_t
*a
, const smb_ucs2_t
*b
, size_t len
);
1582 bool strequal_w(const smb_ucs2_t
*s1
, const smb_ucs2_t
*s2
);
1583 bool strnequal_w(const smb_ucs2_t
*s1
,const smb_ucs2_t
*s2
,size_t n
);
1584 smb_ucs2_t
*strdup_w(const smb_ucs2_t
*src
);
1585 smb_ucs2_t
*strndup_w(const smb_ucs2_t
*src
, size_t len
);
1586 smb_ucs2_t
*strncpy_w(smb_ucs2_t
*dest
, const smb_ucs2_t
*src
, const size_t max
);
1587 smb_ucs2_t
*strncat_w(smb_ucs2_t
*dest
, const smb_ucs2_t
*src
, const size_t max
);
1588 smb_ucs2_t
*strcat_w(smb_ucs2_t
*dest
, const smb_ucs2_t
*src
);
1589 void string_replace_w(smb_ucs2_t
*s
, smb_ucs2_t oldc
, smb_ucs2_t newc
);
1590 bool trim_string_w(smb_ucs2_t
*s
, const smb_ucs2_t
*front
,
1591 const smb_ucs2_t
*back
);
1592 int strcmp_wa(const smb_ucs2_t
*a
, const char *b
);
1593 int strncmp_wa(const smb_ucs2_t
*a
, const char *b
, size_t len
);
1594 smb_ucs2_t
*strpbrk_wa(const smb_ucs2_t
*s
, const char *p
);
1595 smb_ucs2_t
*strstr_wa(const smb_ucs2_t
*s
, const char *ins
);
1596 int toupper_ascii(int c
);
1597 int tolower_ascii(int c
);
1598 int isupper_ascii(int c
);
1599 int islower_ascii(int c
);
1601 /* The following definitions come from lib/util_uuid.c */
1603 void smb_uuid_pack(const struct GUID uu
, UUID_FLAT
*ptr
);
1604 void smb_uuid_unpack(const UUID_FLAT in
, struct GUID
*uu
);
1605 char *guid_binstring(const struct GUID
*guid
);
1607 /* The following definitions come from lib/version.c */
1609 const char *samba_version_string(void);
1611 /* The following definitions come from lib/winbind_util.c */
1613 bool winbind_lookup_name(const char *dom_name
, const char *name
, DOM_SID
*sid
,
1614 enum lsa_SidType
*name_type
);
1615 bool winbind_lookup_sid(TALLOC_CTX
*mem_ctx
, const DOM_SID
*sid
,
1616 const char **domain
, const char **name
,
1617 enum lsa_SidType
*name_type
);
1618 bool winbind_ping(void);
1619 bool winbind_sid_to_uid(uid_t
*puid
, const DOM_SID
*sid
);
1620 bool winbind_uid_to_sid(DOM_SID
*sid
, uid_t uid
);
1621 bool winbind_sid_to_gid(gid_t
*pgid
, const DOM_SID
*sid
);
1622 bool winbind_gid_to_sid(DOM_SID
*sid
, gid_t gid
);
1623 struct passwd
* winbind_getpwnam(const char * sname
);
1624 struct passwd
* winbind_getpwsid(const DOM_SID
*sid
);
1625 wbcErr
wb_is_trusted_domain(const char *domain
);
1626 bool winbind_lookup_rids(TALLOC_CTX
*mem_ctx
,
1627 const DOM_SID
*domain_sid
,
1628 int num_rids
, uint32
*rids
,
1629 const char **domain_name
,
1630 const char ***names
, enum lsa_SidType
**types
);
1631 bool winbind_allocate_uid(uid_t
*uid
);
1632 bool winbind_allocate_gid(gid_t
*gid
);
1633 bool winbind_get_groups(TALLOC_CTX
*mem_ctx
,
1634 const char *account
,
1635 uint32_t *num_groups
,
1637 bool winbind_get_sid_aliases(TALLOC_CTX
*mem_ctx
,
1638 const DOM_SID
*dom_sid
,
1639 const DOM_SID
*members
,
1641 uint32_t **pp_alias_rids
,
1642 size_t *p_num_alias_rids
);
1645 /* The following definitions come from lib/wins_srv.c */
1647 bool wins_srv_is_dead(struct in_addr wins_ip
, struct in_addr src_ip
);
1648 void wins_srv_alive(struct in_addr wins_ip
, struct in_addr src_ip
);
1649 void wins_srv_died(struct in_addr wins_ip
, struct in_addr src_ip
);
1650 unsigned wins_srv_count(void);
1651 char **wins_srv_tags(void);
1652 void wins_srv_tags_free(char **list
);
1653 struct in_addr
wins_srv_ip_tag(const char *tag
, struct in_addr src_ip
);
1654 unsigned wins_srv_count_tag(const char *tag
);
1656 /* The following definitions come from libads/ads_status.c */
1658 ADS_STATUS
ads_build_error(enum ads_error_type etype
,
1659 int rc
, int minor_status
);
1660 ADS_STATUS
ads_build_nt_error(enum ads_error_type etype
,
1661 NTSTATUS nt_status
);
1662 NTSTATUS
ads_ntstatus(ADS_STATUS status
);
1663 const char *ads_errstr(ADS_STATUS status
);
1664 NTSTATUS
gss_err_to_ntstatus(uint32 maj
, uint32 min
);
1666 /* The following definitions come from libads/ads_struct.c */
1668 char *ads_build_path(const char *realm
, const char *sep
, const char *field
, int reverse
);
1669 char *ads_build_dn(const char *realm
);
1670 char *ads_build_domain(const char *dn
);
1671 ADS_STRUCT
*ads_init(const char *realm
,
1672 const char *workgroup
,
1673 const char *ldap_server
);
1674 void ads_destroy(ADS_STRUCT
**ads
);
1676 /* The following definitions come from libads/ads_utils.c */
1678 uint32
ads_acb2uf(uint32 acb
);
1679 uint32
ads_uf2acb(uint32 uf
);
1680 uint32
ads_uf2atype(uint32 uf
);
1681 uint32
ads_gtype2atype(uint32 gtype
);
1682 enum lsa_SidType
ads_atype_map(uint32 atype
);
1683 const char *ads_get_ldap_server_name(ADS_STRUCT
*ads
);
1685 /* The following definitions come from libads/authdata.c */
1687 struct PAC_LOGON_INFO
*get_logon_info_from_pac(struct PAC_DATA
*pac_data
);
1688 NTSTATUS
kerberos_return_pac(TALLOC_CTX
*mem_ctx
,
1692 time_t *expire_time
,
1693 time_t *renew_till_time
,
1694 const char *cache_name
,
1696 bool add_netbios_addr
,
1697 time_t renewable_time
,
1698 struct PAC_DATA
**pac_ret
);
1699 NTSTATUS
kerberos_return_info3_from_pac(TALLOC_CTX
*mem_ctx
,
1703 time_t *expire_time
,
1704 time_t *renew_till_time
,
1705 const char *cache_name
,
1707 bool add_netbios_addr
,
1708 time_t renewable_time
,
1709 struct netr_SamInfo3
**info3
);
1711 /* The following definitions come from libads/cldap.c */
1712 bool ads_cldap_netlogon(TALLOC_CTX
*mem_ctx
,
1715 uint32_t nt_version
,
1716 struct netlogon_samlogon_response
**reply
);
1717 bool ads_cldap_netlogon_5(TALLOC_CTX
*mem_ctx
,
1720 struct NETLOGON_SAM_LOGON_RESPONSE_EX
*reply5
);
1722 /* The following definitions come from libads/disp_sec.c */
1724 void ads_disp_sd(ADS_STRUCT
*ads
, TALLOC_CTX
*mem_ctx
, SEC_DESC
*sd
);
1726 /* The following definitions come from libads/dns.c */
1728 NTSTATUS
ads_dns_lookup_ns(TALLOC_CTX
*ctx
,
1729 const char *dnsdomain
,
1730 struct dns_rr_ns
**nslist
,
1732 bool sitename_store(const char *realm
, const char *sitename
);
1733 char *sitename_fetch(const char *realm
);
1734 bool stored_sitename_changed(const char *realm
, const char *sitename
);
1735 NTSTATUS
ads_dns_query_dcs(TALLOC_CTX
*ctx
,
1737 const char *sitename
,
1738 struct dns_rr_srv
**dclist
,
1740 NTSTATUS
ads_dns_query_gcs(TALLOC_CTX
*ctx
,
1742 const char *sitename
,
1743 struct dns_rr_srv
**dclist
,
1745 NTSTATUS
ads_dns_query_kdcs(TALLOC_CTX
*ctx
,
1746 const char *dns_forest_name
,
1747 const char *sitename
,
1748 struct dns_rr_srv
**dclist
,
1750 NTSTATUS
ads_dns_query_pdc(TALLOC_CTX
*ctx
,
1751 const char *dns_domain_name
,
1752 struct dns_rr_srv
**dclist
,
1754 NTSTATUS
ads_dns_query_dcs_guid(TALLOC_CTX
*ctx
,
1755 const char *dns_forest_name
,
1756 const struct GUID
*domain_guid
,
1757 struct dns_rr_srv
**dclist
,
1760 /* The following definitions come from libads/kerberos.c */
1762 int kerberos_kinit_password_ext(const char *principal
,
1763 const char *password
,
1765 time_t *expire_time
,
1766 time_t *renew_till_time
,
1767 const char *cache_name
,
1769 bool add_netbios_addr
,
1770 time_t renewable_time
,
1771 NTSTATUS
*ntstatus
);
1772 int ads_kinit_password(ADS_STRUCT
*ads
);
1773 int ads_kdestroy(const char *cc_name
);
1774 char* kerberos_standard_des_salt( void );
1775 bool kerberos_secrets_store_des_salt( const char* salt
);
1776 char* kerberos_secrets_fetch_des_salt( void );
1777 char *kerberos_get_default_realm_from_ccache( void );
1778 bool kerberos_secrets_store_salting_principal(const char *service
,
1780 const char *principal
);
1781 int kerberos_kinit_password(const char *principal
,
1782 const char *password
,
1784 const char *cache_name
);
1785 bool create_local_private_krb5_conf_for_domain(const char *realm
,
1787 const char *sitename
,
1788 struct sockaddr_storage
*pss
);
1791 /* The following definitions come from libsmb/credentials.c */
1793 char *credstr(const unsigned char *cred
);
1794 void creds_server_init(uint32 neg_flags
,
1796 struct netr_Credential
*clnt_chal
,
1797 struct netr_Credential
*srv_chal
,
1798 const unsigned char mach_pw
[16],
1799 struct netr_Credential
*init_chal_out
);
1800 bool netlogon_creds_server_check(const struct dcinfo
*dc
,
1801 const struct netr_Credential
*rcv_cli_chal_in
);
1802 bool netlogon_creds_server_step(struct dcinfo
*dc
,
1803 const struct netr_Authenticator
*received_cred
,
1804 struct netr_Authenticator
*cred_out
);
1805 void cred_hash3(unsigned char *out
, const unsigned char *in
, const unsigned char *key
, int forw
);
1807 /* The following definitions come from libads/kerberos_keytab.c */
1809 int ads_keytab_add_entry(ADS_STRUCT
*ads
, const char *srvPrinc
);
1810 int ads_keytab_flush(ADS_STRUCT
*ads
);
1811 int ads_keytab_create_default(ADS_STRUCT
*ads
);
1812 int ads_keytab_list(const char *keytab_name
);
1814 /* The following definitions come from libads/kerberos_verify.c */
1816 NTSTATUS
ads_verify_ticket(TALLOC_CTX
*mem_ctx
,
1819 const DATA_BLOB
*ticket
,
1821 struct PAC_DATA
**pac_data
,
1823 DATA_BLOB
*session_key
,
1824 bool use_replay_cache
);
1826 /* The following definitions come from libads/krb5_errs.c */
1829 /* The following definitions come from libads/krb5_setpw.c */
1831 ADS_STATUS
ads_krb5_set_password(const char *kdc_host
, const char *princ
,
1832 const char *newpw
, int time_offset
);
1833 ADS_STATUS
kerberos_set_password(const char *kpasswd_server
,
1834 const char *auth_principal
, const char *auth_password
,
1835 const char *target_principal
, const char *new_password
,
1837 ADS_STATUS
ads_set_machine_password(ADS_STRUCT
*ads
,
1838 const char *machine_account
,
1839 const char *password
);
1841 /* The following definitions come from libads/ldap.c */
1843 bool ads_sitename_match(ADS_STRUCT
*ads
);
1844 bool ads_closest_dc(ADS_STRUCT
*ads
);
1845 ADS_STATUS
ads_connect(ADS_STRUCT
*ads
);
1846 ADS_STATUS
ads_connect_user_creds(ADS_STRUCT
*ads
);
1847 ADS_STATUS
ads_connect_gc(ADS_STRUCT
*ads
);
1848 void ads_disconnect(ADS_STRUCT
*ads
);
1849 ADS_STATUS
ads_do_search_all_fn(ADS_STRUCT
*ads
, const char *bind_path
,
1850 int scope
, const char *expr
, const char **attrs
,
1851 bool (*fn
)(ADS_STRUCT
*, char *, void **, void *),
1853 char *ads_parent_dn(const char *dn
);
1854 ADS_MODLIST
ads_init_mods(TALLOC_CTX
*ctx
);
1855 ADS_STATUS
ads_mod_str(TALLOC_CTX
*ctx
, ADS_MODLIST
*mods
,
1856 const char *name
, const char *val
);
1857 ADS_STATUS
ads_mod_strlist(TALLOC_CTX
*ctx
, ADS_MODLIST
*mods
,
1858 const char *name
, const char **vals
);
1859 ADS_STATUS
ads_gen_mod(ADS_STRUCT
*ads
, const char *mod_dn
, ADS_MODLIST mods
);
1860 ADS_STATUS
ads_gen_add(ADS_STRUCT
*ads
, const char *new_dn
, ADS_MODLIST mods
);
1861 ADS_STATUS
ads_del_dn(ADS_STRUCT
*ads
, char *del_dn
);
1862 char *ads_ou_string(ADS_STRUCT
*ads
, const char *org_unit
);
1863 char *ads_default_ou_string(ADS_STRUCT
*ads
, const char *wknguid
);
1864 ADS_STATUS
ads_add_strlist(TALLOC_CTX
*ctx
, ADS_MODLIST
*mods
,
1865 const char *name
, const char **vals
);
1866 uint32
ads_get_kvno(ADS_STRUCT
*ads
, const char *account_name
);
1867 uint32_t ads_get_machine_kvno(ADS_STRUCT
*ads
, const char *machine_name
);
1868 ADS_STATUS
ads_clear_service_principal_names(ADS_STRUCT
*ads
, const char *machine_name
);
1869 ADS_STATUS
ads_add_service_principal_name(ADS_STRUCT
*ads
, const char *machine_name
,
1870 const char *my_fqdn
, const char *spn
);
1871 ADS_STATUS
ads_create_machine_acct(ADS_STRUCT
*ads
, const char *machine_name
,
1872 const char *org_unit
);
1873 ADS_STATUS
ads_move_machine_acct(ADS_STRUCT
*ads
, const char *machine_name
,
1874 const char *org_unit
, bool *moved
);
1875 int ads_count_replies(ADS_STRUCT
*ads
, void *res
);
1876 ADS_STATUS
ads_USN(ADS_STRUCT
*ads
, uint32
*usn
);
1877 ADS_STATUS
ads_current_time(ADS_STRUCT
*ads
);
1878 ADS_STATUS
ads_domain_func_level(ADS_STRUCT
*ads
, uint32
*val
);
1879 ADS_STATUS
ads_domain_sid(ADS_STRUCT
*ads
, DOM_SID
*sid
);
1880 ADS_STATUS
ads_site_dn(ADS_STRUCT
*ads
, TALLOC_CTX
*mem_ctx
, const char **site_name
);
1881 ADS_STATUS
ads_site_dn_for_machine(ADS_STRUCT
*ads
, TALLOC_CTX
*mem_ctx
, const char *computer_name
, const char **site_dn
);
1882 ADS_STATUS
ads_upn_suffixes(ADS_STRUCT
*ads
, TALLOC_CTX
*mem_ctx
, char ***suffixes
, size_t *num_suffixes
);
1883 ADS_STATUS
ads_get_joinable_ous(ADS_STRUCT
*ads
,
1884 TALLOC_CTX
*mem_ctx
,
1887 ADS_STATUS
ads_get_sid_from_extended_dn(TALLOC_CTX
*mem_ctx
,
1888 const char *extended_dn
,
1889 enum ads_extended_dn_flags flags
,
1891 char* ads_get_dnshostname( ADS_STRUCT
*ads
, TALLOC_CTX
*ctx
, const char *machine_name
);
1892 char* ads_get_upn( ADS_STRUCT
*ads
, TALLOC_CTX
*ctx
, const char *machine_name
);
1893 char* ads_get_samaccountname( ADS_STRUCT
*ads
, TALLOC_CTX
*ctx
, const char *machine_name
);
1894 ADS_STATUS
ads_join_realm(ADS_STRUCT
*ads
, const char *machine_name
,
1895 uint32 account_type
, const char *org_unit
);
1896 ADS_STATUS
ads_leave_realm(ADS_STRUCT
*ads
, const char *hostname
);
1897 ADS_STATUS
ads_find_samaccount(ADS_STRUCT
*ads
,
1898 TALLOC_CTX
*mem_ctx
,
1899 const char *samaccountname
,
1901 const char **dn_ret
);
1902 ADS_STATUS
ads_config_path(ADS_STRUCT
*ads
,
1903 TALLOC_CTX
*mem_ctx
,
1904 char **config_path
);
1905 const char *ads_get_extended_right_name_by_guid(ADS_STRUCT
*ads
,
1906 const char *config_path
,
1907 TALLOC_CTX
*mem_ctx
,
1908 const struct GUID
*rights_guid
);
1909 ADS_STATUS
ads_check_ou_dn(TALLOC_CTX
*mem_ctx
,
1911 const char **account_ou
);
1913 /* The following definitions come from libads/ldap_printer.c */
1915 ADS_STATUS
ads_mod_printer_entry(ADS_STRUCT
*ads
, char *prt_dn
,
1916 TALLOC_CTX
*ctx
, const ADS_MODLIST
*mods
);
1917 ADS_STATUS
ads_add_printer_entry(ADS_STRUCT
*ads
, char *prt_dn
,
1918 TALLOC_CTX
*ctx
, ADS_MODLIST
*mods
);
1919 WERROR
get_remote_printer_publishing_data(struct rpc_pipe_client
*cli
,
1920 TALLOC_CTX
*mem_ctx
,
1922 const char *printer
);
1923 bool get_local_printer_publishing_data(TALLOC_CTX
*mem_ctx
,
1925 NT_PRINTER_DATA
*data
);
1927 /* The following definitions come from libads/ldap_schema.c */
1929 ADS_STATUS
ads_get_attrnames_by_oids(ADS_STRUCT
*ads
, TALLOC_CTX
*mem_ctx
,
1930 const char *schema_path
,
1931 const char **OIDs
, size_t num_OIDs
,
1932 char ***OIDs_out
, char ***names
, size_t *count
);
1933 const char *ads_get_attrname_by_guid(ADS_STRUCT
*ads
,
1934 const char *schema_path
,
1935 TALLOC_CTX
*mem_ctx
,
1936 const struct GUID
*schema_guid
);
1937 const char *ads_get_attrname_by_oid(ADS_STRUCT
*ads
, const char *schema_path
, TALLOC_CTX
*mem_ctx
, const char * OID
);
1938 ADS_STATUS
ads_schema_path(ADS_STRUCT
*ads
, TALLOC_CTX
*mem_ctx
, char **schema_path
);
1939 ADS_STATUS
ads_check_posix_schema_mapping(TALLOC_CTX
*mem_ctx
,
1941 enum wb_posix_mapping map_type
,
1942 struct posix_schema
**s
) ;
1944 /* The following definitions come from libads/ldap_user.c */
1946 ADS_STATUS
ads_add_user_acct(ADS_STRUCT
*ads
, const char *user
,
1947 const char *container
, const char *fullname
);
1948 ADS_STATUS
ads_add_group_acct(ADS_STRUCT
*ads
, const char *group
,
1949 const char *container
, const char *comment
);
1951 /* The following definitions come from libads/ldap_utils.c */
1953 ADS_STATUS
ads_ranged_search(ADS_STRUCT
*ads
,
1954 TALLOC_CTX
*mem_ctx
,
1959 const char *range_attr
,
1961 size_t *num_strings
);
1962 ADS_STATUS
ads_ranged_search_internal(ADS_STRUCT
*ads
,
1963 TALLOC_CTX
*mem_ctx
,
1969 const char *range_attr
,
1971 size_t *num_strings
,
1976 /* The following definitions come from libads/ndr.c */
1978 void ndr_print_ads_auth_flags(struct ndr_print
*ndr
, const char *name
, uint32_t r
);
1979 void ndr_print_ads_struct(struct ndr_print
*ndr
, const char *name
, const struct ads_struct
*r
);
1981 /* The following definitions come from libads/sasl.c */
1983 ADS_STATUS
ads_sasl_bind(ADS_STRUCT
*ads
);
1985 /* The following definitions come from libads/sasl_wrapping.c */
1987 ADS_STATUS
ads_setup_sasl_wrapping(ADS_STRUCT
*ads
,
1988 const struct ads_saslwrap_ops
*ops
,
1989 void *private_data
);
1990 ADS_STATUS
ads_setup_sasl_wrapping(ADS_STRUCT
*ads
,
1991 const struct ads_saslwrap_ops
*ops
,
1992 void *private_data
);
1994 /* The following definitions come from libads/util.c */
1996 ADS_STATUS
ads_change_trust_account_password(ADS_STRUCT
*ads
, char *host_principal
);
1997 ADS_STATUS
ads_guess_service_principal(ADS_STRUCT
*ads
,
1998 char **returned_principal
);
2000 /* The following definitions come from libgpo/gpo_filesync.c */
2002 NTSTATUS
gpo_copy_file(TALLOC_CTX
*mem_ctx
,
2003 struct cli_state
*cli
,
2004 const char *nt_path
,
2005 const char *unix_path
);
2006 NTSTATUS
gpo_sync_directories(TALLOC_CTX
*mem_ctx
,
2007 struct cli_state
*cli
,
2008 const char *nt_path
,
2009 const char *local_path
);
2011 /* The following definitions come from libgpo/gpo_ini.c */
2013 NTSTATUS
parse_gpt_ini(TALLOC_CTX
*mem_ctx
,
2014 const char *filename
,
2016 char **display_name
);
2018 /* The following definitions come from libgpo/gpo_reg.c */
2020 struct nt_user_token
*registry_create_system_token(TALLOC_CTX
*mem_ctx
);
2021 WERROR
gp_init_reg_ctx(TALLOC_CTX
*mem_ctx
,
2022 const char *initial_path
,
2023 uint32_t desired_access
,
2024 const struct nt_user_token
*token
,
2025 struct gp_registry_context
**reg_ctx
);
2026 void gp_free_reg_ctx(struct gp_registry_context
*reg_ctx
);
2027 WERROR
gp_store_reg_subkey(TALLOC_CTX
*mem_ctx
,
2028 const char *subkeyname
,
2029 struct registry_key
*curr_key
,
2030 struct registry_key
**new_key
);
2031 WERROR
gp_read_reg_subkey(TALLOC_CTX
*mem_ctx
,
2032 struct gp_registry_context
*reg_ctx
,
2033 const char *subkeyname
,
2034 struct registry_key
**key
);
2035 WERROR
gp_store_reg_val_sz(TALLOC_CTX
*mem_ctx
,
2036 struct registry_key
*key
,
2037 const char *val_name
,
2039 WERROR
gp_read_reg_val_sz(TALLOC_CTX
*mem_ctx
,
2040 struct registry_key
*key
,
2041 const char *val_name
,
2043 WERROR
gp_reg_state_store(TALLOC_CTX
*mem_ctx
,
2046 const struct nt_user_token
*token
,
2047 struct GROUP_POLICY_OBJECT
*gpo_list
);
2048 WERROR
gp_reg_state_read(TALLOC_CTX
*mem_ctx
,
2051 struct GROUP_POLICY_OBJECT
**gpo_list
);
2052 WERROR
gp_secure_key(TALLOC_CTX
*mem_ctx
,
2054 struct registry_key
*key
,
2055 const DOM_SID
*sid
);
2056 void dump_reg_val(int lvl
, const char *direction
,
2057 const char *key
, const char *subkey
,
2058 struct registry_value
*val
);
2059 void dump_reg_entry(uint32_t flags
,
2061 struct gp_registry_entry
*entry
);
2062 void dump_reg_entries(uint32_t flags
,
2064 struct gp_registry_entry
*entries
,
2065 size_t num_entries
);
2066 bool add_gp_registry_entry_to_array(TALLOC_CTX
*mem_ctx
,
2067 struct gp_registry_entry
*entry
,
2068 struct gp_registry_entry
**entries
,
2070 WERROR
reg_apply_registry_entry(TALLOC_CTX
*mem_ctx
,
2071 struct registry_key
*root_key
,
2072 struct gp_registry_context
*reg_ctx
,
2073 struct gp_registry_entry
*entry
,
2074 const struct nt_user_token
*token
,
2078 #include "librpc/gen_ndr/ndr_dfs.h"
2079 #include "librpc/gen_ndr/ndr_dssetup.h"
2080 #include "librpc/gen_ndr/ndr_echo.h"
2081 #include "librpc/gen_ndr/ndr_eventlog.h"
2082 #include "librpc/gen_ndr/ndr_krb5pac.h"
2083 #include "librpc/gen_ndr/ndr_lsa.h"
2084 #include "librpc/gen_ndr/ndr_misc.h"
2085 #include "librpc/gen_ndr/ndr_netlogon.h"
2086 #include "librpc/gen_ndr/ndr_notify.h"
2087 #include "librpc/gen_ndr/ndr_ntsvcs.h"
2088 #include "librpc/gen_ndr/ndr_samr.h"
2089 #include "librpc/gen_ndr/ndr_security.h"
2090 #include "librpc/gen_ndr/ndr_srvsvc.h"
2091 #include "librpc/gen_ndr/ndr_svcctl.h"
2092 #include "librpc/gen_ndr/ndr_winreg.h"
2093 #include "librpc/gen_ndr/ndr_wkssvc.h"
2095 #include "librpc/gen_ndr/srv_dfs.h"
2096 #include "librpc/gen_ndr/srv_dssetup.h"
2097 #include "librpc/gen_ndr/srv_echo.h"
2098 #include "librpc/gen_ndr/srv_eventlog.h"
2099 #include "librpc/gen_ndr/srv_initshutdown.h"
2100 #include "librpc/gen_ndr/srv_lsa.h"
2101 #include "librpc/gen_ndr/srv_netlogon.h"
2102 #include "librpc/gen_ndr/srv_ntsvcs.h"
2103 #include "librpc/gen_ndr/srv_samr.h"
2104 #include "librpc/gen_ndr/srv_srvsvc.h"
2105 #include "librpc/gen_ndr/srv_svcctl.h"
2106 #include "librpc/gen_ndr/srv_winreg.h"
2107 #include "librpc/gen_ndr/srv_wkssvc.h"
2108 #include "librpc/gen_ndr/srv_spoolss.h"
2110 #include "librpc/ndr/libndr.h"
2112 /* The following definitions come from librpc/ndr/util.c */
2114 enum ndr_err_code
ndr_push_server_id(struct ndr_push
*ndr
, int ndr_flags
, const struct server_id
*r
);
2115 enum ndr_err_code
ndr_pull_server_id(struct ndr_pull
*ndr
, int ndr_flags
, struct server_id
*r
);
2116 void ndr_print_server_id(struct ndr_print
*ndr
, const char *name
, const struct server_id
*r
);
2117 enum ndr_err_code
ndr_push_file_id(struct ndr_push
*ndr
, int ndr_flags
, const struct file_id
*r
);
2118 enum ndr_err_code
ndr_pull_file_id(struct ndr_pull
*ndr
, int ndr_flags
, struct file_id
*r
);
2119 void ndr_print_file_id(struct ndr_print
*ndr
, const char *name
, const struct file_id
*r
);
2120 _PUBLIC_
void ndr_print_bool(struct ndr_print
*ndr
, const char *name
, const bool b
);
2121 _PUBLIC_
void ndr_print_sockaddr_storage(struct ndr_print
*ndr
, const char *name
, const struct sockaddr_storage
*ss
);
2122 const char *ndr_errstr(enum ndr_err_code err
);
2124 /* The following definitions come from librpc/ndr/sid.c */
2126 char *dom_sid_string(TALLOC_CTX
*mem_ctx
, const struct dom_sid
*sid
);
2128 /* The following definitions come from librpc/rpc/binding.c */
2130 const char *epm_floor_string(TALLOC_CTX
*mem_ctx
, struct epm_floor
*epm_floor
);
2131 _PUBLIC_
char *dcerpc_binding_string(TALLOC_CTX
*mem_ctx
, const struct dcerpc_binding
*b
);
2132 _PUBLIC_ NTSTATUS
dcerpc_parse_binding(TALLOC_CTX
*mem_ctx
, const char *s
, struct dcerpc_binding
**b_out
);
2133 _PUBLIC_ NTSTATUS
dcerpc_floor_get_lhs_data(const struct epm_floor
*epm_floor
,
2134 struct ndr_syntax_id
*syntax
);
2135 const char *dcerpc_floor_get_rhs_data(TALLOC_CTX
*mem_ctx
, struct epm_floor
*epm_floor
);
2136 enum dcerpc_transport_t
dcerpc_transport_by_endpoint_protocol(int prot
);
2137 _PUBLIC_
enum dcerpc_transport_t
dcerpc_transport_by_tower(const struct epm_tower
*tower
);
2138 _PUBLIC_
const char *derpc_transport_string_by_transport(enum dcerpc_transport_t t
);
2139 _PUBLIC_ NTSTATUS
dcerpc_binding_from_tower(TALLOC_CTX
*mem_ctx
,
2140 struct epm_tower
*tower
,
2141 struct dcerpc_binding
**b_out
);
2142 _PUBLIC_ NTSTATUS
dcerpc_binding_build_tower(TALLOC_CTX
*mem_ctx
,
2143 const struct dcerpc_binding
*binding
,
2144 struct epm_tower
*tower
);
2146 /* The following definitions come from librpc/rpc/dcerpc.c */
2148 struct rpc_request
*dcerpc_ndr_request_send(struct dcerpc_pipe
*p
, const struct GUID
*object
,
2149 const struct ndr_interface_table
*table
, uint32_t opnum
,
2150 TALLOC_CTX
*mem_ctx
, void *r
);
2151 NTSTATUS
dcerpc_ndr_request_recv(struct rpc_request
*req
);
2152 _PUBLIC_ NTSTATUS
dcerpc_pipe_connect(TALLOC_CTX
*parent_ctx
, struct dcerpc_pipe
**pp
,
2153 const char *binding_string
, const struct ndr_interface_table
*table
,
2154 struct cli_credentials
*credentials
, struct event_context
*ev
,
2155 struct loadparm_context
*lp_ctx
);
2157 /* The following definitions come from libsmb/cliconnect.c */
2159 ADS_STATUS
cli_session_setup_spnego(struct cli_state
*cli
, const char *user
,
2160 const char *pass
, const char *user_domain
,
2161 const char * dest_realm
);
2163 NTSTATUS
cli_session_setup(struct cli_state
*cli
,
2165 const char *pass
, int passlen
,
2166 const char *ntpass
, int ntpasslen
,
2167 const char *workgroup
);
2168 struct tevent_req
*cli_session_setup_guest_create(TALLOC_CTX
*mem_ctx
,
2169 struct event_context
*ev
,
2170 struct cli_state
*cli
,
2171 struct tevent_req
**psmbreq
);
2172 struct tevent_req
*cli_session_setup_guest_send(TALLOC_CTX
*mem_ctx
,
2173 struct event_context
*ev
,
2174 struct cli_state
*cli
);
2175 NTSTATUS
cli_session_setup_guest_recv(struct tevent_req
*req
);
2176 bool cli_ulogoff(struct cli_state
*cli
);
2177 struct tevent_req
*cli_tcon_andx_create(TALLOC_CTX
*mem_ctx
,
2178 struct event_context
*ev
,
2179 struct cli_state
*cli
,
2180 const char *share
, const char *dev
,
2181 const char *pass
, int passlen
,
2182 struct tevent_req
**psmbreq
);
2183 struct tevent_req
*cli_tcon_andx_send(TALLOC_CTX
*mem_ctx
,
2184 struct event_context
*ev
,
2185 struct cli_state
*cli
,
2186 const char *share
, const char *dev
,
2187 const char *pass
, int passlen
);
2188 NTSTATUS
cli_tcon_andx_recv(struct tevent_req
*req
);
2189 NTSTATUS
cli_tcon_andx(struct cli_state
*cli
, const char *share
,
2190 const char *dev
, const char *pass
, int passlen
);
2191 bool cli_tdis(struct cli_state
*cli
);
2192 void cli_negprot_sendsync(struct cli_state
*cli
);
2193 NTSTATUS
cli_negprot(struct cli_state
*cli
);
2194 struct tevent_req
*cli_negprot_send(TALLOC_CTX
*mem_ctx
,
2195 struct event_context
*ev
,
2196 struct cli_state
*cli
);
2197 NTSTATUS
cli_negprot_recv(struct tevent_req
*req
);
2198 bool cli_session_request(struct cli_state
*cli
,
2199 struct nmb_name
*calling
, struct nmb_name
*called
);
2200 NTSTATUS
cli_connect(struct cli_state
*cli
,
2202 struct sockaddr_storage
*dest_ss
);
2203 NTSTATUS
cli_start_connection(struct cli_state
**output_cli
,
2204 const char *my_name
,
2205 const char *dest_host
,
2206 struct sockaddr_storage
*dest_ss
, int port
,
2207 int signing_state
, int flags
,
2209 NTSTATUS
cli_full_connection(struct cli_state
**output_cli
,
2210 const char *my_name
,
2211 const char *dest_host
,
2212 struct sockaddr_storage
*dest_ss
, int port
,
2213 const char *service
, const char *service_type
,
2214 const char *user
, const char *domain
,
2215 const char *password
, int flags
,
2218 bool attempt_netbios_session_request(struct cli_state
**ppcli
, const char *srchost
, const char *desthost
,
2219 struct sockaddr_storage
*pdest_ss
);
2220 NTSTATUS
cli_raw_tcon(struct cli_state
*cli
,
2221 const char *service
, const char *pass
, const char *dev
,
2222 uint16
*max_xmit
, uint16
*tid
);
2223 struct cli_state
*get_ipc_connect(char *server
,
2224 struct sockaddr_storage
*server_ss
,
2225 const struct user_auth_info
*user_info
);
2226 struct cli_state
*get_ipc_connect_master_ip(TALLOC_CTX
*ctx
,
2227 struct ip_service
*mb_ip
,
2228 const struct user_auth_info
*user_info
,
2229 char **pp_workgroup_out
);
2230 struct cli_state
*get_ipc_connect_master_ip_bcast(TALLOC_CTX
*ctx
,
2231 const struct user_auth_info
*user_info
,
2232 char **pp_workgroup_out
);
2234 /* The following definitions come from libsmb/clidfs.c */
2236 NTSTATUS
cli_cm_force_encryption(struct cli_state
*c
,
2237 const char *username
,
2238 const char *password
,
2240 const char *sharename
);
2241 struct cli_state
*cli_cm_open(TALLOC_CTX
*ctx
,
2242 struct cli_state
*referring_cli
,
2245 const struct user_auth_info
*auth_info
,
2251 void cli_cm_display(const struct cli_state
*c
);
2252 bool cli_dfs_get_referral(TALLOC_CTX
*ctx
,
2253 struct cli_state
*cli
,
2255 CLIENT_DFS_REFERRAL
**refs
,
2258 bool cli_resolve_path(TALLOC_CTX
*ctx
,
2259 const char *mountpt
,
2260 const struct user_auth_info
*dfs_auth_info
,
2261 struct cli_state
*rootcli
,
2263 struct cli_state
**targetcli
,
2264 char **pp_targetpath
);
2266 /* The following definitions come from libsmb/clidgram.c */
2268 bool cli_send_mailslot(struct messaging_context
*msg_ctx
,
2269 bool unique
, const char *mailslot
,
2272 const char *srcname
, int src_type
,
2273 const char *dstname
, int dest_type
,
2274 const struct sockaddr_storage
*dest_ss
);
2275 bool send_getdc_request(TALLOC_CTX
*mem_ctx
,
2276 struct messaging_context
*msg_ctx
,
2277 struct sockaddr_storage
*dc_ss
,
2278 const char *domain_name
,
2280 uint32_t nt_version
);
2281 bool receive_getdc_response(TALLOC_CTX
*mem_ctx
,
2282 struct sockaddr_storage
*dc_ss
,
2283 const char *domain_name
,
2284 uint32_t *nt_version
,
2285 const char **dc_name
,
2286 struct netlogon_samlogon_response
**reply
);
2288 /* The following definitions come from libsmb/clientgen.c */
2290 int cli_set_message(char *buf
,int num_words
,int num_bytes
,bool zero
);
2291 unsigned int cli_set_timeout(struct cli_state
*cli
, unsigned int timeout
);
2292 void cli_set_port(struct cli_state
*cli
, int port
);
2293 bool cli_state_seqnum_persistent(struct cli_state
*cli
,
2295 bool cli_state_seqnum_remove(struct cli_state
*cli
,
2297 bool cli_receive_smb(struct cli_state
*cli
);
2298 ssize_t
cli_receive_smb_data(struct cli_state
*cli
, char *buffer
, size_t len
);
2299 bool cli_receive_smb_readX_header(struct cli_state
*cli
);
2300 bool cli_send_smb(struct cli_state
*cli
);
2301 bool cli_send_smb_direct_writeX(struct cli_state
*cli
,
2304 void cli_setup_packet_buf(struct cli_state
*cli
, char *buf
);
2305 void cli_setup_packet(struct cli_state
*cli
);
2306 void cli_setup_bcc(struct cli_state
*cli
, void *p
);
2307 NTSTATUS
cli_set_domain(struct cli_state
*cli
, const char *domain
);
2308 NTSTATUS
cli_set_username(struct cli_state
*cli
, const char *username
);
2309 NTSTATUS
cli_set_password(struct cli_state
*cli
, const char *password
);
2310 NTSTATUS
cli_init_creds(struct cli_state
*cli
, const char *username
, const char *domain
, const char *password
);
2311 struct cli_state
*cli_initialise(void);
2312 struct cli_state
*cli_initialise_ex(int signing_state
);
2313 void cli_nt_pipes_close(struct cli_state
*cli
);
2314 void cli_shutdown(struct cli_state
*cli
);
2315 void cli_sockopt(struct cli_state
*cli
, const char *options
);
2316 uint16
cli_setpid(struct cli_state
*cli
, uint16 pid
);
2317 bool cli_set_case_sensitive(struct cli_state
*cli
, bool case_sensitive
);
2318 bool cli_send_keepalive(struct cli_state
*cli
);
2319 struct tevent_req
*cli_echo_send(TALLOC_CTX
*mem_ctx
, struct event_context
*ev
,
2320 struct cli_state
*cli
, uint16_t num_echos
,
2322 NTSTATUS
cli_echo_recv(struct tevent_req
*req
);
2323 NTSTATUS
cli_echo(struct cli_state
*cli
, uint16_t num_echos
, DATA_BLOB data
);
2324 bool cli_ucs2(struct cli_state
*cli
);
2325 bool is_andx_req(uint8_t cmd
);
2327 /* The following definitions come from libsmb/clierror.c */
2329 const char *cli_errstr(struct cli_state
*cli
);
2330 NTSTATUS
cli_nt_error(struct cli_state
*cli
);
2331 void cli_dos_error(struct cli_state
*cli
, uint8
*eclass
, uint32
*ecode
);
2332 int cli_errno(struct cli_state
*cli
);
2333 bool cli_is_error(struct cli_state
*cli
);
2334 bool cli_is_nt_error(struct cli_state
*cli
);
2335 bool cli_is_dos_error(struct cli_state
*cli
);
2336 NTSTATUS
cli_get_nt_error(struct cli_state
*cli
);
2337 void cli_set_nt_error(struct cli_state
*cli
, NTSTATUS status
);
2338 void cli_reset_error(struct cli_state
*cli
);
2340 /* The following definitions come from libsmb/clifile.c */
2342 uint32_t unix_perms_to_wire(mode_t perms
);
2343 mode_t
wire_perms_to_unix(uint32_t perms
);
2344 bool cli_unix_getfacl(struct cli_state
*cli
, const char *name
, size_t *prb_size
, char **retbuf
);
2345 bool cli_unix_stat(struct cli_state
*cli
, const char *name
, SMB_STRUCT_STAT
*sbuf
);
2346 bool cli_unix_symlink(struct cli_state
*cli
, const char *oldname
, const char *newname
);
2347 bool cli_unix_hardlink(struct cli_state
*cli
, const char *oldname
, const char *newname
);
2348 bool cli_unix_chmod(struct cli_state
*cli
, const char *fname
, mode_t mode
);
2349 bool cli_unix_chown(struct cli_state
*cli
, const char *fname
, uid_t uid
, gid_t gid
);
2350 struct tevent_req
*cli_rename_send(TALLOC_CTX
*mem_ctx
,
2351 struct event_context
*ev
,
2352 struct cli_state
*cli
,
2353 const char *fname_src
,
2354 const char *fname_dst
);
2355 NTSTATUS
cli_rename_recv(struct tevent_req
*req
);
2356 NTSTATUS
cli_rename(struct cli_state
*cli
, const char *fname_src
, const char *fname_dst
);
2357 struct tevent_req
*cli_ntrename_send(TALLOC_CTX
*mem_ctx
,
2358 struct event_context
*ev
,
2359 struct cli_state
*cli
,
2360 const char *fname_src
,
2361 const char *fname_dst
);
2362 NTSTATUS
cli_ntrename_recv(struct tevent_req
*req
);
2363 NTSTATUS
cli_ntrename(struct cli_state
*cli
, const char *fname_src
, const char *fname_dst
);
2365 struct tevent_req
*cli_nt_hardlink_send(TALLOC_CTX
*mem_ctx
,
2366 struct event_context
*ev
,
2367 struct cli_state
*cli
,
2368 const char *fname_src
,
2369 const char *fname_dst
);
2370 NTSTATUS
cli_nt_hardlink_recv(struct tevent_req
*req
);
2371 NTSTATUS
cli_nt_hardlink(struct cli_state
*cli
, const char *fname_src
, const char *fname_dst
);
2373 struct tevent_req
*cli_unlink_send(TALLOC_CTX
*mem_ctx
,
2374 struct event_context
*ev
,
2375 struct cli_state
*cli
,
2377 uint16_t mayhave_attrs
);
2378 NTSTATUS
cli_unlink_recv(struct tevent_req
*req
);
2379 NTSTATUS
cli_unlink(struct cli_state
*cli
, const char *fname
, uint16_t mayhave_attrs
);
2381 struct tevent_req
*cli_mkdir_send(TALLOC_CTX
*mem_ctx
,
2382 struct event_context
*ev
,
2383 struct cli_state
*cli
,
2385 NTSTATUS
cli_mkdir_recv(struct tevent_req
*req
);
2386 NTSTATUS
cli_mkdir(struct cli_state
*cli
, const char *dname
);
2387 struct tevent_req
*cli_rmdir_send(TALLOC_CTX
*mem_ctx
,
2388 struct event_context
*ev
,
2389 struct cli_state
*cli
,
2391 NTSTATUS
cli_rmdir_recv(struct tevent_req
*req
);
2392 NTSTATUS
cli_rmdir(struct cli_state
*cli
, const char *dname
);
2393 int cli_nt_delete_on_close(struct cli_state
*cli
, uint16_t fnum
, bool flag
);
2394 struct tevent_req
*cli_ntcreate_send(TALLOC_CTX
*mem_ctx
,
2395 struct event_context
*ev
,
2396 struct cli_state
*cli
,
2398 uint32_t CreatFlags
,
2399 uint32_t DesiredAccess
,
2400 uint32_t FileAttributes
,
2401 uint32_t ShareAccess
,
2402 uint32_t CreateDisposition
,
2403 uint32_t CreateOptions
,
2404 uint8_t SecurityFlags
);
2405 NTSTATUS
cli_ntcreate_recv(struct tevent_req
*req
, uint16_t *pfnum
);
2406 NTSTATUS
cli_ntcreate(struct cli_state
*cli
,
2408 uint32_t CreatFlags
,
2409 uint32_t DesiredAccess
,
2410 uint32_t FileAttributes
,
2411 uint32_t ShareAccess
,
2412 uint32_t CreateDisposition
,
2413 uint32_t CreateOptions
,
2414 uint8_t SecurityFlags
,
2416 uint8_t *smb_bytes_push_str(uint8_t *buf
, bool ucs2
, const char *str
,
2417 size_t str_len
, size_t *pconverted_size
);
2418 struct tevent_req
*cli_open_create(TALLOC_CTX
*mem_ctx
,
2419 struct event_context
*ev
,
2420 struct cli_state
*cli
, const char *fname
,
2421 int flags
, int share_mode
,
2422 struct tevent_req
**psmbreq
);
2423 struct tevent_req
*cli_open_send(TALLOC_CTX
*mem_ctx
, struct event_context
*ev
,
2424 struct cli_state
*cli
, const char *fname
,
2425 int flags
, int share_mode
);
2426 NTSTATUS
cli_open_recv(struct tevent_req
*req
, uint16_t *fnum
);
2427 NTSTATUS
cli_open(struct cli_state
*cli
, const char *fname
, int flags
, int share_mode
, uint16_t *pfnum
);
2428 struct tevent_req
*cli_close_create(TALLOC_CTX
*mem_ctx
,
2429 struct event_context
*ev
,
2430 struct cli_state
*cli
, uint16_t fnum
,
2431 struct tevent_req
**psubreq
);
2432 struct tevent_req
*cli_close_send(TALLOC_CTX
*mem_ctx
,
2433 struct event_context
*ev
,
2434 struct cli_state
*cli
, uint16_t fnum
);
2435 NTSTATUS
cli_close_recv(struct tevent_req
*req
);
2436 NTSTATUS
cli_close(struct cli_state
*cli
, uint16_t fnum
);
2437 bool cli_ftruncate(struct cli_state
*cli
, uint16_t fnum
, uint64_t size
);
2438 NTSTATUS
cli_locktype(struct cli_state
*cli
, uint16_t fnum
,
2439 uint32_t offset
, uint32_t len
,
2440 int timeout
, unsigned char locktype
);
2441 bool cli_lock(struct cli_state
*cli
, uint16_t fnum
,
2442 uint32_t offset
, uint32_t len
, int timeout
, enum brl_type lock_type
);
2443 bool cli_unlock(struct cli_state
*cli
, uint16_t fnum
, uint32_t offset
, uint32_t len
);
2444 bool cli_lock64(struct cli_state
*cli
, uint16_t fnum
,
2445 uint64_t offset
, uint64_t len
, int timeout
, enum brl_type lock_type
);
2446 bool cli_unlock64(struct cli_state
*cli
, uint16_t fnum
, uint64_t offset
, uint64_t len
);
2447 bool cli_posix_lock(struct cli_state
*cli
, uint16_t fnum
,
2448 uint64_t offset
, uint64_t len
,
2449 bool wait_lock
, enum brl_type lock_type
);
2450 bool cli_posix_unlock(struct cli_state
*cli
, uint16_t fnum
, uint64_t offset
, uint64_t len
);
2451 bool cli_posix_getlock(struct cli_state
*cli
, uint16_t fnum
, uint64_t *poffset
, uint64_t *plen
);
2452 struct tevent_req
*cli_getattrE_send(TALLOC_CTX
*mem_ctx
,
2453 struct event_context
*ev
,
2454 struct cli_state
*cli
,
2456 NTSTATUS
cli_getattrE_recv(struct tevent_req
*req
,
2459 time_t *change_time
,
2460 time_t *access_time
,
2461 time_t *write_time
);
2462 NTSTATUS
cli_getattrE(struct cli_state
*cli
,
2466 time_t *change_time
,
2467 time_t *access_time
,
2468 time_t *write_time
);
2469 struct tevent_req
*cli_setattrE_send(TALLOC_CTX
*mem_ctx
,
2470 struct event_context
*ev
,
2471 struct cli_state
*cli
,
2476 NTSTATUS
cli_setattrE_recv(struct tevent_req
*req
);
2477 NTSTATUS
cli_setattrE(struct cli_state
*cli
,
2482 struct tevent_req
*cli_getatr_send(TALLOC_CTX
*mem_ctx
,
2483 struct event_context
*ev
,
2484 struct cli_state
*cli
,
2486 NTSTATUS
cli_getatr_recv(struct tevent_req
*req
,
2489 time_t *write_time
);
2490 NTSTATUS
cli_getatr(struct cli_state
*cli
,
2494 time_t *write_time
);
2495 struct tevent_req
*cli_setatr_send(TALLOC_CTX
*mem_ctx
,
2496 struct event_context
*ev
,
2497 struct cli_state
*cli
,
2501 NTSTATUS
cli_setatr_recv(struct tevent_req
*req
);
2502 NTSTATUS
cli_setatr(struct cli_state
*cli
,
2506 struct tevent_req
*cli_chkpath_send(TALLOC_CTX
*mem_ctx
,
2507 struct event_context
*ev
,
2508 struct cli_state
*cli
,
2510 NTSTATUS
cli_chkpath_recv(struct tevent_req
*req
);
2511 NTSTATUS
cli_chkpath(struct cli_state
*cli
, const char *path
);
2512 struct tevent_req
*cli_dskattr_send(TALLOC_CTX
*mem_ctx
,
2513 struct event_context
*ev
,
2514 struct cli_state
*cli
);
2515 NTSTATUS
cli_dskattr_recv(struct tevent_req
*req
, int *bsize
, int *total
,
2517 NTSTATUS
cli_dskattr(struct cli_state
*cli
, int *bsize
, int *total
, int *avail
);
2518 int cli_ctemp(struct cli_state
*cli
, const char *path
, char **tmp_path
);
2519 NTSTATUS
cli_raw_ioctl(struct cli_state
*cli
, uint16_t fnum
, uint32_t code
, DATA_BLOB
*blob
);
2520 bool cli_set_ea_path(struct cli_state
*cli
, const char *path
, const char *ea_name
, const char *ea_val
, size_t ea_len
);
2521 bool cli_set_ea_fnum(struct cli_state
*cli
, uint16_t fnum
, const char *ea_name
, const char *ea_val
, size_t ea_len
);
2522 bool cli_get_ea_list_path(struct cli_state
*cli
, const char *path
,
2525 struct ea_struct
**pea_list
);
2526 bool cli_get_ea_list_fnum(struct cli_state
*cli
, uint16_t fnum
,
2529 struct ea_struct
**pea_list
);
2530 int cli_posix_open(struct cli_state
*cli
, const char *fname
, int flags
, mode_t mode
);
2531 int cli_posix_mkdir(struct cli_state
*cli
, const char *fname
, mode_t mode
);
2533 struct tevent_req
*cli_posix_unlink_send(TALLOC_CTX
*mem_ctx
,
2534 struct event_context
*ev
,
2535 struct cli_state
*cli
,
2537 NTSTATUS
cli_posix_unlink_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
2538 NTSTATUS
cli_posix_unlink(struct cli_state
*cli
, const char *fname
);
2540 struct tevent_req
*cli_posix_rmdir_send(TALLOC_CTX
*mem_ctx
,
2541 struct event_context
*ev
,
2542 struct cli_state
*cli
,
2544 NTSTATUS
cli_posix_rmdir_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
2545 NTSTATUS
cli_posix_rmdir(struct cli_state
*cli
, const char *fname
);
2547 /* The following definitions come from libsmb/clifsinfo.c */
2549 bool cli_unix_extensions_version(struct cli_state
*cli
, uint16
*pmajor
, uint16
*pminor
,
2550 uint32
*pcaplow
, uint32
*pcaphigh
);
2551 bool cli_set_unix_extensions_capabilities(struct cli_state
*cli
, uint16 major
, uint16 minor
,
2552 uint32 caplow
, uint32 caphigh
);
2553 bool cli_get_fs_attr_info(struct cli_state
*cli
, uint32
*fs_attr
);
2554 bool cli_get_fs_volume_info_old(struct cli_state
*cli
, fstring volume_name
, uint32
*pserial_number
);
2555 bool cli_get_fs_volume_info(struct cli_state
*cli
, fstring volume_name
, uint32
*pserial_number
, time_t *pdate
);
2556 bool cli_get_fs_full_size_info(struct cli_state
*cli
,
2557 uint64_t *total_allocation_units
,
2558 uint64_t *caller_allocation_units
,
2559 uint64_t *actual_allocation_units
,
2560 uint64_t *sectors_per_allocation_unit
,
2561 uint64_t *bytes_per_sector
);
2562 bool cli_get_posix_fs_info(struct cli_state
*cli
,
2563 uint32
*optimal_transfer_size
,
2565 uint64_t *total_blocks
,
2566 uint64_t *blocks_available
,
2567 uint64_t *user_blocks_available
,
2568 uint64_t *total_file_nodes
,
2569 uint64_t *free_file_nodes
,
2570 uint64_t *fs_identifier
);
2571 NTSTATUS
cli_raw_ntlm_smb_encryption_start(struct cli_state
*cli
,
2574 const char *domain
);
2575 NTSTATUS
cli_gss_smb_encryption_start(struct cli_state
*cli
);
2576 NTSTATUS
cli_force_encryption(struct cli_state
*c
,
2577 const char *username
,
2578 const char *password
,
2579 const char *domain
);
2581 /* The following definitions come from libsmb/clikrb5.c */
2583 bool unwrap_edata_ntstatus(TALLOC_CTX
*mem_ctx
,
2585 DATA_BLOB
*edata_out
);
2586 bool unwrap_pac(TALLOC_CTX
*mem_ctx
, DATA_BLOB
*auth_data
, DATA_BLOB
*unwrapped_pac_data
);
2587 int cli_krb5_get_ticket(const char *principal
, time_t time_offset
,
2588 DATA_BLOB
*ticket
, DATA_BLOB
*session_key_krb5
,
2589 uint32 extra_ap_opts
, const char *ccname
,
2590 time_t *tgs_expire
);
2592 /* The following definitions come from libsmb/clilist.c */
2594 int cli_list_new(struct cli_state
*cli
,const char *Mask
,uint16 attribute
,
2595 void (*fn
)(const char *, file_info
*, const char *, void *), void *state
);
2596 int cli_list_old(struct cli_state
*cli
,const char *Mask
,uint16 attribute
,
2597 void (*fn
)(const char *, file_info
*, const char *, void *), void *state
);
2598 int cli_list(struct cli_state
*cli
,const char *Mask
,uint16 attribute
,
2599 void (*fn
)(const char *, file_info
*, const char *, void *), void *state
);
2601 /* The following definitions come from libsmb/climessage.c */
2603 int cli_message_start_build(struct cli_state
*cli
, const char *host
, const char *username
);
2604 bool cli_message_start(struct cli_state
*cli
, const char *host
, const char *username
,
2606 int cli_message_text_build(struct cli_state
*cli
, const char *msg
, int len
, int grp
);
2607 bool cli_message_text(struct cli_state
*cli
, const char *msg
, int len
, int grp
);
2608 int cli_message_end_build(struct cli_state
*cli
, int grp
);
2609 bool cli_message_end(struct cli_state
*cli
, int grp
);
2611 /* The following definitions come from libsmb/clioplock.c */
2613 struct tevent_req
*cli_oplock_ack_send(TALLOC_CTX
*mem_ctx
,
2614 struct tevent_context
*ev
,
2615 struct cli_state
*cli
,
2616 uint16_t fnum
, uint8_t level
);
2617 NTSTATUS
cli_oplock_ack_recv(struct tevent_req
*req
);
2618 NTSTATUS
cli_oplock_ack(struct cli_state
*cli
, uint16_t fnum
, unsigned char level
);
2619 void cli_oplock_handler(struct cli_state
*cli
,
2620 NTSTATUS (*handler
)(struct cli_state
*, uint16_t, unsigned char));
2622 /* The following definitions come from libsmb/cliprint.c */
2624 int cli_print_queue(struct cli_state
*cli
,
2625 void (*fn
)(struct print_job_info
*));
2626 int cli_printjob_del(struct cli_state
*cli
, int job
);
2627 int cli_spl_open(struct cli_state
*cli
, const char *fname
, int flags
, int share_mode
);
2628 bool cli_spl_close(struct cli_state
*cli
, uint16_t fnum
);
2630 /* The following definitions come from libsmb/cliquota.c */
2632 NTSTATUS
cli_get_quota_handle(struct cli_state
*cli
, uint16_t *quota_fnum
);
2633 void free_ntquota_list(SMB_NTQUOTA_LIST
**qt_list
);
2634 bool cli_get_user_quota(struct cli_state
*cli
, int quota_fnum
, SMB_NTQUOTA_STRUCT
*pqt
);
2635 bool cli_set_user_quota(struct cli_state
*cli
, int quota_fnum
, SMB_NTQUOTA_STRUCT
*pqt
);
2636 bool cli_list_user_quota(struct cli_state
*cli
, int quota_fnum
, SMB_NTQUOTA_LIST
**pqt_list
);
2637 bool cli_get_fs_quota_info(struct cli_state
*cli
, int quota_fnum
, SMB_NTQUOTA_STRUCT
*pqt
);
2638 bool cli_set_fs_quota_info(struct cli_state
*cli
, int quota_fnum
, SMB_NTQUOTA_STRUCT
*pqt
);
2639 void dump_ntquota(SMB_NTQUOTA_STRUCT
*qt
, bool _verbose
, bool _numeric
, void (*_sidtostring
)(fstring str
, DOM_SID
*sid
, bool _numeric
));
2640 void dump_ntquota_list(SMB_NTQUOTA_LIST
**qtl
, bool _verbose
, bool _numeric
, void (*_sidtostring
)(fstring str
, DOM_SID
*sid
, bool _numeric
));
2642 /* The following definitions come from libsmb/clirap.c */
2644 bool cli_api(struct cli_state
*cli
,
2645 char *param
, int prcnt
, int mprcnt
,
2646 char *data
, int drcnt
, int mdrcnt
,
2647 char **rparam
, unsigned int *rprcnt
,
2648 char **rdata
, unsigned int *rdrcnt
);
2649 bool cli_NetWkstaUserLogon(struct cli_state
*cli
,char *user
, char *workstation
);
2650 int cli_RNetShareEnum(struct cli_state
*cli
, void (*fn
)(const char *, uint32
, const char *, void *), void *state
);
2651 bool cli_NetServerEnum(struct cli_state
*cli
, char *workgroup
, uint32 stype
,
2652 void (*fn
)(const char *, uint32
, const char *, void *),
2654 bool cli_oem_change_password(struct cli_state
*cli
, const char *user
, const char *new_password
,
2655 const char *old_password
);
2656 bool cli_qpathinfo(struct cli_state
*cli
,
2658 time_t *change_time
,
2659 time_t *access_time
,
2663 bool cli_setpathinfo(struct cli_state
*cli
, const char *fname
,
2669 bool cli_qpathinfo2(struct cli_state
*cli
, const char *fname
,
2670 struct timespec
*create_time
,
2671 struct timespec
*access_time
,
2672 struct timespec
*write_time
,
2673 struct timespec
*change_time
,
2674 SMB_OFF_T
*size
, uint16
*mode
,
2676 bool cli_qpathinfo_streams(struct cli_state
*cli
, const char *fname
,
2677 TALLOC_CTX
*mem_ctx
,
2678 unsigned int *pnum_streams
,
2679 struct stream_struct
**pstreams
);
2680 bool cli_qfilename(struct cli_state
*cli
, uint16_t fnum
, char *name
, size_t namelen
);
2681 bool cli_qfileinfo(struct cli_state
*cli
, uint16_t fnum
,
2682 uint16
*mode
, SMB_OFF_T
*size
,
2683 struct timespec
*create_time
,
2684 struct timespec
*access_time
,
2685 struct timespec
*write_time
,
2686 struct timespec
*change_time
,
2688 bool cli_qpathinfo_basic( struct cli_state
*cli
, const char *name
,
2689 SMB_STRUCT_STAT
*sbuf
, uint32
*attributes
);
2690 bool cli_qfileinfo_test(struct cli_state
*cli
, uint16_t fnum
, int level
, char **poutdata
, uint32
*poutlen
);
2691 NTSTATUS
cli_qpathinfo_alt_name(struct cli_state
*cli
, const char *fname
, fstring alt_name
);
2693 /* The following definitions come from libsmb/clirap2.c */
2695 int cli_NetGroupDelete(struct cli_state
*cli
, const char *group_name
);
2696 int cli_NetGroupAdd(struct cli_state
*cli
, RAP_GROUP_INFO_1
*grinfo
);
2697 int cli_RNetGroupEnum(struct cli_state
*cli
, void (*fn
)(const char *, const char *, void *), void *state
);
2698 int cli_RNetGroupEnum0(struct cli_state
*cli
,
2699 void (*fn
)(const char *, void *),
2701 int cli_NetGroupDelUser(struct cli_state
* cli
, const char *group_name
, const char *user_name
);
2702 int cli_NetGroupAddUser(struct cli_state
* cli
, const char *group_name
, const char *user_name
);
2703 int cli_NetGroupGetUsers(struct cli_state
* cli
, const char *group_name
, void (*fn
)(const char *, void *), void *state
);
2704 int cli_NetUserGetGroups(struct cli_state
* cli
, const char *user_name
, void (*fn
)(const char *, void *), void *state
);
2705 int cli_NetUserDelete(struct cli_state
*cli
, const char * user_name
);
2706 int cli_NetUserAdd(struct cli_state
*cli
, RAP_USER_INFO_1
* userinfo
);
2707 int cli_RNetUserEnum(struct cli_state
*cli
, void (*fn
)(const char *, const char *, const char *, const char *, void *), void *state
);
2708 int cli_RNetUserEnum0(struct cli_state
*cli
,
2709 void (*fn
)(const char *, void *),
2711 int cli_NetFileClose(struct cli_state
*cli
, uint32 file_id
);
2712 int cli_NetFileGetInfo(struct cli_state
*cli
, uint32 file_id
, void (*fn
)(const char *, const char *, uint16
, uint16
, uint32
));
2713 int cli_NetFileEnum(struct cli_state
*cli
, const char * user
,
2714 const char * base_path
,
2715 void (*fn
)(const char *, const char *, uint16
, uint16
,
2717 int cli_NetShareAdd(struct cli_state
*cli
, RAP_SHARE_INFO_2
* sinfo
);
2718 int cli_NetShareDelete(struct cli_state
*cli
, const char * share_name
);
2719 bool cli_get_pdc_name(struct cli_state
*cli
, const char *workgroup
, char **pdc_name
);
2720 bool cli_get_server_domain(struct cli_state
*cli
);
2721 bool cli_get_server_type(struct cli_state
*cli
, uint32
*pstype
);
2722 bool cli_get_server_name(TALLOC_CTX
*mem_ctx
, struct cli_state
*cli
,
2724 bool cli_ns_check_server_type(struct cli_state
*cli
, char *workgroup
, uint32 stype
);
2725 bool cli_NetWkstaUserLogoff(struct cli_state
*cli
, const char *user
, const char *workstation
);
2726 int cli_NetPrintQEnum(struct cli_state
*cli
,
2727 void (*qfn
)(const char*,uint16
,uint16
,uint16
,const char*,const char*,const char*,const char*,const char*,uint16
,uint16
),
2728 void (*jfn
)(uint16
,const char*,const char*,const char*,const char*,uint16
,uint16
,const char*,uint
,uint
,const char*));
2729 int cli_NetPrintQGetInfo(struct cli_state
*cli
, const char *printer
,
2730 void (*qfn
)(const char*,uint16
,uint16
,uint16
,const char*,const char*,const char*,const char*,const char*,uint16
,uint16
),
2731 void (*jfn
)(uint16
,const char*,const char*,const char*,const char*,uint16
,uint16
,const char*,uint
,uint
,const char*));
2732 int cli_RNetServiceEnum(struct cli_state
*cli
, void (*fn
)(const char *, const char *, void *), void *state
);
2733 int cli_NetSessionEnum(struct cli_state
*cli
, void (*fn
)(char *, char *, uint16
, uint16
, uint16
, uint
, uint
, uint
, char *));
2734 int cli_NetSessionGetInfo(struct cli_state
*cli
, const char *workstation
,
2735 void (*fn
)(const char *, const char *, uint16
, uint16
, uint16
, uint
, uint
, uint
, const char *));
2736 int cli_NetSessionDel(struct cli_state
*cli
, const char *workstation
);
2737 int cli_NetConnectionEnum(struct cli_state
*cli
, const char *qualifier
,
2738 void (*fn
)(uint16_t conid
, uint16_t contype
,
2739 uint16_t numopens
, uint16_t numusers
,
2740 uint32_t contime
, const char *username
,
2741 const char *netname
));
2743 /* The following definitions come from libsmb/clireadwrite.c */
2745 struct tevent_req
*cli_read_andx_create(TALLOC_CTX
*mem_ctx
,
2746 struct event_context
*ev
,
2747 struct cli_state
*cli
, uint16_t fnum
,
2748 off_t offset
, size_t size
,
2749 struct tevent_req
**psmbreq
);
2750 struct tevent_req
*cli_read_andx_send(TALLOC_CTX
*mem_ctx
,
2751 struct event_context
*ev
,
2752 struct cli_state
*cli
, uint16_t fnum
,
2753 off_t offset
, size_t size
);
2754 NTSTATUS
cli_read_andx_recv(struct tevent_req
*req
, ssize_t
*received
,
2756 struct tevent_req
*cli_pull_send(TALLOC_CTX
*mem_ctx
,
2757 struct event_context
*ev
,
2758 struct cli_state
*cli
,
2759 uint16_t fnum
, off_t start_offset
,
2760 SMB_OFF_T size
, size_t window_size
,
2761 NTSTATUS (*sink
)(char *buf
, size_t n
,
2764 NTSTATUS
cli_pull_recv(struct tevent_req
*req
, SMB_OFF_T
*received
);
2765 NTSTATUS
cli_pull(struct cli_state
*cli
, uint16_t fnum
,
2766 off_t start_offset
, SMB_OFF_T size
, size_t window_size
,
2767 NTSTATUS (*sink
)(char *buf
, size_t n
, void *priv
),
2768 void *priv
, SMB_OFF_T
*received
);
2769 ssize_t
cli_read(struct cli_state
*cli
, uint16_t fnum
, char *buf
,
2770 off_t offset
, size_t size
);
2771 ssize_t
cli_readraw(struct cli_state
*cli
, uint16_t fnum
, char *buf
, off_t offset
, size_t size
);
2772 ssize_t
cli_write(struct cli_state
*cli
,
2773 uint16_t fnum
, uint16 write_mode
,
2774 const char *buf
, off_t offset
, size_t size
);
2775 ssize_t
cli_smbwrite(struct cli_state
*cli
,
2776 uint16_t fnum
, char *buf
, off_t offset
, size_t size1
);
2777 struct tevent_req
*cli_write_andx_create(TALLOC_CTX
*mem_ctx
,
2778 struct event_context
*ev
,
2779 struct cli_state
*cli
, uint16_t fnum
,
2780 uint16_t mode
, const uint8_t *buf
,
2781 off_t offset
, size_t size
,
2782 struct tevent_req
**reqs_before
,
2783 int num_reqs_before
,
2784 struct tevent_req
**psmbreq
);
2785 struct tevent_req
*cli_write_andx_send(TALLOC_CTX
*mem_ctx
,
2786 struct event_context
*ev
,
2787 struct cli_state
*cli
, uint16_t fnum
,
2788 uint16_t mode
, const uint8_t *buf
,
2789 off_t offset
, size_t size
);
2790 NTSTATUS
cli_write_andx_recv(struct tevent_req
*req
, size_t *pwritten
);
2792 struct tevent_req
*cli_push_send(TALLOC_CTX
*mem_ctx
, struct event_context
*ev
,
2793 struct cli_state
*cli
,
2794 uint16_t fnum
, uint16_t mode
,
2795 off_t start_offset
, size_t window_size
,
2796 size_t (*source
)(uint8_t *buf
, size_t n
,
2799 NTSTATUS
cli_push_recv(struct tevent_req
*req
);
2800 NTSTATUS
cli_push(struct cli_state
*cli
, uint16_t fnum
, uint16_t mode
,
2801 off_t start_offset
, size_t window_size
,
2802 size_t (*source
)(uint8_t *buf
, size_t n
, void *priv
),
2805 /* The following definitions come from libsmb/clisecdesc.c */
2807 SEC_DESC
*cli_query_secdesc(struct cli_state
*cli
, uint16_t fnum
,
2808 TALLOC_CTX
*mem_ctx
);
2809 bool cli_set_secdesc(struct cli_state
*cli
, uint16_t fnum
, SEC_DESC
*sd
);
2811 /* The following definitions come from libsmb/clispnego.c */
2813 DATA_BLOB
spnego_gen_negTokenInit(char guid
[16],
2815 const char *principal
);
2816 DATA_BLOB
gen_negTokenInit(const char *OID
, DATA_BLOB blob
);
2817 bool spnego_parse_negTokenInit(DATA_BLOB blob
,
2818 char *OIDs
[ASN1_MAX_OIDS
],
2820 DATA_BLOB
gen_negTokenTarg(const char *OIDs
[], DATA_BLOB blob
);
2821 bool parse_negTokenTarg(DATA_BLOB blob
, char *OIDs
[ASN1_MAX_OIDS
], DATA_BLOB
*secblob
);
2822 DATA_BLOB
spnego_gen_krb5_wrap(const DATA_BLOB ticket
, const uint8 tok_id
[2]);
2823 bool spnego_parse_krb5_wrap(DATA_BLOB blob
, DATA_BLOB
*ticket
, uint8 tok_id
[2]);
2824 int spnego_gen_negTokenTarg(const char *principal
, int time_offset
,
2826 DATA_BLOB
*session_key_krb5
, uint32 extra_ap_opts
,
2827 time_t *expire_time
);
2828 bool spnego_parse_challenge(const DATA_BLOB blob
,
2829 DATA_BLOB
*chal1
, DATA_BLOB
*chal2
);
2830 DATA_BLOB
spnego_gen_auth(DATA_BLOB blob
);
2831 bool spnego_parse_auth(DATA_BLOB blob
, DATA_BLOB
*auth
);
2832 DATA_BLOB
spnego_gen_auth_response(DATA_BLOB
*reply
, NTSTATUS nt_status
,
2833 const char *mechOID
);
2834 bool spnego_parse_auth_response(DATA_BLOB blob
, NTSTATUS nt_status
,
2835 const char *mechOID
,
2838 /* The following definitions come from libsmb/clistr.c */
2840 size_t clistr_push_fn(const char *function
,
2842 struct cli_state
*cli
,
2847 size_t clistr_pull_fn(const char *function
,
2855 size_t clistr_pull_talloc_fn(const char *function
,
2863 size_t clistr_align_out(struct cli_state
*cli
, const void *p
, int flags
);
2864 size_t clistr_align_in(struct cli_state
*cli
, const void *p
, int flags
);
2866 /* The following definitions come from libsmb/clitrans.c */
2868 bool cli_send_trans(struct cli_state
*cli
, int trans
,
2869 const char *pipe_name
,
2871 uint16
*setup
, unsigned int lsetup
, unsigned int msetup
,
2872 const char *param
, unsigned int lparam
, unsigned int mparam
,
2873 const char *data
, unsigned int ldata
, unsigned int mdata
);
2874 bool cli_receive_trans(struct cli_state
*cli
,int trans
,
2875 char **param
, unsigned int *param_len
,
2876 char **data
, unsigned int *data_len
);
2877 bool cli_send_nt_trans(struct cli_state
*cli
,
2880 uint16
*setup
, unsigned int lsetup
, unsigned int msetup
,
2881 char *param
, unsigned int lparam
, unsigned int mparam
,
2882 char *data
, unsigned int ldata
, unsigned int mdata
);
2883 bool cli_receive_nt_trans(struct cli_state
*cli
,
2884 char **param
, unsigned int *param_len
,
2885 char **data
, unsigned int *data_len
);
2886 struct tevent_req
*cli_trans_send(
2887 TALLOC_CTX
*mem_ctx
, struct event_context
*ev
,
2888 struct cli_state
*cli
, uint8_t cmd
,
2889 const char *pipe_name
, uint16_t fid
, uint16_t function
, int flags
,
2890 uint16_t *setup
, uint8_t num_setup
, uint8_t max_setup
,
2891 uint8_t *param
, uint32_t num_param
, uint32_t max_param
,
2892 uint8_t *data
, uint32_t num_data
, uint32_t max_data
);
2893 NTSTATUS
cli_trans_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
2894 uint16_t **setup
, uint8_t *num_setup
,
2895 uint8_t **param
, uint32_t *num_param
,
2896 uint8_t **data
, uint32_t *num_data
);
2897 NTSTATUS
cli_trans(TALLOC_CTX
*mem_ctx
, struct cli_state
*cli
,
2899 const char *pipe_name
, uint16_t fid
, uint16_t function
,
2901 uint16_t *setup
, uint8_t num_setup
, uint8_t max_setup
,
2902 uint8_t *param
, uint32_t num_param
, uint32_t max_param
,
2903 uint8_t *data
, uint32_t num_data
, uint32_t max_data
,
2904 uint16_t **rsetup
, uint8_t *num_rsetup
,
2905 uint8_t **rparam
, uint32_t *num_rparam
,
2906 uint8_t **rdata
, uint32_t *num_rdata
);
2908 /* The following definitions come from libsmb/conncache.c */
2910 NTSTATUS
check_negative_conn_cache_timeout( const char *domain
, const char *server
, unsigned int failed_cache_timeout
);
2911 NTSTATUS
check_negative_conn_cache( const char *domain
, const char *server
);
2912 void add_failed_connection_entry(const char *domain
, const char *server
, NTSTATUS result
) ;
2913 void delete_negative_conn_cache(const char *domain
, const char *server
);
2914 void flush_negative_conn_cache( void );
2915 void flush_negative_conn_cache_for_domain(const char *domain
);
2917 /* The following definitions come from ../librpc/rpc/dcerpc_error.c */
2919 const char *dcerpc_errstr(TALLOC_CTX
*mem_ctx
, uint32_t fault_code
);
2921 /* The following definitions come from libsmb/dsgetdcname.c */
2923 void debug_dsdcinfo_flags(int lvl
, uint32_t flags
);
2924 NTSTATUS
dsgetdcname(TALLOC_CTX
*mem_ctx
,
2925 struct messaging_context
*msg_ctx
,
2926 const char *domain_name
,
2927 struct GUID
*domain_guid
,
2928 const char *site_name
,
2930 struct netr_DsRGetDCNameInfo
**info
);
2932 /* The following definitions come from libsmb/errormap.c */
2934 NTSTATUS
dos_to_ntstatus(uint8 eclass
, uint32 ecode
);
2935 void ntstatus_to_dos(NTSTATUS ntstatus
, uint8
*eclass
, uint32
*ecode
);
2936 NTSTATUS
werror_to_ntstatus(WERROR error
);
2937 WERROR
ntstatus_to_werror(NTSTATUS error
);
2938 NTSTATUS
map_nt_error_from_gss(uint32 gss_maj
, uint32 minor
);
2940 /* The following definitions come from libsmb/namecache.c */
2942 bool namecache_enable(void);
2943 bool namecache_store(const char *name
,
2946 struct ip_service
*ip_list
);
2947 bool namecache_fetch(const char *name
,
2949 struct ip_service
**ip_list
,
2951 bool namecache_delete(const char *name
, int name_type
);
2952 void namecache_flush(void);
2953 bool namecache_status_store(const char *keyname
, int keyname_type
,
2954 int name_type
, const struct sockaddr_storage
*keyip
,
2955 const char *srvname
);
2956 bool namecache_status_fetch(const char *keyname
,
2959 const struct sockaddr_storage
*keyip
,
2962 /* The following definitions come from libsmb/namequery.c */
2964 bool saf_store( const char *domain
, const char *servername
);
2965 bool saf_join_store( const char *domain
, const char *servername
);
2966 bool saf_delete( const char *domain
);
2967 char *saf_fetch( const char *domain
);
2968 NODE_STATUS_STRUCT
*node_status_query(int fd
,
2969 struct nmb_name
*name
,
2970 const struct sockaddr_storage
*to_ss
,
2972 struct node_status_extra
*extra
);
2973 bool name_status_find(const char *q_name
,
2976 const struct sockaddr_storage
*to_ss
,
2978 int ip_service_compare(struct ip_service
*ss1
, struct ip_service
*ss2
);
2979 struct sockaddr_storage
*name_query(int fd
,
2984 const struct sockaddr_storage
*to_ss
,
2988 XFILE
*startlmhosts(const char *fname
);
2989 bool getlmhostsent(TALLOC_CTX
*ctx
, XFILE
*fp
, char **pp_name
, int *name_type
,
2990 struct sockaddr_storage
*pss
);
2991 void endlmhosts(XFILE
*fp
);
2992 NTSTATUS
name_resolve_bcast(const char *name
,
2994 struct ip_service
**return_iplist
,
2996 NTSTATUS
resolve_wins(const char *name
,
2998 struct ip_service
**return_iplist
,
3000 NTSTATUS
internal_resolve_name(const char *name
,
3002 const char *sitename
,
3003 struct ip_service
**return_iplist
,
3005 const char *resolve_order
);
3006 bool resolve_name(const char *name
,
3007 struct sockaddr_storage
*return_ss
,
3009 NTSTATUS
resolve_name_list(TALLOC_CTX
*ctx
,
3012 struct sockaddr_storage
**return_ss_arr
,
3013 unsigned int *p_num_entries
);
3014 bool find_master_ip(const char *group
, struct sockaddr_storage
*master_ss
);
3015 bool get_pdc_ip(const char *domain
, struct sockaddr_storage
*pss
);
3016 NTSTATUS
get_sorted_dc_list( const char *domain
,
3017 const char *sitename
,
3018 struct ip_service
**ip_list
,
3021 NTSTATUS
get_kdc_list( const char *realm
,
3022 const char *sitename
,
3023 struct ip_service
**ip_list
,
3026 /* The following definitions come from libsmb/namequery_dc.c */
3028 bool get_dc_name(const char *domain
,
3031 struct sockaddr_storage
*ss_out
);
3033 /* The following definitions come from libsmb/nmblib.c */
3035 void debug_nmb_packet(struct packet_struct
*p
);
3036 void put_name(char *dest
, const char *name
, int pad
, unsigned int name_type
);
3037 char *nmb_namestr(const struct nmb_name
*n
);
3038 struct packet_struct
*copy_packet(struct packet_struct
*packet
);
3039 void free_packet(struct packet_struct
*packet
);
3040 struct packet_struct
*parse_packet(char *buf
,int length
,
3041 enum packet_type packet_type
,
3044 struct packet_struct
*read_packet(int fd
,enum packet_type packet_type
);
3045 void make_nmb_name( struct nmb_name
*n
, const char *name
, int type
);
3046 bool nmb_name_equal(struct nmb_name
*n1
, struct nmb_name
*n2
);
3047 int build_packet(char *buf
, size_t buflen
, struct packet_struct
*p
);
3048 bool send_packet(struct packet_struct
*p
);
3049 struct packet_struct
*receive_packet(int fd
,enum packet_type type
,int t
);
3050 struct packet_struct
*receive_nmb_packet(int fd
, int t
, int trn_id
);
3051 struct packet_struct
*receive_dgram_packet(int fd
, int t
,
3052 const char *mailslot_name
);
3053 bool match_mailslot_name(struct packet_struct
*p
, const char *mailslot_name
);
3054 int matching_len_bits(unsigned char *p1
, unsigned char *p2
, size_t len
);
3055 void sort_query_replies(char *data
, int n
, struct in_addr ip
);
3056 char *name_mangle(TALLOC_CTX
*mem_ctx
, char *In
, char name_type
);
3057 int name_extract(char *buf
,int ofs
, fstring name
);
3058 int name_len(char *s1
);
3060 /* The following definitions come from libsmb/nterr.c */
3062 const char *nt_errstr(NTSTATUS nt_code
);
3063 const char *get_friendly_nt_error_msg(NTSTATUS nt_code
);
3064 const char *get_nt_error_c_code(NTSTATUS nt_code
);
3065 NTSTATUS
nt_status_string_to_code(const char *nt_status_str
);
3066 NTSTATUS
nt_status_squash(NTSTATUS nt_status
);
3068 /* The following definitions come from libsmb/ntlmssp.c */
3070 void debug_ntlmssp_flags(uint32 neg_flags
);
3071 NTSTATUS
ntlmssp_set_username(NTLMSSP_STATE
*ntlmssp_state
, const char *user
) ;
3072 NTSTATUS
ntlmssp_set_hashes(NTLMSSP_STATE
*ntlmssp_state
,
3073 const unsigned char lm_hash
[16],
3074 const unsigned char nt_hash
[16]) ;
3075 NTSTATUS
ntlmssp_set_password(NTLMSSP_STATE
*ntlmssp_state
, const char *password
) ;
3076 NTSTATUS
ntlmssp_set_domain(NTLMSSP_STATE
*ntlmssp_state
, const char *domain
) ;
3077 NTSTATUS
ntlmssp_set_workstation(NTLMSSP_STATE
*ntlmssp_state
, const char *workstation
) ;
3078 NTSTATUS
ntlmssp_store_response(NTLMSSP_STATE
*ntlmssp_state
,
3079 DATA_BLOB response
) ;
3080 void ntlmssp_want_feature_list(NTLMSSP_STATE
*ntlmssp_state
, char *feature_list
);
3081 void ntlmssp_want_feature(NTLMSSP_STATE
*ntlmssp_state
, uint32 feature
);
3082 NTSTATUS
ntlmssp_update(NTLMSSP_STATE
*ntlmssp_state
,
3083 const DATA_BLOB in
, DATA_BLOB
*out
) ;
3084 void ntlmssp_end(NTLMSSP_STATE
**ntlmssp_state
);
3085 DATA_BLOB
ntlmssp_weaken_keys(NTLMSSP_STATE
*ntlmssp_state
, TALLOC_CTX
*mem_ctx
);
3086 NTSTATUS
ntlmssp_server_start(NTLMSSP_STATE
**ntlmssp_state
);
3087 NTSTATUS
ntlmssp_client_start(NTLMSSP_STATE
**ntlmssp_state
);
3089 /* The following definitions come from libsmb/ntlmssp_sign.c */
3091 NTSTATUS
ntlmssp_sign_packet(NTLMSSP_STATE
*ntlmssp_state
,
3092 const uchar
*data
, size_t length
,
3093 const uchar
*whole_pdu
, size_t pdu_length
,
3095 NTSTATUS
ntlmssp_check_packet(NTLMSSP_STATE
*ntlmssp_state
,
3096 const uchar
*data
, size_t length
,
3097 const uchar
*whole_pdu
, size_t pdu_length
,
3098 const DATA_BLOB
*sig
) ;
3099 NTSTATUS
ntlmssp_seal_packet(NTLMSSP_STATE
*ntlmssp_state
,
3100 uchar
*data
, size_t length
,
3101 uchar
*whole_pdu
, size_t pdu_length
,
3103 NTSTATUS
ntlmssp_unseal_packet(NTLMSSP_STATE
*ntlmssp_state
,
3104 uchar
*data
, size_t length
,
3105 uchar
*whole_pdu
, size_t pdu_length
,
3107 NTSTATUS
ntlmssp_sign_init(NTLMSSP_STATE
*ntlmssp_state
);
3109 /* The following definitions come from libsmb/passchange.c */
3111 NTSTATUS
remote_password_change(const char *remote_machine
, const char *user_name
,
3112 const char *old_passwd
, const char *new_passwd
,
3115 /* The following definitions come from libsmb/samlogon_cache.c */
3117 bool netsamlogon_cache_init(void);
3118 bool netsamlogon_cache_shutdown(void);
3119 void netsamlogon_clear_cached_user(struct netr_SamInfo3
*info3
);
3120 bool netsamlogon_cache_store(const char *username
, struct netr_SamInfo3
*info3
);
3121 struct netr_SamInfo3
*netsamlogon_cache_get(TALLOC_CTX
*mem_ctx
, const DOM_SID
*user_sid
);
3122 bool netsamlogon_cache_have(const DOM_SID
*user_sid
);
3124 /* The following definitions come from libsmb/smb_seal.c */
3126 NTSTATUS
get_enc_ctx_num(const uint8_t *buf
, uint16
*p_enc_ctx_num
);
3127 bool common_encryption_on(struct smb_trans_enc_state
*es
);
3128 NTSTATUS
common_ntlm_decrypt_buffer(NTLMSSP_STATE
*ntlmssp_state
, char *buf
);
3129 NTSTATUS
common_ntlm_encrypt_buffer(NTLMSSP_STATE
*ntlmssp_state
,
3133 NTSTATUS
common_encrypt_buffer(struct smb_trans_enc_state
*es
, char *buffer
, char **buf_out
);
3134 NTSTATUS
common_decrypt_buffer(struct smb_trans_enc_state
*es
, char *buf
);
3135 void common_free_encryption_state(struct smb_trans_enc_state
**pp_es
);
3136 void common_free_enc_buffer(struct smb_trans_enc_state
*es
, char *buf
);
3137 bool cli_encryption_on(struct cli_state
*cli
);
3138 void cli_free_encryption_context(struct cli_state
*cli
);
3139 void cli_free_enc_buffer(struct cli_state
*cli
, char *buf
);
3140 NTSTATUS
cli_decrypt_message(struct cli_state
*cli
);
3141 NTSTATUS
cli_encrypt_message(struct cli_state
*cli
, char *buf
, char **buf_out
);
3143 /* The following definitions come from libsmb/clisigning.c */
3145 bool cli_simple_set_signing(struct cli_state
*cli
,
3146 const DATA_BLOB user_session_key
,
3147 const DATA_BLOB response
);
3148 bool cli_temp_set_signing(struct cli_state
*cli
);
3149 void cli_calculate_sign_mac(struct cli_state
*cli
, char *buf
, uint32_t *seqnum
);
3150 bool cli_check_sign_mac(struct cli_state
*cli
, const char *buf
, uint32_t seqnum
);
3151 bool client_is_signing_on(struct cli_state
*cli
);
3152 bool client_is_signing_allowed(struct cli_state
*cli
);
3153 bool client_is_signing_mandatory(struct cli_state
*cli
);
3154 void cli_set_signing_negotiated(struct cli_state
*cli
);
3156 /* The following definitions come from smbd/signing.c */
3158 struct smbd_server_connection
;
3159 bool srv_check_sign_mac(struct smbd_server_connection
*conn
,
3160 const char *inbuf
, uint32_t *seqnum
);
3161 void srv_calculate_sign_mac(struct smbd_server_connection
*conn
,
3162 char *outbuf
, uint32_t seqnum
);
3163 void srv_cancel_sign_response(struct smbd_server_connection
*conn
);
3164 bool srv_init_signing(struct smbd_server_connection
*conn
);
3165 void srv_set_signing_negotiated(struct smbd_server_connection
*conn
);
3166 bool srv_is_signing_active(struct smbd_server_connection
*conn
);
3167 bool srv_is_signing_negotiated(struct smbd_server_connection
*conn
);
3168 void srv_set_signing(struct smbd_server_connection
*conn
,
3169 const DATA_BLOB user_session_key
,
3170 const DATA_BLOB response
);
3172 /* The following definitions come from libsmb/smberr.c */
3174 const char *smb_dos_err_name(uint8 e_class
, uint16 num
);
3175 const char *get_dos_error_msg(WERROR result
);
3176 const char *smb_dos_err_class(uint8 e_class
);
3177 char *smb_dos_errstr(char *inbuf
);
3178 WERROR
map_werror_from_unix(int error
);
3180 /* The following definitions come from libsmb/spnego.c */
3182 ssize_t
read_spnego_data(DATA_BLOB data
, SPNEGO_DATA
*token
);
3183 ssize_t
write_spnego_data(DATA_BLOB
*blob
, SPNEGO_DATA
*spnego
);
3184 bool free_spnego_data(SPNEGO_DATA
*spnego
);
3186 /* The following definitions come from libsmb/trustdom_cache.c */
3188 bool trustdom_cache_enable(void);
3189 bool trustdom_cache_shutdown(void);
3190 bool trustdom_cache_store(char* name
, char* alt_name
, const DOM_SID
*sid
,
3192 bool trustdom_cache_fetch(const char* name
, DOM_SID
* sid
);
3193 uint32
trustdom_cache_fetch_timestamp( void );
3194 bool trustdom_cache_store_timestamp( uint32 t
, time_t timeout
);
3195 void trustdom_cache_flush(void);
3196 void update_trustdom_cache( void );
3198 /* The following definitions come from libsmb/trusts_util.c */
3200 NTSTATUS
trust_pw_change_and_store_it(struct rpc_pipe_client
*cli
, TALLOC_CTX
*mem_ctx
,
3202 unsigned char orig_trust_passwd_hash
[16],
3203 uint32 sec_channel_type
);
3204 NTSTATUS
trust_pw_find_change_and_store_it(struct rpc_pipe_client
*cli
,
3205 TALLOC_CTX
*mem_ctx
,
3206 const char *domain
) ;
3207 bool enumerate_domain_trusts( TALLOC_CTX
*mem_ctx
, const char *domain
,
3208 char ***domain_names
, uint32
*num_domains
,
3211 /* The following definitions come from libsmb/unexpected.c */
3213 void unexpected_packet(struct packet_struct
*p
);
3214 void clear_unexpected(time_t t
);
3215 struct packet_struct
*receive_unexpected(enum packet_type packet_type
, int id
,
3216 const char *mailslot_name
);
3218 /* The following definitions come from locking/brlock.c */
3220 bool brl_same_context(const struct lock_context
*ctx1
,
3221 const struct lock_context
*ctx2
);
3222 NTSTATUS
brl_lock_failed(files_struct
*fsp
, const struct lock_struct
*lock
, bool blocking_lock
);
3223 void brl_init(bool read_only
);
3224 void brl_shutdown(void);
3226 NTSTATUS
brl_lock_windows_default(struct byte_range_lock
*br_lck
,
3227 struct lock_struct
*plock
,
3228 bool blocking_lock
);
3230 NTSTATUS
brl_lock(struct messaging_context
*msg_ctx
,
3231 struct byte_range_lock
*br_lck
,
3233 struct server_id pid
,
3236 enum brl_type lock_type
,
3237 enum brl_flavour lock_flav
,
3240 struct blocking_lock_record
*blr
);
3241 bool brl_unlock(struct messaging_context
*msg_ctx
,
3242 struct byte_range_lock
*br_lck
,
3244 struct server_id pid
,
3247 enum brl_flavour lock_flav
);
3248 bool brl_unlock_windows_default(struct messaging_context
*msg_ctx
,
3249 struct byte_range_lock
*br_lck
,
3250 const struct lock_struct
*plock
);
3251 bool brl_locktest(struct byte_range_lock
*br_lck
,
3253 struct server_id pid
,
3256 enum brl_type lock_type
,
3257 enum brl_flavour lock_flav
);
3258 NTSTATUS
brl_lockquery(struct byte_range_lock
*br_lck
,
3260 struct server_id pid
,
3263 enum brl_type
*plock_type
,
3264 enum brl_flavour lock_flav
);
3265 bool brl_lock_cancel(struct byte_range_lock
*br_lck
,
3267 struct server_id pid
,
3270 enum brl_flavour lock_flav
,
3271 struct blocking_lock_record
*blr
);
3272 bool brl_lock_cancel_default(struct byte_range_lock
*br_lck
,
3273 struct lock_struct
*plock
);
3274 void brl_close_fnum(struct messaging_context
*msg_ctx
,
3275 struct byte_range_lock
*br_lck
);
3276 int brl_forall(void (*fn
)(struct file_id id
, struct server_id pid
,
3277 enum brl_type lock_type
,
3278 enum brl_flavour lock_flav
,
3279 br_off start
, br_off size
,
3280 void *private_data
),
3281 void *private_data
);
3282 struct byte_range_lock
*brl_get_locks(TALLOC_CTX
*mem_ctx
,
3284 struct byte_range_lock
*brl_get_locks_readonly(TALLOC_CTX
*mem_ctx
,
3286 void brl_register_msgs(struct messaging_context
*msg_ctx
);
3288 /* The following definitions come from locking/locking.c */
3290 const char *lock_type_name(enum brl_type lock_type
);
3291 const char *lock_flav_name(enum brl_flavour lock_flav
);
3292 void init_strict_lock_struct(files_struct
*fsp
,
3296 enum brl_type lock_type
,
3297 struct lock_struct
*plock
);
3298 bool strict_lock_default(files_struct
*fsp
,
3299 struct lock_struct
*plock
);
3300 void strict_unlock_default(files_struct
*fsp
,
3301 struct lock_struct
*plock
);
3302 NTSTATUS
query_lock(files_struct
*fsp
,
3306 enum brl_type
*plock_type
,
3307 enum brl_flavour lock_flav
);
3308 struct byte_range_lock
*do_lock(struct messaging_context
*msg_ctx
,
3313 enum brl_type lock_type
,
3314 enum brl_flavour lock_flav
,
3318 struct blocking_lock_record
*blr
);
3319 NTSTATUS
do_unlock(struct messaging_context
*msg_ctx
,
3324 enum brl_flavour lock_flav
);
3325 NTSTATUS
do_lock_cancel(files_struct
*fsp
,
3329 enum brl_flavour lock_flav
,
3330 struct blocking_lock_record
*blr
);
3331 void locking_close_file(struct messaging_context
*msg_ctx
,
3333 bool locking_init(void);
3334 bool locking_init_readonly(void);
3335 bool locking_end(void);
3336 char *share_mode_str(TALLOC_CTX
*ctx
, int num
, const struct share_mode_entry
*e
);
3337 struct share_mode_lock
*get_share_mode_lock(TALLOC_CTX
*mem_ctx
,
3338 const struct file_id id
,
3339 const char *servicepath
,
3341 const struct timespec
*old_write_time
);
3342 struct share_mode_lock
*fetch_share_mode_unlocked(TALLOC_CTX
*mem_ctx
,
3343 const struct file_id id
,
3344 const char *servicepath
,
3346 bool rename_share_filename(struct messaging_context
*msg_ctx
,
3347 struct share_mode_lock
*lck
,
3348 const char *servicepath
,
3349 const char *newname
);
3350 void get_file_infos(struct file_id id
,
3351 bool *delete_on_close
,
3352 struct timespec
*write_time
);
3353 bool is_valid_share_mode_entry(const struct share_mode_entry
*e
);
3354 bool is_deferred_open_entry(const struct share_mode_entry
*e
);
3355 bool is_unused_share_mode_entry(const struct share_mode_entry
*e
);
3356 void set_share_mode(struct share_mode_lock
*lck
, files_struct
*fsp
,
3357 uid_t uid
, uint16 mid
, uint16 op_type
);
3358 void add_deferred_open(struct share_mode_lock
*lck
, uint16 mid
,
3359 struct timeval request_time
,
3361 bool del_share_mode(struct share_mode_lock
*lck
, files_struct
*fsp
);
3362 void del_deferred_open_entry(struct share_mode_lock
*lck
, uint16 mid
);
3363 bool remove_share_oplock(struct share_mode_lock
*lck
, files_struct
*fsp
);
3364 bool downgrade_share_oplock(struct share_mode_lock
*lck
, files_struct
*fsp
);
3365 NTSTATUS
can_set_delete_on_close(files_struct
*fsp
, bool delete_on_close
,
3367 void set_delete_on_close_token(struct share_mode_lock
*lck
, const UNIX_USER_TOKEN
*tok
);
3368 void set_delete_on_close_lck(struct share_mode_lock
*lck
, bool delete_on_close
, const UNIX_USER_TOKEN
*tok
);
3369 bool set_delete_on_close(files_struct
*fsp
, bool delete_on_close
, const UNIX_USER_TOKEN
*tok
);
3370 bool set_sticky_write_time(struct file_id fileid
, struct timespec write_time
);
3371 bool set_write_time(struct file_id fileid
, struct timespec write_time
);
3372 int share_mode_forall(void (*fn
)(const struct share_mode_entry
*, const char *,
3373 const char *, void *),
3374 void *private_data
);
3376 /* The following definitions come from locking/posix.c */
3378 bool is_posix_locked(files_struct
*fsp
,
3379 uint64_t *pu_offset
,
3381 enum brl_type
*plock_type
,
3382 enum brl_flavour lock_flav
);
3383 bool posix_locking_init(bool read_only
);
3384 bool posix_locking_end(void);
3385 void reduce_windows_lock_ref_count(files_struct
*fsp
, unsigned int dcount
);
3386 int fd_close_posix(struct files_struct
*fsp
);
3387 bool set_posix_lock_windows_flavour(files_struct
*fsp
,
3390 enum brl_type lock_type
,
3391 const struct lock_context
*lock_ctx
,
3392 const struct lock_struct
*plocks
,
3395 bool release_posix_lock_windows_flavour(files_struct
*fsp
,
3398 enum brl_type deleted_lock_type
,
3399 const struct lock_context
*lock_ctx
,
3400 const struct lock_struct
*plocks
,
3402 bool set_posix_lock_posix_flavour(files_struct
*fsp
,
3405 enum brl_type lock_type
,
3407 bool release_posix_lock_posix_flavour(files_struct
*fsp
,
3410 const struct lock_context
*lock_ctx
,
3411 const struct lock_struct
*plocks
,
3414 /* The following definitions come from modules/vfs_default.c */
3416 int vfswrap_lstat(vfs_handle_struct
*handle
, const char *path
, SMB_STRUCT_STAT
*sbuf
);
3417 ssize_t
vfswrap_llistxattr(struct vfs_handle_struct
*handle
, const char *path
, char *list
, size_t size
);
3418 ssize_t
vfswrap_flistxattr(struct vfs_handle_struct
*handle
, struct files_struct
*fsp
, char *list
, size_t size
);
3419 NTSTATUS
vfs_default_init(void);
3421 /* The following definitions come from nmbd/asyncdns.c */
3423 int asyncdns_fd(void);
3424 void kill_async_dns_child(void);
3425 void start_async_dns(void);
3426 void run_dns_queue(void);
3427 bool queue_dns_query(struct packet_struct
*p
,struct nmb_name
*question
);
3428 bool queue_dns_query(struct packet_struct
*p
,struct nmb_name
*question
);
3429 void kill_async_dns_child(void);
3431 /* The following definitions come from nmbd/nmbd.c */
3433 struct event_context
*nmbd_event_context(void);
3434 struct messaging_context
*nmbd_messaging_context(void);
3436 /* The following definitions come from nmbd/nmbd_become_dmb.c */
3438 void add_domain_names(time_t t
);
3440 /* The following definitions come from nmbd/nmbd_become_lmb.c */
3442 void insert_permanent_name_into_unicast( struct subnet_record
*subrec
,
3443 struct nmb_name
*nmbname
, uint16 nb_type
);
3444 void unbecome_local_master_browser(struct subnet_record
*subrec
, struct work_record
*work
,
3445 bool force_new_election
);
3446 void become_local_master_browser(struct subnet_record
*subrec
, struct work_record
*work
);
3447 void set_workgroup_local_master_browser_name( struct work_record
*work
, const char *newname
);
3449 /* The following definitions come from nmbd/nmbd_browserdb.c */
3451 void update_browser_death_time( struct browse_cache_record
*browc
);
3452 struct browse_cache_record
*create_browser_in_lmb_cache( const char *work_name
,
3453 const char *browser_name
,
3454 struct in_addr ip
);
3455 struct browse_cache_record
*find_browser_in_lmb_cache( const char *browser_name
);
3456 void expire_lmb_browsers( time_t t
);
3458 /* The following definitions come from nmbd/nmbd_browsesync.c */
3460 void dmb_expire_and_sync_browser_lists(time_t t
);
3461 void announce_and_sync_with_domain_master_browser( struct subnet_record
*subrec
,
3462 struct work_record
*work
);
3463 void collect_all_workgroup_names_from_wins_server(time_t t
);
3464 void sync_all_dmbs(time_t t
);
3466 /* The following definitions come from nmbd/nmbd_elections.c */
3468 void check_master_browser_exists(time_t t
);
3469 void run_elections(time_t t
);
3470 void process_election(struct subnet_record
*subrec
, struct packet_struct
*p
, char *buf
);
3471 bool check_elections(void);
3472 void nmbd_message_election(struct messaging_context
*msg
,
3475 struct server_id server_id
,
3478 /* The following definitions come from nmbd/nmbd_incomingdgrams.c */
3480 void tell_become_backup(void);
3481 void process_host_announce(struct subnet_record
*subrec
, struct packet_struct
*p
, char *buf
);
3482 void process_workgroup_announce(struct subnet_record
*subrec
, struct packet_struct
*p
, char *buf
);
3483 void process_local_master_announce(struct subnet_record
*subrec
, struct packet_struct
*p
, char *buf
);
3484 void process_master_browser_announce(struct subnet_record
*subrec
,
3485 struct packet_struct
*p
,char *buf
);
3486 void process_lm_host_announce(struct subnet_record
*subrec
, struct packet_struct
*p
, char *buf
, int len
);
3487 void process_get_backup_list_request(struct subnet_record
*subrec
,
3488 struct packet_struct
*p
,char *buf
);
3489 void process_reset_browser(struct subnet_record
*subrec
,
3490 struct packet_struct
*p
,char *buf
);
3491 void process_announce_request(struct subnet_record
*subrec
, struct packet_struct
*p
, char *buf
);
3492 void process_lm_announce_request(struct subnet_record
*subrec
, struct packet_struct
*p
, char *buf
, int len
);
3494 /* The following definitions come from nmbd/nmbd_incomingrequests.c */
3496 void process_name_release_request(struct subnet_record
*subrec
,
3497 struct packet_struct
*p
);
3498 void process_name_refresh_request(struct subnet_record
*subrec
,
3499 struct packet_struct
*p
);
3500 void process_name_registration_request(struct subnet_record
*subrec
,
3501 struct packet_struct
*p
);
3502 void process_node_status_request(struct subnet_record
*subrec
, struct packet_struct
*p
);
3503 void process_name_query_request(struct subnet_record
*subrec
, struct packet_struct
*p
);
3505 /* The following definitions come from nmbd/nmbd_lmhosts.c */
3507 void load_lmhosts_file(const char *fname
);
3508 bool find_name_in_lmhosts(struct nmb_name
*nmbname
, struct name_record
**namerecp
);
3510 /* The following definitions come from nmbd/nmbd_logonnames.c */
3512 void add_logon_names(void);
3514 /* The following definitions come from nmbd/nmbd_mynames.c */
3516 void register_my_workgroup_one_subnet(struct subnet_record
*subrec
);
3517 bool register_my_workgroup_and_names(void);
3518 void release_wins_names(void);
3519 void refresh_my_names(time_t t
);
3521 /* The following definitions come from nmbd/nmbd_namelistdb.c */
3523 void set_samba_nb_type(void);
3524 void remove_name_from_namelist(struct subnet_record
*subrec
,
3525 struct name_record
*namerec
);
3526 struct name_record
*find_name_on_subnet(struct subnet_record
*subrec
,
3527 const struct nmb_name
*nmbname
,
3529 struct name_record
*find_name_for_remote_broadcast_subnet(struct nmb_name
*nmbname
,
3531 void update_name_ttl( struct name_record
*namerec
, int ttl
);
3532 bool add_name_to_subnet( struct subnet_record
*subrec
,
3537 enum name_source source
,
3539 struct in_addr
*iplist
);
3540 void standard_success_register(struct subnet_record
*subrec
,
3541 struct userdata_struct
*userdata
,
3542 struct nmb_name
*nmbname
, uint16 nb_flags
, int ttl
,
3543 struct in_addr registered_ip
);
3544 void standard_fail_register( struct subnet_record
*subrec
,
3545 struct nmb_name
*nmbname
);
3546 bool find_ip_in_name_record( struct name_record
*namerec
, struct in_addr ip
);
3547 void add_ip_to_name_record( struct name_record
*namerec
, struct in_addr new_ip
);
3548 void remove_ip_from_name_record( struct name_record
*namerec
,
3549 struct in_addr remove_ip
);
3550 void standard_success_release( struct subnet_record
*subrec
,
3551 struct userdata_struct
*userdata
,
3552 struct nmb_name
*nmbname
,
3553 struct in_addr released_ip
);
3554 void expire_names(time_t t
);
3555 void add_samba_names_to_subnet( struct subnet_record
*subrec
);
3556 void dump_name_record( struct name_record
*namerec
, XFILE
*fp
);
3557 void dump_all_namelists(void);
3559 /* The following definitions come from nmbd/nmbd_namequery.c */
3561 bool query_name(struct subnet_record
*subrec
, const char *name
, int type
,
3562 query_name_success_function success_fn
,
3563 query_name_fail_function fail_fn
,
3564 struct userdata_struct
*userdata
);
3565 bool query_name_from_wins_server(struct in_addr ip_to
,
3566 const char *name
, int type
,
3567 query_name_success_function success_fn
,
3568 query_name_fail_function fail_fn
,
3569 struct userdata_struct
*userdata
);
3571 /* The following definitions come from nmbd/nmbd_nameregister.c */
3573 void register_name(struct subnet_record
*subrec
,
3574 const char *name
, int type
, uint16 nb_flags
,
3575 register_name_success_function success_fn
,
3576 register_name_fail_function fail_fn
,
3577 struct userdata_struct
*userdata
);
3578 void wins_refresh_name(struct name_record
*namerec
);
3580 /* The following definitions come from nmbd/nmbd_namerelease.c */
3582 void release_name(struct subnet_record
*subrec
, struct name_record
*namerec
,
3583 release_name_success_function success_fn
,
3584 release_name_fail_function fail_fn
,
3585 struct userdata_struct
*userdata
);
3587 /* The following definitions come from nmbd/nmbd_nodestatus.c */
3589 bool node_status(struct subnet_record
*subrec
, struct nmb_name
*nmbname
,
3590 struct in_addr send_ip
, node_status_success_function success_fn
,
3591 node_status_fail_function fail_fn
, struct userdata_struct
*userdata
);
3593 /* The following definitions come from nmbd/nmbd_packets.c */
3595 uint16
get_nb_flags(char *buf
);
3596 void set_nb_flags(char *buf
, uint16 nb_flags
);
3597 struct response_record
*queue_register_name( struct subnet_record
*subrec
,
3598 response_function resp_fn
,
3599 timeout_response_function timeout_fn
,
3600 register_name_success_function success_fn
,
3601 register_name_fail_function fail_fn
,
3602 struct userdata_struct
*userdata
,
3603 struct nmb_name
*nmbname
,
3605 void queue_wins_refresh(struct nmb_name
*nmbname
,
3606 response_function resp_fn
,
3607 timeout_response_function timeout_fn
,
3609 struct in_addr refresh_ip
,
3611 struct response_record
*queue_register_multihomed_name( struct subnet_record
*subrec
,
3612 response_function resp_fn
,
3613 timeout_response_function timeout_fn
,
3614 register_name_success_function success_fn
,
3615 register_name_fail_function fail_fn
,
3616 struct userdata_struct
*userdata
,
3617 struct nmb_name
*nmbname
,
3619 struct in_addr register_ip
,
3620 struct in_addr wins_ip
);
3621 struct response_record
*queue_release_name( struct subnet_record
*subrec
,
3622 response_function resp_fn
,
3623 timeout_response_function timeout_fn
,
3624 release_name_success_function success_fn
,
3625 release_name_fail_function fail_fn
,
3626 struct userdata_struct
*userdata
,
3627 struct nmb_name
*nmbname
,
3629 struct in_addr release_ip
,
3630 struct in_addr dest_ip
);
3631 struct response_record
*queue_query_name( struct subnet_record
*subrec
,
3632 response_function resp_fn
,
3633 timeout_response_function timeout_fn
,
3634 query_name_success_function success_fn
,
3635 query_name_fail_function fail_fn
,
3636 struct userdata_struct
*userdata
,
3637 struct nmb_name
*nmbname
);
3638 struct response_record
*queue_query_name_from_wins_server( struct in_addr to_ip
,
3639 response_function resp_fn
,
3640 timeout_response_function timeout_fn
,
3641 query_name_success_function success_fn
,
3642 query_name_fail_function fail_fn
,
3643 struct userdata_struct
*userdata
,
3644 struct nmb_name
*nmbname
);
3645 struct response_record
*queue_node_status( struct subnet_record
*subrec
,
3646 response_function resp_fn
,
3647 timeout_response_function timeout_fn
,
3648 node_status_success_function success_fn
,
3649 node_status_fail_function fail_fn
,
3650 struct userdata_struct
*userdata
,
3651 struct nmb_name
*nmbname
,
3652 struct in_addr send_ip
);
3653 void reply_netbios_packet(struct packet_struct
*orig_packet
,
3654 int rcode
, enum netbios_reply_type_code rcv_code
, int opcode
,
3655 int ttl
, char *data
,int len
);
3656 void queue_packet(struct packet_struct
*packet
);
3657 void run_packet_queue(void);
3658 void retransmit_or_expire_response_records(time_t t
);
3659 bool listen_for_packets(bool run_election
);
3660 bool send_mailslot(bool unique
, const char *mailslot
,char *buf
, size_t len
,
3661 const char *srcname
, int src_type
,
3662 const char *dstname
, int dest_type
,
3663 struct in_addr dest_ip
,struct in_addr src_ip
,
3666 /* The following definitions come from nmbd/nmbd_processlogon.c */
3668 bool initialize_nmbd_proxy_logon(void);
3670 void process_logon_packet(struct packet_struct
*p
, char *buf
,int len
,
3671 const char *mailslot
);
3673 /* The following definitions come from nmbd/nmbd_responserecordsdb.c */
3675 void remove_response_record(struct subnet_record
*subrec
,
3676 struct response_record
*rrec
);
3677 struct response_record
*make_response_record( struct subnet_record
*subrec
,
3678 struct packet_struct
*p
,
3679 response_function resp_fn
,
3680 timeout_response_function timeout_fn
,
3681 success_function success_fn
,
3682 fail_function fail_fn
,
3683 struct userdata_struct
*userdata
);
3684 struct response_record
*find_response_record(struct subnet_record
**ppsubrec
,
3686 bool is_refresh_already_queued(struct subnet_record
*subrec
, struct name_record
*namerec
);
3688 /* The following definitions come from nmbd/nmbd_sendannounce.c */
3690 void send_browser_reset(int reset_type
, const char *to_name
, int to_type
, struct in_addr to_ip
);
3691 void broadcast_announce_request(struct subnet_record
*subrec
, struct work_record
*work
);
3692 void announce_my_server_names(time_t t
);
3693 void announce_my_lm_server_names(time_t t
);
3694 void reset_announce_timer(void);
3695 void announce_myself_to_domain_master_browser(time_t t
);
3696 void announce_my_servers_removed(void);
3697 void announce_remote(time_t t
);
3698 void browse_sync_remote(time_t t
);
3700 /* The following definitions come from nmbd/nmbd_serverlistdb.c */
3702 void remove_all_servers(struct work_record
*work
);
3703 struct server_record
*find_server_in_workgroup(struct work_record
*work
, const char *name
);
3704 void remove_server_from_workgroup(struct work_record
*work
, struct server_record
*servrec
);
3705 struct server_record
*create_server_on_workgroup(struct work_record
*work
,
3706 const char *name
,int servertype
,
3707 int ttl
, const char *comment
);
3708 void update_server_ttl(struct server_record
*servrec
, int ttl
);
3709 void expire_servers(struct work_record
*work
, time_t t
);
3710 void write_browse_list_entry(XFILE
*fp
, const char *name
, uint32 rec_type
,
3711 const char *local_master_browser_name
, const char *description
);
3712 void write_browse_list(time_t t
, bool force_write
);
3714 /* The following definitions come from nmbd/nmbd_subnetdb.c */
3716 void close_subnet(struct subnet_record
*subrec
);
3717 struct subnet_record
*make_normal_subnet(const struct interface
*iface
);
3718 bool create_subnets(void);
3719 bool we_are_a_wins_client(void);
3720 struct subnet_record
*get_next_subnet_maybe_unicast(struct subnet_record
*subrec
);
3721 struct subnet_record
*get_next_subnet_maybe_unicast_or_wins_server(struct subnet_record
*subrec
);
3723 /* The following definitions come from nmbd/nmbd_synclists.c */
3725 void sync_browse_lists(struct work_record
*work
,
3726 char *name
, int nm_type
,
3727 struct in_addr ip
, bool local
, bool servers
);
3728 void sync_check_completion(void);
3730 /* The following definitions come from nmbd/nmbd_winsproxy.c */
3732 void make_wins_proxy_name_query_request( struct subnet_record
*subrec
,
3733 struct packet_struct
*incoming_packet
,
3734 struct nmb_name
*question_name
);
3736 /* The following definitions come from nmbd/nmbd_winsserver.c */
3738 struct name_record
*find_name_on_wins_subnet(const struct nmb_name
*nmbname
, bool self_only
);
3739 bool wins_store_changed_namerec(const struct name_record
*namerec
);
3740 bool add_name_to_wins_subnet(const struct name_record
*namerec
);
3741 bool remove_name_from_wins_namelist(struct name_record
*namerec
);
3742 void dump_wins_subnet_namelist(XFILE
*fp
);
3743 bool packet_is_for_wins_server(struct packet_struct
*packet
);
3744 bool initialise_wins(void);
3745 void wins_process_name_refresh_request( struct subnet_record
*subrec
,
3746 struct packet_struct
*p
);
3747 void wins_process_name_registration_request(struct subnet_record
*subrec
,
3748 struct packet_struct
*p
);
3749 void wins_process_multihomed_name_registration_request( struct subnet_record
*subrec
,
3750 struct packet_struct
*p
);
3751 void fetch_all_active_wins_1b_names(void);
3752 void send_wins_name_query_response(int rcode
, struct packet_struct
*p
,
3753 struct name_record
*namerec
);
3754 void wins_process_name_query_request(struct subnet_record
*subrec
,
3755 struct packet_struct
*p
);
3756 void wins_process_name_release_request(struct subnet_record
*subrec
,
3757 struct packet_struct
*p
);
3758 void initiate_wins_processing(time_t t
);
3759 void wins_write_name_record(struct name_record
*namerec
, XFILE
*fp
);
3760 void wins_write_database(time_t t
, bool background
);
3761 void nmbd_wins_new_entry(struct messaging_context
*msg
,
3764 struct server_id server_id
,
3767 /* The following definitions come from nmbd/nmbd_workgroupdb.c */
3769 struct work_record
*find_workgroup_on_subnet(struct subnet_record
*subrec
,
3771 struct work_record
*create_workgroup_on_subnet(struct subnet_record
*subrec
,
3772 const char *name
, int ttl
);
3773 void update_workgroup_ttl(struct work_record
*work
, int ttl
);
3774 void initiate_myworkgroup_startup(struct subnet_record
*subrec
, struct work_record
*work
);
3775 void dump_workgroups(bool force_write
);
3776 void expire_workgroups_and_servers(time_t t
);
3778 /* The following definitions come from param/loadparm.c */
3780 char *lp_smb_ports(void);
3781 char *lp_dos_charset(void);
3782 char *lp_unix_charset(void);
3783 char *lp_display_charset(void);
3784 char *lp_logfile(void);
3785 char *lp_configfile(void);
3786 char *lp_smb_passwd_file(void);
3787 char *lp_private_dir(void);
3788 char *lp_serverstring(void);
3789 int lp_printcap_cache_time(void);
3790 char *lp_addport_cmd(void);
3791 char *lp_enumports_cmd(void);
3792 char *lp_addprinter_cmd(void);
3793 char *lp_deleteprinter_cmd(void);
3794 char *lp_os2_driver_map(void);
3795 char *lp_lockdir(void);
3796 char *lp_statedir(void);
3797 char *lp_cachedir(void);
3798 char *lp_piddir(void);
3799 char *lp_mangling_method(void);
3800 int lp_mangle_prefix(void);
3801 char *lp_utmpdir(void);
3802 char *lp_wtmpdir(void);
3804 char *lp_rootdir(void);
3805 char *lp_defaultservice(void);
3806 char *lp_msg_command(void);
3807 char *lp_get_quota_command(void);
3808 char *lp_set_quota_command(void);
3809 char *lp_auto_services(void);
3810 char *lp_passwd_program(void);
3811 char *lp_passwd_chat(void);
3812 char *lp_passwordserver(void);
3813 char *lp_name_resolve_order(void);
3814 char *lp_realm(void);
3815 const char *lp_afs_username_map(void);
3816 int lp_afs_token_lifetime(void);
3817 char *lp_log_nt_token_command(void);
3818 char *lp_username_map(void);
3819 const char *lp_logon_script(void);
3820 const char *lp_logon_path(void);
3821 const char *lp_logon_drive(void);
3822 const char *lp_logon_home(void);
3823 char *lp_remote_announce(void);
3824 char *lp_remote_browse_sync(void);
3825 const char **lp_wins_server_list(void);
3826 const char **lp_interfaces(void);
3827 const char *lp_socket_address(void);
3828 char *lp_nis_home_map_name(void);
3829 const char **lp_netbios_aliases(void);
3830 const char *lp_passdb_backend(void);
3831 const char **lp_preload_modules(void);
3832 char *lp_panic_action(void);
3833 char *lp_adduser_script(void);
3834 char *lp_renameuser_script(void);
3835 char *lp_deluser_script(void);
3836 const char *lp_guestaccount(void);
3837 char *lp_addgroup_script(void);
3838 char *lp_delgroup_script(void);
3839 char *lp_addusertogroup_script(void);
3840 char *lp_deluserfromgroup_script(void);
3841 char *lp_setprimarygroup_script(void);
3842 char *lp_addmachine_script(void);
3843 char *lp_shutdown_script(void);
3844 char *lp_abort_shutdown_script(void);
3845 char *lp_username_map_script(void);
3846 char *lp_check_password_script(void);
3847 char *lp_wins_hook(void);
3848 const char *lp_template_homedir(void);
3849 const char *lp_template_shell(void);
3850 const char *lp_winbind_separator(void);
3851 int lp_acl_compatibility(void);
3852 bool lp_winbind_enum_users(void);
3853 bool lp_winbind_enum_groups(void);
3854 bool lp_winbind_use_default_domain(void);
3855 bool lp_winbind_trusted_domains_only(void);
3856 bool lp_winbind_nested_groups(void);
3857 int lp_winbind_expand_groups(void);
3858 bool lp_winbind_refresh_tickets(void);
3859 bool lp_winbind_offline_logon(void);
3860 bool lp_winbind_normalize_names(void);
3861 bool lp_winbind_rpc_only(void);
3862 const char **lp_idmap_domains(void);
3863 const char *lp_idmap_backend(void);
3864 char *lp_idmap_alloc_backend(void);
3865 int lp_idmap_cache_time(void);
3866 int lp_idmap_negative_cache_time(void);
3867 int lp_keepalive(void);
3868 bool lp_passdb_expand_explicit(void);
3869 char *lp_ldap_suffix(void);
3870 char *lp_ldap_admin_dn(void);
3871 int lp_ldap_ssl(void);
3872 bool lp_ldap_ssl_ads(void);
3873 int lp_ldap_passwd_sync(void);
3874 bool lp_ldap_delete_dn(void);
3875 int lp_ldap_replication_sleep(void);
3876 int lp_ldap_timeout(void);
3877 int lp_ldap_connection_timeout(void);
3878 int lp_ldap_page_size(void);
3879 int lp_ldap_debug_level(void);
3880 int lp_ldap_debug_threshold(void);
3881 char *lp_add_share_cmd(void);
3882 char *lp_change_share_cmd(void);
3883 char *lp_delete_share_cmd(void);
3884 char *lp_usershare_path(void);
3885 const char **lp_usershare_prefix_allow_list(void);
3886 const char **lp_usershare_prefix_deny_list(void);
3887 const char **lp_eventlog_list(void);
3888 bool lp_registry_shares(void);
3889 bool lp_usershare_allow_guests(void);
3890 bool lp_usershare_owner_only(void);
3891 bool lp_disable_netbios(void);
3892 bool lp_reset_on_zero_vc(void);
3893 bool lp_ms_add_printer_wizard(void);
3894 bool lp_dns_proxy(void);
3895 bool lp_wins_support(void);
3896 bool lp_we_are_a_wins_server(void);
3897 bool lp_wins_proxy(void);
3898 bool lp_local_master(void);
3899 bool lp_domain_logons(void);
3900 const char **lp_init_logon_delayed_hosts(void);
3901 int lp_init_logon_delay(void);
3902 bool lp_load_printers(void);
3903 bool lp_readraw(void);
3904 bool lp_large_readwrite(void);
3905 bool lp_writeraw(void);
3906 bool lp_null_passwords(void);
3907 bool lp_obey_pam_restrictions(void);
3908 bool lp_encrypted_passwords(void);
3909 bool lp_update_encrypted(void);
3910 int lp_client_schannel(void);
3911 int lp_server_schannel(void);
3912 bool lp_syslog_only(void);
3913 bool lp_timestamp_logs(void);
3914 bool lp_debug_prefix_timestamp(void);
3915 bool lp_debug_hires_timestamp(void);
3916 bool lp_debug_pid(void);
3917 bool lp_debug_uid(void);
3918 bool lp_debug_class(void);
3919 bool lp_enable_core_files(void);
3920 bool lp_browse_list(void);
3921 bool lp_nis_home_map(void);
3922 bool lp_bind_interfaces_only(void);
3923 bool lp_pam_password_change(void);
3924 bool lp_unix_password_sync(void);
3925 bool lp_passwd_chat_debug(void);
3926 int lp_passwd_chat_timeout(void);
3927 bool lp_nt_pipe_support(void);
3928 bool lp_nt_status_support(void);
3929 bool lp_stat_cache(void);
3930 int lp_max_stat_cache_size(void);
3931 bool lp_allow_trusted_domains(void);
3932 bool lp_map_untrusted_to_domain(void);
3933 int lp_restrict_anonymous(void);
3934 bool lp_lanman_auth(void);
3935 bool lp_ntlm_auth(void);
3936 bool lp_client_plaintext_auth(void);
3937 bool lp_client_lanman_auth(void);
3938 bool lp_client_ntlmv2_auth(void);
3939 bool lp_host_msdfs(void);
3940 bool lp_kernel_oplocks(void);
3941 bool lp_enhanced_browsing(void);
3942 bool lp_use_mmap(void);
3943 bool lp_unix_extensions(void);
3944 bool lp_use_spnego(void);
3945 bool lp_client_use_spnego(void);
3946 bool lp_hostname_lookups(void);
3947 bool lp_change_notify(const struct share_params
*p
);
3948 bool lp_kernel_change_notify(const struct share_params
*p
);
3949 char * lp_dedicated_keytab_file(void);
3950 int lp_kerberos_method(void);
3951 bool lp_defer_sharing_violations(void);
3952 bool lp_enable_privileges(void);
3953 bool lp_enable_asu_support(void);
3954 int lp_os_level(void);
3955 int lp_max_ttl(void);
3956 int lp_max_wins_ttl(void);
3957 int lp_min_wins_ttl(void);
3958 int lp_max_log_size(void);
3959 int lp_max_open_files(void);
3960 int lp_open_files_db_hash_size(void);
3961 int lp_maxxmit(void);
3962 int lp_maxmux(void);
3963 int lp_passwordlevel(void);
3964 int lp_usernamelevel(void);
3965 int lp_deadtime(void);
3966 bool lp_getwd_cache(void);
3967 int lp_maxprotocol(void);
3968 int lp_minprotocol(void);
3969 int lp_security(void);
3970 const char **lp_auth_methods(void);
3971 bool lp_paranoid_server_security(void);
3972 int lp_maxdisksize(void);
3973 int lp_lpqcachetime(void);
3974 int lp_max_smbd_processes(void);
3975 bool _lp_disable_spoolss(void);
3976 int lp_syslog(void);
3977 int lp_lm_announce(void);
3978 int lp_lm_interval(void);
3979 int lp_machine_password_timeout(void);
3980 int lp_map_to_guest(void);
3981 int lp_oplock_break_wait_time(void);
3982 int lp_lock_spin_time(void);
3983 int lp_usershare_max_shares(void);
3984 const char *lp_socket_options(void);
3985 int lp_config_backend(void);
3986 char *lp_preexec(int );
3987 char *lp_postexec(int );
3988 char *lp_rootpreexec(int );
3989 char *lp_rootpostexec(int );
3990 char *lp_servicename(int );
3991 const char *lp_const_servicename(int );
3992 char *lp_pathname(int );
3993 char *lp_dontdescend(int );
3994 char *lp_username(int );
3995 const char **lp_invalid_users(int );
3996 const char **lp_valid_users(int );
3997 const char **lp_admin_users(int );
3998 const char **lp_svcctl_list(void);
3999 char *lp_cups_options(int );
4000 char *lp_cups_server(void);
4001 int lp_cups_encrypt(void);
4002 char *lp_iprint_server(void);
4003 int lp_cups_connection_timeout(void);
4004 const char *lp_ctdbd_socket(void);
4005 const char **lp_cluster_addresses(void);
4006 bool lp_clustering(void);
4007 char *lp_printcommand(int );
4008 char *lp_lpqcommand(int );
4009 char *lp_lprmcommand(int );
4010 char *lp_lppausecommand(int );
4011 char *lp_lpresumecommand(int );
4012 char *lp_queuepausecommand(int );
4013 char *lp_queueresumecommand(int );
4014 const char *lp_printjob_username(int );
4015 const char **lp_hostsallow(int );
4016 const char **lp_hostsdeny(int );
4017 char *lp_magicscript(int );
4018 char *lp_magicoutput(int );
4019 char *lp_comment(int );
4020 char *lp_force_user(int );
4021 char *lp_force_group(int );
4022 const char **lp_readlist(int );
4023 const char **lp_writelist(int );
4024 const char **lp_printer_admin(int );
4025 char *lp_fstype(int );
4026 const char **lp_vfs_objects(int );
4027 char *lp_msdfs_proxy(int );
4028 char *lp_veto_files(int );
4029 char *lp_hide_files(int );
4030 char *lp_veto_oplocks(int );
4031 bool lp_msdfs_root(int );
4032 char *lp_aio_write_behind(int );
4033 char *lp_dfree_command(int );
4034 bool lp_autoloaded(int );
4035 bool lp_preexec_close(int );
4036 bool lp_rootpreexec_close(int );
4037 int lp_casesensitive(int );
4038 bool lp_preservecase(int );
4039 bool lp_shortpreservecase(int );
4040 bool lp_hide_dot_files(int );
4041 bool lp_hide_special_files(int );
4042 bool lp_hideunreadable(int );
4043 bool lp_hideunwriteable_files(int );
4044 bool lp_browseable(int );
4045 bool lp_access_based_share_enum(int );
4046 bool lp_readonly(int );
4047 bool lp_no_set_dir(int );
4048 bool lp_guest_ok(int );
4049 bool lp_guest_only(int );
4050 bool lp_administrative_share(int );
4051 bool lp_print_ok(int );
4052 bool lp_map_hidden(int );
4053 bool lp_map_archive(int );
4054 bool lp_store_dos_attributes(int );
4055 bool lp_dmapi_support(int );
4056 bool lp_locking(const struct share_params
*p
);
4057 int lp_strict_locking(const struct share_params
*p
);
4058 bool lp_posix_locking(const struct share_params
*p
);
4059 bool lp_share_modes(int );
4060 bool lp_oplocks(int );
4061 bool lp_level2_oplocks(int );
4062 bool lp_onlyuser(int );
4063 bool lp_manglednames(const struct share_params
*p
);
4064 bool lp_widelinks(int );
4065 bool lp_symlinks(int );
4066 bool lp_syncalways(int );
4067 bool lp_strict_allocate(int );
4068 bool lp_strict_sync(int );
4069 bool lp_map_system(int );
4070 bool lp_delete_readonly(int );
4071 bool lp_fake_oplocks(int );
4072 bool lp_recursive_veto_delete(int );
4073 bool lp_dos_filemode(int );
4074 bool lp_dos_filetimes(int );
4075 bool lp_dos_filetime_resolution(int );
4076 bool lp_fake_dir_create_times(int );
4077 bool lp_blocking_locks(int );
4078 bool lp_inherit_perms(int );
4079 bool lp_inherit_acls(int );
4080 bool lp_inherit_owner(int );
4081 bool lp_use_client_driver(int );
4082 bool lp_default_devmode(int );
4083 bool lp_force_printername(int );
4084 bool lp_nt_acl_support(int );
4085 bool lp_force_unknown_acl_user(int );
4086 bool lp_ea_support(int );
4087 bool _lp_use_sendfile(int );
4088 bool lp_profile_acls(int );
4089 bool lp_map_acl_inherit(int );
4090 bool lp_afs_share(int );
4091 bool lp_acl_check_permissions(int );
4092 bool lp_acl_group_control(int );
4093 bool lp_acl_map_full_control(int );
4094 int lp_create_mask(int );
4095 int lp_force_create_mode(int );
4096 int lp_security_mask(int );
4097 int lp_force_security_mode(int );
4098 int lp_dir_mask(int );
4099 int lp_force_dir_mode(int );
4100 int lp_dir_security_mask(int );
4101 int lp_force_dir_security_mode(int );
4102 int lp_max_connections(int );
4103 int lp_defaultcase(int );
4104 int lp_minprintspace(int );
4105 int lp_printing(int );
4106 int lp_max_reported_jobs(int );
4107 int lp_oplock_contention_limit(int );
4108 int lp_csc_policy(int );
4109 int lp_write_cache_size(int );
4110 int lp_block_size(int );
4111 int lp_dfree_cache_time(int );
4112 int lp_allocation_roundup_size(int );
4113 int lp_aio_read_size(int );
4114 int lp_aio_write_size(int );
4115 int lp_map_readonly(int );
4116 int lp_directory_name_cache_size(int );
4117 int lp_smb_encrypt(int );
4118 char lp_magicchar(const struct share_params
*p
);
4119 int lp_winbind_cache_time(void);
4120 int lp_winbind_reconnect_delay(void);
4121 const char **lp_winbind_nss_info(void);
4122 int lp_algorithmic_rid_base(void);
4123 int lp_name_cache_timeout(void);
4124 int lp_client_signing(void);
4125 int lp_server_signing(void);
4126 int lp_client_ldap_sasl_wrapping(void);
4127 char *lp_parm_talloc_string(int snum
, const char *type
, const char *option
, const char *def
);
4128 const char *lp_parm_const_string(int snum
, const char *type
, const char *option
, const char *def
);
4129 const char **lp_parm_string_list(int snum
, const char *type
, const char *option
, const char **def
);
4130 int lp_parm_int(int snum
, const char *type
, const char *option
, int def
);
4131 unsigned long lp_parm_ulong(int snum
, const char *type
, const char *option
, unsigned long def
);
4132 bool lp_parm_bool(int snum
, const char *type
, const char *option
, bool def
);
4133 int lp_parm_enum(int snum
, const char *type
, const char *option
,
4134 const struct enum_list
*_enum
, int def
);
4135 bool lp_add_home(const char *pszHomename
, int iDefaultService
,
4136 const char *user
, const char *pszHomedir
);
4137 int lp_add_service(const char *pszService
, int iDefaultService
);
4138 bool lp_add_printer(const char *pszPrintername
, int iDefaultService
);
4139 bool lp_parameter_is_valid(const char *pszParmName
);
4140 bool lp_parameter_is_global(const char *pszParmName
);
4141 bool lp_parameter_is_canonical(const char *parm_name
);
4142 bool lp_canonicalize_parameter(const char *parm_name
, const char **canon_parm
,
4144 bool lp_canonicalize_parameter_with_value(const char *parm_name
,
4146 const char **canon_parm
,
4147 const char **canon_val
);
4148 void show_parameter_list(void);
4149 bool lp_string_is_valid_boolean(const char *parm_value
);
4150 bool lp_invert_boolean(const char *str
, const char **inverse_str
);
4151 bool lp_canonicalize_boolean(const char *str
, const char**canon_str
);
4152 bool service_ok(int iService
);
4153 bool process_registry_service(const char *service_name
);
4154 bool process_registry_shares(void);
4155 bool lp_config_backend_is_registry(void);
4156 bool lp_config_backend_is_file(void);
4157 bool lp_file_list_changed(void);
4158 bool lp_idmap_uid(uid_t
*low
, uid_t
*high
);
4159 bool lp_idmap_gid(gid_t
*low
, gid_t
*high
);
4160 const char *lp_ldap_machine_suffix(void);
4161 const char *lp_ldap_user_suffix(void);
4162 const char *lp_ldap_group_suffix(void);
4163 const char *lp_ldap_idmap_suffix(void);
4164 void *lp_local_ptr_by_snum(int snum
, void *ptr
);
4165 bool lp_do_parameter(int snum
, const char *pszParmName
, const char *pszParmValue
);
4166 void init_locals(void);
4167 bool lp_is_default(int snum
, struct parm_struct
*parm
);
4168 bool dump_a_parameter(int snum
, char *parm_name
, FILE * f
, bool isGlobal
);
4169 struct parm_struct
*lp_get_parameter(const char *param_name
);
4170 struct parm_struct
*lp_next_parameter(int snum
, int *i
, int allparameters
);
4171 bool lp_snum_ok(int iService
);
4172 void lp_add_one_printer(const char *name
, const char *comment
, void *pdata
);
4173 bool lp_loaded(void);
4174 void lp_killunused(bool (*snumused
) (int));
4175 void lp_kill_all_services(void);
4176 void lp_killservice(int iServiceIn
);
4177 const char* server_role_str(uint32 role
);
4178 enum usershare_err
parse_usershare_file(TALLOC_CTX
*ctx
,
4179 SMB_STRUCT_STAT
*psbuf
,
4180 const char *servicename
,
4184 char **pp_sharepath
,
4187 bool *pallow_guest
);
4188 int load_usershare_service(const char *servicename
);
4189 int load_usershare_shares(void);
4190 void gfree_loadparm(void);
4191 void lp_set_in_client(bool b
);
4192 bool lp_is_in_client(void);
4193 bool lp_load_ex(const char *pszFname
,
4197 bool initialize_globals
,
4198 bool allow_include_registry
,
4199 bool allow_registry_shares
);
4200 bool lp_load(const char *pszFname
,
4204 bool initialize_globals
);
4205 bool lp_load_initial_only(const char *pszFname
);
4206 bool lp_load_with_registry_shares(const char *pszFname
,
4210 bool initialize_globals
);
4211 int lp_numservices(void);
4212 void lp_dump(FILE *f
, bool show_defaults
, int maxtoprint
);
4213 void lp_dump_one(FILE * f
, bool show_defaults
, int snum
);
4214 int lp_servicenumber(const char *pszServiceName
);
4215 bool share_defined(const char *service_name
);
4216 struct share_params
*get_share_params(TALLOC_CTX
*mem_ctx
,
4217 const char *sharename
);
4218 struct share_iterator
*share_list_all(TALLOC_CTX
*mem_ctx
);
4219 struct share_params
*next_share(struct share_iterator
*list
);
4220 struct share_params
*next_printer(struct share_iterator
*list
);
4221 struct share_params
*snum2params_static(int snum
);
4222 const char *volume_label(int snum
);
4223 int lp_server_role(void);
4224 bool lp_domain_master(void);
4225 bool lp_preferred_master(void);
4226 void lp_remove_service(int snum
);
4227 void lp_copy_service(int snum
, const char *new_name
);
4228 int lp_default_server_announce(void);
4229 int lp_major_announce_version(void);
4230 int lp_minor_announce_version(void);
4231 void lp_set_name_resolve_order(const char *new_order
);
4232 const char *lp_printername(int snum
);
4233 void lp_set_logfile(const char *name
);
4234 int lp_maxprintjobs(int snum
);
4235 const char *lp_printcapname(void);
4236 bool lp_disable_spoolss( void );
4237 void lp_set_spoolss_state( uint32 state
);
4238 uint32
lp_get_spoolss_state( void );
4239 bool lp_use_sendfile(int snum
, struct smb_signing_state
*signing_state
);
4240 void set_use_sendfile(int snum
, bool val
);
4241 void set_store_dos_attributes(int snum
, bool val
);
4242 void lp_set_mangling_method(const char *new_method
);
4243 bool lp_posix_pathnames(void);
4244 void lp_set_posix_pathnames(void);
4245 enum brl_flavour
lp_posix_cifsu_locktype(files_struct
*fsp
);
4246 void lp_set_posix_default_cifsx_readwrite_locktype(enum brl_flavour val
);
4247 int lp_min_receive_file_size(void);
4248 char* lp_perfcount_module(void);
4251 /* The following definitions come from param/util.c */
4253 uint32
get_int_param( const char* param
);
4254 char* get_string_param( const char* param
);
4256 /* The following definitions come from passdb/login_cache.c */
4258 bool login_cache_init(void);
4259 bool login_cache_shutdown(void);
4260 LOGIN_CACHE
* login_cache_read(struct samu
*sampass
);
4261 bool login_cache_write(const struct samu
*sampass
, LOGIN_CACHE entry
);
4262 bool login_cache_delentry(const struct samu
*sampass
);
4264 /* The following definitions come from passdb/lookup_sid.c */
4266 bool lookup_name(TALLOC_CTX
*mem_ctx
,
4267 const char *full_name
, int flags
,
4268 const char **ret_domain
, const char **ret_name
,
4269 DOM_SID
*ret_sid
, enum lsa_SidType
*ret_type
);
4270 bool lookup_name_smbconf(TALLOC_CTX
*mem_ctx
,
4271 const char *full_name
, int flags
,
4272 const char **ret_domain
, const char **ret_name
,
4273 DOM_SID
*ret_sid
, enum lsa_SidType
*ret_type
);
4274 NTSTATUS
lookup_sids(TALLOC_CTX
*mem_ctx
, int num_sids
,
4275 const DOM_SID
**sids
, int level
,
4276 struct lsa_dom_info
**ret_domains
,
4277 struct lsa_name_info
**ret_names
);
4278 bool lookup_sid(TALLOC_CTX
*mem_ctx
, const DOM_SID
*sid
,
4279 const char **ret_domain
, const char **ret_name
,
4280 enum lsa_SidType
*ret_type
);
4281 void store_uid_sid_cache(const DOM_SID
*psid
, uid_t uid
);
4282 void store_gid_sid_cache(const DOM_SID
*psid
, gid_t gid
);
4283 void uid_to_sid(DOM_SID
*psid
, uid_t uid
);
4284 void gid_to_sid(DOM_SID
*psid
, gid_t gid
);
4285 bool sid_to_uid(const DOM_SID
*psid
, uid_t
*puid
);
4286 bool sid_to_gid(const DOM_SID
*psid
, gid_t
*pgid
);
4288 /* The following definitions come from passdb/machine_sid.c */
4290 DOM_SID
*get_global_sam_sid(void);
4291 void reset_global_sam_sid(void) ;
4292 bool sid_check_is_domain(const DOM_SID
*sid
);
4293 bool sid_check_is_in_our_domain(const DOM_SID
*sid
);
4295 /* The following definitions come from passdb/passdb.c */
4297 const char *my_sam_name(void);
4298 struct samu
*samu_new( TALLOC_CTX
*ctx
);
4299 NTSTATUS
samu_set_unix(struct samu
*user
, const struct passwd
*pwd
);
4300 NTSTATUS
samu_alloc_rid_unix(struct samu
*user
, const struct passwd
*pwd
);
4301 char *pdb_encode_acct_ctrl(uint32 acct_ctrl
, size_t length
);
4302 uint32
pdb_decode_acct_ctrl(const char *p
);
4303 void pdb_sethexpwd(char p
[33], const unsigned char *pwd
, uint32 acct_ctrl
);
4304 bool pdb_gethexpwd(const char *p
, unsigned char *pwd
);
4305 void pdb_sethexhours(char *p
, const unsigned char *hours
);
4306 bool pdb_gethexhours(const char *p
, unsigned char *hours
);
4307 int algorithmic_rid_base(void);
4308 uid_t
algorithmic_pdb_user_rid_to_uid(uint32 user_rid
);
4309 uid_t
max_algorithmic_uid(void);
4310 uint32
algorithmic_pdb_uid_to_user_rid(uid_t uid
);
4311 gid_t
pdb_group_rid_to_gid(uint32 group_rid
);
4312 gid_t
max_algorithmic_gid(void);
4313 uint32
algorithmic_pdb_gid_to_group_rid(gid_t gid
);
4314 bool algorithmic_pdb_rid_is_user(uint32 rid
);
4315 bool lookup_global_sam_name(const char *name
, int flags
, uint32_t *rid
,
4316 enum lsa_SidType
*type
);
4317 NTSTATUS
local_password_change(const char *user_name
,
4319 const char *new_passwd
,
4322 bool init_samu_from_buffer(struct samu
*sampass
, uint32_t level
,
4323 uint8
*buf
, uint32 buflen
);
4324 uint32
init_buffer_from_samu (uint8
**buf
, struct samu
*sampass
, bool size_only
);
4325 bool pdb_copy_sam_account(struct samu
*dst
, struct samu
*src
);
4326 bool pdb_update_bad_password_count(struct samu
*sampass
, bool *updated
);
4327 bool pdb_update_autolock_flag(struct samu
*sampass
, bool *updated
);
4328 bool pdb_increment_bad_password_count(struct samu
*sampass
);
4329 bool is_dc_trusted_domain_situation(const char *domain_name
);
4330 bool get_trust_pw_clear(const char *domain
, char **ret_pwd
,
4331 const char **account_name
, uint32
*channel
);
4332 bool get_trust_pw_hash(const char *domain
, uint8 ret_pwd
[16],
4333 const char **account_name
, uint32
*channel
);
4334 struct samr_LogonHours
get_logon_hours_from_pdb(TALLOC_CTX
*mem_ctx
,
4336 /* The following definitions come from passdb/pdb_compat.c */
4338 uint32
pdb_get_user_rid (const struct samu
*sampass
);
4339 uint32
pdb_get_group_rid (struct samu
*sampass
);
4340 bool pdb_set_user_sid_from_rid (struct samu
*sampass
, uint32 rid
, enum pdb_value_state flag
);
4341 bool pdb_set_group_sid_from_rid (struct samu
*sampass
, uint32 grid
, enum pdb_value_state flag
);
4343 /* The following definitions come from passdb/pdb_get_set.c */
4345 uint32
pdb_get_acct_ctrl(const struct samu
*sampass
);
4346 time_t pdb_get_logon_time(const struct samu
*sampass
);
4347 time_t pdb_get_logoff_time(const struct samu
*sampass
);
4348 time_t pdb_get_kickoff_time(const struct samu
*sampass
);
4349 time_t pdb_get_bad_password_time(const struct samu
*sampass
);
4350 time_t pdb_get_pass_last_set_time(const struct samu
*sampass
);
4351 time_t pdb_get_pass_can_change_time(const struct samu
*sampass
);
4352 time_t pdb_get_pass_can_change_time_noncalc(const struct samu
*sampass
);
4353 time_t pdb_get_pass_must_change_time(const struct samu
*sampass
);
4354 bool pdb_get_pass_can_change(const struct samu
*sampass
);
4355 uint16
pdb_get_logon_divs(const struct samu
*sampass
);
4356 uint32
pdb_get_hours_len(const struct samu
*sampass
);
4357 const uint8
*pdb_get_hours(const struct samu
*sampass
);
4358 const uint8
*pdb_get_nt_passwd(const struct samu
*sampass
);
4359 const uint8
*pdb_get_lanman_passwd(const struct samu
*sampass
);
4360 const uint8
*pdb_get_pw_history(const struct samu
*sampass
, uint32
*current_hist_len
);
4361 const char *pdb_get_plaintext_passwd(const struct samu
*sampass
);
4362 const DOM_SID
*pdb_get_user_sid(const struct samu
*sampass
);
4363 const DOM_SID
*pdb_get_group_sid(struct samu
*sampass
);
4364 enum pdb_value_state
pdb_get_init_flags(const struct samu
*sampass
, enum pdb_elements element
);
4365 const char *pdb_get_username(const struct samu
*sampass
);
4366 const char *pdb_get_domain(const struct samu
*sampass
);
4367 const char *pdb_get_nt_username(const struct samu
*sampass
);
4368 const char *pdb_get_fullname(const struct samu
*sampass
);
4369 const char *pdb_get_homedir(const struct samu
*sampass
);
4370 const char *pdb_get_dir_drive(const struct samu
*sampass
);
4371 const char *pdb_get_logon_script(const struct samu
*sampass
);
4372 const char *pdb_get_profile_path(const struct samu
*sampass
);
4373 const char *pdb_get_acct_desc(const struct samu
*sampass
);
4374 const char *pdb_get_workstations(const struct samu
*sampass
);
4375 const char *pdb_get_comment(const struct samu
*sampass
);
4376 const char *pdb_get_munged_dial(const struct samu
*sampass
);
4377 uint16
pdb_get_bad_password_count(const struct samu
*sampass
);
4378 uint16
pdb_get_logon_count(const struct samu
*sampass
);
4379 uint32
pdb_get_unknown_6(const struct samu
*sampass
);
4380 void *pdb_get_backend_private_data(const struct samu
*sampass
, const struct pdb_methods
*my_methods
);
4381 bool pdb_set_acct_ctrl(struct samu
*sampass
, uint32 acct_ctrl
, enum pdb_value_state flag
);
4382 bool pdb_set_logon_time(struct samu
*sampass
, time_t mytime
, enum pdb_value_state flag
);
4383 bool pdb_set_logoff_time(struct samu
*sampass
, time_t mytime
, enum pdb_value_state flag
);
4384 bool pdb_set_kickoff_time(struct samu
*sampass
, time_t mytime
, enum pdb_value_state flag
);
4385 bool pdb_set_bad_password_time(struct samu
*sampass
, time_t mytime
, enum pdb_value_state flag
);
4386 bool pdb_set_pass_can_change_time(struct samu
*sampass
, time_t mytime
, enum pdb_value_state flag
);
4387 bool pdb_set_pass_must_change_time(struct samu
*sampass
, time_t mytime
, enum pdb_value_state flag
);
4388 bool pdb_set_pass_last_set_time(struct samu
*sampass
, time_t mytime
, enum pdb_value_state flag
);
4389 bool pdb_set_hours_len(struct samu
*sampass
, uint32 len
, enum pdb_value_state flag
);
4390 bool pdb_set_logon_divs(struct samu
*sampass
, uint16 hours
, enum pdb_value_state flag
);
4391 bool pdb_set_init_flags(struct samu
*sampass
, enum pdb_elements element
, enum pdb_value_state value_flag
);
4392 bool pdb_set_user_sid(struct samu
*sampass
, const DOM_SID
*u_sid
, enum pdb_value_state flag
);
4393 bool pdb_set_user_sid_from_string(struct samu
*sampass
, fstring u_sid
, enum pdb_value_state flag
);
4394 bool pdb_set_group_sid(struct samu
*sampass
, const DOM_SID
*g_sid
, enum pdb_value_state flag
);
4395 bool pdb_set_username(struct samu
*sampass
, const char *username
, enum pdb_value_state flag
);
4396 bool pdb_set_domain(struct samu
*sampass
, const char *domain
, enum pdb_value_state flag
);
4397 bool pdb_set_nt_username(struct samu
*sampass
, const char *nt_username
, enum pdb_value_state flag
);
4398 bool pdb_set_fullname(struct samu
*sampass
, const char *full_name
, enum pdb_value_state flag
);
4399 bool pdb_set_logon_script(struct samu
*sampass
, const char *logon_script
, enum pdb_value_state flag
);
4400 bool pdb_set_profile_path(struct samu
*sampass
, const char *profile_path
, enum pdb_value_state flag
);
4401 bool pdb_set_dir_drive(struct samu
*sampass
, const char *dir_drive
, enum pdb_value_state flag
);
4402 bool pdb_set_homedir(struct samu
*sampass
, const char *home_dir
, enum pdb_value_state flag
);
4403 bool pdb_set_acct_desc(struct samu
*sampass
, const char *acct_desc
, enum pdb_value_state flag
);
4404 bool pdb_set_workstations(struct samu
*sampass
, const char *workstations
, enum pdb_value_state flag
);
4405 bool pdb_set_comment(struct samu
*sampass
, const char *comment
, enum pdb_value_state flag
);
4406 bool pdb_set_munged_dial(struct samu
*sampass
, const char *munged_dial
, enum pdb_value_state flag
);
4407 bool pdb_set_nt_passwd(struct samu
*sampass
, const uint8 pwd
[NT_HASH_LEN
], enum pdb_value_state flag
);
4408 bool pdb_set_lanman_passwd(struct samu
*sampass
, const uint8 pwd
[LM_HASH_LEN
], enum pdb_value_state flag
);
4409 bool pdb_set_pw_history(struct samu
*sampass
, const uint8
*pwd
, uint32 historyLen
, enum pdb_value_state flag
);
4410 bool pdb_set_plaintext_pw_only(struct samu
*sampass
, const char *password
, enum pdb_value_state flag
);
4411 bool pdb_set_bad_password_count(struct samu
*sampass
, uint16 bad_password_count
, enum pdb_value_state flag
);
4412 bool pdb_set_logon_count(struct samu
*sampass
, uint16 logon_count
, enum pdb_value_state flag
);
4413 bool pdb_set_unknown_6(struct samu
*sampass
, uint32 unkn
, enum pdb_value_state flag
);
4414 bool pdb_set_hours(struct samu
*sampass
, const uint8
*hours
, enum pdb_value_state flag
);
4415 bool pdb_set_backend_private_data(struct samu
*sampass
, void *private_data
,
4416 void (*free_fn
)(void **),
4417 const struct pdb_methods
*my_methods
,
4418 enum pdb_value_state flag
);
4419 bool pdb_set_pass_can_change(struct samu
*sampass
, bool canchange
);
4420 bool pdb_set_plaintext_passwd(struct samu
*sampass
, const char *plaintext
);
4421 uint32
pdb_build_fields_present(struct samu
*sampass
);
4423 /* The following definitions come from passdb/pdb_interface.c */
4425 NTSTATUS
smb_register_passdb(int version
, const char *name
, pdb_init_function init
) ;
4426 struct pdb_init_function_entry
*pdb_find_backend_entry(const char *name
);
4427 struct event_context
*pdb_get_event_context(void);
4428 NTSTATUS
make_pdb_method_name(struct pdb_methods
**methods
, const char *selected
);
4429 bool pdb_getsampwnam(struct samu
*sam_acct
, const char *username
) ;
4430 bool guest_user_info( struct samu
*user
);
4431 bool pdb_getsampwsid(struct samu
*sam_acct
, const DOM_SID
*sid
) ;
4432 NTSTATUS
pdb_create_user(TALLOC_CTX
*mem_ctx
, const char *name
, uint32 flags
,
4434 NTSTATUS
pdb_delete_user(TALLOC_CTX
*mem_ctx
, struct samu
*sam_acct
);
4435 NTSTATUS
pdb_add_sam_account(struct samu
*sam_acct
) ;
4436 NTSTATUS
pdb_update_sam_account(struct samu
*sam_acct
) ;
4437 NTSTATUS
pdb_delete_sam_account(struct samu
*sam_acct
) ;
4438 NTSTATUS
pdb_rename_sam_account(struct samu
*oldname
, const char *newname
);
4439 NTSTATUS
pdb_update_login_attempts(struct samu
*sam_acct
, bool success
);
4440 bool pdb_getgrsid(GROUP_MAP
*map
, DOM_SID sid
);
4441 bool pdb_getgrgid(GROUP_MAP
*map
, gid_t gid
);
4442 bool pdb_getgrnam(GROUP_MAP
*map
, const char *name
);
4443 NTSTATUS
pdb_create_dom_group(TALLOC_CTX
*mem_ctx
, const char *name
,
4445 NTSTATUS
pdb_delete_dom_group(TALLOC_CTX
*mem_ctx
, uint32 rid
);
4446 NTSTATUS
pdb_add_group_mapping_entry(GROUP_MAP
*map
);
4447 NTSTATUS
pdb_update_group_mapping_entry(GROUP_MAP
*map
);
4448 NTSTATUS
pdb_delete_group_mapping_entry(DOM_SID sid
);
4449 bool pdb_enum_group_mapping(const DOM_SID
*sid
, enum lsa_SidType sid_name_use
, GROUP_MAP
**pp_rmap
,
4450 size_t *p_num_entries
, bool unix_only
);
4451 NTSTATUS
pdb_enum_group_members(TALLOC_CTX
*mem_ctx
,
4453 uint32
**pp_member_rids
,
4454 size_t *p_num_members
);
4455 NTSTATUS
pdb_enum_group_memberships(TALLOC_CTX
*mem_ctx
, struct samu
*user
,
4456 DOM_SID
**pp_sids
, gid_t
**pp_gids
,
4457 size_t *p_num_groups
);
4458 NTSTATUS
pdb_set_unix_primary_group(TALLOC_CTX
*mem_ctx
, struct samu
*user
);
4459 NTSTATUS
pdb_add_groupmem(TALLOC_CTX
*mem_ctx
, uint32 group_rid
,
4461 NTSTATUS
pdb_del_groupmem(TALLOC_CTX
*mem_ctx
, uint32 group_rid
,
4463 NTSTATUS
pdb_create_alias(const char *name
, uint32
*rid
);
4464 NTSTATUS
pdb_delete_alias(const DOM_SID
*sid
);
4465 NTSTATUS
pdb_get_aliasinfo(const DOM_SID
*sid
, struct acct_info
*info
);
4466 NTSTATUS
pdb_set_aliasinfo(const DOM_SID
*sid
, struct acct_info
*info
);
4467 NTSTATUS
pdb_add_aliasmem(const DOM_SID
*alias
, const DOM_SID
*member
);
4468 NTSTATUS
pdb_del_aliasmem(const DOM_SID
*alias
, const DOM_SID
*member
);
4469 NTSTATUS
pdb_enum_aliasmem(const DOM_SID
*alias
,
4470 DOM_SID
**pp_members
, size_t *p_num_members
);
4471 NTSTATUS
pdb_enum_alias_memberships(TALLOC_CTX
*mem_ctx
,
4472 const DOM_SID
*domain_sid
,
4473 const DOM_SID
*members
, size_t num_members
,
4474 uint32
**pp_alias_rids
,
4475 size_t *p_num_alias_rids
);
4476 NTSTATUS
pdb_lookup_rids(const DOM_SID
*domain_sid
,
4480 enum lsa_SidType
*attrs
);
4481 NTSTATUS
pdb_lookup_names(const DOM_SID
*domain_sid
,
4485 enum lsa_SidType
*attrs
);
4486 bool pdb_get_account_policy(int policy_index
, uint32
*value
);
4487 bool pdb_set_account_policy(int policy_index
, uint32 value
);
4488 bool pdb_get_seq_num(time_t *seq_num
);
4489 bool pdb_uid_to_rid(uid_t uid
, uint32
*rid
);
4490 bool pdb_uid_to_sid(uid_t uid
, DOM_SID
*sid
);
4491 bool pdb_gid_to_sid(gid_t gid
, DOM_SID
*sid
);
4492 bool pdb_sid_to_id(const DOM_SID
*sid
, union unid_t
*id
,
4493 enum lsa_SidType
*type
);
4494 bool pdb_rid_algorithm(void);
4495 bool pdb_new_rid(uint32
*rid
);
4496 bool initialize_password_db(bool reload
, struct event_context
*event_ctx
);
4497 struct pdb_search
*pdb_search_init(TALLOC_CTX
*mem_ctx
,
4498 enum pdb_search_type type
);
4499 struct pdb_search
*pdb_search_users(TALLOC_CTX
*mem_ctx
, uint32 acct_flags
);
4500 struct pdb_search
*pdb_search_groups(TALLOC_CTX
*mem_ctx
);
4501 struct pdb_search
*pdb_search_aliases(TALLOC_CTX
*mem_ctx
, const DOM_SID
*sid
);
4502 uint32
pdb_search_entries(struct pdb_search
*search
,
4503 uint32 start_idx
, uint32 max_entries
,
4504 struct samr_displayentry
**result
);
4505 bool pdb_get_trusteddom_pw(const char *domain
, char** pwd
, DOM_SID
*sid
,
4506 time_t *pass_last_set_time
);
4507 bool pdb_set_trusteddom_pw(const char* domain
, const char* pwd
,
4508 const DOM_SID
*sid
);
4509 bool pdb_del_trusteddom_pw(const char *domain
);
4510 NTSTATUS
pdb_enum_trusteddoms(TALLOC_CTX
*mem_ctx
, uint32
*num_domains
,
4511 struct trustdom_info
***domains
);
4512 NTSTATUS
make_pdb_method( struct pdb_methods
**methods
) ;
4514 /* The following definitions come from passdb/pdb_ldap.c */
4516 const char** get_userattr_list( TALLOC_CTX
*mem_ctx
, int schema_ver
);
4517 int ldapsam_search_suffix_by_name(struct ldapsam_privates
*ldap_state
,
4519 LDAPMessage
** result
,
4521 const char **talloc_attrs(TALLOC_CTX
*mem_ctx
, ...);
4522 NTSTATUS
pdb_init_ldapsam_compat(struct pdb_methods
**pdb_method
, const char *location
);
4523 NTSTATUS
pdb_init_ldapsam(struct pdb_methods
**pdb_method
, const char *location
);
4524 NTSTATUS
pdb_ldap_init(void);
4526 /* The following definitions come from passdb/pdb_nds.c */
4528 int pdb_nds_get_password(
4529 struct smbldap_state
*ldap_state
,
4533 int pdb_nds_set_password(
4534 struct smbldap_state
*ldap_state
,
4537 NTSTATUS
pdb_nds_init(void);
4539 /* The following definitions come from passdb/pdb_smbpasswd.c */
4541 NTSTATUS
pdb_smbpasswd_init(void) ;
4543 /* The following definitions come from passdb/pdb_wbc_sam.c */
4545 NTSTATUS
pdb_wbc_sam_init(void);
4547 /* The following definitions come from passdb/pdb_tdb.c */
4549 bool init_sam_from_buffer_v2(struct samu
*sampass
, uint8
*buf
, uint32 buflen
);
4550 NTSTATUS
pdb_tdbsam_init(void);
4552 /* The following definitions come from passdb/secrets.c */
4554 bool secrets_init(void);
4555 struct db_context
*secrets_db_ctx(void);
4556 void secrets_shutdown(void);
4557 void *secrets_fetch(const char *key
, size_t *size
);
4558 bool secrets_store(const char *key
, const void *data
, size_t size
);
4559 bool secrets_delete(const char *key
);
4560 bool secrets_store_domain_sid(const char *domain
, const DOM_SID
*sid
);
4561 bool secrets_fetch_domain_sid(const char *domain
, DOM_SID
*sid
);
4562 bool secrets_store_domain_guid(const char *domain
, struct GUID
*guid
);
4563 bool secrets_fetch_domain_guid(const char *domain
, struct GUID
*guid
);
4564 void *secrets_get_trust_account_lock(TALLOC_CTX
*mem_ctx
, const char *domain
);
4565 uint32
get_default_sec_channel(void);
4566 bool secrets_fetch_trust_account_password_legacy(const char *domain
,
4568 time_t *pass_last_set_time
,
4570 bool secrets_fetch_trust_account_password(const char *domain
, uint8 ret_pwd
[16],
4571 time_t *pass_last_set_time
,
4573 bool secrets_fetch_trusted_domain_password(const char *domain
, char** pwd
,
4574 DOM_SID
*sid
, time_t *pass_last_set_time
);
4575 bool secrets_store_trusted_domain_password(const char* domain
, const char* pwd
,
4576 const DOM_SID
*sid
);
4577 bool secrets_delete_machine_password(const char *domain
);
4578 bool secrets_delete_machine_password_ex(const char *domain
);
4579 bool secrets_delete_domain_sid(const char *domain
);
4580 bool secrets_store_machine_password(const char *pass
, const char *domain
, uint32 sec_channel
);
4581 char *secrets_fetch_machine_password(const char *domain
,
4582 time_t *pass_last_set_time
,
4584 bool trusted_domain_password_delete(const char *domain
);
4585 bool secrets_store_ldap_pw(const char* dn
, char* pw
);
4586 bool fetch_ldap_pw(char **dn
, char** pw
);
4587 NTSTATUS
secrets_trusted_domains(TALLOC_CTX
*mem_ctx
, uint32
*num_domains
,
4588 struct trustdom_info
***domains
);
4589 bool secrets_store_afs_keyfile(const char *cell
, const struct afs_keyfile
*keyfile
);
4590 bool secrets_fetch_afs_key(const char *cell
, struct afs_key
*result
);
4591 void secrets_fetch_ipc_userpass(char **username
, char **domain
, char **password
);
4592 bool secrets_store_schannel_session_info(TALLOC_CTX
*mem_ctx
,
4593 const char *remote_machine
,
4594 const struct dcinfo
*pdc
);
4595 bool secrets_restore_schannel_session_info(TALLOC_CTX
*mem_ctx
,
4596 const char *remote_machine
,
4597 struct dcinfo
**ppdc
);
4598 bool secrets_store_generic(const char *owner
, const char *key
, const char *secret
);
4599 char *secrets_fetch_generic(const char *owner
, const char *key
);
4600 bool secrets_store_local_schannel_key(uint8_t schannel_key
[16]);
4601 bool secrets_fetch_local_schannel_key(uint8_t schannel_key
[16]);
4603 /* The following definitions come from passdb/util_builtin.c */
4605 bool lookup_builtin_rid(TALLOC_CTX
*mem_ctx
, uint32 rid
, const char **name
);
4606 bool lookup_builtin_name(const char *name
, uint32
*rid
);
4607 const char *builtin_domain_name(void);
4608 bool sid_check_is_builtin(const DOM_SID
*sid
);
4609 bool sid_check_is_in_builtin(const DOM_SID
*sid
);
4611 /* The following definitions come from passdb/util_unixsids.c */
4613 bool sid_check_is_unix_users(const DOM_SID
*sid
);
4614 bool sid_check_is_in_unix_users(const DOM_SID
*sid
);
4615 bool uid_to_unix_users_sid(uid_t uid
, DOM_SID
*sid
);
4616 bool gid_to_unix_groups_sid(gid_t gid
, DOM_SID
*sid
);
4617 const char *unix_users_domain_name(void);
4618 bool lookup_unix_user_name(const char *name
, DOM_SID
*sid
);
4619 bool sid_check_is_unix_groups(const DOM_SID
*sid
);
4620 bool sid_check_is_in_unix_groups(const DOM_SID
*sid
);
4621 const char *unix_groups_domain_name(void);
4622 bool lookup_unix_group_name(const char *name
, DOM_SID
*sid
);
4624 /* The following definitions come from passdb/util_wellknown.c */
4626 bool sid_check_is_wellknown_domain(const DOM_SID
*sid
, const char **name
);
4627 bool sid_check_is_in_wellknown_domain(const DOM_SID
*sid
);
4628 bool lookup_wellknown_sid(TALLOC_CTX
*mem_ctx
, const DOM_SID
*sid
,
4629 const char **domain
, const char **name
);
4630 bool lookup_wellknown_name(TALLOC_CTX
*mem_ctx
, const char *name
,
4631 DOM_SID
*sid
, const char **domain
);
4633 /* The following definitions come from printing/load.c */
4635 void load_printers(void);
4637 /* The following definitions come from printing/lpq_parse.c */
4639 bool parse_lpq_entry(enum printing_types printing_type
,char *line
,
4640 print_queue_struct
*buf
,
4641 print_status_struct
*status
,bool first
);
4643 /* The following definitions come from printing/notify.c */
4645 int print_queue_snum(const char *qname
);
4646 void print_notify_send_messages(struct messaging_context
*msg_ctx
,
4647 unsigned int timeout
);
4648 void notify_printer_status_byname(const char *sharename
, uint32 status
);
4649 void notify_printer_status(int snum
, uint32 status
);
4650 void notify_job_status_byname(const char *sharename
, uint32 jobid
, uint32 status
,
4652 void notify_job_status(const char *sharename
, uint32 jobid
, uint32 status
);
4653 void notify_job_total_bytes(const char *sharename
, uint32 jobid
,
4655 void notify_job_total_pages(const char *sharename
, uint32 jobid
,
4657 void notify_job_username(const char *sharename
, uint32 jobid
, char *name
);
4658 void notify_job_name(const char *sharename
, uint32 jobid
, char *name
);
4659 void notify_job_submitted(const char *sharename
, uint32 jobid
,
4661 void notify_printer_driver(int snum
, char *driver_name
);
4662 void notify_printer_comment(int snum
, char *comment
);
4663 void notify_printer_sharename(int snum
, char *share_name
);
4664 void notify_printer_printername(int snum
, char *printername
);
4665 void notify_printer_port(int snum
, char *port_name
);
4666 void notify_printer_location(int snum
, char *location
);
4667 void notify_printer_byname( const char *printername
, uint32 change
, const char *value
);
4669 /* The following definitions come from printing/nt_printing.c */
4671 bool nt_printing_init(struct messaging_context
*msg_ctx
);
4672 uint32
update_c_setprinter(bool initialize
);
4673 uint32
get_c_setprinter(void);
4674 int get_builtin_ntforms(nt_forms_struct
**list
);
4675 bool get_a_builtin_ntform_by_string(const char *form_name
, nt_forms_struct
*form
);
4676 int get_ntforms(nt_forms_struct
**list
);
4677 int write_ntforms(nt_forms_struct
**list
, int number
);
4678 bool add_a_form(nt_forms_struct
**list
, struct spoolss_AddFormInfo1
*form
, int *count
);
4679 bool delete_a_form(nt_forms_struct
**list
, const char *del_name
, int *count
, WERROR
*ret
);
4680 void update_a_form(nt_forms_struct
**list
, struct spoolss_AddFormInfo1
*form
, int count
);
4681 int get_ntdrivers(fstring
**list
, const char *architecture
, uint32 version
);
4682 const char *get_short_archi(const char *long_archi
);
4683 WERROR
clean_up_driver_struct(struct pipes_struct
*rpc_pipe
,
4684 NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract
,
4686 WERROR
move_driver_to_download_area(struct pipes_struct
*p
,
4687 NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract
,
4688 uint32 level
, WERROR
*perr
);
4689 int pack_devicemode(NT_DEVICEMODE
*nt_devmode
, uint8
*buf
, int buflen
);
4690 uint32
del_a_printer(const char *sharename
);
4691 NT_DEVICEMODE
*construct_nt_devicemode(const fstring default_devicename
);
4692 void free_nt_devicemode(NT_DEVICEMODE
**devmode_ptr
);
4693 int unpack_devicemode(NT_DEVICEMODE
**nt_devmode
, const uint8
*buf
, int buflen
);
4694 int add_new_printer_key( NT_PRINTER_DATA
*data
, const char *name
);
4695 int delete_printer_key( NT_PRINTER_DATA
*data
, const char *name
);
4696 int lookup_printerkey( NT_PRINTER_DATA
*data
, const char *name
);
4697 int get_printer_subkeys( NT_PRINTER_DATA
*data
, const char* key
, fstring
**subkeys
);
4698 WERROR
nt_printer_publish(Printer_entry
*print_hnd
, int snum
, int action
);
4699 WERROR
check_published_printers(void);
4700 bool is_printer_published(Printer_entry
*print_hnd
, int snum
,
4702 WERROR
nt_printer_publish(Printer_entry
*print_hnd
, int snum
, int action
);
4703 WERROR
check_published_printers(void);
4704 bool is_printer_published(Printer_entry
*print_hnd
, int snum
,
4706 WERROR
delete_all_printer_data( NT_PRINTER_INFO_LEVEL_2
*p2
, const char *key
);
4707 WERROR
delete_printer_data( NT_PRINTER_INFO_LEVEL_2
*p2
, const char *key
, const char *value
);
4708 WERROR
add_printer_data( NT_PRINTER_INFO_LEVEL_2
*p2
, const char *key
, const char *value
,
4709 uint32 type
, uint8
*data
, int real_len
);
4710 struct regval_blob
* get_printer_data( NT_PRINTER_INFO_LEVEL_2
*p2
, const char *key
, const char *value
);
4711 WERROR
mod_a_printer(NT_PRINTER_INFO_LEVEL
*printer
, uint32 level
);
4712 bool set_driver_init(NT_PRINTER_INFO_LEVEL
*printer
, uint32 level
);
4713 bool del_driver_init(const char *drivername
);
4714 WERROR
save_driver_init(NT_PRINTER_INFO_LEVEL
*printer
, uint32 level
, uint8
*data
, uint32 data_len
);
4715 WERROR
get_a_printer( Printer_entry
*print_hnd
,
4716 NT_PRINTER_INFO_LEVEL
**pp_printer
,
4718 const char *sharename
);
4719 WERROR
get_a_printer_search( Printer_entry
*print_hnd
,
4720 NT_PRINTER_INFO_LEVEL
**pp_printer
,
4722 const char *sharename
);
4723 uint32
free_a_printer(NT_PRINTER_INFO_LEVEL
**pp_printer
, uint32 level
);
4724 uint32
add_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL driver
, uint32 level
);
4725 WERROR
get_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL
*driver
, uint32_t level
,
4726 const char *drivername
, const char *architecture
, uint32_t version
);
4727 uint32
free_a_printer_driver(NT_PRINTER_DRIVER_INFO_LEVEL driver
, uint32 level
);
4728 bool printer_driver_in_use ( NT_PRINTER_DRIVER_INFO_LEVEL_3
*info_3
);
4729 bool printer_driver_files_in_use ( NT_PRINTER_DRIVER_INFO_LEVEL_3
*info
);
4730 WERROR
delete_printer_driver(struct pipes_struct
*rpc_pipe
,
4731 NT_PRINTER_DRIVER_INFO_LEVEL_3
*info_3
,
4732 uint32 version
, bool delete_files
);
4733 WERROR
nt_printing_setsec(const char *sharename
, SEC_DESC_BUF
*secdesc_ctr
);
4734 bool nt_printing_getsec(TALLOC_CTX
*ctx
, const char *sharename
, SEC_DESC_BUF
**secdesc_ctr
);
4735 void map_printer_permissions(SEC_DESC
*sd
);
4736 void map_job_permissions(SEC_DESC
*sd
);
4737 bool print_access_check(struct auth_serversupplied_info
*server_info
, int snum
,
4739 bool print_time_access_check(const char *servicename
);
4740 char* get_server_name( Printer_entry
*printer
);
4742 /* The following definitions come from printing/pcap.c */
4744 bool pcap_cache_add_specific(struct pcap_cache
**ppcache
, const char *name
, const char *comment
);
4745 void pcap_cache_destroy_specific(struct pcap_cache
**ppcache
);
4746 bool pcap_cache_add(const char *name
, const char *comment
);
4747 bool pcap_cache_loaded(void);
4748 void pcap_cache_replace(const struct pcap_cache
*cache
);
4749 void pcap_cache_reload(void);
4750 bool pcap_printername_ok(const char *printername
);
4751 void pcap_printer_fn_specific(const struct pcap_cache
*, void (*fn
)(const char *, const char *, void *), void *);
4752 void pcap_printer_fn(void (*fn
)(const char *, const char *, void *), void *);
4754 /* The following definitions come from printing/print_aix.c */
4756 bool aix_cache_reload(void);
4758 /* The following definitions come from printing/print_cups.c */
4760 bool cups_cache_reload(void);
4761 bool cups_pull_comment_location(NT_PRINTER_INFO_LEVEL_2
*printer
);
4763 /* The following definitions come from printing/print_generic.c */
4766 /* The following definitions come from printing/print_iprint.c */
4768 bool iprint_cache_reload(void);
4770 /* The following definitions come from printing/print_svid.c */
4772 bool sysv_cache_reload(void);
4774 /* The following definitions come from printing/printfsp.c */
4776 NTSTATUS
print_fsp_open(struct smb_request
*req
, connection_struct
*conn
,
4778 uint16_t current_vuid
, files_struct
*fsp
,
4779 SMB_STRUCT_STAT
*psbuf
);
4780 void print_fsp_end(files_struct
*fsp
, enum file_close_type close_type
);
4782 /* The following definitions come from printing/printing.c */
4784 uint16
pjobid_to_rap(const char* sharename
, uint32 jobid
);
4785 bool rap_to_pjobid(uint16 rap_jobid
, fstring sharename
, uint32
*pjobid
);
4786 bool print_backend_init(struct messaging_context
*msg_ctx
);
4787 void printing_end(void);
4788 int unpack_pjob( uint8
*buf
, int buflen
, struct printjob
*pjob
);
4789 uint32
sysjob_to_jobid(int unix_jobid
);
4790 void pjob_delete(const char* sharename
, uint32 jobid
);
4791 void start_background_queue(void);
4792 bool print_notify_register_pid(int snum
);
4793 bool print_notify_deregister_pid(int snum
);
4794 bool print_job_exists(const char* sharename
, uint32 jobid
);
4795 int print_job_fd(const char* sharename
, uint32 jobid
);
4796 char *print_job_fname(const char* sharename
, uint32 jobid
);
4797 NT_DEVICEMODE
*print_job_devmode(const char* sharename
, uint32 jobid
);
4798 bool print_job_set_place(const char *sharename
, uint32 jobid
, int place
);
4799 bool print_job_set_name(const char *sharename
, uint32 jobid
, char *name
);
4800 bool print_job_delete(struct auth_serversupplied_info
*server_info
, int snum
,
4801 uint32 jobid
, WERROR
*errcode
);
4802 bool print_job_pause(struct auth_serversupplied_info
*server_info
, int snum
,
4803 uint32 jobid
, WERROR
*errcode
);
4804 bool print_job_resume(struct auth_serversupplied_info
*server_info
, int snum
,
4805 uint32 jobid
, WERROR
*errcode
);
4806 ssize_t
print_job_write(int snum
, uint32 jobid
, const char *buf
, SMB_OFF_T pos
, size_t size
);
4807 int print_queue_length(int snum
, print_status_struct
*pstatus
);
4808 uint32
print_job_start(struct auth_serversupplied_info
*server_info
, int snum
,
4809 const char *jobname
, NT_DEVICEMODE
*nt_devmode
);
4810 void print_job_endpage(int snum
, uint32 jobid
);
4811 bool print_job_end(int snum
, uint32 jobid
, enum file_close_type close_type
);
4812 int print_queue_status(int snum
,
4813 print_queue_struct
**ppqueue
,
4814 print_status_struct
*status
);
4815 WERROR
print_queue_pause(struct auth_serversupplied_info
*server_info
, int snum
);
4816 WERROR
print_queue_resume(struct auth_serversupplied_info
*server_info
, int snum
);
4817 WERROR
print_queue_purge(struct auth_serversupplied_info
*server_info
, int snum
);
4819 /* The following definitions come from printing/printing_db.c */
4821 struct tdb_print_db
*get_print_db_byname(const char *printername
);
4822 void release_print_db( struct tdb_print_db
*pdb
);
4823 void close_all_print_db(void);
4824 TDB_DATA
get_printer_notify_pid_list(TDB_CONTEXT
*tdb
, const char *printer_name
, bool cleanlist
);
4826 /* The following definitions come from profile/profile.c */
4828 void set_profile_level(int level
, struct server_id src
);
4829 bool profile_setup(struct messaging_context
*msg_ctx
, bool rdonly
);
4831 /* The following definitions come from registry/reg_api.c */
4833 WERROR
reg_openhive(TALLOC_CTX
*mem_ctx
, const char *hive
,
4834 uint32 desired_access
,
4835 const struct nt_user_token
*token
,
4836 struct registry_key
**pkey
);
4837 WERROR
reg_openkey(TALLOC_CTX
*mem_ctx
, struct registry_key
*parent
,
4838 const char *name
, uint32 desired_access
,
4839 struct registry_key
**pkey
);
4840 WERROR
reg_enumkey(TALLOC_CTX
*mem_ctx
, struct registry_key
*key
,
4841 uint32 idx
, char **name
, NTTIME
*last_write_time
);
4842 WERROR
reg_enumvalue(TALLOC_CTX
*mem_ctx
, struct registry_key
*key
,
4843 uint32 idx
, char **pname
, struct registry_value
**pval
);
4844 WERROR
reg_queryvalue(TALLOC_CTX
*mem_ctx
, struct registry_key
*key
,
4845 const char *name
, struct registry_value
**pval
);
4846 WERROR
reg_queryinfokey(struct registry_key
*key
, uint32_t *num_subkeys
,
4847 uint32_t *max_subkeylen
, uint32_t *max_subkeysize
,
4848 uint32_t *num_values
, uint32_t *max_valnamelen
,
4849 uint32_t *max_valbufsize
, uint32_t *secdescsize
,
4850 NTTIME
*last_changed_time
);
4851 WERROR
reg_createkey(TALLOC_CTX
*ctx
, struct registry_key
*parent
,
4852 const char *subkeypath
, uint32 desired_access
,
4853 struct registry_key
**pkey
,
4854 enum winreg_CreateAction
*paction
);
4855 WERROR
reg_deletekey(struct registry_key
*parent
, const char *path
);
4856 WERROR
reg_setvalue(struct registry_key
*key
, const char *name
,
4857 const struct registry_value
*val
);
4858 WERROR
reg_deletevalue(struct registry_key
*key
, const char *name
);
4859 WERROR
reg_getkeysecurity(TALLOC_CTX
*mem_ctx
, struct registry_key
*key
,
4860 struct security_descriptor
**psecdesc
);
4861 WERROR
reg_setkeysecurity(struct registry_key
*key
,
4862 struct security_descriptor
*psecdesc
);
4863 WERROR
reg_getversion(uint32_t *version
);
4864 WERROR
reg_restorekey(struct registry_key
*key
, const char *fname
);
4865 WERROR
reg_savekey(struct registry_key
*key
, const char *fname
);
4866 WERROR
reg_deleteallvalues(struct registry_key
*key
);
4867 WERROR
reg_open_path(TALLOC_CTX
*mem_ctx
, const char *orig_path
,
4868 uint32 desired_access
, const struct nt_user_token
*token
,
4869 struct registry_key
**pkey
);
4870 WERROR
reg_deletekey_recursive(TALLOC_CTX
*ctx
,
4871 struct registry_key
*parent
,
4873 WERROR
reg_deletesubkeys_recursive(TALLOC_CTX
*ctx
,
4874 struct registry_key
*parent
,
4876 WERROR
reg_create_path(TALLOC_CTX
*mem_ctx
, const char *orig_path
,
4877 uint32 desired_access
,
4878 const struct nt_user_token
*token
,
4879 enum winreg_CreateAction
*paction
,
4880 struct registry_key
**pkey
);
4881 WERROR
reg_delete_path(const struct nt_user_token
*token
,
4882 const char *orig_path
);
4884 /* The following definitions come from registry/reg_backend_current_version.c */
4887 /* The following definitions come from registry/reg_backend_db.c */
4889 WERROR
init_registry_key(const char *add_path
);
4890 WERROR
init_registry_data(void);
4891 WERROR
regdb_init(void);
4892 WERROR
regdb_open( void );
4893 int regdb_close( void );
4894 WERROR
regdb_transaction_start(void);
4895 WERROR
regdb_transaction_commit(void);
4896 WERROR
regdb_transaction_cancel(void);
4897 int regdb_get_seqnum(void);
4898 bool regdb_store_keys(const char *key
, struct regsubkey_ctr
*ctr
);
4899 int regdb_fetch_keys(const char *key
, struct regsubkey_ctr
*ctr
);
4900 int regdb_fetch_values(const char* key
, struct regval_ctr
*values
);
4901 bool regdb_store_values(const char *key
, struct regval_ctr
*values
);
4902 bool regdb_subkeys_need_update(struct regsubkey_ctr
*subkeys
);
4903 bool regdb_values_need_update(struct regval_ctr
*values
);
4905 /* The following definitions come from registry/reg_backend_hkpt_params.c */
4908 /* The following definitions come from registry/reg_backend_netlogon_params.c */
4911 /* The following definitions come from registry/reg_backend_perflib.c */
4914 /* The following definitions come from registry/reg_backend_printing.c */
4917 /* The following definitions come from registry/reg_backend_prod_options.c */
4920 /* The following definitions come from registry/reg_backend_shares.c */
4923 /* The following definitions come from registry/reg_backend_smbconf.c */
4926 /* The following definitions come from registry/reg_backend_tcpip_params.c */
4929 /* The following definitions come from registry/reg_cachehook.c */
4931 WERROR
reghook_cache_init(void);
4932 WERROR
reghook_cache_add(const char *keyname
, struct registry_ops
*ops
);
4933 struct registry_ops
*reghook_cache_find(const char *keyname
);
4934 void reghook_dump_cache( int debuglevel
);
4936 /* The following definitions come from registry/reg_dispatcher.c */
4938 bool store_reg_keys(struct registry_key_handle
*key
,
4939 struct regsubkey_ctr
*subkeys
);
4940 bool store_reg_values(struct registry_key_handle
*key
, struct regval_ctr
*val
);
4941 WERROR
create_reg_subkey(struct registry_key_handle
*key
, const char *subkey
);
4942 WERROR
delete_reg_subkey(struct registry_key_handle
*key
, const char *subkey
);
4943 int fetch_reg_keys(struct registry_key_handle
*key
,
4944 struct regsubkey_ctr
*subkey_ctr
);
4945 int fetch_reg_values(struct registry_key_handle
*key
, struct regval_ctr
*val
);
4946 bool regkey_access_check(struct registry_key_handle
*key
, uint32 requested
,
4948 const struct nt_user_token
*token
);
4949 WERROR
regkey_get_secdesc(TALLOC_CTX
*mem_ctx
, struct registry_key_handle
*key
,
4950 struct security_descriptor
**psecdesc
);
4951 WERROR
regkey_set_secdesc(struct registry_key_handle
*key
,
4952 struct security_descriptor
*psecdesc
);
4953 bool reg_subkeys_need_update(struct registry_key_handle
*key
,
4954 struct regsubkey_ctr
*subkeys
);
4955 bool reg_values_need_update(struct registry_key_handle
*key
,
4956 struct regval_ctr
*values
);
4958 /* The following definitions come from registry/reg_eventlog.c */
4960 bool eventlog_init_keys(void);
4961 bool eventlog_add_source( const char *eventlog
, const char *sourcename
,
4962 const char *messagefile
);
4964 /* The following definitions come from registry/reg_init_basic.c */
4966 WERROR
registry_init_common(void);
4967 WERROR
registry_init_basic(void);
4969 /* The following definitions come from registry/reg_init_full.c */
4971 WERROR
registry_init_full(void);
4973 /* The following definitions come from registry/reg_init_smbconf.c */
4975 NTSTATUS
registry_create_admin_token(TALLOC_CTX
*mem_ctx
,
4976 NT_USER_TOKEN
**ptoken
);
4977 WERROR
registry_init_smbconf(const char *keyname
);
4979 /* The following definitions come from registry/reg_objects.c */
4981 WERROR
regsubkey_ctr_init(TALLOC_CTX
*mem_ctx
, struct regsubkey_ctr
**ctr
);
4982 WERROR
regsubkey_ctr_set_seqnum(struct regsubkey_ctr
*ctr
, int seqnum
);
4983 int regsubkey_ctr_get_seqnum(struct regsubkey_ctr
*ctr
);
4984 WERROR
regsubkey_ctr_addkey( struct regsubkey_ctr
*ctr
, const char *keyname
);
4985 WERROR
regsubkey_ctr_delkey( struct regsubkey_ctr
*ctr
, const char *keyname
);
4986 bool regsubkey_ctr_key_exists( struct regsubkey_ctr
*ctr
, const char *keyname
);
4987 int regsubkey_ctr_numkeys( struct regsubkey_ctr
*ctr
);
4988 char* regsubkey_ctr_specific_key( struct regsubkey_ctr
*ctr
, uint32 key_index
);
4989 int regval_ctr_numvals(struct regval_ctr
*ctr
);
4990 struct regval_blob
* dup_registry_value(struct regval_blob
*val
);
4991 void free_registry_value(struct regval_blob
*val
);
4992 uint8
* regval_data_p(struct regval_blob
*val
);
4993 uint32
regval_size(struct regval_blob
*val
);
4994 char* regval_name(struct regval_blob
*val
);
4995 uint32
regval_type(struct regval_blob
*val
);
4996 struct regval_blob
* regval_ctr_specific_value(struct regval_ctr
*ctr
,
4998 bool regval_ctr_key_exists(struct regval_ctr
*ctr
, const char *value
);
4999 struct regval_blob
*regval_compose(TALLOC_CTX
*ctx
, const char *name
,
5001 const char *data_p
, size_t size
);
5002 int regval_ctr_addvalue(struct regval_ctr
*ctr
, const char *name
, uint16 type
,
5003 const char *data_p
, size_t size
);
5004 int regval_ctr_copyvalue(struct regval_ctr
*ctr
, struct regval_blob
*val
);
5005 int regval_ctr_delvalue(struct regval_ctr
*ctr
, const char *name
);
5006 struct regval_blob
* regval_ctr_getvalue(struct regval_ctr
*ctr
,
5008 uint32
regval_dword(struct regval_blob
*val
);
5009 char *regval_sz(struct regval_blob
*val
);
5011 /* The following definitions come from registry/reg_perfcount.c */
5013 void perfcount_init_keys( void );
5014 uint32
reg_perfcount_get_base_index(void);
5015 uint32
reg_perfcount_get_last_counter(uint32 base_index
);
5016 uint32
reg_perfcount_get_last_help(uint32 last_counter
);
5017 uint32
reg_perfcount_get_counter_help(uint32 base_index
, char **retbuf
);
5018 uint32
reg_perfcount_get_counter_names(uint32 base_index
, char **retbuf
);
5019 bool _reg_perfcount_get_counter_data(TDB_DATA key
, TDB_DATA
*data
);
5020 bool _reg_perfcount_get_instance_info(PERF_INSTANCE_DEFINITION
*inst
,
5023 PERF_OBJECT_TYPE
*obj
,
5024 TDB_CONTEXT
*names
);
5025 bool _reg_perfcount_add_instance(PERF_OBJECT_TYPE
*obj
,
5028 TDB_CONTEXT
*names
);
5029 uint32
reg_perfcount_get_perf_data_block(uint32 base_index
,
5031 PERF_DATA_BLOCK
*block
,
5032 const char *object_ids
);
5033 WERROR
reg_perfcount_get_hkpd(prs_struct
*ps
, uint32 max_buf_size
, uint32
*outbuf_len
, const char *object_ids
);
5035 /* The following definitions come from registry/reg_util.c */
5037 bool reg_split_path(char *path
, char **base
, char **new_path
);
5038 bool reg_split_key(char *path
, char **base
, char **key
);
5039 char *normalize_reg_path(TALLOC_CTX
*ctx
, const char *keyname
);
5040 void normalize_dbkey(char *key
);
5041 char *reg_remaining_path(TALLOC_CTX
*ctx
, const char *key
);
5042 int regval_convert_multi_sz( uint16
*multi_string
, size_t byte_len
, char ***values
);
5043 size_t regval_build_multi_sz( char **values
, uint16
**buffer
);
5045 /* The following definitions come from registry/reg_util_legacy.c */
5047 WERROR
regkey_open_internal(TALLOC_CTX
*ctx
,
5048 struct registry_key_handle
**regkey
,
5050 const struct nt_user_token
*token
,
5051 uint32 access_desired
);
5053 /* The following definitions come from registry/regfio.c */
5056 /* The following definitions come from rpc_client/cli_lsarpc.c */
5058 NTSTATUS
rpccli_lsa_open_policy(struct rpc_pipe_client
*cli
,
5059 TALLOC_CTX
*mem_ctx
,
5060 bool sec_qos
, uint32 des_access
,
5061 struct policy_handle
*pol
);
5062 NTSTATUS
rpccli_lsa_open_policy2(struct rpc_pipe_client
*cli
,
5063 TALLOC_CTX
*mem_ctx
, bool sec_qos
,
5064 uint32 des_access
, struct policy_handle
*pol
);
5065 NTSTATUS
rpccli_lsa_lookup_sids(struct rpc_pipe_client
*cli
,
5066 TALLOC_CTX
*mem_ctx
,
5067 struct policy_handle
*pol
,
5069 const DOM_SID
*sids
,
5072 enum lsa_SidType
**ptypes
);
5073 NTSTATUS
rpccli_lsa_lookup_names(struct rpc_pipe_client
*cli
,
5074 TALLOC_CTX
*mem_ctx
,
5075 struct policy_handle
*pol
, int num_names
,
5077 const char ***dom_names
,
5080 enum lsa_SidType
**types
);
5081 bool fetch_domain_sid( char *domain
, char *remote_machine
, DOM_SID
*psid
);
5083 /* The following definitions come from rpc_client/cli_netlogon.c */
5085 NTSTATUS
rpccli_netlogon_setup_creds(struct rpc_pipe_client
*cli
,
5086 const char *server_name
,
5088 const char *clnt_name
,
5089 const char *machine_account
,
5090 const unsigned char machine_pwd
[16],
5091 enum netr_SchannelType sec_chan_type
,
5092 uint32_t *neg_flags_inout
);
5093 NTSTATUS
rpccli_netlogon_sam_logon(struct rpc_pipe_client
*cli
,
5094 TALLOC_CTX
*mem_ctx
,
5095 uint32 logon_parameters
,
5097 const char *username
,
5098 const char *password
,
5099 const char *workstation
,
5101 NTSTATUS
rpccli_netlogon_sam_network_logon(struct rpc_pipe_client
*cli
,
5102 TALLOC_CTX
*mem_ctx
,
5103 uint32 logon_parameters
,
5105 const char *username
,
5107 const char *workstation
,
5108 const uint8 chal
[8],
5109 DATA_BLOB lm_response
,
5110 DATA_BLOB nt_response
,
5111 struct netr_SamInfo3
**info3
);
5112 NTSTATUS
rpccli_netlogon_sam_network_logon_ex(struct rpc_pipe_client
*cli
,
5113 TALLOC_CTX
*mem_ctx
,
5114 uint32 logon_parameters
,
5116 const char *username
,
5118 const char *workstation
,
5119 const uint8 chal
[8],
5120 DATA_BLOB lm_response
,
5121 DATA_BLOB nt_response
,
5122 struct netr_SamInfo3
**info3
);
5123 NTSTATUS
rpccli_netlogon_set_trust_password(struct rpc_pipe_client
*cli
,
5124 TALLOC_CTX
*mem_ctx
,
5125 const unsigned char orig_trust_passwd_hash
[16],
5126 const char *new_trust_pwd_cleartext
,
5127 const unsigned char new_trust_passwd_hash
[16],
5128 uint32_t sec_channel_type
);
5130 /* The following definitions come from rpc_client/cli_pipe.c */
5132 struct tevent_req
*rpc_api_pipe_req_send(TALLOC_CTX
*mem_ctx
,
5133 struct event_context
*ev
,
5134 struct rpc_pipe_client
*cli
,
5136 prs_struct
*req_data
);
5137 NTSTATUS
rpc_api_pipe_req_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
5138 prs_struct
*reply_pdu
);
5139 NTSTATUS
rpc_api_pipe_req(TALLOC_CTX
*mem_ctx
, struct rpc_pipe_client
*cli
,
5141 prs_struct
*in_data
,
5142 prs_struct
*out_data
);
5143 struct tevent_req
*rpc_pipe_bind_send(TALLOC_CTX
*mem_ctx
,
5144 struct event_context
*ev
,
5145 struct rpc_pipe_client
*cli
,
5146 struct cli_pipe_auth_data
*auth
);
5147 NTSTATUS
rpc_pipe_bind_recv(struct tevent_req
*req
);
5148 NTSTATUS
rpc_pipe_bind(struct rpc_pipe_client
*cli
,
5149 struct cli_pipe_auth_data
*auth
);
5150 unsigned int rpccli_set_timeout(struct rpc_pipe_client
*cli
,
5151 unsigned int timeout
);
5152 bool rpccli_get_pwd_hash(struct rpc_pipe_client
*cli
, uint8_t nt_hash
[16]);
5153 NTSTATUS
rpccli_anon_bind_data(TALLOC_CTX
*mem_ctx
,
5154 struct cli_pipe_auth_data
**presult
);
5155 NTSTATUS
rpccli_ntlmssp_bind_data(TALLOC_CTX
*mem_ctx
,
5156 enum pipe_auth_type auth_type
,
5157 enum pipe_auth_level auth_level
,
5159 const char *username
,
5160 const char *password
,
5161 struct cli_pipe_auth_data
**presult
);
5162 NTSTATUS
rpccli_schannel_bind_data(TALLOC_CTX
*mem_ctx
, const char *domain
,
5163 enum pipe_auth_level auth_level
,
5164 const uint8_t sess_key
[16],
5165 struct cli_pipe_auth_data
**presult
);
5166 NTSTATUS
rpccli_kerberos_bind_data(TALLOC_CTX
*mem_ctx
,
5167 enum pipe_auth_level auth_level
,
5168 const char *service_princ
,
5169 const char *username
,
5170 const char *password
,
5171 struct cli_pipe_auth_data
**presult
);
5172 NTSTATUS
rpc_pipe_open_tcp(TALLOC_CTX
*mem_ctx
, const char *host
,
5173 const struct ndr_syntax_id
*abstract_syntax
,
5174 struct rpc_pipe_client
**presult
);
5175 NTSTATUS
rpc_pipe_open_ncalrpc(TALLOC_CTX
*mem_ctx
, const char *socket_path
,
5176 const struct ndr_syntax_id
*abstract_syntax
,
5177 struct rpc_pipe_client
**presult
);
5178 NTSTATUS
rpc_pipe_open_internal(TALLOC_CTX
*mem_ctx
, const struct ndr_syntax_id
*abstract_syntax
,
5179 NTSTATUS (*dispatch
) (struct rpc_pipe_client
*cli
, TALLOC_CTX
*mem_ctx
, const struct ndr_interface_table
*table
, uint32_t opnum
, void *r
),
5180 struct auth_serversupplied_info
*serversupplied_info
,
5181 struct rpc_pipe_client
**presult
);
5182 NTSTATUS
cli_rpc_pipe_open_noauth(struct cli_state
*cli
,
5183 const struct ndr_syntax_id
*interface
,
5184 struct rpc_pipe_client
**presult
);
5185 NTSTATUS
cli_rpc_pipe_open_ntlmssp(struct cli_state
*cli
,
5186 const struct ndr_syntax_id
*interface
,
5187 enum pipe_auth_level auth_level
,
5189 const char *username
,
5190 const char *password
,
5191 struct rpc_pipe_client
**presult
);
5192 NTSTATUS
cli_rpc_pipe_open_spnego_ntlmssp(struct cli_state
*cli
,
5193 const struct ndr_syntax_id
*interface
,
5194 enum pipe_auth_level auth_level
,
5196 const char *username
,
5197 const char *password
,
5198 struct rpc_pipe_client
**presult
);
5199 NTSTATUS
get_schannel_session_key(struct cli_state
*cli
,
5202 struct rpc_pipe_client
**presult
);
5203 NTSTATUS
cli_rpc_pipe_open_schannel_with_key(struct cli_state
*cli
,
5204 const struct ndr_syntax_id
*interface
,
5205 enum pipe_auth_level auth_level
,
5207 struct netlogon_creds_CredentialState
**pdc
,
5208 struct rpc_pipe_client
**presult
);
5209 NTSTATUS
cli_rpc_pipe_open_ntlmssp_auth_schannel(struct cli_state
*cli
,
5210 const struct ndr_syntax_id
*interface
,
5211 enum pipe_auth_level auth_level
,
5213 const char *username
,
5214 const char *password
,
5215 struct rpc_pipe_client
**presult
);
5216 NTSTATUS
cli_rpc_pipe_open_schannel(struct cli_state
*cli
,
5217 const struct ndr_syntax_id
*interface
,
5218 enum pipe_auth_level auth_level
,
5220 struct rpc_pipe_client
**presult
);
5221 NTSTATUS
cli_rpc_pipe_open_krb5(struct cli_state
*cli
,
5222 const struct ndr_syntax_id
*interface
,
5223 enum pipe_auth_level auth_level
,
5224 const char *service_princ
,
5225 const char *username
,
5226 const char *password
,
5227 struct rpc_pipe_client
**presult
);
5228 NTSTATUS
cli_get_session_key(TALLOC_CTX
*mem_ctx
,
5229 struct rpc_pipe_client
*cli
,
5230 DATA_BLOB
*session_key
);
5231 NTSTATUS
rpc_pipe_open_local(TALLOC_CTX
*mem_ctx
,
5232 struct rpc_cli_smbd_conn
*conn
,
5233 const struct ndr_syntax_id
*syntax
,
5234 struct rpc_pipe_client
**presult
);
5236 /* The following definitions come from rpc_client/rpc_transport_np.c */
5238 struct tevent_req
*rpc_transport_np_init_send(TALLOC_CTX
*mem_ctx
,
5239 struct event_context
*ev
,
5240 struct cli_state
*cli
,
5241 const struct ndr_syntax_id
*abstract_syntax
);
5242 NTSTATUS
rpc_transport_np_init_recv(struct tevent_req
*req
,
5243 TALLOC_CTX
*mem_ctx
,
5244 struct rpc_cli_transport
**presult
);
5245 NTSTATUS
rpc_transport_np_init(TALLOC_CTX
*mem_ctx
, struct cli_state
*cli
,
5246 const struct ndr_syntax_id
*abstract_syntax
,
5247 struct rpc_cli_transport
**presult
);
5248 struct cli_state
*rpc_pipe_np_smb_conn(struct rpc_pipe_client
*p
);
5250 /* The following definitions come from rpc_client/rpc_transport_smbd.c */
5252 struct tevent_req
*rpc_cli_smbd_conn_init_send(TALLOC_CTX
*mem_ctx
,
5253 struct event_context
*ev
,
5254 void (*stdout_callback
)(char *buf
,
5258 NTSTATUS
rpc_cli_smbd_conn_init_recv(struct tevent_req
*req
,
5259 TALLOC_CTX
*mem_ctx
,
5260 struct rpc_cli_smbd_conn
**pconn
);
5261 NTSTATUS
rpc_cli_smbd_conn_init(TALLOC_CTX
*mem_ctx
,
5262 struct rpc_cli_smbd_conn
**pconn
,
5263 void (*stdout_callback
)(char *buf
,
5268 struct tevent_req
*rpc_transport_smbd_init_send(TALLOC_CTX
*mem_ctx
,
5269 struct event_context
*ev
,
5270 struct rpc_cli_smbd_conn
*conn
,
5271 const struct ndr_syntax_id
*abstract_syntax
);
5272 NTSTATUS
rpc_transport_smbd_init_recv(struct tevent_req
*req
,
5273 TALLOC_CTX
*mem_ctx
,
5274 struct rpc_cli_transport
**presult
);
5275 NTSTATUS
rpc_transport_smbd_init(TALLOC_CTX
*mem_ctx
,
5276 struct rpc_cli_smbd_conn
*conn
,
5277 const struct ndr_syntax_id
*abstract_syntax
,
5278 struct rpc_cli_transport
**presult
);
5280 /* The following definitions come from rpc_client/rpc_transport_sock.c */
5282 NTSTATUS
rpc_transport_sock_init(TALLOC_CTX
*mem_ctx
, int fd
,
5283 struct rpc_cli_transport
**presult
);
5285 /* The following definitions come from rpc_client/cli_reg.c */
5287 NTSTATUS
rpccli_winreg_Connect(struct rpc_pipe_client
*cli
, TALLOC_CTX
*mem_ctx
,
5288 uint32 reg_type
, uint32 access_mask
,
5289 struct policy_handle
*reg_hnd
);
5291 /* The following definitions come from rpc_client/cli_samr.c */
5293 NTSTATUS
rpccli_samr_chgpasswd_user(struct rpc_pipe_client
*cli
,
5294 TALLOC_CTX
*mem_ctx
,
5295 struct policy_handle
*user_handle
,
5296 const char *newpassword
,
5297 const char *oldpassword
);
5298 NTSTATUS
rpccli_samr_chgpasswd_user2(struct rpc_pipe_client
*cli
,
5299 TALLOC_CTX
*mem_ctx
,
5300 const char *username
,
5301 const char *newpassword
,
5302 const char *oldpassword
);
5303 NTSTATUS
rpccli_samr_chng_pswd_auth_crap(struct rpc_pipe_client
*cli
,
5304 TALLOC_CTX
*mem_ctx
,
5305 const char *username
,
5306 DATA_BLOB new_nt_password_blob
,
5307 DATA_BLOB old_nt_hash_enc_blob
,
5308 DATA_BLOB new_lm_password_blob
,
5309 DATA_BLOB old_lm_hash_enc_blob
);
5310 NTSTATUS
rpccli_samr_chgpasswd_user3(struct rpc_pipe_client
*cli
,
5311 TALLOC_CTX
*mem_ctx
,
5312 const char *username
,
5313 const char *newpassword
,
5314 const char *oldpassword
,
5315 struct samr_DomInfo1
**dominfo1
,
5316 struct samr_ChangeReject
**reject
);
5317 void get_query_dispinfo_params(int loop_count
, uint32
*max_entries
,
5319 NTSTATUS
rpccli_try_samr_connects(struct rpc_pipe_client
*cli
,
5320 TALLOC_CTX
*mem_ctx
,
5321 uint32_t access_mask
,
5322 struct policy_handle
*connect_pol
);
5324 /* The following definitions come from rpc_client/cli_spoolss.c */
5326 WERROR
rpccli_spoolss_openprinter_ex(struct rpc_pipe_client
*cli
,
5327 TALLOC_CTX
*mem_ctx
,
5328 const char *printername
,
5329 uint32_t access_desired
,
5330 struct policy_handle
*handle
);
5331 WERROR
rpccli_spoolss_getprinterdriver2(struct rpc_pipe_client
*cli
,
5332 TALLOC_CTX
*mem_ctx
,
5333 struct policy_handle
*handle
,
5334 const char *architecture
,
5337 uint32_t client_major_version
,
5338 uint32_t client_minor_version
,
5339 union spoolss_DriverInfo
*info
,
5340 uint32_t *server_major_version
,
5341 uint32_t *server_minor_version
);
5342 WERROR
rpccli_spoolss_addprinterex(struct rpc_pipe_client
*cli
,
5343 TALLOC_CTX
*mem_ctx
,
5344 struct spoolss_SetPrinterInfoCtr
*info_ctr
);
5345 WERROR
rpccli_spoolss_getprinter(struct rpc_pipe_client
*cli
,
5346 TALLOC_CTX
*mem_ctx
,
5347 struct policy_handle
*handle
,
5350 union spoolss_PrinterInfo
*info
);
5351 WERROR
rpccli_spoolss_getjob(struct rpc_pipe_client
*cli
,
5352 TALLOC_CTX
*mem_ctx
,
5353 struct policy_handle
*handle
,
5357 union spoolss_JobInfo
*info
);
5358 WERROR
rpccli_spoolss_enumforms(struct rpc_pipe_client
*cli
,
5359 TALLOC_CTX
*mem_ctx
,
5360 struct policy_handle
*handle
,
5364 union spoolss_FormInfo
**info
);
5365 WERROR
rpccli_spoolss_enumprintprocessors(struct rpc_pipe_client
*cli
,
5366 TALLOC_CTX
*mem_ctx
,
5367 const char *servername
,
5368 const char *environment
,
5372 union spoolss_PrintProcessorInfo
**info
);
5373 WERROR
rpccli_spoolss_enumprintprocessordatatypes(struct rpc_pipe_client
*cli
,
5374 TALLOC_CTX
*mem_ctx
,
5375 const char *servername
,
5376 const char *print_processor_name
,
5380 union spoolss_PrintProcDataTypesInfo
**info
);
5381 WERROR
rpccli_spoolss_enumports(struct rpc_pipe_client
*cli
,
5382 TALLOC_CTX
*mem_ctx
,
5383 const char *servername
,
5387 union spoolss_PortInfo
**info
);
5388 WERROR
rpccli_spoolss_enummonitors(struct rpc_pipe_client
*cli
,
5389 TALLOC_CTX
*mem_ctx
,
5390 const char *servername
,
5394 union spoolss_MonitorInfo
**info
);
5395 WERROR
rpccli_spoolss_enumjobs(struct rpc_pipe_client
*cli
,
5396 TALLOC_CTX
*mem_ctx
,
5397 struct policy_handle
*handle
,
5403 union spoolss_JobInfo
**info
);
5404 WERROR
rpccli_spoolss_enumprinterdrivers(struct rpc_pipe_client
*cli
,
5405 TALLOC_CTX
*mem_ctx
,
5407 const char *environment
,
5411 union spoolss_DriverInfo
**info
);
5412 WERROR
rpccli_spoolss_enumprinters(struct rpc_pipe_client
*cli
,
5413 TALLOC_CTX
*mem_ctx
,
5419 union spoolss_PrinterInfo
**info
);
5420 WERROR
rpccli_spoolss_getprinterdata(struct rpc_pipe_client
*cli
,
5421 TALLOC_CTX
*mem_ctx
,
5422 struct policy_handle
*handle
,
5423 const char *value_name
,
5425 enum winreg_Type
*type
,
5426 union spoolss_PrinterData
*data
);
5427 WERROR
rpccli_spoolss_enumprinterkey(struct rpc_pipe_client
*cli
,
5428 TALLOC_CTX
*mem_ctx
,
5429 struct policy_handle
*handle
,
5430 const char *key_name
,
5431 const char ***key_buffer
,
5433 WERROR
rpccli_spoolss_enumprinterdataex(struct rpc_pipe_client
*cli
,
5434 TALLOC_CTX
*mem_ctx
,
5435 struct policy_handle
*handle
,
5436 const char *key_name
,
5439 struct spoolss_PrinterEnumValues
**info
);
5441 /* The following definitions come from rpc_client/init_spoolss.c */
5443 bool init_systemtime(struct spoolss_Time
*r
,
5444 struct tm
*unixtime
);
5445 WERROR
pull_spoolss_PrinterData(TALLOC_CTX
*mem_ctx
,
5446 const DATA_BLOB
*blob
,
5447 union spoolss_PrinterData
*data
,
5448 enum winreg_Type type
);
5449 WERROR
push_spoolss_PrinterData(TALLOC_CTX
*mem_ctx
, DATA_BLOB
*blob
,
5450 enum winreg_Type type
,
5451 union spoolss_PrinterData
*data
);
5453 /* The following definitions come from rpc_client/init_lsa.c */
5455 void init_lsa_String(struct lsa_String
*name
, const char *s
);
5456 void init_lsa_StringLarge(struct lsa_StringLarge
*name
, const char *s
);
5457 void init_lsa_AsciiString(struct lsa_AsciiString
*name
, const char *s
);
5458 void init_lsa_AsciiStringLarge(struct lsa_AsciiStringLarge
*name
, const char *s
);
5460 /* The following definitions come from rpc_client/init_netlogon.c */
5462 void init_netr_SamBaseInfo(struct netr_SamBaseInfo
*r
,
5466 NTTIME last_password_change
,
5467 NTTIME allow_password_change
,
5468 NTTIME force_password_change
,
5469 const char *account_name
,
5470 const char *full_name
,
5471 const char *logon_script
,
5472 const char *profile_path
,
5473 const char *home_directory
,
5474 const char *home_drive
,
5475 uint16_t logon_count
,
5476 uint16_t bad_password_count
,
5478 uint32_t primary_gid
,
5479 struct samr_RidWithAttributeArray groups
,
5480 uint32_t user_flags
,
5481 struct netr_UserSessionKey key
,
5482 const char *logon_server
,
5484 struct dom_sid2
*domain_sid
,
5485 struct netr_LMSessionKey LMSessKey
,
5486 uint32_t acct_flags
);
5487 void init_netr_SamInfo3(struct netr_SamInfo3
*r
,
5491 NTTIME last_password_change
,
5492 NTTIME allow_password_change
,
5493 NTTIME force_password_change
,
5494 const char *account_name
,
5495 const char *full_name
,
5496 const char *logon_script
,
5497 const char *profile_path
,
5498 const char *home_directory
,
5499 const char *home_drive
,
5500 uint16_t logon_count
,
5501 uint16_t bad_password_count
,
5503 uint32_t primary_gid
,
5504 struct samr_RidWithAttributeArray groups
,
5505 uint32_t user_flags
,
5506 struct netr_UserSessionKey key
,
5507 const char *logon_server
,
5509 struct dom_sid2
*domain_sid
,
5510 struct netr_LMSessionKey LMSessKey
,
5511 uint32_t acct_flags
,
5513 struct netr_SidAttr
*sids
);
5514 NTSTATUS
serverinfo_to_SamInfo3(struct auth_serversupplied_info
*server_info
,
5515 uint8_t *pipe_session_key
,
5516 size_t pipe_session_key_len
,
5517 struct netr_SamInfo3
*sam3
);
5518 void init_netr_IdentityInfo(struct netr_IdentityInfo
*r
,
5519 const char *domain_name
,
5520 uint32_t parameter_control
,
5521 uint32_t logon_id_low
,
5522 uint32_t logon_id_high
,
5523 const char *account_name
,
5524 const char *workstation
);
5525 void init_netr_NetworkInfo(struct netr_NetworkInfo
*r
,
5526 const char *domain_name
,
5527 uint32_t parameter_control
,
5528 uint32_t logon_id_low
,
5529 uint32_t logon_id_high
,
5530 const char *account_name
,
5531 const char *workstation
,
5532 uint8_t challenge
[8],
5533 struct netr_ChallengeResponse nt
,
5534 struct netr_ChallengeResponse lm
);
5535 void init_netr_PasswordInfo(struct netr_PasswordInfo
*r
,
5536 const char *domain_name
,
5537 uint32_t parameter_control
,
5538 uint32_t logon_id_low
,
5539 uint32_t logon_id_high
,
5540 const char *account_name
,
5541 const char *workstation
,
5542 struct samr_Password lmpassword
,
5543 struct samr_Password ntpassword
);
5544 void init_netr_CryptPassword(const char *pwd
,
5545 unsigned char session_key
[16],
5546 struct netr_CryptPassword
*pwd_buf
);
5548 /* The following definitions come from rpc_client/init_samr.c */
5550 void init_samr_CryptPasswordEx(const char *pwd
,
5551 DATA_BLOB
*session_key
,
5552 struct samr_CryptPasswordEx
*pwd_buf
);
5553 void init_samr_CryptPassword(const char *pwd
,
5554 DATA_BLOB
*session_key
,
5555 struct samr_CryptPassword
*pwd_buf
);
5557 /* The following definitions come from rpc_client/ndr.c */
5559 NTSTATUS
cli_do_rpc_ndr(struct rpc_pipe_client
*cli
,
5560 TALLOC_CTX
*mem_ctx
,
5561 const struct ndr_interface_table
*table
,
5562 uint32 opnum
, void *r
);
5564 /* The following definitions come from rpc_parse/parse_misc.c */
5566 bool smb_io_time(const char *desc
, NTTIME
*nttime
, prs_struct
*ps
, int depth
);
5567 bool smb_io_system_time(const char *desc
, prs_struct
*ps
, int depth
, SYSTEMTIME
*systime
);
5568 bool make_systemtime(SYSTEMTIME
*systime
, struct tm
*unixtime
);
5569 bool smb_io_uuid(const char *desc
, struct GUID
*uuid
,
5570 prs_struct
*ps
, int depth
);
5571 void init_unistr2(UNISTR2
*str
, const char *buf
, enum unistr2_term_codes flags
);
5573 /* The following definitions come from rpc_parse/parse_prs.c */
5575 void prs_dump(const char *name
, int v
, prs_struct
*ps
);
5576 void prs_dump_before(const char *name
, int v
, prs_struct
*ps
);
5577 void prs_dump_region(const char *name
, int v
, prs_struct
*ps
,
5578 int from_off
, int to_off
);
5579 void prs_debug(prs_struct
*ps
, int depth
, const char *desc
, const char *fn_name
);
5580 bool prs_init(prs_struct
*ps
, uint32 size
, TALLOC_CTX
*ctx
, bool io
);
5581 void prs_mem_free(prs_struct
*ps
);
5582 void prs_mem_clear(prs_struct
*ps
);
5583 char *prs_alloc_mem_(prs_struct
*ps
, size_t size
, unsigned int count
);
5584 char *prs_alloc_mem(prs_struct
*ps
, size_t size
, unsigned int count
);
5585 TALLOC_CTX
*prs_get_mem_context(prs_struct
*ps
);
5586 void prs_give_memory(prs_struct
*ps
, char *buf
, uint32 size
, bool is_dynamic
);
5587 char *prs_take_memory(prs_struct
*ps
, uint32
*psize
);
5588 bool prs_set_buffer_size(prs_struct
*ps
, uint32 newsize
);
5589 bool prs_grow(prs_struct
*ps
, uint32 extra_space
);
5590 bool prs_force_grow(prs_struct
*ps
, uint32 extra_space
);
5591 char *prs_data_p(prs_struct
*ps
);
5592 uint32
prs_data_size(prs_struct
*ps
);
5593 uint32
prs_offset(prs_struct
*ps
);
5594 bool prs_set_offset(prs_struct
*ps
, uint32 offset
);
5595 bool prs_append_prs_data(prs_struct
*dst
, prs_struct
*src
);
5596 bool prs_append_some_data(prs_struct
*dst
, void *src_base
, uint32_t start
,
5598 bool prs_append_some_prs_data(prs_struct
*dst
, prs_struct
*src
, int32 start
, uint32 len
);
5599 bool prs_copy_data_in(prs_struct
*dst
, const char *src
, uint32 len
);
5600 bool prs_copy_data_out(char *dst
, prs_struct
*src
, uint32 len
);
5601 bool prs_copy_all_data_out(char *dst
, prs_struct
*src
);
5602 void prs_set_endian_data(prs_struct
*ps
, bool endian
);
5603 bool prs_align(prs_struct
*ps
);
5604 bool prs_align_uint16(prs_struct
*ps
);
5605 bool prs_align_uint64(prs_struct
*ps
);
5606 bool prs_align_custom(prs_struct
*ps
, uint8 boundary
);
5607 bool prs_align_needed(prs_struct
*ps
, uint32 needed
);
5608 char *prs_mem_get(prs_struct
*ps
, uint32 extra_size
);
5609 void prs_switch_type(prs_struct
*ps
, bool io
);
5610 void prs_force_dynamic(prs_struct
*ps
);
5611 void prs_set_session_key(prs_struct
*ps
, const char sess_key
[16]);
5612 bool prs_uint8(const char *name
, prs_struct
*ps
, int depth
, uint8
*data8
);
5613 bool prs_pointer( const char *name
, prs_struct
*ps
, int depth
,
5614 void *dta
, size_t data_size
,
5615 bool (*prs_fn
)(const char*, prs_struct
*, int, void*) );
5616 bool prs_uint16(const char *name
, prs_struct
*ps
, int depth
, uint16
*data16
);
5617 bool prs_uint32(const char *name
, prs_struct
*ps
, int depth
, uint32
*data32
);
5618 bool prs_int32(const char *name
, prs_struct
*ps
, int depth
, int32
*data32
);
5619 bool prs_uint64(const char *name
, prs_struct
*ps
, int depth
, uint64
*data64
);
5620 bool prs_ntstatus(const char *name
, prs_struct
*ps
, int depth
, NTSTATUS
*status
);
5621 bool prs_dcerpc_status(const char *name
, prs_struct
*ps
, int depth
, NTSTATUS
*status
);
5622 bool prs_werror(const char *name
, prs_struct
*ps
, int depth
, WERROR
*status
);
5623 bool prs_uint8s(bool charmode
, const char *name
, prs_struct
*ps
, int depth
, uint8
*data8s
, int len
);
5624 bool prs_uint16s(bool charmode
, const char *name
, prs_struct
*ps
, int depth
, uint16
*data16s
, int len
);
5625 bool prs_uint16uni(bool charmode
, const char *name
, prs_struct
*ps
, int depth
, uint16
*data16s
, int len
);
5626 bool prs_uint32s(bool charmode
, const char *name
, prs_struct
*ps
, int depth
, uint32
*data32s
, int len
);
5627 bool prs_unistr(const char *name
, prs_struct
*ps
, int depth
, UNISTR
*str
);
5628 bool prs_string(const char *name
, prs_struct
*ps
, int depth
, char *str
, int max_buf_size
);
5629 bool prs_string_alloc(const char *name
, prs_struct
*ps
, int depth
, const char **str
);
5630 bool prs_uint16_pre(const char *name
, prs_struct
*ps
, int depth
, uint16
*data16
, uint32
*offset
);
5631 bool prs_uint16_post(const char *name
, prs_struct
*ps
, int depth
, uint16
*data16
,
5632 uint32 ptr_uint16
, uint32 start_offset
);
5633 bool prs_uint32_pre(const char *name
, prs_struct
*ps
, int depth
, uint32
*data32
, uint32
*offset
);
5634 bool prs_uint32_post(const char *name
, prs_struct
*ps
, int depth
, uint32
*data32
,
5635 uint32 ptr_uint32
, uint32 data_size
);
5636 int tdb_prs_store(TDB_CONTEXT
*tdb
, TDB_DATA kbuf
, prs_struct
*ps
);
5637 int tdb_prs_fetch(TDB_CONTEXT
*tdb
, TDB_DATA kbuf
, prs_struct
*ps
, TALLOC_CTX
*mem_ctx
);
5638 bool prs_hash1(prs_struct
*ps
, uint32 offset
, int len
);
5639 void schannel_encode(struct schannel_auth_struct
*a
, enum pipe_auth_level auth_level
,
5640 enum schannel_direction direction
,
5641 RPC_AUTH_SCHANNEL_CHK
* verf
,
5642 char *data
, size_t data_len
);
5643 bool schannel_decode(struct schannel_auth_struct
*a
, enum pipe_auth_level auth_level
,
5644 enum schannel_direction direction
,
5645 RPC_AUTH_SCHANNEL_CHK
* verf
, char *data
, size_t data_len
);
5646 bool prs_init_data_blob(prs_struct
*prs
, DATA_BLOB
*blob
, TALLOC_CTX
*mem_ctx
);
5647 bool prs_data_blob(prs_struct
*prs
, DATA_BLOB
*blob
, TALLOC_CTX
*mem_ctx
);
5649 /* The following definitions come from rpc_parse/parse_rpc.c */
5651 const char *get_pipe_name_from_iface(const struct ndr_syntax_id
*interface
);
5652 void init_rpc_hdr(RPC_HDR
*hdr
, enum RPC_PKT_TYPE pkt_type
, uint8 flags
,
5653 uint32 call_id
, int data_len
, int auth_len
);
5654 bool smb_io_rpc_hdr(const char *desc
, RPC_HDR
*rpc
, prs_struct
*ps
, int depth
);
5655 void init_rpc_context(RPC_CONTEXT
*rpc_ctx
, uint16 context_id
,
5656 const RPC_IFACE
*abstract
, const RPC_IFACE
*transfer
);
5657 void init_rpc_hdr_rb(RPC_HDR_RB
*rpc
,
5658 uint16 max_tsize
, uint16 max_rsize
, uint32 assoc_gid
,
5659 RPC_CONTEXT
*context
);
5660 bool smb_io_rpc_context(const char *desc
, RPC_CONTEXT
*rpc_ctx
, prs_struct
*ps
, int depth
);
5661 bool smb_io_rpc_hdr_rb(const char *desc
, RPC_HDR_RB
*rpc
, prs_struct
*ps
, int depth
);
5662 void init_rpc_hdr_ba(RPC_HDR_BA
*rpc
,
5663 uint16 max_tsize
, uint16 max_rsize
, uint32 assoc_gid
,
5664 const char *pipe_addr
,
5665 uint8 num_results
, uint16 result
, uint16 reason
,
5666 RPC_IFACE
*transfer
);
5667 bool smb_io_rpc_hdr_ba(const char *desc
, RPC_HDR_BA
*rpc
, prs_struct
*ps
, int depth
);
5668 void init_rpc_hdr_req(RPC_HDR_REQ
*hdr
, uint32 alloc_hint
, uint16 opnum
);
5669 bool smb_io_rpc_hdr_req(const char *desc
, RPC_HDR_REQ
*rpc
, prs_struct
*ps
, int depth
);
5670 bool smb_io_rpc_hdr_resp(const char *desc
, RPC_HDR_RESP
*rpc
, prs_struct
*ps
, int depth
);
5671 bool smb_io_rpc_hdr_fault(const char *desc
, RPC_HDR_FAULT
*rpc
, prs_struct
*ps
, int depth
);
5672 void init_rpc_hdr_auth(RPC_HDR_AUTH
*rai
,
5673 uint8 auth_type
, uint8 auth_level
,
5675 uint32 auth_context_id
);
5676 bool smb_io_rpc_hdr_auth(const char *desc
, RPC_HDR_AUTH
*rai
, prs_struct
*ps
, int depth
);
5677 bool rpc_auth_verifier_chk(RPC_AUTH_VERIFIER
*rav
,
5678 const char *signature
, uint32 msg_type
);
5679 void init_rpc_auth_verifier(RPC_AUTH_VERIFIER
*rav
,
5680 const char *signature
, uint32 msg_type
);
5681 bool smb_io_rpc_auth_verifier(const char *desc
, RPC_AUTH_VERIFIER
*rav
, prs_struct
*ps
, int depth
);
5682 bool smb_io_rpc_schannel_verifier(const char *desc
, RPC_AUTH_VERIFIER
*rav
, prs_struct
*ps
, int depth
);
5683 void init_rpc_auth_schannel_neg(RPC_AUTH_SCHANNEL_NEG
*neg
,
5684 const char *domain
, const char *myname
);
5685 bool smb_io_rpc_auth_schannel_neg(const char *desc
, RPC_AUTH_SCHANNEL_NEG
*neg
,
5686 prs_struct
*ps
, int depth
);
5687 bool smb_io_rpc_auth_schannel_chk(const char *desc
, int auth_len
,
5688 RPC_AUTH_SCHANNEL_CHK
* chk
,
5689 prs_struct
*ps
, int depth
);
5691 /* The following definitions come from lib/eventlog/eventlog.c */
5693 TDB_CONTEXT
*elog_init_tdb( char *tdbfilename
);
5694 char *elog_tdbname(TALLOC_CTX
*ctx
, const char *name
);
5695 int elog_tdb_size( TDB_CONTEXT
* tdb
, int *MaxSize
, int *Retention
);
5696 bool prune_eventlog( TDB_CONTEXT
* tdb
);
5697 ELOG_TDB
*elog_open_tdb( const char *logname
, bool force_clear
, bool read_only
);
5698 int elog_close_tdb( ELOG_TDB
*etdb
, bool force_close
);
5699 bool parse_logentry( TALLOC_CTX
*mem_ctx
, char *line
, struct eventlog_Record_tdb
*entry
, bool * eor
);
5700 size_t fixup_eventlog_record_tdb(struct eventlog_Record_tdb
*r
);
5701 struct eventlog_Record_tdb
*evlog_pull_record_tdb(TALLOC_CTX
*mem_ctx
,
5703 uint32_t record_number
);
5704 NTSTATUS
evlog_push_record_tdb(TALLOC_CTX
*mem_ctx
,
5706 struct eventlog_Record_tdb
*r
,
5707 uint32_t *record_number
);
5708 NTSTATUS
evlog_push_record(TALLOC_CTX
*mem_ctx
,
5710 struct EVENTLOGRECORD
*r
,
5711 uint32_t *record_number
);
5712 struct EVENTLOGRECORD
*evlog_pull_record(TALLOC_CTX
*mem_ctx
,
5714 uint32_t record_number
);
5715 NTSTATUS
evlog_evt_entry_to_tdb_entry(TALLOC_CTX
*mem_ctx
,
5716 const struct EVENTLOGRECORD
*e
,
5717 struct eventlog_Record_tdb
*t
);
5718 NTSTATUS
evlog_tdb_entry_to_evt_entry(TALLOC_CTX
*mem_ctx
,
5719 const struct eventlog_Record_tdb
*t
,
5720 struct EVENTLOGRECORD
*e
);
5721 NTSTATUS
evlog_convert_tdb_to_evt(TALLOC_CTX
*mem_ctx
,
5724 uint32_t *num_records_p
);
5726 /* The following definitions come from rpc_server/srv_eventlog_nt.c */
5728 /* The following definitions come from rpc_server/srv_lsa_hnd.c */
5730 size_t num_pipe_handles(struct handle_list
*list
);
5731 bool init_pipe_handle_list(pipes_struct
*p
,
5732 const struct ndr_syntax_id
*syntax
);
5733 bool create_policy_hnd(pipes_struct
*p
, struct policy_handle
*hnd
, void *data_ptr
);
5734 bool find_policy_by_hnd(pipes_struct
*p
, const struct policy_handle
*hnd
,
5736 bool close_policy_hnd(pipes_struct
*p
, struct policy_handle
*hnd
);
5737 void close_policy_by_pipe(pipes_struct
*p
);
5738 bool pipe_access_check(pipes_struct
*p
);
5740 void *_policy_handle_create(struct pipes_struct
*p
, struct policy_handle
*hnd
,
5741 uint32_t access_granted
, size_t data_size
,
5742 const char *type
, NTSTATUS
*pstatus
);
5743 #define policy_handle_create(_p, _hnd, _access, _type, _pstatus) \
5744 (_type *)_policy_handle_create((_p), (_hnd), (_access), sizeof(_type), #_type, \
5747 void *_policy_handle_find(struct pipes_struct
*p
,
5748 const struct policy_handle
*hnd
,
5749 uint32_t access_required
, uint32_t *paccess_granted
,
5750 const char *name
, const char *location
,
5752 #define policy_handle_find(_p, _hnd, _access_required, _access_granted, _type, _pstatus) \
5753 (_type *)_policy_handle_find((_p), (_hnd), (_access_required), \
5754 (_access_granted), #_type, __location__, (_pstatus))
5757 /* The following definitions come from rpc_server/srv_pipe.c */
5759 bool create_next_pdu(pipes_struct
*p
);
5760 bool api_pipe_bind_auth3(pipes_struct
*p
, prs_struct
*rpc_in_p
);
5761 bool setup_fault_pdu(pipes_struct
*p
, NTSTATUS status
);
5762 bool setup_cancel_ack_reply(pipes_struct
*p
, prs_struct
*rpc_in_p
);
5763 bool check_bind_req(struct pipes_struct
*p
, RPC_IFACE
* abstract
,
5764 RPC_IFACE
* transfer
, uint32 context_id
);
5765 NTSTATUS
rpc_pipe_register_commands(int version
, const char *clnt
,
5767 const struct ndr_syntax_id
*interface
,
5768 const struct api_struct
*cmds
, int size
);
5769 NTSTATUS
rpc_srv_register(int version
, const char *clnt
,
5771 const struct ndr_interface_table
*iface
,
5772 const struct api_struct
*cmds
, int size
);
5773 bool is_known_pipename(const char *cli_filename
, struct ndr_syntax_id
*syntax
);
5774 bool api_pipe_bind_req(pipes_struct
*p
, prs_struct
*rpc_in_p
);
5775 bool api_pipe_alter_context(pipes_struct
*p
, prs_struct
*rpc_in_p
);
5776 bool api_pipe_ntlmssp_auth_process(pipes_struct
*p
, prs_struct
*rpc_in
,
5777 uint32
*p_ss_padding_len
, NTSTATUS
*pstatus
);
5778 bool api_pipe_schannel_process(pipes_struct
*p
, prs_struct
*rpc_in
, uint32
*p_ss_padding_len
);
5779 void free_pipe_rpc_context( PIPE_RPC_FNS
*list
);
5780 bool api_pipe_request(pipes_struct
*p
);
5782 /* The following definitions come from rpc_server/srv_pipe_hnd.c */
5784 pipes_struct
*get_first_internal_pipe(void);
5785 pipes_struct
*get_next_internal_pipe(pipes_struct
*p
);
5787 bool fsp_is_np(struct files_struct
*fsp
);
5788 NTSTATUS
np_open(TALLOC_CTX
*mem_ctx
, const char *name
,
5789 const char *client_address
,
5790 struct auth_serversupplied_info
*server_info
,
5791 struct fake_file_handle
**phandle
);
5792 struct tevent_req
*np_write_send(TALLOC_CTX
*mem_ctx
, struct event_context
*ev
,
5793 struct fake_file_handle
*handle
,
5794 const uint8_t *data
, size_t len
);
5795 NTSTATUS
np_write_recv(struct tevent_req
*req
, ssize_t
*pnwritten
);
5796 struct tevent_req
*np_read_send(TALLOC_CTX
*mem_ctx
, struct event_context
*ev
,
5797 struct fake_file_handle
*handle
,
5798 uint8_t *data
, size_t len
);
5799 NTSTATUS
np_read_recv(struct tevent_req
*req
, ssize_t
*nread
,
5800 bool *is_data_outstanding
);
5802 /* The following definitions come from rpc_server/srv_samr_util.c */
5804 void copy_id2_to_sam_passwd(struct samu
*to
,
5805 struct samr_UserInfo2
*from
);
5806 void copy_id4_to_sam_passwd(struct samu
*to
,
5807 struct samr_UserInfo4
*from
);
5808 void copy_id6_to_sam_passwd(struct samu
*to
,
5809 struct samr_UserInfo6
*from
);
5810 void copy_id8_to_sam_passwd(struct samu
*to
,
5811 struct samr_UserInfo8
*from
);
5812 void copy_id10_to_sam_passwd(struct samu
*to
,
5813 struct samr_UserInfo10
*from
);
5814 void copy_id11_to_sam_passwd(struct samu
*to
,
5815 struct samr_UserInfo11
*from
);
5816 void copy_id12_to_sam_passwd(struct samu
*to
,
5817 struct samr_UserInfo12
*from
);
5818 void copy_id13_to_sam_passwd(struct samu
*to
,
5819 struct samr_UserInfo13
*from
);
5820 void copy_id14_to_sam_passwd(struct samu
*to
,
5821 struct samr_UserInfo14
*from
);
5822 void copy_id16_to_sam_passwd(struct samu
*to
,
5823 struct samr_UserInfo16
*from
);
5824 void copy_id17_to_sam_passwd(struct samu
*to
,
5825 struct samr_UserInfo17
*from
);
5826 void copy_id18_to_sam_passwd(struct samu
*to
,
5827 struct samr_UserInfo18
*from
);
5828 void copy_id20_to_sam_passwd(struct samu
*to
,
5829 struct samr_UserInfo20
*from
);
5830 void copy_id21_to_sam_passwd(const char *log_prefix
,
5832 struct samr_UserInfo21
*from
);
5833 void copy_id23_to_sam_passwd(struct samu
*to
,
5834 struct samr_UserInfo23
*from
);
5835 void copy_id24_to_sam_passwd(struct samu
*to
,
5836 struct samr_UserInfo24
*from
);
5837 void copy_id25_to_sam_passwd(struct samu
*to
,
5838 struct samr_UserInfo25
*from
);
5839 void copy_id26_to_sam_passwd(struct samu
*to
,
5840 struct samr_UserInfo26
*from
);
5842 /* The following definitions come from rpc_server/srv_spoolss_nt.c */
5844 WERROR
delete_printer_hook(TALLOC_CTX
*ctx
, NT_USER_TOKEN
*token
, const char *sharename
);
5845 void do_drv_upgrade_printer(struct messaging_context
*msg
,
5848 struct server_id server_id
,
5850 void update_monitored_printq_cache( void );
5851 void reset_all_printerdata(struct messaging_context
*msg
,
5854 struct server_id server_id
,
5856 bool convert_devicemode(const char *printername
,
5857 const struct spoolss_DeviceMode
*devmode
,
5858 NT_DEVICEMODE
**pp_nt_devmode
);
5859 WERROR
set_printer_dataex(NT_PRINTER_INFO_LEVEL
*printer
,
5860 const char *key
, const char *value
,
5861 uint32_t type
, uint8_t *data
, int real_len
);
5862 void spoolss_notify_server_name(int snum
,
5863 struct spoolss_Notify
*data
,
5864 print_queue_struct
*queue
,
5865 NT_PRINTER_INFO_LEVEL
*printer
,
5866 TALLOC_CTX
*mem_ctx
);
5867 void spoolss_notify_printer_name(int snum
,
5868 struct spoolss_Notify
*data
,
5869 print_queue_struct
*queue
,
5870 NT_PRINTER_INFO_LEVEL
*printer
,
5871 TALLOC_CTX
*mem_ctx
);
5872 void spoolss_notify_share_name(int snum
,
5873 struct spoolss_Notify
*data
,
5874 print_queue_struct
*queue
,
5875 NT_PRINTER_INFO_LEVEL
*printer
,
5876 TALLOC_CTX
*mem_ctx
);
5877 void spoolss_notify_port_name(int snum
,
5878 struct spoolss_Notify
*data
,
5879 print_queue_struct
*queue
,
5880 NT_PRINTER_INFO_LEVEL
*printer
,
5881 TALLOC_CTX
*mem_ctx
);
5882 void spoolss_notify_driver_name(int snum
,
5883 struct spoolss_Notify
*data
,
5884 print_queue_struct
*queue
,
5885 NT_PRINTER_INFO_LEVEL
*printer
,
5886 TALLOC_CTX
*mem_ctx
);
5887 void spoolss_notify_comment(int snum
,
5888 struct spoolss_Notify
*data
,
5889 print_queue_struct
*queue
,
5890 NT_PRINTER_INFO_LEVEL
*printer
,
5891 TALLOC_CTX
*mem_ctx
);
5892 void spoolss_notify_location(int snum
,
5893 struct spoolss_Notify
*data
,
5894 print_queue_struct
*queue
,
5895 NT_PRINTER_INFO_LEVEL
*printer
,
5896 TALLOC_CTX
*mem_ctx
);
5897 void spoolss_notify_sepfile(int snum
,
5898 struct spoolss_Notify
*data
,
5899 print_queue_struct
*queue
,
5900 NT_PRINTER_INFO_LEVEL
*printer
,
5901 TALLOC_CTX
*mem_ctx
);
5902 void spoolss_notify_print_processor(int snum
,
5903 struct spoolss_Notify
*data
,
5904 print_queue_struct
*queue
,
5905 NT_PRINTER_INFO_LEVEL
*printer
,
5906 TALLOC_CTX
*mem_ctx
);
5907 void spoolss_notify_parameters(int snum
,
5908 struct spoolss_Notify
*data
,
5909 print_queue_struct
*queue
,
5910 NT_PRINTER_INFO_LEVEL
*printer
,
5911 TALLOC_CTX
*mem_ctx
);
5912 void spoolss_notify_datatype(int snum
,
5913 struct spoolss_Notify
*data
,
5914 print_queue_struct
*queue
,
5915 NT_PRINTER_INFO_LEVEL
*printer
,
5916 TALLOC_CTX
*mem_ctx
);
5917 void spoolss_notify_attributes(int snum
,
5918 struct spoolss_Notify
*data
,
5919 print_queue_struct
*queue
,
5920 NT_PRINTER_INFO_LEVEL
*printer
,
5921 TALLOC_CTX
*mem_ctx
);
5922 void spoolss_notify_cjobs(int snum
,
5923 struct spoolss_Notify
*data
,
5924 print_queue_struct
*queue
,
5925 NT_PRINTER_INFO_LEVEL
*printer
,
5926 TALLOC_CTX
*mem_ctx
);
5927 void construct_info_data(struct spoolss_Notify
*info_data
,
5928 enum spoolss_NotifyType type
,
5931 struct spoolss_DeviceMode
*construct_dev_mode(TALLOC_CTX
*mem_ctx
,
5932 const char *servicename
);
5933 WERROR
add_port_hook(TALLOC_CTX
*ctx
, NT_USER_TOKEN
*token
, const char *portname
, const char *uri
);
5934 bool add_printer_hook(TALLOC_CTX
*ctx
, NT_USER_TOKEN
*token
, NT_PRINTER_INFO_LEVEL
*printer
);
5935 WERROR
enumports_hook(TALLOC_CTX
*ctx
, int *count
, char ***lines
);
5937 /* The following definitions come from rpc_server/srv_srvsvc_nt.c */
5939 char *valid_share_pathname(TALLOC_CTX
*ctx
, const char *dos_pathname
);
5941 /* The following definitions come from rpc_server/srv_svcctl_nt.c */
5943 bool init_service_op_table( void );
5945 /* The following definitions come from rpcclient/cmd_dfs.c */
5948 /* The following definitions come from rpcclient/cmd_dssetup.c */
5951 /* The following definitions come from rpcclient/cmd_echo.c */
5954 /* The following definitions come from rpcclient/cmd_lsarpc.c */
5957 /* The following definitions come from rpcclient/cmd_netlogon.c */
5960 /* The following definitions come from rpcclient/cmd_ntsvcs.c */
5963 /* The following definitions come from rpcclient/cmd_samr.c */
5966 /* The following definitions come from rpcclient/cmd_shutdown.c */
5969 /* The following definitions come from rpcclient/cmd_spoolss.c */
5972 /* The following definitions come from rpcclient/cmd_srvsvc.c */
5975 /* The following definitions come from rpcclient/cmd_test.c */
5978 /* The following definitions come from rpcclient/cmd_wkssvc.c */
5981 /* The following definitions come from rpcclient/rpcclient.c */
5984 /* The following definitions come from services/services_db.c */
5986 void svcctl_init_keys( void );
5987 SEC_DESC
*svcctl_get_secdesc( TALLOC_CTX
*ctx
, const char *name
, NT_USER_TOKEN
*token
);
5988 bool svcctl_set_secdesc( TALLOC_CTX
*ctx
, const char *name
, SEC_DESC
*sec_desc
, NT_USER_TOKEN
*token
);
5989 const char *svcctl_lookup_dispname(TALLOC_CTX
*ctx
, const char *name
, NT_USER_TOKEN
*token
);
5990 const char *svcctl_lookup_description(TALLOC_CTX
*ctx
, const char *name
, NT_USER_TOKEN
*token
);
5991 struct regval_ctr
*svcctl_fetch_regvalues( const char *name
, NT_USER_TOKEN
*token
);
5993 /* The following definitions come from services/svc_netlogon.c */
5996 /* The following definitions come from services/svc_rcinit.c */
5999 /* The following definitions come from services/svc_spoolss.c */
6002 /* The following definitions come from services/svc_winreg.c */
6005 /* The following definitions come from services/svc_wins.c */
6008 /* The following definitions come from smbd/aio.c */
6010 void initialize_async_io_handler(void);
6011 bool schedule_aio_read_and_X(connection_struct
*conn
,
6012 struct smb_request
*req
,
6013 files_struct
*fsp
, SMB_OFF_T startpos
,
6015 bool schedule_aio_write_and_X(connection_struct
*conn
,
6016 struct smb_request
*req
,
6017 files_struct
*fsp
, char *data
,
6020 int wait_for_aio_completion(files_struct
*fsp
);
6021 void cancel_aio_by_fsp(files_struct
*fsp
);
6022 void smbd_aio_complete_mid(unsigned int mid
);
6024 /* The following definitions come from smbd/blocking.c */
6026 void process_blocking_lock_queue(void);
6027 bool push_blocking_lock_request( struct byte_range_lock
*br_lck
,
6028 struct smb_request
*req
,
6033 enum brl_type lock_type
,
6034 enum brl_flavour lock_flav
,
6037 uint32 blocking_pid
);
6038 void cancel_pending_lock_requests_by_fid(files_struct
*fsp
, struct byte_range_lock
*br_lck
);
6039 void remove_pending_lock_requests_by_mid(int mid
);
6040 bool blocking_lock_was_deferred(int mid
);
6041 struct blocking_lock_record
*blocking_lock_cancel(files_struct
*fsp
,
6045 enum brl_flavour lock_flav
,
6046 unsigned char locktype
,
6049 /* The following definitions come from smbd/change_trust_pw.c */
6051 NTSTATUS
change_trust_account_password( const char *domain
, const char *remote_machine
);
6053 /* The following definitions come from smbd/chgpasswd.c */
6055 bool chgpasswd(const char *name
, const struct passwd
*pass
,
6056 const char *oldpass
, const char *newpass
, bool as_root
);
6057 bool chgpasswd(const char *name
, const struct passwd
*pass
,
6058 const char *oldpass
, const char *newpass
, bool as_root
);
6059 bool check_lanman_password(char *user
, uchar
* pass1
,
6060 uchar
* pass2
, struct samu
**hnd
);
6061 bool change_lanman_password(struct samu
*sampass
, uchar
*pass2
);
6062 NTSTATUS
pass_oem_change(char *user
,
6063 uchar password_encrypted_with_lm_hash
[516],
6064 const uchar old_lm_hash_encrypted
[16],
6065 uchar password_encrypted_with_nt_hash
[516],
6066 const uchar old_nt_hash_encrypted
[16],
6067 uint32
*reject_reason
);
6068 NTSTATUS
change_oem_password(struct samu
*hnd
, char *old_passwd
, char *new_passwd
, bool as_root
, uint32
*samr_reject_reason
);
6070 /* The following definitions come from smbd/close.c */
6072 void set_close_write_time(struct files_struct
*fsp
, struct timespec ts
);
6073 NTSTATUS
close_file(struct smb_request
*req
, files_struct
*fsp
,
6074 enum file_close_type close_type
);
6075 void msg_close_file(struct messaging_context
*msg_ctx
,
6078 struct server_id server_id
,
6080 NTSTATUS
delete_all_streams(connection_struct
*conn
, const char *fname
);
6082 /* The following definitions come from smbd/conn.c */
6084 void conn_init(void);
6085 int conn_num_open(void);
6086 bool conn_snum_used(int snum
);
6087 connection_struct
*conn_find(unsigned cnum
);
6088 connection_struct
*conn_new(void);
6089 bool conn_close_all(void);
6090 bool conn_idle_all(time_t t
);
6091 void conn_clear_vuid_caches(uint16 vuid
);
6092 void conn_free_internal(connection_struct
*conn
);
6093 void conn_free(connection_struct
*conn
);
6094 void msg_force_tdis(struct messaging_context
*msg
,
6097 struct server_id server_id
,
6100 /* The following definitions come from smbd/connection.c */
6102 bool yield_connection(connection_struct
*conn
, const char *name
);
6103 int count_current_connections( const char *sharename
, bool clear
);
6104 int count_all_current_connections(void);
6105 bool claim_connection(connection_struct
*conn
, const char *name
,
6107 bool register_message_flags(bool doreg
, uint32 msg_flags
);
6109 /* The following definitions come from smbd/dfree.c */
6111 uint64_t sys_disk_free(connection_struct
*conn
, const char *path
, bool small_query
,
6112 uint64_t *bsize
,uint64_t *dfree
,uint64_t *dsize
);
6113 uint64_t get_dfree_info(connection_struct
*conn
,
6120 /* The following definitions come from smbd/dir.c */
6122 bool make_dir_struct(TALLOC_CTX
*ctx
,
6130 void init_dptrs(void);
6131 char *dptr_path(int key
);
6132 char *dptr_wcard(int key
);
6133 uint16
dptr_attr(int key
);
6134 void dptr_close(int *key
);
6135 void dptr_closecnum(connection_struct
*conn
);
6136 void dptr_idlecnum(connection_struct
*conn
);
6137 void dptr_closepath(char *path
,uint16 spid
);
6138 NTSTATUS
dptr_create(connection_struct
*conn
, const char *path
, bool old_handle
, bool expect_close
,uint16 spid
,
6139 const char *wcard
, bool wcard_has_wild
, uint32 attr
, struct dptr_struct
**dptr_ret
);
6140 int dptr_CloseDir(struct dptr_struct
*dptr
);
6141 void dptr_SeekDir(struct dptr_struct
*dptr
, long offset
);
6142 long dptr_TellDir(struct dptr_struct
*dptr
);
6143 bool dptr_has_wild(struct dptr_struct
*dptr
);
6144 int dptr_dnum(struct dptr_struct
*dptr
);
6145 const char *dptr_ReadDirName(TALLOC_CTX
*ctx
,
6146 struct dptr_struct
*dptr
,
6148 SMB_STRUCT_STAT
*pst
);
6149 bool dptr_SearchDir(struct dptr_struct
*dptr
, const char *name
, long *poffset
, SMB_STRUCT_STAT
*pst
);
6150 void dptr_DirCacheAdd(struct dptr_struct
*dptr
, const char *name
, long offset
);
6151 void dptr_init_search_op(struct dptr_struct
*dptr
);
6152 bool dptr_fill(char *buf1
,unsigned int key
);
6153 struct dptr_struct
*dptr_fetch(char *buf
,int *num
);
6154 struct dptr_struct
*dptr_fetch_lanman2(int dptr_num
);
6155 bool dir_check_ftype(connection_struct
*conn
, uint32 mode
, uint32 dirtype
);
6156 bool get_dir_entry(TALLOC_CTX
*ctx
,
6157 connection_struct
*conn
,
6160 char **pp_fname_out
,
6165 bool ask_sharemode
);
6166 bool is_visible_file(connection_struct
*conn
, const char *dir_path
, const char *name
, SMB_STRUCT_STAT
*pst
, bool use_veto
);
6167 struct smb_Dir
*OpenDir(TALLOC_CTX
*mem_ctx
, connection_struct
*conn
,
6168 const char *name
, const char *mask
, uint32 attr
);
6169 const char *ReadDirName(struct smb_Dir
*dirp
, long *poffset
,
6170 SMB_STRUCT_STAT
*sbuf
);
6171 void RewindDir(struct smb_Dir
*dirp
, long *poffset
);
6172 void SeekDir(struct smb_Dir
*dirp
, long offset
);
6173 long TellDir(struct smb_Dir
*dirp
);
6174 void DirCacheAdd(struct smb_Dir
*dirp
, const char *name
, long offset
);
6175 bool SearchDir(struct smb_Dir
*dirp
, const char *name
, long *poffset
);
6176 NTSTATUS
can_delete_directory(struct connection_struct
*conn
,
6177 const char *dirname
);
6179 /* The following definitions come from smbd/dmapi.c */
6181 const void *dmapi_get_current_session(void);
6182 bool dmapi_have_session(void);
6183 bool dmapi_new_session(void);
6184 bool dmapi_destroy_session(void);
6185 uint32
dmapi_file_flags(const char * const path
);
6187 /* The following definitions come from smbd/dnsregister.c */
6189 bool smbd_setup_mdns_registration(struct tevent_context
*ev
,
6190 TALLOC_CTX
*mem_ctx
,
6193 /* The following definitions come from smbd/dosmode.c */
6195 mode_t
unix_mode(connection_struct
*conn
, int dosmode
, const char *fname
,
6196 const char *inherit_from_dir
);
6197 uint32
dos_mode_msdfs(connection_struct
*conn
, const char *path
,SMB_STRUCT_STAT
*sbuf
);
6198 int dos_attributes_to_stat_dos_flags(uint32_t dosmode
);
6199 uint32
dos_mode(connection_struct
*conn
, const char *path
,SMB_STRUCT_STAT
*sbuf
);
6200 int file_set_dosmode(connection_struct
*conn
, const char *fname
,
6201 uint32 dosmode
, SMB_STRUCT_STAT
*st
,
6202 const char *parent_dir
,
6204 int file_ntimes(connection_struct
*conn
, const char *fname
,
6205 struct smb_file_time
*ft
);
6206 bool set_sticky_write_time_path(connection_struct
*conn
, const char *fname
,
6207 struct file_id fileid
, const struct timespec mtime
);
6208 bool set_sticky_write_time_fsp(struct files_struct
*fsp
, const struct timespec mtime
);
6209 bool update_write_time(struct files_struct
*fsp
);
6211 /* The following definitions come from smbd/error.c */
6213 bool use_nt_status(void);
6214 void error_packet_set(char *outbuf
, uint8 eclass
, uint32 ecode
, NTSTATUS ntstatus
, int line
, const char *file
);
6215 int error_packet(char *outbuf
, uint8 eclass
, uint32 ecode
, NTSTATUS ntstatus
, int line
, const char *file
);
6216 void reply_nt_error(struct smb_request
*req
, NTSTATUS ntstatus
,
6217 int line
, const char *file
);
6218 void reply_force_nt_error(struct smb_request
*req
, NTSTATUS ntstatus
,
6219 int line
, const char *file
);
6220 void reply_dos_error(struct smb_request
*req
, uint8 eclass
, uint32 ecode
,
6221 int line
, const char *file
);
6222 void reply_both_error(struct smb_request
*req
, uint8 eclass
, uint32 ecode
,
6223 NTSTATUS status
, int line
, const char *file
);
6224 void reply_openerror(struct smb_request
*req
, NTSTATUS status
);
6225 void reply_unix_error(struct smb_request
*req
, uint8 defclass
, uint32 defcode
,
6226 NTSTATUS defstatus
, int line
, const char *file
);
6228 /* The following definitions come from smbd/fake_file.c */
6230 enum FAKE_FILE_TYPE
is_fake_file(const char *fname
);
6231 NTSTATUS
open_fake_file(struct smb_request
*req
, connection_struct
*conn
,
6232 uint16_t current_vuid
,
6233 enum FAKE_FILE_TYPE fake_file_type
,
6236 files_struct
**result
);
6237 NTSTATUS
close_fake_file(struct smb_request
*req
, files_struct
*fsp
);
6239 /* The following definitions come from smbd/file_access.c */
6241 bool can_access_file_acl(struct connection_struct
*conn
,
6243 uint32_t access_mask
);
6244 bool can_delete_file_in_directory(connection_struct
*conn
, const char *fname
);
6245 bool can_access_file_data(connection_struct
*conn
, const char *fname
, SMB_STRUCT_STAT
*psbuf
, uint32 access_mask
);
6246 bool can_write_to_file(connection_struct
*conn
, const char *fname
, SMB_STRUCT_STAT
*psbuf
);
6247 bool directory_has_default_acl(connection_struct
*conn
, const char *fname
);
6249 /* The following definitions come from smbd/fileio.c */
6251 ssize_t
read_file(files_struct
*fsp
,char *data
,SMB_OFF_T pos
,size_t n
);
6252 void trigger_write_time_update(struct files_struct
*fsp
);
6253 void trigger_write_time_update_immediate(struct files_struct
*fsp
);
6254 ssize_t
write_file(struct smb_request
*req
,
6259 void delete_write_cache(files_struct
*fsp
);
6260 void set_filelen_write_cache(files_struct
*fsp
, SMB_OFF_T file_size
);
6261 ssize_t
flush_write_cache(files_struct
*fsp
, enum flush_reason_enum reason
);
6262 NTSTATUS
sync_file(connection_struct
*conn
, files_struct
*fsp
, bool write_through
);
6263 int fsp_stat(files_struct
*fsp
, SMB_STRUCT_STAT
*pst
);
6265 /* The following definitions come from smbd/filename.c */
6267 NTSTATUS
unix_convert(TALLOC_CTX
*ctx
,
6268 connection_struct
*conn
,
6269 const char *orig_path
,
6270 bool allow_wcard_last_component
,
6271 char **pp_conv_path
,
6272 char **pp_saved_last_component
,
6273 SMB_STRUCT_STAT
*pst
);
6274 NTSTATUS
check_name(connection_struct
*conn
, const char *name
);
6275 int get_real_filename(connection_struct
*conn
, const char *path
,
6276 const char *name
, TALLOC_CTX
*mem_ctx
,
6279 /* The following definitions come from smbd/files.c */
6281 NTSTATUS
file_new(struct smb_request
*req
, connection_struct
*conn
,
6282 files_struct
**result
);
6283 void file_close_conn(connection_struct
*conn
);
6284 void file_close_pid(uint16 smbpid
, int vuid
);
6285 void file_init(void);
6286 void file_close_user(int vuid
);
6287 void file_dump_open_table(void);
6288 struct files_struct
*file_walk_table(
6289 struct files_struct
*(*fn
)(struct files_struct
*fsp
,
6290 void *private_data
),
6291 void *private_data
);
6292 files_struct
*file_find_fd(int fd
);
6293 files_struct
*file_find_dif(struct file_id id
, unsigned long gen_id
);
6294 files_struct
*file_find_fsp(files_struct
*orig_fsp
);
6295 files_struct
*file_find_di_first(struct file_id id
);
6296 files_struct
*file_find_di_next(files_struct
*start_fsp
);
6297 files_struct
*file_find_print(void);
6298 bool file_find_subpath(files_struct
*dir_fsp
);
6299 void file_sync_all(connection_struct
*conn
);
6300 void file_free(struct smb_request
*req
, files_struct
*fsp
);
6301 files_struct
*file_fnum(uint16 fnum
);
6302 files_struct
*file_fsp(struct smb_request
*req
, uint16 fid
);
6303 void dup_file_fsp(struct smb_request
*req
, files_struct
*from
,
6304 uint32 access_mask
, uint32 share_access
,
6305 uint32 create_options
, files_struct
*to
);
6307 /* The following definitions come from smbd/ipc.c */
6309 void send_trans_reply(connection_struct
*conn
,
6310 struct smb_request
*req
,
6311 char *rparam
, int rparam_len
,
6312 char *rdata
, int rdata_len
,
6313 bool buffer_too_large
);
6314 void reply_trans(struct smb_request
*req
);
6315 void reply_transs(struct smb_request
*req
);
6317 /* The following definitions come from smbd/lanman.c */
6319 void api_reply(connection_struct
*conn
, uint16 vuid
,
6320 struct smb_request
*req
,
6321 char *data
, char *params
,
6322 int tdscnt
, int tpscnt
,
6323 int mdrcnt
, int mprcnt
);
6325 /* The following definitions come from smbd/mangle.c */
6327 void mangle_reset_cache(void);
6328 void mangle_change_to_posix(void);
6329 bool mangle_is_mangled(const char *s
, const struct share_params
*p
);
6330 bool mangle_is_8_3(const char *fname
, bool check_case
,
6331 const struct share_params
*p
);
6332 bool mangle_is_8_3_wildcards(const char *fname
, bool check_case
,
6333 const struct share_params
*p
);
6334 bool mangle_must_mangle(const char *fname
,
6335 const struct share_params
*p
);
6336 bool mangle_lookup_name_from_8_3(TALLOC_CTX
*ctx
,
6338 char **out
, /* talloced on the given context. */
6339 const struct share_params
*p
);
6340 bool name_to_8_3(const char *in
,
6343 const struct share_params
*p
);
6345 /* The following definitions come from smbd/mangle_hash.c */
6347 const struct mangle_fns
*mangle_hash_init(void);
6349 /* The following definitions come from smbd/mangle_hash2.c */
6351 const struct mangle_fns
*mangle_hash2_init(void);
6352 const struct mangle_fns
*posix_mangle_init(void);
6354 /* The following definitions come from smbd/map_username.c */
6356 bool map_username(fstring user
);
6358 /* The following definitions come from smbd/message.c */
6360 void reply_sends(struct smb_request
*req
);
6361 void reply_sendstrt(struct smb_request
*req
);
6362 void reply_sendtxt(struct smb_request
*req
);
6363 void reply_sendend(struct smb_request
*req
);
6365 /* The following definitions come from smbd/msdfs.c */
6367 bool is_msdfs_link(connection_struct
*conn
,
6369 SMB_STRUCT_STAT
*sbufp
);
6370 NTSTATUS
get_referred_path(TALLOC_CTX
*ctx
,
6371 const char *dfs_path
,
6372 struct junction_map
*jucn
,
6374 bool *self_referralp
);
6375 int setup_dfs_referral(connection_struct
*orig_conn
,
6376 const char *dfs_path
,
6377 int max_referral_level
,
6378 char **ppdata
, NTSTATUS
*pstatus
);
6379 bool create_junction(TALLOC_CTX
*ctx
,
6380 const char *dfs_path
,
6381 struct junction_map
*jucn
);
6382 bool create_msdfs_link(const struct junction_map
*jucn
);
6383 bool remove_msdfs_link(const struct junction_map
*jucn
);
6384 struct junction_map
*enum_msdfs_links(TALLOC_CTX
*ctx
, size_t *p_num_jn
);
6385 NTSTATUS
resolve_dfspath(TALLOC_CTX
*ctx
,
6386 connection_struct
*conn
,
6388 const char *name_in
,
6389 char **pp_name_out
);
6390 NTSTATUS
resolve_dfspath_wcard(TALLOC_CTX
*ctx
,
6391 connection_struct
*conn
,
6393 const char *name_in
,
6395 bool *ppath_contains_wcard
);
6396 NTSTATUS
create_conn_struct(TALLOC_CTX
*ctx
,
6397 connection_struct
**pconn
,
6400 struct auth_serversupplied_info
*server_info
,
6403 /* The following definitions come from smbd/negprot.c */
6405 void reply_negprot(struct smb_request
*req
);
6407 /* The following definitions come from smbd/notify.c */
6409 void change_notify_reply(connection_struct
*conn
,
6410 struct smb_request
*req
, uint32 max_param
,
6411 struct notify_change_buf
*notify_buf
);
6412 NTSTATUS
change_notify_create(struct files_struct
*fsp
, uint32 filter
,
6414 NTSTATUS
change_notify_add_request(struct smb_request
*req
,
6416 uint32 filter
, bool recursive
,
6417 struct files_struct
*fsp
);
6418 void remove_pending_change_notify_requests_by_mid(uint16 mid
);
6419 void remove_pending_change_notify_requests_by_fid(files_struct
*fsp
,
6421 void notify_fname(connection_struct
*conn
, uint32 action
, uint32 filter
,
6423 char *notify_filter_string(TALLOC_CTX
*mem_ctx
, uint32 filter
);
6424 struct sys_notify_context
*sys_notify_context_create(connection_struct
*conn
,
6425 TALLOC_CTX
*mem_ctx
,
6426 struct event_context
*ev
);
6427 NTSTATUS
sys_notify_watch(struct sys_notify_context
*ctx
,
6428 struct notify_entry
*e
,
6429 void (*callback
)(struct sys_notify_context
*ctx
,
6431 struct notify_event
*ev
),
6432 void *private_data
, void *handle
);
6434 /* The following definitions come from smbd/notify_inotify.c */
6436 NTSTATUS
inotify_watch(struct sys_notify_context
*ctx
,
6437 struct notify_entry
*e
,
6438 void (*callback
)(struct sys_notify_context
*ctx
,
6440 struct notify_event
*ev
),
6444 /* The following definitions come from smbd/notify_internal.c */
6446 struct notify_context
*notify_init(TALLOC_CTX
*mem_ctx
, struct server_id server
,
6447 struct messaging_context
*messaging_ctx
,
6448 struct event_context
*ev
,
6449 connection_struct
*conn
);
6450 NTSTATUS
notify_add(struct notify_context
*notify
, struct notify_entry
*e0
,
6451 void (*callback
)(void *, const struct notify_event
*),
6452 void *private_data
);
6453 NTSTATUS
notify_remove(struct notify_context
*notify
, void *private_data
);
6454 NTSTATUS
notify_remove_onelevel(struct notify_context
*notify
,
6455 const struct file_id
*fid
,
6456 void *private_data
);
6457 void notify_onelevel(struct notify_context
*notify
, uint32_t action
,
6458 uint32_t filter
, struct file_id fid
, const char *name
);
6459 void notify_trigger(struct notify_context
*notify
,
6460 uint32_t action
, uint32_t filter
, const char *path
);
6462 /* The following definitions come from smbd/ntquotas.c */
6464 int vfs_get_ntquota(files_struct
*fsp
, enum SMB_QUOTA_TYPE qtype
, DOM_SID
*psid
, SMB_NTQUOTA_STRUCT
*qt
);
6465 int vfs_set_ntquota(files_struct
*fsp
, enum SMB_QUOTA_TYPE qtype
, DOM_SID
*psid
, SMB_NTQUOTA_STRUCT
*qt
);
6466 int vfs_get_user_ntquota_list(files_struct
*fsp
, SMB_NTQUOTA_LIST
**qt_list
);
6467 void *init_quota_handle(TALLOC_CTX
*mem_ctx
);
6469 /* The following definitions come from smbd/nttrans.c */
6471 void send_nt_replies(connection_struct
*conn
,
6472 struct smb_request
*req
, NTSTATUS nt_error
,
6473 char *params
, int paramsize
,
6474 char *pdata
, int datasize
);
6475 bool is_ntfs_stream_name(const char *fname
);
6476 void reply_ntcreate_and_X(struct smb_request
*req
);
6477 void reply_ntcancel(struct smb_request
*req
);
6478 void reply_ntrename(struct smb_request
*req
);
6479 void reply_nttrans(struct smb_request
*req
);
6480 void reply_nttranss(struct smb_request
*req
);
6482 /* The following definitions come from smbd/open.c */
6484 NTSTATUS
smb1_file_se_access_check(const struct security_descriptor
*sd
,
6485 const NT_USER_TOKEN
*token
,
6486 uint32_t access_desired
,
6487 uint32_t *access_granted
);
6488 NTSTATUS
fd_close(files_struct
*fsp
);
6489 void change_file_owner_to_parent(connection_struct
*conn
,
6490 const char *inherit_from_dir
,
6492 NTSTATUS
change_dir_owner_to_parent(connection_struct
*conn
,
6493 const char *inherit_from_dir
,
6495 SMB_STRUCT_STAT
*psbuf
);
6496 bool is_executable(const char *fname
);
6497 bool is_stat_open(uint32 access_mask
);
6498 bool request_timed_out(struct timeval request_time
,
6499 struct timeval timeout
);
6500 bool open_match_attributes(connection_struct
*conn
,
6502 uint32 old_dos_attr
,
6503 uint32 new_dos_attr
,
6504 mode_t existing_unx_mode
,
6505 mode_t new_unx_mode
,
6506 mode_t
*returned_unx_mode
);
6507 NTSTATUS
fcb_or_dos_open(struct smb_request
*req
,
6508 connection_struct
*conn
,
6509 files_struct
*fsp_to_dup_into
,
6515 uint32 share_access
,
6516 uint32 create_options
);
6517 bool map_open_params_to_ntcreate(const char *fname
, int deny_mode
, int open_func
,
6518 uint32
*paccess_mask
,
6519 uint32
*pshare_mode
,
6520 uint32
*pcreate_disposition
,
6521 uint32
*pcreate_options
);
6522 NTSTATUS
open_file_fchmod(struct smb_request
*req
, connection_struct
*conn
,
6524 SMB_STRUCT_STAT
*psbuf
, files_struct
**result
);
6525 NTSTATUS
close_file_fchmod(struct smb_request
*req
, files_struct
*fsp
);
6526 NTSTATUS
create_directory(connection_struct
*conn
, struct smb_request
*req
, const char *directory
);
6527 void msg_file_was_renamed(struct messaging_context
*msg
,
6530 struct server_id server_id
,
6532 struct case_semantics_state
;
6533 struct case_semantics_state
*set_posix_case_semantics(TALLOC_CTX
*mem_ctx
,
6534 connection_struct
*conn
);
6535 NTSTATUS
open_streams_for_delete(connection_struct
*conn
,
6537 NTSTATUS
create_file_default(connection_struct
*conn
,
6538 struct smb_request
*req
,
6539 uint16_t root_dir_fid
,
6541 uint32_t create_file_flags
,
6542 uint32_t access_mask
,
6543 uint32_t share_access
,
6544 uint32_t create_disposition
,
6545 uint32_t create_options
,
6546 uint32_t file_attributes
,
6547 uint32_t oplock_request
,
6548 uint64_t allocation_size
,
6549 struct security_descriptor
*sd
,
6550 struct ea_list
*ea_list
,
6552 files_struct
**result
,
6554 SMB_STRUCT_STAT
*psbuf
);
6555 NTSTATUS
get_relative_fid_filename(connection_struct
*conn
,
6556 struct smb_request
*req
,
6557 uint16_t root_dir_fid
,
6558 const char *fname
, char **new_fname
);
6560 /* The following definitions come from smbd/oplock.c */
6562 int32
get_number_of_exclusive_open_oplocks(void);
6563 void break_kernel_oplock(struct messaging_context
*msg_ctx
, files_struct
*fsp
);
6564 bool set_file_oplock(files_struct
*fsp
, int oplock_type
);
6565 void release_file_oplock(files_struct
*fsp
);
6566 bool remove_oplock(files_struct
*fsp
);
6567 bool downgrade_oplock(files_struct
*fsp
);
6568 bool should_notify_deferred_opens(void);
6569 void break_level2_to_none_async(files_struct
*fsp
);
6570 void reply_to_oplock_break_requests(files_struct
*fsp
);
6571 void process_oplock_async_level2_break_message(struct messaging_context
*msg_ctx
,
6574 struct server_id src
,
6576 void contend_level2_oplocks_begin(files_struct
*fsp
,
6577 enum level2_contention_type type
);
6578 void contend_level2_oplocks_end(files_struct
*fsp
,
6579 enum level2_contention_type type
);
6580 void share_mode_entry_to_message(char *msg
, const struct share_mode_entry
*e
);
6581 void message_to_share_mode_entry(struct share_mode_entry
*e
, char *msg
);
6582 bool init_oplocks(struct messaging_context
*msg_ctx
);
6584 /* The following definitions come from smbd/oplock_irix.c */
6586 struct kernel_oplocks
*irix_init_kernel_oplocks(TALLOC_CTX
*mem_ctx
) ;
6588 /* The following definitions come from smbd/oplock_linux.c */
6590 void linux_set_lease_capability(void);
6591 int linux_set_lease_sighandler(int fd
);
6592 int linux_setlease(int fd
, int leasetype
);
6593 struct kernel_oplocks
*linux_init_kernel_oplocks(TALLOC_CTX
*mem_ctx
) ;
6595 /* The following definitions come from smbd/oplock_onefs.c */
6597 struct kernel_oplocks
*onefs_init_kernel_oplocks(TALLOC_CTX
*mem_ctx
);
6599 /* The following definitions come from smbd/password.c */
6601 user_struct
*get_valid_user_struct(uint16 vuid
);
6602 bool is_partial_auth_vuid(uint16 vuid
);
6603 user_struct
*get_partial_auth_user_struct(uint16 vuid
);
6604 void invalidate_vuid(uint16 vuid
);
6605 void invalidate_all_vuids(void);
6606 int register_initial_vuid(void);
6607 int register_existing_vuid(uint16 vuid
,
6608 auth_serversupplied_info
*server_info
,
6609 DATA_BLOB response_blob
,
6610 const char *smb_name
);
6611 void add_session_user(const char *user
);
6612 void add_session_workgroup(const char *workgroup
);
6613 const char *get_session_workgroup(void);
6614 bool user_in_netgroup(const char *user
, const char *ngname
);
6615 bool user_in_list(const char *user
,const char **list
);
6616 bool authorise_login(int snum
, fstring user
, DATA_BLOB password
,
6619 /* The following definitions come from smbd/pipes.c */
6621 NTSTATUS
open_np_file(struct smb_request
*smb_req
, const char *name
,
6622 struct files_struct
**pfsp
);
6623 void reply_open_pipe_and_X(connection_struct
*conn
, struct smb_request
*req
);
6624 void reply_pipe_write(struct smb_request
*req
);
6625 void reply_pipe_write_and_X(struct smb_request
*req
);
6626 void reply_pipe_read_and_X(struct smb_request
*req
);
6627 void reply_pipe_close(connection_struct
*conn
, struct smb_request
*req
);
6629 /* The following definitions come from smbd/posix_acls.c */
6631 void create_file_sids(const SMB_STRUCT_STAT
*psbuf
, DOM_SID
*powner_sid
, DOM_SID
*pgroup_sid
);
6632 bool nt4_compatible_acls(void);
6633 NTSTATUS
unpack_nt_owners(int snum
, uid_t
*puser
, gid_t
*pgrp
, uint32 security_info_sent
, const SEC_DESC
*psd
);
6634 SMB_ACL_T
free_empty_sys_acl(connection_struct
*conn
, SMB_ACL_T the_acl
);
6635 NTSTATUS
posix_fget_nt_acl(struct files_struct
*fsp
, uint32_t security_info
,
6637 NTSTATUS
posix_get_nt_acl(struct connection_struct
*conn
, const char *name
,
6638 uint32_t security_info
, SEC_DESC
**ppdesc
);
6639 int try_chown(connection_struct
*conn
, const char *fname
, uid_t uid
, gid_t gid
);
6640 NTSTATUS
append_parent_acl(files_struct
*fsp
,
6641 const SEC_DESC
*pcsd
,
6642 SEC_DESC
**pp_new_sd
);
6643 NTSTATUS
set_nt_acl(files_struct
*fsp
, uint32 security_info_sent
, const SEC_DESC
*psd
);
6644 int get_acl_group_bits( connection_struct
*conn
, const char *fname
, mode_t
*mode
);
6645 int chmod_acl(connection_struct
*conn
, const char *name
, mode_t mode
);
6646 int inherit_access_posix_acl(connection_struct
*conn
, const char *inherit_from_dir
,
6647 const char *name
, mode_t mode
);
6648 int fchmod_acl(files_struct
*fsp
, mode_t mode
);
6649 bool set_unix_posix_default_acl(connection_struct
*conn
, const char *fname
, SMB_STRUCT_STAT
*psbuf
,
6650 uint16 num_def_acls
, const char *pdata
);
6651 bool set_unix_posix_acl(connection_struct
*conn
, files_struct
*fsp
, const char *fname
, uint16 num_acls
, const char *pdata
);
6652 SEC_DESC
*get_nt_acl_no_snum( TALLOC_CTX
*ctx
, const char *fname
);
6654 /* The following definitions come from smbd/process.c */
6656 void smbd_setup_sig_term_handler(void);
6657 void smbd_setup_sig_hup_handler(void);
6658 bool srv_send_smb(int fd
, char *buffer
,
6659 bool no_signing
, uint32_t seqnum
,
6661 struct smb_perfcount_data
*pcd
);
6662 int srv_set_message(char *buf
,
6666 void init_smb_request(struct smb_request
*req
,
6668 size_t unread_bytes
,
6670 void remove_deferred_open_smb_message(uint16 mid
);
6671 void schedule_deferred_open_smb_message(uint16 mid
);
6672 bool open_was_deferred(uint16 mid
);
6673 struct pending_message_list
*get_open_deferred_message(uint16 mid
);
6674 bool push_deferred_smb_message(struct smb_request
*req
,
6675 struct timeval request_time
,
6676 struct timeval timeout
,
6677 char *private_data
, size_t priv_len
);
6678 struct idle_event
*event_add_idle(struct event_context
*event_ctx
,
6679 TALLOC_CTX
*mem_ctx
,
6680 struct timeval interval
,
6682 bool (*handler
)(const struct timeval
*now
,
6683 void *private_data
),
6684 void *private_data
);
6685 NTSTATUS
allow_new_trans(struct trans_state
*list
, int mid
);
6686 void reply_outbuf(struct smb_request
*req
, uint8 num_words
, uint32 num_bytes
);
6687 const char *smb_fn_name(int type
);
6688 void add_to_common_flags2(uint32 v
);
6689 void remove_from_common_flags2(uint32 v
);
6690 void construct_reply_common_req(struct smb_request
*req
, char *outbuf
);
6691 size_t req_wct_ofs(struct smb_request
*req
);
6692 void chain_reply(struct smb_request
*req
);
6693 bool req_is_in_chain(struct smb_request
*req
);
6694 void check_reload(time_t t
);
6695 void smbd_process(void);
6697 /* The following definitions come from smbd/quotas.c */
6699 bool disk_quotas(const char *path
, uint64_t *bsize
, uint64_t *dfree
, uint64_t *dsize
);
6700 bool disk_quotas(const char *path
, uint64_t *bsize
, uint64_t *dfree
, uint64_t *dsize
);
6701 bool disk_quotas(const char *path
,
6705 bool disk_quotas(const char *path
, uint64_t *bsize
, uint64_t *dfree
, uint64_t *dsize
);
6706 bool disk_quotas(const char *path
, uint64_t *bsize
, uint64_t *dfree
, uint64_t *dsize
);
6707 bool disk_quotas(const char *path
, uint64_t *bsize
, uint64_t *dfree
, uint64_t *dsize
);
6708 bool disk_quotas_vxfs(const char *name
, char *path
, uint64_t *bsize
, uint64_t *dfree
, uint64_t *dsize
);
6709 bool disk_quotas(const char *path
,uint64_t *bsize
,uint64_t *dfree
,uint64_t *dsize
);
6710 bool disk_quotas(const char *path
,uint64_t *bsize
,uint64_t *dfree
,uint64_t *dsize
);
6712 /* The following definitions come from smbd/reply.c */
6714 NTSTATUS
check_path_syntax(char *path
);
6715 NTSTATUS
check_path_syntax_wcard(char *path
, bool *p_contains_wcard
);
6716 NTSTATUS
check_path_syntax_posix(char *path
);
6717 size_t srvstr_get_path_wcard(TALLOC_CTX
*ctx
,
6725 bool *contains_wcard
);
6726 size_t srvstr_get_path(TALLOC_CTX
*ctx
,
6734 size_t srvstr_get_path_req_wcard(TALLOC_CTX
*mem_ctx
, struct smb_request
*req
,
6735 char **pp_dest
, const char *src
, int flags
,
6736 NTSTATUS
*err
, bool *contains_wcard
);
6737 size_t srvstr_get_path_req(TALLOC_CTX
*mem_ctx
, struct smb_request
*req
,
6738 char **pp_dest
, const char *src
, int flags
,
6740 bool check_fsp_open(connection_struct
*conn
, struct smb_request
*req
,
6742 bool check_fsp(connection_struct
*conn
, struct smb_request
*req
,
6744 bool check_fsp_ntquota_handle(connection_struct
*conn
, struct smb_request
*req
,
6746 bool fsp_belongs_conn(connection_struct
*conn
, struct smb_request
*req
,
6748 void reply_special(char *inbuf
);
6749 void reply_tcon(struct smb_request
*req
);
6750 void reply_tcon_and_X(struct smb_request
*req
);
6751 void reply_unknown_new(struct smb_request
*req
, uint8 type
);
6752 void reply_ioctl(struct smb_request
*req
);
6753 void reply_checkpath(struct smb_request
*req
);
6754 void reply_getatr(struct smb_request
*req
);
6755 void reply_setatr(struct smb_request
*req
);
6756 void reply_dskattr(struct smb_request
*req
);
6757 void reply_search(struct smb_request
*req
);
6758 void reply_fclose(struct smb_request
*req
);
6759 void reply_open(struct smb_request
*req
);
6760 void reply_open_and_X(struct smb_request
*req
);
6761 void reply_ulogoffX(struct smb_request
*req
);
6762 void reply_mknew(struct smb_request
*req
);
6763 void reply_ctemp(struct smb_request
*req
);
6764 NTSTATUS
unlink_internals(connection_struct
*conn
, struct smb_request
*req
,
6765 uint32 dirtype
, const char *name_in
, bool has_wild
);
6766 void reply_unlink(struct smb_request
*req
);
6767 void reply_readbraw(struct smb_request
*req
);
6768 void reply_lockread(struct smb_request
*req
);
6769 void reply_read(struct smb_request
*req
);
6770 void reply_read_and_X(struct smb_request
*req
);
6771 void error_to_writebrawerr(struct smb_request
*req
);
6772 void reply_writebraw(struct smb_request
*req
);
6773 void reply_writeunlock(struct smb_request
*req
);
6774 void reply_write(struct smb_request
*req
);
6775 bool is_valid_writeX_buffer(const uint8_t *inbuf
);
6776 void reply_write_and_X(struct smb_request
*req
);
6777 void reply_lseek(struct smb_request
*req
);
6778 void reply_flush(struct smb_request
*req
);
6779 void reply_exit(struct smb_request
*req
);
6780 void reply_close(struct smb_request
*req
);
6781 void reply_writeclose(struct smb_request
*req
);
6782 void reply_lock(struct smb_request
*req
);
6783 void reply_unlock(struct smb_request
*req
);
6784 void reply_tdis(struct smb_request
*req
);
6785 void reply_echo(struct smb_request
*req
);
6786 void reply_printopen(struct smb_request
*req
);
6787 void reply_printclose(struct smb_request
*req
);
6788 void reply_printqueue(struct smb_request
*req
);
6789 void reply_printwrite(struct smb_request
*req
);
6790 void reply_mkdir(struct smb_request
*req
);
6791 NTSTATUS
rmdir_internals(TALLOC_CTX
*ctx
,
6792 connection_struct
*conn
,
6793 const char *directory
);
6794 void reply_rmdir(struct smb_request
*req
);
6795 NTSTATUS
rename_internals_fsp(connection_struct
*conn
,
6798 const char *newname_last_component
,
6800 bool replace_if_exists
);
6801 NTSTATUS
rename_internals(TALLOC_CTX
*ctx
,
6802 connection_struct
*conn
,
6803 struct smb_request
*req
,
6804 const char *name_in
,
6805 const char *newname_in
,
6807 bool replace_if_exists
,
6810 uint32_t access_mask
);
6811 void reply_mv(struct smb_request
*req
);
6812 NTSTATUS
copy_file(TALLOC_CTX
*ctx
,
6813 connection_struct
*conn
,
6818 bool target_is_directory
);
6819 void reply_copy(struct smb_request
*req
);
6820 uint32
get_lock_pid(const uint8_t *data
, int data_offset
,
6821 bool large_file_format
);
6822 uint64_t get_lock_count(const uint8_t *data
, int data_offset
,
6823 bool large_file_format
);
6824 uint64_t get_lock_offset(const uint8_t *data
, int data_offset
,
6825 bool large_file_format
, bool *err
);
6826 void reply_lockingX(struct smb_request
*req
);
6827 void reply_readbmpx(struct smb_request
*req
);
6828 void reply_readbs(struct smb_request
*req
);
6829 void reply_setattrE(struct smb_request
*req
);
6830 void reply_writebmpx(struct smb_request
*req
);
6831 void reply_writebs(struct smb_request
*req
);
6832 void reply_getattrE(struct smb_request
*req
);
6834 /* The following definitions come from smbd/seal.c */
6836 uint16_t srv_enc_ctx(void);
6837 bool is_encrypted_packet(const uint8_t *inbuf
);
6838 void srv_free_enc_buffer(char *buf
);
6839 NTSTATUS
srv_decrypt_buffer(char *buf
);
6840 NTSTATUS
srv_encrypt_buffer(char *buf
, char **buf_out
);
6841 NTSTATUS
srv_request_encryption_setup(connection_struct
*conn
,
6842 unsigned char **ppdata
,
6843 size_t *p_data_size
,
6844 unsigned char **pparam
,
6845 size_t *p_param_size
);
6846 NTSTATUS
srv_encryption_start(connection_struct
*conn
);
6847 void server_encryption_shutdown(void);
6849 /* The following definitions come from smbd/sec_ctx.c */
6851 bool unix_token_equal(const UNIX_USER_TOKEN
*t1
, const UNIX_USER_TOKEN
*t2
);
6852 bool push_sec_ctx(void);
6853 void set_sec_ctx(uid_t uid
, gid_t gid
, int ngroups
, gid_t
*groups
, NT_USER_TOKEN
*token
);
6854 void set_root_sec_ctx(void);
6855 bool pop_sec_ctx(void);
6856 void init_sec_ctx(void);
6858 /* The following definitions come from smbd/server.c */
6860 int smbd_server_fd(void);
6861 int get_client_fd(void);
6862 struct event_context
*smbd_event_context(void);
6863 struct messaging_context
*smbd_messaging_context(void);
6864 struct memcache
*smbd_memcache(void);
6865 void reload_printers(void);
6866 bool reload_services(bool test
);
6867 void exit_server(const char *const explanation
);
6868 void exit_server_cleanly(const char *const explanation
);
6869 void exit_server_fault(void);
6871 /* The following definitions come from smbd/service.c */
6873 bool set_conn_connectpath(connection_struct
*conn
, const char *connectpath
);
6874 bool set_current_service(connection_struct
*conn
, uint16 flags
, bool do_chdir
);
6875 void load_registry_shares(void);
6876 int add_home_service(const char *service
, const char *username
, const char *homedir
);
6877 int find_service(fstring service
);
6878 connection_struct
*make_connection(const char *service_in
, DATA_BLOB password
,
6879 const char *pdev
, uint16 vuid
,
6881 void close_cnum(connection_struct
*conn
, uint16 vuid
);
6883 /* The following definitions come from smbd/session.c */
6885 bool session_init(void);
6886 bool session_claim(user_struct
*vuser
);
6887 void session_yield(user_struct
*vuser
);
6888 int list_sessions(TALLOC_CTX
*mem_ctx
, struct sessionid
**session_list
);
6890 /* The following definitions come from smbd/sesssetup.c */
6892 NTSTATUS
parse_spnego_mechanisms(DATA_BLOB blob_in
,
6893 DATA_BLOB
*pblob_out
,
6894 char **kerb_mechOID
);
6895 void reply_sesssetup_and_X(struct smb_request
*req
);
6897 /* The following definitions come from smbd/share_access.c */
6899 bool token_contains_name_in_list(const char *username
,
6901 const char *sharename
,
6902 const struct nt_user_token
*token
,
6904 bool user_ok_token(const char *username
, const char *domain
,
6905 const struct nt_user_token
*token
, int snum
);
6906 bool is_share_read_only_for_token(const char *username
,
6908 const struct nt_user_token
*token
,
6909 connection_struct
*conn
);
6911 /* The following definitions come from smbd/srvstr.c */
6913 size_t srvstr_push_fn(const char *function
, unsigned int line
,
6914 const char *base_ptr
, uint16 smb_flags2
, void *dest
,
6915 const char *src
, int dest_len
, int flags
);
6916 ssize_t
message_push_string(uint8
**outbuf
, const char *str
, int flags
);
6918 /* The following definitions come from smbd/statcache.c */
6920 void stat_cache_add( const char *full_orig_name
,
6921 char *translated_path
,
6922 bool case_sensitive
);
6923 bool stat_cache_lookup(connection_struct
*conn
,
6927 SMB_STRUCT_STAT
*pst
);
6928 void send_stat_cache_delete_message(const char *name
);
6929 void stat_cache_delete(const char *name
);
6930 unsigned int fast_string_hash(TDB_DATA
*key
);
6931 bool reset_stat_cache( void );
6933 /* The following definitions come from smbd/statvfs.c */
6935 int sys_statvfs(const char *path
, vfs_statvfs_struct
*statbuf
);
6937 /* The following definitions come from smbd/trans2.c */
6939 uint64_t smb_roundup(connection_struct
*conn
, uint64_t val
);
6940 NTSTATUS
get_ea_value(TALLOC_CTX
*mem_ctx
, connection_struct
*conn
,
6941 files_struct
*fsp
, const char *fname
,
6942 const char *ea_name
, struct ea_struct
*pea
);
6943 NTSTATUS
get_ea_names_from_file(TALLOC_CTX
*mem_ctx
, connection_struct
*conn
,
6944 files_struct
*fsp
, const char *fname
,
6945 char ***pnames
, size_t *pnum_names
);
6946 NTSTATUS
set_ea(connection_struct
*conn
, files_struct
*fsp
, const char *fname
, struct ea_list
*ea_list
);
6947 struct ea_list
*read_ea_list_entry(TALLOC_CTX
*ctx
, const char *pdata
, size_t data_size
, size_t *pbytes_used
);
6948 void send_trans2_replies(connection_struct
*conn
,
6949 struct smb_request
*req
,
6954 int max_data_bytes
);
6955 unsigned char *create_volume_objectid(connection_struct
*conn
, unsigned char objid
[16]);
6956 NTSTATUS
hardlink_internals(TALLOC_CTX
*ctx
,
6957 connection_struct
*conn
,
6958 const char *oldname_in
,
6959 const char *newname_in
);
6960 NTSTATUS
smb_set_file_time(connection_struct
*conn
,
6963 const SMB_STRUCT_STAT
*psbuf
,
6964 struct smb_file_time
*ft
,
6965 bool setting_write_time
);
6966 void reply_findclose(struct smb_request
*req
);
6967 void reply_findnclose(struct smb_request
*req
);
6968 void reply_trans2(struct smb_request
*req
);
6969 void reply_transs2(struct smb_request
*req
);
6971 /* The following definitions come from smbd/uid.c */
6973 bool change_to_guest(void);
6974 void conn_clear_vuid_cache(connection_struct
*conn
, uint16_t vuid
);
6975 bool change_to_user(connection_struct
*conn
, uint16 vuid
);
6976 bool change_to_root_user(void);
6977 bool become_authenticated_pipe_user(pipes_struct
*p
);
6978 bool unbecome_authenticated_pipe_user(void);
6979 void become_root(void);
6980 void unbecome_root(void);
6981 bool become_user(connection_struct
*conn
, uint16 vuid
);
6982 bool unbecome_user(void);
6984 /* The following definitions come from smbd/utmp.c */
6986 void sys_utmp_claim(const char *username
, const char *hostname
,
6987 const char *ip_addr_str
,
6988 const char *id_str
, int id_num
);
6989 void sys_utmp_yield(const char *username
, const char *hostname
,
6990 const char *ip_addr_str
,
6991 const char *id_str
, int id_num
);
6992 void sys_utmp_yield(const char *username
, const char *hostname
,
6993 const char *ip_addr_str
,
6994 const char *id_str
, int id_num
);
6995 void sys_utmp_claim(const char *username
, const char *hostname
,
6996 const char *ip_addr_str
,
6997 const char *id_str
, int id_num
);
6999 /* The following definitions come from smbd/vfs.c */
7001 NTSTATUS
smb_register_vfs(int version
, const char *name
, const vfs_op_tuple
*vfs_op_tuples
);
7002 bool vfs_init_custom(connection_struct
*conn
, const char *vfs_object
);
7003 void *vfs_add_fsp_extension_notype(vfs_handle_struct
*handle
,
7004 files_struct
*fsp
, size_t ext_size
,
7005 void (*destroy_fn
)(void *p_data
));
7006 void vfs_remove_fsp_extension(vfs_handle_struct
*handle
, files_struct
*fsp
);
7007 void *vfs_memctx_fsp_extension(vfs_handle_struct
*handle
, files_struct
*fsp
);
7008 void *vfs_fetch_fsp_extension(vfs_handle_struct
*handle
, files_struct
*fsp
);
7009 bool smbd_vfs_init(connection_struct
*conn
);
7010 bool vfs_directory_exist(connection_struct
*conn
, const char *dname
, SMB_STRUCT_STAT
*st
);
7011 bool vfs_object_exist(connection_struct
*conn
,const char *fname
,SMB_STRUCT_STAT
*sbuf
);
7012 bool vfs_file_exist(connection_struct
*conn
, const char *fname
,SMB_STRUCT_STAT
*sbuf
);
7013 ssize_t
vfs_read_data(files_struct
*fsp
, char *buf
, size_t byte_count
);
7014 ssize_t
vfs_pread_data(files_struct
*fsp
, char *buf
,
7015 size_t byte_count
, SMB_OFF_T offset
);
7016 ssize_t
vfs_write_data(struct smb_request
*req
,
7020 ssize_t
vfs_pwrite_data(struct smb_request
*req
,
7025 int vfs_allocate_file_space(files_struct
*fsp
, uint64_t len
);
7026 int vfs_set_filelen(files_struct
*fsp
, SMB_OFF_T len
);
7027 int vfs_fill_sparse(files_struct
*fsp
, SMB_OFF_T len
);
7028 SMB_OFF_T
vfs_transfer_file(files_struct
*in
, files_struct
*out
, SMB_OFF_T n
);
7029 char *vfs_readdirname(connection_struct
*conn
, void *p
, SMB_STRUCT_STAT
*sbuf
);
7030 int vfs_ChDir(connection_struct
*conn
, const char *path
);
7031 char *vfs_GetWd(TALLOC_CTX
*ctx
, connection_struct
*conn
);
7032 NTSTATUS
check_reduced_name(connection_struct
*conn
, const char *fname
);
7034 /* The following definitions come from torture/denytest.c */
7036 bool torture_denytest1(int dummy
);
7037 bool torture_denytest2(int dummy
);
7039 /* The following definitions come from torture/mangle_test.c */
7041 bool torture_mangle(int dummy
);
7043 /* The following definitions come from torture/nbio.c */
7045 double nbio_total(void);
7046 void nb_alarm(int ignore
);
7047 void nbio_shmem(int n
);
7048 void nb_setup(struct cli_state
*cli
);
7049 void nb_unlink(const char *fname
);
7050 void nb_createx(const char *fname
,
7051 unsigned create_options
, unsigned create_disposition
, int handle
);
7052 void nb_writex(int handle
, int offset
, int size
, int ret_size
);
7053 void nb_readx(int handle
, int offset
, int size
, int ret_size
);
7054 void nb_close(int handle
);
7055 void nb_rmdir(const char *fname
);
7056 void nb_rename(const char *oldname
, const char *newname
);
7057 void nb_qpathinfo(const char *fname
);
7058 void nb_qfileinfo(int fnum
);
7059 void nb_qfsinfo(int level
);
7060 void nb_findfirst(const char *mask
);
7061 void nb_flush(int fnum
);
7062 void nb_deltree(const char *dname
);
7063 void nb_cleanup(void);
7065 /* The following definitions come from torture/scanner.c */
7067 bool torture_trans2_scan(int dummy
);
7068 bool torture_nttrans_scan(int dummy
);
7070 /* The following definitions come from torture/torture.c */
7072 void start_timer(void);
7073 double end_timer(void);
7074 void *shm_setup(int size
);
7075 bool smbcli_parse_unc(const char *unc_name
, TALLOC_CTX
*mem_ctx
,
7076 char **hostname
, char **sharename
);
7077 void torture_open_connection_free_unclist(char **unc_list
);
7078 bool torture_open_connection(struct cli_state
**c
, int conn_index
);
7079 bool torture_cli_session_setup2(struct cli_state
*cli
, uint16
*new_vuid
);
7080 bool torture_close_connection(struct cli_state
*c
);
7081 bool torture_ioctl_test(int dummy
);
7082 bool torture_chkpath_test(int dummy
);
7084 /* The following definitions come from torture/utable.c */
7086 bool torture_utable(int dummy
);
7087 bool torture_casetable(int dummy
);
7089 /* The following definitions come from utils/passwd_util.c */
7091 char *stdin_new_passwd( void);
7092 char *get_pass( const char *prompt
, bool stdin_get
);
7094 /* The following definitions come from winbindd/idmap.c */
7096 bool idmap_is_offline(void);
7097 bool idmap_is_online(void);
7098 NTSTATUS
smb_register_idmap(int version
, const char *name
,
7099 struct idmap_methods
*methods
);
7100 NTSTATUS
smb_register_idmap_alloc(int version
, const char *name
,
7101 struct idmap_alloc_methods
*methods
);
7102 void idmap_close(void);
7103 NTSTATUS
idmap_init_cache(void);
7104 NTSTATUS
idmap_allocate_uid(struct unixid
*id
);
7105 NTSTATUS
idmap_allocate_gid(struct unixid
*id
);
7106 NTSTATUS
idmap_set_uid_hwm(struct unixid
*id
);
7107 NTSTATUS
idmap_set_gid_hwm(struct unixid
*id
);
7108 NTSTATUS
idmap_backends_unixid_to_sid(const char *domname
,
7110 NTSTATUS
idmap_backends_sid_to_unixid(const char *domname
,
7112 NTSTATUS
idmap_new_mapping(const struct dom_sid
*psid
, enum id_type type
,
7113 struct unixid
*pxid
);
7114 NTSTATUS
idmap_set_mapping(const struct id_map
*map
);
7115 NTSTATUS
idmap_remove_mapping(const struct id_map
*map
);
7117 /* The following definitions come from winbindd/idmap_cache.c */
7119 bool idmap_cache_find_sid2uid(const struct dom_sid
*sid
, uid_t
*puid
,
7121 bool idmap_cache_find_uid2sid(uid_t uid
, struct dom_sid
*sid
, bool *expired
);
7122 void idmap_cache_set_sid2uid(const struct dom_sid
*sid
, uid_t uid
);
7123 bool idmap_cache_find_sid2gid(const struct dom_sid
*sid
, gid_t
*pgid
,
7125 bool idmap_cache_find_gid2sid(gid_t gid
, struct dom_sid
*sid
, bool *expired
);
7126 void idmap_cache_set_sid2gid(const struct dom_sid
*sid
, gid_t gid
);
7129 /* The following definitions come from winbindd/idmap_nss.c */
7131 NTSTATUS
idmap_nss_init(void);
7133 /* The following definitions come from winbindd/idmap_passdb.c */
7135 NTSTATUS
idmap_passdb_init(void);
7137 /* The following definitions come from winbindd/idmap_tdb.c */
7139 bool idmap_tdb_tdb_close(TDB_CONTEXT
*tdbctx
);
7140 NTSTATUS
idmap_alloc_tdb_init(void);
7141 NTSTATUS
idmap_tdb_init(void);
7143 /* The following definitions come from winbindd/idmap_util.c */
7145 NTSTATUS
idmap_uid_to_sid(const char *domname
, DOM_SID
*sid
, uid_t uid
);
7146 NTSTATUS
idmap_gid_to_sid(const char *domname
, DOM_SID
*sid
, gid_t gid
);
7147 NTSTATUS
idmap_sid_to_uid(const char *dom_name
, DOM_SID
*sid
, uid_t
*uid
);
7148 NTSTATUS
idmap_sid_to_gid(const char *domname
, DOM_SID
*sid
, gid_t
*gid
);
7150 /* The following definitions come from winbindd/nss_info.c */
7153 /* The following definitions come from winbindd/nss_info_template.c */
7155 NTSTATUS
nss_info_template_init( void );
7157 /* The following definitions come from lib/avahi.c */
7159 struct AvahiPoll
*tevent_avahi_poll(TALLOC_CTX
*mem_ctx
,
7160 struct tevent_context
*ev
);
7162 /* The following definitions come from smbd/avahi_register.c */
7164 void *avahi_start_register(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
7169 struct fncall_context
*fncall_context_init(TALLOC_CTX
*mem_ctx
,
7171 struct tevent_req
*fncall_send(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
7172 struct fncall_context
*ctx
,
7173 void (*fn
)(void *private_data
),
7174 void *private_data
);
7175 int fncall_recv(struct tevent_req
*req
, int *perr
);
7177 #endif /* _PROTO_H_ */