From db68c286df6637598a402cf82f2a84cb7023ad07 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sun, 11 Oct 2009 03:45:23 +0000 Subject: [PATCH] * Yup, that's it ... the expression (long)*(cdboi->ptr) does NOT work reliably for copying the first (sizeof long) bytes in all cases. This is what was causing lots of OpenID associations to get deleted, on Uncensored and possibly elsewhere. Fixed in serv_expire.c ... must also begin looking elsewhere for this. --- citadel/modules/expire/serv_expire.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/citadel/modules/expire/serv_expire.c b/citadel/modules/expire/serv_expire.c index 32b6d270c..ab1d3a359 100644 --- a/citadel/modules/expire/serv_expire.c +++ b/citadel/modules/expire/serv_expire.c @@ -806,6 +806,7 @@ int PurgeStaleOpenIDassociations(void) { void *Value; const char *Key; int num_deleted = 0; + long usernum = 0L; keys = NewHash(1, NULL); if (!keys) return(0); @@ -814,15 +815,7 @@ int PurgeStaleOpenIDassociations(void) { cdb_rewind(CDB_OPENID); while (cdboi = cdb_next_item(CDB_OPENID), cdboi != NULL) { if (cdboi->len > sizeof(long)) { - long usernum; - usernum = ((long)*(cdboi->ptr)); - /* FIXME two different things here, trying to figure out whether this is the - * source of a bug. - */ - CtdlLogPrintf(CTDL_DEBUG, "#1 Evaluating openid association for user %ld\n", usernum); - usernum = 0; memcpy(&usernum, cdboi->ptr, sizeof(long)); - CtdlLogPrintf(CTDL_DEBUG, "#2 Evaluating openid association for user %ld\n", usernum); if (getuserbynumber(&usbuf, usernum) != 0) { deleteme = strdup(cdboi->ptr + sizeof(long)), Put(keys, deleteme, strlen(deleteme), deleteme, generic_free_handler); -- 2.30.2