1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

get rid of compiler warnings

(This used to be commit 0768991d04)
This commit is contained in:
Herb Lewis 2001-08-24 20:32:01 +00:00
parent b9e7eeaf4f
commit 717533483b
16 changed files with 42 additions and 41 deletions

View 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.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; 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 /* The password could be either NTLM or plain LM. Try NTLM first, but fall-through as
required. */ 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; 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; return True;
} }

View File

@ -45,7 +45,7 @@ static BOOL smb_pwd_check_ntlmv1(const uchar *password,
SMBOWFencrypt(part_passwd, c8, p24); SMBOWFencrypt(part_passwd, c8, p24);
if (user_sess_key != NULL) 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); 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) if (user_sess_key != NULL)
{ {
SMBsesskeygen_ntv2(kr, resp, user_sess_key); 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, nt_pw,
user_info->chal, user_info->requested_username.str, user_info->chal, user_info->requested_username.str,
user_info->requested_domain.str, user_info->requested_domain.str,
server_info->session_key)) (char *)server_info->session_key))
{ {
return NT_STATUS_NOPROBLEMO; return NT_STATUS_NOPROBLEMO;
} }

View File

@ -205,9 +205,9 @@ use this machine as the password server.\n"));
*/ */
if (!cli_session_setup(cli, user_info->smb_username.str, 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->lm_resp.len,
user_info->nt_resp.buffer, (char *)user_info->nt_resp.buffer,
user_info->nt_resp.len, user_info->nt_resp.len,
user_info->domain.str)) { user_info->domain.str)) {
DEBUG(1,("password server %s rejected the password\n", cli->desthost)); DEBUG(1,("password server %s rejected the password\n", cli->desthost));

View File

@ -67,7 +67,7 @@ void E_md4hash(uchar *passwd, uchar *p16)
if(len > 128) if(len > 128)
len = 128; len = 128;
/* Password must be converted to NT unicode - null terminated. */ /* 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 */ /* Calculate length in bytes */
len = strlen_w(wpwd) * sizeof(int16); 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); 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_init_limK_to_64(owf, 16, &ctx);
hmac_md5_update(user_u, user_l * 2, &ctx); hmac_md5_update((const unsigned char *)user_u, user_l * 2, &ctx);
hmac_md5_update(dom_u, domain_l * 2, &ctx); hmac_md5_update((const unsigned char *)dom_u, domain_l * 2, &ctx);
hmac_md5_final(kr_buf, &ctx); hmac_md5_final(kr_buf, &ctx);
#ifdef DEBUG_PASSWORD #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_init_limK_to_64(kr, 16, &ctx);
hmac_md5_update(srv_chal, srv_chal_len, &ctx); hmac_md5_update(srv_chal, srv_chal_len, &ctx);
hmac_md5_update(cli_chal, cli_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 #ifdef DEBUG_PASSWORD
DEBUG(100, ("SMBOWFencrypt_ntv2: srv_chal, cli_chal, resp_buf\n")); 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_init_limK_to_64(kr, 16, &ctx);
hmac_md5_update(nt_resp, 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 #ifdef DEBUG_PASSWORD
DEBUG(100, ("SMBsesskeygen_ntv2:\n")); DEBUG(100, ("SMBsesskeygen_ntv2:\n"));
@ -256,7 +256,7 @@ void SMBsesskeygen_ntv2(const uchar kr[16],
void SMBsesskeygen_ntv1(const uchar kr[16], void SMBsesskeygen_ntv1(const uchar kr[16],
const uchar * nt_resp, char sess_key[16]) const uchar * nt_resp, char sess_key[16])
{ {
mdfour(sess_key, kr, 16); mdfour((unsigned char *)sess_key, kr, 16);
#ifdef DEBUG_PASSWORD #ifdef DEBUG_PASSWORD
DEBUG(100, ("SMBsesskeygen_ntv1:\n")); 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, BOOL encode_pw_buffer(char buffer[516], const char *new_pass,
int new_pw_len, BOOL nt_pass_set) 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) { if (nt_pass_set) {
new_pw_len *= 2; 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]); SIVAL(buf, i * 2, pwd->buffer[i]);
} }
/* Calculate the MD4 hash (NT compatible) of the password */ /* 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). */ /* clear out local copy of user's password (just being paranoid). */
ZERO_STRUCT(buf); ZERO_STRUCT(buf);

View File

@ -25,8 +25,9 @@
#include "includes.h" #include "includes.h"
int winbindd_request(int req_type, struct winbindd_request *request, NSS_STATUS winbindd_request(int req_type,
struct winbindd_response *response); struct winbindd_request *request,
struct winbindd_response *response);
/* Copy of parse_domain_user from winbindd_util.c. Parse a string of the /* Copy of parse_domain_user from winbindd_util.c. Parse a string of the
form DOMAIN/user into a domain and a user */ form DOMAIN/user into a domain and a user */

View File

@ -48,7 +48,7 @@ void init_request(struct winbindd_request *request, int request_type)
static char *domain_env; static char *domain_env;
static BOOL initialised; static BOOL initialised;
request->cmd = request_type; request->cmd = (enum winbindd_cmd)request_type;
request->pid = getpid(); request->pid = getpid();
request->domain[0] = '\0'; request->domain[0] = '\0';

View File

@ -189,7 +189,7 @@ void reset_globals_after_fork(void)
if (tdb) { if (tdb) {
uint32 initial_val = sys_getpid(); 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)); set_rand_reseed_data((unsigned char *)&initial_val, sizeof(initial_val));
} }

View File

@ -2900,7 +2900,7 @@ static BOOL convert_driver_init(NT_PRINTER_PARAM *param, TALLOC_CTX *ctx, NT_DEV
ZERO_STRUCT(devmode); ZERO_STRUCT(devmode);
prs_init(&ps, 0, ctx, UNMARSHALL); prs_init(&ps, 0, ctx, UNMARSHALL);
ps.data_p = param->data; ps.data_p = (char *)param->data;
ps.buffer_size = param->data_len; ps.buffer_size = param->data_len;
if (spoolss_io_devmode("phantom DEVMODE", &ps, 0, &devmode)) if (spoolss_io_devmode("phantom DEVMODE", &ps, 0, &devmode))

View File

@ -535,8 +535,8 @@ static uint32 _net_logon_any(NET_ID_INFO_CTR *ctr, char *user, char *domain, cha
#endif #endif
generate_random_buffer(user_info.chal, 8, False); generate_random_buffer(user_info.chal, 8, False);
SMBOWFencrypt(lm_pwd, user_info.chal, local_lm_response); SMBOWFencrypt((const unsigned char *)lm_pwd, user_info.chal, local_lm_response);
SMBOWFencrypt(nt_pwd, user_info.chal, local_nt_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.buffer = (uint8 *)local_lm_response;
user_info.lm_resp.len = 24; user_info.lm_resp.len = 24;
user_info.nt_resp.buffer = (uint8 *)local_nt_response; 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)); 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 */ /* Check account and password */

View File

@ -808,7 +808,7 @@ static BOOL get_group_alias_entries(TALLOC_CTX *ctx, DOMAIN_GRP **d_grp, DOM_SID
/* well-known aliases */ /* well-known aliases */
if (sid_equal(sid, &global_sid_Builtin) && !lp_hide_local_users()) { 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)); *d_grp=(DOMAIN_GRP *)talloc_zero(ctx, num_entries*sizeof(DOMAIN_GRP));
if (*d_grp==NULL) 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; *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; 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); 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; return NT_STATUS_ACCESS_DENIED;
break; break;

View 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.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; 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 /* The password could be either NTLM or plain LM. Try NTLM first, but fall-through as
required. */ 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; 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; return True;
} }

View File

@ -205,9 +205,9 @@ use this machine as the password server.\n"));
*/ */
if (!cli_session_setup(cli, user_info->smb_username.str, 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->lm_resp.len,
user_info->nt_resp.buffer, (char *)user_info->nt_resp.buffer,
user_info->nt_resp.len, user_info->nt_resp.len,
user_info->domain.str)) { user_info->domain.str)) {
DEBUG(1,("password server %s rejected the password\n", cli->desthost)); DEBUG(1,("password server %s rejected the password\n", cli->desthost));

View File

@ -45,7 +45,7 @@ static BOOL smb_pwd_check_ntlmv1(const uchar *password,
SMBOWFencrypt(part_passwd, c8, p24); SMBOWFencrypt(part_passwd, c8, p24);
if (user_sess_key != NULL) 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); 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) if (user_sess_key != NULL)
{ {
SMBsesskeygen_ntv2(kr, resp, user_sess_key); 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, nt_pw,
user_info->chal, user_info->requested_username.str, user_info->chal, user_info->requested_username.str,
user_info->requested_domain.str, user_info->requested_domain.str,
server_info->session_key)) (char *)server_info->session_key))
{ {
return NT_STATUS_NOPROBLEMO; return NT_STATUS_NOPROBLEMO;
} }

View File

@ -812,8 +812,8 @@ int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf,int
if (!guest) { if (!guest) {
valid_password = (pass_check_smb(user, domain, valid_password = (pass_check_smb(user, domain,
smb_apasswd, smb_apasslen, (unsigned char *)smb_apasswd, smb_apasslen,
smb_ntpasswd, smb_ntpasslen) == NT_STATUS_NOPROBLEMO); (unsigned char *)smb_ntpasswd, smb_ntpasslen) == NT_STATUS_NOPROBLEMO);
/* The true branch will be executed if /* The true branch will be executed if
(1) the NT password failed (or was not tried), and (1) the NT password failed (or was not tried), and

View File

@ -356,7 +356,7 @@ int vfs_allocate_file_space(files_struct *fsp, SMB_OFF_T len)
while ( len_to_write > 0) { while ( len_to_write > 0) {
SMB_OFF_T current_len_to_write = MIN(sizeof(zero_space),len_to_write); 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) { if (retlen <= 0) {
/* Write fail - return to original size. */ /* Write fail - return to original size. */
int save_errno = errno; int save_errno = errno;

View File

@ -349,9 +349,9 @@ static int join_domain_byuser(char *domain, char *remote_machine,
machine_pwd = (char *)upw.buffer; machine_pwd = (char *)upw.buffer;
plen = upw.uni_str_len * 2; 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); nt_owf_genW(&upw, ntpw);
} }
@ -361,7 +361,7 @@ static int join_domain_byuser(char *domain, char *remote_machine,
ZERO_STRUCT(ctr); ZERO_STRUCT(ctr);
ZERO_STRUCT(p24); ZERO_STRUCT(p24);
init_sam_user_info24(&p24, pwbuf,24); init_sam_user_info24(&p24, (char *)pwbuf,24);
ctr.switch_value = 24; ctr.switch_value = 24;
ctr.info.id24 = &p24; ctr.info.id24 = &p24;