diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/include/proto.h | 836 | ||||
-rw-r--r-- | source/lib/sendfile.c | 4 | ||||
-rw-r--r-- | source/smbd/reply.c | 4 |
3 files changed, 352 insertions, 492 deletions
diff --git a/source/include/proto.h b/source/include/proto.h index 41624c95235..7e7ed6f1bc7 100644 --- a/source/include/proto.h +++ b/source/include/proto.h @@ -1,28 +1,8 @@ -/* - * Unix SMB/CIFS implementation. - * collected prototypes header - * - * frozen from "make proto" in May 2008 - * - * Copyright (C) Michael Adam 2008 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see <http://www.gnu.org/licenses/>. - */ - #ifndef _PROTO_H_ #define _PROTO_H_ +/* This file is automatically generated with "make proto". DO NOT EDIT */ + /* The following definitions come from auth/auth.c */ @@ -43,8 +23,7 @@ bool password_ok(const char *smb_name, DATA_BLOB password_blob); /* The following definitions come from auth/auth_domain.c */ -void attempt_machine_password_change(void); -NTSTATUS auth_domain_init(void); +NTSTATUS auth_domain_init(void) ; /* The following definitions come from auth/auth_ntlmssp.c */ @@ -103,7 +82,7 @@ NTSTATUS make_user_info_for_reply_enc(auth_usersupplied_info **user_info, const char *client_domain, DATA_BLOB lm_resp, DATA_BLOB nt_resp); bool make_user_info_guest(auth_usersupplied_info **user_info) ; -NTSTATUS make_server_info_sam(auth_serversupplied_info **server_info, +NTSTATUS make_server_info_sam(auth_serversupplied_info **server_info, struct samu *sampass); NTSTATUS create_local_token(auth_serversupplied_info *server_info); NTSTATUS create_token_from_username(TALLOC_CTX *mem_ctx, const char *username, @@ -116,18 +95,10 @@ bool user_in_group(const char *username, const char *groupname); NTSTATUS make_server_info_pw(auth_serversupplied_info **server_info, char *unix_username, struct passwd *pwd); -NTSTATUS make_serverinfo_from_username(TALLOC_CTX *mem_ctx, - const char *username, - bool is_guest, - struct auth_serversupplied_info **presult); -struct auth_serversupplied_info *copy_serverinfo(TALLOC_CTX *mem_ctx, - const auth_serversupplied_info *src); bool init_guest_info(void); -bool server_info_set_session_key(struct auth_serversupplied_info *info, - DATA_BLOB session_key); -NTSTATUS make_server_info_guest(TALLOC_CTX *mem_ctx, - auth_serversupplied_info **server_info); +NTSTATUS make_server_info_guest(auth_serversupplied_info **server_info); bool copy_current_user(struct current_user *dst, struct current_user *src); +bool set_current_user_guest(struct current_user *dst); struct passwd *smb_getpwnam( TALLOC_CTX *mem_ctx, char *domuser, fstring save_username, bool create ); NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx, @@ -172,8 +143,6 @@ bool nt_token_check_domain_rid( NT_USER_TOKEN *token, uint32 rid ); NT_USER_TOKEN *get_root_nt_token( void ); NTSTATUS add_aliases(const DOM_SID *domain_sid, struct nt_user_token *token); -NTSTATUS create_builtin_users(const DOM_SID *sid); -NTSTATUS create_builtin_administrators(const DOM_SID *sid); struct nt_user_token *create_local_nt_token(TALLOC_CTX *mem_ctx, const DOM_SID *user_sid, bool is_guest, @@ -183,6 +152,31 @@ void debug_nt_user_token(int dbg_class, int dbg_lev, NT_USER_TOKEN *token); void debug_unix_user_token(int dbg_class, int dbg_lev, uid_t uid, gid_t gid, int n_groups, gid_t *groups); +/* The following definitions come from dynconfig.c */ + +const char *get_dyn_CONFIGFILE(void); +const char *set_dyn_CONFIGFILE(const char *newpath); +const char *get_dyn_LOGFILEBASE(void); +const char *set_dyn_LOGFILEBASE(const char *newpath); +const char *get_dyn_LMHOSTSFILE(void); +const char *set_dyn_LMHOSTSFILE(const char *newpath); +const char *get_dyn_CODEPAGEDIR(void); +const char *set_dyn_CODEPAGEDIR(const char *newpath); +const char *get_dyn_LIBDIR(void); +const char *set_dyn_LIBDIR(const char *newpath); +const char *get_dyn_SHLIBEXT(void); +const char *set_dyn_SHLIBEXT(const char *newpath); +const char *get_dyn_LOCKDIR(void); +const char *set_dyn_LOCKDIR(const char *newpath); +const char *get_dyn_PIDDIR(void); +const char *set_dyn_PIDDIR(const char *newpath); +const char *get_dyn_SMB_PASSWD_FILE(void); +const char *set_dyn_SMB_PASSWD_FILE(const char *newpath); +const char *get_dyn_PRIVATE_DIR(void); +const char *set_dyn_PRIVATE_DIR(const char *newpath); +const char *get_dyn_STATEDIR(void); +const char *get_dyn_CACHEDIR(void); + /* The following definitions come from groupdb/mapping.c */ NTSTATUS add_initial_entry(gid_t gid, const char *sid, enum lsa_SidType sid_name_use, const char *nt_name, const char *comment); @@ -269,9 +263,6 @@ char *lang_tdb_current(void); /* The following definitions come from lib/access.c */ -bool client_match(const char *tok, const void *item); -bool list_match(const char **list,const void *item, - bool (*match_fn)(const char *, const void *)); bool allow_access(const char **deny_list, const char **allow_list, const char *cname, @@ -349,9 +340,9 @@ size_t convert_string(charset_t from, charset_t to, bool convert_string_allocate(TALLOC_CTX *ctx, charset_t from, charset_t to, void const *src, size_t srclen, void *dst, size_t *converted_size, bool allow_bad_conv); -bool convert_string_talloc(TALLOC_CTX *ctx, charset_t from, charset_t to, - void const *src, size_t srclen, void *dst, - size_t *converted_size, bool allow_bad_conv); +size_t convert_string_talloc(TALLOC_CTX *ctx, charset_t from, charset_t to, + void const *src, size_t srclen, void *dst, + bool allow_bad_conv); size_t unix_strupper(const char *src, size_t srclen, char *dest, size_t destlen); char *strdup_upper(const char *s); char *talloc_strdup_upper(TALLOC_CTX *ctx, const char *s); @@ -362,17 +353,16 @@ size_t ucs2_align(const void *base_ptr, const void *p, int flags); size_t push_ascii(void *dest, const char *src, size_t dest_len, int flags); size_t push_ascii_fstring(void *dest, const char *src); size_t push_ascii_nstring(void *dest, const char *src); -bool push_ascii_allocate(char **dest, const char *src, size_t *converted_size); +size_t push_ascii_allocate(char **dest, const char *src); size_t pull_ascii(char *dest, const void *src, size_t dest_len, size_t src_len, int flags); size_t pull_ascii_fstring(char *dest, const void *src); size_t pull_ascii_nstring(char *dest, size_t dest_len, const void *src); size_t push_ucs2(const void *base_ptr, void *dest, const char *src, size_t dest_len, int flags); -bool push_ucs2_allocate(smb_ucs2_t **dest, const char *src, - size_t *converted_size); +size_t push_ucs2_talloc(TALLOC_CTX *ctx, smb_ucs2_t **dest, const char *src); +size_t push_ucs2_allocate(smb_ucs2_t **dest, const char *src); size_t push_utf8_fstring(void *dest, const char *src); -bool push_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src, - size_t *converted_size); -bool push_utf8_allocate(char **dest, const char *src, size_t *converted_size); +size_t push_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src); +size_t push_utf8_allocate(char **dest, const char *src); size_t pull_ucs2(const void *base_ptr, char *dest, const void *src, size_t dest_len, size_t src_len, int flags); size_t pull_ucs2_base_talloc(TALLOC_CTX *ctx, const void *base_ptr, @@ -381,17 +371,11 @@ size_t pull_ucs2_base_talloc(TALLOC_CTX *ctx, size_t src_len, int flags); size_t pull_ucs2_fstring(char *dest, const void *src); -bool push_ucs2_talloc(TALLOC_CTX *ctx, smb_ucs2_t **dest, const char *src, - size_t *converted_size); -bool pull_ucs2_allocate(char **dest, const smb_ucs2_t *src, - size_t *converted_size); -bool pull_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src, - size_t *converted_size); -bool pull_utf8_allocate(char **dest, const char *src, size_t *converted_size); -bool pull_ucs2_talloc(TALLOC_CTX *ctx, char **dest, const smb_ucs2_t *src, - size_t *converted_size); -bool pull_ascii_talloc(TALLOC_CTX *ctx, char **dest, const char *src, - size_t *converted_size); +size_t pull_ucs2_talloc(TALLOC_CTX *ctx, char **dest, const smb_ucs2_t *src); +size_t pull_ucs2_allocate(char **dest, const smb_ucs2_t *src); +size_t pull_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src); +size_t pull_utf8_allocate(char **dest, const char *src); +size_t pull_ascii_talloc(TALLOC_CTX *ctx, char **dest, const char *src); size_t push_string_fn(const char *function, unsigned int line, const void *base_ptr, uint16 flags2, void *dest, const char *src, @@ -452,7 +436,6 @@ void data_blob_clear_free(DATA_BLOB *d); DATA_BLOB data_blob_string_const(const char *str); DATA_BLOB data_blob_const(const void *p, size_t length); DATA_BLOB data_blob_talloc_zero(TALLOC_CTX *mem_ctx, size_t length); -_PUBLIC_ char *data_blob_hex_string(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob); /* The following definitions come from lib/dbwrap_util.c */ @@ -460,7 +443,7 @@ int32_t dbwrap_fetch_int32(struct db_context *db, const char *keystr); int dbwrap_store_int32(struct db_context *db, const char *keystr, int32_t v); bool dbwrap_fetch_uint32(struct db_context *db, const char *keystr, uint32_t *val); -bool dbwrap_store_uint32(struct db_context *db, const char *keystr, uint32_t v); +int dbwrap_store_uint32(struct db_context *db, const char *keystr, uint32_t v); uint32_t dbwrap_change_uint32_atomic(struct db_context *db, const char *keystr, uint32_t *oldval, uint32_t change_val); int32 dbwrap_change_int32_atomic(struct db_context *db, const char *keystr, @@ -483,7 +466,11 @@ const char *debug_classname_from_index(int ndx); int debug_add_class(const char *classname); int debug_lookup_classname(const char *classname); bool debug_parse_levels(const char *params_str); -void debug_message(struct messaging_context *msg_ctx, void *private_data, uint32_t msg_type, struct server_id src, DATA_BLOB *data); +void debug_message(struct messaging_context *msg_ctx, + void *private_data, + uint32_t msg_type, + struct server_id src, + DATA_BLOB *data); void debug_init(void); void debug_register_msgs(struct messaging_context *msg_ctx); void setup_logging(const char *pname, bool interactive); @@ -499,7 +486,7 @@ TALLOC_CTX *debug_ctx(void); /* The following definitions come from lib/display_sec.c */ char *get_sec_mask_str(TALLOC_CTX *ctx, uint32 type); -void display_sec_access(uint32_t *info); +void display_sec_access(SEC_ACCESS *info); void display_sec_ace_flags(uint8_t flags); void display_sec_ace(SEC_ACE *ace); void display_sec_acl(SEC_ACL *sec_acl); @@ -517,7 +504,6 @@ void display_set_stderr(void); /* The following definitions come from lib/errmap_unix.c */ NTSTATUS map_nt_error_from_unix(int unix_error); -int map_errno_from_nt_status(NTSTATUS status); /* The following definitions come from lib/events.c */ @@ -552,11 +538,8 @@ bool run_events(struct event_context *event_ctx, struct timeval *get_timed_events_timeout(struct event_context *event_ctx, struct timeval *to_ret); int event_loop_once(struct event_context *ev); +void event_context_reinit(struct event_context *ev); struct event_context *event_context_init(TALLOC_CTX *mem_ctx); -int set_event_dispatch_time(struct event_context *event_ctx, - const char *event_name, struct timeval when); -int cancel_named_event(struct event_context *event_ctx, - const char *event_name); void dump_event_list(struct event_context *event_ctx); /* The following definitions come from lib/fault.c */ @@ -792,17 +775,9 @@ SEC_DESC_BUF *dup_sec_desc_buf(TALLOC_CTX *ctx, SEC_DESC_BUF *src); NTSTATUS sec_desc_add_sid(TALLOC_CTX *ctx, SEC_DESC **psd, DOM_SID *sid, uint32 mask, size_t *sd_size); NTSTATUS sec_desc_mod_sid(SEC_DESC *sd, DOM_SID *sid, uint32 mask); NTSTATUS sec_desc_del_sid(TALLOC_CTX *ctx, SEC_DESC **psd, DOM_SID *sid, size_t *sd_size); -NTSTATUS se_create_child_secdesc(TALLOC_CTX *ctx, - SEC_DESC **ppsd, - size_t *psize, - const SEC_DESC *parent_ctr, - const DOM_SID *owner_sid, - const DOM_SID *group_sid, - bool container); -NTSTATUS se_create_child_secdesc_buf(TALLOC_CTX *ctx, - SEC_DESC_BUF **ppsdb, - const SEC_DESC *parent_ctr, - bool container); +SEC_DESC_BUF *se_create_child_secdesc(TALLOC_CTX *ctx, SEC_DESC *parent_ctr, + bool child_container); +void init_sec_access(uint32 *t, uint32 mask); /* The following definitions come from lib/select.c */ @@ -901,8 +876,7 @@ const char *get_local_machine_name(void); bool set_remote_machine_name(const char *remote_name, bool perm); const char *get_remote_machine_name(void); void sub_set_smb_name(const char *name); -void set_current_user_info(const char *smb_name, const char *unix_name, - const char *full_name, const char *domain); +void set_current_user_info(const userdom_struct *pcui); const char *get_current_username(void); void standard_sub_basic(const char *smb_name, const char *domain_name, char *str, size_t len); @@ -1037,6 +1011,7 @@ void *sys_memalign( size_t align, size_t size ); int sys_usleep(long usecs); ssize_t sys_read(int fd, void *buf, size_t count); ssize_t sys_write(int fd, const void *buf, size_t count); +ssize_t sys_writev(int fd, const struct iovec *iov, int iovcnt); ssize_t sys_pread(int fd, void *buf, size_t count, SMB_OFF_T off); ssize_t sys_pwrite(int fd, const void *buf, size_t count, SMB_OFF_T off); ssize_t sys_send(int s, const void *msg, size_t len, int flags); @@ -1196,7 +1171,7 @@ void srv_put_dos_date2(char *buf,int offset, time_t unixdate); void srv_put_dos_date3(char *buf,int offset,time_t unixdate); void put_long_date_timespec(char *p, struct timespec ts); void put_long_date(char *p, time_t t); -struct timespec get_create_timespec(const SMB_STRUCT_STAT *st,bool fake_dirs); +struct timespec get_create_timespec(const SMB_STRUCT_STAT *pst,bool fake_dirs); struct timespec get_atimespec(const SMB_STRUCT_STAT *pst); void set_atimespec(SMB_STRUCT_STAT *pst, struct timespec ts); struct timespec get_mtimespec(const SMB_STRUCT_STAT *pst); @@ -1227,7 +1202,6 @@ bool nt_time_equals(const NTTIME *nt1, const NTTIME *nt2); void TimeInit(void); void get_process_uptime(struct timeval *ret_time); time_t nt_time_to_unix_abs(const NTTIME *nt); -time_t uint64s_nt_time_to_unix_abs(const uint64_t *src); void unix_timespec_to_nt_time(NTTIME *nt, struct timespec ts); void unix_to_nt_time_abs(NTTIME *nt, time_t t); bool null_mtime(time_t mtime); @@ -1263,7 +1237,6 @@ const char *get_cmdline_auth_info_password(void); void set_cmdline_auth_info_password(const char *password); bool set_cmdline_auth_info_signing_state(const char *arg); int get_cmdline_auth_info_signing_state(void); -void set_cmdline_auth_info_use_kerberos(bool b); bool get_cmdline_auth_info_use_kerberos(void); void set_cmdline_auth_info_use_krb5_ticket(void); void set_cmdline_auth_info_smb_encrypt(void); @@ -1296,6 +1269,7 @@ int set_blocking(int fd, bool set); void smb_msleep(unsigned int t); void become_daemon(bool Fork, bool no_process_group); bool reinit_after_fork(struct messaging_context *msg_ctx, + struct event_context *ev_ctx, bool parent_longlived); bool yesno(const char *p); void *malloc_(size_t size); @@ -1323,7 +1297,7 @@ void smb_panic(const char *const why); void log_stack_trace(void); const char *readdirname(SMB_STRUCT_DIR *p); bool is_in_path(const char *name, name_compare_entry *namelist, bool case_sensitive); -void set_namearray(name_compare_entry **ppname_array, const char *namelist); +void set_namearray(name_compare_entry **ppname_array, char *namelist); void free_namearray(name_compare_entry *name_array); bool fcntl_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type); bool fcntl_getlock(int fd, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid); @@ -1350,7 +1324,6 @@ char *myhostname(void); char *lock_path(const char *name); char *pid_path(const char *name); char *lib_path(const char *name); -char *modules_path(const char *name); char *data_path(const char *name); char *state_path(const char *name); const char *shlib_ext(void); @@ -1399,8 +1372,6 @@ void *talloc_zeronull(const void *context, size_t size, const char *name); NTSTATUS split_ntfs_stream_name(TALLOC_CTX *mem_ctx, const char *fname, char **pbase, char **pstream); bool is_valid_policy_hnd(const POLICY_HND *hnd); -bool policy_hnd_equal(const struct policy_handle *hnd1, - const struct policy_handle *hnd2); const char *strip_hostname(const char *s); /* The following definitions come from lib/util_file.c */ @@ -1425,10 +1396,6 @@ void smb_nscd_flush_group_cache(void); /* The following definitions come from lib/util_nttoken.c */ NT_USER_TOKEN *dup_nt_token(TALLOC_CTX *mem_ctx, const NT_USER_TOKEN *ptoken); -NTSTATUS merge_nt_token(TALLOC_CTX *mem_ctx, - const struct nt_user_token *token_1, - const struct nt_user_token *token_2, - struct nt_user_token **token_out); /* The following definitions come from lib/util_pw.c */ @@ -1456,10 +1423,10 @@ WERROR registry_push_value(TALLOC_CTX *mem_ctx, /* The following definitions come from lib/util_seaccess.c */ void se_map_generic(uint32 *access_mask, const struct generic_mapping *mapping); -void security_acl_map_generic(struct security_acl *sa, const struct generic_mapping *mapping); void se_map_standard(uint32 *access_mask, struct standard_mapping *mapping); -NTSTATUS se_access_check(const SEC_DESC *sd, const NT_USER_TOKEN *token, - uint32 acc_desired, uint32 *acc_granted); +bool se_access_check(const SEC_DESC *sd, const NT_USER_TOKEN *token, + uint32 acc_desired, uint32 *acc_granted, + NTSTATUS *status); NTSTATUS samr_make_sam_obj_sd(TALLOC_CTX *ctx, SEC_DESC **psd, size_t *sd_size); /* The following definitions come from lib/util_sec.c */ @@ -1546,7 +1513,7 @@ bool same_net(const struct sockaddr_storage *ip1, const struct sockaddr_storage *ip2, const struct sockaddr_storage *mask); bool sockaddr_equal(const struct sockaddr_storage *ip1, - const struct sockaddr_storage *ip2); + const struct sockaddr_storage *ip2); bool is_address_any(const struct sockaddr_storage *psa); uint16_t get_sockaddr_port(const struct sockaddr_storage *pss); char *print_sockaddr(char *dest, @@ -1574,6 +1541,7 @@ NTSTATUS read_socket_with_timeout(int fd, char *buf, unsigned int time_out, size_t *size_ret); NTSTATUS read_data(int fd, char *buffer, size_t N); +ssize_t write_data_iov(int fd, const struct iovec *orig_iov, int iovcnt); ssize_t write_data(int fd, const char *buffer, size_t N); bool send_keepalive(int client); NTSTATUS read_smb_length_return_keepalive(int fd, char *inbuf, @@ -1581,12 +1549,8 @@ NTSTATUS read_smb_length_return_keepalive(int fd, char *inbuf, size_t *len); NTSTATUS read_smb_length(int fd, char *inbuf, unsigned int timeout, size_t *len); -NTSTATUS receive_smb_raw(int fd, - char *buffer, - size_t buflen, - unsigned int timeout, - size_t maxlen, - size_t *p_len); +NTSTATUS receive_smb_raw(int fd, char *buffer, size_t buflen, unsigned int timeout, + size_t maxlen, size_t *p_len); int open_socket_in(int type, uint16_t port, int dlevel, @@ -1729,7 +1693,6 @@ void sprintf_append(TALLOC_CTX *mem_ctx, char **string, ssize_t *len, size_t *bufsize, const char *fmt, ...); int asprintf_strupper_m(char **strp, const char *fmt, ...); char *talloc_asprintf_strupper_m(TALLOC_CTX *t, const char *fmt, ...); -char *talloc_asprintf_strlower_m(TALLOC_CTX *t, const char *fmt, ...); char *sstring_sub(const char *src, char front, char back); bool validate_net_name( const char *name, const char *invalid_chars, @@ -1938,15 +1901,20 @@ NTSTATUS kerberos_return_info3_from_pac(TALLOC_CTX *mem_ctx, struct netr_SamInfo3 **info3); /* The following definitions come from libads/cldap.c */ + bool ads_cldap_netlogon(TALLOC_CTX *mem_ctx, const char *server, const char *realm, - uint32_t nt_version, - struct netlogon_samlogon_response **reply); + uint32_t *nt_version, + union nbt_cldap_netlogon **reply); bool ads_cldap_netlogon_5(TALLOC_CTX *mem_ctx, const char *server, const char *realm, - struct NETLOGON_SAM_LOGON_RESPONSE_EX *reply5); + struct nbt_cldap_netlogon_5 *reply5); +bool pull_mailslot_cldap_reply(TALLOC_CTX *mem_ctx, + const DATA_BLOB *blob, + union nbt_cldap_netlogon *r, + uint32_t *nt_version); /* The following definitions come from libads/disp_sec.c */ @@ -2054,9 +2022,8 @@ ADS_STATUS ads_set_machine_password(ADS_STRUCT *ads, bool ads_sitename_match(ADS_STRUCT *ads); bool ads_closest_dc(ADS_STRUCT *ads); +bool ads_try_connect(ADS_STRUCT *ads, const char *server ); ADS_STATUS ads_connect(ADS_STRUCT *ads); -ADS_STATUS ads_connect_user_creds(ADS_STRUCT *ads); -ADS_STATUS ads_connect_gc(ADS_STRUCT *ads); void ads_disconnect(ADS_STRUCT *ads); ADS_STATUS ads_do_search_all_fn(ADS_STRUCT *ads, const char *bind_path, int scope, const char *expr, const char **attrs, @@ -2076,8 +2043,7 @@ char *ads_ou_string(ADS_STRUCT *ads, const char *org_unit); char *ads_default_ou_string(ADS_STRUCT *ads, const char *wknguid); ADS_STATUS ads_add_strlist(TALLOC_CTX *ctx, ADS_MODLIST *mods, const char *name, const char **vals); -uint32 ads_get_kvno(ADS_STRUCT *ads, const char *account_name); -uint32_t ads_get_machine_kvno(ADS_STRUCT *ads, const char *machine_name); +uint32 ads_get_kvno(ADS_STRUCT *ads, const char *machine_name); ADS_STATUS ads_clear_service_principal_names(ADS_STRUCT *ads, const char *machine_name); ADS_STATUS ads_add_service_principal_name(ADS_STRUCT *ads, const char *machine_name, const char *my_fqdn, const char *spn); @@ -2227,45 +2193,6 @@ _PUBLIC_ enum ndr_err_code ndr_pull_wrepl_nbt_name(struct ndr_pull *ndr, int ndr _PUBLIC_ enum ndr_err_code ndr_push_wrepl_nbt_name(struct ndr_push *ndr, int ndr_flags, const struct nbt_name *r); _PUBLIC_ void ndr_print_wrepl_nbt_name(struct ndr_print *ndr, const char *name, const struct nbt_name *r); -/* The following definitions come from libgpo/gpext/gpext.c */ - -struct gp_extension *get_gp_extension_list(void); -NTSTATUS unregister_gp_extension(const char *name); -NTSTATUS register_gp_extension(TALLOC_CTX *gpext_ctx, - int version, - const char *name, - const char *guid, - struct gp_extension_methods *methods); -NTSTATUS gp_ext_info_add_entry(TALLOC_CTX *mem_ctx, - const char *module, - const char *ext_guid, - struct gp_extension_reg_table *table, - struct gp_extension_reg_info *info); -NTSTATUS shutdown_gp_extensions(void); -NTSTATUS init_gp_extensions(TALLOC_CTX *mem_ctx); -NTSTATUS free_gp_extensions(void); -void debug_gpext_header(int lvl, - const char *name, - uint32_t flags, - struct GROUP_POLICY_OBJECT *gpo, - const char *extension_guid, - const char *snapin_guid); -NTSTATUS process_gpo_list_with_extension(ADS_STRUCT *ads, - TALLOC_CTX *mem_ctx, - uint32_t flags, - const struct nt_user_token *token, - struct GROUP_POLICY_OBJECT *gpo_list, - const char *extension_guid, - const char *snapin_guid); -NTSTATUS gpext_process_extension(ADS_STRUCT *ads, - TALLOC_CTX *mem_ctx, - uint32_t flags, - const struct nt_user_token *token, - struct registry_key *root_key, - struct GROUP_POLICY_OBJECT *gpo, - const char *extension_guid, - const char *snapin_guid); - /* The following definitions come from libgpo/gpo_fetch.c */ NTSTATUS gpo_explode_filesyspath(TALLOC_CTX *mem_ctx, @@ -2335,65 +2262,6 @@ ADS_STATUS ads_get_gpo_list(ADS_STRUCT *ads, const struct nt_user_token *token, struct GROUP_POLICY_OBJECT **gpo_list); -/* The following definitions come from libgpo/gpo_reg.c */ - -struct nt_user_token *registry_create_system_token(TALLOC_CTX *mem_ctx); -WERROR gp_init_reg_ctx(TALLOC_CTX *mem_ctx, - const char *initial_path, - uint32_t desired_access, - const struct nt_user_token *token, - struct gp_registry_context **reg_ctx); -void gp_free_reg_ctx(struct gp_registry_context *reg_ctx); -WERROR gp_store_reg_subkey(TALLOC_CTX *mem_ctx, - const char *subkeyname, - struct registry_key *curr_key, - struct registry_key **new_key); -WERROR gp_read_reg_subkey(TALLOC_CTX *mem_ctx, - struct gp_registry_context *reg_ctx, - const char *subkeyname, - struct registry_key **key); -WERROR gp_store_reg_val_sz(TALLOC_CTX *mem_ctx, - struct registry_key *key, - const char *val_name, - const char *val); -WERROR gp_read_reg_val_sz(TALLOC_CTX *mem_ctx, - struct registry_key *key, - const char *val_name, - const char **val); -WERROR gp_reg_state_store(TALLOC_CTX *mem_ctx, - uint32_t flags, - const char *dn, - const struct nt_user_token *token, - struct GROUP_POLICY_OBJECT *gpo_list); -WERROR gp_reg_state_read(TALLOC_CTX *mem_ctx, - uint32_t flags, - const DOM_SID *sid, - struct GROUP_POLICY_OBJECT **gpo_list); -WERROR gp_secure_key(TALLOC_CTX *mem_ctx, - uint32_t flags, - struct registry_key *key, - const DOM_SID *sid); -void dump_reg_val(int lvl, const char *direction, - const char *key, const char *subkey, - struct registry_value *val); -void dump_reg_entry(uint32_t flags, - const char *dir, - struct gp_registry_entry *entry); -void dump_reg_entries(uint32_t flags, - const char *dir, - struct gp_registry_entry *entries, - size_t num_entries); -bool add_gp_registry_entry_to_array(TALLOC_CTX *mem_ctx, - struct gp_registry_entry *entry, - struct gp_registry_entry **entries, - size_t *num); -WERROR reg_apply_registry_entry(TALLOC_CTX *mem_ctx, - struct registry_key *root_key, - struct gp_registry_context *reg_ctx, - struct gp_registry_entry *entry, - const struct nt_user_token *token, - uint32_t flags); - /* The following definitions come from libgpo/gpo_sec.c */ NTSTATUS gpo_apply_security_filtering(const struct GROUP_POLICY_OBJECT *gpo, @@ -2414,10 +2282,16 @@ void dump_gpo_list(ADS_STRUCT *ads, struct GROUP_POLICY_OBJECT *gpo_list, int debuglevel); void dump_gplink(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, struct GP_LINK *gp_link); +NTSTATUS process_extension(ADS_STRUCT *ads, + TALLOC_CTX *mem_ctx, + uint32_t flags, + const struct nt_user_token *token, + struct GROUP_POLICY_OBJECT *gpo, + const char *extension_guid, + const char *snapin_guid); ADS_STATUS gpo_process_a_gpo(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, const struct nt_user_token *token, - struct registry_key *root_key, struct GROUP_POLICY_OBJECT *gpo, const char *extension_guid_filter, uint32_t flags); @@ -2425,7 +2299,7 @@ ADS_STATUS gpo_process_gpo_list(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, const struct nt_user_token *token, struct GROUP_POLICY_OBJECT *gpo_list, - const char *extensions_guid_filter, + const char *extensions_guid, uint32_t flags); NTSTATUS check_refresh_gpo(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, @@ -2436,19 +2310,11 @@ NTSTATUS check_refresh_gpo_list(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, uint32_t flags, struct GROUP_POLICY_OBJECT *gpo_list); -NTSTATUS gpo_get_unix_path(TALLOC_CTX *mem_ctx, - struct GROUP_POLICY_OBJECT *gpo, - char **unix_path); -char *gpo_flag_str(uint32_t flags); NTSTATUS gp_find_file(TALLOC_CTX *mem_ctx, uint32_t flags, const char *filename, const char *suffix, const char **filename_out); -ADS_STATUS gp_get_machine_token(ADS_STRUCT *ads, - TALLOC_CTX *mem_ctx, - const char *dn, - struct nt_user_token **token); /* The following definitions come from librpc/gen_ndr/ndr_dfs.c */ @@ -2877,6 +2743,93 @@ _PUBLIC_ enum ndr_err_code ndr_push_samr_RejectReason(struct ndr_push *ndr, int _PUBLIC_ enum ndr_err_code ndr_pull_samr_RejectReason(struct ndr_pull *ndr, int ndr_flags, enum samr_RejectReason *r); _PUBLIC_ void ndr_print_samr_RejectReason(struct ndr_print *ndr, const char *name, enum samr_RejectReason r); +/* The following definitions come from librpc/gen_ndr/ndr_nbt.c */ + +_PUBLIC_ void ndr_print_nbt_operation(struct ndr_print *ndr, const char *name, uint16_t r); +_PUBLIC_ void ndr_print_nbt_name_type(struct ndr_print *ndr, const char *name, enum nbt_name_type r); +_PUBLIC_ void ndr_print_nbt_name(struct ndr_print *ndr, const char *name, const struct nbt_name *r); +_PUBLIC_ void ndr_print_nbt_qclass(struct ndr_print *ndr, const char *name, enum nbt_qclass r); +_PUBLIC_ void ndr_print_nbt_qtype(struct ndr_print *ndr, const char *name, enum nbt_qtype r); +_PUBLIC_ void ndr_print_nbt_name_question(struct ndr_print *ndr, const char *name, const struct nbt_name_question *r); +_PUBLIC_ void ndr_print_nb_flags(struct ndr_print *ndr, const char *name, uint16_t r); +_PUBLIC_ void ndr_print_nbt_rdata_address(struct ndr_print *ndr, const char *name, const struct nbt_rdata_address *r); +_PUBLIC_ void ndr_print_nbt_rdata_netbios(struct ndr_print *ndr, const char *name, const struct nbt_rdata_netbios *r); +_PUBLIC_ void ndr_print_nbt_statistics(struct ndr_print *ndr, const char *name, const struct nbt_statistics *r); +_PUBLIC_ void ndr_print_nbt_status_name(struct ndr_print *ndr, const char *name, const struct nbt_status_name *r); +_PUBLIC_ void ndr_print_nbt_rdata_status(struct ndr_print *ndr, const char *name, const struct nbt_rdata_status *r); +_PUBLIC_ void ndr_print_nbt_rdata_data(struct ndr_print *ndr, const char *name, const struct nbt_rdata_data *r); +_PUBLIC_ void ndr_print_nbt_rdata(struct ndr_print *ndr, const char *name, const union nbt_rdata *r); +_PUBLIC_ void ndr_print_nbt_res_rec(struct ndr_print *ndr, const char *name, const struct nbt_res_rec *r); +_PUBLIC_ enum ndr_err_code ndr_push_nbt_name_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_name_packet *r); +_PUBLIC_ enum ndr_err_code ndr_pull_nbt_name_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_name_packet *r); +_PUBLIC_ void ndr_print_nbt_name_packet(struct ndr_print *ndr, const char *name, const struct nbt_name_packet *r); +_PUBLIC_ void ndr_print_dgram_msg_type(struct ndr_print *ndr, const char *name, enum dgram_msg_type r); +_PUBLIC_ void ndr_print_dgram_flags(struct ndr_print *ndr, const char *name, uint8_t r); +_PUBLIC_ void ndr_print_smb_command(struct ndr_print *ndr, const char *name, enum smb_command r); +_PUBLIC_ void ndr_print_smb_trans_body(struct ndr_print *ndr, const char *name, const struct smb_trans_body *r); +_PUBLIC_ void ndr_print_smb_body(struct ndr_print *ndr, const char *name, const union smb_body *r); +_PUBLIC_ enum ndr_err_code ndr_push_dgram_smb_packet(struct ndr_push *ndr, int ndr_flags, const struct dgram_smb_packet *r); +_PUBLIC_ enum ndr_err_code ndr_pull_dgram_smb_packet(struct ndr_pull *ndr, int ndr_flags, struct dgram_smb_packet *r); +_PUBLIC_ void ndr_print_dgram_smb_packet(struct ndr_print *ndr, const char *name, const struct dgram_smb_packet *r); +_PUBLIC_ void ndr_print_dgram_message_body(struct ndr_print *ndr, const char *name, const union dgram_message_body *r); +_PUBLIC_ void ndr_print_dgram_message(struct ndr_print *ndr, const char *name, const struct dgram_message *r); +_PUBLIC_ void ndr_print_dgram_err_code(struct ndr_print *ndr, const char *name, enum dgram_err_code r); +_PUBLIC_ void ndr_print_dgram_data(struct ndr_print *ndr, const char *name, const union dgram_data *r); +_PUBLIC_ enum ndr_err_code ndr_push_nbt_dgram_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_dgram_packet *r); +_PUBLIC_ enum ndr_err_code ndr_pull_nbt_dgram_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_dgram_packet *r); +_PUBLIC_ void ndr_print_nbt_dgram_packet(struct ndr_print *ndr, const char *name, const struct nbt_dgram_packet *r); +_PUBLIC_ void ndr_print_nbt_netlogon_command(struct ndr_print *ndr, const char *name, enum nbt_netlogon_command r); +_PUBLIC_ void ndr_print_nbt_netlogon_version(struct ndr_print *ndr, const char *name, uint32_t r); +_PUBLIC_ void ndr_print_nbt_netlogon_query_for_pdc(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_query_for_pdc *r); +_PUBLIC_ void ndr_print_nbt_netlogon_query_for_pdc2(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_query_for_pdc2 *r); +_PUBLIC_ void ndr_print_nbt_netlogon_response_from_pdc(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_response_from_pdc *r); +_PUBLIC_ void ndr_print_nbt_server_type(struct ndr_print *ndr, const char *name, uint32_t r); +_PUBLIC_ void ndr_print_nbt_dc_sock_addr(struct ndr_print *ndr, const char *name, const struct nbt_dc_sock_addr *r); +_PUBLIC_ void ndr_print_nbt_netlogon_response_from_pdc2(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_response_from_pdc2 *r); +_PUBLIC_ void ndr_print_nbt_db_change(struct ndr_print *ndr, const char *name, const struct nbt_db_change *r); +_PUBLIC_ void ndr_print_nbt_netlogon_announce_uas(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_announce_uas *r); +_PUBLIC_ void ndr_print_nbt_netlogon_request(struct ndr_print *ndr, const char *name, const union nbt_netlogon_request *r); +_PUBLIC_ enum ndr_err_code ndr_push_nbt_netlogon_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_netlogon_packet *r); +_PUBLIC_ enum ndr_err_code ndr_pull_nbt_netlogon_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_netlogon_packet *r); +_PUBLIC_ void ndr_print_nbt_netlogon_packet(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_packet *r); +_PUBLIC_ void ndr_print_nbt_cldap_netlogon_1(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_1 *r); +_PUBLIC_ void ndr_print_nbt_cldap_netlogon_3(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_3 *r); +_PUBLIC_ enum ndr_err_code ndr_push_nbt_cldap_netlogon_5(struct ndr_push *ndr, int ndr_flags, const struct nbt_cldap_netlogon_5 *r); +_PUBLIC_ enum ndr_err_code ndr_pull_nbt_cldap_netlogon_5(struct ndr_pull *ndr, int ndr_flags, struct nbt_cldap_netlogon_5 *r); +_PUBLIC_ void ndr_print_nbt_cldap_netlogon_5(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_5 *r); +_PUBLIC_ void ndr_print_nbt_cldap_netlogon_13(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_13 *r); +_PUBLIC_ enum ndr_err_code ndr_push_nbt_cldap_netlogon_15(struct ndr_push *ndr, int ndr_flags, const struct nbt_cldap_netlogon_15 *r); +_PUBLIC_ enum ndr_err_code ndr_pull_nbt_cldap_netlogon_15(struct ndr_pull *ndr, int ndr_flags, struct nbt_cldap_netlogon_15 *r); +_PUBLIC_ void ndr_print_nbt_cldap_netlogon_15(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_15 *r); +_PUBLIC_ enum ndr_err_code ndr_push_nbt_cldap_netlogon_29(struct ndr_push *ndr, int ndr_flags, const struct nbt_cldap_netlogon_29 *r); +_PUBLIC_ enum ndr_err_code ndr_pull_nbt_cldap_netlogon_29(struct ndr_pull *ndr, int ndr_flags, struct nbt_cldap_netlogon_29 *r); +_PUBLIC_ void ndr_print_nbt_cldap_netlogon_29(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_29 *r); +_PUBLIC_ enum ndr_err_code ndr_push_nbt_cldap_netlogon(struct ndr_push *ndr, int ndr_flags, const union nbt_cldap_netlogon *r); +_PUBLIC_ enum ndr_err_code ndr_pull_nbt_cldap_netlogon(struct ndr_pull *ndr, int ndr_flags, union nbt_cldap_netlogon *r); +_PUBLIC_ void ndr_print_nbt_cldap_netlogon(struct ndr_print *ndr, const char *name, const union nbt_cldap_netlogon *r); +_PUBLIC_ void ndr_print_nbt_ntlogon_command(struct ndr_print *ndr, const char *name, enum nbt_ntlogon_command r); +_PUBLIC_ void ndr_print_nbt_ntlogon_sam_logon(struct ndr_print *ndr, const char *name, const struct nbt_ntlogon_sam_logon *r); +_PUBLIC_ void ndr_print_nbt_ntlogon_sam_logon_reply(struct ndr_print *ndr, const char *name, const struct nbt_ntlogon_sam_logon_reply *r); +_PUBLIC_ void ndr_print_nbt_ntlogon_request(struct ndr_print *ndr, const char *name, const union nbt_ntlogon_request *r); +_PUBLIC_ enum ndr_err_code ndr_push_nbt_ntlogon_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_ntlogon_packet *r); +_PUBLIC_ enum ndr_err_code ndr_pull_nbt_ntlogon_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_ntlogon_packet *r); +_PUBLIC_ void ndr_print_nbt_ntlogon_packet(struct ndr_print *ndr, const char *name, const struct nbt_ntlogon_packet *r); +_PUBLIC_ void ndr_print_nbt_browse_opcode(struct ndr_print *ndr, const char *name, enum nbt_browse_opcode r); +_PUBLIC_ void ndr_print_nbt_browse_host_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_host_announcement *r); +_PUBLIC_ void ndr_print_nbt_browse_announcement_request(struct ndr_print *ndr, const char *name, const struct nbt_browse_announcement_request *r); +_PUBLIC_ void ndr_print_nbt_browse_election_request(struct ndr_print *ndr, const char *name, const struct nbt_browse_election_request *r); +_PUBLIC_ void ndr_print_nbt_browse_backup_list_request(struct ndr_print *ndr, const char *name, const struct nbt_browse_backup_list_request *r); +_PUBLIC_ void ndr_print_nbt_browse_backup_list_response(struct ndr_print *ndr, const char *name, const struct nbt_browse_backup_list_response *r); +_PUBLIC_ void ndr_print_nbt_browse_become_backup(struct ndr_print *ndr, const char *name, const struct nbt_browse_become_backup *r); +_PUBLIC_ void ndr_print_nbt_browse_domain_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_domain_announcement *r); +_PUBLIC_ void ndr_print_nbt_browse_master_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_master_announcement *r); +_PUBLIC_ void ndr_print_nbt_browse_reset_state(struct ndr_print *ndr, const char *name, const struct nbt_browse_reset_state *r); +_PUBLIC_ void ndr_print_nbt_browse_local_master_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_local_master_announcement *r); +_PUBLIC_ void ndr_print_nbt_browse_payload(struct ndr_print *ndr, const char *name, const union nbt_browse_payload *r); +_PUBLIC_ enum ndr_err_code ndr_push_nbt_browse_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_packet *r); +_PUBLIC_ enum ndr_err_code ndr_pull_nbt_browse_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_packet *r); +_PUBLIC_ void ndr_print_nbt_browse_packet(struct ndr_print *ndr, const char *name, const struct nbt_browse_packet *r); + /* The following definitions come from librpc/gen_ndr/ndr_netlogon.c */ _PUBLIC_ void ndr_print_netr_UasInfo(struct ndr_print *ndr, const char *name, const struct netr_UasInfo *r); @@ -3310,15 +3263,20 @@ _PUBLIC_ void ndr_print_samr_ValidatePassword(struct ndr_print *ndr, const char /* The following definitions come from librpc/gen_ndr/ndr_security.c */ +_PUBLIC_ enum ndr_err_code ndr_push_security_ace_flags(struct ndr_push *ndr, int ndr_flags, uint8_t r); +_PUBLIC_ enum ndr_err_code ndr_pull_security_ace_flags(struct ndr_pull *ndr, int ndr_flags, uint8_t *r); _PUBLIC_ void ndr_print_security_ace_flags(struct ndr_print *ndr, const char *name, uint8_t r); +_PUBLIC_ enum ndr_err_code ndr_push_security_ace_type(struct ndr_push *ndr, int ndr_flags, enum security_ace_type r); +_PUBLIC_ enum ndr_err_code ndr_pull_security_ace_type(struct ndr_pull *ndr, int ndr_flags, enum security_ace_type *r); _PUBLIC_ void ndr_print_security_ace_type(struct ndr_print *ndr, const char *name, enum security_ace_type r); _PUBLIC_ void ndr_print_security_ace_object_flags(struct ndr_print *ndr, const char *name, uint32_t r); _PUBLIC_ void ndr_print_security_ace_object_type(struct ndr_print *ndr, const char *name, const union security_ace_object_type *r); _PUBLIC_ void ndr_print_security_ace_object_inherited_type(struct ndr_print *ndr, const char *name, const union security_ace_object_inherited_type *r); _PUBLIC_ void ndr_print_security_ace_object(struct ndr_print *ndr, const char *name, const struct security_ace_object *r); +_PUBLIC_ enum ndr_err_code ndr_push_security_ace_object_ctr(struct ndr_push *ndr, int ndr_flags, const union security_ace_object_ctr *r); +_PUBLIC_ enum ndr_err_code ndr_pull_security_ace_object_ctr(struct ndr_pull *ndr, int ndr_flags, union security_ace_object_ctr *r); _PUBLIC_ void ndr_print_security_ace_object_ctr(struct ndr_print *ndr, const char *name, const union security_ace_object_ctr *r); _PUBLIC_ enum ndr_err_code ndr_push_security_ace(struct ndr_push *ndr, int ndr_flags, const struct security_ace *r); -_PUBLIC_ enum ndr_err_code ndr_pull_security_ace(struct ndr_pull *ndr, int ndr_flags, struct security_ace *r); _PUBLIC_ void ndr_print_security_ace(struct ndr_print *ndr, const char *name, const struct security_ace *r); _PUBLIC_ void ndr_print_security_acl_revision(struct ndr_print *ndr, const char *name, enum security_acl_revision r); _PUBLIC_ enum ndr_err_code ndr_push_security_acl(struct ndr_push *ndr, int ndr_flags, const struct security_acl *r); @@ -3542,8 +3500,6 @@ _PUBLIC_ void ndr_print_ENUM_SERVICE_STATUS(struct ndr_print *ndr, const char *n _PUBLIC_ enum ndr_err_code ndr_push_svcctl_ServerType(struct ndr_push *ndr, int ndr_flags, uint32_t r); _PUBLIC_ enum ndr_err_code ndr_pull_svcctl_ServerType(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); _PUBLIC_ void ndr_print_svcctl_ServerType(struct ndr_print *ndr, const char *name, uint32_t r); -_PUBLIC_ void ndr_print_svcctl_MgrAccessMask(struct ndr_print *ndr, const char *name, uint32_t r); -_PUBLIC_ void ndr_print_svcctl_ServiceAccessMask(struct ndr_print *ndr, const char *name, uint32_t r); _PUBLIC_ void ndr_print_svcctl_CloseServiceHandle(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_CloseServiceHandle *r); _PUBLIC_ void ndr_print_svcctl_ControlService(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_ControlService *r); _PUBLIC_ void ndr_print_svcctl_DeleteService(struct ndr_print *ndr, const char *name, int flags, const struct svcctl_DeleteService *r); @@ -4004,8 +3960,6 @@ void ndr_print_PAC_BUFFER(struct ndr_print *ndr, const char *name, const struct bool all_zero(const uint8_t *ptr, size_t size); void ndr_print_GUID(struct ndr_print *ndr, const char *name, const struct GUID *guid); -bool ndr_syntax_id_equal(const struct ndr_syntax_id *i1, - const struct ndr_syntax_id *i2); enum ndr_err_code ndr_push_server_id(struct ndr_push *ndr, int ndr_flags, const struct server_id *r); enum ndr_err_code ndr_pull_server_id(struct ndr_pull *ndr, int ndr_flags, struct server_id *r); void ndr_print_server_id(struct ndr_print *ndr, const char *name, const struct server_id *r); @@ -4015,6 +3969,7 @@ void ndr_print_server_id(struct ndr_print *ndr, const char *name, const struct s size_t ndr_size_dom_sid(const struct dom_sid *sid, int flags); size_t ndr_size_dom_sid28(const struct dom_sid *sid, int flags); size_t ndr_size_dom_sid0(const struct dom_sid *sid, int flags); +enum ndr_err_code ndr_pull_security_ace(struct ndr_pull *ndr, int ndr_flags, struct security_ace *r); size_t ndr_size_security_ace(const struct security_ace *ace, int flags); size_t ndr_size_security_acl(const struct security_acl *acl, int flags); size_t ndr_size_security_descriptor(const struct security_descriptor *sd, int flags); @@ -4065,31 +4020,6 @@ _PUBLIC_ char *GUID_string2(TALLOC_CTX *mem_ctx, const struct GUID *guid); _PUBLIC_ char *NS_GUID_string(TALLOC_CTX *mem_ctx, const struct GUID *guid); _PUBLIC_ bool policy_handle_empty(struct policy_handle *h) ; -/* The following definitions come from librpc/rpc/binding.c */ - -const char *epm_floor_string(TALLOC_CTX *mem_ctx, struct epm_floor *epm_floor); -_PUBLIC_ char *dcerpc_binding_string(TALLOC_CTX *mem_ctx, const struct dcerpc_binding *b); -_PUBLIC_ NTSTATUS dcerpc_parse_binding(TALLOC_CTX *mem_ctx, const char *s, struct dcerpc_binding **b_out); -_PUBLIC_ NTSTATUS dcerpc_floor_get_lhs_data(struct epm_floor *epm_floor, struct ndr_syntax_id *syntax); -const char *dcerpc_floor_get_rhs_data(TALLOC_CTX *mem_ctx, struct epm_floor *epm_floor); -enum dcerpc_transport_t dcerpc_transport_by_endpoint_protocol(int prot); -_PUBLIC_ enum dcerpc_transport_t dcerpc_transport_by_tower(struct epm_tower *tower); -_PUBLIC_ NTSTATUS dcerpc_binding_from_tower(TALLOC_CTX *mem_ctx, - struct epm_tower *tower, - struct dcerpc_binding **b_out); -_PUBLIC_ NTSTATUS dcerpc_binding_build_tower(TALLOC_CTX *mem_ctx, struct dcerpc_binding *binding, struct epm_tower *tower); - -/* The following definitions come from librpc/rpc/dcerpc.c */ - -struct rpc_request *dcerpc_ndr_request_send(struct dcerpc_pipe *p, const struct GUID *object, - const struct ndr_interface_table *table, uint32_t opnum, - TALLOC_CTX *mem_ctx, void *r); -NTSTATUS dcerpc_ndr_request_recv(struct rpc_request *req); -_PUBLIC_ NTSTATUS dcerpc_pipe_connect(TALLOC_CTX *parent_ctx, struct dcerpc_pipe **pp, - const char *binding_string, const struct ndr_interface_table *table, - struct cli_credentials *credentials, struct event_context *ev, - struct loadparm_context *lp_ctx); - /* The following definitions come from libsmb/asn1.c */ void asn1_free(ASN1_DATA *data); @@ -4118,8 +4048,6 @@ bool asn1_read_OctetString(ASN1_DATA *data, DATA_BLOB *blob); bool asn1_read_Integer(ASN1_DATA *data, int *i); bool asn1_check_enumerated(ASN1_DATA *data, int v); bool asn1_write_enumerated(ASN1_DATA *data, uint8 v); -bool ber_write_OID_String(DATA_BLOB *blob, const char *OID); -bool ber_read_OID_String(TALLOC_CTX *mem_ctx, DATA_BLOB blob, const char **OID); /* The following definitions come from libsmb/async_smb.c */ @@ -4140,8 +4068,7 @@ NTSTATUS cli_add_event_ctx(struct cli_state *cli, ADS_STATUS cli_session_setup_spnego(struct cli_state *cli, const char *user, const char *pass, const char *user_domain, - const char * dest_realm); - + const char * dest_realm); NTSTATUS cli_session_setup(struct cli_state *cli, const char *user, const char *pass, int passlen, @@ -4247,7 +4174,7 @@ bool receive_getdc_response(TALLOC_CTX *mem_ctx, const char *domain_name, uint32_t *nt_version, const char **dc_name, - struct netlogon_samlogon_response **reply); + union nbt_cldap_netlogon **reply); /* The following definitions come from libsmb/clientgen.c */ @@ -4256,7 +4183,6 @@ unsigned int cli_set_timeout(struct cli_state *cli, unsigned int timeout); int cli_set_port(struct cli_state *cli, int port); bool cli_receive_smb(struct cli_state *cli); ssize_t cli_receive_smb_data(struct cli_state *cli, char *buffer, size_t len); -bool cli_receive_smb_readX_header(struct cli_state *cli); bool cli_send_smb(struct cli_state *cli); bool cli_send_smb_direct_writeX(struct cli_state *cli, const char *p, @@ -4267,6 +4193,7 @@ void cli_setup_bcc(struct cli_state *cli, void *p); void cli_init_creds(struct cli_state *cli, const char *username, const char *domain, const char *password); void cli_setup_signing_state(struct cli_state *cli, int signing_state); struct cli_state *cli_initialise(void); +bool cli_rpc_pipe_close(struct rpc_pipe_client *cli); void cli_nt_pipes_close(struct cli_state *cli); void cli_shutdown(struct cli_state *cli); void cli_sockopt(struct cli_state *cli, const char *options); @@ -4564,7 +4491,6 @@ NTSTATUS cli_pull(struct cli_state *cli, uint16_t fnum, void *priv, SMB_OFF_T *received); ssize_t cli_read(struct cli_state *cli, int fnum, char *buf, off_t offset, size_t size); -ssize_t cli_readraw(struct cli_state *cli, int fnum, char *buf, off_t offset, size_t size); ssize_t cli_write(struct cli_state *cli, int fnum, uint16 write_mode, const char *buf, off_t offset, size_t size); @@ -4658,7 +4584,6 @@ bool cli_receive_nt_trans(struct cli_state *cli, NTSTATUS check_negative_conn_cache_timeout( const char *domain, const char *server, unsigned int failed_cache_timeout ); NTSTATUS check_negative_conn_cache( const char *domain, const char *server); void add_failed_connection_entry(const char *domain, const char *server, NTSTATUS result) ; -void delete_negative_conn_cache(const char *domain, const char *server); void flush_negative_conn_cache( void ); void flush_negative_conn_cache_for_domain(const char *domain); @@ -4742,6 +4667,7 @@ bool namecache_status_fetch(const char *keyname, /* The following definitions come from libsmb/namequery.c */ bool saf_store( const char *domain, const char *servername ); +bool saf_join_store( const char *domain, const char *servername ); bool saf_delete( const char *domain ); char *saf_fetch( const char *domain ); NODE_STATUS_STRUCT *node_status_query(int fd, @@ -5033,7 +4959,7 @@ bool decode_pw_buffer(TALLOC_CTX *ctx, int string_flags); void encode_or_decode_arc4_passwd_buffer(unsigned char pw_buf[532], const DATA_BLOB *psession_key); void sess_crypt_blob(DATA_BLOB *out, const DATA_BLOB *in, const DATA_BLOB *session_key, int forward); -char *decrypt_trustdom_secret(uint8_t nt_hash[16], DATA_BLOB *data_in); +char *decrypt_trustdom_secret(const char *pass, DATA_BLOB *data_in); void encode_wkssvc_join_password_buffer(TALLOC_CTX *mem_ctx, const char *pwd, DATA_BLOB *session_key, @@ -5042,11 +4968,6 @@ WERROR decode_wkssvc_join_password_buffer(TALLOC_CTX *mem_ctx, struct wkssvc_PasswordBuffer *pwd_buf, DATA_BLOB *session_key, char **pwd); -DATA_BLOB decrypt_drsuapi_blob(TALLOC_CTX *mem_ctx, - const DATA_BLOB *session_key, - bool rcrypt, - uint32_t rid, - const DATA_BLOB *buffer); /* The following definitions come from libsmb/smberr.c */ @@ -5277,6 +5198,24 @@ ssize_t vfswrap_llistxattr(struct vfs_handle_struct *handle, const char *path, c ssize_t vfswrap_flistxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size); NTSTATUS vfs_default_init(void); +/* The following definitions come from modules/vfs_posixacl.c */ + +SMB_ACL_T posixacl_sys_acl_get_file(vfs_handle_struct *handle, + const char *path_p, + SMB_ACL_TYPE_T type); +SMB_ACL_T posixacl_sys_acl_get_fd(vfs_handle_struct *handle, + files_struct *fsp); +int posixacl_sys_acl_set_file(vfs_handle_struct *handle, + const char *name, + SMB_ACL_TYPE_T type, + SMB_ACL_T theacl); +int posixacl_sys_acl_set_fd(vfs_handle_struct *handle, + files_struct *fsp, + SMB_ACL_T theacl); +int posixacl_sys_acl_delete_def_file(vfs_handle_struct *handle, + const char *path); +NTSTATUS vfs_posixacl_init(void); + /* The following definitions come from nmbd/asyncdns.c */ int asyncdns_fd(void); @@ -5512,7 +5451,6 @@ struct response_record *queue_node_status( struct subnet_record *subrec, void reply_netbios_packet(struct packet_struct *orig_packet, int rcode, enum netbios_reply_type_code rcv_code, int opcode, int ttl, char *data,int len); -void queue_packet(struct packet_struct *packet); void run_packet_queue(void); void retransmit_or_expire_response_records(time_t t); bool listen_for_packets(bool run_election); @@ -5679,7 +5617,6 @@ char *lp_remote_announce(void); char *lp_remote_browse_sync(void); const char **lp_wins_server_list(void); const char **lp_interfaces(void); -const char *lp_socket_address(void); char *lp_nis_home_map_name(void); const char **lp_netbios_aliases(void); const char *lp_passdb_backend(void); @@ -5715,7 +5652,7 @@ bool lp_winbind_offline_logon(void); bool lp_winbind_normalize_names(void); bool lp_winbind_rpc_only(void); const char **lp_idmap_domains(void); -const char *lp_idmap_backend(void); +const char **lp_idmap_backend(void); char *lp_idmap_alloc_backend(void); int lp_idmap_cache_time(void); int lp_idmap_negative_cache_time(void); @@ -5751,8 +5688,6 @@ bool lp_we_are_a_wins_server(void); bool lp_wins_proxy(void); bool lp_local_master(void); bool lp_domain_logons(void); -const char **lp_init_logon_delayed_hosts(void); -int lp_init_logon_delay(void); bool lp_load_printers(void); bool lp_readraw(void); bool lp_large_readwrite(void); @@ -5851,7 +5786,6 @@ const char **lp_svcctl_list(void); char *lp_cups_options(int ); char *lp_cups_server(void); char *lp_iprint_server(void); -int lp_cups_connection_timeout(void); const char *lp_ctdbd_socket(void); const char **lp_cluster_addresses(void); bool lp_clustering(void); @@ -5967,7 +5901,6 @@ int lp_directory_name_cache_size(int ); int lp_smb_encrypt(int ); char lp_magicchar(const struct share_params *p ); int lp_winbind_cache_time(void); -int lp_winbind_reconnect_delay(void); const char **lp_winbind_nss_info(void); int lp_algorithmic_rid_base(void); int lp_name_cache_timeout(void); @@ -6093,6 +6026,7 @@ void lp_set_posix_pathnames(void); enum brl_flavour lp_posix_cifsu_locktype(files_struct *fsp); void lp_set_posix_default_cifsx_readwrite_locktype(enum brl_flavour val); int lp_min_receive_file_size(void); +const char *lp_socket_address(void); /* The following definitions come from param/params.c */ @@ -6178,7 +6112,7 @@ bool pdb_copy_sam_account(struct samu *dst, struct samu *src ); bool pdb_update_bad_password_count(struct samu *sampass, bool *updated); bool pdb_update_autolock_flag(struct samu *sampass, bool *updated); bool pdb_increment_bad_password_count(struct samu *sampass); -bool is_dc_trusted_domain_situation(const char *domain_name); +bool is_trusted_domain_situation(const char *domain_name); bool get_trust_pw_clear(const char *domain, char **ret_pwd, const char **account_name, uint32 *channel); bool get_trust_pw_hash(const char *domain, uint8 ret_pwd[16], @@ -6220,6 +6154,7 @@ const char *pdb_get_domain(const struct samu *sampass); const char *pdb_get_nt_username(const struct samu *sampass); const char *pdb_get_fullname(const struct samu *sampass); const char *pdb_get_homedir(const struct samu *sampass); +const char *pdb_get_unix_homedir(const struct samu *sampass); const char *pdb_get_dir_drive(const struct samu *sampass); const char *pdb_get_logon_script(const struct samu *sampass); const char *pdb_get_profile_path(const struct samu *sampass); @@ -6581,22 +6516,23 @@ WERROR nt_printing_setsec(const char *sharename, SEC_DESC_BUF *secdesc_ctr); bool nt_printing_getsec(TALLOC_CTX *ctx, const char *sharename, SEC_DESC_BUF **secdesc_ctr); void map_printer_permissions(SEC_DESC *sd); void map_job_permissions(SEC_DESC *sd); -bool print_access_check(struct auth_serversupplied_info *server_info, int snum, - int access_type); +bool print_access_check(struct current_user *user, int snum, int access_type); bool print_time_access_check(const char *servicename); char* get_server_name( Printer_entry *printer ); /* The following definitions come from printing/pcap.c */ bool pcap_cache_add_specific(struct pcap_cache **ppcache, const char *name, const char *comment); -void pcap_cache_destroy_specific(struct pcap_cache **ppcache); +void pcap_cache_destroy_specific(struct pcap_cache **pp_cache); bool pcap_cache_add(const char *name, const char *comment); bool pcap_cache_loaded(void); -void pcap_cache_replace(const struct pcap_cache *cache); +void pcap_cache_replace(const struct pcap_cache *pcache); void pcap_cache_reload(void); bool pcap_printername_ok(const char *printername); -void pcap_printer_fn_specific(const struct pcap_cache *, void (*fn)(const char *, const char *, void *), void *); -void pcap_printer_fn(void (*fn)(const char *, const char *, void *), void *); +void pcap_printer_fn_specific(const struct pcap_cache *pc, + void (*fn)(const char *, const char *, void *), + void *pdata); +void pcap_printer_fn(void (*fn)(const char *, const char *, void *), void *pdata); /* The following definitions come from printing/print_aix.c */ @@ -6621,7 +6557,7 @@ bool sysv_cache_reload(void); /* The following definitions come from printing/printfsp.c */ NTSTATUS print_fsp_open(connection_struct *conn, const char *fname, - uint16_t current_vuid, files_struct *fsp); + files_struct *fsp, SMB_STRUCT_STAT *psbuf); void print_fsp_end(files_struct *fsp, enum file_close_type close_type); /* The following definitions come from printing/printing.c */ @@ -6642,27 +6578,20 @@ char *print_job_fname(const char* sharename, uint32 jobid); NT_DEVICEMODE *print_job_devmode(const char* sharename, uint32 jobid); bool print_job_set_place(const char *sharename, uint32 jobid, int place); bool print_job_set_name(const char *sharename, uint32 jobid, char *name); -bool print_job_delete(struct auth_serversupplied_info *server_info, int snum, - uint32 jobid, WERROR *errcode); -bool print_job_pause(struct auth_serversupplied_info *server_info, int snum, - uint32 jobid, WERROR *errcode); -bool print_job_resume(struct auth_serversupplied_info *server_info, int snum, - uint32 jobid, WERROR *errcode); +bool print_job_delete(struct current_user *user, int snum, uint32 jobid, WERROR *errcode); +bool print_job_pause(struct current_user *user, int snum, uint32 jobid, WERROR *errcode); +bool print_job_resume(struct current_user *user, int snum, uint32 jobid, WERROR *errcode); ssize_t print_job_write(int snum, uint32 jobid, const char *buf, SMB_OFF_T pos, size_t size); int print_queue_length(int snum, print_status_struct *pstatus); -uint32 print_job_start(struct auth_serversupplied_info *server_info, int snum, - char *jobname, NT_DEVICEMODE *nt_devmode ); +uint32 print_job_start(struct current_user *user, int snum, char *jobname, NT_DEVICEMODE *nt_devmode ); void print_job_endpage(int snum, uint32 jobid); bool print_job_end(int snum, uint32 jobid, enum file_close_type close_type); int print_queue_status(int snum, print_queue_struct **ppqueue, print_status_struct *status); -bool print_queue_pause(struct auth_serversupplied_info *server_info, int snum, - WERROR *errcode); -bool print_queue_resume(struct auth_serversupplied_info *server_info, int snum, - WERROR *errcode); -bool print_queue_purge(struct auth_serversupplied_info *server_info, int snum, - WERROR *errcode); +bool print_queue_pause(struct current_user *user, int snum, WERROR *errcode); +bool print_queue_resume(struct current_user *user, int snum, WERROR *errcode); +bool print_queue_purge(struct current_user *user, int snum, WERROR *errcode); /* The following definitions come from printing/printing_db.c */ @@ -6951,12 +6880,6 @@ NTSTATUS rpccli_netlogon_sam_network_logon_ex(struct rpc_pipe_client *cli, DATA_BLOB lm_response, DATA_BLOB nt_response, struct netr_SamInfo3 **info3); -NTSTATUS rpccli_netlogon_set_trust_password(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const unsigned char orig_trust_passwd_hash[16], - const char *new_trust_pwd_cleartext, - const unsigned char new_trust_passwd_hash[16], - uint32_t sec_channel_type); /* The following definitions come from rpc_client/cli_pipe.c */ @@ -6964,87 +6887,50 @@ NTSTATUS rpc_api_pipe_req(struct rpc_pipe_client *cli, uint8 op_num, prs_struct *in_data, prs_struct *out_data); -NTSTATUS rpc_pipe_bind(struct rpc_pipe_client *cli, - struct cli_pipe_auth_data *auth); -unsigned int rpccli_set_timeout(struct rpc_pipe_client *cli, - unsigned int timeout); -bool rpccli_get_pwd_hash(struct rpc_pipe_client *cli, uint8_t nt_hash[16]); -struct cli_state *rpc_pipe_np_smb_conn(struct rpc_pipe_client *p); -NTSTATUS rpccli_anon_bind_data(TALLOC_CTX *mem_ctx, - struct cli_pipe_auth_data **presult); -NTSTATUS rpccli_ntlmssp_bind_data(TALLOC_CTX *mem_ctx, - enum pipe_auth_type auth_type, - enum pipe_auth_level auth_level, - const char *domain, - const char *username, - const char *password, - struct cli_pipe_auth_data **presult); -NTSTATUS rpccli_schannel_bind_data(TALLOC_CTX *mem_ctx, const char *domain, - enum pipe_auth_level auth_level, - const uint8_t sess_key[16], - struct cli_pipe_auth_data **presult); -NTSTATUS rpccli_kerberos_bind_data(TALLOC_CTX *mem_ctx, - enum pipe_auth_level auth_level, - const char *service_princ, - const char *username, - const char *password, - struct cli_pipe_auth_data **presult); -NTSTATUS rpc_pipe_open_tcp(TALLOC_CTX *mem_ctx, const char *host, - const struct ndr_syntax_id *abstract_syntax, - struct rpc_pipe_client **presult); -NTSTATUS rpc_pipe_open_ncalrpc(TALLOC_CTX *mem_ctx, const char *socket_path, - const struct ndr_syntax_id *abstract_syntax, - struct rpc_pipe_client **presult); -NTSTATUS cli_rpc_pipe_open_noauth(struct cli_state *cli, - const struct ndr_syntax_id *interface, - struct rpc_pipe_client **presult); -NTSTATUS cli_rpc_pipe_open_ntlmssp(struct cli_state *cli, - const struct ndr_syntax_id *interface, - enum pipe_auth_level auth_level, - const char *domain, - const char *username, - const char *password, - struct rpc_pipe_client **presult); -NTSTATUS cli_rpc_pipe_open_spnego_ntlmssp(struct cli_state *cli, - const struct ndr_syntax_id *interface, - enum pipe_auth_level auth_level, - const char *domain, - const char *username, - const char *password, - struct rpc_pipe_client **presult); -NTSTATUS get_schannel_session_key(struct cli_state *cli, - const char *domain, - uint32 *pneg_flags, - struct rpc_pipe_client **presult); -NTSTATUS cli_rpc_pipe_open_schannel_with_key(struct cli_state *cli, - const struct ndr_syntax_id *interface, - enum pipe_auth_level auth_level, - const char *domain, - const struct dcinfo *pdc, - struct rpc_pipe_client **presult); -NTSTATUS cli_rpc_pipe_open_ntlmssp_auth_schannel(struct cli_state *cli, - const struct ndr_syntax_id *interface, - enum pipe_auth_level auth_level, - const char *domain, - const char *username, - const char *password, - struct rpc_pipe_client **presult); -NTSTATUS cli_rpc_pipe_open_schannel(struct cli_state *cli, - const struct ndr_syntax_id *interface, - enum pipe_auth_level auth_level, - const char *domain, - struct rpc_pipe_client **presult); -NTSTATUS cli_rpc_pipe_open_krb5(struct cli_state *cli, - const struct ndr_syntax_id *interface, - enum pipe_auth_level auth_level, - const char *service_princ, - const char *username, - const char *password, - struct rpc_pipe_client **presult); -NTSTATUS cli_get_session_key(TALLOC_CTX *mem_ctx, - struct rpc_pipe_client *cli, - DATA_BLOB *session_key); - +struct rpc_pipe_client *cli_rpc_pipe_open_noauth(struct cli_state *cli, int pipe_idx, NTSTATUS *perr); +struct rpc_pipe_client *cli_rpc_pipe_open_ntlmssp(struct cli_state *cli, + int pipe_idx, + enum pipe_auth_level auth_level, + const char *domain, + const char *username, + const char *password, + NTSTATUS *perr); +struct rpc_pipe_client *cli_rpc_pipe_open_spnego_ntlmssp(struct cli_state *cli, + int pipe_idx, + enum pipe_auth_level auth_level, + const char *domain, + const char *username, + const char *password, + NTSTATUS *perr); +struct rpc_pipe_client *get_schannel_session_key(struct cli_state *cli, + const char *domain, + uint32 *pneg_flags, + NTSTATUS *perr); +struct rpc_pipe_client *cli_rpc_pipe_open_schannel_with_key(struct cli_state *cli, + int pipe_idx, + enum pipe_auth_level auth_level, + const char *domain, + const struct dcinfo *pdc, + NTSTATUS *perr); +struct rpc_pipe_client *cli_rpc_pipe_open_ntlmssp_auth_schannel(struct cli_state *cli, + int pipe_idx, + enum pipe_auth_level auth_level, + const char *domain, + const char *username, + const char *password, + NTSTATUS *perr); +struct rpc_pipe_client *cli_rpc_pipe_open_schannel(struct cli_state *cli, + int pipe_idx, + enum pipe_auth_level auth_level, + const char *domain, + NTSTATUS *perr); +struct rpc_pipe_client *cli_rpc_pipe_open_krb5(struct cli_state *cli, + int pipe_idx, + enum pipe_auth_level auth_level, + const char *service_princ, + const char *username, + const char *password, + NTSTATUS *perr); /* The following definitions come from rpc_client/cli_reg.c */ @@ -7057,14 +6943,9 @@ uint32 reg_init_regval_buffer( REGVAL_BUFFER *buf2, REGISTRY_VALUE *val ); NTSTATUS rpccli_samr_chgpasswd_user(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, - struct policy_handle *user_handle, + const char *username, const char *newpassword, const char *oldpassword); -NTSTATUS rpccli_samr_chgpasswd_user2(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *username, - const char *newpassword, - const char *oldpassword); NTSTATUS rpccli_samr_chng_pswd_auth_crap(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const char *username, @@ -7072,13 +6953,13 @@ NTSTATUS rpccli_samr_chng_pswd_auth_crap(struct rpc_pipe_client *cli, DATA_BLOB old_nt_hash_enc_blob, DATA_BLOB new_lm_password_blob, DATA_BLOB old_lm_hash_enc_blob); -NTSTATUS rpccli_samr_chgpasswd_user3(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *username, - const char *newpassword, - const char *oldpassword, - struct samr_DomInfo1 **dominfo1, - struct samr_ChangeReject **reject); +NTSTATUS rpccli_samr_chgpasswd3(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + const char *username, + const char *newpassword, + const char *oldpassword, + struct samr_DomInfo1 **dominfo1, + struct samr_ChangeReject **reject); void get_query_dispinfo_params(int loop_count, uint32 *max_entries, uint32 *max_size); NTSTATUS rpccli_try_samr_connects(struct rpc_pipe_client *cli, @@ -7218,9 +7099,12 @@ WERROR rpccli_spoolss_rffpcnex(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, /* The following definitions come from rpc_client/cli_svcctl.c */ +const char* svc_status_string( uint32 state ); WERROR rpccli_svcctl_enumerate_services( struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, POLICY_HND *hSCM, uint32 type, uint32 state, uint32 *returned, ENUM_SERVICES_STATUS **service_array ); +WERROR rpccli_svcctl_query_config(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + POLICY_HND *hService, SERVICE_CONFIG *config ); /* The following definitions come from rpc_client/init_lsa.c */ @@ -7304,9 +7188,6 @@ void init_netr_SamInfo3(struct netr_SamInfo3 *r, uint32_t acct_flags, uint32_t sidcount, struct netr_SidAttr *sids); -NTSTATUS serverinfo_to_SamInfo3(struct auth_serversupplied_info *server_info, - uint8_t pipe_session_key[16], - struct netr_SamInfo3 *sam3); void init_netr_IdentityInfo(struct netr_IdentityInfo *r, const char *domain_name, uint32_t parameter_control, @@ -7333,9 +7214,6 @@ void init_netr_PasswordInfo(struct netr_PasswordInfo *r, const char *workstation, struct samr_Password lmpassword, struct samr_Password ntpassword); -void init_netr_CryptPassword(const char *pwd, - unsigned char session_key[16], - struct netr_CryptPassword *pwd_buf); /* The following definitions come from rpc_client/init_samr.c */ @@ -7640,7 +7518,7 @@ void init_srvsvc_NetConnInfo1(struct srvsvc_NetConnInfo1 *r, /* The following definitions come from rpc_client/ndr.c */ NTSTATUS cli_do_rpc_ndr(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, + TALLOC_CTX *mem_ctx, int p_idx, const struct ndr_interface_table *table, uint32 opnum, void *r); @@ -7843,14 +7721,11 @@ bool prs_data_blob(prs_struct *prs, DATA_BLOB *blob, TALLOC_CTX *mem_ctx); /* The following definitions come from rpc_parse/parse_rpc.c */ -const char *cli_get_pipe_name_from_iface(TALLOC_CTX *mem_ctx, - struct cli_state *cli, - const struct ndr_syntax_id *interface); +const char *cli_get_pipe_name(int pipe_idx); void init_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, uint8 flags, uint32 call_id, int data_len, int auth_len); bool smb_io_rpc_hdr(const char *desc, RPC_HDR *rpc, prs_struct *ps, int depth); -void init_rpc_context(RPC_CONTEXT *rpc_ctx, uint16 context_id, - const RPC_IFACE *abstract, const RPC_IFACE *transfer); +void init_rpc_context(RPC_CONTEXT *rpc_ctx, uint16 context_id, RPC_IFACE *abstract, RPC_IFACE *transfer); void init_rpc_hdr_rb(RPC_HDR_RB *rpc, uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid, RPC_CONTEXT *context); @@ -8243,8 +8118,13 @@ bool convert_port_data_1( NT_PORT_DATA_1 *port1, RPC_BUFFER *buf ) ; bool svcctl_io_enum_services_status( const char *desc, ENUM_SERVICES_STATUS *enum_status, RPC_BUFFER *buffer, int depth ); bool svcctl_io_service_status_process( const char *desc, SERVICE_STATUS_PROCESS *status, RPC_BUFFER *buffer, int depth ); uint32 svcctl_sizeof_enum_services_status( ENUM_SERVICES_STATUS *status ); +uint32 svcctl_sizeof_service_config( SERVICE_CONFIG *config ); bool svcctl_io_q_enum_services_status(const char *desc, SVCCTL_Q_ENUM_SERVICES_STATUS *q_u, prs_struct *ps, int depth); bool svcctl_io_r_enum_services_status(const char *desc, SVCCTL_R_ENUM_SERVICES_STATUS *r_u, prs_struct *ps, int depth); +bool svcctl_io_q_enum_dependent_services(const char *desc, SVCCTL_Q_ENUM_DEPENDENT_SERVICES *q_u, prs_struct *ps, int depth); +bool svcctl_io_r_enum_dependent_services(const char *desc, SVCCTL_R_ENUM_DEPENDENT_SERVICES *r_u, prs_struct *ps, int depth); +bool svcctl_io_q_query_service_config(const char *desc, SVCCTL_Q_QUERY_SERVICE_CONFIG *q_u, prs_struct *ps, int depth); +bool svcctl_io_r_query_service_config(const char *desc, SVCCTL_R_QUERY_SERVICE_CONFIG *r_u, prs_struct *ps, int depth); bool svcctl_io_q_query_service_config2(const char *desc, SVCCTL_Q_QUERY_SERVICE_CONFIG2 *q_u, prs_struct *ps, int depth); void init_service_description_buffer(SERVICE_DESCRIPTION *desc, const char *service_desc ); bool svcctl_io_service_description( const char *desc, SERVICE_DESCRIPTION *description, RPC_BUFFER *buffer, int depth ); @@ -8330,7 +8210,7 @@ TDB_CONTEXT *elog_init_tdb( char *tdbfilename ); char *elog_tdbname(TALLOC_CTX *ctx, const char *name ); int elog_tdb_size( TDB_CONTEXT * tdb, int *MaxSize, int *Retention ); bool prune_eventlog( TDB_CONTEXT * tdb ); -bool can_write_to_eventlog( TDB_CONTEXT * tdb, int32 needed ); +bool can_write_to_eventlog( TDB_CONTEXT * tdb, int32_t needed ); ELOG_TDB *elog_open_tdb( char *logname, bool force_clear ); int elog_close_tdb( ELOG_TDB *etdb, bool force_close ); int write_eventlog_tdb( TDB_CONTEXT * the_tdb, Eventlog_entry * ee ); @@ -8744,11 +8624,7 @@ bool setup_fault_pdu(pipes_struct *p, NTSTATUS status); bool setup_cancel_ack_reply(pipes_struct *p, prs_struct *rpc_in_p); bool check_bind_req(struct pipes_struct *p, RPC_IFACE* abstract, RPC_IFACE* transfer, uint32 context_id); -NTSTATUS rpc_pipe_register_commands(int version, const char *clnt, - const char *srv, - const struct ndr_syntax_id *interface, - const struct api_struct *cmds, int size); -bool is_known_pipename(const char *cli_filename); +NTSTATUS rpc_pipe_register_commands(int version, const char *clnt, const char *srv, const struct api_struct *cmds, int size); bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p); bool api_pipe_alter_context(pipes_struct *p, prs_struct *rpc_in_p); bool api_pipe_ntlmssp_auth_process(pipes_struct *p, prs_struct *rpc_in, @@ -8757,6 +8633,9 @@ bool api_pipe_schannel_process(pipes_struct *p, prs_struct *rpc_in, uint32 *p_ss struct current_user *get_current_user(struct current_user *user, pipes_struct *p); void free_pipe_rpc_context( PIPE_RPC_FNS *list ); bool api_pipe_request(pipes_struct *p); +bool api_rpcTNP(pipes_struct *p, const char *rpc_name, + const struct api_struct *api_rpc_cmds, int n_cmds); +void get_pipe_fns( int idx, struct api_struct **fns, int *n_fns ); /* The following definitions come from rpc_server/srv_pipe_hnd.c */ @@ -8776,13 +8655,6 @@ bool close_rpc_pipe_hnd(smb_np_struct *p); void pipe_close_conn(connection_struct *conn); smb_np_struct *get_rpc_pipe_p(uint16 pnum); smb_np_struct *get_rpc_pipe(int pnum); -struct pipes_struct *make_internal_rpc_pipe_p(const char *pipe_name, - const char *client_address, - struct auth_serversupplied_info *server_info, - uint16_t vuid); -ssize_t read_from_internal_pipe(struct pipes_struct *p, char *data, size_t n, - bool *is_data_outstanding); -ssize_t write_to_internal_pipe(struct pipes_struct *p, char *data, size_t n); /* The following definitions come from rpc_server/srv_samr_nt.c */ @@ -9177,9 +9049,9 @@ WERROR _svcctl_StartServiceW(pipes_struct *p, struct svcctl_StartServiceW *r); WERROR _svcctl_ControlService(pipes_struct *p, struct svcctl_ControlService *r); -WERROR _svcctl_EnumDependentServicesW(pipes_struct *p, - struct svcctl_EnumDependentServicesW *r); +WERROR _svcctl_enum_dependent_services( pipes_struct *p, SVCCTL_Q_ENUM_DEPENDENT_SERVICES *q_u, SVCCTL_R_ENUM_DEPENDENT_SERVICES *r_u ); WERROR _svcctl_query_service_status_ex( pipes_struct *p, SVCCTL_Q_QUERY_SERVICE_STATUSEX *q_u, SVCCTL_R_QUERY_SERVICE_STATUSEX *r_u ); +WERROR _svcctl_query_service_config( pipes_struct *p, SVCCTL_Q_QUERY_SERVICE_CONFIG *q_u, SVCCTL_R_QUERY_SERVICE_CONFIG *r_u ); WERROR _svcctl_query_service_config2( pipes_struct *p, SVCCTL_Q_QUERY_SERVICE_CONFIG2 *q_u, SVCCTL_R_QUERY_SERVICE_CONFIG2 *r_u ); WERROR _svcctl_LockServiceDatabase(pipes_struct *p, struct svcctl_LockServiceDatabase *r); @@ -9195,6 +9067,7 @@ WERROR _svcctl_NotifyBootConfigStatus(pipes_struct *p, struct svcctl_NotifyBootC WERROR _svcctl_SCSetServiceBitsW(pipes_struct *p, struct svcctl_SCSetServiceBitsW *r); WERROR _svcctl_ChangeServiceConfigW(pipes_struct *p, struct svcctl_ChangeServiceConfigW *r); WERROR _svcctl_CreateServiceW(pipes_struct *p, struct svcctl_CreateServiceW *r); +WERROR _svcctl_EnumDependentServicesW(pipes_struct *p, struct svcctl_EnumDependentServicesW *r); WERROR _svcctl_EnumServicesStatusW(pipes_struct *p, struct svcctl_EnumServicesStatusW *r); WERROR _svcctl_QueryServiceConfigW(pipes_struct *p, struct svcctl_QueryServiceConfigW *r); WERROR _svcctl_QueryServiceLockStatusW(pipes_struct *p, struct svcctl_QueryServiceLockStatusW *r); @@ -9442,10 +9315,10 @@ NTSTATUS change_oem_password(struct samu *hnd, char *old_passwd, char *new_passw void set_close_write_time(struct files_struct *fsp, struct timespec ts); NTSTATUS close_file(files_struct *fsp, enum file_close_type close_type); void msg_close_file(struct messaging_context *msg_ctx, - void *private_data, - uint32_t msg_type, - struct server_id server_id, - DATA_BLOB *data); + void *private_data, + uint32_t msg_type, + struct server_id server_id, + DATA_BLOB *data); /* The following definitions come from smbd/conn.c */ @@ -9454,9 +9327,9 @@ int conn_num_open(void); bool conn_snum_used(int snum); connection_struct *conn_find(unsigned cnum); connection_struct *conn_new(void); -bool conn_close_all(void); +void conn_close_all(void); bool conn_idle_all(time_t t); -void conn_clear_vuid_caches(uint16 vuid); +void conn_clear_vuid_cache(uint16 vuid); void conn_free_internal(connection_struct *conn); void conn_free(connection_struct *conn); void msg_force_tdis(struct messaging_context *msg, @@ -9600,22 +9473,18 @@ void reply_unix_error(struct smb_request *req, uint8 defclass, uint32 defcode, enum FAKE_FILE_TYPE is_fake_file(const char *fname); NTSTATUS open_fake_file(connection_struct *conn, - uint16_t current_vuid, enum FAKE_FILE_TYPE fake_file_type, const char *fname, uint32 access_mask, files_struct **result); +void destroy_fake_file_handle(FAKE_FILE_HANDLE **fh); NTSTATUS close_fake_file(files_struct *fsp); /* The following definitions come from smbd/file_access.c */ -bool can_access_file_acl(struct connection_struct *conn, - const char * fname, - uint32_t access_mask); bool can_delete_file_in_directory(connection_struct *conn, const char *fname); -bool can_access_file_data(connection_struct *conn, const char *fname, SMB_STRUCT_STAT *psbuf, uint32 access_mask); +bool can_access_file(connection_struct *conn, const char *fname, SMB_STRUCT_STAT *psbuf, uint32 access_mask); bool can_write_to_file(connection_struct *conn, const char *fname, SMB_STRUCT_STAT *psbuf); -bool directory_has_default_acl(connection_struct *conn, const char *fname); /* The following definitions come from smbd/fileio.c */ @@ -9664,15 +9533,15 @@ files_struct *file_fnum(uint16 fnum); files_struct *file_fsp(uint16 fid); void file_chain_reset(void); void dup_file_fsp(files_struct *from, - uint32 access_mask, - uint32 share_access, - uint32 create_options, - files_struct *to); + uint32 access_mask, + uint32 share_access, + uint32 create_options, + files_struct *to); /* The following definitions come from smbd/ipc.c */ void send_trans_reply(connection_struct *conn, - const uint8_t *inbuf, + struct smb_request *req, char *rparam, int rparam_len, char *rdata, int rdata_len, bool buffer_too_large); @@ -9758,11 +9627,6 @@ NTSTATUS resolve_dfspath_wcard(TALLOC_CTX *ctx, const char *name_in, char **pp_name_out, bool *ppath_contains_wcard); -NTSTATUS create_conn_struct(TALLOC_CTX *ctx, - connection_struct **pconn, - int snum, - const char *path, - char **poldcwd); /* The following definitions come from smbd/negprot.c */ @@ -9824,6 +9688,7 @@ int vfs_get_ntquota(files_struct *fsp, enum SMB_QUOTA_TYPE qtype, DOM_SID *psid, int vfs_set_ntquota(files_struct *fsp, enum SMB_QUOTA_TYPE qtype, DOM_SID *psid, SMB_NTQUOTA_STRUCT *qt); int vfs_get_user_ntquota_list(files_struct *fsp, SMB_NTQUOTA_LIST **qt_list); void *init_quota_handle(TALLOC_CTX *mem_ctx); +void destroy_quota_handle(void **pqt_handle); /* The following definitions come from smbd/nttrans.c */ @@ -9840,10 +9705,6 @@ void reply_nttranss(struct smb_request *req); /* The following definitions come from smbd/open.c */ -NTSTATUS smb1_file_se_access_check(const struct security_descriptor *sd, - const NT_USER_TOKEN *token, - uint32_t access_desired, - uint32_t *access_granted); NTSTATUS fd_close(files_struct *fsp); bool map_open_params_to_ntcreate(const char *fname, int deny_mode, int open_func, uint32 *paccess_mask, @@ -9878,6 +9739,9 @@ NTSTATUS open_directory(connection_struct *conn, int *pinfo, files_struct **result); NTSTATUS create_directory(connection_struct *conn, struct smb_request *req, const char *directory); +NTSTATUS open_file_stat(connection_struct *conn, struct smb_request *req, + const char *fname, SMB_STRUCT_STAT *psbuf, + files_struct **result); void msg_file_was_renamed(struct messaging_context *msg, void *private_data, uint32_t msg_type, @@ -9954,6 +9818,7 @@ void invalidate_all_vuids(void); int register_initial_vuid(void); int register_existing_vuid(uint16 vuid, auth_serversupplied_info *server_info, + DATA_BLOB session_key, DATA_BLOB response_blob, const char *smb_name); void add_session_user(const char *user); @@ -9974,23 +9839,20 @@ void reply_pipe_close(connection_struct *conn, struct smb_request *req); /* The following definitions come from smbd/posix_acls.c */ -void create_file_sids(const SMB_STRUCT_STAT *psbuf, DOM_SID *powner_sid, DOM_SID *pgroup_sid); -NTSTATUS unpack_nt_owners(int snum, uid_t *puser, gid_t *pgrp, uint32 security_info_sent, const SEC_DESC *psd); +NTSTATUS unpack_nt_owners(int snum, uid_t *puser, gid_t *pgrp, uint32 security_info_sent, SEC_DESC *psd); SMB_ACL_T free_empty_sys_acl(connection_struct *conn, SMB_ACL_T the_acl); NTSTATUS posix_fget_nt_acl(struct files_struct *fsp, uint32_t security_info, SEC_DESC **ppdesc); NTSTATUS posix_get_nt_acl(struct connection_struct *conn, const char *name, uint32_t security_info, SEC_DESC **ppdesc); int try_chown(connection_struct *conn, const char *fname, uid_t uid, gid_t gid); -NTSTATUS append_parent_acl(files_struct *fsp, - const SEC_DESC *pcsd, - SEC_DESC **pp_new_sd); -NTSTATUS set_nt_acl(files_struct *fsp, uint32 security_info_sent, const SEC_DESC *psd); +NTSTATUS set_nt_acl(files_struct *fsp, uint32 security_info_sent, SEC_DESC *psd); int get_acl_group_bits( connection_struct *conn, const char *fname, mode_t *mode ); int chmod_acl(connection_struct *conn, const char *name, mode_t mode); -int inherit_access_posix_acl(connection_struct *conn, const char *inherit_from_dir, +int inherit_access_acl(connection_struct *conn, const char *inherit_from_dir, const char *name, mode_t mode); int fchmod_acl(files_struct *fsp, mode_t mode); +bool directory_has_default_acl(connection_struct *conn, const char *fname); bool set_unix_posix_default_acl(connection_struct *conn, const char *fname, SMB_STRUCT_STAT *psbuf, uint16 num_def_acls, const char *pdata); bool set_unix_posix_acl(connection_struct *conn, files_struct *fsp, const char *fname, uint16 num_acls, const char *pdata); @@ -10024,8 +9886,6 @@ struct idle_event *event_add_idle(struct event_context *event_ctx, void *private_data); NTSTATUS allow_new_trans(struct trans_state *list, int mid); void respond_to_all_remaining_local_messages(void); -bool create_outbuf(TALLOC_CTX *mem_ctx, const char *inbuf, char **outbuf, - uint8_t num_words, uint32_t num_bytes); void reply_outbuf(struct smb_request *req, uint8 num_words, uint32 num_bytes); const char *smb_fn_name(int type); void add_to_common_flags2(uint32 v); @@ -10073,13 +9933,11 @@ size_t srvstr_get_path(TALLOC_CTX *ctx, int flags, NTSTATUS *err); bool check_fsp_open(connection_struct *conn, struct smb_request *req, - files_struct *fsp); + files_struct *fsp, struct current_user *user); bool check_fsp(connection_struct *conn, struct smb_request *req, - files_struct *fsp); -bool check_fsp_ntquota_handle(connection_struct *conn, struct smb_request *req, - files_struct *fsp); + files_struct *fsp, struct current_user *user); bool fsp_belongs_conn(connection_struct *conn, struct smb_request *req, - files_struct *fsp); + files_struct *fsp, struct current_user *user); void reply_special(char *inbuf); void reply_tcon(struct smb_request *req); void reply_tcon_and_X(struct smb_request *req); @@ -10239,16 +10097,13 @@ void reply_sesssetup_and_X(struct smb_request *req); /* The following definitions come from smbd/share_access.c */ bool token_contains_name_in_list(const char *username, - const char *domain, const char *sharename, const struct nt_user_token *token, const char **list); -bool user_ok_token(const char *username, const char *domain, - const struct nt_user_token *token, int snum); +bool user_ok_token(const char *username, const struct nt_user_token *token, int snum); bool is_share_read_only_for_token(const char *username, - const char *domain, - const struct nt_user_token *token, - connection_struct *conn); + const struct nt_user_token *token, + connection_struct *conn); /* The following definitions come from smbd/srvstr.c */ @@ -10313,8 +10168,9 @@ void reply_transs2(struct smb_request *req); /* The following definitions come from smbd/uid.c */ +gid_t get_current_user_gid_first(int *piterator); +gid_t get_current_user_gid_next(int *piterator); bool change_to_guest(void); -void conn_clear_vuid_cache(connection_struct *conn, uint16_t vuid); bool change_to_user(connection_struct *conn, uint16 vuid); bool change_to_root_user(void); bool become_authenticated_pipe_user(pipes_struct *p); @@ -10435,37 +10291,41 @@ char *get_pass( const char *prompt, bool stdin_get); /* The following definitions come from winbindd/idmap.c */ bool idmap_is_offline(void); -bool idmap_is_online(void); NTSTATUS smb_register_idmap(int version, const char *name, struct idmap_methods *methods); NTSTATUS smb_register_idmap_alloc(int version, const char *name, struct idmap_alloc_methods *methods); -void idmap_close(void); +NTSTATUS idmap_close(void); NTSTATUS idmap_init_cache(void); +NTSTATUS idmap_init(void); NTSTATUS idmap_allocate_uid(struct unixid *id); NTSTATUS idmap_allocate_gid(struct unixid *id); NTSTATUS idmap_set_uid_hwm(struct unixid *id); NTSTATUS idmap_set_gid_hwm(struct unixid *id); -NTSTATUS idmap_backends_unixid_to_sid(const char *domname, - struct id_map *id); -NTSTATUS idmap_backends_sid_to_unixid(const char *domname, - struct id_map *id); -NTSTATUS idmap_new_mapping(const struct dom_sid *psid, enum id_type type, - struct unixid *pxid); -NTSTATUS idmap_set_mapping(const struct id_map *map); -NTSTATUS idmap_remove_mapping(const struct id_map *map); +NTSTATUS idmap_unixids_to_sids(struct id_map **ids); +NTSTATUS idmap_sids_to_unixids(struct id_map **ids); +NTSTATUS idmap_set_mapping(const struct id_map *id); +char *idmap_fetch_secret(const char *backend, bool alloc, + const char *domain, const char *identity); /* The following definitions come from winbindd/idmap_cache.c */ -bool idmap_cache_find_sid2uid(const struct dom_sid *sid, uid_t *puid, - bool *expired); -bool idmap_cache_find_uid2sid(uid_t uid, struct dom_sid *sid, bool *expired); -void idmap_cache_set_sid2uid(const struct dom_sid *sid, uid_t uid); -bool idmap_cache_find_sid2gid(const struct dom_sid *sid, gid_t *pgid, - bool *expired); -bool idmap_cache_find_gid2sid(gid_t gid, struct dom_sid *sid, bool *expired); -void idmap_cache_set_sid2gid(const struct dom_sid *sid, gid_t gid); +struct idmap_cache_ctx *idmap_cache_init(TALLOC_CTX *memctx); +void idmap_cache_shutdown(struct idmap_cache_ctx *cache); +NTSTATUS idmap_cache_build_sidkey(TALLOC_CTX *ctx, char **sidkey, const struct id_map *id); +NTSTATUS idmap_cache_build_idkey(TALLOC_CTX *ctx, char **idkey, const struct id_map *id); +NTSTATUS idmap_cache_set(struct idmap_cache_ctx *cache, const struct id_map *id); +NTSTATUS idmap_cache_set_negative_sid(struct idmap_cache_ctx *cache, const struct id_map *id); +NTSTATUS idmap_cache_set_negative_id(struct idmap_cache_ctx *cache, const struct id_map *id); +NTSTATUS idmap_cache_fill_map(struct id_map *id, const char *value); +bool idmap_cache_is_negative(const char *val); +NTSTATUS idmap_cache_map_sid(struct idmap_cache_ctx *cache, struct id_map *id); +NTSTATUS idmap_cache_map_id(struct idmap_cache_ctx *cache, struct id_map *id); + +/* The following definitions come from winbindd/idmap_ldap.c */ +NTSTATUS idmap_alloc_ldap_init(void); +NTSTATUS idmap_ldap_init(void); /* The following definitions come from winbindd/idmap_nss.c */ @@ -10483,10 +10343,10 @@ NTSTATUS idmap_tdb_init(void); /* The following definitions come from winbindd/idmap_util.c */ -NTSTATUS idmap_uid_to_sid(const char *domname, DOM_SID *sid, uid_t uid); -NTSTATUS idmap_gid_to_sid(const char *domname, DOM_SID *sid, gid_t gid); -NTSTATUS idmap_sid_to_uid(const char *dom_name, DOM_SID *sid, uid_t *uid); -NTSTATUS idmap_sid_to_gid(const char *domname, DOM_SID *sid, gid_t *gid); +NTSTATUS idmap_uid_to_sid(DOM_SID *sid, uid_t uid); +NTSTATUS idmap_gid_to_sid(DOM_SID *sid, gid_t gid); +NTSTATUS idmap_sid_to_uid(DOM_SID *sid, uid_t *uid); +NTSTATUS idmap_sid_to_gid(DOM_SID *sid, gid_t *gid); /* The following definitions come from winbindd/nss_info.c */ diff --git a/source/lib/sendfile.c b/source/lib/sendfile.c index 20b23712733..11582af61ec 100644 --- a/source/lib/sendfile.c +++ b/source/lib/sendfile.c @@ -65,7 +65,7 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of #endif } while (nwritten == -1 && errno == EINTR); if (nwritten == -1) { - if (errno == ENOSYS) { + if (errno == ENOSYS || errno == EINVAL) { /* Ok - we're in a world of pain here. We just sent * the header, but the sendfile failed. We have to * emulate the sendfile at an upper layer before we @@ -143,7 +143,7 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of nwritten = sendfile(tofd, fromfd, &small_offset, small_total); } while (nwritten == -1 && errno == EINTR); if (nwritten == -1) { - if (errno == ENOSYS) { + if (errno == ENOSYS || errno == EINVAL) { /* Ok - we're in a world of pain here. We just sent * the header, but the sendfile failed. We have to * emulate the sendfile at an upper layer before we diff --git a/source/smbd/reply.c b/source/smbd/reply.c index 1f03de0bd81..19f4ac1f335 100644 --- a/source/smbd/reply.c +++ b/source/smbd/reply.c @@ -3202,9 +3202,9 @@ static void send_file_readX(connection_struct *conn, struct smb_request *req, setup_readX_header((char *)headerbuf, smb_maxcnt); if ((nread = SMB_VFS_SENDFILE(smbd_server_fd(), fsp, &header, startpos, smb_maxcnt)) == -1) { - /* Returning ENOSYS or EINVAL means no data at all was sent. + /* Returning ENOSYS means no data at all was sent. Do this as a normal read. */ - if (errno == ENOSYS || errno == EINVAL) { + if (errno == ENOSYS) { goto normal_read; } |