]> andersk Git - moira.git/blobdiff - server/qrtn.pc
Implement glic query for returning the container associated with a given
[moira.git] / server / qrtn.pc
index 42892e2a201481df090234a18647986d370e1bd5..bdb16f1619fc34f919df23c2e17267af1eef74dc 100644 (file)
@@ -44,7 +44,7 @@ extern int QueryCount, max_version;
 extern struct query Queries[];
 
 /* Put this in a variable so that we can patch it if necessary */
-int max_row_count = 4096;
+int max_row_count = 8192;
 
 int mr_verify_query(client *cl, struct query *q, int argc, char *argv_ro[]);
 int do_retrieve(struct query *q, char *pqual,
@@ -425,7 +425,8 @@ char *build_qual(char *fmt_buf, int argc, char *argv[])
 
   while (*fmt)
     {
-      if (!like && !arg)
+      
+      if ((!like && !arg) || argc == 0)
        {
          /* only plain text remains */
          strcpy(res, fmt);
@@ -558,20 +559,16 @@ int mr_verify_query(client *cl, struct query *q, int argc, char *argv_ro[])
       if (*fr)
        return MR_ARG_TOO_LONG;
       *to = '\0';
-
-      if (to > Argv[i] && *--to == '\\')
-       return MR_BAD_CHAR;
     }
 
-  /* check initial query access, unless we're acting as a proxy */
-  if (!cl->proxy_id)
-    {
-      status = check_query_access(q, Argv, cl);
-      if (status != MR_SUCCESS && status != MR_PERM)
-       return status;
-      if (status == MR_SUCCESS)
-       privileged++;
-    }
+  /* Check initial query access.  If we're acting as a proxy, only allow
+   * access if the query has "default" as a capacl.
+   */
+  status = check_query_access(q, Argv, cl);
+  if (status != MR_SUCCESS && status != MR_PERM)
+    return status;
+  if (status == MR_SUCCESS && (!cl->proxy_id || q->everybody))
+      privileged++;
 
   /* validate arguments */
   if (v && v->valobj)
@@ -1011,7 +1008,8 @@ int name_to_id(char *name, enum tables type, int *id)
       EXEC SQL SELECT string_id INTO :j FROM strings WHERE string = :iname;
       break;
     case CONTAINERS_TABLE:
-      EXEC SQL SELECT cnt_id INTO :j FROM containers WHERE name = :iname;
+      EXEC SQL SELECT cnt_id INTO :j FROM containers WHERE LOWER(name) = 
+       LOWER(:iname);
       break;
     default:
       return MR_INTERNAL;
This page took 0.0469 seconds and 4 git commands to generate.