]> andersk Git - moira.git/commitdiff
added followup_ghst
authormar <mar>
Wed, 10 Nov 1993 15:34:33 +0000 (15:34 +0000)
committermar <mar>
Wed, 10 Nov 1993 15:34:33 +0000 (15:34 +0000)
server/qfollow.dc

index fc13e1db00b911ed0b480d8f896a3c31756f8266..f541fc37133ac998a90f3388a25b09bd6e629eaf 100644 (file)
@@ -751,6 +751,83 @@ followup_gsnt(q, sq, v, action, actarg, cl)
 }
 
 
+/* followup_ghst: fix the ace_name in argv[12].  argv[11] will contain the
+ * ace_type: "LIST", "USER", or "NONE".  Decode the id in argv[12] into the
+ * proper name based on the type, and repace that string in the argv.
+ * Also fixes the modby field by called followup_fix_modby.
+ */
+
+followup_ghst(q, sq, v, action, actarg, cl)
+    register struct query *q;
+    register struct save_queue *sq;
+    register struct validate *v;
+    register int (*action)();
+    int actarg;
+    client *cl;
+{
+    char **argv, *malloc(), *realloc(), *type;
+    int id, i, idx, status;
+
+    while (sq_get_data(sq, &argv)) {
+       mr_trim_args(q->vcnt, argv);
+
+       id = atoi(argv[i = q->vcnt - 2]);
+       if (id > 0)
+         status = id_to_name(id, "USER", &argv[i]);
+       else
+         status = id_to_name(-id, "STRING", &argv[i]);
+       if (status && status != MR_NO_MATCH)
+         return(status);
+
+       id = atoi(argv[13]);
+       status = id_to_name(id, "STRING", &argv[13]);
+       if (status) return(status);
+       id = atoi(argv[14]);
+       status = id_to_name(id, "STRING", &argv[14]);
+       if (status) return(status);
+       id = atoi(argv[16]);
+       if (id < 0)
+         status = id_to_name(-id, "STRING", &argv[16]);
+       else
+         status = id_to_name(id, "USER", &argv[16]);
+       if (status) return(status);
+
+       idx = 12;
+       id = atoi(argv[idx]);
+       type = strtrim(argv[idx - 1]);
+
+       if (!strcmp(type, "LIST")) {
+           status = id_to_name(id, "LIST", &argv[idx]);
+       } else if (!strcmp(type, "USER")) {
+           status = id_to_name(id, "USER", &argv[idx]);
+       } else if (!strcmp(type, "KERBEROS")) {
+           status = id_to_name(id, "STRING", &argv[idx]);
+       } else if (!strcmp(type, "NONE")) {
+           status = 0;
+           free(argv[idx]);
+           argv[idx] = strsave("NONE");
+       } else {
+           status = 0;
+           free(argv[idx]);
+           argv[idx] = strsave("???");
+       }
+       if (status && status != MR_NO_MATCH)
+         return(status);
+
+       /* send the data */
+       (*action)(q->vcnt, argv, actarg);
+
+       /* free saved data */
+       for (i = 0; i < q->vcnt; i++)
+           free(argv[i]);
+       free(argv);
+    }
+
+    sq_destroy(sq);
+    return (MR_SUCCESS);
+}
+
+
 /* followup_glin: fix the ace_name in argv[8].  argv[7] will contain the
  * ace_type: "LIST", "USER", or "NONE".  Decode the id in argv[8] into the
  * proper name based on the type, and repace that string in the argv.
This page took 0.068252 seconds and 5 git commands to generate.