1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

More fixes towards warnings on the IRIX compiler

(and yes, some of these are real bugs)

In particular, the samr code was doing an &foo of various types, to a function
that assumed uint32.  If time_t isn't 32 bits long, that broke.

They are assignment compatible however, so use that and an intermediate
variable.

Andrew Bartlett
(This used to be commit 30d0998c8c)
This commit is contained in:
Andrew Bartlett 2002-07-20 13:02:47 +00:00
parent 9175bd2fe7
commit 29075c97d3
8 changed files with 46 additions and 35 deletions

View File

@ -284,17 +284,14 @@ smb_connect(char *workgroup, /* I - Workgroup */
nt_status = cli_full_connection(&c, myname, server, NULL, 0, share, "?????",
username, lp_workgroup(), password, 0);
if (NT_STATUS_IS_OK(nt_status)) {
return c;
} else {
if (!NT_STATUS_IS_OK(nt_status)) {
fprintf(stderr, "ERROR: Connection failed with error %s\n", nt_errstr(nt_status));
return NULL;
}
/*
* Return the new connection...
*/
/*
* Return the new connection...
*/
return (c);
}

View File

@ -230,7 +230,7 @@ ADS_STATUS ads_do_paged_search(ADS_STRUCT *ads, const char *bind_path,
else {
/* This would be the utf8-encoded version...*/
/* if (!(search_attrs = ads_push_strvals(ctx, attrs))) */
if (!(str_list_copy(&search_attrs, (char **) attrs)))
if (!(str_list_copy(&search_attrs, attrs)))
{
rc = LDAP_NO_MEMORY;
goto done;
@ -453,7 +453,7 @@ ADS_STATUS ads_do_search(ADS_STRUCT *ads, const char *bind_path, int scope,
else {
/* This would be the utf8-encoded version...*/
/* if (!(search_attrs = ads_push_strvals(ctx, attrs))) */
if (!(str_list_copy(&search_attrs, (char **) attrs)))
if (!(str_list_copy(&search_attrs, attrs)))
{
rc = LDAP_NO_MEMORY;
goto done;

View File

@ -178,7 +178,7 @@ BOOL secrets_fetch_trust_account_password(char *domain, uint8 ret_pwd[16],
if (plaintext) {
/* we have an ADS password - use that */
DEBUG(4,("Using ADS machine password\n"));
E_md4hash((uchar *)plaintext, ret_pwd);
E_md4hash(plaintext, ret_pwd);
SAFE_FREE(plaintext);
return True;
}

View File

@ -38,7 +38,7 @@ auto-load some homes and printer services
***************************************************************************/
static void add_auto_printers(void)
{
char *p;
const char *p;
int printers;
char *str = strdup(lp_auto_services());
@ -47,9 +47,9 @@ static void add_auto_printers(void)
printers = lp_servicenumber(PRINTERS_NAME);
if (printers < 0) {
SAFE_FREE(str);
return;
}
SAFE_FREE(str);
return;
}
for (p=strtok(str,LIST_SEP);p;p=strtok(NULL,LIST_SEP)) {
if (lp_servicenumber(p) >= 0) continue;

View File

@ -241,12 +241,9 @@ static BOOL ScanQconfig(char *psz,char *pszPrintername)
Scan printcap file pszPrintcapname for a printer called pszPrintername.
Return True if found, else False. Returns False on error, too, after logging
the error at level 0. For generality, the printcap name may be passed - if
passed as NULL, the configuration will be queried for the name. pszPrintername
must be in DOS codepage.
The xxx_printername_ok functions need fixing to understand they are being
given a DOS codepage. FIXME !! JRA.
passed as NULL, the configuration will be queried for the name.
***************************************************************************/
BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname)
BOOL pcap_printername_ok(const char *pszPrintername, const char *pszPrintcapname)
{
char *line=NULL;
char *psz;
@ -305,8 +302,6 @@ BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname)
if (strequal(p,pszPrintername))
{
/* normalise the case */
pstrcpy(pszPrintername,p);
SAFE_FREE(line);
x_fclose(pfile);
return(True);

View File

@ -126,7 +126,7 @@ void sysv_printer_fn(void (*fn)(char *, char *))
* provide the equivalent of pcap_printername_ok() for SVID/XPG4 conforming
* systems.
*/
int sysv_printername_ok(char *name)
int sysv_printername_ok(const char *name)
{
printer_t *tmp;

View File

@ -2081,6 +2081,8 @@ NTSTATUS _samr_query_dom_info(pipes_struct *p, SAMR_Q_QUERY_DOMAIN_INFO *q_u, SA
time_t u_logout;
NTTIME nt_logout;
uint32 account_policy_temp;
uint32 num_users=0, num_groups=0, num_aliases=0;
if ((ctr = (SAM_UNK_CTR *)talloc_zero(p->mem_ctx, sizeof(SAM_UNK_CTR))) == NULL)
@ -2098,11 +2100,21 @@ NTSTATUS _samr_query_dom_info(pipes_struct *p, SAMR_Q_QUERY_DOMAIN_INFO *q_u, SA
switch (q_u->switch_value) {
case 0x01:
account_policy_get(AP_MIN_PASSWORD_LEN, &min_pass_len);
account_policy_get(AP_PASSWORD_HISTORY, &pass_hist);
account_policy_get(AP_USER_MUST_LOGON_TO_CHG_PASS, &flag);
account_policy_get(AP_MAX_PASSWORD_AGE, (int *)&u_expire);
account_policy_get(AP_MIN_PASSWORD_AGE, (int *)&u_min_age);
account_policy_get(AP_MIN_PASSWORD_LEN, &account_policy_temp);
min_pass_len = account_policy_temp;
account_policy_get(AP_PASSWORD_HISTORY, &account_policy_temp);
pass_hist = account_policy_temp;
account_policy_get(AP_USER_MUST_LOGON_TO_CHG_PASS, &account_policy_temp);
flag = account_policy_temp;
account_policy_get(AP_MAX_PASSWORD_AGE, &account_policy_temp);
u_expire = account_policy_temp;
account_policy_get(AP_MIN_PASSWORD_AGE, &account_policy_temp);
u_min_age = account_policy_temp;
unix_to_nt_time_abs(&nt_expire, u_expire);
unix_to_nt_time_abs(&nt_min_age, u_min_age);
@ -2149,9 +2161,14 @@ NTSTATUS _samr_query_dom_info(pipes_struct *p, SAMR_Q_QUERY_DOMAIN_INFO *q_u, SA
init_unk_info7(&ctr->info.inf7);
break;
case 0x0c:
account_policy_get(AP_LOCK_ACCOUNT_DURATION, (int *)&u_lock_duration);
account_policy_get(AP_RESET_COUNT_TIME, (int *)&u_reset_time);
account_policy_get(AP_BAD_ATTEMPT_LOCKOUT, &lockout);
account_policy_get(AP_LOCK_ACCOUNT_DURATION, &account_policy_temp);
u_lock_duration = account_policy_temp;
account_policy_get(AP_RESET_COUNT_TIME, &account_policy_temp);
u_reset_time = account_policy_temp;
account_policy_get(AP_BAD_ATTEMPT_LOCKOUT, &account_policy_temp);
lockout = account_policy_temp;
unix_to_nt_time_abs(&nt_lock_duration, u_lock_duration);
unix_to_nt_time_abs(&nt_reset_time, u_reset_time);

View File

@ -80,7 +80,8 @@ int net_rpc_join_newstyle(int argc, const char **argv)
fstring domain;
uint32 num_rids, *name_types, *user_rids;
uint32 flags = 0x3e8;
const char *acct_name;
char *acct_name;
const char *const_acct_name;
/* Connect to remote machine */
@ -162,7 +163,8 @@ int net_rpc_join_newstyle(int argc, const char **argv)
CHECK_RPC_ERR_DEBUG(cli_samr_lookup_names(cli, mem_ctx,
&domain_pol, flags,
1, &acct_name, &num_rids,
1, &const_acct_name,
&num_rids,
&user_rids, &name_types),
("error looking up rid for user %s: %s\n",
acct_name, nt_errstr(result)));