From 4656d65034eae549c3b63e37b708e63ad55a0b1b Mon Sep 17 00:00:00 2001 From: zacheiss Date: Thu, 2 Jan 2003 01:06:34 +0000 Subject: [PATCH] Revert incremental code until we actually have an incremental (not yet) and tweak name sanity checks a bit more. --- server/increment.pc | 20 ++++---------------- server/qsetup.pc | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/server/increment.pc b/server/increment.pc index 7f803aee..cf30ddda 100644 --- a/server/increment.pc +++ b/server/increment.pc @@ -197,15 +197,9 @@ void incremental_before(enum tables table, char *qual, char **argv) case LIST_TABLE: sprintf(stmt_buf, "SELECT l.name, l.active, l.publicflg, l.hidden, " "l.maillist, l.grouplist, l.gid, l.acl_type, l.acl_id, " - "l.description, l.list_id, l.mailman, l.mailman_id " - "FROM list l WHERE %s", qual); + "l.description, l.list_id FROM list l WHERE %s", qual); dosql(before); - name = xmalloc(0); - id = atoi(before[12]); - id_to_name(id, MACHINE_TABLE, &name); - strcpy(before[12], name); - free(name); - beforec = 13; + beforec = 11; break; case IMEMBERS_TABLE: id = (int) argv[0]; @@ -386,15 +380,9 @@ void incremental_after(enum tables table, char *qual, char **argv) case LIST_TABLE: sprintf(stmt_buf, "SELECT l.name, l.active, l.publicflg, l.hidden, " "l.maillist, l.grouplist, l.gid, l.acl_type, l.acl_id, " - "l.description, l.list_id, l.mailman, l.mailman_id " - "FROM list l WHERE %s", qual); + "l.description, l.list_id FROM list l WHERE %s", qual); dosql(after); - name = xmalloc(0); - id = atoi(after[12]); - id_to_name(id, MACHINE_TABLE, &name); - strcpy(after[12], name); - free(name); - afterc = 13; + afterc = 11; break; case IMEMBERS_TABLE: id = (int) argv[0]; diff --git a/server/qsetup.pc b/server/qsetup.pc index 24431f9f..80f5535b 100644 --- a/server/qsetup.pc +++ b/server/qsetup.pc @@ -495,6 +495,21 @@ int setup_alis(struct query *q, char *argv[], client *cl) return MR_SERVICE; } } + else + { + /* Client too old to know about the mailman code. + * Use existing value of mailman boolean in the table. + */ + EXEC SQL SELECT mailman INTO :mailman FROM list WHERE name = :name; + if (mailman) + { + EXEC SQL SELECT COUNT(name) INTO :cnt FROM list + WHERE (name = :name || '-admin' OR name = :name || '-owner' OR + name = :name || '-request'); + if (cnt) + return MR_EXISTS; + } + } if ((mr_errcode = prefetch_value(q, argv, cl)) != MR_SUCCESS) return mr_errcode; -- 2.45.2