]> andersk Git - moira.git/blobdiff - server/qsupport.qc
Used /bin/sh format instead of /bin/csh format, by accident.
[moira.git] / server / qsupport.qc
index 0cc32e43ede9fbf74577000322c15a5bc94189e8..5e3638346f3508628b5d3798a85acfc5228157f6 100644 (file)
@@ -331,10 +331,15 @@ setup_ausr(q, argv, cl)
 ##  int nuid, rowcount;
 ##  char *mit_id;
 
+#ifdef notdef
+    /* this is currently disabled because we need an index on ID's
+     * before it can run in finite time.
+     */
     mit_id = argv[U_MITID];
 ##  retrieve (rowcount = any(u.#mit_id where u.#mit_id = mit_id))
     if (ingres_errno) return(mr_errcode);
     if (rowcount) return(MR_EXISTS);
+#endif notdef
 
     if (!strcmp(argv[1], UNIQUE_UID) || atoi(argv[1]) == -1) {
        if (set_next_object_id("uid", "users"))
@@ -573,8 +578,8 @@ int setup_dlis(q, argv)
 ##                     servers.acl_type = "LIST"))
     if (flag)
        return(MR_IN_USE);
-##  repeat retrieve (flag = any(quotas.entity_id where quotas.entity_id=@id and
-##                     quotas.type = "GROUP"))
+##  repeat retrieve (flag = any(quota.entity_id where quota.entity_id=@id and
+##                     quota.type = "GROUP"))
     if (flag)
        return(MR_IN_USE);
 ##  repeat retrieve (flag=any(hostaccess.acl_id where hostaccess.acl_id=@id and
@@ -1498,6 +1503,40 @@ followup_aqot(q, argv, cl)
 ##}
 
 
+followup_gpce(q, sq, v, action, actarg, cl)
+    struct query *q;
+    register struct save_queue *sq;
+    struct validate *v;
+    register int (*action)();
+    register int actarg;
+    client *cl;
+{
+    register int i, j;
+    char **argv, *malloc();
+    int id, status;
+
+    i = q->vcnt - 2;
+    while (sq_get_data(sq, &argv)) {
+       id = atoi(argv[PCAP_QSERVER]);
+       status = id_to_name(id, "MACHINE", &argv[PCAP_QSERVER]);
+       if (status) return (status);
+       id = atoi(argv[i]);
+       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);
+       (*action)(q->vcnt, argv, actarg);
+       for (j = 0; j < q->vcnt; j++)
+         free(argv[j]);
+       free(argv);
+    }
+    sq_destroy(sq);
+    return(MR_SUCCESS);
+}
+
+
 /* followup_gzcl:
  */
 
@@ -1772,7 +1811,7 @@ get_list_info(q, aargv, cl, action, actarg)
  * how many different ancestors a member is allowed to have.
  */
 
-#define MAXLISTDEPTH   100
+#define MAXLISTDEPTH   1024
 
 int add_member_to_list(q, argv, cl)
     struct query *q;
@@ -2703,7 +2742,8 @@ register_user(q, argv, cl)
     if (rowcount != 1)
       return(MR_INTERNAL);
     aargv[0] = login;
-    aargv[1] = login;
+    aargv[1] = "USER";
+    aargv[2] = login;
     sprintf(buffer, "q.entity_id = %d and q.filsys_id = values.value and q.type = \"USER\" and values.name = \"filsys_id\"", users_id);
     incremental_after("quota", buffer, aargv);
     com_err(whoami, 0, "quota of %d assigned", quota);
This page took 0.114965 seconds and 4 git commands to generate.