]> andersk Git - moira.git/blobdiff - server/queries2.c
Make update_printer work.
[moira.git] / server / queries2.c
index 811f6e01420bcacd7751663b35dc3ccac1c87a1f..43c6d97aad9dfdc3db6c113714c98007cb203c67 100644 (file)
@@ -42,6 +42,10 @@ static struct valobj VOfilesys0[] = {
   {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
 };
 
+static struct valobj VOcon0[] = {
+  {V_ID, 0, CONTAINERS_TABLE, "name", "cnt_id", MR_CONTAINER},
+};
+
 static struct valobj VOnum0[] = {
   {V_NUM, 0},
 };
@@ -82,11 +86,27 @@ static char *gual2_fields[] = {
   "modtime", "modby", "modwith",
 };
 
+static char *gual3_fields[] = {
+  "login",
+  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
+  "status", "clearid", "class", "comments", "signature", "secure", "modtime",
+  "modby", "modwith", "created", "creator",
+};
+
+static char *gual11_fields[] = {
+  "login",
+  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
+  "status", "clearid", "class", "comments", "signature", "secure",
+  "winhomedir", "winprofiledir", "modtime", "modby", "modwith", "created",
+  "creator",
+};
+
 static char *gual_fields[] = {
   "login",
-  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", 
+  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
   "status", "clearid", "class", "comments", "signature", "secure",
-  "modtime", "modby", "modwith",
+  "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration",
+  "modtime", "modby", "modwith", "created", "creator",
 };
 
 static char *gubl2_fields[] = {
@@ -98,10 +118,11 @@ static char *gubl2_fields[] = {
 static char *gubl_fields[] = {
   "login",
   "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", 
-  "status", "clearid", "class", "modtime", "modby", "modwith",
+  "status", "clearid", "class", "modtime", "modby", "modwith", "created",
+  "creator", 
 };
 
-static struct validate gubl_validate =
+static struct validate gubl2_validate =
 {
   0,
   0,
@@ -114,6 +135,19 @@ static struct validate gubl_validate =
   followup_fix_modby,
 };
 
+static struct validate gubl_validate =
+{
+  0,
+  0,
+  0,
+  0,
+  0,
+  0,
+  access_login,
+  0,
+  followup_get_user,
+};
+
 static char *guau2_fields[] = {
   "unix_uid",
   "login", "unix_uid", "shell", "last", "first", "middle", "status",
@@ -121,11 +155,27 @@ static char *guau2_fields[] = {
   "modtime", "modby", "modwith",
 };
 
-static char *guau_fields[] = {
+static char *guau3_fields[] = {
   "unix_uid",
   "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", 
   "status", "clearid", "class", "comments", "signature", "secure",
-  "modtime", "modby", "modwith",
+  "modtime", "modby", "modwith", "created", "creator",
+};
+
+static char *guau11_fields[] = {
+  "unix_uid",
+  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
+  "status", "clearid", "class", "comments", "signature", "secure", 
+  "winhomedir", "winprofiledir", "modtime", "modby", "modwith", "created",
+  "creator",
+};
+
+static char *guau_fields[] = {
+  "unix_uid",
+  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
+  "status", "clearid", "class", "comments", "signature", "secure", 
+  "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration",
+  "modtime", "modby", "modwith", "created", "creator",
 };
 
 static char *guan2_fields[] = {
@@ -135,14 +185,30 @@ static char *guan2_fields[] = {
   "modtime", "modby", "modwith",
 };
 
-static char *guan_fields[] = {
+static char *guan3_fields[] = {
   "first", "last",
   "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", 
   "status", "clearid", "class", "comments", "signature", "secure",
-  "modtime", "modby", "modwith",
+  "modtime", "modby", "modwith", "created", "creator",
 };
 
-static struct validate guan_validate =
+static char *guan11_fields[] = {
+  "first", "last",
+  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
+  "status", "clearid", "class", "comments", "signature", "secure",
+  "winhomedir", "winprofiledir", "modtime", "modby", "modwith", "created",
+  "creator",
+};
+
+static char *guan_fields[] = {
+  "first", "last",
+  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
+  "status", "clearid", "class", "comments", "signature", "secure",
+  "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration",
+  "modtime", "modby", "modwith", "created", "creator",
+};
+
+static struct validate guan2_validate =
 {
   0,
   0,
@@ -155,6 +221,19 @@ static struct validate guan_validate =
   followup_fix_modby,
 };
 
+static struct validate guan_validate =
+{
+  0,
+  0,
+  0,
+  0,
+  0,
+  0,
+  0,
+  0,
+  followup_get_user,
+};
+
 static char *guac2_fields[] = {
   "class",
   "login", "unix_uid", "shell", "last", "first", "middle", "status",
@@ -162,11 +241,27 @@ static char *guac2_fields[] = {
   "modtime", "modby", "modwith",
 };
 
-static char *guac_fields[] = {
+static char *guac3_fields[] = {
   "class",
   "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", 
   "status", "clearid", "class", "comments", "signature", "secure",
-  "modtime", "modby", "modwith",
+  "modtime", "modby", "modwith", "created", "creator",
+};
+
+static char *guac11_fields[] = {
+  "class",
+  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
+  "status", "clearid", "class", "comments", "signature", "secure",
+  "winhomedir", "winprofiledir", "modtime", "modby", "modwith", "created",
+  "creator",
+};
+
+static char *guac_fields[] = {
+  "class",
+  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
+  "status", "clearid", "class", "comments", "signature", "secure",
+  "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration",
+  "modtime", "modby", "modwith", "created", "creator",
 };
 
 static char *guam2_fields[] = {
@@ -176,11 +271,49 @@ static char *guam2_fields[] = {
   "modtime", "modby", "modwith",
 };
 
-static char *guam_fields[] = {
+static char *guam3_fields[] = {
   "clearid",
   "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", 
   "status", "clearid", "class", "comments", "signature", "secure",
-  "modtime", "modby", "modwith",
+  "modtime", "modby", "modwith", "created", "creator", 
+};
+
+static char *guam11_fields[] = {
+  "clearid",
+  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
+  "status", "clearid", "class", "comments", "signature", "secure",
+  "winhomedir", "winprofiledir", "modtime", "modby", "modwith", "created",
+  "creator", 
+};
+
+static char *guam_fields[] = {
+  "clearid",
+  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
+  "status", "clearid", "class", "comments", "signature", "secure",
+  "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration",
+  "modtime", "modby", "modwith", "created", "creator", 
+};
+
+static char *guas_fields[] = {
+  "sponsor_type", "sponsor_name",
+  "login",
+};
+
+static struct valobj guas_valobj[] = {
+  {V_TYPE, 0, 0, "gaus", 0, MR_TYPE},
+  {V_TYPEDATA, 1, 0, 0, 0, MR_NO_MATCH},
+};
+
+static struct validate guas_validate = {
+  guas_valobj,
+  2,
+  0,
+  0,
+  0,
+  0,
+  access_member,
+  0,
+  get_user_account_by_sponsor,
 };
 
 static char *gubu2_fields[] = {
@@ -192,10 +325,11 @@ static char *gubu2_fields[] = {
 static char *gubu_fields[] = {
   "unix_uid",
   "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", 
-  "status", "clearid", "class", "modtime", "modby", "modwith",
+  "status", "clearid", "class", "modtime", "modby", "modwith", "created",
+  "creator",
 };
 
-static struct validate gubu_validate =
+static struct validate gubu2_validate =
 {
   VOnum0,
   1,
@@ -208,6 +342,19 @@ static struct validate gubu_validate =
   followup_fix_modby,
 };
 
+static struct validate gubu_validate =
+{
+  VOnum0,
+  1,
+  0,
+  0,
+  0,
+  0,
+  access_login,
+  0,
+  followup_get_user,
+};
+
 static char *gubn2_fields[] = {
   "first", "last",
   "login", "unix_uid", "shell", "last", "first", "middle", "status",
@@ -217,10 +364,11 @@ static char *gubn2_fields[] = {
 static char *gubn_fields[] = {
   "first", "last",
   "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", 
-  "status", "clearid", "class", "modtime", "modby", "modwith",
+  "status", "clearid", "class", "modtime", "modby", "modwith", "created",
+  "creator",
 };
 
-static struct validate gubn_validate =
+static struct validate gubn2_validate =
 {
   0,
   0,
@@ -233,6 +381,19 @@ static struct validate gubn_validate =
   followup_fix_modby,
 };
 
+static struct validate gubn_validate =
+{
+  0,
+  0,
+  0,
+  0,
+  0,
+  0,
+  0,
+  0,
+  followup_get_user,
+};
+
 static char *gubc2_fields[] = {
   "class",
   "login", "unix_uid", "shell", "last", "first", "middle", "status",
@@ -243,6 +404,7 @@ static char *gubc_fields[] = {
   "class",
   "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", 
   "status", "clearid", "class", "modtime", "modby", "modwith",
+  "created", "creator",
 };
 
 static char *gubm2_fields[] = {
@@ -255,6 +417,7 @@ static char *gubm_fields[] = {
   "clearid",
   "login", "unix_uid", "shell", "winconsoleshell", "last", "first", 
   "middle", "status", "clearid", "class", "modtime", "modby", "modwith",
+  "created", "creator",
 };
 
 static char *auac2_fields[] = {
@@ -262,11 +425,23 @@ static char *auac2_fields[] = {
   "clearid", "class", "comments", "signature", "secure",
 };
 
-static char *auac_fields[] = {
+static char *auac3_fields[] = {
   "login", "unix_uid", "shell", "winconsoleshell", "last", "first", 
   "middle", "status", "clearid", "class", "comments", "signature", "secure",
 };
 
+static char *auac11_fields[] = {
+  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
+  "status", "clearid", "class", "comments", "signature", "secure",
+  "winhomedir", "winprofiledir",
+};
+
+static char *auac_fields[] = {
+  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
+  "status", "clearid", "class", "comments", "signature", "secure",
+  "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration",
+};
+
 static struct valobj auac2_valobj[] = {
   {V_CHAR, 0, USERS_TABLE, "login"},
   {V_NUM, 1},
@@ -281,6 +456,38 @@ static struct valobj auac2_valobj[] = {
   {V_NUM, 11},
 };
 
+static struct valobj auac3_valobj[] = {
+  {V_CHAR, 0, USERS_TABLE, "login"},
+  {V_NUM, 1},
+  {V_CHAR, 2, USERS_TABLE, "shell"},
+  {V_CHAR, 3, USERS_TABLE, "winconsoleshell"},
+  {V_CHAR, 4, USERS_TABLE, "last"},
+  {V_CHAR, 5, USERS_TABLE, "first"},
+  {V_CHAR, 6, USERS_TABLE, "middle"},
+  {V_NUM, 7},
+  {V_CHAR, 8, USERS_TABLE, "clearid"},
+  {V_TYPE, 9, 0, "class", 0, MR_BAD_CLASS},
+  {V_ID, 10, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
+  {V_NUM, 12},
+};
+
+static struct valobj auac11_valobj[] = {
+  {V_CHAR, 0, USERS_TABLE, "login"},
+  {V_NUM, 1},
+  {V_CHAR, 2, USERS_TABLE, "shell"},
+  {V_CHAR, 3, USERS_TABLE, "winconsoleshell"},
+  {V_CHAR, 4, USERS_TABLE, "last"},
+  {V_CHAR, 5, USERS_TABLE, "first"},
+  {V_CHAR, 6, USERS_TABLE, "middle"},
+  {V_NUM, 7},
+  {V_CHAR, 8, USERS_TABLE, "clearid"},
+  {V_TYPE, 9, 0, "class", 0, MR_BAD_CLASS},
+  {V_ID, 10, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
+  {V_NUM, 12},
+  {V_LEN, 13, USERS_TABLE, "winhomedir"},
+  {V_LEN, 14, USERS_TABLE, "winprofiledir"},
+};
+
 static struct valobj auac_valobj[] = {
   {V_CHAR, 0, USERS_TABLE, "login"},
   {V_NUM, 1},
@@ -294,6 +501,11 @@ static struct valobj auac_valobj[] = {
   {V_TYPE, 9, 0, "class", 0, MR_BAD_CLASS},
   {V_ID, 10, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
   {V_NUM, 12},
+  {V_LEN, 13, USERS_TABLE, "winhomedir"},
+  {V_LEN, 14, USERS_TABLE, "winprofiledir"},
+  {V_TYPE, 15, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 16, 0, 0, "list_id", MR_ACE},
+  {V_CHAR, 17, USERS_TABLE, "expiration"},
 };
 
 static struct validate auac2_validate = {
@@ -308,9 +520,33 @@ static struct validate auac2_validate = {
   followup_ausr,
 };
 
+static struct validate auac3_validate = {
+  auac3_valobj,
+  12,
+  "login",
+  "login = '%s'",
+  1,
+  "users_id",
+  0,
+  setup_ausr,
+  followup_ausr,
+};
+
+static struct validate auac11_validate = {
+  auac11_valobj,
+  14,
+  "login",
+  "login = '%s'",
+  1,
+  "users_id",
+  0,
+  setup_ausr,
+  followup_ausr,
+};
+
 static struct validate auac_validate = {
   auac_valobj,
-  12,
+  17,
   "login",
   "login = '%s'",
   1,
@@ -332,9 +568,33 @@ static struct validate ausr2_validate = {
   followup_ausr,
 };
 
+static struct validate ausr3_validate = {
+  auac3_valobj,
+  10,
+  "login",
+  "login = '%s'",
+  1,
+  "users_id",
+  0,
+  setup_ausr,
+  followup_ausr,
+};
+
+static struct validate ausr11_validate = {
+  auac11_valobj,
+  12,
+  "login",
+  "login = '%s'",
+  1,
+  "users_id",
+  0,
+  setup_ausr,
+  followup_ausr,
+};
+
 static struct validate ausr_validate = {
   auac_valobj,
-  10,
+  15,
   "login",
   "login = '%s'",
   1,
@@ -371,12 +631,26 @@ static char *uuac2_fields[] = {
   "clearid", "class", "comments", "signature", "secure",
 };
 
-static char *uuac_fields[] = {
+static char *uuac3_fields[] = {
   "login",
   "newlogin", "unix_uid", "shell", "winconsoleshell", "last", "first", 
   "middle", "status", "clearid", "class", "comments", "signature", "secure",
 };
 
+static char *uuac11_fields[] = {
+  "login",
+  "newlogin", "unix_uid", "shell", "winconsoleshell", "last", "first",
+  "middle", "status", "clearid", "class", "comments", "signature", "secure",
+  "winhomedir", "winprofiledir",
+};
+
+static char *uuac_fields[] = {
+  "login",
+  "newlogin", "unix_uid", "shell", "winconsoleshell", "last", "first",
+  "middle", "status", "clearid", "class", "comments", "signature", "secure",
+  "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration",
+};
+
 static struct valobj uuac2_valobj[] = {
   {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
   {V_RENAME, 1, USERS_TABLE, "login", "users_id", MR_NOT_UNIQUE},
@@ -392,6 +666,40 @@ static struct valobj uuac2_valobj[] = {
   {V_NUM, 12},
 };
   
+static struct valobj uuac3_valobj[] = {
+  {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
+  {V_RENAME, 1, USERS_TABLE, "login", "users_id", MR_NOT_UNIQUE},
+  {V_NUM, 2},
+  {V_CHAR, 3, USERS_TABLE, "shell"},
+  {V_CHAR, 4, USERS_TABLE, "winconsoleshell"},
+  {V_CHAR, 5, USERS_TABLE, "first"},
+  {V_CHAR, 6, USERS_TABLE, "last"},
+  {V_CHAR, 7, USERS_TABLE, "middle"},
+  {V_NUM, 8},
+  {V_CHAR, 9, USERS_TABLE, "clearid"},
+  {V_TYPE, 10, 0, "class", 0, MR_BAD_CLASS},
+  {V_ID, 11, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
+  {V_NUM, 13},
+};
+
+static struct valobj uuac11_valobj[] = {
+  {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
+  {V_RENAME, 1, USERS_TABLE, "login", "users_id", MR_NOT_UNIQUE},
+  {V_NUM, 2},
+  {V_CHAR, 3, USERS_TABLE, "shell"},
+  {V_CHAR, 4, USERS_TABLE, "winconsoleshell"},
+  {V_CHAR, 5, USERS_TABLE, "first"},
+  {V_CHAR, 6, USERS_TABLE, "last"},
+  {V_CHAR, 7, USERS_TABLE, "middle"},
+  {V_NUM, 8},
+  {V_CHAR, 9, USERS_TABLE, "clearid"},
+  {V_TYPE, 10, 0, "class", 0, MR_BAD_CLASS},
+  {V_ID, 11, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
+  {V_NUM, 13},
+  {V_LEN, 14, USERS_TABLE, "winhomedir"},
+  {V_LEN, 15, USERS_TABLE, "winprofiledir"},
+};
+
 static struct valobj uuac_valobj[] = {
   {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
   {V_RENAME, 1, USERS_TABLE, "login", "users_id", MR_NOT_UNIQUE},
@@ -406,6 +714,11 @@ static struct valobj uuac_valobj[] = {
   {V_TYPE, 10, 0, "class", 0, MR_BAD_CLASS},
   {V_ID, 11, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
   {V_NUM, 13},
+  {V_LEN, 14, USERS_TABLE, "winhomedir"},
+  {V_LEN, 15, USERS_TABLE, "winprofiledir"},
+  {V_TYPE, 16, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 17, 0, 0, "list_id", MR_ACE},
+  {V_CHAR, 18, USERS_TABLE, "expiration"},
 };
 
 static struct validate uuac2_validate = {
@@ -420,8 +733,8 @@ static struct validate uuac2_validate = {
   set_modtime_by_id,
 };
 
-static struct validate uuac_validate = {
-  uuac_valobj,
+static struct validate uuac3_validate = {
+  uuac3_valobj,
   13,
   0,
   0,
@@ -432,6 +745,30 @@ static struct validate uuac_validate = {
   set_modtime_by_id,
 };
 
+static struct validate uuac11_validate = {
+  uuac11_valobj,
+  15,
+  0,
+  0,
+  0,
+  "users_id",
+  access_update_user,
+  setup_ausr,
+  set_modtime_by_id,
+};
+
+static struct validate uuac_validate = {
+  uuac_valobj,
+  18,
+  0,
+  0,
+  0,
+  "users_id",
+  access_update_user,
+  setup_ausr,
+  set_modtime_by_id,
+};
+
 static struct validate uusr2_validate = {
   uuac2_valobj,
   10,
@@ -444,9 +781,33 @@ static struct validate uusr2_validate = {
   set_modtime_by_id,
 };
 
+static struct validate uusr3_validate = {
+  uuac3_valobj,
+  11,
+  0,
+  0,
+  0,
+  "users_id",
+  0,
+  setup_ausr,
+  set_modtime_by_id,
+};
+
+static struct validate uusr11_validate = {
+  uuac11_valobj,
+  13,
+  0,
+  0,
+  0,
+  "users_id",
+  0,
+  setup_ausr,
+  set_modtime_by_id,
+};
+
 static struct validate uusr_validate = {
   uuac_valobj,
-  11,
+  16,
   0,
   0,
   0,
@@ -783,7 +1144,7 @@ static char *ghbh2_fields[] = {
   "inuse", "modtime", "modby", "modwith",
 };
 
-static char *ghst_fields[] = {
+static char *ghst6_fields[] = {
   "name", "address", "location", "network",
   "name", "vendor", "model", "os", "location", "contact", "billing_contact",
   "use", "status", "status_change", "network", "address", "ace_type",
@@ -791,7 +1152,7 @@ static char *ghst_fields[] = {
   "inuse", "modtime", "modby", "modwith",
 };
 
-static char *ghbh_fields[] = {
+static char *ghbh6_fields[] = {
   "hwaddr",
   "name", "vendor", "model", "os", "location", "contact", "billing_contact",
   "use", "status", "status_change", "network", "address", "ace_type",
@@ -799,6 +1160,30 @@ static char *ghbh_fields[] = {
   "inuse", "modtime", "modby", "modwith",
 };
 
+static char *ghst_fields[] = {
+  "name", "address", "location", "network",
+  "name", "vendor", "model", "os", "location", "contact", "billing_contact",
+  "account_number", "use", "status", "status_change", "network", "address", 
+  "ace_type", "ace_name", "admin_comment", "ops_comment", "created", "creator",
+  "inuse", "modtime", "modby", "modwith",
+};
+
+static char *ghbh_fields[] = {
+  "hwaddr",
+  "name", "vendor", "model", "os", "location", "contact", "billing_contact",
+  "account_number", "use", "status", "status_change", "network", "address", 
+  "ace_type", "ace_name", "admin_comment", "ops_comment", "created", "creator",
+  "inuse", "modtime", "modby", "modwith",
+};
+
+static char *ghba_fields[] = {
+  "account_number",
+  "name", "vendor", "model", "os", "location", "contact", "billing_contact",
+  "account_number", "use", "status", "status_change", "network", "address", 
+  "ace_type", "ace_name", "admin_comment", "ops_comment", "created", "creator",
+  "inuse", "modtime", "modby", "modwith",
+};
+
 static struct validate ghst_validate = {
   0,
   0,
@@ -806,8 +1191,8 @@ static struct validate ghst_validate = {
   0,
   0,
   0,
-  access_host,
   0,
+  setup_ghst,
   followup_ghst,
 };
 
@@ -850,13 +1235,13 @@ static struct validate ahst2_validate = {
   set_uppercase_modtime,
 };
 
-static char *ahst_fields[] = {
+static char *ahst6_fields[] = {
   "name", "vendor", "model", "os", "location", "contact", "billing_contact",
   "use", "status", "subnet", "address", "ace_type", "ace_name",
   "admin_comment", "ops_comment",
 };
 
-static struct valobj ahst_valobj[] = {
+static struct valobj ahst6_valobj[] = {
   {V_CHAR, 0, MACHINE_TABLE, "name"},
   {V_CHAR, 1, MACHINE_TABLE, "vendor"},
   {V_CHAR, 2, MACHINE_TABLE, "model"},
@@ -873,9 +1258,45 @@ static struct valobj ahst_valobj[] = {
   {V_ID, 14, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
 };
 
+static struct validate ahst6_validate = {
+  ahst6_valobj,
+  14,
+  "name",
+  "name = UPPER('%s')",
+  1,
+  "mach_id",
+  access_host,
+  setup_ahst,
+  set_uppercase_modtime,
+};
+
+static char *ahst_fields[] = {
+  "name", "vendor", "model", "os", "location", "contact", "billing_contact",
+  "account_number", "use", "status", "subnet", "address", "ace_type", 
+  "ace_name", "admin_comment", "ops_comment",
+};
+
+static struct valobj ahst_valobj[] = {
+  {V_CHAR, 0, MACHINE_TABLE, "name"},
+  {V_CHAR, 1, MACHINE_TABLE, "vendor"},
+  {V_CHAR, 2, MACHINE_TABLE, "model"},
+  {V_CHAR, 3, MACHINE_TABLE, "os"},
+  {V_CHAR, 4, MACHINE_TABLE, "location"},
+  {V_CHAR, 5, MACHINE_TABLE, "contact"},
+  {V_CHAR, 6, MACHINE_TABLE, "billing_contact"},
+  {V_CHAR, 7, MACHINE_TABLE, "account_number"},
+  {V_NUM, 8},
+  {V_NUM, 9},
+  {V_ID, 10, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
+  {V_TYPE, 12, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 13, 0, 0, 0, MR_ACE},
+  {V_ID, 14, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
+  {V_ID, 15, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
+};
+
 static struct validate ahst_validate = {
   ahst_valobj,
-  14,
+  15,
   "name",
   "name = UPPER('%s')",
   1,
@@ -922,14 +1343,14 @@ static struct validate uhst2_validate = {
   set_modtime_by_id,
 };
 
-static char *uhst_fields[] = {
+static char *uhst6_fields[] = {
   "name",
   "newname", "vendor", "model", "os", "location", "contact", "billing_contact",
   "use", "status", "subnet", "address", "ace_type", "ace_name",
   "admin_comment", "ops_comment",
 };
 
-static struct valobj uhst_valobj[] = {
+static struct valobj uhst6_valobj[] = {
   {V_CHAR, 0, MACHINE_TABLE, "name"},
   {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
   {V_RENAME, 1, MACHINE_TABLE, "name", "mach_id", MR_NOT_UNIQUE},
@@ -948,9 +1369,48 @@ static struct valobj uhst_valobj[] = {
   {V_ID, 15, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
 };
 
+static struct validate uhst6_validate = {
+  uhst6_valobj,
+  16,
+  0,
+  0,
+  0,
+  "mach_id",
+  access_host,
+  setup_ahst,
+  set_modtime_by_id,
+};
+
+static char *uhst_fields[] = {
+  "name",
+  "newname", "vendor", "model", "os", "location", "contact", "billing_contact",
+  "account_number", "use", "status", "subnet", "address", "ace_type", 
+  "ace_name", "admin_comment", "ops_comment",
+};
+
+static struct valobj uhst_valobj[] = {
+  {V_CHAR, 0, MACHINE_TABLE, "name"},
+  {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
+  {V_RENAME, 1, MACHINE_TABLE, "name", "mach_id", MR_NOT_UNIQUE},
+  {V_CHAR, 2, MACHINE_TABLE, "vendor"},
+  {V_CHAR, 3, MACHINE_TABLE, "model"},
+  {V_CHAR, 4, MACHINE_TABLE, "os"},
+  {V_CHAR, 5, MACHINE_TABLE, "location"},
+  {V_CHAR, 6, MACHINE_TABLE, "contact"},
+  {V_CHAR, 7, MACHINE_TABLE, "billing_contact"},
+  {V_CHAR, 8, MACHINE_TABLE, "account_number"},
+  {V_NUM, 9},
+  {V_NUM, 10},
+  {V_ID, 11, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
+  {V_TYPE, 13, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 14, 0, 0, 0, MR_ACE},
+  {V_ID, 15, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
+  {V_ID, 16, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
+};
+
 static struct validate uhst_validate = {
   uhst_valobj,
-  16,
+  17,
   0,
   0,
   0,
@@ -1048,12 +1508,19 @@ static struct validate dhal_validate = {
   0,
 };
 
-static char *gsnt_fields[] = {
+static char *gsnt2_fields[] = {
   "name",
   "name", "description", "address", "mask", "low", "high", "prefix",
   "ace_type", "ace_name", "modtime", "modby", "modwith"
 };
 
+static char *gsnt_fields[] = {
+  "name",
+  "name", "description", "status", "contact", "account_number", "address", 
+  "mask", "low", "high", "prefix", "ace_type", "ace_name", "modtime", 
+  "modby", "modwith"
+};
+
 static struct validate gsnt_validate = {
   0,
   0,
@@ -1066,12 +1533,12 @@ static struct validate gsnt_validate = {
   followup_gsnt,
 };
 
-static char *asnt_fields[] = {
+static char *asnt2_fields[] = {
   "name", "description", "address", "mask", "low", "high", "prefix",
   "ace_type", "ace_name",
 };
 
-static struct valobj asnt_valobj[] = {
+static struct valobj asnt2_valobj[] = {
   {V_CHAR, 0, SUBNET_TABLE, "name"},
   {V_LEN, 1, SUBNET_TABLE, "description"},
   {V_NUM, 2},
@@ -1083,9 +1550,9 @@ static struct valobj asnt_valobj[] = {
   {V_TYPEDATA, 8, 0, 0, 0, MR_ACE},
 };
 
-static struct validate asnt_validate =
+static struct validate asnt2_validate =
 {
-  asnt_valobj,
+  asnt2_valobj,
   9,
   "name",
   "name = UPPER('%s')",
@@ -1096,13 +1563,46 @@ static struct validate asnt_validate =
   set_uppercase_modtime,
 };
 
-static char *usnt_fields[] = {
+static char *asnt_fields[] = {
+  "name", "description", "status", "contact", "account_number", "address", 
+  "mask", "low", "high", "prefix", "ace_type", "ace_name",
+};
+
+static struct valobj asnt_valobj[] = {
+  {V_CHAR, 0, SUBNET_TABLE, "name"},
+  {V_LEN, 1, SUBNET_TABLE, "description"},
+  {V_NUM, 2},
+  {V_CHAR, 3, SUBNET_TABLE, "contact"},
+  {V_CHAR, 4, SUBNET_TABLE, "account_number"},
+  {V_NUM, 5},
+  {V_NUM, 6},
+  {V_NUM, 7},
+  {V_NUM, 8},
+  {V_LEN, 9, SUBNET_TABLE, "prefix"},
+  {V_TYPE, 10, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 11, 0, 0, 0, MR_ACE},
+};
+
+static struct validate asnt_validate =
+{
+  asnt_valobj,
+  12,
+  "name",
+  "name = UPPER('%s')",
+  1,
+  "snet_id",
+  0,
+  setup_asnt,
+  set_uppercase_modtime,
+};
+
+static char *usnt2_fields[] = {
   "name",
   "newname", "description", "address", "mask", "low", "high", "prefix",
   "ace_type", "ace_name",
 };
 
-static struct valobj usnt_valobj[] = {
+static struct valobj usnt2_valobj[] = {
   {V_ID, 0, SUBNET_TABLE, "name", "snet_id", MR_NO_MATCH},
   {V_RENAME, 1, SUBNET_TABLE, "name", "snet_id", MR_NOT_UNIQUE},
   {V_LEN, 2, SUBNET_TABLE, "description"},
@@ -1115,9 +1615,9 @@ static struct valobj usnt_valobj[] = {
   {V_TYPEDATA, 9, 0, 0, 0, MR_ACE},
 };
 
-static struct validate usnt_validate =
+static struct validate usnt2_validate =
 {
-  usnt_valobj,
+  usnt2_valobj,
   10,
   "name",
   "snet_id = %d",
@@ -1128,6 +1628,41 @@ static struct validate usnt_validate =
   set_modtime_by_id,
 };
 
+static char *usnt_fields[] = {
+  "name",
+  "newname", "description", "status", "contact", "account_number", "address", 
+  "mask", "low", "high", "prefix", "ace_type", "ace_name",
+};
+
+static struct valobj usnt_valobj[] = {
+  {V_ID, 0, SUBNET_TABLE, "name", "snet_id", MR_NO_MATCH},
+  {V_RENAME, 1, SUBNET_TABLE, "name", "snet_id", MR_NOT_UNIQUE},
+  {V_LEN, 2, SUBNET_TABLE, "description"},
+  {V_NUM, 3},
+  {V_CHAR, 4, SUBNET_TABLE, "contact"},
+  {V_CHAR, 5, SUBNET_TABLE, "account_number"},
+  {V_NUM, 6},
+  {V_NUM, 7},
+  {V_NUM, 8},
+  {V_NUM, 9},
+  {V_LEN, 10, SUBNET_TABLE, "prefix"},
+  {V_TYPE, 11, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 12, 0, 0, 0, MR_ACE},
+};
+
+static struct validate usnt_validate =
+{
+  usnt_valobj,
+  13,
+  "name",
+  "snet_id = %d",
+  1,
+  "snet_id",
+  0,
+  setup_asnt,
+  set_modtime_by_id,
+};
+
 static char *dsnt_fields[] = {
   "name",
 };
@@ -1291,13 +1826,20 @@ static char *glin3_fields[] = {
   "modwith",
 };
 
-static char *glin_fields[] = {
+static char *glin4_fields[] = {
   "name",
   "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
   "nfsgroup", "ace_type", "ace_name", "memace_type", "memace_name", 
   "description", "modtime", "modby", "modwith",
 };
 
+static char *glin_fields[] = {
+  "name",
+  "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
+  "nfsgroup", "mailman", "mailman_server", "ace_type", "ace_name", 
+  "memace_type", "memace_name", "description", "modtime", "modby", "modwith",
+};
+
 static struct validate glin_validate = {
   0,
   0,
@@ -1371,13 +1913,13 @@ static struct validate alis3_validate = {
   set_modtime,
 };
 
-static char *alis_fields[] = {
+static char *alis4_fields[] = {
   "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
   "nfsgroup", "ace_type", "ace_name", "memace_type", "memace_name", 
   "description",
 };
 
-static struct valobj alis_valobj[] = {
+static struct valobj alis4_valobj[] = {
   {V_CHAR, 0, LIST_TABLE, "name"},
   {V_NUM, 1},
   {V_NUM, 2},
@@ -1390,12 +1932,48 @@ static struct valobj alis_valobj[] = {
   {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
   {V_TYPE, 10, 0, "ace_type", 0, MR_ACE},
   {V_TYPEDATA, 11, 0, 0, "list_id", MR_ACE},
-  {V_LEN, 12, LIST_TABLE, "description"},
+  {V_LEN, 12, LIST_TABLE, "description"},
+};
+
+static struct validate alis4_validate = {
+  alis4_valobj,
+  13,
+  "name",
+  "name = '%s'",
+  1,
+  "list_id",
+  0,
+  setup_alis,
+  set_modtime,
+};
+
+static char *alis_fields[] = {
+  "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
+  "nfsgroup", "mailman", "mailman_server", "ace_type", "ace_name", 
+  "memace_type", "memace_name", "description",
+};
+
+static struct valobj alis_valobj[] = {
+  {V_CHAR, 0, LIST_TABLE, "name"},
+  {V_NUM, 1},
+  {V_NUM, 2},
+  {V_NUM, 3},
+  {V_NUM, 4},
+  {V_NUM, 5},
+  {V_NUM, 6},
+  {V_NUM, 7},
+  {V_NUM, 8},
+  {V_ID, 9, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
+  {V_TYPE, 10, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 11, 0, 0, "list_id", MR_ACE},
+  {V_TYPE, 12, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 13, 0, 0, "list_id", MR_ACE},
+  {V_LEN, 14, LIST_TABLE, "description"},
 };
 
 static struct validate alis_validate = {
   alis_valobj,
-  13,
+  15,
   "name",
   "name = '%s'",
   1,
@@ -1470,14 +2048,14 @@ static struct validate ulis3_validate = {
   set_modtime_by_id,
 };
 
-static char *ulis_fields[] = {
+static char *ulis4_fields[] = {
   "name",
   "newname", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
   "nfsgroup", "ace_type", "ace_name", "memace_type", "memace_name",
   "description",
 };
 
-static struct valobj ulis_valobj[] = {
+static struct valobj ulis4_valobj[] = {
   {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
   {V_RENAME, 1, LIST_TABLE, "name", "list_id", MR_NOT_UNIQUE},
   {V_NUM, 2},
@@ -1494,9 +2072,47 @@ static struct valobj ulis_valobj[] = {
   {V_LEN, 13, LIST_TABLE, "description"},
 };
 
+static struct validate ulis4_validate = {
+  ulis4_valobj,
+  14,
+  "name",
+  "list_id = %d",
+  1,
+  "list_id",
+  access_list,
+  setup_alis,
+  set_modtime_by_id,
+};
+
+static char *ulis_fields[] = {
+  "name",
+  "newname", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
+  "nfsgroup", "mailman", "mailman_server", "ace_type", "ace_name", 
+  "memace_type", "memace_name", "description",
+};
+
+static struct valobj ulis_valobj[] = {
+  {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
+  {V_RENAME, 1, LIST_TABLE, "name", "list_id", MR_NOT_UNIQUE},
+  {V_NUM, 2},
+  {V_NUM, 3},
+  {V_NUM, 4},
+  {V_NUM, 5},
+  {V_NUM, 6},
+  {V_NUM, 7},
+  {V_NUM, 8},
+  {V_NUM, 9},
+  {V_ID, 10, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
+  {V_TYPE, 11, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 12, 0, 0, "list_id", MR_ACE},
+  {V_TYPE, 13, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 14, 0, 0, "list_id", MR_ACE},
+  {V_LEN, 15, LIST_TABLE, "description"},
+};
+
 static struct validate ulis_validate = {
   ulis_valobj,
-  14,
+  16,
   "name",
   "list_id = %d",
   1,
@@ -2005,7 +2621,7 @@ static struct validate gfsl_validate = {
   0,
   0,
   0,
-  access_filesys,
+  0,
   0,
   followup_fix_modby,
 };
@@ -2312,7 +2928,7 @@ static struct validate gqbf_validate = {
   0,
   0,
   0,
-  access_filesys,
+  0,
   0,
   followup_gqot,
 };
@@ -2377,7 +2993,7 @@ static struct validate gnfq_validate = {
   0,
   0,
   0,
-  access_filesys,
+  0,
   0,
   followup_gqot,
 };
@@ -2949,7 +3565,7 @@ static struct validate aali_validate = {
   3,
   0,
   0,
-  0,
+  setup_aali,
   0,
 };
 
@@ -3034,81 +3650,298 @@ static struct validate _sdl_validate =
   _sdl_followup,
 };
 
-static char *gusl_fields[] = {
-  "login", "domain_sid", 
-  "login", "sid", "created",
+static char *gcon7_fields[] = {
+  "name",
+  "name", "description", "location", "contact",
+  "ace_type", "ace_name", "memace_type", "memace_name", "modtime", "modby", "modwith",
+};
+
+static struct validate gcon_validate = {
+  0,
+  0,
+  0,
+  0,
+  0,
+  0,
+  0,
+  0,
+  followup_gcon,
+};
+
+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 acon7_valobj[] = {
+  {V_CHAR, 0, CONTAINERS_TABLE, "name"},
+  {V_LEN, 1, CONTAINERS_TABLE, "description"},
+  {V_CHAR, 2, CONTAINERS_TABLE, "location"},
+  {V_CHAR, 3, CONTAINERS_TABLE, "contact"},
+  {V_TYPE, 4, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 5, 0, 0, 0, MR_ACE},
+  {V_TYPE, 6, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 7, 0, 0, 0, MR_ACE},
 };
 
-static struct validate gusl_validate =
+static struct validate acon7_validate =
 {
-  VOuser0,
+  acon7_valobj,
+  8,
+  "name",
+  "name = '%s'",
   1,
-  NULL,
-  NULL,
+  "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,
+  9,
+  "name",
+  "name = '%s'",
+  1,
+  "cnt_id",
+  0,
+  setup_acon,
+  set_modtime,
+};
+
+static char *ucon7_fields[] = {
+  "name",
+  "newname", "description", "location", "contact",
+  "ace_type", "ace_name", "memace_type", "memace_name",
+};
+
+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"},
+  {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 ucon7_validate =
+{
+  ucon7_valobj,
+  9,
   0,
   0,
   0,
   0,
+  access_container,
   0,
+  update_container,
 };
 
-static char *glsn_fields[] = {
-  "name", "domain_sid",
-  "name", "sid", "created",
+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 glsn_validate = 
+static struct validate ucon_validate =
 {
-  VOlist0,
+  ucon_valobj,
+  10,
+  0,
+  0,
+  0,
+  0,
+  access_container,
+  0,
+  update_container,
+};
+
+static char *dcon_fields[] = {
+  "name",
+};
+
+static struct validate dcon_validate =
+{
+  VOcon0,
   1,
-  NULL,
-  NULL,
   0,
   0,
   0,
   0,
   0,
+  setup_dcon,
+  0,
 };
 
-static char *ausl_fields[] = {
-  "login", "sid",
+static char *amcn_fields[] = {
+  "machine", "container",
 };
 
-static struct validate ausl_validate =
+static struct valobj amcn_valobj[] =   /* ADD_MACHINE_TO_CONTAINER */
+{                                      /* DELETE_MACHINE_FROM_CONTAINER */
+  {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
+  {V_ID, 1, CONTAINERS_TABLE, "name", "cnt_id", MR_CONTAINER},
+};
+
+static struct validate amcn_validate = /* for amtn and dmfn */
 {
-  VOuser0,
+  amcn_valobj,
+  2,
+  "mach_id",
+  "mach_id = %d",
+  1,
+  0,
+  access_container,
+  0,
+  set_mach_modtime_by_id,
+};
+
+static struct validate dmcn_validate = /* for amtn and dmfn */
+{
+  amcn_valobj,
+  2,
+  "mach_id",
+  "mach_id = %d and cnt_id = %d",
+  2,
+  0,
+  access_container,
+  0,
+  set_mach_modtime_by_id,
+};
+
+static char *gmnm_fields[] = {
+  "machine",
+  "machine", "container",
+};
+
+static char *gmoc_fields[] = {
+  "container",
+  "isrecursive",
+       "machine",
+  "container",
+};
+
+static struct validate gmoc_validate = 
+{
+  VOcon0,
+  1,
+  0,
+  0,
+  0,
+  0,
+  0,
+  0,
+  get_machines_of_container,
+};
+
+static char *gsoc_fields[] = {
+  "container",
+  "isrecursive",
+       "subcontainer",
+};
+
+static struct validate gsoc_validate = 
+{
+  VOcon0,
   1,
-  "sid",
-  "users_id = %d AND sid = '%s'",
+  0,
+  0,
+  0,
+  0,
+  0,
+  0,
+  get_subcontainers_of_container,
+};
+
+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 *alsn_fields[] = {
-  "name", "sid",
+static char *gcli_fields[] = {
+  "containername",
+  "containername", "listname",
 };
 
-static struct validate alsn_validate =
+static struct validate glic_validate = 
 {
   VOlist0,
   1,
-  "sid",
-  "list_id = %d AND sid = '%s'",
-  2,
+  NULL,
+  NULL,
+  0,
   0,
   0,
   0,
   0,
 };
 
-static char *gdds_fields[] = {
-  "sid",
+static char *glic_fields[] = {
+  "listname",
+  "containername", "listname",
 };
 
-\f
 /* Generalized Query Definitions */
 
 /* Multiple versions of the same query MUST be listed in ascending
@@ -3125,7 +3958,7 @@ struct query Queries[] = {
     "get_all_logins",
     "galo",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "u",
     USERS_TABLE,
     "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle FROM users u",
@@ -3142,7 +3975,7 @@ struct query Queries[] = {
     "get_all_logins",
     "galo",
     3,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "u",
     USERS_TABLE,
     "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle FROM users u",
@@ -3159,7 +3992,7 @@ struct query Queries[] = {
     "get_all_active_logins",
     "gaal",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "u",
     USERS_TABLE,
     "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle FROM users u",
@@ -3176,7 +4009,7 @@ struct query Queries[] = {
     "get_all_active_logins",
     "gaal",
     3,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "u",
     USERS_TABLE,
     "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle FROM users u",
@@ -3193,7 +4026,7 @@ struct query Queries[] = {
     "get_user_account_by_login",
     "gual",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "u",
     USERS_TABLE,
     "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
@@ -3202,7 +4035,7 @@ struct query Queries[] = {
     "u.login LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
     1,
     "u.login",
-    &gubl_validate,
+    &gubl2_validate,
   },
 
   {
@@ -3210,12 +4043,46 @@ struct query Queries[] = {
     "get_user_account_by_login",
     "gual",
     3,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
+    "u",
+    USERS_TABLE,
+    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
+    gual3_fields,
+    18,
+    "u.login LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
+    1,
+    "u.login",
+    &gubl_validate,
+  },
+
+  {
+    /* Q_GUAL - GET_USER_ACCOUNT_BY_LOGIN, v11 */
+    "get_user_account_by_login",
+    "gual",
+    11,
+    MR_Q_RETRIEVE,
+    "u",
+    USERS_TABLE,
+    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
+    gual11_fields,
+    20,
+    "u.login LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
+    1,
+    "u.login",
+    &gubl_validate,
+  },
+
+  {
+    /* Q_GUAL - GET_USER_ACCOUNT_BY_LOGIN, v12 */
+    "get_user_account_by_login",
+    "gual",
+    12,
+    MR_Q_RETRIEVE,
     "u",
     USERS_TABLE,
-    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
+    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
     gual_fields,
-    16,
+    23,
     "u.login LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
     1,
     "u.login",
@@ -3227,7 +4094,7 @@ struct query Queries[] = {
     "get_user_account_by_uid",
     "guau",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "u",
     USERS_TABLE,
     "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
@@ -3236,37 +4103,105 @@ struct query Queries[] = {
     "u.unix_uid = %s AND u.users_id != 0 AND u.comments = str.string_id",
     1,
     "u.login",
+    &gubu2_validate,
+  },
+
+  {
+    /* Q_GUAU - GET_USER_ACCOUNT_BY_UID, v3 */
+    "get_user_account_by_uid",
+    "guau",
+    3,
+    MR_Q_RETRIEVE,
+    "u",
+    USERS_TABLE,
+    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
+    guau3_fields,
+    18,
+    "u.unix_uid = %s AND u.users_id != 0 AND u.comments = str.string_id",
+    1,
+    "u.login",
+    &gubu_validate,
+  },
+
+  {
+    /* Q_GUAU - GET_USER_ACCOUNT_BY_UID, v11 */
+    "get_user_account_by_uid",
+    "guau",
+    11,
+    MR_Q_RETRIEVE,
+    "u",
+    USERS_TABLE,
+    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
+    guau3_fields,
+    20,
+    "u.unix_uid = %s AND u.users_id != 0 AND u.comments = str.string_id",
+    1,
+    "u.login",
+    &gubu_validate,
+  }, 
+
+  {
+    /* Q_GUAU - GET_USER_ACCOUNT_BY_UID, v12 */
+    "get_user_account_by_uid",
+    "guau",
+    12,
+    MR_Q_RETRIEVE,
+    "u",
+    USERS_TABLE,
+    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
+    guau_fields,
+    23,
+    "u.unix_uid = %s AND u.users_id != 0 AND u.comments = str.string_id",
+    1,
+    "u.login",
     &gubu_validate,
+  }, 
+
+  {
+    /* Q_GUAN - GET_USER_ACCOUNT_BY_NAME, v2 */
+    "get_user_account_by_name",
+    "guan",
+    2,
+    MR_Q_RETRIEVE,
+    "u",
+    USERS_TABLE,
+    "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
+    guan2_fields,
+    15,
+    "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0 and u.comments = str.string_id",
+    2,
+    "u.login",
+    &guan2_validate,
   },
 
   {
-    /* Q_GUAU - GET_USER_ACCOUNT_BY_UID, v3 */
-    "get_user_account_by_uid",
-    "guau",
+    /* Q_GUAN - GET_USER_ACCOUNT_BY_NAME, v3 */
+    "get_user_account_by_name",
+    "guan",
     3,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "u",
     USERS_TABLE,
-    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
-    guau_fields,
-    16,
-    "u.unix_uid = %s AND u.users_id != 0 AND u.comments = str.string_id",
-    1,
+    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
+    guan3_fields,
+    18,
+    "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0 and u.comments = str.string_id",
+    2,
     "u.login",
-    &gubu_validate,
+    &guan_validate,
   },
 
   {
-    /* Q_GUAN - GET_USER_ACCOUNT_BY_NAME, v2 */
+    /* Q_GUAN - GET_USER_ACCOUNT_BY_NAME, v11 */
     "get_user_account_by_name",
     "guan",
-    2,
-    RETRIEVE,
+    11,
+    MR_Q_RETRIEVE,
     "u",
     USERS_TABLE,
-    "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
-    guan2_fields,
-    15,
+    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
+    guan11_fields,
+    20,
     "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0 and u.comments = str.string_id",
     2,
     "u.login",
@@ -3274,16 +4209,16 @@ struct query Queries[] = {
   },
 
   {
-    /* Q_GUAN - GET_USER_ACCOUNT_BY_NAME, v3 */
+    /* Q_GUAN - GET_USER_ACCOUNT_BY_NAME, v12 */
     "get_user_account_by_name",
     "guan",
-    3,
-    RETRIEVE,
+    12,
+    MR_Q_RETRIEVE,
     "u",
     USERS_TABLE,
-    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
+    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
     guan_fields,
-    16,
+    23,
     "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0 and u.comments = str.string_id",
     2,
     "u.login",
@@ -3295,7 +4230,7 @@ struct query Queries[] = {
     "get_user_account_by_class",
     "guac",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "u",
     USERS_TABLE,
     "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
@@ -3312,16 +4247,50 @@ struct query Queries[] = {
     "get_user_account_by_class",
     "guac",
     3,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
+    "u",
+    USERS_TABLE,
+    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
+    guac3_fields,
+    18,
+    "u.type = UPPER('%s') AND u.users_id != 0 AND u.comments = str.string_id",
+    1,
+    "u.login",
+    &guan_validate,
+  },
+
+  {
+    /* Q_GUAC - GET_USER_ACCOUNT_BY_CLASS, v11 */
+    "get_user_account_by_class",
+    "guac",
+    11,
+    MR_Q_RETRIEVE,
+    "u",
+    USERS_TABLE,
+    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
+    guac11_fields,
+    20,
+    "u.type = UPPER('%s') AND u.users_id != 0 AND u.comments = str.string_id",
+    1,
+    "u.login",
+    &guan_validate,
+  },
+
+  {
+    /* Q_GUAC - GET_USER_ACCOUNT_BY_CLASS, v12 */
+    "get_user_account_by_class",
+    "guac",
+    12,
+    MR_Q_RETRIEVE,
     "u",
     USERS_TABLE,
-    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
+    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
     guac_fields,
-    16,
+    23,
     "u.type = UPPER('%s') AND u.users_id != 0 AND u.comments = str.string_id",
     1,
     "u.login",
-    &VDfix_modby,
+    &guan_validate,
   },
 
   {
@@ -3329,7 +4298,7 @@ struct query Queries[] = {
     "get_user_account_by_id",
     "guai",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "u",
     USERS_TABLE,
     "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
@@ -3346,16 +4315,67 @@ struct query Queries[] = {
     "get_user_account_by_id",
     "guai",
     3,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "u",
     USERS_TABLE,
-    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
+    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
     guam_fields,
-    16,
+    18,
     "u.clearid LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
     1,
     "u.login",
-    &VDfix_modby,
+    &guan_validate,
+  },
+
+  {
+    /* Q_GUAM - GET_USER_ACCOUNT_BY_MITID, v11 */
+    "get_user_account_by_id",
+    "guai",
+    11,
+    MR_Q_RETRIEVE,
+    "u",
+    USERS_TABLE,
+    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
+    guam11_fields,
+    20,
+    "u.clearid LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
+    1,
+    "u.login",
+    &guan_validate,
+  },
+
+  {
+    /* Q_GUAM - GET_USER_ACCOUNT_BY_MITID, v12 */
+    "get_user_account_by_id",
+    "guai",
+    12,
+    MR_Q_RETRIEVE,
+    "u",
+    USERS_TABLE,
+    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
+    guam_fields,
+    23,
+    "u.clearid LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
+    1,
+    "u.login",
+    &guan_validate,
+  },
+
+  {
+    /* Q_GUAS - GET_USER_ACCOUNT_BY_SPONSOR, v12 */
+    "get_user_account_by_sponsor",
+    "guas",
+    12,
+    MR_Q_RETRIEVE,
+    0,
+    0,
+    0,
+    guas_fields,
+    1,
+    0,
+    2,
+    NULL,
+    &guas_validate,
   },
 
   {
@@ -3363,7 +4383,7 @@ struct query Queries[] = {
     "get_user_by_login",
     "gubl",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "u",
     USERS_TABLE,
     "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
@@ -3372,7 +4392,7 @@ struct query Queries[] = {
     "u.login LIKE '%s' AND u.users_id != 0",
     1,
     "u.login",
-    &gubl_validate,
+    &gubl2_validate,
   },
 
   {
@@ -3380,12 +4400,12 @@ struct query Queries[] = {
     "get_user_by_login",
     "gubl",
     3,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "u",
     USERS_TABLE,
-    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
+    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u",
     gubl_fields,
-    13,
+    15,
     "u.login LIKE '%s' AND u.users_id != 0",
     1,
     "u.login",
@@ -3397,7 +4417,7 @@ struct query Queries[] = {
     "get_user_by_uid",
     "gubu",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "u",
     USERS_TABLE,
     "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
@@ -3406,7 +4426,7 @@ struct query Queries[] = {
     "u.unix_uid = %s AND u.users_id != 0",
     1,
     "u.login",
-    &gubu_validate,
+    &gubu2_validate,
   },
 
   {
@@ -3414,12 +4434,12 @@ struct query Queries[] = {
     "get_user_by_uid",
     "gubu",
     3,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "u",
     USERS_TABLE,
-    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
+    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u",
     gubu_fields,
-    13,
+    15,
     "u.unix_uid = %s AND u.users_id != 0",
     1,
     "u.login",
@@ -3431,7 +4451,7 @@ struct query Queries[] = {
     "get_user_by_name",
     "gubn",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "u",
     USERS_TABLE,
     "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
@@ -3440,7 +4460,7 @@ struct query Queries[] = {
     "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0",
     2,
     "u.login",
-    &gubn_validate,
+    &gubn2_validate,
   },
 
   {
@@ -3448,12 +4468,12 @@ struct query Queries[] = {
     "get_user_by_name",
     "gubn",
     3,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "u",
     USERS_TABLE,
-    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
+    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u",
     gubn_fields,
-    13,
+    15,
     "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0",
     2,
     "u.login",
@@ -3465,7 +4485,7 @@ struct query Queries[] = {
     "get_user_by_class",
     "gubc",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "u",
     USERS_TABLE,
     "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
@@ -3482,16 +4502,16 @@ struct query Queries[] = {
     "get_user_by_class",
     "gubc",
     3,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "u",
     USERS_TABLE,
-    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
+    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS') FROM users u",
     gubc_fields,
-    13,
+    15,
     "u.type = UPPER('%s') AND u.users_id != 0",
     1,
     "u.login",
-    &VDfix_modby,
+    &guan_validate,
   },
 
   {
@@ -3499,7 +4519,7 @@ struct query Queries[] = {
     "get_user_by_mitid",
     "gubm",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "u",
     USERS_TABLE,
     "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
@@ -3516,16 +4536,16 @@ struct query Queries[] = {
     "get_user_by_mitid",
     "gubm",
     3,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "u",
     USERS_TABLE,
-    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
+    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u",
     gubm_fields,
-    13,
+    15,
     "u.clearid LIKE '%s' AND u.users_id != 0",
     1,
     "u.login",
-    &VDfix_modby,
+    &guan_validate,
   },
 
   {
@@ -3533,7 +4553,7 @@ struct query Queries[] = {
     "add_user_account",
     "auac",
     2,
-    APPEND,
+    MR_Q_APPEND,
     "u",
     USERS_TABLE,
     /* We set signature to "NVL(CHR(0), '%s')", which is to say, "CHR(0)",
@@ -3553,18 +4573,58 @@ struct query Queries[] = {
     "add_user_account",
     "auac",
     3,
-    APPEND,
+    MR_Q_APPEND,
     "u",
     USERS_TABLE,
     /* We set signature to "NVL(CHR(0), '%s')", which is to say, "CHR(0)",
      * but using up one argv element.
      */
-    "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, users_id) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', %d, NVL(CHR(0), '%s'), %s, %s)",
-    auac_fields,
+    "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, users_id, created, creator) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', %d, NVL(CHR(0), '%s'), %s, %s, SYSDATE, %s)",
+    auac3_fields,
     13,
     NULL,
     0,
     NULL,
+    &auac3_validate,
+  },
+
+  {
+    /* Q_AUAC - ADD_USER_ACCOUNT, v11 */  /* uses prefetch_value() for users_id */
+    "add_user_account",
+    "auac",
+    11,
+    MR_Q_APPEND,
+    "u",
+    USERS_TABLE,
+    /* We set signature to "NVL(CHR(0), '%s')", which is to say, "CHR(0)",
+     * but using up one argv element.
+     */
+    "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, winhomedir, winprofiledir, users_id, created, creator) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', %d, NVL(CHR(0), '%s'), %s, NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, SYSDATE, %s)",
+    auac11_fields,
+    15,
+    NULL,
+    0,
+    NULL,
+    &auac11_validate,
+  },
+
+  {
+    /* Q_AUAC - ADD_USER_ACCOUNT, v12 */  /* uses prefetch_value() for users_id */
+    "add_user_account",
+    "auac",
+    12,
+    MR_Q_APPEND,
+    "u",
+    USERS_TABLE,
+    /* We set signature to "NVL(CHR(0), '%s')", which is to say, "CHR(0)",
+     * but using up one argv element.
+     */
+    "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, winhomedir, winprofiledir, sponsor_type, sponsor_id, expiration, users_id, created, creator) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', %d, NVL(CHR(0), '%s'), %s, NVL('%s', CHR(0)), NVL('%s', CHR(0)), '%s', %d, NVL('%s', CHR(0)), %s, SYSDATE, %s)",
+    auac_fields,
+    18,
+    NULL,
+    0,
+    NULL,
     &auac_validate,
   },
 
@@ -3573,7 +4633,7 @@ struct query Queries[] = {
     "add_user",
     "ausr",
     2,
-    APPEND,
+    MR_Q_APPEND,
     "u",
     USERS_TABLE,
     "INTO users (login, unix_uid, shell, last, first, middle, status, clearid, type, comments, signature, secure, users_id) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', 0, CHR(0), 0, %s)",
@@ -3590,15 +4650,49 @@ struct query Queries[] = {
     "add_user",
     "ausr",
     3,
-    APPEND,
+    MR_Q_APPEND,
     "u",
     USERS_TABLE,
-    "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, users_id) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', 0, CHR(0), 0, %s)",
-    auac_fields,
+    "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, users_id, created, creator) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', 0, CHR(0), 0, %s, SYSDATE, %s)",
+    auac3_fields,
     10,
     0,
     0,
     NULL,
+    &ausr3_validate,
+  },
+
+  {
+    /* Q_AUSR - ADD_USER, v11 */  /* uses prefetch_value() for users_id */
+    "add_user",
+    "ausr",
+    11,
+    MR_Q_APPEND,
+    "u",
+    USERS_TABLE,
+    "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, winhomedir, winprofiledir, users_id, created, creator) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', 0, CHR(0), 0, NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, SYSDATE, %s)",
+    auac11_fields,
+    12,
+    0,
+    0,
+    NULL,
+    &ausr11_validate,
+  },
+
+  {
+    /* Q_AUSR - ADD_USER, v12 */  /* uses prefetch_value() for users_id */
+    "add_user",
+    "ausr",
+    12,
+    MR_Q_APPEND,
+    "u",
+    USERS_TABLE,
+    "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, winhomedir, winprofiledir, sponsor_type, sponsor_id, expiration, users_id, created, creator) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', 0, CHR(0), 0, NVL('%s', CHR(0)), NVL('%s', CHR(0)), '%s', %d, NVL('%s', CHR(0)), %s, SYSDATE, %s)",
+    auac_fields,
+    15,
+    0,
+    0,
+    NULL,
     &ausr_validate,
   },
 
@@ -3607,7 +4701,7 @@ struct query Queries[] = {
     "register_user",
     "rusr",
     2,
-    APPEND,
+    MR_Q_APPEND,
     0,
     0,
     0,
@@ -3624,7 +4718,7 @@ struct query Queries[] = {
     "update_user_account",
     "uuac",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     "u",
     USERS_TABLE,
     /* See comment in auac about signature. */
@@ -3642,16 +4736,52 @@ struct query Queries[] = {
     "update_user_account",
     "uuac",
     3,
-    UPDATE,
+    MR_Q_UPDATE,
     "u",
     USERS_TABLE,
     /* See comment in auac about signature. */
     "users SET login = '%s', unix_uid = %s, shell = '%s', winconsoleshell = '%s', last = NVL('%s', CHR(0)), first = NVL('%s', CHR(0)), middle = NVL('%s', CHR(0)), status = %s, clearid = NVL('%s', CHR(0)), type = '%s', comments = %d, signature = NVL(CHR(0), '%s'), secure = %s",
-    uuac_fields,
+    uuac3_fields,
     13,
     "users_id = %d",
     1,
     NULL,
+    &uuac3_validate,
+  },
+
+  {
+    /* Q_UUAC - UPDATE_USER_ACCOUNT, v11 */
+    "update_user_account",
+    "uuac",
+    11,
+    MR_Q_UPDATE,
+    "u",
+    USERS_TABLE,
+    /* See comment in auac about signature. */
+    "users SET login = '%s', unix_uid = %s, shell = '%s', winconsoleshell = '%s', last = NVL('%s', CHR(0)), first = NVL('%s', CHR(0)), middle = NVL('%s', CHR(0)), status = %s, clearid = NVL('%s', CHR(0)), type = '%s', comments = %d, signature = NVL(CHR(0), '%s'), secure = %s, winhomedir = NVL('%s', CHR(0)), winprofiledir = NVL('%s', CHR(0))",
+    uuac11_fields,
+    15,
+    "users_id = %d",
+    1,
+    NULL,
+    &uuac11_validate,
+  },
+
+  {
+    /* Q_UUAC - UPDATE_USER_ACCOUNT, v12 */
+    "update_user_account",
+    "uuac",
+    12,
+    MR_Q_UPDATE,
+    "u",
+    USERS_TABLE,
+    /* See comment in auac about signature. */
+    "users SET login = '%s', unix_uid = %s, shell = '%s', winconsoleshell = '%s', last = NVL('%s', CHR(0)), first = NVL('%s', CHR(0)), middle = NVL('%s', CHR(0)), status = %s, clearid = NVL('%s', CHR(0)), type = '%s', comments = %d, signature = NVL(CHR(0), '%s'), secure = %s, winhomedir = NVL('%s', CHR(0)), winprofiledir = NVL('%s', CHR(0)), sponsor_type = '%s', sponsor_id = %d, expiration = NVL('%s', CHR(0))",
+    uuac_fields,
+    18,
+    "users_id = %d",
+    1,
+    NULL,
     &uuac_validate,
   },
 
@@ -3660,7 +4790,7 @@ struct query Queries[] = {
     "update_user",
     "uusr",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     "u",
     USERS_TABLE,
     "users SET login = '%s', unix_uid = %s, shell = '%s', last = NVL('%s', CHR(0)), first = NVL('%s', CHR(0)), middle = NVL('%s', CHR(0)), status = %s, clearid = NVL('%s', CHR(0)),  type = '%s'",
@@ -3677,15 +4807,49 @@ struct query Queries[] = {
     "update_user",
     "uusr",
     3,
-    UPDATE,
+    MR_Q_UPDATE,
     "u",
     USERS_TABLE,
     "users SET login = '%s', unix_uid = %s, shell = '%s', winconsoleshell = '%s', last = NVL('%s', CHR(0)), first = NVL('%s', CHR(0)), middle = NVL('%s', CHR(0)), status = %s, clearid = NVL('%s', CHR(0)),  type = '%s'",
-    uuac_fields,
+    uuac3_fields,
     10,
     "users_id = %d",
     1,
     NULL,
+    &uusr3_validate,
+  },
+
+  {
+    /* Q_UUSR - UPDATE_USER, v11 */
+    "update_user",
+    "uusr",
+    11,
+    MR_Q_UPDATE,
+    "u",
+    USERS_TABLE,
+    "users SET login = '%s', unix_uid = %s, shell = '%s', winconsoleshell = '%s', last = NVL('%s', CHR(0)), first = NVL('%s', CHR(0)), middle = NVL('%s', CHR(0)), status = %s, clearid = NVL('%s', CHR(0)),  type = '%s', winhomedir = NVL('%s', CHR(0)), winprofiledir = NVL('%s', CHR(0)) ",
+    uuac11_fields,
+    12,
+    "users_id = %d",
+    1,
+    NULL,
+    &uusr11_validate,
+  },
+
+  {
+    /* Q_UUSR - UPDATE_USER, v12 */
+    "update_user",
+    "uusr",
+    12,
+    MR_Q_UPDATE,
+    "u",
+    USERS_TABLE,
+    "users SET login = '%s', unix_uid = %s, shell = '%s', winconsoleshell = '%s', last = NVL('%s', CHR(0)), first = NVL('%s', CHR(0)), middle = NVL('%s', CHR(0)), status = %s, clearid = NVL('%s', CHR(0)),  type = '%s', winhomedir = NVL('%s', CHR(0)), winprofiledir = NVL('%s', CHR(0)), sponsor_type = '%s', sponsor_id = %d, expiration = NVL('%s', CHR(0)) ",
+    uuac_fields,
+    15,
+    "users_id = %d",
+    1,
+    NULL,
     &uusr_validate,
   },
 
@@ -3694,7 +4858,7 @@ struct query Queries[] = {
     "update_user_shell",
     "uush",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     "u",
     USERS_TABLE,
     "users SET shell = '%s'",
@@ -3711,7 +4875,7 @@ struct query Queries[] = {
     "update_user_windows_shell",
     "uuws",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     "u",
     USERS_TABLE,
     "users SET winconsoleshell = '%s'",
@@ -3728,7 +4892,7 @@ struct query Queries[] = {
     "update_user_status",
     "uust",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     "u",
     USERS_TABLE,
     "users SET status = %s",
@@ -3745,7 +4909,7 @@ struct query Queries[] = {
     "update_user_security_status",
     "uuss",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     "u",
     USERS_TABLE,
     "users SET secure = %s",
@@ -3762,7 +4926,7 @@ struct query Queries[] = {
     "delete_user",
     "dusr",
     2,
-    DELETE,
+    MR_Q_DELETE,
     "u",
     USERS_TABLE,
     NULL,
@@ -3779,7 +4943,7 @@ struct query Queries[] = {
     "add_user_reservation",
     "aurv",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     0,
     USERS_TABLE,
     0,
@@ -3796,7 +4960,7 @@ struct query Queries[] = {
     "get_user_reservations",
     "gurv",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     0,
     USERS_TABLE,
     0,
@@ -3813,7 +4977,7 @@ struct query Queries[] = {
     "get_user_by_reservation",
     "gubr",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     0,
     USERS_TABLE,
     0,
@@ -3830,7 +4994,7 @@ struct query Queries[] = {
     "delete_user_reservation",
     "durv",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     0,
     USERS_TABLE,
     0,
@@ -3847,7 +5011,7 @@ struct query Queries[] = {
     "get_kerberos_user_map",
     "gkum",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "k",
     KRBMAP_TABLE,
     "u.login, str.string FROM krbmap km, users u, strings str",
@@ -3864,7 +5028,7 @@ struct query Queries[] = {
     "add_kerberos_user_map",
     "akum",
     2,
-    APPEND,
+    MR_Q_APPEND,
     "k",
     KRBMAP_TABLE,
     "INTO krbmap (users_id, string_id) VALUES (%d, %d)",
@@ -3881,7 +5045,7 @@ struct query Queries[] = {
     "delete_kerberos_user_map",
     "dkum",
     2,
-    DELETE,
+    MR_Q_DELETE,
     "k",
     KRBMAP_TABLE,
     0,
@@ -3898,7 +5062,7 @@ struct query Queries[] = {
     "get_finger_by_login",
     "gfbl",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "u",
     USERS_TABLE,
     "login, fullname, nickname, home_addr, home_phone, office_addr, office_phone, department, affiliation, TO_CHAR(fmodtime, 'DD-mon-YYYY HH24:MI:SS'), fmodby, fmodwith FROM users",
@@ -3915,7 +5079,7 @@ struct query Queries[] = {
     "update_finger_by_login",
     "ufbl",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     "u",
     USERS_TABLE,
     "users SET fullname= NVL('%s', CHR(0)), nickname= NVL('%s', CHR(0)), home_addr= NVL('%s', CHR(0)), home_phone= NVL('%s', CHR(0)), office_addr= NVL('%s', CHR(0)), office_phone= NVL('%s', CHR(0)), department= NVL('%s', CHR(0)), affiliation= NVL('%s', CHR(0))",
@@ -3932,7 +5096,7 @@ struct query Queries[] = {
     "get_pobox",
     "gpob",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "u",
     USERS_TABLE,
     "login, potype, users_id, CHR(0), TO_CHAR(pmodtime, 'DD-mon-YYYY HH24:MI:SS'), pmodby, pmodwith FROM users",
@@ -3949,7 +5113,7 @@ struct query Queries[] = {
     "get_all_poboxes",
     "gapo",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "u",
     USERS_TABLE,
     "login, potype, pop_id || ':' || box_id FROM users",
@@ -3966,7 +5130,7 @@ struct query Queries[] = {
     "get_poboxes_pop",
     "gpop",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "u",
     USERS_TABLE,
     "login, potype, users_id FROM users",
@@ -3983,7 +5147,7 @@ struct query Queries[] = {
     "get_poboxes_smtp",
     "gpos",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "u",
     USERS_TABLE,
     "login, potype, users_id FROM users",
@@ -4000,7 +5164,7 @@ struct query Queries[] = {
     "set_pobox",
     "spob",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     0,
     USERS_TABLE,
     0,
@@ -4017,7 +5181,7 @@ struct query Queries[] = {
     "set_pobox_pop",
     "spop",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     0,
     USERS_TABLE,
     0,
@@ -4034,7 +5198,7 @@ struct query Queries[] = {
     "delete_pobox",
     "dpob",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     "u",
     USERS_TABLE,
     "users SET potype = 'NONE'",
@@ -4051,7 +5215,7 @@ struct query Queries[] = {
     "get_host",
     "ghst",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "m",
     MACHINE_TABLE,
     "m.name, m.vendor, m.model, m.os, m.location, m.contact, m.use, m.status, TO_CHAR(m.statuschange, 'DD-mon-YYYY HH24:MI:SS'), s.name, m.address, m.owner_type, m.owner_id, m.acomment, m.ocomment, TO_CHAR(m.created, 'DD-mon-YYYY HH24:MI:SS'), m.creator, TO_CHAR(m.inuse, 'DD-mon-YYYY HH24:MI:SS'), TO_CHAR(m.modtime, 'DD-mon-YYYY HH24:MI:SS'), m.modby, m.modwith FROM machine m, subnet s",
@@ -4068,11 +5232,11 @@ struct query Queries[] = {
     "get_host",
     "ghst",
     6,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "m",
     MACHINE_TABLE,
     "m.name, m.vendor, m.model, m.os, m.location, m.contact, m.billing_contact, m.use, m.status, TO_CHAR(m.statuschange, 'DD-mon-YYYY HH24:MI:SS'), s.name, m.address, m.owner_type, m.owner_id, m.acomment, m.ocomment, TO_CHAR(m.created, 'DD-mon-YYYY HH24:MI:SS'), m.creator, TO_CHAR(m.inuse, 'DD-mon-YYYY HH24:MI:SS'), TO_CHAR(m.modtime, 'DD-mon-YYYY HH24:MI:SS'), m.modby, m.modwith FROM machine m, subnet s",
-    ghst_fields,
+    ghst6_fields,
     22,
     "m.name LIKE UPPER('%s') AND m.address LIKE '%s' AND m.location LIKE UPPER('%s') AND s.name LIKE UPPER('%s') AND m.mach_id != 0 AND s.snet_id = m.snet_id",
     4,
@@ -4080,12 +5244,29 @@ struct query Queries[] = {
     &ghst_validate,
   },
 
+  {
+    /* Q_GHST - GET_HOST, v8 */
+    "get_host",
+    "ghst",
+    8,
+    MR_Q_RETRIEVE,
+    "m",
+    MACHINE_TABLE,
+    "m.name, m.vendor, m.model, m.os, m.location, m.contact, m.billing_contact, m.account_number, m.use, m.status, TO_CHAR(m.statuschange, 'DD-mon-YYYY HH24:MI:SS'), s.name, m.address, m.owner_type, m.owner_id, m.acomment, m.ocomment, TO_CHAR(m.created, 'DD-mon-YYYY HH24:MI:SS'), m.creator, TO_CHAR(m.inuse, 'DD-mon-YYYY HH24:MI:SS'), TO_CHAR(m.modtime, 'DD-mon-YYYY HH24:MI:SS'), m.modby, m.modwith FROM machine m, subnet s",
+    ghst_fields,
+    23,
+    "m.name LIKE UPPER('%s') AND m.address LIKE '%s' AND m.location LIKE UPPER('%s') AND s.name LIKE UPPER('%s') AND m.mach_id != 0 AND s.snet_id = m.snet_id",
+    4,
+    "m.name",
+    &ghst_validate,
+  },
+
   {
     /* Q_GHBH - GET_HOST_BY_HWADDR, v2 */
     "get_host_by_hwaddr",
     "ghbh",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "m",
     MACHINE_TABLE,
     "m.name, m.vendor, m.model, m.os, m.location, m.contact, m.use, m.status, TO_CHAR(m.statuschange, 'DD-mon-YYYY HH24:MI:SS'), s.name, m.address, m.owner_type, m.owner_id, m.acomment, m.ocomment, TO_CHAR(m.created, 'DD-mon-YYYY HH24:MI:SS'), m.creator, TO_CHAR(m.inuse, 'DD-mon-YYYY HH24:MI:SS'), TO_CHAR(m.modtime, 'DD-mon-YYYY HH24:MI:SS'), m.modby, m.modwith FROM machine m, subnet s",
@@ -4098,17 +5279,51 @@ struct query Queries[] = {
   },
 
   {
-    /* Q_GHBH - GET_HOST_BY_HWADDR, v6 */
-    "get_host_by_hwaddr",
-    "ghbh",
-    6,
-    RETRIEVE,
+    /* Q_GHBH - GET_HOST_BY_HWADDR, v6 */
+    "get_host_by_hwaddr",
+    "ghbh",
+    6,
+    MR_Q_RETRIEVE,
+    "m",
+    MACHINE_TABLE,
+    "m.name, m.vendor, m.model, m.os, m.location, m.contact, m.billing_contact, m.use, m.status, TO_CHAR(m.statuschange, 'DD-mon-YYYY HH24:MI:SS'), s.name, m.address, m.owner_type, m.owner_id, m.acomment, m.ocomment, TO_CHAR(m.created, 'DD-mon-YYYY HH24:MI:SS'), m.creator, TO_CHAR(m.inuse, 'DD-mon-YYYY HH24:MI:SS'), TO_CHAR(m.modtime, 'DD-mon-YYYY HH24:MI:SS'), m.modby, m.modwith FROM machine m, subnet s",
+    ghbh6_fields,
+    22,
+    "m.hwaddr LIKE LOWER('%s') AND m.mach_id != 0 AND s.snet_id = m.snet_id",
+    1,
+    "m.name",
+    &ghst_validate,
+  },
+
+  {
+    /* Q_GHBH - GET_HOST_BY_HWADDR, v8 */
+    "get_host_by_hwaddr",
+    "ghbh",
+    8,
+    MR_Q_RETRIEVE,
+    "m",
+    MACHINE_TABLE,
+    "m.name, m.vendor, m.model, m.os, m.location, m.contact, m.billing_contact, m.account_number, m.use, m.status, TO_CHAR(m.statuschange, 'DD-mon-YYYY HH24:MI:SS'), s.name, m.address, m.owner_type, m.owner_id, m.acomment, m.ocomment, TO_CHAR(m.created, 'DD-mon-YYYY HH24:MI:SS'), m.creator, TO_CHAR(m.inuse, 'DD-mon-YYYY HH24:MI:SS'), TO_CHAR(m.modtime, 'DD-mon-YYYY HH24:MI:SS'), m.modby, m.modwith FROM machine m, subnet s",
+    ghbh_fields,
+    23,
+    "m.hwaddr LIKE LOWER('%s') AND m.mach_id != 0 AND s.snet_id = m.snet_id",
+    1,
+    "m.name",
+    &ghst_validate,
+  },
+
+  {
+    /* Q_GHBA - GET_HOST_BY_ACCOUNT_NUMBER, v8 */
+    "get_host_by_account_number",
+    "ghba",
+    8,
+    MR_Q_RETRIEVE,
     "m",
     MACHINE_TABLE,
-    "m.name, m.vendor, m.model, m.os, m.location, m.contact, m.billing_contact, m.use, m.status, TO_CHAR(m.statuschange, 'DD-mon-YYYY HH24:MI:SS'), s.name, m.address, m.owner_type, m.owner_id, m.acomment, m.ocomment, TO_CHAR(m.created, 'DD-mon-YYYY HH24:MI:SS'), m.creator, TO_CHAR(m.inuse, 'DD-mon-YYYY HH24:MI:SS'), TO_CHAR(m.modtime, 'DD-mon-YYYY HH24:MI:SS'), m.modby, m.modwith FROM machine m, subnet s",
-    ghbh_fields,
-    22,
-    "m.hwaddr LIKE LOWER('%s') AND m.mach_id != 0 AND s.snet_id = m.snet_id",
+    "m.name, m.vendor, m.model, m.os, m.location, m.contact, m.billing_contact, m.account_number, m.use, m.status, TO_CHAR(m.statuschange, 'DD-mon-YYYY HH24:MI:SS'), s.name, m.address, m.owner_type, m.owner_id, m.acomment, m.ocomment, TO_CHAR(m.created, 'DD-mon-YYYY HH24:MI:SS'), m.creator, TO_CHAR(m.inuse, 'DD-mon-YYYY HH24:MI:SS'), TO_CHAR(m.modtime, 'DD-mon-YYYY HH24:MI:SS'), m.modby, m.modwith FROM machine m, subnet s",    
+    ghba_fields,
+    23,
+    "m.account_number LIKE '%s' AND m.mach_id != 0 and s.snet_id = m.snet_id",
     1,
     "m.name",
     &ghst_validate,
@@ -4119,7 +5334,7 @@ struct query Queries[] = {
     "get_host_hwaddr",
     "ghha",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "m",
     MACHINE_TABLE,
     "m.hwaddr FROM machine m",
@@ -4136,7 +5351,7 @@ struct query Queries[] = {
     "add_host",
     "ahst",
     2,
-    APPEND,
+    MR_Q_APPEND,
     "m",
     MACHINE_TABLE,
     "INTO machine (name, vendor, model, os, location, contact, use, status, statuschange, snet_id, address, owner_type, owner_id, acomment, ocomment, created, inuse, mach_id, creator) VALUES (UPPER('%s'), NVL(UPPER('%s'), CHR(0)), NVL(UPPER('%s'), CHR(0)), NVL(UPPER('%s'), CHR(0)), NVL(UPPER('%s'), CHR(0)), NVL('%s', CHR(0)), %s, %s, SYSDATE, %d, '%s', '%s', %d, %d, %d, SYSDATE, SYSDATE, %s, %s)",
@@ -4153,15 +5368,32 @@ struct query Queries[] = {
     "add_host",
     "ahst",
     6,
-    APPEND,
+    MR_Q_APPEND,
     "m",
     MACHINE_TABLE,
     "INTO machine (name, vendor, model, os, location, contact, billing_contact, use, status, statuschange, snet_id, address, owner_type, owner_id, acomment, ocomment, created, inuse, mach_id, creator) VALUES (UPPER('%s'), NVL(UPPER('%s'), CHR(0)), NVL(UPPER('%s'), CHR(0)), NVL(UPPER('%s'), CHR(0)), NVL(UPPER('%s'), CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, %s, SYSDATE, %d, '%s', '%s', %d, %d, %d, SYSDATE, SYSDATE, %s, %s)",
-    ahst_fields,
+    ahst6_fields,
     15,
     0,
     0,
     NULL,
+    &ahst6_validate,
+  },
+
+  {
+    /* Q_AHST - ADD_HOST, v8 */ /* Uses prefetch_value() for mach_id */
+    "add_host",
+    "ahst",
+    8,
+    MR_Q_APPEND,
+    "m",
+    MACHINE_TABLE,
+    "INTO machine (name, vendor, model, os, location, contact, billing_contact, account_number, use, status, statuschange, snet_id, address, owner_type, owner_id, acomment, ocomment, created, inuse, mach_id, creator) VALUES (UPPER('%s'), NVL(UPPER('%s'), CHR(0)), NVL(UPPER('%s'), CHR(0)), NVL(UPPER('%s'), CHR(0)), NVL(UPPER('%s'), CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, %s, SYSDATE, %d, '%s', '%s', %d, %d, %d, SYSDATE, SYSDATE, %s, %s)",
+    ahst_fields,
+    16,
+    0,
+    0,
+    NULL,
     &ahst_validate,
   },
 
@@ -4170,7 +5402,7 @@ struct query Queries[] = {
     "update_host",
     "uhst",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     "m",
     MACHINE_TABLE,
     "machine SET name = NVL(UPPER('%s'), CHR(0)), vendor = NVL(UPPER('%s'), CHR(0)), model = NVL(UPPER('%s'), CHR(0)), os = NVL(UPPER('%s'), CHR(0)), location = NVL(UPPER('%s'), CHR(0)), contact = NVL('%s', CHR(0)), use = %s, status = %s, snet_id = %d, address = '%s', owner_type = '%s', owner_id = %d, acomment = %d, ocomment = %d",
@@ -4187,15 +5419,32 @@ struct query Queries[] = {
     "update_host",
     "uhst",
     6,
-    UPDATE,
+    MR_Q_UPDATE,
     "m",
     MACHINE_TABLE,
     "machine SET name = NVL(UPPER('%s'), CHR(0)), vendor = NVL(UPPER('%s'), CHR(0)), model = NVL(UPPER('%s'), CHR(0)), os = NVL(UPPER('%s'), CHR(0)), location = NVL(UPPER('%s'), CHR(0)), contact = NVL('%s', CHR(0)), billing_contact = NVL('%s', CHR(0)), use = %s, status = %s, snet_id = %d, address = '%s', owner_type = '%s', owner_id = %d, acomment = %d, ocomment = %d",
-    uhst_fields,
+    uhst6_fields,
     15,
     "mach_id = %d",
     1,
     NULL,
+    &uhst6_validate,
+  },
+
+  {
+    /* Q_UHST - UPDATE_HOST, v8 */
+    "update_host",
+    "uhst",
+    8,
+    MR_Q_UPDATE,
+    "m",
+    MACHINE_TABLE,
+    "machine SET name = NVL(UPPER('%s'), CHR(0)), vendor = NVL(UPPER('%s'), CHR(0)), model = NVL(UPPER('%s'), CHR(0)), os = NVL(UPPER('%s'), CHR(0)), location = NVL(UPPER('%s'), CHR(0)), contact = NVL('%s', CHR(0)), billing_contact = NVL('%s', CHR(0)), account_number = NVL('%s', CHR(0)), use = %s, status = %s, snet_id = %d, address = '%s', owner_type = '%s', owner_id = %d, acomment = %d, ocomment = %d",
+    uhst_fields,
+    16,
+    "mach_id = %d",
+    1,
+    NULL,
     &uhst_validate,
   },
 
@@ -4204,7 +5453,7 @@ struct query Queries[] = {
     "update_host_hwaddr",
     "uhha",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     "m",
     MACHINE_TABLE,
     "machine SET hwaddr = NVL('%s', CHR(0))",
@@ -4221,7 +5470,7 @@ struct query Queries[] = {
     "delete_host",
     "dhst",
     2,
-    DELETE,
+    MR_Q_DELETE,
     "m",
     MACHINE_TABLE,
     NULL,
@@ -4238,7 +5487,7 @@ struct query Queries[] = {
     "get_machine",
     "gmac",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "m",
     MACHINE_TABLE,
     "name, vendor, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM machine",
@@ -4255,7 +5504,7 @@ struct query Queries[] = {
     "get_hostalias",
     "ghal",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "a",
     HOSTALIAS_TABLE,
     "a.name, m.name FROM hostalias a, machine m",
@@ -4272,7 +5521,7 @@ struct query Queries[] = {
     "add_hostalias",
     "ahal",
     2,
-    APPEND,
+    MR_Q_APPEND,
     "a",
     HOSTALIAS_TABLE,
     "INTO hostalias (name, mach_id) VALUES (UPPER('%s'), %d)",
@@ -4289,7 +5538,7 @@ struct query Queries[] = {
     "delete_hostalias",
     "dhal",
     2,
-    DELETE,
+    MR_Q_DELETE,
     "a",
     HOSTALIAS_TABLE,
     NULL,
@@ -4302,15 +5551,15 @@ struct query Queries[] = {
   },
 
   {
-    /* Q_GSNT - GET_SUBNET */
+    /* Q_GSNT - GET_SUBNET, v2 */
     "get_subnet",
     "gsnt",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "s",
     SUBNET_TABLE,
     "name, description, saddr, mask, low, high, prefix, owner_type, owner_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM subnet",
-    gsnt_fields,
+    gsnt2_fields,
     12,
     "name LIKE UPPER('%s')",
     1,
@@ -4319,36 +5568,87 @@ struct query Queries[] = {
   },
 
   {
-    /* Q_ASNT - ADD_SUBNET */
+    /* Q_GSNT - GET_SUBNET, v8 */
+    "get_subnet",
+    "gsnt",
+    8,
+    MR_Q_RETRIEVE,
+    "s",
+    SUBNET_TABLE,
+    "name, description, status, contact, account_number, saddr, mask, low, high, prefix, owner_type, owner_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM subnet",
+    gsnt_fields,
+    15,
+    "name LIKE UPPER('%s')",
+    1,
+    "name",
+    &gsnt_validate,
+  },
+
+  {
+    /* Q_ASNT - ADD_SUBNET, v2 */
     "add_subnet",
     "asnt",
     2,
-    APPEND,
+    MR_Q_APPEND,
     "s",
     SUBNET_TABLE,
     "INTO subnet (name, description, saddr, mask, low, high, prefix, owner_type, owner_id, snet_id) VALUES (UPPER('%s'), NVL('%s', CHR(0)), %s, %s, %s, %s, NVL('%s', CHR(0)), '%s', %d, %s)",
-    asnt_fields,
+    asnt2_fields,
     9,
     0,
     0,
     NULL,
+    &asnt2_validate,
+  },
+
+  {
+    /* Q_ASNT - ADD_SUBNET, v8 */
+    "add_subnet",
+    "asnt",
+    8,
+    MR_Q_APPEND,
+    "s",
+    SUBNET_TABLE,
+    "INTO subnet (name, description, status, contact, account_number, saddr, mask, low, high, prefix, owner_type, owner_id, snet_id) VALUES (UPPER('%s'), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, %s, %s, %s, NVL('%s', CHR(0)), '%s', %d, %s)",
+    asnt_fields,
+    12,
+    0,
+    0,
+    NULL,
     &asnt_validate,
   },
 
   {
-    /* Q_USNT - UPDATE_SUBNET */
+    /* Q_USNT - UPDATE_SUBNET, v2 */
     "update_subnet",
     "usnt",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     "s",
     SUBNET_TABLE,
     "subnet SET name = UPPER('%s'), description = NVL('%s', CHR(0)), saddr = %s, mask = %s, low = %s, high = %s, prefix = NVL('%s', CHR(0)), owner_type = '%s', owner_id = %d",
-    usnt_fields,
+    usnt2_fields,
     9,
     "snet_id = %d",
     1,
     NULL,
+    &usnt2_validate,
+  },
+
+  {
+    /* Q_USNT - UPDATE_SUBNET, v8 */
+    "update_subnet",
+    "usnt",
+    8,
+    MR_Q_UPDATE,
+    "s",
+    SUBNET_TABLE,
+    "subnet SET name = UPPER('%s'), description = NVL('%s', CHR(0)), status = %s, contact = NVL('%s', CHR(0)), account_number = NVL('%s', CHR(0)), saddr = %s, mask = %s, low = %s, high = %s, prefix = NVL('%s', CHR(0)), owner_type = '%s', owner_id = %d",
+    usnt_fields,
+    12,
+    "snet_id = %d",
+    1,
+    NULL,
     &usnt_validate,
   },
 
@@ -4357,7 +5657,7 @@ struct query Queries[] = {
     "delete_subnet",
     "dsnt",
     2,
-    DELETE,
+    MR_Q_DELETE,
     "s",
     SUBNET_TABLE,
     NULL,
@@ -4374,7 +5674,7 @@ struct query Queries[] = {
     "get_cluster",
     "gclu",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "c",
     CLUSTERS_TABLE,
     "name, description, location, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM clusters",
@@ -4391,7 +5691,7 @@ struct query Queries[] = {
     "add_cluster",
     "aclu",
     2,
-    APPEND,
+    MR_Q_APPEND,
     "c",
     CLUSTERS_TABLE,
     "INTO clusters (name, description, location, clu_id) VALUES ('%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s)",
@@ -4408,7 +5708,7 @@ struct query Queries[] = {
     "update_cluster",
     "uclu",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     "c",
     CLUSTERS_TABLE,
     "clusters SET name = '%s', description = NVL('%s', CHR(0)), location = NVL('%s', CHR(0))",
@@ -4425,7 +5725,7 @@ struct query Queries[] = {
     "delete_cluster",
     "dclu",
     2,
-    DELETE,
+    MR_Q_DELETE,
     "c",
     CLUSTERS_TABLE,
     NULL,
@@ -4442,7 +5742,7 @@ struct query Queries[] = {
     "get_machine_to_cluster_map",
     "gmcm",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "mcm",
     MCMAP_TABLE,
     "m.name, c.name FROM machine m, clusters c, mcmap mcm",
@@ -4459,7 +5759,7 @@ struct query Queries[] = {
     "add_machine_to_cluster",
     "amtc",
     2,
-    APPEND,
+    MR_Q_APPEND,
     "mcm",
     MCMAP_TABLE,
     "INTO mcmap (mach_id, clu_id) VALUES (%d, %d)",
@@ -4476,7 +5776,7 @@ struct query Queries[] = {
     "delete_machine_from_cluster",
     "dmfc",
     2,
-    DELETE,
+    MR_Q_DELETE,
     "mcm",
     MCMAP_TABLE,
     0,
@@ -4493,7 +5793,7 @@ struct query Queries[] = {
     "get_cluster_data",
     "gcld",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "svc",
     SVC_TABLE,
     "c.name, svc.serv_label, svc.serv_cluster FROM svc svc, clusters c",
@@ -4510,7 +5810,7 @@ struct query Queries[] = {
     "add_cluster_data",
     "acld",
     2,
-    APPEND,
+    MR_Q_APPEND,
     "svc",
     SVC_TABLE,
     "INTO svc (clu_id, serv_label, serv_cluster) VALUES (%d, '%s', '%s')",
@@ -4527,7 +5827,7 @@ struct query Queries[] = {
     "delete_cluster_data",
     "dcld",
     2,
-    DELETE,
+    MR_Q_DELETE,
     "svc",
     SVC_TABLE,
     NULL,
@@ -4544,7 +5844,7 @@ struct query Queries[] = {
     "get_list_info",
     "glin",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "l",
     LIST_TABLE,
     "name, active, publicflg, hidden, maillist, grouplist, gid, acl_type, acl_id, description, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM list",
@@ -4561,7 +5861,7 @@ struct query Queries[] = {
     "get_list_info",
     "glin",
     3,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "l",
     LIST_TABLE,
     "name, active, publicflg, hidden, maillist, grouplist, gid, nfsgroup, acl_type, acl_id, description, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM list",
@@ -4578,11 +5878,11 @@ struct query Queries[] = {
     "get_list_info",
     "glin",
     4,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "l",
     LIST_TABLE,
     "name, active, publicflg, hidden, maillist, grouplist, gid, nfsgroup, acl_type, acl_id, memacl_type, memacl_id, description, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM list",
-    glin_fields,
+    glin4_fields,
     16,
     "name LIKE '%s'",
     1,
@@ -4590,12 +5890,29 @@ struct query Queries[] = {
     &glin_validate,
   },
 
+  {
+    /* Q_GLIN - GET_LIST_INFO, v10 */
+    "get_list_info",
+    "glin",
+    10,
+    MR_Q_RETRIEVE,
+    "l",
+    LIST_TABLE,
+    "l.name, l.active, l.publicflg, l.hidden, l.maillist, l.grouplist, l.gid, l.nfsgroup, l.mailman, m.name, l.acl_type, l.acl_id, l.memacl_type, l.memacl_id, l.description, TO_CHAR(l.modtime, 'DD-mon-YYYY HH24:MI:SS'), l.modby, l.modwith FROM list l, machine m",
+    glin_fields,
+    18,
+    "l.name LIKE '%s' AND m.mach_id = l.mailman_id",
+    1,
+    "l.name",
+    &glin_validate,
+  },
+
   {
     /* Q_EXLN - EXPAND_LIST_NAMES */
     "expand_list_names",
     "exln",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "l",
     LIST_TABLE,
     "name FROM list",
@@ -4612,7 +5929,7 @@ struct query Queries[] = {
     "add_list",
     "alis",
     2,
-    APPEND,
+    MR_Q_APPEND,
     "l",
     LIST_TABLE,
     "INTO list (name, active, publicflg, hidden, maillist, grouplist, gid, acl_type, acl_id, description, list_id) VALUES ('%s', %s, %s, %s, %s, %s, %s, '%s', %d, NVL('%s', CHR(0)), %s)",
@@ -4629,7 +5946,7 @@ struct query Queries[] = {
     "add_list",
     "alis",
     3,
-    APPEND,
+    MR_Q_APPEND,
     "l",
     LIST_TABLE,
     "INTO list (name, active, publicflg, hidden, maillist, grouplist, gid, nfsgroup, acl_type, acl_id, description, list_id) VALUES ('%s', %s, %s, %s, %s, %s, %s, %s, '%s', %d, NVL('%s', CHR(0)), %s)", 
@@ -4646,15 +5963,32 @@ struct query Queries[] = {
     "add_list",
     "alis",
     4,
-    APPEND,
+    MR_Q_APPEND,
     "l",
     LIST_TABLE,
     "INTO list (name, active, publicflg, hidden, maillist, grouplist, gid, nfsgroup, acl_type, acl_id, memacl_type, memacl_id, description, list_id) VALUES ('%s', %s, %s, %s, %s, %s, %s, %s, '%s', %d, '%s', %d, NVL('%s', CHR(0)), %s)",
-    alis_fields,
+    alis4_fields,
     13,
     0,
     0,
     NULL,
+    &alis4_validate,
+  },
+
+  {
+    /* Q_ALIS - ADD_LIST, v10 */ /* uses prefetch_value() for list_id */
+    "add_list",
+    "alis",
+    10,
+    MR_Q_APPEND,
+    "l",
+    LIST_TABLE,
+    "INTO list (name, active, publicflg, hidden, maillist, grouplist, gid, nfsgroup, mailman, mailman_id, acl_type, acl_id, memacl_type, memacl_id, description, list_id) VALUES ('%s', %s, %s, %s, %s, %s, %s, %s, %s, %d, '%s', %d, '%s', %d, NVL('%s', CHR(0)), %s)",
+    alis_fields,
+    15,
+    0,
+    0,
+    NULL,
     &alis_validate,
   },
 
@@ -4663,7 +5997,7 @@ struct query Queries[] = {
     "update_list",
     "ulis",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     "l",
     LIST_TABLE,
     "list SET name = '%s', active = %s, publicflg = %s, hidden = %s, maillist = %s, grouplist = %s, gid = %s, acl_type = '%s', acl_id = %d, description = NVL('%s', CHR(0))",
@@ -4680,7 +6014,7 @@ struct query Queries[] = {
     "update_list",
     "ulis",
     3,
-    UPDATE,
+    MR_Q_UPDATE,
     "l",
     LIST_TABLE,
     "list SET name = '%s', active = %s, publicflg = %s, hidden = %s, maillist = %s, grouplist = %s, gid = %s, nfsgroup = %s, acl_type = '%s', acl_id = %d, description = NVL('%s', CHR(0))",
@@ -4697,15 +6031,32 @@ struct query Queries[] = {
     "update_list",
     "ulis",
     4,
-    UPDATE,
+    MR_Q_UPDATE,
     "l",
     LIST_TABLE,
     "list SET name = '%s', active = %s, publicflg = %s, hidden = %s, maillist = %s, grouplist = %s, gid = %s, nfsgroup = %s, acl_type = '%s', acl_id = %d, memacl_type = '%s', memacl_id = %d, description = NVL('%s', CHR(0))",
-    ulis_fields,
+    ulis4_fields,
     13,
     "list_id = %d",
     1,
     NULL,
+    &ulis4_validate,
+  },
+
+  {
+    /* Q_ULIS, UPDATE_LIST, v10 */
+    "update_list",
+    "ulis",
+    10,
+    MR_Q_UPDATE,
+    "l",
+    LIST_TABLE,
+    "list SET name = '%s', active = %s, publicflg = %s, hidden = %s, maillist = %s, grouplist = %s, gid = %s, nfsgroup = %s, mailman = %s, mailman_id = %d, acl_type = '%s', acl_id = %d, memacl_type = '%s', memacl_id = %d, description = NVL('%s', CHR(0))",
+    ulis_fields,
+    15,
+    "list_id = %d",
+    1,
+    NULL,
     &ulis_validate,
   },
 
@@ -4714,7 +6065,7 @@ struct query Queries[] = {
     "delete_list",
     "dlis",
     2,
-    DELETE,
+    MR_Q_DELETE,
     "l",
     LIST_TABLE,
     NULL,
@@ -4731,7 +6082,7 @@ struct query Queries[] = {
     "add_member_to_list",
     "amtl",
     2,
-    APPEND,
+    MR_Q_APPEND,
     0,
     IMEMBERS_TABLE,
     0,
@@ -4748,7 +6099,7 @@ struct query Queries[] = {
     "add_tagged_member_to_list",
     "atml",
     2,
-    APPEND,
+    MR_Q_APPEND,
     0,
     IMEMBERS_TABLE,
     0,
@@ -4765,7 +6116,7 @@ struct query Queries[] = {
     "tag_member_of_list",
     "tmol",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     0,
     IMEMBERS_TABLE,
     0,
@@ -4782,7 +6133,7 @@ struct query Queries[] = {
     "delete_member_from_list",
     "dmfl",
     2,
-    DELETE,
+    MR_Q_DELETE,
     0,
     IMEMBERS_TABLE,
     NULL,
@@ -4799,7 +6150,7 @@ struct query Queries[] = {
     "get_ace_use",
     "gaus",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     0,
     0,
     0,
@@ -4816,7 +6167,7 @@ struct query Queries[] = {
     "get_host_by_owner",
     "ghbo",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     0,
     0,
     0,
@@ -4833,7 +6184,7 @@ struct query Queries[] = {
     "qualified_get_lists",
     "qgli",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     0,
     LIST_TABLE,
     0,
@@ -4850,7 +6201,7 @@ struct query Queries[] = {
     "get_members_of_list",
     "gmol",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     NULL,
     IMEMBERS_TABLE,
     NULL,
@@ -4867,7 +6218,7 @@ struct query Queries[] = {
     "get_end_members_of_list",
     "geml",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     NULL,
     IMEMBERS_TABLE,
     NULL,
@@ -4884,7 +6235,7 @@ struct query Queries[] = {
     "get_tagged_members_of_list",
     "gtml",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     NULL,
     IMEMBERS_TABLE,
     NULL,
@@ -4901,7 +6252,7 @@ struct query Queries[] = {
     "get_lists_of_member",
     "glom",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     0,
     IMEMBERS_TABLE,
     0,
@@ -4918,7 +6269,7 @@ struct query Queries[] = {
     "count_members_of_list",
     "cmol",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     0,
     IMEMBERS_TABLE,
     0,
@@ -4935,7 +6286,7 @@ struct query Queries[] = {
     "get_server_info",
     "gsin",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "s",
     SERVERS_TABLE,
     "name, update_int, target_file, script, dfgen, dfcheck, type, enable, inprogress, harderror, errmsg, acl_type, acl_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM servers",
@@ -4952,7 +6303,7 @@ struct query Queries[] = {
     "qualified_get_server",
     "qgsv",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     0,
     SERVERS_TABLE,
     0,
@@ -4969,7 +6320,7 @@ struct query Queries[] = {
     "add_server_info",
     "asin",
     2,
-    APPEND,
+    MR_Q_APPEND,
     "s",
     SERVERS_TABLE,
     "INTO servers (name, update_int, target_file, script, type, enable, acl_type, acl_id) VALUES (UPPER('%s'), %s, '%s', '%s', '%s', %s, '%s', %d)",
@@ -4986,7 +6337,7 @@ struct query Queries[] = {
     "update_server_info",
     "usin",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     "s",
     SERVERS_TABLE,
     "servers SET update_int = %s, target_file = '%s', script = '%s', type = '%s', enable = %s, acl_type = '%s', acl_id = %d",
@@ -5003,7 +6354,7 @@ struct query Queries[] = {
     "reset_server_error",
     "rsve",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     "s",
     SERVERS_TABLE,
     "servers SET harderror = 0, dfcheck = dfgen",
@@ -5020,7 +6371,7 @@ struct query Queries[] = {
     "set_server_internal_flags",
     "ssif",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     "s",
     SERVERS_TABLE,
     "servers SET dfgen = %s, dfcheck = %s, inprogress = %s, harderror = %s, errmsg = NVL('%s', CHR(0))",
@@ -5037,7 +6388,7 @@ struct query Queries[] = {
     "delete_server_info",
     "dsin",
     2,
-    DELETE,
+    MR_Q_DELETE,
     "s",
     SERVERS_TABLE,
     NULL,
@@ -5054,7 +6405,7 @@ struct query Queries[] = {
     "get_server_host_info",
     "gshi",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "sh",
     SERVERHOSTS_TABLE,
     "sh.service, m.name, sh.enable, sh.override, sh.success, sh.inprogress, sh.hosterror, sh.hosterrmsg, sh.ltt, sh.lts, sh.value1, sh.value2, sh.value3, TO_CHAR(sh.modtime, 'DD-mon-YYYY HH24:MI:SS'), sh.modby, sh.modwith FROM serverhosts sh, machine m",
@@ -5071,7 +6422,7 @@ struct query Queries[] = {
     "qualified_get_server_host",
     "qgsh",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     0,
     SERVERHOSTS_TABLE,
     0,
@@ -5088,7 +6439,7 @@ struct query Queries[] = {
     "add_server_host_info",
     "ashi",
     2,
-    APPEND,
+    MR_Q_APPEND,
     "sh",
     SERVERHOSTS_TABLE,
     "INTO serverhosts (service, mach_id, enable, value1, value2, value3) VALUES (UPPER('%s'), %d, %s, %s, %s, NVL('%s', CHR(0)))",
@@ -5105,7 +6456,7 @@ struct query Queries[] = {
     "update_server_host_info",
     "ushi",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     "sh",
     SERVERHOSTS_TABLE,
     "serverhosts SET enable = %s, value1 = %s, value2 = %s, value3 = NVL('%s', CHR(0))",
@@ -5122,7 +6473,7 @@ struct query Queries[] = {
     "reset_server_host_error",
     "rshe",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     "sh",
     SERVERHOSTS_TABLE,
     "serverhosts SET hosterror = 0",
@@ -5139,7 +6490,7 @@ struct query Queries[] = {
     "set_server_host_override",
     "ssho",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     "sh",
     SERVERHOSTS_TABLE,
     "serverhosts SET override = 1",
@@ -5156,7 +6507,7 @@ struct query Queries[] = {
     "set_server_host_internal",
     "sshi",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     "s",
     SERVERHOSTS_TABLE,
     "serverhosts SET override = %s, success = %s, inprogress = %s, hosterror = %s, hosterrmsg = NVL('%s', CHR(0)), ltt = %s, lts = %s",
@@ -5173,7 +6524,7 @@ struct query Queries[] = {
     "delete_server_host_info",
     "dshi",
     2,
-    DELETE,
+    MR_Q_DELETE,
     "sh",
     SERVERHOSTS_TABLE,
     NULL,
@@ -5190,7 +6541,7 @@ struct query Queries[] = {
     "get_server_locations",
     "gslo",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "sh",
     SERVERHOSTS_TABLE,
     "sh.service, m.name FROM serverhosts sh, machine m",
@@ -5207,7 +6558,7 @@ struct query Queries[] = {
     "get_filesys_by_label",
     "gfsl",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "fs",
     FILESYS_TABLE,
     "fs.label, fs.type, m.name, fs.name, fs.mount, fs.rwaccess, fs.comments, u.login, l.name, fs.createflg, fs.lockertype, TO_CHAR(fs.modtime, 'DD-mon-YYYY HH24:MI:SS'), fs.modby, fs.modwith FROM filesys fs, machine m, users u, list l",
@@ -5224,7 +6575,7 @@ struct query Queries[] = {
     "get_filesys_by_machine",
     "gfsm",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "fs",
     FILESYS_TABLE,
     "fs.label, fs.type, m.name, fs.name, fs.mount, fs.rwaccess, fs.comments, u.login, l.name, fs.createflg, fs.lockertype, TO_CHAR(fs.modtime, 'DD-mon-YYYY HH24:MI:SS'), fs.modby, fs.modwith FROM filesys fs, machine m, users u, list l",
@@ -5241,7 +6592,7 @@ struct query Queries[] = {
     "get_filesys_by_nfsphys",
     "gfsn",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "fs",
     FILESYS_TABLE,
     "fs.label, fs.type, m.name, fs.name, fs.mount, fs.rwaccess, fs.comments, u.login, l.name, fs.createflg, fs.lockertype, TO_CHAR(fs.modtime, 'DD-mon-YYYY HH24:MI:SS'), fs.modby, fs.modwith FROM filesys fs, machine m, users u, list l, nfsphys np",
@@ -5258,7 +6609,7 @@ struct query Queries[] = {
     "get_filesys_by_group",
     "gfsg",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "fs",
     FILESYS_TABLE,
     "fs.label, fs.type, m.name, fs.name, fs.mount, fs.rwaccess, fs.comments, u.login, l.name, fs.createflg, fs.lockertype, TO_CHAR(fs.modtime, 'DD-mon-YYYY HH24:MI:SS'), fs.modby, fs.modwith FROM filesys fs, machine m, users u, list l",
@@ -5275,7 +6626,7 @@ struct query Queries[] = {
     "get_filesys_by_path",
     "gfsp",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "fs",
     FILESYS_TABLE,
     "fs.label, fs.type, m.name, fs.name, fs.mount, fs.rwaccess, fs.comments, u.login, l.name, fs.createflg, fs.lockertype, TO_CHAR(fs.modtime, 'DD-mon-YYYY HH24:MI:SS'), fs.modby, fs.modwith FROM filesys fs, machine m, users u, list l",
@@ -5292,7 +6643,7 @@ struct query Queries[] = {
     "add_filesys",
     "afil",
     2,
-    APPEND,
+    MR_Q_APPEND,
     "fs",
     FILESYS_TABLE,
     "INTO filesys (label, type, mach_id, name, mount, rwaccess, comments, owner, owners, createflg, lockertype, filsys_id) VALUES ('%s', '%s', %d, NVL('%s', CHR(0)), NVL('%s', CHR(0)), '%s', NVL('%s', CHR(0)), %d, %d, %s, '%s', %s)",
@@ -5309,7 +6660,7 @@ struct query Queries[] = {
     "update_filesys",
     "ufil",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     "fs",
     FILESYS_TABLE,
     "filesys SET label = '%s', type = '%s', mach_id = %d, name = NVL('%s', CHR(0)), mount = NVL('%s', CHR(0)), rwaccess = '%s', comments = NVL('%s', CHR(0)), owner = %d, owners = %d, createflg = %s, lockertype = '%s'",
@@ -5326,7 +6677,7 @@ struct query Queries[] = {
     "delete_filesys",
     "dfil",
     2,
-    DELETE,
+    MR_Q_DELETE,
     "fs",
     FILESYS_TABLE,
     NULL,
@@ -5343,7 +6694,7 @@ struct query Queries[] = {
     "get_fsgroup_members",
     "gfgm",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "fg",
     FSGROUP_TABLE,
     "fs.label, fg.key FROM fsgroup fg, filesys fs",
@@ -5360,7 +6711,7 @@ struct query Queries[] = {
     "add_filesys_to_fsgroup",
     "aftg",
     2,
-    APPEND,
+    MR_Q_APPEND,
     "fg",
     FSGROUP_TABLE,
     "INTO fsgroup (group_id, filsys_id, key) VALUES (%d, %d, '%s')",
@@ -5377,7 +6728,7 @@ struct query Queries[] = {
     "remove_filesys_from_fsgroup",
     "rffg",
     2,
-    DELETE,
+    MR_Q_DELETE,
     "fg",
     FSGROUP_TABLE,
     NULL,
@@ -5394,7 +6745,7 @@ struct query Queries[] = {
     "get_all_nfsphys",
     "ganf",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "np",
     NFSPHYS_TABLE,
     "m.name, np.dir, np.device, np.status, np.allocated, np.partsize, TO_CHAR(np.modtime, 'DD-mon-YYYY HH24:MI:SS'), np.modby, np.modwith FROM nfsphys np, machine m",
@@ -5411,7 +6762,7 @@ struct query Queries[] = {
     "get_nfsphys",
     "gnfp",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "np",
     NFSPHYS_TABLE,
     "m.name, np.dir, np.device, np.status, np.allocated, np.partsize, TO_CHAR(np.modtime, 'DD-mon-YYYY HH24:MI:SS'), np.modby, np.modwith FROM nfsphys np, machine m",
@@ -5428,7 +6779,7 @@ struct query Queries[] = {
     "add_nfsphys",
     "anfp",
     2,
-    APPEND,
+    MR_Q_APPEND,
     "np",
     NFSPHYS_TABLE,
     "INTO nfsphys (mach_id, dir, device, status, allocated, partsize, nfsphys_id) VALUES (%d, '%s', NVL('%s', CHR(0)), %s, %s, %s, %s)",
@@ -5445,7 +6796,7 @@ struct query Queries[] = {
     "update_nfsphys",
     "unfp",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     "np",
     NFSPHYS_TABLE,
     "nfsphys SET device = NVL('%s', CHR(0)), status = %s, allocated = %s, partsize = %s",
@@ -5462,7 +6813,7 @@ struct query Queries[] = {
     "adjust_nfsphys_allocation",
     "ajnf",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     "np",
     NFSPHYS_TABLE,
     "nfsphys SET allocated = allocated + %s",
@@ -5479,7 +6830,7 @@ struct query Queries[] = {
     "delete_nfsphys",
     "dnfp",
     2,
-    DELETE,
+    MR_Q_DELETE,
     "np",
     NFSPHYS_TABLE,
     NULL,
@@ -5496,7 +6847,7 @@ struct query Queries[] = {
     "get_quota",
     "gqot",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "q",
     QUOTA_TABLE,
     "fs.label, q.type, q.entity_id, q.quota, q.phys_id, m.name, TO_CHAR(q.modtime, 'DD-mon-YYYY HH24:MI:SS'), q.modby, q.modwith FROM quota q, filesys fs, machine m",
@@ -5513,7 +6864,7 @@ struct query Queries[] = {
     "get_quota_by_filesys",
     "gqbf",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "q",
     QUOTA_TABLE,
     "fs.label, q.type, q.entity_id, q.quota, q.phys_id, m.name, TO_CHAR(q.modtime, 'DD-mon-YYYY HH24:MI:SS'), q.modby, q.modwith FROM quota q, filesys fs, machine m",
@@ -5530,7 +6881,7 @@ struct query Queries[] = {
     "add_quota",
     "aqot",
     2,
-    APPEND,
+    MR_Q_APPEND,
     0,
     QUOTA_TABLE,
     "INTO quota (filsys_id, type, entity_id, quota, phys_id) VALUES ('%s', %d, %d, %s, %s)",
@@ -5547,7 +6898,7 @@ struct query Queries[] = {
     "update_quota",
     "uqot",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     0,
     QUOTA_TABLE,
     "quota SET quota = %s",
@@ -5564,7 +6915,7 @@ struct query Queries[] = {
     "delete_quota",
     "dqot",
     2,
-    DELETE,
+    MR_Q_DELETE,
     0,
     QUOTA_TABLE,
     NULL,
@@ -5581,7 +6932,7 @@ struct query Queries[] = {
     "get_nfs_quota",
     "gnfq",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "q",
     QUOTA_TABLE,
     "fs.label, u.login, q.quota, q.phys_id, m.name, TO_CHAR(q.modtime, 'DD-mon-YYYY HH24:MI:SS'), q.modby, q.modwith FROM quota q, filesys fs, users u, machine m",
@@ -5598,7 +6949,7 @@ struct query Queries[] = {
     "get_nfs_quotas_by_partition",
     "gnqp",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "q",
     QUOTA_TABLE,
     "fs.label, u.login, q.quota, np.dir, m.name FROM quota q, filesys fs, users u, nfsphys np, machine m",
@@ -5615,7 +6966,7 @@ struct query Queries[] = {
     "add_nfs_quota",
     "anfq",
     2,
-    APPEND,
+    MR_Q_APPEND,
     0,
     QUOTA_TABLE,
     "INTO quota (type, filsys_id, entity_id, quota, phys_id ) VALUES ('USER', %d, %d, %s, %s)",
@@ -5632,7 +6983,7 @@ struct query Queries[] = {
     "update_nfs_quota",
     "unfq",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     0,
     QUOTA_TABLE,
     "quota SET quota = %s",
@@ -5649,7 +7000,7 @@ struct query Queries[] = {
     "delete_nfs_quota",
     "dnfq",
     2,
-    DELETE,
+    MR_Q_DELETE,
     0,
     QUOTA_TABLE,
     NULL,
@@ -5666,7 +7017,7 @@ struct query Queries[] = {
     "get_zephyr_class",
     "gzcl",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "z",
     ZEPHYR_TABLE,
     "class, xmt_type, xmt_id, sub_type, sub_id, iws_type, iws_id, iui_type, iui_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM zephyr",
@@ -5683,7 +7034,7 @@ struct query Queries[] = {
     "get_zephyr_class",
     "gzcl",
     5,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "z",
     ZEPHYR_TABLE,
     "class, xmt_type, xmt_id, sub_type, sub_id, iws_type, iws_id, iui_type, iui_id, owner_type, owner_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM zephyr",
@@ -5700,7 +7051,7 @@ struct query Queries[] = {
     "add_zephyr_class",
     "azcl",
     2,
-    APPEND,
+    MR_Q_APPEND,
     "z",
     ZEPHYR_TABLE,
     "INTO zephyr (class, xmt_type, xmt_id, sub_type, sub_id, iws_type, iws_id, iui_type, iui_id) VALUES ('%s', '%s', %d, '%s', %d, '%s', %d, '%s', %d)",
@@ -5717,7 +7068,7 @@ struct query Queries[] = {
     "add_zephyr_class",
     "azcl",
     5,
-    APPEND,
+    MR_Q_APPEND,
     "z",
     ZEPHYR_TABLE,
     "INTO zephyr (class, xmt_type, xmt_id, sub_type, sub_id, iws_type, iws_id, iui_type, iui_id, owner_type, owner_id) VALUES ('%s', '%s', %d, '%s', %d, '%s', %d, '%s', %d, '%s', %d)",
@@ -5734,7 +7085,7 @@ struct query Queries[] = {
     "update_zephyr_class",
     "uzcl",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     "z",
     ZEPHYR_TABLE,
     "zephyr SET class = '%s', xmt_type = '%s', xmt_id = %d, sub_type = '%s', sub_id = %d, iws_type = '%s', iws_id = %d, iui_type = '%s', iui_id = %d",
@@ -5751,7 +7102,7 @@ struct query Queries[] = {
     "update_zephyr_class",
     "uzcl",
     5,
-    UPDATE,
+    MR_Q_UPDATE,
     "z",
     ZEPHYR_TABLE,
     "zephyr SET class = '%s', xmt_type = '%s', xmt_id = %d, sub_type = '%s', sub_id = %d, iws_type = '%s', iws_id = %d, iui_type = '%s', iui_id = %d, owner_type = '%s', owner_id = %d",
@@ -5768,7 +7119,7 @@ struct query Queries[] = {
     "delete_zephyr_class",
     "dzcl",
     2,
-    DELETE,
+    MR_Q_DELETE,
     "z",
     ZEPHYR_TABLE,
     0,
@@ -5785,7 +7136,7 @@ struct query Queries[] = {
     "get_server_host_access",
     "gsha",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "ha",
     HOSTACCESS_TABLE,
     "m.name, ha.acl_type, ha.acl_id, TO_CHAR(ha.modtime, 'DD-mon-YYYY HH24:MI:SS'), ha.modby, ha.modwith FROM hostaccess ha, machine m",
@@ -5802,7 +7153,7 @@ struct query Queries[] = {
     "add_server_host_access",
     "asha",
     2,
-    APPEND,
+    MR_Q_APPEND,
     "ha",
     HOSTACCESS_TABLE,
     "INTO hostaccess (mach_id, acl_type, acl_id) VALUES (%d, '%s', %d)",
@@ -5819,7 +7170,7 @@ struct query Queries[] = {
     "update_server_host_access",
     "usha",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     "ha",
     HOSTACCESS_TABLE,
     "hostaccess SET acl_type = '%s', acl_id = %d",
@@ -5836,7 +7187,7 @@ struct query Queries[] = {
     "delete_server_host_access",
     "dsha",
     2,
-    DELETE,
+    MR_Q_DELETE,
     "ha",
     HOSTACCESS_TABLE,
     0,
@@ -5853,7 +7204,7 @@ struct query Queries[] = {
     "get_acl",
     "gacl",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "ac",
     ACL_TABLE,
     "m.name, ac.target, ac.kind, l.name FROM acl ac, machine m, list l",
@@ -5870,7 +7221,7 @@ struct query Queries[] = {
     "add_acl",
     "aacl",
     2,
-    APPEND,
+    MR_Q_APPEND,
     "ac",
     ACL_TABLE,
     "INTO acl (mach_id, target, kind, list_id) VALUES (%d, '%s', '%s', %d)",
@@ -5887,7 +7238,7 @@ struct query Queries[] = {
     "delete_acl",
     "dacl",
     2,
-    DELETE,
+    MR_Q_DELETE,
     "ac",
     ACL_TABLE,
     0,
@@ -5904,7 +7255,7 @@ struct query Queries[] = {
     "get_service",
     "gsvc",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "ss",
     SERVICES_TABLE,
     "name, protocol, port, description, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM services",
@@ -5921,7 +7272,7 @@ struct query Queries[] = {
     "add_service",
     "asvc",
     2,
-    APPEND,
+    MR_Q_APPEND,
     "ss",
     SERVICES_TABLE,
     "INTO services (name, protocol, port, description) VALUES ('%s', '%s', %s, NVL('%s', CHR(0)))",
@@ -5938,7 +7289,7 @@ struct query Queries[] = {
     "delete_service",
     "dsvc",
     2,
-    DELETE,
+    MR_Q_DELETE,
     "ss",
     SERVICES_TABLE,
     0,
@@ -5955,7 +7306,7 @@ struct query Queries[] = {
     "get_printer",
     "gprn",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "pr",
     PRINTERS_TABLE,
     "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
@@ -5972,7 +7323,7 @@ struct query Queries[] = {
     "get_printer_by_duplexname",
     "gpbd",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "pr",
     PRINTERS_TABLE,
     "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
@@ -5989,7 +7340,7 @@ struct query Queries[] = {
     "get_printer_by_ethernet",
     "gpbe",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "pr",
     PRINTERS_TABLE,
     "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
@@ -6006,7 +7357,7 @@ struct query Queries[] = {
     "get_printer_by_hostname",
     "gpbh",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "pr",
     PRINTERS_TABLE,
     "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
@@ -6023,7 +7374,7 @@ struct query Queries[] = {
     "get_printer_by_rm",
     "gpbr",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "pr",
     PRINTERS_TABLE,
     "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
@@ -6040,7 +7391,7 @@ struct query Queries[] = {
     "get_printer_by_location",
     "gpbl",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "pr",
     PRINTERS_TABLE,
     "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
@@ -6057,7 +7408,7 @@ struct query Queries[] = {
     "get_printer_by_contact",
     "gpbc",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "pr",
     PRINTERS_TABLE,
     "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
@@ -6074,7 +7425,7 @@ struct query Queries[] = {
     "add_printer",
     "aprn",
     2,
-    APPEND,
+    MR_Q_APPEND,
     "pr",
     PRINTERS_TABLE,
     "INTO printers (name, type, hwtype, duplexname, mach_id, loghost, rm, rp, rq, ka, pc, ac, lpc_acl, banner, location, contact) VALUES ('%s', '%s', '%s', NVL('%s', CHR(0)), %d, %d, %d, NVL('%s', CHR(0)), %d, %s, %s, %d, %d, %s, NVL('%s', CHR(0)), NVL('%s', CHR(0)))",
@@ -6091,14 +7442,14 @@ struct query Queries[] = {
     "update_printer",
     "uprn",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     "pr",
     PRINTERS_TABLE,
-    "printers SET name = '%s', type = '%s', hwtype = '%s', duplexname = NVL('%s', CHR(0)), mach_id = %d, loghost = %d, rm = %d, rp = NVL('%s', CHR(0)), rq = %d, ka = %d, pc = %d, ac = %d, lpc_acl = %d, banner = %d, location = NVL('%s', CHR(0)), contact = NVL('%s', CHR(0))",
+    "printers SET name = '%s', type = '%s', hwtype = '%s', duplexname = NVL('%s', CHR(0)), mach_id = %d, loghost = %d, rm = %d, rp = NVL('%s', CHR(0)), rq = %d, ka = %s, pc = %s, ac = %d, lpc_acl = %d, banner = %s, location = NVL('%s', CHR(0)), contact = NVL('%s', CHR(0))",
     uprn_fields,
     16,
-    0,
-    0,
+    "name = '%s'",
+    1,
     NULL,
     &uprn_validate,
   },
@@ -6108,7 +7459,7 @@ struct query Queries[] = {
     "delete_printer",
     "dprn",
     2,
-    DELETE,
+    MR_Q_DELETE,
     "pr",
     PRINTERS_TABLE,
     0,
@@ -6125,7 +7476,7 @@ struct query Queries[] = {
     "get_print_server",
     "gpsv",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "ps",
     PRINTSERVERS_TABLE,
     "m.name, ps.kind, s.string, ps.owner_type, ps.owner_id, l.name, TO_CHAR(ps.modtime, 'DD-mon-YYYY HH24:MI:SS'), ps.modby, ps.modwith FROM printservers ps, machine m, strings s, list l",
@@ -6142,7 +7493,7 @@ struct query Queries[] = {
     "add_print_server",
     "apsv",
     2,
-    APPEND,
+    MR_Q_APPEND,
     "ps",
     PRINTSERVERS_TABLE,
     "INTO printservers (mach_id, kind, printer_types, owner_type, owner_id, lpc_acl) VALUES (%d, '%s', %d, '%s', %d, %d)",
@@ -6159,7 +7510,7 @@ struct query Queries[] = {
     "update_print_server",
     "upsv",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     "ps",
     PRINTSERVERS_TABLE,
     "printservers SET kind = '%s', printer_types = %d, owner_type = '%s', owner_id = %d, lpc_acl = %d",
@@ -6176,7 +7527,7 @@ struct query Queries[] = {
     "delete_print_server",
     "dpsv",
     2,
-    DELETE,
+    MR_Q_DELETE,
     "ps",
     PRINTSERVERS_TABLE,
     0,
@@ -6193,7 +7544,7 @@ struct query Queries[] = {
     "get_alias",
     "gali",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "a",
     ALIAS_TABLE,
     "name, type, trans FROM alias",
@@ -6210,7 +7561,7 @@ struct query Queries[] = {
     "add_alias",
     "aali",
     2,
-    APPEND,
+    MR_Q_APPEND,
     "a",
     ALIAS_TABLE,
     "INTO alias (name, type, trans) VALUES ('%s', '%s', '%s')",
@@ -6227,7 +7578,7 @@ struct query Queries[] = {
     "delete_alias",
     "dali",
     2,
-    DELETE,
+    MR_Q_DELETE,
     "a",
     ALIAS_TABLE,
     NULL,
@@ -6244,7 +7595,7 @@ struct query Queries[] = {
     "get_value",
     "gval",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "val",
     NUMVALUES_TABLE,
     "value FROM numvalues",
@@ -6261,7 +7612,7 @@ struct query Queries[] = {
     "add_value",
     "aval",
     2,
-    APPEND,
+    MR_Q_APPEND,
     "val",
     NUMVALUES_TABLE,
     "INTO numvalues (name, value) VALUES ('%s', %s)",
@@ -6278,7 +7629,7 @@ struct query Queries[] = {
     "update_value",
     "uval",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     "val",
     NUMVALUES_TABLE,
     "numvalues SET value = %s",
@@ -6295,7 +7646,7 @@ struct query Queries[] = {
     "delete_value",
     "dval",
     2,
-    DELETE,
+    MR_Q_DELETE,
     "val",
     NUMVALUES_TABLE,
     NULL,
@@ -6312,7 +7663,7 @@ struct query Queries[] = {
     "get_all_table_stats",
     "gats",
     2,
-    RETRIEVE,
+    MR_Q_RETRIEVE,
     "tbs",
     TBLSTATS_TABLE,
     "table_name, appends, updates, deletes, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS') FROM tblstats",
@@ -6329,7 +7680,7 @@ struct query Queries[] = {
     "_set_debug_level",
     "_sdl",
     2,
-    UPDATE,
+    MR_Q_UPDATE,
     NULL,
     0,
     NULL,
@@ -6342,88 +7693,275 @@ struct query Queries[] = {
   },
 
   {
-    /* Q_GUSL - GET_USER_SIDS_BY_LOGIN, v4 */
-    "get_user_sids_by_login",
-    "gusl",
-    4,
-    RETRIEVE,
-    "s",
-    USERSIDS_TABLE,
-    "u.login, us.sid, TO_CHAR(us.created, 'YYYY-MM-DD HH24:MI:SS') FROM users u, usersids us",
-    gusl_fields,
-    3,
-    "us.users_id = %d AND u.users_id = us.users_id AND SUBSTR(us.sid, 1, LENGTH(us.sid)-8) = '%s'",
-    2,
+    /* Q_GCON - GET_CONTAINER, v7 */
+    "get_container",
+    "gcon",
+    7,
+    MR_Q_RETRIEVE,
+    "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",
+    gcon7_fields,
+    11,
+    "LOWER(name) LIKE LOWER('%s') AND cnt_id != 0",
+    1,
     NULL,
-    &gusl_validate,
+    &gcon_validate,
   },
 
   {
-    /* Q_AUSL - ADD_USER_SID_BY_LOGIN, v4 */
-    "add_user_sid_by_login",
-    "ausl",
-    4,
-    APPEND,
-    "s",
-    USERSIDS_TABLE,
-    "INTO usersids (users_id, sid) VALUES (%d, '%s')",
-    ausl_fields,
+    /* Q_GCON - GET_CONTAINER, v9 */
+    "get_container",
+    "gcon",
+    9,
+    MR_Q_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,
+  },
+
+  {
+    /* Q_ACON - ADD_CONTAINER, v7 */ /* uses prefetch_value() for cnt_id */
+    "add_container",
+    "acon",
+    7,
+    MR_Q_APPEND,
+    "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)",
+    acon7_fields,
+    8,
+    0,
+    0,
+    NULL,
+    &acon7_validate,
+  },
+
+  {
+    /* Q_ACON - ADD_CONTAINER, v9 */ /* uses prefetch_value() for cnt_id */
+    "add_container",
+    "acon",
+    9,
+    MR_Q_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,
+  },
+
+  {
+    /* Q_UCON - UPDATE_CONTAINER, v7 */
+    "update_container",
+    "ucon",
+    7,
+    MR_Q_UPDATE,
+    0,
+    CONTAINERS_TABLE,
+    0,
+    ucon7_fields,
+    8,
+    0,
+    1,
+    NULL,
+    &ucon7_validate,
+  },
+
+  {
+    /* Q_UCON - UPDATE_CONTAINER, v9 */
+    "update_container",
+    "ucon",
+    9,
+    MR_Q_UPDATE,
+    0,
+    CONTAINERS_TABLE,
+    0,
+    ucon_fields,
+    9,
+    0,
+    1,
+    NULL,
+    &ucon_validate,
+  },
+
+  {
+    /* Q_DCON - DELETE_CONTAINER, v7 */
+    "delete_container",
+    "dcon",
+    7,
+    MR_Q_DELETE,
+    "c",
+    CONTAINERS_TABLE,
+    NULL,
+    dcon_fields,
+    0,
+    "cnt_id = %d",
+    1,
+    NULL,
+    &dcon_validate,
+  },
+
+  {
+    /* Q_AMCN - ADD_MACHINE_TO_CONTAINER, v7 */
+    "add_machine_to_container",
+    "amcn",
+    7,
+    MR_Q_APPEND,
+    "mcn",
+    MCNTMAP_TABLE,
+    "INTO mcntmap (mach_id, cnt_id) VALUES (%d, %d)",
+    amcn_fields,
     2,
+    0,
+    0,
     NULL,
+    &amcn_validate,
+  },
+
+  {
+    /* Q_DMCN - DELETE_MACHINE_FROM_CONTAINER, v7 */
+    "delete_machine_from_container",
+    "dmcn",
+    7,
+    MR_Q_DELETE,
+    "mcn",
+    MCNTMAP_TABLE,
+    0,
+    amcn_fields,
     0,
+    "mach_id = %d AND cnt_id = %d",
+    2,
     NULL,
-    &ausl_validate,
+    &dmcn_validate,
   },
-  
+
   {
-    /* Q_GLSN - GET_LIST_SIDS_BY_NAME, v4 */
-    "get_list_sids_by_name",
-    "glsn",
-    4,
-    RETRIEVE,
-    "s",
-    LISTSIDS_TABLE,
-    "l.name, ls.sid, TO_CHAR(ls.created, 'YYYY-MM-DD HH24:MI:SS') FROM list l, listsids ls",
-    glsn_fields,
-    3,
-    "ls.list_id = %d AND l.list_id = ls.list_id AND SUBSTR(ls.sid, 1, LENGTH(ls.sid)-8) = '%s'",
+    /* Q_GMNM - GET_MACHINE_TO_CONTAINER_MAP, v7 */
+    "get_machine_to_container_map",
+    "gmnm",
+    7,
+    MR_Q_RETRIEVE,
+    "mcn",
+    MCNTMAP_TABLE,
+    "m.name, c.name FROM machine m, containers c, mcntmap mcn",
+    gmnm_fields,
     2,
+    "m.name LIKE UPPER('%s') AND mcn.cnt_id = c.cnt_id AND mcn.mach_id = m.mach_id",
+    1,
+    NULL,
     NULL,
-    &glsn_validate,
   },
 
   {
-    /* Q_ALSN - ADD_LIST_SID_BY_NAME, v4 */
-    "add_list_sid_by_name",
-    "alsn",
-    4,
-    APPEND,
-    "s",
-    LISTSIDS_TABLE,
-    "INTO listsids (list_id, sid) VALUES (%d, '%s')",
-    alsn_fields,
+    /* Q_GMOC - GET_MACHINES_OF_CONTAINER, v7 */
+    "get_machines_of_container",
+    "gmoc",
+    7,
+    MR_Q_RETRIEVE,
+    NULL,
+    MCNTMAP_TABLE,
+    NULL,
+    gmoc_fields,
     2,
     NULL,
-    0,
+    2,
     NULL,
-    &alsn_validate,
+    &gmoc_validate,
   },
 
   {
-    /* Q_GDDS - GET_DISTINCT_DOMAIN_SIDS, v4 */
-    "get_distinct_domain_sids",
-    "gdds",
-    4,
-    RETRIEVE,
-    "s",
-    USERSIDS_TABLE,
-    "DISTINCT SUBSTR(sid, 1, LENGTH(sid)-8) FROM usersids",
-    gdds_fields,
+    /* Q_GSOC - GET_SUBCONTAINERS_OF_CONTAINER, v7 */
+    "get_subcontainers_of_container",
+    "gsoc",
+    7,
+    MR_Q_RETRIEVE,
+    NULL,
+    CONTAINERS_TABLE,
+    NULL,
+    gsoc_fields,
+    1,
+    NULL,
+    2,
+    NULL,
+    &gsoc_validate,
+  },
+
+  {
+    /* Q_GTLC - GET_TOPLEVEL_CONTAINERS, v7 */
+    "get_toplevel_containers",
+    "gtlc",
+    7,
+    MR_Q_RETRIEVE,
+    "c",
+    CONTAINERS_TABLE,
+    "name FROM containers",
+    gtlc_fields,
     1,
+    "name NOT LIKE '%%/%%'",
+    0,
+    "name",
     NULL,
+  },
+
+  {
+    /* Q_SCLI - SET_CONTAINER_LIST, v9 */
+    "set_container_list",
+    "scli",
+    9,
+    MR_Q_UPDATE,
     0,
+    CONTAINERS_TABLE,
+    0,
+    scli_fields,
+    1,
+    0,
+    1,
     NULL,
+    &scli_validate,
+  },
+
+  {
+    /* Q_GCLI - GET_CONTAINER_LIST, v9 */
+    "get_container_list",
+    "gcli",
+    9,
+    MR_Q_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,
+  },
+
+  {
+    /* G_GLIC - GET_LIST_CONTAINER, v9 */
+    "get_list_container",
+    "glic",
+    9,
+    MR_Q_RETRIEVE,
+    "c",
+    CONTAINERS_TABLE,
+    "c.name, l.name FROM containers c, list l",
+    glic_fields,
+    2,
+    "l.list_id = %d AND l.list_id = c.list_id and c.list_id != 0",
+    1,
     NULL,
+    &glic_validate,
   },
 
 };
This page took 0.222531 seconds and 4 git commands to generate.