Due to the fact that db4 is incredibly fragile in the fact of abnormal
termination and that Apache (and presumably other web servers) will
merrily kill CGI as and when they see fit, we need to try and catch any
signal we can and clean ourselves up.
PROGS = add lookup gpgwww onak splitkeys onak-mail.pl
CORE_OBJS = armor.o charfuncs.o decodekey.o getcgi.o hash.o keydb_$(DBTYPE).o \
keyid.o keyindex.o ll.o mem.o onak-conf.o parsekey.o sha1.o md5.o \
PROGS = add lookup gpgwww onak splitkeys onak-mail.pl
CORE_OBJS = armor.o charfuncs.o decodekey.o getcgi.o hash.o keydb_$(DBTYPE).o \
keyid.o keyindex.o ll.o mem.o onak-conf.o parsekey.o sha1.o md5.o \
- log.o photoid.o wordlist.o
+ log.o photoid.o wordlist.o cleanup.o
OBJS = merge.o stats.o sendsync.o cleankey.o $(CORE_OBJS)
SRCS = armor.c parsekey.c merge.c keyid.c md5.c sha1.c main.c getcgi.c mem.c \
keyindex.c stats.c lookup.c add.c keydb_$(DBTYPE).c ll.c hash.c \
gpgwww.c onak-conf.c charfuncs.c sendsync.c log.c photoid.c \
OBJS = merge.o stats.o sendsync.o cleankey.o $(CORE_OBJS)
SRCS = armor.c parsekey.c merge.c keyid.c md5.c sha1.c main.c getcgi.c mem.c \
keyindex.c stats.c lookup.c add.c keydb_$(DBTYPE).c ll.c hash.c \
gpgwww.c onak-conf.c charfuncs.c sendsync.c log.c photoid.c \
+ wordlist.c cleankey.c cleanup.c
all: .depend $(PROGS) testparse maxpath sixdegrees splitkeys
all: .depend $(PROGS) testparse maxpath sixdegrees splitkeys
#include "armor.h"
#include "cleankey.h"
#include "armor.h"
#include "cleankey.h"
#include "charfuncs.h"
#include "getcgi.h"
#include "keydb.h"
#include "charfuncs.h"
#include "getcgi.h"
#include "keydb.h"
end_html();
fclose(stdout);
fclose(stderr);
end_html();
fclose(stdout);
fclose(stderr);
initdb(false);
count = cleankeys(keys);
initdb(false);
count = cleankeys(keys);
count);
count = update_keys(&keys);
count);
count = update_keys(&keys);
- printf("Got %d new keys.\n", count);
logthing(LOGTHING_NOTICE, "Got %d new keys.",
count);
if (keys != NULL) {
logthing(LOGTHING_NOTICE, "Got %d new keys.",
count);
if (keys != NULL) {
#include "armor.h"
#include "charfuncs.h"
#include "armor.h"
#include "charfuncs.h"
#include "getcgi.h"
#include "hash.h"
#include "keydb.h"
#include "getcgi.h"
#include "hash.h"
#include "keydb.h"
- while (pathlen < count) {
+ while ((!cleanup()) && (pathlen < count)) {
/*
* Fill the tree info up.
*/
/*
* Fill the tree info up.
*/
readconfig(NULL);
initlogthing("gpgwww", config.logfile);
readconfig(NULL);
initlogthing("gpgwww", config.logfile);
initdb(true);
inithash();
logthing(LOGTHING_NOTICE, "Looking for path from 0x%llX to 0x%llX.",
initdb(true);
inithash();
logthing(LOGTHING_NOTICE, "Looking for path from 0x%llX to 0x%llX.",
#include "armor.h"
#include "charfuncs.h"
#include "cleankey.h"
#include "armor.h"
#include "charfuncs.h"
#include "cleankey.h"
#include "getcgi.h"
#include "keydb.h"
#include "keyindex.h"
#include "getcgi.h"
#include "keydb.h"
#include "keyindex.h"
} else {
readconfig(NULL);
initlogthing("lookup", config.logfile);
} else {
readconfig(NULL);
initlogthing("lookup", config.logfile);
initdb(true);
switch (op) {
case OP_GET:
initdb(true);
switch (op) {
case OP_GET:
#include "armor.h"
#include "charfuncs.h"
#include "cleankey.h"
#include "armor.h"
#include "charfuncs.h"
#include "cleankey.h"
#include "keydb.h"
#include "keyid.h"
#include "keyindex.h"
#include "keydb.h"
#include "keyid.h"
#include "keyindex.h"
readconfig(configfile);
initlogthing("onak", config.logfile);
readconfig(configfile);
initlogthing("onak", config.logfile);
if ((argc - optind) < 1) {
usage();
if ((argc - optind) < 1) {
usage();
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
#include "getcgi.h"
#include "hash.h"
#include "keydb.h"
#include "getcgi.h"
#include "hash.h"
#include "keydb.h"
keys = lladd(NULL, want);
oldkeys = keys;
keys = lladd(NULL, want);
oldkeys = keys;
- while (keys != NULL && have->colour == 0) {
+ while ((!cleanup()) && keys != NULL && have->colour == 0) {
sigs = cached_getkeysigs(((struct stats_key *)
keys->object)->keyid);
sigs = cached_getkeysigs(((struct stats_key *)
keys->object)->keyid);
- while (sigs != NULL && have->colour == 0) {
+ while ((!cleanup()) && sigs != NULL && have->colour == 0) {
/*
* Check if we've seen this key before and if not mark
* it and add its sigs to the list we want to look at.
/*
* Check if we've seen this key before and if not mark
* it and add its sigs to the list we want to look at.
- while (pathnum < count) {
+ while ((!cleanup()) && (pathnum < count)) {
/*
* Fill the tree info up.
*/
/*
* Fill the tree info up.
*/