r12043: It's amazing the warnings you find when compiling on a 64-bit
authorJeremy Allison <jra@samba.org>
Sat, 3 Dec 2005 06:46:46 +0000 (06:46 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:05:42 +0000 (11:05 -0500)
box with gcc4 and -O6...
Fix a bunch of C99 dereferencing type-punned pointer will break
strict-aliasing rules errors. Also added prs_int32 (not uint32...)
as it's needed in one place. Find places where prs_uint32 was being
used to marshall/unmarshall a time_t (a big no no on 64-bits).
More warning fixes to come.
Thanks to Volker for nudging me to compile like this.
Jeremy.
(This used to be commit c65b752604f8f58abc4e7ae8514dc2c7f086271c)

19 files changed:
source3/lib/charcnv.c
source3/lib/clobber.c
source3/lib/crc32.c
source3/lib/util_file.c
source3/libads/ads_ldap.c
source3/libads/ldap.c
source3/libsmb/climessage.c
source3/libsmb/samlogon_cache.c
source3/nmbd/nmbd_namelistdb.c
source3/passdb/secrets.c
source3/rpc_parse/parse_net.c
source3/rpc_parse/parse_prs.c
source3/rpc_server/srv_eventlog_nt.c
source3/rpc_server/srv_lsa_nt.c
source3/rpc_server/srv_reg_nt.c
source3/rpc_server/srv_samr_nt.c
source3/rpc_server/srv_spoolss_nt.c
source3/rpc_server/srv_svcctl_nt.c
source3/smbd/message.c

index 4fbad0f3d18aca24cd6227182b39f307a448b670..0c806167f4135fce63ab61350a26d6650247cbdc 100644 (file)
@@ -781,7 +781,7 @@ size_t unix_strlower(const char *src, size_t srclen, char *dest, size_t destlen)
        smb_ucs2_t *buffer = NULL;
        
        size = convert_string_allocate(NULL, CH_UNIX, CH_UCS2, src, srclen,
-                                      (void **) &buffer, True);
+                                      (void **)(void *)&buffer, True);
        if (size == (size_t)-1 || !buffer) {
                smb_panic("failed to create UCS2 buffer");
        }
index fb3a0dc28159c179fad88d0a3c7da0809dc75ffc..54b24ffed390fefecde69ed6b478776c5c0c690c 100644 (file)
@@ -54,7 +54,7 @@ void clobber_region(const char *fn, unsigned int line, char *dest, size_t len)
         * (This is not redundant with the clobbering above.  The
         * marking might not actually take effect if we're not running
         * under valgrind.) */
-       VALGRIND_MAKE_WRITABLE(dest, len);
+//     VALGRIND_MAKE_WRITABLE(dest, len);
 #endif /* VALGRIND */
 #endif /* DEVELOPER */
 }
index 7522ab7c811310d0e958df59f82c7f94a4215808..a4ae90c469308a881095fce0419a3e93f29bbcf0 100644 (file)
@@ -93,7 +93,7 @@ uint32 crc32_calc_buffer(const char *buf, size_t size)
        const unsigned char *p;
        uint32 crc;
 
-       p = buf;
+       p = (const unsigned char *)buf;
        crc = ~0U;
 
        while (size--)
index 963d610beffb5737d84e031dbf20b956be112b84..407a8b24fc97381c33502cd72c76c24dfa5a6dca 100644 (file)
@@ -525,7 +525,7 @@ static char **file_lines_parse(char *p, size_t size, int *numlines)
 char **file_lines_load(const char *fname, int *numlines)
 {
        char *p;
-       size_t size;
+       size_t size = 0;
 
        p = file_load(fname, &size);
        if (!p) {
index ae86ef0b764078afa54abf3f4880166f60b4a90c..fea4cd0fd09991f2fc047b6c7910860fc8d7ed1f 100644 (file)
@@ -56,7 +56,7 @@ ADS_STATUS ads_sid_to_dn(ADS_STRUCT *ads,
                goto done;
        }
 
-       rc = ads_search_retry(ads, (void **)&msg, ldap_exp, attr);
+       rc = ads_search_retry(ads, (void **)(void *)&msg, ldap_exp, attr);
 
        if (!ADS_ERR_OK(rc)) {
                DEBUG(1,("ads_sid_to_dn ads_search: %s\n", ads_errstr(rc)));
index e4cfc456a2156800965d85cb577bb4bb65957842..fa2a8b5ea57634f42e652a6a6ca641ad129396e1 100644 (file)
@@ -1162,7 +1162,7 @@ uint32 ads_get_kvno(ADS_STRUCT *ads, const char *machine_name)
        if (asprintf(&filter, "(samAccountName=%s$)", machine_name) == -1) {
                return kvno;
        }
-       ret = ads_search(ads, (void**) &res, filter, attrs);
+       ret = ads_search(ads, (void**)(void *)&res, filter, attrs);
        SAFE_FREE(filter);
        if (!ADS_ERR_OK(ret) && ads_count_replies(ads, res)) {
                DEBUG(1,("ads_get_kvno: Computer Account For %s not found.\n", machine_name));
@@ -1216,7 +1216,7 @@ ADS_STATUS ads_clear_service_principal_names(ADS_STRUCT *ads, const char *machin
        ADS_STATUS ret = ADS_ERROR(LDAP_SUCCESS);
        char *dn_string = NULL;
 
-       ret = ads_find_machine_acct(ads, (void **)&res, machine_name);
+       ret = ads_find_machine_acct(ads, (void **)(void *)&res, machine_name);
        if (!ADS_ERR_OK(ret) || ads_count_replies(ads, res) != 1) {
                DEBUG(5,("ads_clear_service_principal_names: WARNING: Host Account for %s not found... skipping operation.\n", machine_name));
                DEBUG(5,("ads_clear_service_principal_names: WARNING: Service Principals for %s have NOT been cleared.\n", machine_name));
@@ -1284,7 +1284,7 @@ ADS_STATUS ads_add_service_principal_name(ADS_STRUCT *ads, const char *machine_n
        char *dn_string = NULL;
        const char *servicePrincipalName[4] = {NULL, NULL, NULL, NULL};
 
-       ret = ads_find_machine_acct(ads, (void **)&res, machine_name);
+       ret = ads_find_machine_acct(ads, (void **)(void *)&res, machine_name);
        if (!ADS_ERR_OK(ret) || ads_count_replies(ads, res) != 1) {
                DEBUG(1,("ads_add_service_principal_name: WARNING: Host Account for %s not found... skipping operation.\n",
                        machine_name));
@@ -1398,7 +1398,7 @@ static ADS_STATUS ads_add_machine_acct(ADS_STRUCT *ads, const char *machine_name
 
        name_to_fqdn(my_fqdn, machine_name);
 
-       status = ads_find_machine_acct(ads, (void **)&res, machine_name);
+       status = ads_find_machine_acct(ads, (void **)(void *)&res, machine_name);
        if (ADS_ERR_OK(status) && ads_count_replies(ads, res) == 1) {
                char *dn_string = ads_get_dn(ads, res);
                if (!dn_string) {
@@ -1771,7 +1771,7 @@ ADS_STATUS ads_join_realm(ADS_STRUCT *ads, const char *machine_name,
                return status;
        }
 
-       status = ads_find_machine_acct(ads, (void **)&res, machine);
+       status = ads_find_machine_acct(ads, (void **)(void *)&res, machine);
        if (!ADS_ERR_OK(status)) {
                DEBUG(0, ("ads_join_realm: Host account test failed for machine %s\n", machine));
                SAFE_FREE(machine);
index f646096a4e5aaa8921b8f9f65678a5aa58be8d41..1aa659c1ba3cee2547338d7dadcf43f738d05c7a 100644 (file)
@@ -85,7 +85,7 @@ int cli_message_text_build(struct cli_state *cli, char *msg, int len, int grp)
        p = smb_buf(cli->outbuf);
        *p++ = 1;
 
-       if ((lendos = (int)convert_string_allocate(NULL,CH_UNIX, CH_DOS, msg,len, (void **) &msgdos, True)) < 0 || !msgdos) {
+       if ((lendos = (int)convert_string_allocate(NULL,CH_UNIX, CH_DOS, msg,len, (void **)(void *)&msgdos, True)) < 0 || !msgdos) {
                DEBUG(3,("Conversion failed, sending message in UNIX charset\n"));
                SSVAL(p, 0, len); p += 2;
                memcpy(p, msg, len);
index d0469a1a4819e70d3c8d3f393730fe038f68b655..ef60055cf47d60109503b33203efa97d89c077e6 100644 (file)
@@ -150,8 +150,12 @@ BOOL netsamlogon_cache_store( const char *username, NET_USER_INFO_3 *user )
 
        prs_init( &ps, RPC_MAX_PDU_FRAG_LEN, mem_ctx, MARSHALL);
        
-       if ( !prs_uint32( "timestamp", &ps, 0, (uint32*)&t ) )
-               return False;
+       {
+               uint32 ts;
+               if ( !prs_uint32( "timestamp", &ps, 0, &ts ) )
+                       return False;
+               t = (time_t)ts;
+       }
        
        if ( net_io_user_info3("", user, &ps, 0, 3, 0) ) 
        {
index 344d3c7ca195df6b71ee6c4b95f8cdfc08d0f819..88d5ea52f589c41d3278817079cebf1422d5bc40 100644 (file)
@@ -78,7 +78,7 @@ static void update_name_in_namelist( struct subnet_record *subrec,
 {
        struct name_record *oldrec = NULL;
 
-       ubi_trInsert( subrec->namelist, namerec, &(namerec->name), &oldrec );
+       ubi_trInsert( subrec->namelist, namerec, &namerec->name, &oldrec );
        if( oldrec ) {
                SAFE_FREE( oldrec->data.ip );
                SAFE_FREE( oldrec );
index 35ccb2c725b57a3296056fd0aecaa5f58379a99c..bf57e013fc5ad79a9997c791521b5102449ac7bc 100644 (file)
@@ -138,7 +138,7 @@ BOOL secrets_fetch_domain_sid(const char *domain, DOM_SID *sid)
 {
        DOM_SID *dyn_sid;
        fstring key;
-       size_t size;
+       size_t size = 0;
 
        slprintf(key, sizeof(key)-1, "%s/%s", SECRETS_DOMAIN_SID, domain);
        strupper_m(key);
@@ -147,8 +147,7 @@ BOOL secrets_fetch_domain_sid(const char *domain, DOM_SID *sid)
        if (dyn_sid == NULL)
                return False;
 
-       if (size != sizeof(DOM_SID))
-       { 
+       if (size != sizeof(DOM_SID)) { 
                SAFE_FREE(dyn_sid);
                return False;
        }
@@ -171,7 +170,7 @@ BOOL secrets_fetch_domain_guid(const char *domain, struct uuid *guid)
 {
        struct uuid *dyn_guid;
        fstring key;
-       size_t size;
+       size_t size = 0;
        struct uuid new_guid;
 
        slprintf(key, sizeof(key)-1, "%s/%s", SECRETS_DOMAIN_GUID, domain);
@@ -187,8 +186,7 @@ BOOL secrets_fetch_domain_guid(const char *domain, struct uuid *guid)
                        return False;
        }
 
-       if (size != sizeof(struct uuid))
-       { 
+       if (size != sizeof(struct uuid)) { 
                DEBUG(1,("UUID size %d is wrong!\n", (int)size));
                SAFE_FREE(dyn_guid);
                return False;
@@ -276,7 +274,7 @@ BOOL secrets_fetch_trust_account_password(const char *domain, uint8 ret_pwd[16],
 {
        struct machine_acct_pass *pass;
        char *plaintext;
-       size_t size;
+       size_t size = 0;
 
        plaintext = secrets_fetch_machine_password(domain, pass_last_set_time, 
                                                   channel);
@@ -326,7 +324,7 @@ BOOL secrets_fetch_trusted_domain_password(const char *domain, char** pwd,
                                            DOM_SID *sid, time_t *pass_last_set_time)
 {
        struct trusted_dom_pass pass;
-       size_t size;
+       size_t size = 0;
        
        /* unpacking structures */
        char* pass_buf;
@@ -599,7 +597,7 @@ BOOL secrets_store_ldap_pw(const char* dn, char* pw)
 BOOL fetch_ldap_pw(char **dn, char** pw)
 {
        char *key = NULL;
-       size_t size;
+       size_t size = 0;
        
        *dn = smb_xstrdup(lp_ldap_admin_dn());
        
@@ -682,7 +680,7 @@ NTSTATUS secrets_get_trusted_domains(TALLOC_CTX* ctx, int* enum_ctx, unsigned in
        char *pattern;
        unsigned int start_idx;
        uint32 idx = 0;
-       size_t size, packed_size = 0;
+       size_t size = 0, packed_size = 0;
        fstring dom_name;
        char *packed_pass;
        struct trusted_dom_pass *pass = TALLOC_ZERO_P(ctx, struct trusted_dom_pass);
@@ -877,7 +875,7 @@ BOOL secrets_fetch_afs_key(const char *cell, struct afs_key *result)
 {
        fstring key;
        struct afs_keyfile *keyfile;
-       size_t size;
+       size_t size = 0;
        uint32 i;
 
        slprintf(key, sizeof(key)-1, "%s/%s", SECRETS_AFS_KEYFILE, cell);
index ce2a085f4787edae1ef8d406d6046f0382e8a8c1..3bd6977dbb1491626deaaef2073ff2f97d887812 100644 (file)
@@ -3317,7 +3317,7 @@ BOOL net_io_r_dsr_getdcname(const char *desc, NET_R_DSR_GETDCNAME *r_t,
        if (!prs_uint32("ptr_dc_address", ps, depth, &r_t->ptr_dc_address))
                return False;
 
-       if (!prs_uint32("dc_address_type", ps, depth, &r_t->dc_address_type))
+       if (!prs_int32("dc_address_type", ps, depth, &r_t->dc_address_type))
                return False;
 
        if (!smb_io_uuid("domain_guid", &r_t->domain_guid, ps, depth))
index 77f0e6d5c8865b8ff0afae4e59ac2d51536be6d6..7c84ee800b94031effd8b8172a0bd703c4db8d7e 100644 (file)
@@ -707,6 +707,35 @@ BOOL prs_uint32(const char *name, prs_struct *ps, int depth, uint32 *data32)
        return True;
 }
 
+/*******************************************************************
+ Stream an int32.
+ ********************************************************************/
+
+BOOL prs_int32(const char *name, prs_struct *ps, int depth, int32 *data32)
+{
+       char *q = prs_mem_get(ps, sizeof(int32));
+       if (q == NULL)
+               return False;
+
+       if (UNMARSHALLING(ps)) {
+               if (ps->bigendian_data)
+                       *data32 = RIVALS(q,0);
+               else
+                       *data32 = IVALS(q,0);
+       } else {
+               if (ps->bigendian_data)
+                       RSIVALS(q,0,*data32);
+               else
+                       SIVALS(q,0,*data32);
+       }
+
+       DEBUG(5,("%s%04x %s: %08x\n", tab_depth(depth), ps->data_offset, name, *data32));
+
+       ps->data_offset += sizeof(int32);
+
+       return True;
+}
+
 /*******************************************************************
  Stream a NTSTATUS
  ********************************************************************/
index 658928b92706a46269df40bb9acd3a8e29b6f4ad..a8b9c66717e75929a9288a632ea1d42c275200be 100644 (file)
@@ -56,7 +56,7 @@ static EVENTLOG_INFO *find_eventlog_info_by_hnd( pipes_struct * p,
 {
        EVENTLOG_INFO *info;
 
-       if ( !find_policy_by_hnd( p, handle, ( void ** ) &info ) ) {
+       if ( !find_policy_by_hnd( p, handle, (void **)(void *)&info ) ) {
                DEBUG( 2,
                       ( "find_eventlog_info_by_hnd: eventlog not found.\n" ) );
                return NULL;
index 15d420538ef11d8f957f44b5c2864d96e03da523..b56ae1091412b2554c2acbf007aeb983a4574424 100644 (file)
@@ -501,7 +501,7 @@ NTSTATUS _lsa_enum_trust_dom(pipes_struct *p, LSA_Q_ENUM_TRUST_DOM *q_u, LSA_R_E
        uint32 num_domains;
        NTSTATUS nt_status;
 
-       if (!find_policy_by_hnd(p, &q_u->pol, (void **)&info))
+       if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&info))
                return NT_STATUS_INVALID_HANDLE;
 
        /* check if the user have enough rights */
@@ -539,7 +539,7 @@ NTSTATUS _lsa_query_info(pipes_struct *p, LSA_Q_QUERY_INFO *q_u, LSA_R_QUERY_INF
 
        r_u->status = NT_STATUS_OK;
 
-       if (!find_policy_by_hnd(p, &q_u->pol, (void **)&handle))
+       if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&handle))
                return NT_STATUS_INVALID_HANDLE;
 
        switch (q_u->info_class) {
@@ -657,7 +657,7 @@ NTSTATUS _lsa_lookup_sids(pipes_struct *p, LSA_Q_LOOKUP_SIDS *q_u, LSA_R_LOOKUP_
        ref = TALLOC_ZERO_P(p->mem_ctx, DOM_R_REF);
        names = TALLOC_ZERO_P(p->mem_ctx, LSA_TRANS_NAME_ENUM);
 
-       if (!find_policy_by_hnd(p, &q_u->pol, (void **)&handle)) {
+       if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&handle)) {
                r_u->status = NT_STATUS_INVALID_HANDLE;
                goto done;
        }
@@ -706,7 +706,7 @@ NTSTATUS _lsa_lookup_names(pipes_struct *p,LSA_Q_LOOKUP_NAMES *q_u, LSA_R_LOOKUP
        ref = TALLOC_ZERO_P(p->mem_ctx, DOM_R_REF);
        rids = TALLOC_ZERO_ARRAY(p->mem_ctx, DOM_RID2, num_entries);
 
-       if (!find_policy_by_hnd(p, &q_u->pol, (void **)&handle)) {
+       if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&handle)) {
                r_u->status = NT_STATUS_INVALID_HANDLE;
                goto done;
        }
@@ -817,7 +817,7 @@ NTSTATUS _lsa_enum_privs(pipes_struct *p, LSA_Q_ENUM_PRIVS *q_u, LSA_R_ENUM_PRIV
        DEBUG(10,("_lsa_enum_privs: enum_context:%d total entries:%d\n", 
                enum_context, num_privs));
        
-       if (!find_policy_by_hnd(p, &q_u->pol, (void **)&handle))
+       if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&handle))
                return NT_STATUS_INVALID_HANDLE;
 
        /* check if the user have enough rights
@@ -864,7 +864,7 @@ NTSTATUS _lsa_priv_get_dispname(pipes_struct *p, LSA_Q_PRIV_GET_DISPNAME *q_u, L
        fstring name_asc;
        const char *description;
 
-       if (!find_policy_by_hnd(p, &q_u->pol, (void **)&handle))
+       if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&handle))
                return NT_STATUS_INVALID_HANDLE;
 
        /* check if the user have enough rights */
@@ -912,7 +912,7 @@ NTSTATUS _lsa_enum_accounts(pipes_struct *p, LSA_Q_ENUM_ACCOUNTS *q_u, LSA_R_ENU
        LSA_SID_ENUM *sids=&r_u->sids;
        NTSTATUS ret;
 
-       if (!find_policy_by_hnd(p, &q_u->pol, (void **)&handle))
+       if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&handle))
                return NT_STATUS_INVALID_HANDLE;
 
        if (!(handle->access & POLICY_VIEW_LOCAL_INFORMATION))
@@ -988,7 +988,7 @@ NTSTATUS _lsa_create_account(pipes_struct *p, LSA_Q_CREATEACCOUNT *q_u, LSA_R_CR
        struct lsa_info *info;
 
        /* find the connection policy handle. */
-       if (!find_policy_by_hnd(p, &q_u->pol, (void **)&handle))
+       if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&handle))
                return NT_STATUS_INVALID_HANDLE;
 
        /* check if the user have enough rights */
@@ -1036,7 +1036,7 @@ NTSTATUS _lsa_open_account(pipes_struct *p, LSA_Q_OPENACCOUNT *q_u, LSA_R_OPENAC
        struct lsa_info *info;
 
        /* find the connection policy handle. */
-       if (!find_policy_by_hnd(p, &q_u->pol, (void **)&handle))
+       if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&handle))
                return NT_STATUS_INVALID_HANDLE;
 
        /* check if the user have enough rights */
@@ -1079,7 +1079,7 @@ NTSTATUS _lsa_enum_privsaccount(pipes_struct *p, prs_struct *ps, LSA_Q_ENUMPRIVS
        PRIVILEGE_SET privileges;
 
        /* find the connection policy handle. */
-       if (!find_policy_by_hnd(p, &q_u->pol, (void **)&info))
+       if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&info))
                return NT_STATUS_INVALID_HANDLE;
 
        if ( !get_privileges_for_sids( &mask, &info->sid, 1 ) ) 
@@ -1114,7 +1114,7 @@ NTSTATUS _lsa_getsystemaccount(pipes_struct *p, LSA_Q_GETSYSTEMACCOUNT *q_u, LSA
 
        /* find the connection policy handle. */
 
-       if (!find_policy_by_hnd(p, &q_u->pol, (void **)&info))
+       if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&info))
                return NT_STATUS_INVALID_HANDLE;
 
        if (!lookup_sid(&info->sid, dom_name, name, &type))
@@ -1145,7 +1145,7 @@ NTSTATUS _lsa_setsystemaccount(pipes_struct *p, LSA_Q_SETSYSTEMACCOUNT *q_u, LSA
        r_u->status = NT_STATUS_OK;
 
        /* find the connection policy handle. */
-       if (!find_policy_by_hnd(p, &q_u->pol, (void **)&info))
+       if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&info))
                return NT_STATUS_INVALID_HANDLE;
 
        /* check to see if the pipe_user is a Domain Admin since 
@@ -1175,7 +1175,7 @@ NTSTATUS _lsa_addprivs(pipes_struct *p, LSA_Q_ADDPRIVS *q_u, LSA_R_ADDPRIVS *r_u
        struct current_user user;
 
        /* find the connection policy handle. */
-       if (!find_policy_by_hnd(p, &q_u->pol, (void **)&info))
+       if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&info))
                return NT_STATUS_INVALID_HANDLE;
                
        /* check to see if the pipe_user is root or a Domain Admin since 
@@ -1216,7 +1216,7 @@ NTSTATUS _lsa_removeprivs(pipes_struct *p, LSA_Q_REMOVEPRIVS *q_u, LSA_R_REMOVEP
        struct current_user user;
 
        /* find the connection policy handle. */
-       if (!find_policy_by_hnd(p, &q_u->pol, (void **)&info))
+       if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&info))
                return NT_STATUS_INVALID_HANDLE;
 
        /* check to see if the pipe_user is root or a Domain Admin since 
@@ -1259,7 +1259,7 @@ NTSTATUS _lsa_query_secobj(pipes_struct *p, LSA_Q_QUERY_SEC_OBJ *q_u, LSA_R_QUER
        r_u->status = NT_STATUS_OK;
 
        /* find the connection policy handle. */
-       if (!find_policy_by_hnd(p, &q_u->pol, (void **)&handle))
+       if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&handle))
                return NT_STATUS_INVALID_HANDLE;
 
        /* check if the user have enough rights */
@@ -1316,7 +1316,7 @@ NTSTATUS _lsa_query_info2(pipes_struct *p, LSA_Q_QUERY_INFO2 *q_u, LSA_R_QUERY_I
        ZERO_STRUCT(guid);
        r_u->status = NT_STATUS_OK;
 
-       if (!find_policy_by_hnd(p, &q_u->pol, (void **)&handle))
+       if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&handle))
                return NT_STATUS_INVALID_HANDLE;
 
        switch (q_u->info_class) {
@@ -1378,7 +1378,7 @@ NTSTATUS _lsa_add_acct_rights(pipes_struct *p, LSA_Q_ADD_ACCT_RIGHTS *q_u, LSA_R
        
 
        /* find the connection policy handle. */
-       if (!find_policy_by_hnd(p, &q_u->pol, (void **)&info))
+       if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&info))
                return NT_STATUS_INVALID_HANDLE;
                
        /* check to see if the pipe_user is a Domain Admin since 
@@ -1436,7 +1436,7 @@ NTSTATUS _lsa_remove_acct_rights(pipes_struct *p, LSA_Q_REMOVE_ACCT_RIGHTS *q_u,
        
 
        /* find the connection policy handle. */
-       if (!find_policy_by_hnd(p, &q_u->pol, (void **)&info))
+       if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&info))
                return NT_STATUS_INVALID_HANDLE;
                
        /* check to see if the pipe_user is a Domain Admin since 
@@ -1498,7 +1498,7 @@ NTSTATUS _lsa_enum_acct_rights(pipes_struct *p, LSA_Q_ENUM_ACCT_RIGHTS *q_u, LSA
 
        /* find the connection policy handle. */
        
-       if (!find_policy_by_hnd(p, &q_u->pol, (void **)&info))
+       if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&info))
                return NT_STATUS_INVALID_HANDLE;
                
        /* according to an NT4 PDC, you can add privileges to SIDs even without
@@ -1539,7 +1539,7 @@ NTSTATUS _lsa_lookup_priv_value(pipes_struct *p, LSA_Q_LOOKUP_PRIV_VALUE *q_u, L
        
        /* find the connection policy handle. */
        
-       if (!find_policy_by_hnd(p, &q_u->pol, (void **)&info))
+       if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&info))
                return NT_STATUS_INVALID_HANDLE;
                
        unistr2_to_ascii(name, &q_u->privname.unistring, sizeof(name));
index 35a060c38e3330bae1b0ca73747691656a2147f5..33711d0fac91386956c8ecf05d1b461a31ad4dfb 100644 (file)
@@ -54,7 +54,7 @@ static REGISTRY_KEY *find_regkey_index_by_hnd(pipes_struct *p, POLICY_HND *hnd)
 {
        REGISTRY_KEY *regkey = NULL;
 
-       if(!find_policy_by_hnd(p,hnd,(void **)&regkey)) {
+       if(!find_policy_by_hnd(p,hnd,(void **)(void *)&regkey)) {
                DEBUG(2,("find_regkey_index_by_hnd: Registry Key not found: "));
                return NULL;
        }
index 52b78d5e8dee214b14bcbcae6b9ee0b3d77bd86c..635d87076231817d9a38d155e0664081562b032f 100644 (file)
@@ -573,7 +573,7 @@ NTSTATUS _samr_open_domain(pipes_struct *p, SAMR_Q_OPEN_DOMAIN *q_u, SAMR_R_OPEN
 
        /* find the connection policy handle. */
        
-       if ( !find_policy_by_hnd(p, &q_u->pol, (void**)&info) )
+       if ( !find_policy_by_hnd(p, &q_u->pol, (void**)(void *)&info) )
                return NT_STATUS_INVALID_HANDLE;
 
        status = access_check_samr_function( info->acc_granted, 
@@ -627,7 +627,7 @@ NTSTATUS _samr_get_usrdom_pwinfo(pipes_struct *p, SAMR_Q_GET_USRDOM_PWINFO *q_u,
        r_u->status = NT_STATUS_OK;
 
        /* find the policy handle.  open a policy on it. */
-       if (!find_policy_by_hnd(p, &q_u->user_pol, (void **)&info))
+       if (!find_policy_by_hnd(p, &q_u->user_pol, (void **)(void *)&info))
                return NT_STATUS_INVALID_HANDLE;
 
        if (!sid_check_is_in_our_domain(&info->sid))
@@ -665,7 +665,7 @@ static BOOL get_lsa_policy_samr_sid( pipes_struct *p, POLICY_HND *pol,
        struct samr_info *info = NULL;
 
        /* find the policy handle.  open a policy on it. */
-       if (!find_policy_by_hnd(p, pol, (void **)&info))
+       if (!find_policy_by_hnd(p, pol, (void **)(void *)&info))
                return False;
 
        if (!info)
@@ -803,7 +803,7 @@ NTSTATUS _samr_enum_dom_users(pipes_struct *p, SAMR_Q_ENUM_DOM_USERS *q_u,
        r_u->status = NT_STATUS_OK;
 
        /* find the policy handle.  open a policy on it. */
-       if (!find_policy_by_hnd(p, &q_u->pol, (void **)&info))
+       if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&info))
                return NT_STATUS_INVALID_HANDLE;
 
        if (!NT_STATUS_IS_OK(r_u->status = access_check_samr_function(info->acc_granted, 
@@ -936,7 +936,7 @@ NTSTATUS _samr_enum_dom_groups(pipes_struct *p, SAMR_Q_ENUM_DOM_GROUPS *q_u, SAM
        r_u->status = NT_STATUS_OK;
 
        /* find the policy handle.  open a policy on it. */
-       if (!find_policy_by_hnd(p, &q_u->pol, (void **)&info))
+       if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&info))
                return NT_STATUS_INVALID_HANDLE;
 
        r_u->status = access_check_samr_function(info->acc_granted,
@@ -995,7 +995,7 @@ NTSTATUS _samr_enum_dom_aliases(pipes_struct *p, SAMR_Q_ENUM_DOM_ALIASES *q_u, S
        uint32 num_aliases = 0;
 
        /* find the policy handle.  open a policy on it. */
-       if (!find_policy_by_hnd(p, &q_u->pol, (void **)&info))
+       if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&info))
                return NT_STATUS_INVALID_HANDLE;
 
        r_u->status = access_check_samr_function(info->acc_granted,
@@ -1061,7 +1061,7 @@ NTSTATUS _samr_query_dispinfo(pipes_struct *p, SAMR_Q_QUERY_DISPINFO *q_u,
        r_u->status = NT_STATUS_UNSUCCESSFUL;
 
        /* find the policy handle.  open a policy on it. */
-       if (!find_policy_by_hnd(p, &q_u->domain_pol, (void **)&info))
+       if (!find_policy_by_hnd(p, &q_u->domain_pol, (void **)(void *)&info))
                return NT_STATUS_INVALID_HANDLE;
 
        /*
@@ -1857,7 +1857,7 @@ NTSTATUS _samr_query_userinfo(pipes_struct *p, SAMR_Q_QUERY_USERINFO *q_u, SAMR_
        r_u->status=NT_STATUS_OK;
 
        /* search for the handle */
-       if (!find_policy_by_hnd(p, &q_u->pol, (void **)&info))
+       if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&info))
                return NT_STATUS_INVALID_HANDLE;
 
        domain_sid = info->sid;
@@ -2094,7 +2094,7 @@ NTSTATUS _samr_query_dom_info(pipes_struct *p, SAMR_Q_QUERY_DOMAIN_INFO *q_u, SA
        DEBUG(5,("_samr_query_dom_info: %d\n", __LINE__));
        
        /* find the policy handle.  open a policy on it. */
-       if (!find_policy_by_hnd(p, &q_u->domain_pol, (void **)&info)) {
+       if (!find_policy_by_hnd(p, &q_u->domain_pol, (void **)(void *)&info)) {
                return NT_STATUS_INVALID_HANDLE;
        }
        
@@ -2165,7 +2165,11 @@ NTSTATUS _samr_query_dom_info(pipes_struct *p, SAMR_Q_QUERY_DOMAIN_INFO *q_u, SA
 
                        /* AS ROOT !!! */
 
-                       pdb_get_account_policy(AP_TIME_TO_LOGOUT, (unsigned int *)&u_logout);
+                       {
+                               uint32 ul;
+                               pdb_get_account_policy(AP_TIME_TO_LOGOUT, &ul);
+                               u_logout = (time_t)ul;
+                       }
 
                        /* !AS ROOT */
                        
@@ -2641,7 +2645,7 @@ NTSTATUS _samr_lookup_domain(pipes_struct *p, SAMR_Q_LOOKUP_DOMAIN *q_u, SAMR_R_
 
        r_u->status = NT_STATUS_OK;
 
-       if (!find_policy_by_hnd(p, &q_u->connect_pol, (void**)&info))
+       if (!find_policy_by_hnd(p, &q_u->connect_pol, (void**)(void *)&info))
                return NT_STATUS_INVALID_HANDLE;
 
        /* win9x user manager likes to use SA_RIGHT_SAM_ENUM_DOMAINS here.  
@@ -2717,7 +2721,7 @@ NTSTATUS _samr_enum_domains(pipes_struct *p, SAMR_Q_ENUM_DOMAINS *q_u, SAMR_R_EN
 
        r_u->status = NT_STATUS_OK;
        
-       if (!find_policy_by_hnd(p, &q_u->pol, (void**)&info))
+       if (!find_policy_by_hnd(p, &q_u->pol, (void**)(void *)&info))
                return NT_STATUS_INVALID_HANDLE;
        
        if (!NT_STATUS_IS_OK(r_u->status = access_check_samr_function(info->acc_granted, SA_RIGHT_SAM_ENUM_DOMAINS, "_samr_enum_domains"))) {
@@ -3418,7 +3422,7 @@ NTSTATUS _samr_query_useraliases(pipes_struct *p, SAMR_Q_QUERY_USERALIASES *q_u,
        DEBUG(5,("_samr_query_useraliases: %d\n", __LINE__));
 
        /* find the policy handle.  open a policy on it. */
-       if (!find_policy_by_hnd(p, &q_u->pol, (void **)&info))
+       if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&info))
                return NT_STATUS_INVALID_HANDLE;
                
        ntstatus1 = access_check_samr_function(info->acc_granted, SA_RIGHT_DOMAIN_LOOKUP_ALIAS_BY_MEM, "_samr_query_useraliases");
@@ -4704,7 +4708,7 @@ NTSTATUS _samr_query_domain_info2(pipes_struct *p,
        DEBUG(5,("_samr_query_domain_info2: %d\n", __LINE__));
 
        /* find the policy handle.  open a policy on it. */
-       if (!find_policy_by_hnd(p, &q_u->domain_pol, (void **)&info))
+       if (!find_policy_by_hnd(p, &q_u->domain_pol, (void **)(void *)&info))
                return NT_STATUS_INVALID_HANDLE;
 
        switch (q_u->switch_value) {
index f0ba863b4d706676d1e6e973c67348675dba8127..334158bbbd2b0ff533ee467b3aaa3d59216571b7 100644 (file)
@@ -267,7 +267,7 @@ static Printer_entry *find_printer_index_by_hnd(pipes_struct *p, POLICY_HND *hnd
 {
        Printer_entry *find_printer = NULL;
 
-       if(!find_policy_by_hnd(p,hnd,(void **)&find_printer)) {
+       if(!find_policy_by_hnd(p,hnd,(void **)(void *)&find_printer)) {
                DEBUG(2,("find_printer_index_by_hnd: Printer handle not found: "));
                return NULL;
        }
index 19648f5e78bc87220d21e91b5d2b47a486bbbcaa..bbf313f7fa1a0a0e53d6fe0ea3e78f0a584fa3c8 100644 (file)
@@ -186,7 +186,7 @@ static SERVICE_INFO *find_service_info_by_hnd(pipes_struct *p, POLICY_HND *hnd)
 {
        SERVICE_INFO *service_info = NULL;
 
-       if( !find_policy_by_hnd( p, hnd, (void **)&service_info) ) {
+       if( !find_policy_by_hnd( p, hnd, (void **)(void *)&service_info) ) {
                DEBUG(2,("find_service_info_by_hnd: handle not found"));
                return NULL;
        }
index e975da3e1530e16bde6b588fd11de64f121eb160..fd28df0d801fa2aeab2c715d8a20d7f5d45f82dd 100644 (file)
@@ -65,7 +65,7 @@ static void msg_deliver(void)
    * Incoming message is in DOS codepage format. Convert to UNIX.
    */
   
-  if ((len = (int)convert_string_allocate(NULL,CH_DOS, CH_UNIX, msgbuf, msgpos, (void **) &msg, True)) < 0 || !msg) {
+  if ((len = (int)convert_string_allocate(NULL,CH_DOS, CH_UNIX, msgbuf, msgpos, (void **)(void *)&msg, True)) < 0 || !msg) {
     DEBUG(3,("Conversion failed, delivering message in DOS codepage format\n"));
     for (i = 0; i < msgpos;) {
       if (msgbuf[i] == '\r' && i < (msgpos-1) && msgbuf[i+1] == '\n') {