]> andersk Git - moira.git/commitdiff
Major update to container related code.
authorzacheiss <zacheiss>
Fri, 2 Aug 2002 10:30:07 +0000 (10:30 +0000)
committerzacheiss <zacheiss>
Fri, 2 Aug 2002 10:30:07 +0000 (10:30 +0000)
- Make container name in container-related queries case insensitive.
- Implement get_container_list and set_container_list queries for
  associating a container with a list.
- Add a publicflg to containers, analagous to what's already there for
  and update acl'ing semantics to use it.
- Pass associated container list to incremental programs for container
  table incrementals.

Not guaranteed to be bug free, but seems to all work, and it's time to
checkpoint this work.

server/increment.pc
server/mr_server.h
server/qaccess.pc
server/qfollow.pc
server/qrtn.pc
server/qsetup.pc
server/qsupport.pc
server/queries2.c

index 6879afee8b9d8845cfe0bce37e5855abcbfe3407..ea75a8629a850b0fd5b527ab7640f805c3e5842e 100644 (file)
@@ -112,10 +112,10 @@ void incremental_before(enum tables table, char *qual, char **argv)
       break;
     case CONTAINERS_TABLE:
       sprintf(stmt_buf, "SELECT c.name, c.description, c.location, c.contact, "
-             "c.acl_type, c.acl_id, c.cnt_id FROM containers c WHERE %s", 
-             qual);
+             "c.acl_type, c.acl_id, c.cnt_id, c.list_id FROM containers c "
+             "WHERE %s", qual);
       dosql(before);
-      beforec = 7;
+      beforec = 8;
       name = xmalloc(0);
       id = atoi(before[5]);
       if (!strncmp(before[4], "USER", 4))
@@ -133,6 +133,9 @@ void incremental_before(enum tables table, char *qual, char **argv)
          id_to_name(id, STRINGS_TABLE, &name);
          strcpy(before[5], name);
        }
+      id = atoi(before[7]);
+      id_to_name(id, LIST_TABLE, &name);
+      strcpy(before[7], name);
       break;
     case MCMAP_TABLE:
       strcpy(before[0], argv[0]);
@@ -146,7 +149,13 @@ void incremental_before(enum tables table, char *qual, char **argv)
       sprintf(before[2], "%d", id);
       name_to_id(before[1], CONTAINERS_TABLE, &id);
       sprintf(before[3], "%d", id);
-      beforec = 4;
+      name = xmalloc(0);
+      EXEC SQL SELECT list_id INTO :before[4] FROM containers
+       WHERE cnt_id = :id;
+      id = atoi(before[4]);
+      id_to_name(id, LIST_TABLE, &name);
+      strcpy(before[4], name);
+      beforec = 5;
       break;
     case SVC_TABLE:
       strcpy(before[0], argv[0]);
@@ -259,7 +268,7 @@ void incremental_after(enum tables table, char *qual, char **argv)
 {
   char *name, *name2;
   EXEC SQL BEGIN DECLARE SECTION;
-  int id;
+  int id; 
   EXEC SQL END DECLARE SECTION;
   struct iupdate *iu;
 
@@ -286,10 +295,10 @@ void incremental_after(enum tables table, char *qual, char **argv)
       break;
     case CONTAINERS_TABLE:
       sprintf(stmt_buf, "SELECT c.name, c.description, c.location, c.contact, "
-             "c.acl_type, c.acl_id, c.cnt_id FROM containers c WHERE %s",
-             qual);
+             "c.acl_type, c.acl_id, c.cnt_id, c.list_id FROM containers c "
+             "WHERE %s", qual);
       dosql(after);
-      afterc = 7;
+      afterc = 8;
       name = xmalloc(0);
       id = atoi(after[5]);
       if (!strncmp(after[4], "USER", 4))
@@ -307,6 +316,9 @@ void incremental_after(enum tables table, char *qual, char **argv)
          id_to_name(id, STRINGS_TABLE, &name);
          strcpy(after[5], name);
        }
+      id = atoi(after[7]);
+      id_to_name(id, LIST_TABLE, &name);
+      strcpy(after[7], name);
       break;
     case MCMAP_TABLE:
       strcpy(after[0], argv[0]);
@@ -320,7 +332,13 @@ void incremental_after(enum tables table, char *qual, char **argv)
       sprintf(after[2], "%d", id);
       name_to_id(after[1], CONTAINERS_TABLE, &id);
       sprintf(after[3], "%d", id);
-      afterc = 4;
+      name = xmalloc(0);
+      EXEC SQL SELECT list_id INTO :after[4] FROM containers
+       WHERE cnt_id = :id;
+      id = atoi(after[4]);
+      id_to_name(id, LIST_TABLE, &name);
+      strcpy(after[4], name);
+      afterc = 5;
       break;
     case SVC_TABLE:
       strcpy(after[0], argv[0]);
index c1b8d0d86e0a72823cd0f3c020b3472a984a0434..70e31e600f6d54b19e69e2390b9398e0027b8264 100644 (file)
@@ -240,6 +240,8 @@ int setup_uhha(struct query *q, char *argv[], client *cl);
 int setup_aprn(struct query *q, char *argv[], client *cl);
 int setup_dpsv(struct query *q, char *argv[], client *cl);
 int setup_dcon(struct query *q, char *argv[], client *cl);
+int setup_acon(struct query *q, char *argv[], client *cl);
+int setup_scli(struct query *q, char *argv[], client *cl);
 
 /* prototypes from qsupport.pc */
 int set_pobox(struct query *q, char *argv[], client *cl);
@@ -250,6 +252,7 @@ int tag_member_of_list(struct query *q, char *argv[], client *cl);
 int register_user(struct query *q, char *argv[], client *cl);
 int do_user_reservation(struct query *q, char *argv[], client *cl);
 int update_container(struct query *q, char *argv[], client *cl);
+int set_container_list(struct query *q, char *argv[], client *cl);
 
 int get_ace_use(struct query *q, char **argv, client *cl,
                int (*action)(int, char *[], void *), void *actarg);
index 1c745c3c2385f6c079bc3bf3545987d895938165..801a4d9f75f96427739ecf863db9dea236ffd1c1 100644 (file)
@@ -669,9 +669,10 @@ int access_zephyr(struct query *q, char *argv[], client *cl)
 int access_container(struct query *q, char *argv[], client *cl)
 {
   EXEC SQL BEGIN DECLARE SECTION;
-  int cnt_id, acl_id, memacl_id;
+  int cnt_id, acl_id, memacl_id, mach_id, machine_owner_id, flag;
   char acl_type[CONTAINERS_ACL_TYPE_SIZE], memacl_type[CONTAINERS_ACL_TYPE_SIZE];
   char name[CONTAINERS_NAME_SIZE], *newname;
+  char machine_owner_type[MACHINE_OWNER_TYPE_SIZE];
   EXEC SQL END DECLARE SECTION;
   int status;
 
@@ -679,10 +680,13 @@ int access_container(struct query *q, char *argv[], client *cl)
   
   /* if amcn or dmcn, container id is the second argument */
   if (strcmp(q->shortname, "amcn") == 0 || strcmp(q->shortname, "dmcn") == 0)
+  {
+       mach_id = *(int *)argv[0];
        cnt_id = *(int *)argv[1];
+  }
 
-  EXEC SQL SELECT acl_id, acl_type, memacl_id, memacl_type, name
-    INTO :acl_id, :acl_type, :memacl_id, :memacl_type, :name
+  EXEC SQL SELECT acl_id, acl_type, memacl_id, memacl_type, name, publicflg
+    INTO :acl_id, :acl_type, :memacl_id, :memacl_type, :name, :flag
     FROM containers
     WHERE cnt_id = :cnt_id;
 
@@ -713,6 +717,19 @@ int access_container(struct query *q, char *argv[], client *cl)
   if (find_member(memacl_type, memacl_id, cl))
     return MR_SUCCESS;
 
+  /* if the container is public or the query is delete, grant access if client
+   * is on owner list */
+  if (flag || q->type == DELETE)
+    {
+         EXEC SQL SELECT owner_type, owner_id INTO :machine_owner_type,
+           :machine_owner_id
+           FROM machine
+           WHERE mach_id = :mach_id;
+
+         if (sqlca.sqlerrd[2] == 1 && strcmp("NONE", machine_owner_type) &&
+               find_member(machine_owner_type, machine_owner_id, cl))
+           return MR_SUCCESS;
+    }
   /* Otherwise fail. */
   return MR_PERM;
 }
index 08ea6aba84bb51e96ea1dc546d6c7041f51a8dcd..24864e60abfdf4b3ea2fc383e77fb272a72ab8d8 100644 (file)
@@ -982,17 +982,20 @@ int followup_gcon(struct query *q, struct save_queue *sq, struct validate *v,
                  client *cl)
 {
   char **argv;
-  int status;
+  int status, idx = 0;
+
+  if (q->version >= 9)
+    idx = 1;
 
   while (sq_get_data(sq, &argv))
   {
     mr_trim_args(q->vcnt, argv);
 
-    status = fix_ace(argv[4], &argv[5]);
+    status = fix_ace(argv[4 + idx], &argv[5 + idx]);
     if (status && status != MR_NO_MATCH)
            return status;
       
-         status = fix_ace(argv[6], &argv[7]);
+         status = fix_ace(argv[6 + idx], &argv[7 + idx]);
          if (status && status != MR_NO_MATCH)
            return status;
        }
index ee69a4973fd41a9e333736598b77ddf8b44f00c7..5b6ebd70139f8819704322fe75bc88f684f189fe 100644 (file)
@@ -1012,7 +1012,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;
index 040d9533da8b32d7a1cc6c952f3af41dcb4fce65..455ddf7ccfb4a1cfbf1aaf7dd96aa1f05edadde6 100644 (file)
@@ -1358,7 +1358,7 @@ int setup_dcon(struct query *q, char *argv[], client *cl)
    strcpy(containername, strtrim(containername));
 
   EXEC SQL SELECT COUNT(cnt_id) INTO :cnt FROM containers
-    WHERE name LIKE :containername || '/' || '%';
+    WHERE LOWER(name) LIKE LOWER(:containername || '/' || '%');
 
   if (cnt > 0)
     return MR_IN_USE;
@@ -1368,6 +1368,25 @@ int setup_dcon(struct query *q, char *argv[], client *cl)
   return MR_SUCCESS;
 }
 
+int setup_scli(struct query *q, char *argv[], client *cl)
+{
+  EXEC SQL BEGIN DECLARE SECTION;
+  int cnt_id, list_id;
+  EXEC SQL END DECLARE SECTION;
+
+  cnt_id = *(int *)argv[0];
+  /* Check if someone has already set the list for this container */
+  EXEC SQL SELECT list_id INTO :list_id FROM containers
+    WHERE cnt_id = :cnt_id;
+  if (list_id != 0)
+    return MR_EXISTS;
+
+  if (dbms_errno)
+    return mr_errcode;
+
+  return MR_SUCCESS;
+}
+
 /* hostname_check()
  * validate the rfc1035/rfc1123-ness of a hostname
  */
@@ -1426,3 +1445,30 @@ int hostinfo_check(char *info, int num)
   if (!isalnum(*(p - 1)))
     return 1;
 }
+
+int setup_acon(struct query *q, char *argv[], client *cl)
+{
+  EXEC SQL BEGIN DECLARE SECTION;
+  char containername[CONTAINERS_NAME_SIZE];
+  EXEC SQL END DECLARE SECTION;
+  
+  char* ptr;
+  
+  memset(containername, 0, sizeof(containername));
+  strcpy(containername, argv[0]);
+  ptr = strrchr(containername, '/');
+  /* sub container, check for parents */
+  if (ptr)
+    {
+      *ptr = '\0';
+      EXEC SQL SELECT * FROM containers
+       WHERE lower(name) = lower(:containername);      
+      if (sqlca.sqlerrd[2] != 1)
+       return MR_CONTAINER_NO_PARENT;
+    }
+  
+  if ((mr_errcode = prefetch_value(q, argv, cl)) != MR_SUCCESS)
+    return mr_errcode;
+  
+  return MR_SUCCESS;
+}
index 655ad2eb92edd194f365e37b2d58495b956ed46b..8a441d3b0baab35fc3645be5856fc0236e8f4944 100644 (file)
@@ -1891,7 +1891,7 @@ int get_user_by_reservation(struct query *q, char **argv, client *cl,
 int update_container(struct query *q, char *argv[], client *cl)
 {
   EXEC SQL BEGIN DECLARE SECTION;
-  int cnt_id, acl_id, memacl_id, who;
+  int cnt_id, acl_id, memacl_id, who, flag;
   char name[CONTAINERS_NAME_SIZE], newchildname[CONTAINERS_NAME_SIZE];
   char* newname, *entity, *description, *location, *contact, *acl_type, *memacl_type;
   EXEC SQL END DECLARE SECTION;
@@ -1899,16 +1899,21 @@ int update_container(struct query *q, char *argv[], client *cl)
   int cnt, childid;
   char childname[CONTAINERS_NAME_SIZE];
   char *qual;
+   int index = 0;
 
-  cnt_id = *(int *)argv[0];
-  newname = argv[1];
-  description = argv[2];
-  location = argv[3];
-  contact = argv[4];
-  acl_type = argv[5];
-  acl_id = *(int *)argv[6];
-  memacl_type = argv[7];
-  memacl_id = *(int *)argv[8];
+  cnt_id = *(int *)argv[index++];
+  newname = argv[index++];
+
+  if (q->version >= 9)
+    flag = atoi(argv[index++]);
+
+  description = argv[index++];
+  location = argv[index++];
+  contact = argv[index++];
+  acl_type = argv[index++];
+  acl_id = *(int *)argv[index++];
+  memacl_type = argv[index++];
+  memacl_id = *(int *)argv[index++];
   entity = cl->entity;
   who = cl->client_id;
 
@@ -1987,12 +1992,24 @@ int update_container(struct query *q, char *argv[], client *cl)
   }
 
   /* update the remaining fields */
-  EXEC SQL UPDATE containers 
-    SET description = NVL(:description, CHR(0)), location = NVL(:location, CHR(0)), 
-      contact = NVL(:contact, CHR(0)), acl_type = :acl_type, acl_id = :acl_id, 
-      memacl_type = :memacl_type, memacl_id = :memacl_id, 
-      modtime = SYSDATE, modby = :who, modwith = :entity
-    WHERE cnt_id = :cnt_id;
+  if (q->version >= 9)
+  {
+       EXEC SQL UPDATE containers
+               SET publicflg= :flag, description = NVL(:description, CHR(0)), location = NVL(:location, CHR(0)),
+                       contact = NVL(:contact, CHR(0)), acl_type = :acl_type, acl_id = :acl_id,
+                       memacl_type = :memacl_type, memacl_id = :memacl_id,
+                       modtime = SYSDATE, modby = :who, modwith = :entity
+               WHERE cnt_id = :cnt_id;
+  }
+  else
+  {
+    EXEC SQL UPDATE containers
+               SET publicflg= :flag, description = NVL(:description, CHR(0)), location = NVL(:location, CHR(0)),
+                       contact = NVL(:contact, CHR(0)), acl_type = :acl_type, acl_id = :acl_id,
+                       memacl_type = :memacl_type, memacl_id = :memacl_id,
+                       modtime = SYSDATE, modby = :who, modwith = :entity
+               WHERE cnt_id = :cnt_id;
+  }
 
   if (dbms_errno)
     return mr_errcode;
@@ -2037,7 +2054,8 @@ int get_machines_of_container(struct query *q, char *argv[], client *cl,
   if (!isrecursive)
     sprintf(tmp, "AND b.cnt_id = %d ", cnt_id);
   else
-    sprintf(tmp, "AND (b.cnt_id = %d OR b.name LIKE '%s/%%') ", cnt_id, containername);
+    sprintf(tmp, "AND (b.cnt_id = %d OR b.name LIKE LOWER('%s/%%')) ", 
+           cnt_id, containername);
 
   strcat(querystring, tmp);
   strcat(querystring, "ORDER BY b.name, a.name");
@@ -2095,10 +2113,10 @@ int get_subcontainers_of_container(struct query *q, char *argv[], client *cl,
   strcpy(querystring, "SELECT name FROM containers ");
   
   if (!isrecursive)
-    sprintf(tmp, "WHERE name LIKE '%s/%%' and name NOT LIKE '%s/%%/%%' ", containername, 
-        containername);
+    sprintf(tmp, "WHERE LOWER(name) LIKE '%s/%%' and name NOT LIKE LOWER('%s/%%/%%') ",
+           containername, containername);
   else
-    sprintf(tmp, "WHERE name LIKE '%s/%%' ", containername);
+    sprintf(tmp, "WHERE LOWER(name) LIKE LOWER('%s/%%') ", containername);
 
   strcat(querystring, tmp);
   strcat(querystring, "ORDER BY name");
@@ -2125,3 +2143,19 @@ int get_subcontainers_of_container(struct query *q, char *argv[], client *cl,
     return MR_NO_MATCH;
   return MR_SUCCESS;
 }
+
+int set_container_list(struct query *q, char *argv[], client *cl)
+{
+  EXEC SQL BEGIN DECLARE SECTION;
+  int cnt_id, list_id;
+  EXEC SQL END DECLARE SECTION;
+
+  cnt_id = *(int *)argv[0];
+  list_id = *(int *)argv[1];
+
+  EXEC SQL UPDATE containers SET list_id = :list_id WHERE cnt_id = :cnt_id;
+  if (dbms_errno)
+    return mr_errcode;
+
+  return MR_SUCCESS;
+}
index 0814cdcdabea0f10735a46c3faab5b053798511a..8277ac01487ab437781a825fd252871406fe07ac 100644 (file)
@@ -43,7 +43,7 @@ static struct valobj VOfilesys0[] = {
 };
 
 static struct valobj VOcon0[] = {
-       {V_ID, 0, CONTAINERS_TABLE, "name", "cnt_id", MR_CONTAINER},
+  {V_ID, 0, CONTAINERS_TABLE, "name", "cnt_id", MR_CONTAINER},
 };
 
 static struct valobj VOnum0[] = {
@@ -3343,7 +3343,7 @@ static char *gdds_fields[] = {
   "sid",
 };
 
-static char *gcon_fields[] = {
+static char *gcon7_fields[] = {
   "name",
   "name", "description", "location", "contact",
   "ace_type", "ace_name", "memace_type", "memace_name", "modtime", "modby", "modwith",
@@ -3361,12 +3361,18 @@ static struct validate gcon_validate = {
   followup_gcon,
 };
 
-static char *acon_fields[] = {
+static char *gcon_fields[] = {
+  "name",
+  "name", "publicflg", "description", "location", "contact",
+  "ace_type", "ace_name", "memace_type", "memace_name", "modtime", "modby", "modwith",
+};
+
+static char *acon7_fields[] = {
   "name", "description", "location", "contact",
   "ace_type", "ace_name", "memace_type", "memace_name",
 };
 
-static struct valobj acon_valobj[] = {
+static struct valobj acon7_valobj[] = {
   {V_CHAR, 0, CONTAINERS_TABLE, "name"},
   {V_LEN, 1, CONTAINERS_TABLE, "description"},
   {V_CHAR, 2, CONTAINERS_TABLE, "location"},
@@ -3377,26 +3383,56 @@ static struct valobj acon_valobj[] = {
   {V_TYPEDATA, 7, 0, 0, 0, MR_ACE},
 };
 
+static struct validate acon7_validate =
+{
+  acon7_valobj,
+  8,
+  "name",
+  "name = '%s'",
+  1,
+  "cnt_id",
+  0,
+  setup_acon,
+  set_modtime,
+};
+
+static char *acon_fields[] = {
+  "name", "publicflg", "description", "location", "contact",
+  "ace_type", "ace_name", "memace_type", "memace_name",
+};
+
+static struct valobj acon_valobj[] = {
+  {V_CHAR, 0, CONTAINERS_TABLE, "name"},
+  {V_NUM, 1},
+  {V_LEN, 2, CONTAINERS_TABLE, "description"},
+  {V_CHAR, 3, CONTAINERS_TABLE, "location"},
+  {V_CHAR, 4, CONTAINERS_TABLE, "contact"},
+  {V_TYPE, 5, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 6, 0, 0, 0, MR_ACE},
+  {V_TYPE, 7, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 8, 0, 0, 0, MR_ACE},
+};
+
 static struct validate acon_validate =
 {
   acon_valobj,
-  8,
+  9,
   "name",
   "name = '%s'",
   1,
   "cnt_id",
   0,
-  prefetch_value,
+  setup_acon,
   set_modtime,
 };
 
-static char *ucon_fields[] = {
+static char *ucon7_fields[] = {
   "name",
   "newname", "description", "location", "contact",
   "ace_type", "ace_name", "memace_type", "memace_name",
 };
 
-static struct valobj ucon_valobj[] = {
+static struct valobj ucon7_valobj[] = {
   {V_ID, 0, CONTAINERS_TABLE, "name", "cnt_id", MR_CONTAINER},
   {V_RENAME, 1, CONTAINERS_TABLE, "name", "cnt_id", MR_NOT_UNIQUE},
   {V_LEN, 2, CONTAINERS_TABLE, "description"},
@@ -3408,10 +3444,42 @@ static struct valobj ucon_valobj[] = {
   {V_TYPEDATA, 8, 0, 0, 0, MR_ACE},
 };
 
+static struct validate ucon7_validate =
+{
+  ucon7_valobj,
+  9,
+  0,
+  0,
+  0,
+  0,
+  access_container,
+  0,
+  update_container,
+};
+
+static char *ucon_fields[] = {
+  "name",
+  "newname", "publicflg", "description", "location", "contact",
+  "ace_type", "ace_name", "memace_type", "memace_name",
+};
+
+static struct valobj ucon_valobj[] = {
+  {V_ID, 0, CONTAINERS_TABLE, "name", "cnt_id", MR_CONTAINER},
+  {V_RENAME, 1, CONTAINERS_TABLE, "name", "cnt_id", MR_NOT_UNIQUE},
+  {V_NUM, 2},
+  {V_LEN, 3, CONTAINERS_TABLE, "description"},
+  {V_CHAR, 4, CONTAINERS_TABLE, "location"},
+  {V_CHAR, 5, CONTAINERS_TABLE, "contact"},
+  {V_TYPE, 6, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 7, 0, 0, 0, MR_ACE},
+  {V_TYPE, 8, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 9, 0, 0, 0, MR_ACE},
+};
+
 static struct validate ucon_validate =
 {
   ucon_valobj,
-  9,
+  10,
   0,
   0,
   0,
@@ -3522,6 +3590,32 @@ static char *gtlc_fields[] = {
   "name",
 };
 
+static char *scli_fields[] = {
+  "containername",
+  "listname",
+};
+
+static struct valobj scli_valobj[] = {
+  {V_ID, 0, CONTAINERS_TABLE, "name", "cnt_id", MR_CONTAINER},
+  {V_ID, 1, LIST_TABLE, "name", "list_id", MR_LIST},
+};
+
+static struct validate scli_validate = {
+  scli_valobj,
+  2,
+  0,
+  0,
+  0,
+  0,
+  0,
+  setup_scli,
+  set_container_list,
+};
+
+static char *gcli_fields[] = {
+  "containername",
+  "containername", "listname",
+};
 
 /* Generalized Query Definitions */
 
@@ -6985,9 +7079,26 @@ struct query Queries[] = {
     "c",
     CONTAINERS_TABLE,
     "name, description, location, contact, acl_type, acl_id, memacl_type, memacl_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM containers",
-    gcon_fields,
+    gcon7_fields,
     11,
-    "name LIKE '%s' AND cnt_id != 0",
+    "LOWER(name) LIKE LOWER('%s') AND cnt_id != 0",
+    1,
+    NULL,
+    &gcon_validate,
+  },
+
+  {
+    /* Q_GCON - GET_CONTAINER, v9 */
+    "get_container",
+    "gcon",
+    9,
+    RETRIEVE,
+    "c",
+    CONTAINERS_TABLE,
+    "name, publicflg, description, location, contact, acl_type, acl_id, memacl_type, memacl_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM containers",
+    gcon_fields,
+    12,
+    "LOWER(name) LIKE LOWER('%s') AND cnt_id != 0",
     1,
     NULL,
     &gcon_validate,
@@ -7002,11 +7113,28 @@ struct query Queries[] = {
     "c",
     CONTAINERS_TABLE,
     "INTO containers (name, description, location, contact, acl_type, acl_id, memacl_type, memacl_id, cnt_id) VALUES ('%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), '%s', %d, '%s', %d, %s)",
-    acon_fields,
+    acon7_fields,
     8,
     0,
     0,
     NULL,
+    &acon7_validate,
+  },
+
+  {
+    /* Q_ACON - ADD_CONTAINER, v9 */ /* uses prefetch_value() for cnt_id */
+    "add_container",
+    "acon",
+    9,
+    APPEND,
+    "c",
+    CONTAINERS_TABLE,
+    "INTO containers (name, publicflg, description, location, contact, acl_type, acl_id, memacl_type, memacl_id, cnt_id) VALUES ('%s', %s, NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), '%s', %d, '%s', %d, %s)",
+    acon_fields,
+    9,
+    0,
+    0,
+    NULL,
     &acon_validate,
   },
 
@@ -7019,11 +7147,28 @@ struct query Queries[] = {
     0,
     CONTAINERS_TABLE,
     0,
-    ucon_fields,
+    ucon7_fields,
     8,
     0,
     1,
     NULL,
+    &ucon7_validate,
+  },
+
+  {
+    /* Q_UCON - UPDATE_CONTAINER, v9 */
+    "update_container",
+    "ucon",
+    9,
+    UPDATE,
+    0,
+    CONTAINERS_TABLE,
+    0,
+    ucon_fields,
+    9,
+    0,
+    1,
+    NULL,
     &ucon_validate,
   },
 
@@ -7146,6 +7291,40 @@ struct query Queries[] = {
     NULL,
   },
 
+  {
+    /* Q_SCLI - SET_CONTAINER_LIST, v9 */
+    "set_container_list",
+    "scli",
+    9,
+    UPDATE,
+    0,
+    CONTAINERS_TABLE,
+    0,
+    scli_fields,
+    1,
+    0,
+    1,
+    NULL,
+    &scli_validate,
+  },
+
+  {
+    /* Q_GCLI - GET_CONTAINER_LIST, v9 */
+    "get_container_list",
+    "gcli",
+    9,
+    RETRIEVE,
+    "c",
+    CONTAINERS_TABLE,
+    "c.name, l.name FROM containers c, list l",
+    gcli_fields,
+    2,
+    "LOWER(c.name) = LOWER('%s') AND c.list_id = l.list_id AND c.list_id != 0",
+    1,
+    NULL,
+    NULL,
+  },
+
 };
 
 int QueryCount = (sizeof(Queries) / sizeof(struct query));
This page took 0.090974 seconds and 5 git commands to generate.