s3: use enum netr_SchannelType all over the place.
authorGünther Deschner <gd@samba.org>
Tue, 13 Oct 2009 08:15:34 +0000 (10:15 +0200)
committerGünther Deschner <gd@samba.org>
Tue, 13 Oct 2009 08:21:46 +0000 (10:21 +0200)
Guenther

16 files changed:
source3/auth/auth_domain.c
source3/include/proto.h
source3/libads/util.c
source3/libsmb/trusts_util.c
source3/passdb/passdb.c
source3/passdb/secrets.c
source3/rpc_client/cli_netlogon.c
source3/rpc_client/cli_pipe.c
source3/rpc_server/srv_netlog_nt.c
source3/rpcclient/cmd_netlogon.c
source3/rpcclient/rpcclient.c
source3/utils/net.c
source3/utils/net_proto.h
source3/utils/net_rpc.c
source3/utils/net_rpc_join.c
source3/winbindd/winbindd_cm.c

index 7dec6ad84bf6524f79f797aad4631cfddae9997f..084d84ce29f0482d0d52bb26e191ef6561c8cff8 100644 (file)
@@ -195,7 +195,7 @@ machine %s. Error was : %s.\n", dc_name, nt_errstr(result)));
        if (!lp_client_schannel()) {
                /* We need to set up a creds chain on an unauthenticated netlogon pipe. */
                uint32_t neg_flags = NETLOGON_NEG_AUTH2_ADS_FLAGS;
-               uint32 sec_chan_type = 0;
+               enum netr_SchannelType sec_chan_type = 0;
                unsigned char machine_pwd[16];
                const char *account_name;
 
index 7e31da064fabc12ae2a3ff0d3dcfb3ffe8f8ed45..8fc4195495bf14896329c9bb7e4416e6035d536f 100644 (file)
@@ -3309,7 +3309,7 @@ NTSTATUS trust_pw_change_and_store_it(struct rpc_pipe_client *cli, TALLOC_CTX *m
                                      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) ;
@@ -4672,14 +4672,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,
@@ -4687,10 +4687,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);
@@ -5243,7 +5243,7 @@ NTSTATUS rpccli_netlogon_set_trust_password(struct rpc_pipe_client *cli,
                                            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  */
 
index 2c7ccfebd6cf53cb826123866dcf4900f9839883..9dcb906a37206c4c87dd2495566e0c5f6cd3d10c 100644 (file)
@@ -26,7 +26,7 @@ ADS_STATUS ads_change_trust_account_password(ADS_STRUCT *ads, char *host_princip
        char *password;
        char *new_password;
        ADS_STATUS ret;
-       uint32 sec_channel_type;
+       enum netr_SchannelType sec_channel_type;
     
        if ((password = secrets_fetch_machine_password(lp_workgroup(), NULL, &sec_channel_type)) == NULL) {
                DEBUG(1,("Failed to retrieve password for principal %s\n", host_principal));
index 1e2460cfcc0ef264109d0035038b7c507ad1c6a4..584217d3f187b64356de738e9995a0d7695a9bdf 100644 (file)
@@ -31,7 +31,7 @@ NTSTATUS trust_pw_change_and_store_it(struct rpc_pipe_client *cli, TALLOC_CTX *m
                                      const char *domain,
                                      const char *account_name,
                                      unsigned char orig_trust_passwd_hash[16],
-                                     uint32 sec_channel_type)
+                                     enum netr_SchannelType sec_channel_type)
 {
        unsigned char new_trust_passwd_hash[16];
        char *new_trust_passwd;
@@ -113,7 +113,7 @@ NTSTATUS trust_pw_find_change_and_store_it(struct rpc_pipe_client *cli,
                                           const char *domain) 
 {
        unsigned char old_trust_passwd_hash[16];
-       uint32 sec_channel_type = 0;
+       enum netr_SchannelType sec_channel_type = SEC_CHAN_NULL;
        const char *account_name;
 
        if (!get_trust_pw_hash(domain, old_trust_passwd_hash, &account_name,
index 0678181669d3e9259f2bc07650143359ed1f84bb..b2c3b948f1b6f1917f6d2c4fc07d0af32bb38c98 100644 (file)
@@ -2257,7 +2257,8 @@ 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)
 {
        char *pwd;
        time_t last_set_time;
@@ -2329,7 +2330,8 @@ bool get_trust_pw_clear(const char *domain, char **ret_pwd,
 *******************************************************************/
 
 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)
 {
        char *pwd = NULL;
        time_t last_set_time;
index 36f401bc92803f7b8fd061d08207ea539221e6ac..8b87c2cd4cd5aeacfa9e47f4260b28844e2320ee 100644 (file)
@@ -392,7 +392,7 @@ void *secrets_get_trust_account_lock(TALLOC_CTX *mem_ctx, const char *domain)
  Routine to get the default secure channel type for trust accounts
 ************************************************************************/
 
-uint32 get_default_sec_channel(void)
+enum netr_SchannelType get_default_sec_channel(void)
 {
        if (lp_server_role() == ROLE_DOMAIN_BDC ||
            lp_server_role() == ROLE_DOMAIN_PDC) {
@@ -412,7 +412,7 @@ uint32 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)
 {
        struct machine_acct_pass *pass;
        size_t size = 0;
@@ -458,7 +458,7 @@ bool secrets_fetch_trust_account_password_legacy(const char *domain,
 
 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)
 {
        char *plaintext;
 
@@ -793,7 +793,8 @@ bool secrets_delete_domain_sid(const char *domain)
 the password is assumed to be a null terminated ascii string
 ************************************************************************/
 
-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)
 {
        bool ret;
        uint32 last_change_time;
@@ -819,7 +820,7 @@ bool secrets_store_machine_password(const char *pass, const char *domain, uint32
 
 char *secrets_fetch_machine_password(const char *domain,
                                     time_t *pass_last_set_time,
-                                    uint32 *channel)
+                                    enum netr_SchannelType *channel)
 {
        char *ret;
        ret = (char *)secrets_fetch(machine_password_keystr(domain), NULL);
index 5e116c95deecea6182d9be32eefd613a6093f87c..a5f48d4aa5a90266ae575476caaff166ec59ff71 100644 (file)
@@ -513,7 +513,7 @@ NTSTATUS rpccli_netlogon_set_trust_password(struct rpc_pipe_client *cli,
                                            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)
 {
        NTSTATUS result;
        uint32_t neg_flags = NETLOGON_NEG_AUTH2_ADS_FLAGS;
index dc4dfbd3b27cefc40b29f418e5d4ab8057424fb1..c197bd4929c181fe400770c7b23327f99ebea23a 100644 (file)
@@ -3819,7 +3819,7 @@ static NTSTATUS get_schannel_session_key_common(struct rpc_pipe_client *netlogon
                                                const char *domain,
                                                uint32 *pneg_flags)
 {
-       uint32 sec_chan_type = 0;
+       enum netr_SchannelType sec_chan_type = 0;
        unsigned char machine_pwd[16];
        const char *machine_account;
        NTSTATUS status;
index fd90bf82c7307b3ee5118bc66859e6f700df11a8..4b83279897b5ceafa542f2d58b3c5bb091606b61 100644 (file)
@@ -281,7 +281,7 @@ WERROR _netr_NetrEnumerateTrustedDomains(pipes_struct *p,
  ******************************************************************/
 
 static NTSTATUS get_md4pw(struct samr_Password *md4pw, const char *mach_acct,
-                         uint16_t sec_chan_type, struct dom_sid *sid)
+                         enum netr_SchannelType sec_chan_type, struct dom_sid *sid)
 {
        struct samu *sampass = NULL;
        const uint8 *pass;
index ae76652113a7da9c28faed319e69a5f3862bead0..2fbadf2a75be6a034f0c9a02c9c3bd1f74afc163 100644 (file)
@@ -1051,7 +1051,7 @@ static NTSTATUS cmd_netlogon_database_redo(struct rpc_pipe_client *cli,
        struct netr_Authenticator clnt_creds, srv_cred;
        struct netr_DELTA_ENUM_ARRAY *delta_enum_array = NULL;
        unsigned char trust_passwd_hash[16];
-       uint32_t sec_channel_type = 0;
+       enum netr_SchannelType sec_channel_type = 0;
        struct netr_ChangeLogEntry e;
        uint32_t rid = 500;
 
index 7a20e487f27777e609aae3e4f511558f2c34a67b..20ea8a05e7d3ad9460a52e0d59320253e67a3bb3 100644 (file)
@@ -694,7 +694,7 @@ static NTSTATUS do_cmd(struct cli_state *cli,
                if (ndr_syntax_id_equal(cmd_entry->interface,
                                        &ndr_table_netlogon.syntax_id)) {
                        uint32_t neg_flags = NETLOGON_NEG_AUTH2_ADS_FLAGS;
-                       uint32 sec_channel_type;
+                       enum netr_SchannelType sec_channel_type;
                        uchar trust_password[16];
                        const char *machine_account;
 
index 585661cd37ac45400dd735d0933ce057da64cfc7..e8920e0b02fd1207deebc369e0a687da25f9b842 100644 (file)
@@ -53,7 +53,7 @@ extern bool AllowDebugChange;
 /* end of internationalization section                                 */
 /***********************************************************************/
 
-uint32 get_sec_channel_type(const char *param)
+enum netr_SchannelType get_sec_channel_type(const char *param)
 {
        if (!(param && *param)) {
                return get_default_sec_channel();
@@ -91,7 +91,7 @@ static int net_changesecretpw(struct net_context *c, int argc,
                              const char **argv)
 {
         char *trust_pw;
-        uint32 sec_channel_type = SEC_CHAN_WKSTA;
+        enum netr_SchannelType sec_channel_type = SEC_CHAN_WKSTA;
 
        if(c->opt_force) {
                if (c->opt_stdin) {
index e1c1817aec4fb007e328ae84e591142dc0073cb0..098e2a22be6b486db68ed0f891258dc900664b71 100644 (file)
@@ -42,7 +42,7 @@ void debug_unix_user_token(int dbg_class, int dbg_lev, uid_t uid, gid_t gid,
 
 /* The following definitions come from utils/net.c  */
 
-uint32 get_sec_channel_type(const char *param);
+enum netr_SchannelType get_sec_channel_type(const char *param);
 
 /* The following definitions come from utils/net_ads.c  */
 
index 896ea8cc653217646f1172edb86089c86c41ca63..afda1a724b1df8f7fa5b56ffbd0a20faa4b9648c 100644 (file)
@@ -309,7 +309,7 @@ static NTSTATUS rpc_oldjoin_internals(struct net_context *c,
        fstring trust_passwd;
        unsigned char orig_trust_passwd_hash[16];
        NTSTATUS result;
-       uint32 sec_channel_type;
+       enum netr_SchannelType sec_channel_type;
 
        result = cli_rpc_pipe_open_noauth(cli, &ndr_table_netlogon.syntax_id,
                                          &pipe_hnd);
index 23913812b05f88b24ef17d273685a498aea71535..d3a63d373d5ea55cf02a606158b1e8110a4e5d15 100644 (file)
@@ -138,7 +138,7 @@ int net_rpc_join_newstyle(struct net_context *c, int argc, const char **argv)
        TALLOC_CTX *mem_ctx;
         uint32 acb_info = ACB_WSTRUST;
        uint32_t neg_flags = NETLOGON_NEG_AUTH2_ADS_FLAGS;
-       uint32 sec_channel_type;
+       enum netr_SchannelType sec_channel_type;
        struct rpc_pipe_client *pipe_hnd = NULL;
 
        /* rpc variables */
index 9a788397a99a78b5d10c61c1088071c186fe6ec6..95e1daf0b7183041f07c396b9bfcecb0a30aec88 100644 (file)
@@ -2370,7 +2370,7 @@ NTSTATUS cm_connect_netlogon(struct winbindd_domain *domain,
 
        uint32_t neg_flags = NETLOGON_NEG_AUTH2_ADS_FLAGS;
        uint8  mach_pwd[16];
-       uint32  sec_chan_type;
+       enum netr_SchannelType sec_chan_type;
        const char *account_name;
        struct rpc_pipe_client *netlogon_pipe = NULL;