summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerb Lewis <herb@samba.org>2001-08-24 20:32:01 +0000
committerHerb Lewis <herb@samba.org>2001-08-24 20:32:01 +0000
commit717533483b41ef975953f58e0c6be04828a3d467 (patch)
tree1eba76475bd03c51e9d2d2f840634517297d0024
parentb9e7eeaf4fc13fb9e2dbee69e07bc6800f6e427a (diff)
downloadsamba-717533483b41ef975953f58e0c6be04828a3d467.tar.gz
samba-717533483b41ef975953f58e0c6be04828a3d467.tar.bz2
samba-717533483b41ef975953f58e0c6be04828a3d467.zip
get rid of compiler warnings
(This used to be commit 0768991d04ea03e774ca8662c9cae5e1951b88e0)
-rw-r--r--source3/auth/auth.c6
-rw-r--r--source3/auth/auth_sam.c6
-rw-r--r--source3/auth/auth_server.c4
-rw-r--r--source3/libsmb/smbencrypt.c16
-rw-r--r--source3/nsswitch/wb_client.c5
-rw-r--r--source3/nsswitch/wb_common.c2
-rw-r--r--source3/passdb/secrets.c2
-rw-r--r--source3/printing/nt_printing.c2
-rw-r--r--source3/rpc_server/srv_netlog_nt.c6
-rw-r--r--source3/rpc_server/srv_samr_nt.c6
-rw-r--r--source3/smbd/auth.c6
-rw-r--r--source3/smbd/auth_server.c4
-rw-r--r--source3/smbd/auth_smbpasswd.c6
-rw-r--r--source3/smbd/reply.c4
-rw-r--r--source3/smbd/vfs.c2
-rw-r--r--source3/utils/smbpasswd.c6
16 files changed, 42 insertions, 41 deletions
diff --git a/source3/auth/auth.c b/source3/auth/auth.c
index d33bc225e6..8ea867fe8c 100644
--- a/source3/auth/auth.c
+++ b/source3/auth/auth.c
@@ -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;
}
diff --git a/source3/auth/auth_sam.c b/source3/auth/auth_sam.c
index 27cb801c33..1a5d02e4a4 100644
--- a/source3/auth/auth_sam.c
+++ b/source3/auth/auth_sam.c
@@ -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;
}
diff --git a/source3/auth/auth_server.c b/source3/auth/auth_server.c
index 0711b056bd..ad66f0c4ac 100644
--- a/source3/auth/auth_server.c
+++ b/source3/auth/auth_server.c
@@ -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));
diff --git a/source3/libsmb/smbencrypt.c b/source3/libsmb/smbencrypt.c
index 95d21dc772..b6273dedfc 100644
--- a/source3/libsmb/smbencrypt.c
+++ b/source3/libsmb/smbencrypt.c
@@ -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);
diff --git a/source3/nsswitch/wb_client.c b/source3/nsswitch/wb_client.c
index 9ae7c8d3f9..12e4bb11db 100644
--- a/source3/nsswitch/wb_client.c
+++ b/source3/nsswitch/wb_client.c
@@ -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 */
diff --git a/source3/nsswitch/wb_common.c b/source3/nsswitch/wb_common.c
index 0ec29aa2d7..7fb2bc2cf5 100644
--- a/source3/nsswitch/wb_common.c
+++ b/source3/nsswitch/wb_common.c
@@ -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';
diff --git a/source3/passdb/secrets.c b/source3/passdb/secrets.c
index d95810bf61..3b2d0b8d4b 100644
--- a/source3/passdb/secrets.c
+++ b/source3/passdb/secrets.c
@@ -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));
}
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 20bdcda5ec..63cfe614e3 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -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))
diff --git a/source3/rpc_server/srv_netlog_nt.c b/source3/rpc_server/srv_netlog_nt.c
index d878e2db58..886e5fefca 100644
--- a/source3/rpc_server/srv_netlog_nt.c
+++ b/source3/rpc_server/srv_netlog_nt.c
@@ -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 */
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index d617dd9809..a81b026c65 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -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;
diff --git a/source3/smbd/auth.c b/source3/smbd/auth.c
index d33bc225e6..8ea867fe8c 100644
--- a/source3/smbd/auth.c
+++ b/source3/smbd/auth.c
@@ -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;
}
diff --git a/source3/smbd/auth_server.c b/source3/smbd/auth_server.c
index 0711b056bd..ad66f0c4ac 100644
--- a/source3/smbd/auth_server.c
+++ b/source3/smbd/auth_server.c
@@ -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));
diff --git a/source3/smbd/auth_smbpasswd.c b/source3/smbd/auth_smbpasswd.c
index 27cb801c33..1a5d02e4a4 100644
--- a/source3/smbd/auth_smbpasswd.c
+++ b/source3/smbd/auth_smbpasswd.c
@@ -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;
}
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index fca16a2f04..02531bd1cd 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -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
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 9709fc6a20..f5870a3119 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -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;
diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c
index 27a00e2e2b..5cfe1152c8 100644
--- a/source3/utils/smbpasswd.c
+++ b/source3/utils/smbpasswd.c
@@ -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;