More fixes towards warnings on the IRIX compiler
authorAndrew Bartlett <abartlet@samba.org>
Sat, 20 Jul 2002 13:02:47 +0000 (13:02 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 20 Jul 2002 13:02:47 +0000 (13:02 +0000)
(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 30d0998c8c1a1d4de38ef0fbc83c2b763e05a3e6)

source3/client/smbspool.c
source3/libads/ldap.c
source3/passdb/secrets.c
source3/printing/load.c
source3/printing/pcap.c
source3/printing/print_svid.c
source3/rpc_server/srv_samr_nt.c
source3/utils/net_rpc_join.c

index b78d9d22a80212cafcc4140044e6ae82e6bcc322..7804669cc88d490b511eda0cced223925fc798a0 100644 (file)
@@ -284,18 +284,15 @@ 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);
 }
 
index 9d15c4e33cccdf10652150863e5071ab9e740778..f91ef4b8a0522dc73842a95bd467f0db487d7053 100644 (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;
index 3ecaf52e58674ab9a611b5f0a2701a655aa4756a..a737a2d0492e75bfea863174142b5af619ef7018 100644 (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;
        }
index ed967fb0a7c64ca8a320e2ca5018163cd86166b4..cd90cbb6f33edfe7059c5ad39079376dab1a204b 100644 (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;
index 4bca63fffb1fd52745e33a9a4e0c359f38135e88..46d1128b8e1d4d472e59f7722a39b5e69a97bb79 100644 (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);           
index 44127c3700af77ff62ae43223e3c25ae1b1a6222..837a2fba483e8bb4f8673ba680f76a61d6c5f807 100644 (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;
 
index 88d728d8107b2e207124d3ab7485ae4b9f0b3a82..96960611b7fbe2e8e44c0ee11178fc175a02e4c9 100644 (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,12 +2100,22 @@ 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,10 +2161,15 @@ 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);
        
index cc1a203ca13bcf3b4b45a2019a5677992bed2f84..61adb2a8ff72ee2d153cdc060568028e72378bc2 100644 (file)
@@ -80,8 +80,9 @@ 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 */
 
        if (!(cli = net_make_ipc_connection(NET_FLAGS_PDC))) 
@@ -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)));