get rid of compiler warnings
authorHerb Lewis <herb@samba.org>
Fri, 24 Aug 2001 20:32:01 +0000 (20:32 +0000)
committerHerb Lewis <herb@samba.org>
Fri, 24 Aug 2001 20:32:01 +0000 (20:32 +0000)
16 files changed:
source/auth/auth.c
source/auth/auth_sam.c
source/auth/auth_server.c
source/libsmb/smbencrypt.c
source/nsswitch/wb_client.c
source/nsswitch/wb_common.c
source/passdb/secrets.c
source/printing/nt_printing.c
source/rpc_server/srv_netlog_nt.c
source/rpc_server/srv_samr_nt.c
source/smbd/auth.c
source/smbd/auth_server.c
source/smbd/auth_smbpasswd.c
source/smbd/reply.c
source/smbd/vfs.c
source/utils/smbpasswd.c

index d33bc225e632cae48a992fbf52667e1c1adc62b6..8ea867fe8c6202085744ad39947beec5087aca16 100644 (file)
@@ -188,7 +188,7 @@ uint32 pass_check_smb_with_chal(char *user, char *domain, uchar chal[8],
                        user_info.nt_resp.len = 24;
                }
                
-               user_info.plaintext_password.str = lm_pwd;
+               user_info.plaintext_password.str = (char *)lm_pwd;
                user_info.plaintext_password.len = lm_pwd_len;
 
        }
@@ -232,11 +232,11 @@ BOOL password_ok(char *user, char *password, int pwlen)
        
        /* The password could be either NTLM or plain LM.  Try NTLM first, but fall-through as
           required. */
-       if (pass_check_smb(user, lp_workgroup(), NULL, 0, password, pwlen) == NT_STATUS_NOPROBLEMO) {
+       if (pass_check_smb(user, lp_workgroup(), NULL, 0, (unsigned char *)password, pwlen) == NT_STATUS_NOPROBLEMO) {
                return True;
        }
 
-       if (pass_check_smb(user, lp_workgroup(), password, pwlen, NULL, 0) == NT_STATUS_NOPROBLEMO) {
+       if (pass_check_smb(user, lp_workgroup(), (unsigned char *)password, pwlen, NULL, 0) == NT_STATUS_NOPROBLEMO) {
                return True;
        }
 
index 27cb801c33e5fac7a60319f8b7ea2f7cf0fc522f..1a5d02e4a44ad6c5cb9c5158d4dee98826859d68 100644 (file)
@@ -45,7 +45,7 @@ static BOOL smb_pwd_check_ntlmv1(const uchar *password,
   SMBOWFencrypt(part_passwd, c8, p24);
        if (user_sess_key != NULL)
        {
-               SMBsesskeygen_ntv1(part_passwd, NULL, user_sess_key);
+               SMBsesskeygen_ntv1(part_passwd, NULL, (char *)user_sess_key);
        }
 
 
@@ -84,7 +84,7 @@ static BOOL smb_pwd_check_ntlmv2(const uchar *password, size_t pwd_len,
        }
 
        ntv2_owf_gen(part_passwd, user, domain, kr);
-       SMBOWFencrypt_ntv2(kr, c8, 8, password+16, pwd_len-16, resp);
+       SMBOWFencrypt_ntv2(kr, c8, 8, password+16, pwd_len-16, (char *)resp);
        if (user_sess_key != NULL)
        {
                SMBsesskeygen_ntv2(kr, resp, user_sess_key);
@@ -154,7 +154,7 @@ uint32 smb_password_ok(SAM_ACCOUNT *sampass, const auth_usersupplied_info *user_
                                                  nt_pw, 
                                                  user_info->chal, user_info->requested_username.str, 
                                                  user_info->requested_domain.str,
-                                                 server_info->session_key))
+                                                 (char *)server_info->session_key))
                        {
                                return NT_STATUS_NOPROBLEMO;
                        }
index 0711b056bd232369b5103fcb8c6e263b1b501e6d..ad66f0c4ac902b796432dadb2b8da0a93c6c4e0b 100644 (file)
@@ -205,9 +205,9 @@ use this machine as the password server.\n"));
         */
 
        if (!cli_session_setup(cli, user_info->smb_username.str, 
-                              user_info->lm_resp.buffer, 
+                              (char *)user_info->lm_resp.buffer, 
                               user_info->lm_resp.len, 
-                              user_info->nt_resp.buffer, 
+                              (char *)user_info->nt_resp.buffer, 
                               user_info->nt_resp.len, 
                               user_info->domain.str)) {
                DEBUG(1,("password server %s rejected the password\n", cli->desthost));
index 95d21dc772c4785f52a93b86cc88f72a8b53beba..b6273dedfc6322e807c8465038e34eb9c30e14e8 100644 (file)
@@ -67,7 +67,7 @@ void E_md4hash(uchar *passwd, uchar *p16)
        if(len > 128)
                len = 128;
        /* Password must be converted to NT unicode - null terminated. */
-       push_ucs2(NULL, wpwd, passwd, 256, STR_UNICODE|STR_NOALIGN|STR_TERMINATE);
+       push_ucs2(NULL, wpwd, (const char *)passwd, 256, STR_UNICODE|STR_NOALIGN|STR_TERMINATE);
        /* Calculate length in bytes */
        len = strlen_w(wpwd) * sizeof(int16);
 
@@ -125,8 +125,8 @@ void ntv2_owf_gen(const uchar owf[16],
        push_ucs2(NULL, dom_u, domain_n, (domain_l+1)*2, STR_UNICODE|STR_NOALIGN|STR_TERMINATE|STR_UPPER);
 
        hmac_md5_init_limK_to_64(owf, 16, &ctx);
-       hmac_md5_update(user_u, user_l * 2, &ctx);
-       hmac_md5_update(dom_u, domain_l * 2, &ctx);
+       hmac_md5_update((const unsigned char *)user_u, user_l * 2, &ctx);
+       hmac_md5_update((const unsigned char *)dom_u, domain_l * 2, &ctx);
        hmac_md5_final(kr_buf, &ctx);
 
 #ifdef DEBUG_PASSWORD
@@ -228,7 +228,7 @@ void SMBOWFencrypt_ntv2(const uchar kr[16],
        hmac_md5_init_limK_to_64(kr, 16, &ctx);
        hmac_md5_update(srv_chal, srv_chal_len, &ctx);
        hmac_md5_update(cli_chal, cli_chal_len, &ctx);
-       hmac_md5_final(resp_buf, &ctx);
+       hmac_md5_final((unsigned char *)resp_buf, &ctx);
 
 #ifdef DEBUG_PASSWORD
        DEBUG(100, ("SMBOWFencrypt_ntv2: srv_chal, cli_chal, resp_buf\n"));
@@ -245,7 +245,7 @@ void SMBsesskeygen_ntv2(const uchar kr[16],
 
        hmac_md5_init_limK_to_64(kr, 16, &ctx);
        hmac_md5_update(nt_resp, 16, &ctx);
-       hmac_md5_final(sess_key, &ctx);
+       hmac_md5_final((unsigned char *)sess_key, &ctx);
 
 #ifdef DEBUG_PASSWORD
        DEBUG(100, ("SMBsesskeygen_ntv2:\n"));
@@ -256,7 +256,7 @@ void SMBsesskeygen_ntv2(const uchar kr[16],
 void SMBsesskeygen_ntv1(const uchar kr[16],
                        const uchar * nt_resp, char sess_key[16])
 {
-       mdfour(sess_key, kr, 16);
+       mdfour((unsigned char *)sess_key, kr, 16);
 
 #ifdef DEBUG_PASSWORD
        DEBUG(100, ("SMBsesskeygen_ntv1:\n"));
@@ -270,7 +270,7 @@ void SMBsesskeygen_ntv1(const uchar kr[16],
 BOOL encode_pw_buffer(char buffer[516], const char *new_pass,
                      int new_pw_len, BOOL nt_pass_set)
 {
-       generate_random_buffer(buffer, 516, True);
+       generate_random_buffer((unsigned char *)buffer, 516, True);
 
        if (nt_pass_set) {
                new_pw_len *= 2;
@@ -388,7 +388,7 @@ void nt_owf_genW(const UNISTR2 *pwd, uchar nt_p16[16])
                SIVAL(buf, i * 2, pwd->buffer[i]);
        }
        /* Calculate the MD4 hash (NT compatible) of the password */
-       mdfour(nt_p16, buf, pwd->uni_str_len * 2);
+       mdfour(nt_p16, (const unsigned char *)buf, pwd->uni_str_len * 2);
 
        /* clear out local copy of user's password (just being paranoid). */
        ZERO_STRUCT(buf);
index 9ae7c8d3f9c8acbf584c63d07a0d1ec836c4ae20..12e4bb11db962e07d41bbefcad239bc5cbc75d13 100644 (file)
@@ -25,8 +25,9 @@
 
 #include "includes.h"
 
- int winbindd_request(int req_type, struct winbindd_request *request,
-                    struct winbindd_response *response);
+NSS_STATUS winbindd_request(int req_type,
+                                 struct winbindd_request *request,
+                                 struct winbindd_response *response);
 
 /* Copy of parse_domain_user from winbindd_util.c.  Parse a string of the
    form DOMAIN/user into a domain and a user */
index 0ec29aa2d783b22e9ac272bc4d26b220ceeae58a..7fb2bc2cf54eb26e28c7bc61a11e6f1ed8314910 100644 (file)
@@ -48,7 +48,7 @@ void init_request(struct winbindd_request *request, int request_type)
         static char *domain_env;
         static BOOL initialised;
 
-       request->cmd = request_type;
+       request->cmd = (enum winbindd_cmd)request_type;
        request->pid = getpid();
        request->domain[0] = '\0';
 
index d95810bf6111cc5348cece09a95e5394e3c82395..3b2d0b8d4bd5a5a81f22edc229f6e08698493f2c 100644 (file)
@@ -189,7 +189,7 @@ void reset_globals_after_fork(void)
 
        if (tdb) {
                uint32 initial_val = sys_getpid();
-               tdb_change_int_atomic(tdb, "INFO/random_seed", &initial_val, 1);
+               tdb_change_int_atomic(tdb, "INFO/random_seed", (int *)&initial_val, 1);
                set_rand_reseed_data((unsigned char *)&initial_val, sizeof(initial_val));
        }
 
index 20bdcda5ecbc3233fc510376d26a4950306c75f4..63cfe614e37454e9989d51f3fafdb3b378173f55 100644 (file)
@@ -2900,7 +2900,7 @@ static BOOL convert_driver_init(NT_PRINTER_PARAM *param, TALLOC_CTX *ctx, NT_DEV
        ZERO_STRUCT(devmode);
 
        prs_init(&ps, 0, ctx, UNMARSHALL);
-       ps.data_p      = param->data;
+       ps.data_p      = (char *)param->data;
        ps.buffer_size = param->data_len;
 
        if (spoolss_io_devmode("phantom DEVMODE", &ps, 0, &devmode))
index d878e2db58bc7ffbf1aa13e69f8bbc2c445521ac..886e5fefca03d49be89f4aeffa984635438e9792 100644 (file)
@@ -535,8 +535,8 @@ static uint32 _net_logon_any(NET_ID_INFO_CTR *ctr, char *user, char *domain, cha
 #endif
 
                generate_random_buffer(user_info.chal, 8, False);
-               SMBOWFencrypt(lm_pwd, user_info.chal, local_lm_response);
-               SMBOWFencrypt(nt_pwd, user_info.chal, local_nt_response);
+               SMBOWFencrypt((const unsigned char *)lm_pwd, user_info.chal, local_lm_response);
+               SMBOWFencrypt((const unsigned char *)nt_pwd, user_info.chal, local_nt_response);
                user_info.lm_resp.buffer = (uint8 *)local_lm_response;
                user_info.lm_resp.len = 24;
                user_info.nt_resp.buffer = (uint8 *)local_nt_response;
@@ -633,7 +633,7 @@ uint32 _net_sam_logon(pipes_struct *p, NET_Q_SAM_LOGON *q_u, NET_R_SAM_LOGON *r_
 
        DEBUG(10,("Attempting validation level %d for mapped username %s.\n", q_u->sam_id.ctr->switch_value, nt_username));
 
-       status = _net_logon_any(q_u->sam_id.ctr, nt_username, nt_domain, p->dc.sess_key);
+       status = _net_logon_any(q_u->sam_id.ctr, nt_username, nt_domain, (char *)p->dc.sess_key);
 
        /* Check account and password */
     
index d617dd9809730dc15fd5ca5539b05f7b80502929..a81b026c65ddc8765c1929c1b36b81f3e7639a26 100644 (file)
@@ -808,7 +808,7 @@ static BOOL get_group_alias_entries(TALLOC_CTX *ctx, DOMAIN_GRP **d_grp, DOM_SID
        /* well-known aliases */
        if (sid_equal(sid, &global_sid_Builtin) && !lp_hide_local_users()) {
                
-               enum_group_mapping(SID_NAME_WKN_GRP, &map, &num_entries, ENUM_ALL_MAPPED);
+               enum_group_mapping(SID_NAME_WKN_GRP, &map, (int *)&num_entries, ENUM_ALL_MAPPED);
        
                *d_grp=(DOMAIN_GRP *)talloc_zero(ctx, num_entries*sizeof(DOMAIN_GRP));
                if (*d_grp==NULL)
@@ -919,7 +919,7 @@ static uint32 get_group_domain_entries(TALLOC_CTX *ctx, DOMAIN_GRP **d_grp, DOM_
 
        *p_num_entries = 0;
 
-       enum_group_mapping(SID_NAME_DOM_GRP, &map, &group_entries, ENUM_ONLY_MAPPED);
+       enum_group_mapping(SID_NAME_DOM_GRP, &map, (int *)&group_entries, ENUM_ONLY_MAPPED);
 
        num_entries=group_entries-start_idx;
 
@@ -2523,7 +2523,7 @@ uint32 _samr_set_userinfo(pipes_struct *p, SAMR_Q_SET_USERINFO *q_u, SAMR_R_SET_
 
                        dump_data(100, (char *)ctr->info.id24->pass, 516);
 
-                       if (!set_user_info_pw(ctr->info.id24->pass, rid))
+                       if (!set_user_info_pw((char *)ctr->info.id24->pass, rid))
                                return NT_STATUS_ACCESS_DENIED;
                        break;
 
index d33bc225e632cae48a992fbf52667e1c1adc62b6..8ea867fe8c6202085744ad39947beec5087aca16 100644 (file)
@@ -188,7 +188,7 @@ uint32 pass_check_smb_with_chal(char *user, char *domain, uchar chal[8],
                        user_info.nt_resp.len = 24;
                }
                
-               user_info.plaintext_password.str = lm_pwd;
+               user_info.plaintext_password.str = (char *)lm_pwd;
                user_info.plaintext_password.len = lm_pwd_len;
 
        }
@@ -232,11 +232,11 @@ BOOL password_ok(char *user, char *password, int pwlen)
        
        /* The password could be either NTLM or plain LM.  Try NTLM first, but fall-through as
           required. */
-       if (pass_check_smb(user, lp_workgroup(), NULL, 0, password, pwlen) == NT_STATUS_NOPROBLEMO) {
+       if (pass_check_smb(user, lp_workgroup(), NULL, 0, (unsigned char *)password, pwlen) == NT_STATUS_NOPROBLEMO) {
                return True;
        }
 
-       if (pass_check_smb(user, lp_workgroup(), password, pwlen, NULL, 0) == NT_STATUS_NOPROBLEMO) {
+       if (pass_check_smb(user, lp_workgroup(), (unsigned char *)password, pwlen, NULL, 0) == NT_STATUS_NOPROBLEMO) {
                return True;
        }
 
index 0711b056bd232369b5103fcb8c6e263b1b501e6d..ad66f0c4ac902b796432dadb2b8da0a93c6c4e0b 100644 (file)
@@ -205,9 +205,9 @@ use this machine as the password server.\n"));
         */
 
        if (!cli_session_setup(cli, user_info->smb_username.str, 
-                              user_info->lm_resp.buffer, 
+                              (char *)user_info->lm_resp.buffer, 
                               user_info->lm_resp.len, 
-                              user_info->nt_resp.buffer, 
+                              (char *)user_info->nt_resp.buffer, 
                               user_info->nt_resp.len, 
                               user_info->domain.str)) {
                DEBUG(1,("password server %s rejected the password\n", cli->desthost));
index 27cb801c33e5fac7a60319f8b7ea2f7cf0fc522f..1a5d02e4a44ad6c5cb9c5158d4dee98826859d68 100644 (file)
@@ -45,7 +45,7 @@ static BOOL smb_pwd_check_ntlmv1(const uchar *password,
   SMBOWFencrypt(part_passwd, c8, p24);
        if (user_sess_key != NULL)
        {
-               SMBsesskeygen_ntv1(part_passwd, NULL, user_sess_key);
+               SMBsesskeygen_ntv1(part_passwd, NULL, (char *)user_sess_key);
        }
 
 
@@ -84,7 +84,7 @@ static BOOL smb_pwd_check_ntlmv2(const uchar *password, size_t pwd_len,
        }
 
        ntv2_owf_gen(part_passwd, user, domain, kr);
-       SMBOWFencrypt_ntv2(kr, c8, 8, password+16, pwd_len-16, resp);
+       SMBOWFencrypt_ntv2(kr, c8, 8, password+16, pwd_len-16, (char *)resp);
        if (user_sess_key != NULL)
        {
                SMBsesskeygen_ntv2(kr, resp, user_sess_key);
@@ -154,7 +154,7 @@ uint32 smb_password_ok(SAM_ACCOUNT *sampass, const auth_usersupplied_info *user_
                                                  nt_pw, 
                                                  user_info->chal, user_info->requested_username.str, 
                                                  user_info->requested_domain.str,
-                                                 server_info->session_key))
+                                                 (char *)server_info->session_key))
                        {
                                return NT_STATUS_NOPROBLEMO;
                        }
index fca16a2f0442b16e48e08d43c9ccad05155ee06f..02531bd1cdde6c2ab578be34790edbb6eae9e559 100644 (file)
@@ -812,8 +812,8 @@ int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf,int
 
   if (!guest) {
          valid_password = (pass_check_smb(user, domain, 
-                                          smb_apasswd, smb_apasslen, 
-                                          smb_ntpasswd, smb_ntpasslen) == NT_STATUS_NOPROBLEMO);
+                                          (unsigned char *)smb_apasswd, smb_apasslen, 
+                                          (unsigned char *)smb_ntpasswd, smb_ntpasslen) == NT_STATUS_NOPROBLEMO);
 
     /* The true branch will be executed if 
        (1) the NT password failed (or was not tried), and 
index 9709fc6a20e41e8bc6c3a579ea2c0889f8f10034..f5870a311903273324ebfd69dcc7ed43dfcb288a 100644 (file)
@@ -356,7 +356,7 @@ int vfs_allocate_file_space(files_struct *fsp, SMB_OFF_T len)
                while ( len_to_write > 0) {
                        SMB_OFF_T current_len_to_write = MIN(sizeof(zero_space),len_to_write);
 
-                       retlen = vfs_ops->write(fsp,fsp->fd,zero_space,current_len_to_write);
+                       retlen = vfs_ops->write(fsp,fsp->fd,(const char *)zero_space,current_len_to_write);
                        if (retlen <= 0) {
                                /* Write fail - return to original size. */
                                int save_errno = errno;
index 27a00e2e2bffe0970bdefb97d1392aedba6b7fcc..5cfe1152c8abfe64aeb9c58f875bb78f437f0426 100644 (file)
@@ -349,9 +349,9 @@ static int join_domain_byuser(char *domain, char *remote_machine,
 
                machine_pwd = (char *)upw.buffer;
                plen = upw.uni_str_len * 2;
-               generate_random_buffer(machine_pwd, plen, True);
+               generate_random_buffer((unsigned char *)machine_pwd, plen, True);
 
-               encode_pw_buffer(pwbuf, machine_pwd, plen, False);
+               encode_pw_buffer((char *)pwbuf, machine_pwd, plen, False);
 
                nt_owf_genW(&upw, ntpw);
        }
@@ -361,7 +361,7 @@ static int join_domain_byuser(char *domain, char *remote_machine,
        ZERO_STRUCT(ctr);
        ZERO_STRUCT(p24);
 
-       init_sam_user_info24(&p24, pwbuf,24);
+       init_sam_user_info24(&p24, (char *)pwbuf,24);
 
        ctr.switch_value = 24;
        ctr.info.id24 = &p24;