use int2HDBFlags/HDBFlags2int
From: Alberto Patino <jalbertop@aranea.com.mx>, Luke Howard <lukeh@PADL.COM> Pointed out by Andrew Bartlett of Samba git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12379 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -421,12 +421,10 @@ LDAP_entry2mods(krb5_context context, HDB * db, hdb_entry * ent,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(&oflags, 0, sizeof(oflags));
|
oflags = HDBFlags2int(orig.flags);
|
||||||
memcpy(&oflags, &orig.flags, sizeof(HDBFlags));
|
nflags = HDBFlags2int(ent->flags);
|
||||||
memset(&nflags, 0, sizeof(nflags));
|
|
||||||
memcpy(&nflags, &ent->flags, sizeof(HDBFlags));
|
|
||||||
|
|
||||||
if (memcmp(&oflags, &nflags, sizeof(HDBFlags))) {
|
if (oflags != nflags) {
|
||||||
rc = asprintf(&tmp, "%lu", nflags);
|
rc = asprintf(&tmp, "%lu", nflags);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
krb5_set_error_string(context, "asprintf: out of memory");
|
krb5_set_error_string(context, "asprintf: out of memory");
|
||||||
@@ -629,7 +627,7 @@ LDAP_message2entry(krb5_context context, HDB * db, LDAPMessage * msg,
|
|||||||
char **values;
|
char **values;
|
||||||
|
|
||||||
memset(ent, 0, sizeof(*ent));
|
memset(ent, 0, sizeof(*ent));
|
||||||
memset(&ent->flags, 0, sizeof(HDBFlags));
|
ent->flags = int2HDBFlags(0);
|
||||||
|
|
||||||
ret =
|
ret =
|
||||||
LDAP_get_string_value(db, msg, "krb5PrincipalName",
|
LDAP_get_string_value(db, msg, "krb5PrincipalName",
|
||||||
@@ -801,7 +799,7 @@ LDAP_message2entry(krb5_context context, HDB * db, LDAPMessage * msg,
|
|||||||
} else {
|
} else {
|
||||||
tmp = 0;
|
tmp = 0;
|
||||||
}
|
}
|
||||||
memcpy(&ent->flags, &tmp, sizeof(HDBFlags));
|
ent->flags = int2HDBFlags(tmp);
|
||||||
|
|
||||||
values = ldap_get_values((LDAP *) db->db, msg, "krb5EncryptionType");
|
values = ldap_get_values((LDAP *) db->db, msg, "krb5EncryptionType");
|
||||||
if (values != NULL) {
|
if (values != NULL) {
|
||||||
|
Reference in New Issue
Block a user