summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/client/clitar.c2
-rw-r--r--source3/libads/ldap.c12
-rw-r--r--source3/libads/sasl.c4
-rw-r--r--source3/rpcclient/cmd_samr.c2
-rw-r--r--source3/utils/net_ads.c6
-rw-r--r--source3/web/swat.c2
-rw-r--r--source3/winbindd/wb_lookupuseraliases.c2
-rw-r--r--source3/winbindd/winbindd_cache.c4
-rw-r--r--source3/winbindd/winbindd_dual.c4
-rw-r--r--source3/winbindd/winbindd_pam.c6
10 files changed, 22 insertions, 22 deletions
diff --git a/source3/client/clitar.c b/source3/client/clitar.c
index 80968a64d7..efbe5ff47f 100644
--- a/source3/client/clitar.c
+++ b/source3/client/clitar.c
@@ -101,7 +101,7 @@ char tar_type='\0';
static char **cliplist=NULL;
static int clipn=0;
static bool must_free_cliplist = False;
-extern const char *cmd_ptr;
+extern char *cmd_ptr;
extern bool lowercase;
extern uint16 cnum;
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index de3ad5aa77..893e1411f0 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -940,21 +940,21 @@ static ADS_STATUS ads_do_paged_search_args(ADS_STRUCT *ads,
ber_printf(cookie_be, "{io}", (ber_int_t) 1000, "", 0);
}
ber_flatten(cookie_be, &cookie_bv);
- PagedResults.ldctl_oid = CONST_DISCARD(char *, ADS_PAGE_CTL_OID);
+ PagedResults.ldctl_oid = discard_const_p(char, ADS_PAGE_CTL_OID);
PagedResults.ldctl_iscritical = (char) 1;
PagedResults.ldctl_value.bv_len = cookie_bv->bv_len;
PagedResults.ldctl_value.bv_val = cookie_bv->bv_val;
- NoReferrals.ldctl_oid = CONST_DISCARD(char *, ADS_NO_REFERRALS_OID);
+ NoReferrals.ldctl_oid = discard_const_p(char, ADS_NO_REFERRALS_OID);
NoReferrals.ldctl_iscritical = (char) 0;
NoReferrals.ldctl_value.bv_len = 0;
- NoReferrals.ldctl_value.bv_val = CONST_DISCARD(char *, "");
+ NoReferrals.ldctl_value.bv_val = discard_const_p(char, "");
if (external_control &&
(strequal(external_control->control, ADS_EXTENDED_DN_OID) ||
strequal(external_control->control, ADS_SD_FLAGS_OID))) {
- ExternalCtrl.ldctl_oid = CONST_DISCARD(char *, external_control->control);
+ ExternalCtrl.ldctl_oid = discard_const_p(char, external_control->control);
ExternalCtrl.ldctl_iscritical = (char) external_control->critical;
/* win2k does not accept a ldctl_value beeing passed in */
@@ -1524,7 +1524,7 @@ ADS_STATUS ads_gen_mod(ADS_STRUCT *ads, const char *mod_dn, ADS_MODLIST mods)
non-existent attribute (but allowable for the object) to run
*/
LDAPControl PermitModify = {
- CONST_DISCARD(char *, ADS_PERMIT_MODIFY_OID),
+ discard_const_p(char, ADS_PERMIT_MODIFY_OID),
{0, NULL},
(char) 1};
LDAPControl *controls[2];
@@ -3485,7 +3485,7 @@ ADS_STATUS ads_leave_realm(ADS_STRUCT *ads, const char *hostname)
pldap_control[0] = &ldap_control;
memset(&ldap_control, 0, sizeof(LDAPControl));
- ldap_control.ldctl_oid = (char *)LDAP_SERVER_TREE_DELETE_OID;
+ ldap_control.ldctl_oid = discard_const_p(char, LDAP_SERVER_TREE_DELETE_OID);
/* hostname must be lowercase */
host = SMB_STRDUP(hostname);
diff --git a/source3/libads/sasl.c b/source3/libads/sasl.c
index e7daa8aec6..8b2dbad434 100644
--- a/source3/libads/sasl.c
+++ b/source3/libads/sasl.c
@@ -388,7 +388,7 @@ static ADS_STATUS ads_sasl_spnego_gsskrb5_bind(ADS_STRUCT *ads, const gss_name_t
uint32 minor_status;
int gss_rc, rc;
gss_OID_desc krb5_mech_type =
- {9, CONST_DISCARD(char *, "\x2a\x86\x48\x86\xf7\x12\x01\x02\x02") };
+ {9, discard_const_p(char, "\x2a\x86\x48\x86\xf7\x12\x01\x02\x02") };
gss_OID mech_type = &krb5_mech_type;
gss_OID actual_mech_type = GSS_C_NULL_OID;
const char *spnego_mechs[] = {OID_KERBEROS5_OLD, OID_KERBEROS5, OID_NTLMSSP, NULL};
@@ -722,7 +722,7 @@ static ADS_STATUS ads_generate_service_principal(ADS_STRUCT *ads,
gss_buffer_desc input_name;
/* GSS_KRB5_NT_PRINCIPAL_NAME */
gss_OID_desc nt_principal =
- {10, CONST_DISCARD(char *, "\x2a\x86\x48\x86\xf7\x12\x01\x02\x02\x01")};
+ {10, discard_const_p(char, "\x2a\x86\x48\x86\xf7\x12\x01\x02\x02\x01")};
uint32 minor_status;
int gss_rc;
#endif
diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c
index 727c9d1456..fdad158efe 100644
--- a/source3/rpcclient/cmd_samr.c
+++ b/source3/rpcclient/cmd_samr.c
@@ -295,7 +295,7 @@ static NTSTATUS get_domain_handle(struct rpc_pipe_client *cli,
status = dcerpc_samr_OpenDomain(b, mem_ctx,
connect_pol,
access_mask,
- CONST_DISCARD(struct dom_sid2 *, &global_sid_Builtin),
+ discard_const_p(struct dom_sid2, &global_sid_Builtin),
domain_pol,
&result);
}
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index 3619ac339b..a966e5dd63 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -155,7 +155,7 @@ static int net_ads_lookup(struct net_context *c, int argc, const char **argv)
}
if (!ads->config.realm) {
- ads->config.realm = CONST_DISCARD(char *, c->opt_target_workgroup);
+ ads->config.realm = discard_const_p(char, c->opt_target_workgroup);
ads->ldap.port = 389;
}
@@ -401,7 +401,7 @@ static int net_ads_workgroup(struct net_context *c, int argc, const char **argv)
}
if (!ads->config.realm) {
- ads->config.realm = CONST_DISCARD(char *, c->opt_target_workgroup);
+ ads->config.realm = discard_const_p(char, c->opt_target_workgroup);
ads->ldap.port = 389;
}
@@ -2023,7 +2023,7 @@ static int net_ads_password(struct net_context *c, int argc, const char **argv)
const char *auth_principal = c->opt_user_name;
const char *auth_password = c->opt_password;
char *realm = NULL;
- char *new_password = NULL;
+ const char *new_password = NULL;
char *chr, *prompt;
const char *user;
ADS_STATUS ret;
diff --git a/source3/web/swat.c b/source3/web/swat.c
index f06bf5ed26..392b7131d8 100644
--- a/source3/web/swat.c
+++ b/source3/web/swat.c
@@ -83,7 +83,7 @@ static char *fix_backslash(const char *str)
return newstring;
}
-static const char *fix_quotes(TALLOC_CTX *ctx, const char *str)
+static const char *fix_quotes(TALLOC_CTX *ctx, char *str)
{
char *newstring = NULL;
char *p = NULL;
diff --git a/source3/winbindd/wb_lookupuseraliases.c b/source3/winbindd/wb_lookupuseraliases.c
index f6fe855a85..5e7eb1c33c 100644
--- a/source3/winbindd/wb_lookupuseraliases.c
+++ b/source3/winbindd/wb_lookupuseraliases.c
@@ -44,7 +44,7 @@ struct tevent_req *wb_lookupuseraliases_send(TALLOC_CTX *mem_ctx,
return NULL;
}
state->sids.num_sids = num_sids;
- state->sids.sids = CONST_DISCARD(struct dom_sid *, sids);
+ state->sids.sids = discard_const_p(struct dom_sid, sids);
subreq = dcerpc_wbint_LookupUserAliases_send(
state, ev, dom_child_handle(domain), &state->sids, &state->rids);
diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c
index 68a86257da..4fa2375152 100644
--- a/source3/winbindd/winbindd_cache.c
+++ b/source3/winbindd/winbindd_cache.c
@@ -1856,8 +1856,8 @@ static NTSTATUS name_to_sid(struct winbindd_domain *domain,
/* Only save the reverse mapping if this was not a UPN */
if (!strchr(name, '@')) {
- strupper_m(CONST_DISCARD(char *,domain_name));
- strlower_m(CONST_DISCARD(char *,name));
+ strupper_m(discard_const_p(char, domain_name));
+ strlower_m(discard_const_p(char, name));
wcache_save_sid_to_name(domain, status, sid, domain_name, name, *type);
}
}
diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c
index 1078f8d374..daa8d70d79 100644
--- a/source3/winbindd/winbindd_dual.c
+++ b/source3/winbindd/winbindd_dual.c
@@ -746,7 +746,7 @@ void winbind_msg_onlinestatus(struct messaging_context *msg_ctx,
}
messaging_send_buf(msg_ctx, *sender, MSG_WINBIND_ONLINESTATUS,
- (uint8 *)message, strlen(message) + 1);
+ (const uint8 *)message, strlen(message) + 1);
talloc_destroy(mem_ctx);
}
@@ -823,7 +823,7 @@ void winbind_msg_dump_domain_list(struct messaging_context *msg_ctx,
messaging_send_buf(msg_ctx, *sender,
MSG_WINBIND_DUMP_DOMAIN_LIST,
- (uint8_t *)message, strlen(message) + 1);
+ (const uint8_t *)message, strlen(message) + 1);
talloc_destroy(mem_ctx);
diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c
index 93c691b13b..e1422e5cce 100644
--- a/source3/winbindd/winbindd_pam.c
+++ b/source3/winbindd/winbindd_pam.c
@@ -385,9 +385,9 @@ static void fill_in_password_policy(struct winbindd_response *r,
r->data.auth.policy.password_properties =
p->password_properties;
r->data.auth.policy.expire =
- nt_time_to_unix_abs((NTTIME *)&(p->max_password_age));
+ nt_time_to_unix_abs((const NTTIME *)&(p->max_password_age));
r->data.auth.policy.min_passwordage =
- nt_time_to_unix_abs((NTTIME *)&(p->min_password_age));
+ nt_time_to_unix_abs((const NTTIME *)&(p->min_password_age));
}
static NTSTATUS fillup_password_policy(struct winbindd_domain *domain,
@@ -2135,7 +2135,7 @@ enum winbindd_result winbindd_dual_pam_chng_pswd_auth_crap(struct winbindd_domai
}
if (!*domain && lp_winbind_use_default_domain()) {
- fstrcpy(domain,(char *)lp_workgroup());
+ fstrcpy(domain,lp_workgroup());
}
if(!*user) {