[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Heimdal PATCH] LDAP backend support for OpenLDAP 2.1.x




Here's a similar patch with consistent indenting.

-- Luke

Index: hdb-ldap.c
===================================================================
RCS file: /home/project/cvs/heimdal/lib/hdb/hdb-ldap.c,v
retrieving revision 1.8
diff -u -r1.8 hdb-ldap.c
--- hdb-ldap.c	2003/05/28 11:11:44	1.8
+++ hdb-ldap.c	2003/06/12 11:10:57
@@ -421,12 +421,10 @@
 	}
     }
 
-    memset(&oflags, 0, sizeof(oflags));
-    memcpy(&oflags, &orig.flags, sizeof(HDBFlags));
-    memset(&nflags, 0, sizeof(nflags));
-    memcpy(&nflags, &ent->flags, sizeof(HDBFlags));
-
-    if (memcmp(&oflags, &nflags, sizeof(HDBFlags))) {
+    oflags = HDBFlags2int(orig.flags);
+    nflags = HDBFlags2int(ent->flags);
+   
+    if (oflags != nflags) {
 	rc = asprintf(&tmp, "%lu", nflags);
 	if (rc < 0) {
 	    krb5_set_error_string(context, "asprintf: out of memory");
@@ -801,7 +799,7 @@
     } else {
 	tmp = 0;
     }
-    memcpy(&ent->flags, &tmp, sizeof(HDBFlags));
+    ent->flags = int2HDBFlags(tmp);
 
     values = ldap_get_values((LDAP *) db->db, msg, "krb5EncryptionType");
     if (values != NULL) {
--
Luke Howard | PADL Software Pty Ltd | www.padl.com