diff options
author | Gerald Carter <jerry@samba.org> | 2005-04-12 00:37:55 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2005-04-12 00:37:55 +0000 |
commit | f0f7108060652a3f0d1b5ca4783cf62cd84fac12 (patch) | |
tree | 8b23f45f7547544c863d9c29f3ae4eba2882ff4b /source/libads | |
parent | dae1a1db3c946093333d9e5001e30f75140fd3ca (diff) | |
download | samba-f0f7108060652a3f0d1b5ca4783cf62cd84fac12.tar.gz samba-f0f7108060652a3f0d1b5ca4783cf62cd84fac12.tar.xz samba-f0f7108060652a3f0d1b5ca4783cf62cd84fac12.zip |
r6303: Setting up for 3.0.15pre1
current as of r6296
Diffstat (limited to 'source/libads')
-rw-r--r-- | source/libads/kerberos.c | 3 | ||||
-rw-r--r-- | source/libads/ldap.c | 21 | ||||
-rw-r--r-- | source/libads/ldap_printer.c | 6 | ||||
-rw-r--r-- | source/libads/sasl.c | 9 |
4 files changed, 22 insertions, 17 deletions
diff --git a/source/libads/kerberos.c b/source/libads/kerberos.c index 4c9997e080e..18820d9e312 100644 --- a/source/libads/kerberos.c +++ b/source/libads/kerberos.c @@ -88,7 +88,8 @@ int kerberos_kinit_password(const char *principal, return code; } - if ((code = krb5_get_init_creds_password(ctx, &my_creds, me, password, + if ((code = krb5_get_init_creds_password(ctx, &my_creds, me, + CONST_DISCARD(char *, password), kerb_prompter, NULL, 0, NULL, NULL))) { krb5_free_principal(ctx, me); diff --git a/source/libads/ldap.c b/source/libads/ldap.c index 6e1b011c37c..7a59da5a6d3 100644 --- a/source/libads/ldap.c +++ b/source/libads/ldap.c @@ -481,15 +481,15 @@ ADS_STATUS ads_do_paged_search(ADS_STRUCT *ads, const char *bind_path, ber_printf(cookie_be, "{io}", (ber_int_t) 1000, "", 0); } ber_flatten(cookie_be, &cookie_bv); - PagedResults.ldctl_oid = ADS_PAGE_CTL_OID; + PagedResults.ldctl_oid = CONST_DISCARD(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 = ADS_NO_REFERRALS_OID; + NoReferrals.ldctl_oid = CONST_DISCARD(char *, ADS_NO_REFERRALS_OID); NoReferrals.ldctl_iscritical = (char) 0; NoReferrals.ldctl_value.bv_len = 0; - NoReferrals.ldctl_value.bv_val = ""; + NoReferrals.ldctl_value.bv_val = CONST_DISCARD(char *, ""); controls[0] = &NoReferrals; @@ -831,7 +831,7 @@ ADS_MODLIST ads_init_mods(TALLOC_CTX *ctx) need to reset it to NULL before doing ldap modify */ mods[ADS_MODLIST_ALLOC_SIZE] = (LDAPMod *) -1; - return mods; + return (ADS_MODLIST)mods; } @@ -868,7 +868,7 @@ static ADS_STATUS ads_modlist_add(TALLOC_CTX *ctx, ADS_MODLIST *mods, memset(&modlist[curmod], 0, ADS_MODLIST_ALLOC_SIZE*sizeof(LDAPMod *)); modlist[curmod+ADS_MODLIST_ALLOC_SIZE] = (LDAPMod *) -1; - *mods = modlist; + *mods = (ADS_MODLIST)modlist; } if (!(modlist[curmod] = TALLOC_ZERO_P(ctx, LDAPMod))) @@ -962,7 +962,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 = { - ADS_PERMIT_MODIFY_OID, + CONST_DISCARD(char *, ADS_PERMIT_MODIFY_OID), {0, NULL}, (char) 1}; LDAPControl *controls[2]; @@ -1006,7 +1006,7 @@ ADS_STATUS ads_gen_add(ADS_STRUCT *ads, const char *new_dn, ADS_MODLIST mods) /* make sure the end of the list is NULL */ mods[i] = NULL; - ret = ldap_add_s(ads->ld, utf8_dn, mods); + ret = ldap_add_s(ads->ld, utf8_dn, (LDAPMod**)mods); SAFE_FREE(utf8_dn); return ADS_ERROR(ret); } @@ -1267,7 +1267,7 @@ ADS_STATUS ads_add_service_principal_name(ADS_STRUCT *ads, const char *machine_n ADS_STATUS ret; TALLOC_CTX *ctx; LDAPMessage *res = NULL; - char *host_spn, *host_upn, *psp1, *psp2, *psp3; + char *host_spn, *psp1, *psp2, *psp3; ADS_MODLIST mods; fstring my_fqdn; char *dn_string = NULL; @@ -1297,11 +1297,6 @@ ADS_STATUS ads_add_service_principal_name(ADS_STRUCT *ads, const char *machine_n ads_msgfree(ads, res); return ADS_ERROR(LDAP_NO_SUCH_OBJECT); } - if (!(host_upn = talloc_asprintf(ctx, "%s@%s", host_spn, ads->config.realm))) { - talloc_destroy(ctx); - ads_msgfree(ads, res); - return ADS_ERROR(LDAP_NO_SUCH_OBJECT); - } /* Add the extra principal */ psp1 = talloc_asprintf(ctx, "%s/%s", spn, machine_name); diff --git a/source/libads/ldap_printer.c b/source/libads/ldap_printer.c index 68e67358910..61275e40d11 100644 --- a/source/libads/ldap_printer.c +++ b/source/libads/ldap_printer.c @@ -61,8 +61,10 @@ ADS_STATUS ads_find_printers(ADS_STRUCT *ads, void **res) /* For the moment only display all printers */ - ldap_expr = "(&(!(showInAdvancedViewOnly=TRUE))(uncName=*)" - "(objectCategory=printQueue))"; + ldap_expr = + CONST_DISCARD(char *, + "(&(!(showInAdvancedViewOnly=TRUE))(uncName=*)" + "(objectCategory=printQueue))"); return ads_search(ads, res, ldap_expr, attrs); } diff --git a/source/libads/sasl.c b/source/libads/sasl.c index 97ba9c92862..e657f2114e6 100644 --- a/source/libads/sasl.c +++ b/source/libads/sasl.c @@ -18,6 +18,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#define KRB5_PRIVATE 1 /* this file uses PRIVATE interfaces! */ + #include "includes.h" #ifdef HAVE_LDAP @@ -173,7 +175,9 @@ static ADS_STATUS ads_sasl_spnego_bind(ADS_STRUCT *ads) DATA_BLOB blob; char *principal = NULL; char *OIDs[ASN1_MAX_OIDS]; +#ifdef HAVE_KRB5 BOOL got_kerberos_mechanism = False; +#endif rc = ldap_sasl_bind_s(ads->ld, NULL, "GSS-SPNEGO", NULL, NULL, NULL, &scred); @@ -202,10 +206,12 @@ static ADS_STATUS ads_sasl_spnego_bind(ADS_STRUCT *ads) /* make sure the server understands kerberos */ for (i=0;OIDs[i];i++) { DEBUG(3,("ads_sasl_spnego_bind: got OID=%s\n", OIDs[i])); +#ifdef HAVE_KRB5 if (strcmp(OIDs[i], OID_KERBEROS5_OLD) == 0 || strcmp(OIDs[i], OID_KERBEROS5) == 0) { got_kerberos_mechanism = True; } +#endif free(OIDs[i]); } DEBUG(3,("ads_sasl_spnego_bind: got server principal name =%s\n", principal)); @@ -281,7 +287,8 @@ static ADS_STATUS ads_sasl_gssapi_bind(ADS_STRUCT *ads) ENCTYPE_DES_CBC_MD5, ENCTYPE_NULL}; gss_OID_desc nt_principal = - {10, "\052\206\110\206\367\022\001\002\002\002"}; + {10, CONST_DISCARD(char *, + "\052\206\110\206\367\022\001\002\002\002")}; /* we need to fetch a service ticket as the ldap user in the servers realm, regardless of our realm */ |