]> andersk Git - moira.git/blobdiff - server/qfollow.dc
had to change the get alias validate thing to use the access hook
[moira.git] / server / qfollow.dc
index fc13e1db00b911ed0b480d8f896a3c31756f8266..7a63bd4d30a69598ab16c9a60a477f267940effe 100644 (file)
@@ -329,7 +329,7 @@ followup_fix_modby(q, sq, v, action, actarg, cl)
     client *cl;
 {
     register int i, j;
-    char **argv, *malloc();
+    char **argv;
     int id, status;
 
     i = q->vcnt - 2;
@@ -368,7 +368,7 @@ followup_guax(q, sq, v, action, actarg, cl)
     client *cl;
 {
     register int i, j;
-    char **argv, *malloc();
+    char **argv;
 #ifdef GDSS
     unsigned char sigbuf[256];
     char *kname;
@@ -638,7 +638,7 @@ followup_gpob(q, sq, v, action, actarg, cl)
     int actarg;
     client *cl;
 {
-    char **argv, *index();
+    char **argv;
     char *ptype, *p;
     int mid, sid, status, i;
 
@@ -700,10 +700,10 @@ followup_gsnt(q, sq, v, action, actarg, cl)
     int actarg;
     client *cl;
 {
-    char **argv, *malloc(), *realloc(), *type;
+    char **argv, *type;
     int id, i, idx, status;
 
-    idx = 7;
+    idx = 8;
 
     while (sq_get_data(sq, &argv)) {
        mr_trim_args(q->vcnt, argv);
@@ -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, *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.
@@ -765,7 +842,7 @@ followup_glin(q, sq, v, action, actarg, cl)
     int actarg;
     client *cl;
 {
-    char **argv, *malloc(), *realloc(), *type;
+    char **argv, *type;
     int id, i, idx, status;
 
     idx = 8;
@@ -839,7 +916,7 @@ followup_gqot(q, sq, v, action, actarg, cl)
     client *cl;
 {
     register int j;
-    char **argv, *malloc();
+    char **argv;
     EXEC SQL BEGIN DECLARE SECTION;
     int id;
     char *name, *label;
@@ -1044,7 +1121,7 @@ followup_gpce(q, sq, v, action, actarg, cl)
     client *cl;
 {
     register int i, j;
-    char **argv, *malloc();
+    char **argv;
     int id, status;
 
     i = q->vcnt - 2;
This page took 0.031794 seconds and 4 git commands to generate.