X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/blobdiff_plain/d7ddc0112258fa6fd12edc4e6827f61dd42412bb..refs/heads/ip-billing-dev:/server/qfollow.pc diff --git a/server/qfollow.pc b/server/qfollow.pc index f1422c6d..4f7d344d 100644 --- a/server/qfollow.pc +++ b/server/qfollow.pc @@ -526,13 +526,18 @@ int followup_gsnt(struct query *q, struct save_queue *sq, struct validate *v, client *cl) { char **argv; - int status; + int status, idx; + + if (q->version < 8) + idx = 0; + else + idx = 3; while (sq_get_data(sq, &argv)) { mr_trim_args(q->vcnt, argv); - status = fix_ace(argv[7], &argv[8]); + status = fix_ace(argv[7 + idx], &argv[8 + idx]); if (status && status != MR_NO_MATCH) return status; } @@ -548,29 +553,36 @@ int followup_ghst(struct query *q, struct save_queue *sq, struct validate *v, client *cl) { char **argv; - int id, status; + int id, status, idx; + + if (q->version < 6) + idx = 0; + else if (q->version >= 6 && q->version < 8) + idx = 1; + else + idx = 2; while (sq_get_data(sq, &argv)) { mr_trim_args(q->vcnt, argv); - id = atoi(argv[13]); - status = id_to_name(id, STRINGS_TABLE, &argv[13]); + id = atoi(argv[13 + idx]); + status = id_to_name(id, STRINGS_TABLE, &argv[13 + idx]); if (status) return status; - id = atoi(argv[14]); - status = id_to_name(id, STRINGS_TABLE, &argv[14]); + id = atoi(argv[14 + idx]); + status = id_to_name(id, STRINGS_TABLE, &argv[14 + idx]); if (status) return status; - id = atoi(argv[16]); + id = atoi(argv[16 + idx]); if (id < 0) - status = id_to_name(-id, STRINGS_TABLE, &argv[16]); + status = id_to_name(-id, STRINGS_TABLE, &argv[16 + idx]); else - status = id_to_name(id, USERS_TABLE, &argv[16]); + status = id_to_name(id, USERS_TABLE, &argv[16 + idx]); if (status && status != MR_NO_MATCH) return status; - status = fix_ace(argv[11], &argv[12]); + status = fix_ace(argv[11 + idx], &argv[12 + idx]); if (status && status != MR_NO_MATCH) return status; } @@ -807,7 +819,6 @@ int followup_aqot(struct query *q, char *argv[], client *cl) if (dbms_errno) return mr_errcode; - flush_name(argv[0], table); if (q->type == APPEND) { EXEC SQL UPDATE tblstats SET appends = appends + 1, modtime = SYSDATE @@ -872,7 +883,6 @@ int followup_dqot(struct query *q, char **argv, client *cl) if (dbms_errno) return mr_errcode; - flush_name(argv[0], table); EXEC SQL UPDATE tblstats SET deletes = deletes + 1, modtime = SYSDATE WHERE table_name = :tname; @@ -964,3 +974,29 @@ int trigger_dcm(struct query *q, char *argv[], client *cl) return MR_SUCCESS; } } + +/* followup_gcon: fix the ace_name, memace_name, and modby */ + +int followup_gcon(struct query *q, struct save_queue *sq, struct validate *v, + int (*action)(int, char *[], void *), void *actarg, + client *cl) +{ + char **argv; + int status; + + while (sq_get_data(sq, &argv)) + { + mr_trim_args(q->vcnt, argv); + + status = fix_ace(argv[4], &argv[5]); + if (status && status != MR_NO_MATCH) + return status; + + status = fix_ace(argv[6], &argv[7]); + if (status && status != MR_NO_MATCH) + return status; + } + + return followup_fix_modby(q, sq, v, action, actarg, cl); +} +