s3-chgpasswd: split out a check_password_complexity() function.
[ira/wip.git] / source3 / include / proto.h
index 530f167df6acf36bd6306f9764f21a9a1b487fca..69555931796f2baee71b79cd454825cb68a4ca69 100644 (file)
@@ -491,7 +491,6 @@ void check_log_size( void );
 void dbgflush( void );
 bool dbghdrclass(int level, int cls, const char *location, const char *func);
 bool dbghdr(int level, const char *location, const char *func);
-TALLOC_CTX *debug_ctx(void);
 
 /* The following definitions come from lib/display_sec.c  */
 
@@ -937,7 +936,7 @@ SMB_OFF_T sys_ftell(FILE *fp);
 int sys_creat(const char *path, mode_t mode);
 int sys_open(const char *path, int oflag, mode_t mode);
 FILE *sys_fopen(const char *path, const char *type);
-void kernel_flock(int fd, uint32 share_mode);
+void kernel_flock(int fd, uint32 share_mode, uint32 access_mask);
 SMB_STRUCT_DIR *sys_opendir(const char *name);
 SMB_STRUCT_DIRENT *sys_readdir(SMB_STRUCT_DIR *dirp);
 void sys_seekdir(SMB_STRUCT_DIR *dirp, long offset);
@@ -1074,6 +1073,8 @@ struct passwd *Get_Pwnam_alloc(TALLOC_CTX *mem_ctx, const char *user);
 
 /* The following definitions come from lib/util.c  */
 
+enum protocol_types get_Protocol(void);
+void set_Protocol(enum protocol_types  p);
 bool all_zero(const uint8_t *ptr, size_t size);
 bool set_global_myname(const char *myname);
 const char *global_myname(void);
@@ -1706,6 +1707,7 @@ NTSTATUS kerberos_return_pac(TALLOC_CTX *mem_ctx,
                             bool request_pac,
                             bool add_netbios_addr,
                             time_t renewable_time,
+                            const char *impersonate_princ_s,
                             struct PAC_DATA **pac_ret);
 NTSTATUS kerberos_return_info3_from_pac(TALLOC_CTX *mem_ctx,
                                        const char *name,
@@ -1717,6 +1719,7 @@ NTSTATUS kerberos_return_info3_from_pac(TALLOC_CTX *mem_ctx,
                                        bool request_pac,
                                        bool add_netbios_addr,
                                        time_t renewable_time,
+                                       const char *impersonate_princ_s,
                                        struct netr_SamInfo3 **info3);
 
 /* The following definitions come from libads/cldap.c  */
@@ -2258,6 +2261,15 @@ bool cli_resolve_path(TALLOC_CTX *ctx,
                        struct cli_state **targetcli,
                        char **pp_targetpath);
 
+bool cli_check_msdfs_proxy(TALLOC_CTX *ctx,
+                       struct cli_state *cli,
+                       const char *sharename,
+                       char **pp_newserver,
+                       char **pp_newshare,
+                       bool force_encrypt,
+                       const char *username,
+                       const char *password,
+                       const char *domain);
 /* The following definitions come from libsmb/clidgram.c  */
 
 bool send_getdc_request(TALLOC_CTX *mem_ctx,
@@ -2659,6 +2671,14 @@ struct tevent_req *cli_posix_rmdir_send(TALLOC_CTX *mem_ctx,
                                        const char *fname);
 NTSTATUS cli_posix_rmdir_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx);
 NTSTATUS cli_posix_rmdir(struct cli_state *cli, const char *fname);
+struct tevent_req *cli_notify_send(TALLOC_CTX *mem_ctx,
+                                  struct tevent_context *ev,
+                                  struct cli_state *cli, uint16_t fnum,
+                                  uint32_t buffer_size,
+                                  uint32_t completion_filter, bool recursive);
+NTSTATUS cli_notify_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
+                        uint32_t *pnum_changes,
+                        struct notify_change **pchanges);
 
 /* The following definitions come from libsmb/clifsinfo.c  */
 
@@ -2700,10 +2720,6 @@ bool unwrap_edata_ntstatus(TALLOC_CTX *mem_ctx,
                           DATA_BLOB *edata, 
                           DATA_BLOB *edata_out);
 bool unwrap_pac(TALLOC_CTX *mem_ctx, DATA_BLOB *auth_data, DATA_BLOB *unwrapped_pac_data);
-int cli_krb5_get_ticket(const char *principal, time_t time_offset, 
-                       DATA_BLOB *ticket, DATA_BLOB *session_key_krb5, 
-                       uint32 extra_ap_opts, const char *ccname, 
-                       time_t *tgs_expire);
 
 /* The following definitions come from libsmb/clilist.c  */
 
@@ -3307,8 +3323,9 @@ void update_trustdom_cache( void );
 
 NTSTATUS trust_pw_change_and_store_it(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, 
                                      const char *domain,
+                                     const char *account_name,
                                      unsigned char orig_trust_passwd_hash[16],
-                                     uint32 sec_channel_type);
+                                     enum netr_SchannelType sec_channel_type);
 NTSTATUS trust_pw_find_change_and_store_it(struct rpc_pipe_client *cli, 
                                           TALLOC_CTX *mem_ctx, 
                                           const char *domain) ;
@@ -3976,6 +3993,7 @@ char *lp_ldap_suffix(void);
 char *lp_ldap_admin_dn(void);
 int lp_ldap_ssl(void);
 bool lp_ldap_ssl_ads(void);
+int lp_ldap_follow_referral(void);
 int lp_ldap_passwd_sync(void);
 bool lp_ldap_delete_dn(void);
 int lp_ldap_replication_sleep(void);
@@ -4110,6 +4128,7 @@ int lp_cups_connection_timeout(void);
 const char *lp_ctdbd_socket(void);
 const char **lp_cluster_addresses(void);
 bool lp_clustering(void);
+int lp_ctdb_timeout(void);
 char *lp_printcommand(int );
 char *lp_lpqcommand(int );
 char *lp_lprmcommand(int );
@@ -4354,6 +4373,7 @@ void lp_set_posix_default_cifsx_readwrite_locktype(enum brl_flavour val);
 int lp_min_receive_file_size(void);
 char* lp_perfcount_module(void);
 void lp_set_passdb_backend(const char *backend);
+bool set_inherit_acls(int i);
 
 /* The following definitions come from param/util.c  */
 
@@ -4435,9 +4455,11 @@ 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 get_trust_pw_clear(const char *domain, char **ret_pwd,
-                       const char **account_name, uint32 *channel);
+                       const char **account_name,
+                       enum netr_SchannelType *channel);
 bool get_trust_pw_hash(const char *domain, uint8 ret_pwd[16],
-                      const char **account_name, uint32 *channel);
+                      const char **account_name,
+                      enum netr_SchannelType *channel);
 struct samr_LogonHours get_logon_hours_from_pdb(TALLOC_CTX *mem_ctx,
                                                struct samu *pw);
 /* The following definitions come from passdb/pdb_compat.c  */
@@ -4670,14 +4692,14 @@ bool secrets_fetch_domain_sid(const char *domain, DOM_SID *sid);
 bool secrets_store_domain_guid(const char *domain, struct GUID *guid);
 bool secrets_fetch_domain_guid(const char *domain, struct GUID *guid);
 void *secrets_get_trust_account_lock(TALLOC_CTX *mem_ctx, const char *domain);
-uint32 get_default_sec_channel(void);
+enum netr_SchannelType get_default_sec_channel(void);
 bool secrets_fetch_trust_account_password_legacy(const char *domain,
                                                 uint8 ret_pwd[16],
                                                 time_t *pass_last_set_time,
-                                                uint32 *channel);
+                                                enum netr_SchannelType *channel);
 bool secrets_fetch_trust_account_password(const char *domain, uint8 ret_pwd[16],
                                          time_t *pass_last_set_time,
-                                         uint32 *channel);
+                                         enum netr_SchannelType *channel);
 bool secrets_fetch_trusted_domain_password(const char *domain, char** pwd,
                                            DOM_SID *sid, time_t *pass_last_set_time);
 bool secrets_store_trusted_domain_password(const char* domain, const char* pwd,
@@ -4685,10 +4707,10 @@ bool secrets_store_trusted_domain_password(const char* domain, const char* pwd,
 bool secrets_delete_machine_password(const char *domain);
 bool secrets_delete_machine_password_ex(const char *domain);
 bool secrets_delete_domain_sid(const char *domain);
-bool secrets_store_machine_password(const char *pass, const char *domain, uint32 sec_channel);
+bool secrets_store_machine_password(const char *pass, const char *domain, enum netr_SchannelType sec_channel);
 char *secrets_fetch_machine_password(const char *domain,
                                     time_t *pass_last_set_time,
-                                    uint32 *channel);
+                                    enum netr_SchannelType *channel);
 bool trusted_domain_password_delete(const char *domain);
 bool secrets_store_ldap_pw(const char* dn, char* pw);
 bool fetch_ldap_pw(char **dn, char** pw);
@@ -4697,14 +4719,15 @@ NTSTATUS secrets_trusted_domains(TALLOC_CTX *mem_ctx, uint32 *num_domains,
 bool secrets_store_afs_keyfile(const char *cell, const struct afs_keyfile *keyfile);
 bool secrets_fetch_afs_key(const char *cell, struct afs_key *result);
 void secrets_fetch_ipc_userpass(char **username, char **domain, char **password);
-TDB_CONTEXT *open_schannel_session_store(TALLOC_CTX *mem_ctx);
 bool secrets_store_generic(const char *owner, const char *key, const char *secret);
 char *secrets_fetch_generic(const char *owner, const char *key);
+bool secrets_delete_generic(const char *owner, const char *key);
 bool secrets_store_local_schannel_key(uint8_t schannel_key[16]);
 bool secrets_fetch_local_schannel_key(uint8_t schannel_key[16]);
 
 /* The following definitions come from passdb/secrets_schannel.c  */
 
+TDB_CONTEXT *open_schannel_session_store(TALLOC_CTX *mem_ctx);
 NTSTATUS schannel_fetch_session_key(TALLOC_CTX *mem_ctx,
                                    const char *computer_name,
                                    struct netlogon_creds_CredentialState **pcreds);
@@ -5130,20 +5153,6 @@ uint32 reg_perfcount_get_last_counter(uint32 base_index);
 uint32 reg_perfcount_get_last_help(uint32 last_counter);
 uint32 reg_perfcount_get_counter_help(uint32 base_index, char **retbuf);
 uint32 reg_perfcount_get_counter_names(uint32 base_index, char **retbuf);
-bool _reg_perfcount_get_counter_data(TDB_DATA key, TDB_DATA *data);
-bool _reg_perfcount_get_instance_info(struct PERF_INSTANCE_DEFINITION *inst,
-                                     prs_struct *ps,
-                                     int instId,
-                                     struct PERF_OBJECT_TYPE *obj,
-                                     TDB_CONTEXT *names);
-bool _reg_perfcount_add_instance(struct PERF_OBJECT_TYPE *obj,
-                                prs_struct *ps,
-                                int instInd,
-                                TDB_CONTEXT *names);
-uint32 reg_perfcount_get_perf_data_block(uint32 base_index, 
-                                        prs_struct *ps, 
-                                        struct PERF_DATA_BLOCK *block,
-                                        const char *object_ids);
 WERROR reg_perfcount_get_hkpd(prs_struct *ps, uint32 max_buf_size, uint32 *outbuf_len, const char *object_ids);
 
 /* The following definitions come from registry/reg_util.c  */
@@ -5251,10 +5260,11 @@ NTSTATUS rpccli_netlogon_sam_network_logon_ex(struct rpc_pipe_client *cli,
                                              struct netr_SamInfo3 **info3);
 NTSTATUS rpccli_netlogon_set_trust_password(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
+                                           const char *account_name,
                                            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);
+                                           enum netr_SchannelType sec_channel_type);
 
 /* The following definitions come from rpc_client/cli_pipe.c  */
 
@@ -5300,7 +5310,7 @@ NTSTATUS rpc_pipe_open_tcp(TALLOC_CTX *mem_ctx, const char *host,
 NTSTATUS rpc_pipe_open_ncalrpc(TALLOC_CTX *mem_ctx, const char *socket_path,
                               const struct ndr_syntax_id *abstract_syntax,
                               struct rpc_pipe_client **presult);
-NTSTATUS rpc_pipe_open_internal(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *abstract_syntax, 
+NTSTATUS rpc_pipe_open_internal(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *abstract_syntax,
                                NTSTATUS (*dispatch) (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *r),
                                struct auth_serversupplied_info *serversupplied_info,
                                struct rpc_pipe_client **presult);
@@ -5441,7 +5451,7 @@ NTSTATUS rpccli_samr_chgpasswd_user3(struct rpc_pipe_client *cli,
                                     const char *newpassword,
                                     const char *oldpassword,
                                     struct samr_DomInfo1 **dominfo1,
-                                    struct samr_ChangeReject **reject);
+                                    struct userPwdChangeFailureInformation **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,
@@ -5693,7 +5703,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 *get_pipe_name_from_iface(const struct ndr_syntax_id *interface);
+bool smb_register_ndr_interface(const struct ndr_interface_table *interface);
+const struct ndr_interface_table *get_iface_from_syntax(
+        const struct ndr_syntax_id *syntax);
+const char *get_pipe_name_from_syntax(TALLOC_CTX *mem_ctx,
+                                     const struct ndr_syntax_id *syntax);
 void init_rpc_hdr(RPC_HDR *hdr, enum dcerpc_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);
@@ -6092,8 +6106,11 @@ NTSTATUS pass_oem_change(char *user,
                         const uchar old_lm_hash_encrypted[16],
                         uchar password_encrypted_with_nt_hash[516],
                         const uchar old_nt_hash_encrypted[16],
-                        uint32 *reject_reason);
-NTSTATUS change_oem_password(struct samu *hnd, char *old_passwd, char *new_passwd, bool as_root, uint32 *samr_reject_reason);
+                        enum samPwdChangeReason *reject_reason);
+NTSTATUS check_password_complexity(const char *username,
+                                  const char *password,
+                                  enum samPwdChangeReason *samr_reject_reason);
+NTSTATUS change_oem_password(struct samu *hnd, char *old_passwd, char *new_passwd, bool as_root, enum samPwdChangeReason *samr_reject_reason);
 
 /* The following definitions come from smbd/close.c  */
 
@@ -6238,7 +6255,6 @@ int file_ntimes(connection_struct *conn, const struct smb_filename *smb_fname,
 bool set_sticky_write_time_path(struct file_id fileid, struct timespec mtime);
 bool set_sticky_write_time_fsp(struct files_struct *fsp,
                               struct timespec mtime);
-bool update_write_time(struct files_struct *fsp);
 
 NTSTATUS set_create_timespec_ea(connection_struct *conn,
                                struct files_struct *fsp,
@@ -6297,6 +6313,10 @@ bool directory_has_default_acl(connection_struct *conn, const char *fname);
 /* The following definitions come from smbd/fileio.c  */
 
 ssize_t read_file(files_struct *fsp,char *data,SMB_OFF_T pos,size_t n);
+void update_write_time_handler(struct event_context *ctx,
+                                      struct timed_event *te,
+                                      struct timeval now,
+                                      void *private_data);
 void trigger_write_time_update(struct files_struct *fsp);
 void trigger_write_time_update_immediate(struct files_struct *fsp);
 ssize_t write_file(struct smb_request *req,
@@ -7130,6 +7150,7 @@ int vfs_stat_smb_fname(struct connection_struct *conn, const char *fname,
                       SMB_STRUCT_STAT *psbuf);
 int vfs_lstat_smb_fname(struct connection_struct *conn, const char *fname,
                        SMB_STRUCT_STAT *psbuf);
+NTSTATUS vfs_stat_fsp(files_struct *fsp);
 
 /* The following definitions come from torture/denytest.c  */