]> andersk Git - moira.git/blobdiff - server/queries2.c
Allow alternate Moira db to be specified (-db ...)
[moira.git] / server / queries2.c
index 439cefc70facf34b67a801356c85c8d26113aded..86a73b1a05af84d5dc12008e4758abf222e3aaba 100644 (file)
@@ -9,7 +9,7 @@
 
 #include <mit-copyright.h>
 #include "query.h"
-#include "sms_et.h"
+#include "mr_et.h"
 
 /* Specialized Support Query Routines */
 
@@ -39,18 +39,20 @@ int setup_afil();
 int setup_ufil();
 int setup_dfil();
 int setup_dnfp();
-int setup_dnfq();
+int setup_dqot();
+int setup_sshi();
+int setup_akum();
 
 /* Query Followup Routines */
 int followup_fix_modby();
 int followup_ausr();
 int followup_gpob();
 int followup_glin();
-int followup_amtl();
-int followup_anfq();
+int followup_aqot();
 int followup_gzcl();
 int followup_gsha();
-int followup_gnfq();
+int followup_gqot();
+int followup_gpce();
 
 int set_modtime();
 int set_modtime_by_id();
@@ -67,6 +69,8 @@ int set_zephyr_modtime();
 /* Special Queries */
 int set_pobox();
 int get_list_info();
+int add_member_to_list();
+int delete_member_from_list();
 int get_ace_use();
 int qualified_get_lists();
 int get_members_of_list();
@@ -76,7 +80,6 @@ int trigger_dcm();
 int count_members_of_list();
 int get_lists_of_member();
 int register_user();
-int add_user_group();
 
 
 \f
@@ -110,6 +113,8 @@ static char MOD1[] = "modtime";
 static char MOD2[] = "modby";
 static char MOD3[] = "modwith";
 static char NAME[] = "name";
+static char QUOTA[] = "quota";
+static char QUOTA_TYPE[] = "quota_type";
 static char SERVICE[] = "service";
 static char SHELL[] = "shell";
 static char STATUS[] = "status";
@@ -130,27 +135,32 @@ static struct valobj VOsort0[] = {
 };
 
 static struct valobj VOdate1[] = {
-  {V_DATE, 1, 0, 0, 0, SMS_DATE},
+  {V_DATE, 1, 0, 0, 0, MR_DATE},
 };
 
 static struct valobj VOuser0[] = {
-  {V_ID, 0, USERS, LOGIN, USERS_ID, SMS_USER},
+  {V_ID, 0, USERS, LOGIN, USERS_ID, MR_USER},
+};
+
+static struct valobj VOuser0lock[] = {
+  {V_LOCK, 0, USERS, 0, USERS_ID, MR_DEADLOCK},
+  {V_ID, 0, USERS, LOGIN, USERS_ID, MR_USER},
 };
 
 static struct valobj VOmach0[] = {
-  {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE},
+  {V_ID, 0, MACHINE, NAME, MACH_ID, MR_MACHINE},
 };
 
 static struct valobj VOclu0[] = {
-  {V_ID, 0, CLUSTER, NAME, CLU_ID, SMS_CLUSTER},
+  {V_ID, 0, CLUSTER, NAME, CLU_ID, MR_CLUSTER},
 };
 
 static struct valobj VOlist0[] = {
-  {V_ID, 0, LIST, NAME, LIST_ID, SMS_LIST},
+  {V_ID, 0, LIST, NAME, LIST_ID, MR_LIST},
 };
 
 static struct valobj VOfilsys0[] = {
-  {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
+  {V_ID, 0, FILESYS, LABEL, FILSYS_ID, MR_FILESYS},
 };
 
 static struct valobj VOchar0[] = {
@@ -163,13 +173,14 @@ static struct valobj VOsort01[] = {
 };
 
 static struct valobj VOuser0sort[] = {
-  {V_ID, 0, USERS, LOGIN, USERS_ID, SMS_USER},
+  {V_ID, 0, USERS, LOGIN, USERS_ID, MR_USER},
   {V_SORT, 0},
 };
 
 static struct valobj VOfilsys0user1[] = {
-  {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
-  {V_ID, 1, USERS, LOGIN, USERS_ID, SMS_USER},
+  {V_LOCK, 0, FILESYS, 0, FILSYS_ID, MR_DEADLOCK},
+  {V_ID, 0, FILESYS, LABEL, FILSYS_ID, MR_FILESYS},
+  {V_ID, 1, USERS, LOGIN, USERS_ID, MR_USER},
 };
 
 
@@ -249,19 +260,20 @@ static char *ausr_fields[] = {
 };
 
 static struct valobj ausr_valobj[] = {
+  {V_LOCK, 0, USERS, 0, USERS_ID, MR_DEADLOCK},
   {V_CHAR, 0},
   {V_CHAR, 3},
   {V_CHAR, 4},
   {V_CHAR, 5},
   {V_CHAR, 7},
-  {V_TYPE, 8, CLASS, 0, 0, SMS_BAD_CLASS},
+  {V_TYPE, 8, CLASS, 0, 0, MR_BAD_CLASS},
 };
 
 static struct validate ausr_validate = {
   ausr_valobj,
-  6,
+  7,
   LOGIN,
-  "u.login = \"%s\"",
+  "users.login = \"%s\"",
   1,
   USERS_ID,
   0,
@@ -273,9 +285,16 @@ static char *rusr_fields[] = {
   UID, LOGIN, "fs_type"
 };
 
+static struct valobj rusr_valobj[] = {
+  {V_LOCK, 0, USERS, 0, USERS_ID, MR_DEADLOCK},
+  {V_LOCK, 0, LIST, 0, LIST_ID, MR_DEADLOCK},
+  {V_LOCK, 0, FILESYS, 0, FILSYS_ID, MR_DEADLOCK},
+  {V_LOCK, 0, "nfsphys", 0, "nfsphys_id", MR_DEADLOCK},
+};
+
 static struct validate rusr_validate = {
-  0,
-  0,
+  rusr_valobj,
+  4,
   0,
   0,
   0,
@@ -292,18 +311,19 @@ static char *uusr_fields[] = {
 };
 
 static struct valobj uusr_valobj[] = {
-    {V_ID, 0, USERS, LOGIN, USERS_ID, SMS_USER},
-    {V_RENAME, 1, USERS, LOGIN, USERS_ID, SMS_NOT_UNIQUE},
+    {V_LOCK, 0, USERS, 0, USERS_ID, MR_DEADLOCK},
+    {V_ID, 0, USERS, LOGIN, USERS_ID, MR_USER},
+    {V_RENAME, 1, USERS, LOGIN, USERS_ID, MR_NOT_UNIQUE},
     {V_CHAR, 4},
     {V_CHAR, 5},
     {V_CHAR, 6},
     {V_CHAR, 8},
-    {V_TYPE, 9, CLASS, 0, 0, SMS_BAD_CLASS},
+    {V_TYPE, 9, CLASS, 0, 0, MR_BAD_CLASS},
 };
 
 static struct validate uusr_validate = {
   uusr_valobj,
-  7,
+  8,
   0,
   0,
   0,
@@ -319,8 +339,8 @@ static char *uush_fields[] = {
 };
 
 static struct validate uush_validate = {
-  VOuser0,
-  1,
+  VOuser0lock,
+  2,
   0,
   0,
   0,
@@ -336,8 +356,8 @@ static char *uust_fields[] = {
 };
 
 static struct validate uust_validate = {
-  VOuser0,
-  1,
+  VOuser0lock,
+  2,
   0,
   0,
   0,
@@ -352,8 +372,8 @@ static char *dusr_fields[] = {
 };
 
 static struct validate dusr_validate = {
-  VOuser0,
-  1,
+  VOuser0lock,
+  2,
   0,
   0,
   0,
@@ -368,12 +388,13 @@ static char *dubu_fields[] = {
 };
 
 static struct valobj dubu_valobj[] = {
-    {V_ID, 0, USERS, UID, USERS_ID, SMS_USER}
+    {V_LOCK, 0, USERS, 0, USERS_ID, MR_DEADLOCK},
+    {V_ID, 0, USERS, UID, USERS_ID, MR_USER}
 };
 
 static struct validate dubu_validate = {
   dubu_valobj,
-  1,
+  2,
   0,
   0,
   0,
@@ -383,6 +404,43 @@ static struct validate dubu_validate = {
   0,
 };
 
+static char *gkum_fields[] = { LOGIN, "kerberos",
+                              LOGIN, "kerberos" };
+
+static char *akum_fields[] = { LOGIN, "kerberos" };
+
+static struct valobj akum_valobj[] =
+{
+    {V_ID, 0, USERS, LOGIN, USERS_ID, MR_USER},
+    {V_ID, 1, "strings", "string", "string_id", MR_NO_MATCH},
+};
+
+static struct validate akum_validate =
+{
+    akum_valobj,
+    1,
+    USERS_ID,
+    "kerberos.users_id = %d or kerberos.string_id = %d",
+    2,
+    USERS_ID,
+    access_user,
+    setup_akum,
+    0
+};
+
+static struct validate dkum_validate =
+{
+    akum_valobj,
+    2,
+    USERS_ID,
+    "kerberos.users_id = %d and kerberos.string_id = %d",
+    2,
+    USERS_ID,
+    access_user,
+    0,
+    0
+};
+
 static char *gfbl_fields[] = {
   LOGIN,
   LOGIN, "fullname", "nickname", "home_addr",
@@ -410,8 +468,8 @@ static char *ufbl_fields[] = {
 };
 
 static struct validate ufbl_validate = {
-  VOuser0,
-  1,
+  VOuser0lock,
+  2,
   0,
   0,
   0,
@@ -430,7 +488,7 @@ static struct validate gpob_validate = {
   VOuser0,
   1,
   "potype",
-  "u.potype != \"NONE\" and u.users_id=%d",
+  "users.potype != \"NONE\" and users.users_id=%d",
   1,
   0,
   access_user,
@@ -459,14 +517,15 @@ static char *spob_fields[] = {
 };
 
 static struct valobj spob_valobj[] = {
-  {V_ID, 0, USERS, LOGIN, USERS_ID, SMS_USER},
-  {V_TYPE, 1, "pobox", 0, 0, SMS_TYPE},
+  {V_LOCK, 0, USERS, 0, USERS_ID, MR_DEADLOCK},
+  {V_ID, 0, USERS, LOGIN, USERS_ID, MR_USER},
+  {V_TYPE, 1, "pobox", 0, 0, MR_TYPE},
 };
 
 static struct validate spob_validate = /* SET_POBOX */
 {
   spob_valobj,
-  2,
+  3,
   0,
   0,
   0,
@@ -478,8 +537,8 @@ static struct validate spob_validate =      /* SET_POBOX */
 
 static struct validate spop_validate = /* SET_POBOX_POP */
 {
-  VOuser0,
-  1,
+  VOuser0lock,
+  2,
   0,
   0,
   0,
@@ -491,8 +550,8 @@ static struct validate spop_validate =      /* SET_POBOX_POP */
 
 static struct validate dpob_validate = /* DELETE_POBOX */
 {
-  VOuser0,
-  1,
+  VOuser0lock,
+  2,
   0,
   0,
   0,
@@ -513,14 +572,15 @@ static char *amac_fields[] = {
 
 static struct valobj amac_valobj[] = {
   {V_CHAR, 0},
-  {V_TYPE, 1, "mac_type", 0, 0, SMS_TYPE},
+  {V_LOCK, 0, MACHINE, 0, MACH_ID, MR_DEADLOCK},
+  {V_TYPE, 1, "mac_type", 0, 0, MR_TYPE},
 };
 
 static struct validate amac_validate = {
   amac_valobj,
-  2,
+  3,
   NAME,
-  "m.name = uppercase(\"%s\")",
+  "imembers.name = uppercase(\"%s\")",
   1,
   MACH_ID,
   0,
@@ -534,14 +594,15 @@ static char *umac_fields[] = {
 };
 
 static struct valobj umac_valobj[] = {
-  {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE},
-  {V_RENAME, 1, MACHINE, NAME, MACH_ID, SMS_NOT_UNIQUE},
-  {V_TYPE, 2, "mac_type", 0, 0, SMS_TYPE},
+  {V_LOCK, 0, MACHINE, 0, MACH_ID, MR_DEADLOCK},
+  {V_ID, 0, MACHINE, NAME, MACH_ID, MR_MACHINE},
+  {V_RENAME, 1, MACHINE, NAME, MACH_ID, MR_NOT_UNIQUE},
+  {V_TYPE, 2, "mac_type", 0, 0, MR_TYPE},
 };
 
 static struct validate umac_validate = {
   umac_valobj,
-  3,
+  4,
   0,
   0,
   0,
@@ -555,9 +616,14 @@ static char *dmac_fields[] = {
   NAME,
 };
 
+static struct valobj dmac_valobj[] = {
+  {V_LOCK, 0, MACHINE, 0, MACH_ID, MR_DEADLOCK},
+  {V_ID, 0, MACHINE, NAME, MACH_ID, MR_MACHINE},
+};
+
 static struct validate dmac_validate = {
-  VOmach0,
-  1,
+  dmac_valobj,
+  2,
   0,
   0,
   0,
@@ -576,12 +642,17 @@ static char *aclu_fields[] = {
   NAME, DESC, LOCATION,
 };
   
+static struct valobj aclu_valobj[] = {
+  {V_LOCK, 0, CLUSTER, 0, CLU_ID, MR_DEADLOCK},
+  {V_CHAR, 0}
+};
+
 static struct validate aclu_validate = /* for aclu  */
 {
-  VOchar0,
-  1,
+  aclu_valobj,
+  2,
   NAME,
-  "c.name = \"%s\"",
+  "clusters.name = \"%s\"",
   1,
   "clu_id",
   0,
@@ -595,13 +666,14 @@ static char *uclu_fields[] = {
 };
 
 static struct valobj uclu_valobj[] = {
-  {V_ID, 0, CLUSTER, NAME, CLU_ID, SMS_CLUSTER},
-  {V_RENAME, 1, CLUSTER, NAME, CLU_ID, SMS_NOT_UNIQUE},
+  {V_LOCK, 0, CLUSTER, 0, CLU_ID, MR_DEADLOCK},
+  {V_ID, 0, CLUSTER, NAME, CLU_ID, MR_CLUSTER},
+  {V_RENAME, 1, CLUSTER, NAME, CLU_ID, MR_NOT_UNIQUE},
 };
 
 static struct validate uclu_validate = {
   uclu_valobj,
-  2,
+  3,
   0,
   0,
   0,
@@ -634,8 +706,8 @@ static char *gmcm_fields[] = {
 
 static struct valobj amtc_valobj[] =   /* ADD_MACHINE_TO_CLUSTER */
 {                                      /* DELETE_MACHINE_FROM_CLUSTER */
-  {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE},
-  {V_ID, 1, CLUSTER, NAME, CLU_ID, SMS_CLUSTER},
+  {V_ID, 0, MACHINE, NAME, MACH_ID, MR_MACHINE},
+  {V_ID, 1, CLUSTER, NAME, CLU_ID, MR_CLUSTER},
 };
 
 static struct validate amtc_validate = /* for amtc and dmfc */
@@ -643,7 +715,7 @@ static struct validate amtc_validate = /* for amtc and dmfc */
   amtc_valobj,
   2,
   MACH_ID,
-  "m.mach_id = %d and m.clu_id = %d",
+  "imembers.mach_id = %d and imembers.clu_id = %d",
   2,
   0,
   0,
@@ -662,7 +734,7 @@ static char *acld_fields[] = {
 
 static struct valobj acld_valobj[] =
 {
-  {V_ID, 0, CLUSTER, NAME, CLU_ID, SMS_CLUSTER},
+  {V_ID, 0, CLUSTER, NAME, CLU_ID, MR_CLUSTER},
   {V_CHAR, 2},
 };
 
@@ -671,7 +743,7 @@ static struct validate acld_validate =      /* ADD_CLUSTER_DATA */
   acld_valobj,
   2,
   CLU_ID,
-  "s.clu_id = %d and s.serv_label = \"%s\" and s.serv_cluster = \"%s\"",
+  "svc.clu_id = %d and svc.serv_label = \"%s\" and svc.serv_cluster = \"%s\"",
   3,
   0,
   0,
@@ -705,9 +777,9 @@ static char *qgsv_fields[] = {
 };
 
 static struct valobj qgsv_valobj[] = {
-  {V_TYPE, 0, "boolean", 0, 0, SMS_TYPE},
-  {V_TYPE, 1, "boolean", 0, 0, SMS_TYPE},
-  {V_TYPE, 2, "boolean", 0, 0, SMS_TYPE},
+  {V_TYPE, 0, "boolean", 0, 0, MR_TYPE},
+  {V_TYPE, 1, "boolean", 0, 0, MR_TYPE},
+  {V_TYPE, 2, "boolean", 0, 0, MR_TYPE},
 };
 
 static struct validate qgsv_validate = {
@@ -728,18 +800,19 @@ static char *asin_fields[] = {
 };
 
 static struct valobj asin_valobj[] = {
+  {V_LOCK, 0, MACHINE, 0, MACH_ID, MR_DEADLOCK},
   {V_CHAR, 0},
-  {V_TYPE, 4, "service", 0, 0, SMS_TYPE},
-  {V_TYPE, 6, ACE_TYPE, 0, 0, SMS_ACE},
-  {V_TYPEDATA, 7, 0, 0, 0, SMS_ACE},
+  {V_TYPE, 4, "service", 0, 0, MR_TYPE},
+  {V_TYPE, 6, ACE_TYPE, 0, 0, MR_ACE},
+  {V_TYPEDATA, 7, 0, 0, 0, MR_ACE},
 };
 
 static struct validate asin_validate = /* for asin, usin */
 {
   asin_valobj,
-  4,
+  5,
   NAME,
-  "s.name = uppercase(\"%s\")",
+  "services.name = uppercase(\"%s\")",
   1,
   0,
   0,
@@ -748,10 +821,10 @@ static struct validate asin_validate =    /* for asin, usin */
 };
 
 static struct validate rsve_validate = {
-  0,
-  0,
+  asin_valobj,
+  1,
   NAME,
-  "s.name = uppercase(\"%s\")",
+  "services.name = uppercase(\"%s\")",
   1,
   0,
   access_service,
@@ -764,10 +837,10 @@ static char *ssif_fields[] = {
 };
 
 static struct validate ssif_validate = {
-  0,
-  0,
+  asin_valobj,
+  1,
   NAME,
-  "s.name = uppercase(\"%s\")",
+  "services.name = uppercase(\"%s\")",
   1,
   0,
   0,
@@ -780,10 +853,10 @@ static char *dsin_fields[] = {
 };
 
 static struct validate dsin_validate = {
-  0,
-  0,
+  asin_valobj,
+  1,
   NAME,
-  "s.name = uppercase(\"%s\")",
+  "services.name = uppercase(\"%s\")",
   1,
   0,
   0,
@@ -816,11 +889,11 @@ static char *qgsh_fields[] = {
 };
 
 static struct valobj qgsh_valobj[] = {
-  {V_TYPE, 1, "boolean", 0, 0, SMS_TYPE},
-  {V_TYPE, 2, "boolean", 0, 0, SMS_TYPE},
-  {V_TYPE, 3, "boolean", 0, 0, SMS_TYPE},
-  {V_TYPE, 4, "boolean", 0, 0, SMS_TYPE},
-  {V_TYPE, 5, "boolean", 0, 0, SMS_TYPE},
+  {V_TYPE, 1, "boolean", 0, 0, MR_TYPE},
+  {V_TYPE, 2, "boolean", 0, 0, MR_TYPE},
+  {V_TYPE, 3, "boolean", 0, 0, MR_TYPE},
+  {V_TYPE, 4, "boolean", 0, 0, MR_TYPE},
+  {V_TYPE, 5, "boolean", 0, 0, MR_TYPE},
 };
 
 static struct validate qgsh_validate = {
@@ -840,16 +913,17 @@ static char *ashi_fields[] = {
 };
 
 static struct valobj ashi_valobj[] = {
-  {V_NAME, 0, "servers", NAME, 0, SMS_SERVICE},
-  {V_ID, 1, MACHINE, NAME, MACH_ID, SMS_MACHINE},
+  {V_LOCK, 0, MACHINE, 0, MACH_ID, MR_DEADLOCK},
+  {V_NAME, 0, "servers", NAME, 0, MR_SERVICE},
+  {V_ID, 1, MACHINE, NAME, MACH_ID, MR_MACHINE},
 };
 
 static struct validate ashi_validate = /* ashi & ushi */
 {
   ashi_valobj,
-  2,
+  3,
   SERVICE,
-  "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
+  "serverhosts.service = uppercase(\"%s\") and serverhosts.mach_id = %d",
   2,
   0,
   access_service,
@@ -860,9 +934,9 @@ static struct validate ashi_validate = /* ashi & ushi */
 static struct validate rshe_validate = 
 {
   ashi_valobj,
-  2,
+  3,
   SERVICE,
-  "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
+  "serverhosts.service = uppercase(\"%s\") and serverhosts.mach_id = %d",
   2,
   0,
   access_service,
@@ -873,9 +947,9 @@ static struct validate rshe_validate =
 static struct validate ssho_validate = 
 {
   ashi_valobj,
-  2,
+  3,
   SERVICE,
-  "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
+  "serverhosts.service = uppercase(\"%s\") and serverhosts.mach_id = %d",
   2,
   0,
   access_service,
@@ -889,20 +963,19 @@ static char *sshi_fields[] = {
 };
 
 static struct valobj sshi_valobj[] = {
-  {V_NAME, 0, "servers", NAME, 0, SMS_SERVICE},
-  {V_ID, 1, MACHINE, NAME, MACH_ID, SMS_MACHINE},
+  {V_NAME, 0, "servers", NAME, 0, MR_SERVICE},
 };
 
 static struct validate sshi_validate = 
 {
   sshi_valobj,
-  2,
-  SERVICE,
-  "s.service = uppercase(\"%s\") and s.mach_id = %d",
-  2,
+  1,
+  0,
+  0,
   0,
   0,
   0,
+  setup_sshi,
   0,
 };
 
@@ -913,9 +986,9 @@ static char *dshi_fields[] = {
 static struct validate dshi_validate = 
 {
   ashi_valobj,
-  2,
+  3,
   SERVICE,
-  "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
+  "serverhosts.service = uppercase(\"%s\") and serverhosts.mach_id = %d",
   2,
   0,
   access_service,
@@ -946,9 +1019,9 @@ static char *asha_fields[] = {
 };
 
 static struct valobj asha_valobj[] = {
-  {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE},
-  {V_TYPE, 1, ACE_TYPE, 0, 0, SMS_ACE},
-  {V_TYPEDATA, 2, 0, 0, 0, SMS_ACE},
+  {V_ID, 0, MACHINE, NAME, MACH_ID, MR_MACHINE},
+  {V_TYPE, 1, ACE_TYPE, 0, 0, MR_ACE},
+  {V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
 };
 
 static struct validate asha_validate = 
@@ -956,7 +1029,7 @@ static struct validate asha_validate =
   asha_valobj,
   3,
   MACH_ID,
-  "ha.mach_id = %d",
+  "hostaccess.mach_id = %d",
   1,
   MACH_ID,
   0,
@@ -1024,19 +1097,20 @@ static char *afil_fields[] = {
 
 static struct valobj afil_valobj[] = {
   {V_CHAR, 0},
-  {V_TYPE, 1, FILESYS, 0, 0, SMS_FSTYPE},
-  {V_ID, 2, MACHINE, NAME, MACH_ID, SMS_MACHINE},
+  {V_LOCK, 0, FILESYS, 0, FILSYS_ID, MR_DEADLOCK},
+  {V_TYPE, 1, FILESYS, 0, 0, MR_FSTYPE},
+  {V_ID, 2, MACHINE, NAME, MACH_ID, MR_MACHINE},
   {V_CHAR, 3},
-  {V_ID, 7, USERS, LOGIN, USERS_ID, SMS_USER},
-  {V_ID, 8, LIST, NAME, LIST_ID, SMS_LIST},
-  {V_TYPE, 10, "lockertype", 0, 0, SMS_TYPE}
+  {V_ID, 7, USERS, LOGIN, USERS_ID, MR_USER},
+  {V_ID, 8, LIST, NAME, LIST_ID, MR_LIST},
+  {V_TYPE, 10, "lockertype", 0, 0, MR_TYPE}
 };
 
 static struct validate afil_validate = {
   afil_valobj,
-  7,
+  8,
   LABEL,
-  "fs.label = \"%s\"",
+  "filesys.label = \"%s\"",
   1,
   FILSYS_ID,
   0,
@@ -1050,21 +1124,22 @@ static char *ufil_fields[] = {
 };
 
 static struct valobj ufil_valobj[] = {
-  {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
-  {V_RENAME, 1, FILESYS, LABEL, FILSYS_ID, SMS_NOT_UNIQUE},
-  {V_TYPE, 2, FILESYS, 0, 0, SMS_FSTYPE},
-  {V_ID, 3, MACHINE, NAME, MACH_ID, SMS_MACHINE},
+  {V_LOCK, 0, FILESYS, 0, FILSYS_ID, MR_DEADLOCK},
+  {V_ID, 0, FILESYS, LABEL, FILSYS_ID, MR_FILESYS},
+  {V_RENAME, 1, FILESYS, LABEL, FILSYS_ID, MR_NOT_UNIQUE},
+  {V_TYPE, 2, FILESYS, 0, 0, MR_FSTYPE},
+  {V_ID, 3, MACHINE, NAME, MACH_ID, MR_MACHINE},
   {V_CHAR, 4},
-  {V_ID, 8, USERS, LOGIN, USERS_ID, SMS_USER},
-  {V_ID, 9, LIST, NAME, LIST_ID, SMS_LIST},
-  {V_TYPE, 11, "lockertype", 0, 0, SMS_TYPE}
+  {V_ID, 8, USERS, LOGIN, USERS_ID, MR_USER},
+  {V_ID, 9, LIST, NAME, LIST_ID, MR_LIST},
+  {V_TYPE, 11, "lockertype", 0, 0, MR_TYPE}
 };
 
 static struct validate ufil_validate = {
   ufil_valobj,
-  8,
+  9,
   LABEL,
-  "fs.filsys_id = %d",
+  "filesys.filsys_id = %d",
   1,
   FILSYS_ID,
   0,
@@ -1077,14 +1152,15 @@ static char *dfil_fields[] = {
 };
 
 static struct valobj dfil_valobj[] = {
-  {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
+  {V_LOCK, 0, FILESYS, 0, FILSYS_ID, MR_DEADLOCK},
+  {V_ID, 0, FILESYS, LABEL, FILSYS_ID, MR_FILESYS},
 };
 
 static struct validate dfil_validate = {
   dfil_valobj,
-  1,
+  2,
   "label",
-  "fs.filsys_id = %d",
+  "filesys.filsys_id = %d",
   1,
   0,
   0,
@@ -1097,7 +1173,7 @@ static char *gfgm_fields[] = {
 };
 
 static struct valobj gfgm_valobj[] = {
-    {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
+    {V_ID, 0, FILESYS, LABEL, FILSYS_ID, MR_FILESYS},
     {V_SORT, 1},
     {V_SORT, 0},
 };
@@ -1115,15 +1191,16 @@ static struct validate gfgm_validate = {
 };
 
 static struct valobj aftg_valobj[] = {
-    {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
-    {V_ID, 1, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
+    {V_LOCK, 0, FILESYS, 0, FILSYS_ID, MR_DEADLOCK},
+    {V_ID, 0, FILESYS, LABEL, FILSYS_ID, MR_FILESYS},
+    {V_ID, 1, FILESYS, LABEL, FILSYS_ID, MR_FILESYS},
 };
 
 static struct validate aftg_validate = {
     aftg_valobj,
-    2,
+    3,
     "group_id",
-    "fg.group_id = %d and fg.filsys_id = %d",
+    "fsgroup.group_id = %d and fsgroup.filsys_id = %d",
     2,
     0,
     0,
@@ -1153,7 +1230,7 @@ static struct validate gnfp_validate = {
 };
 
 static struct valobj anfp_valobj[] = {
-  {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE},
+  {V_ID, 0, MACHINE, NAME, MACH_ID, MR_MACHINE},
   {V_CHAR, 1},
 };
 
@@ -1161,7 +1238,7 @@ static struct validate anfp_validate = {
   anfp_valobj,
   2,
   DIR,
-  "np.mach_id = %d and np.dir = \"%s\"",
+  "nfsphys.mach_id = %d and nfsphys.dir = \"%s\"",
   2,
   "nfsphys_id",
   0,
@@ -1177,7 +1254,7 @@ static struct validate dnfp_validate = {
   VOmach0,
   1,
   DIR,
-  "np.mach_id = %d and np.dir = \"%s\"",
+  "nfsphys.mach_id = %d and nfsphys.dir = \"%s\"",
   2,
   "nfsphys_id",
   0,
@@ -1185,76 +1262,158 @@ static struct validate dnfp_validate = {
   set_nfsphys_modtime,
 };
 
-static char *gnfq_fields[] = {
-  FILESYS, LOGIN,
-  FILESYS, LOGIN, "quota", DIR, MACHINE, MOD1, MOD2, MOD3,
+static char *gqot_fields[] = {
+  FILESYS, TYPE, NAME,
+  FILESYS, TYPE, NAME, QUOTA, DIR, MACHINE, MOD1, MOD2, MOD3,
 };
 
-static struct valobj gnfq_valobj[] = {
-  {V_ID, 1, USERS, LOGIN, USERS_ID, SMS_USER},
-  {V_SORT, 0},
+static struct valobj gqot_valobj[] = {
+  {V_TYPE, 1, QUOTA_TYPE, 0, 0, MR_TYPE},
+  {V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
+  {V_SORT, 0, 0, 0, 0, 0},
+};
+
+static struct validate gqot_validate = {
+  gqot_valobj,
+  3,
+  0,
+  0,
+  0,
+  0,
+  0,
+  0,
+  followup_gqot,
+};
+
+static char *gqbf_fields[] = {
+  FILESYS,
+  FILESYS, TYPE, NAME, QUOTA, DIR, MACHINE, MOD1, MOD2, MOD3,
+};
+
+static struct validate gqbf_validate = {
+  VOsort0,
+  1,
+  0,
+  0,
+  0,
+  0,
+  access_filesys,
+  0,
+  followup_gqot,
+};
+
+static char *aqot_fields[] = {
+  FILESYS, TYPE, NAME, QUOTA,
+};
+
+static struct valobj aqot_valobj[] = {
+  {V_LOCK, 0, FILESYS, 0, FILSYS_ID, MR_DEADLOCK},
+  {V_ID, 0, FILESYS, LABEL, FILSYS_ID, MR_FILESYS},
+  {V_TYPE, 1, QUOTA_TYPE, 0, 0, MR_TYPE},
+  {V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
+};
+
+static struct validate aqot_validate = {
+  aqot_valobj,
+  4,
+  FILSYS_ID,
+  "quota.filsys_id = %d and quota.type = \"%s\" and quota.entity_id = %d",
+  3,
+  0,
+  0,
+  0,
+  followup_aqot,
+};
+
+static struct validate uqot_validate = {
+  aqot_valobj,
+  4,
+  FILSYS_ID,
+  "quota.filsys_id = %d and quota.type = \"%s\" and quota.entity_id = %d",
+  3,
+  0,
+  0,
+  setup_dqot,
+  followup_aqot,
+};
+
+static struct validate dqot_validate = {
+  aqot_valobj,
+  4,
+  FILSYS_ID,
+  "quota.filsys_id = %d and quota.type = \"%s\" and quota.entity_id = %d",
+  3,
+  0,
+  0,
+  setup_dqot,
+  0,
+};
+
+static char *gnfq_fields[] = {
+  FILESYS, LOGIN,
+  FILESYS, LOGIN, QUOTA, DIR, MACHINE, MOD1, MOD2, MOD3,
 };
 
 static struct validate gnfq_validate = {
-  gnfq_valobj,
-  2,
+  VOsort0,
+  1,
   0,
   0,
   0,
   0,
   access_filesys,
   0,
-  followup_fix_modby,
+  followup_gqot,
 };
 
 static char *gnqp_fields[] = {
   MACHINE, DIR,
-  FILESYS, LOGIN, "quota", DIR, MACHINE, MOD1, MOD2, MOD3,
+  FILESYS, LOGIN, QUOTA, DIR, MACHINE, MOD1, MOD2, MOD3,
 };
 
 static char *anfq_fields[] = {
-  FILESYS, LOGIN, "quota",
+  FILESYS, LOGIN, QUOTA,
 };
 
 static struct validate anfq_validate = {
   VOfilsys0user1,
-  2,
-  USERS_ID,
-  "nq.filsys_id = %d and nq.users_id = %d",
+  3,
+  FILSYS_ID,
+  "quota.filsys_id = %d and quota.type = \"USER\" and quota.entity_id = %d",
   2,
   0,
   0,
   0,
-  followup_anfq,
+  followup_aqot,
 };
 
 static struct validate unfq_validate = {
   VOfilsys0user1,
-  2,
-  USERS_ID,
-  "nq.filsys_id = %d and nq.users_id = %d",
+  3,
+  FILSYS_ID,
+  "quota.filsys_id = %d and quota.type = \"USER\" and quota.entity_id = %d",
   2,
   0,
   0,
-  setup_dnfq,
-  followup_anfq,
+  setup_dqot,
+  followup_aqot,
 };
 
 static struct validate dnfq_validate = {
   VOfilsys0user1,
-  2,
-  USERS_ID,
-  "nq.filsys_id = %d and nq.users_id = %d",
+  3,
+  FILSYS_ID,
+  "quota.filsys_id = %d and quota.entity_id = %d",
   2,
   0,
   0,
-  setup_dnfq,
+  setup_dqot,
   0,
 };
 
 static char *glin_fields[] = {
   NAME,
-  NAME, "active", "public", "hidden", "maillist", "group", "gid",
+  NAME, "active", "public", "hidden", "maillist", "grouplist", "gid",
   ACE_TYPE, ACE_NAME, DESC, MOD1, MOD2, MOD3,
 };
 
@@ -1271,21 +1430,22 @@ static struct validate glin_validate = {
 };
 
 static char *alis_fields[] = {
-  NAME, "active", "public", "hidden", "maillist", "group", "gid",
+  NAME, "active", "public", "hidden", "maillist", "grouplist", "gid",
   ACE_TYPE, ACE_NAME, DESC,
 };
 
 static struct valobj alis_valobj[] = {
+  {V_LOCK, 0, LIST, 0, LIST_ID, MR_DEADLOCK},
   {V_CHAR, 0},
-  {V_TYPE, 7, ACE_TYPE, 0, 0, SMS_ACE},
-  {V_TYPEDATA, 8, 0, 0, LIST_ID, SMS_ACE},
+  {V_TYPE, 7, ACE_TYPE, 0, 0, MR_ACE},
+  {V_TYPEDATA, 8, 0, 0, LIST_ID, MR_ACE},
 };
 
 static struct validate alis_validate = {
   alis_valobj,
-  3,
+  4,
   NAME,
-  "l.name = \"%s\"",
+  "list.name = \"%s\"",
   1,
   LIST_ID,
   0,
@@ -1295,22 +1455,23 @@ static struct validate alis_validate = {
 
 static char *ulis_fields[] = {
   NAME,
-  "newname", "active", "public", "hidden", "maillist", "group", "gid",
+  "newname", "active", "public", "hidden", "maillist", "grouplist", "gid",
   ACE_TYPE, ACE_NAME, DESC,
 };
 
 static struct valobj ulis_valobj[] = {
-  {V_ID, 0, LIST, NAME, LIST_ID, SMS_LIST},
-  {V_RENAME, 1, LIST, NAME, LIST_ID, SMS_NOT_UNIQUE},
-  {V_TYPE, 8, ACE_TYPE, 0, 0, SMS_ACE},
-  {V_TYPEDATA, 9, 0, 0, LIST_ID, SMS_ACE},
+  {V_LOCK, 0, LIST, 0, LIST_ID, MR_DEADLOCK},
+  {V_ID, 0, LIST, NAME, LIST_ID, MR_LIST},
+  {V_RENAME, 1, LIST, NAME, LIST_ID, MR_NOT_UNIQUE},
+  {V_TYPE, 8, ACE_TYPE, 0, 0, MR_ACE},
+  {V_TYPEDATA, 9, 0, 0, LIST_ID, MR_ACE},
 };
 
 static struct validate ulis_validate = {
   ulis_valobj,
-  4,
+  5,
   NAME,
-  "l.list_id = %d",
+  "list.list_id = %d",
   1,
   LIST_ID,
   access_list,
@@ -1326,7 +1487,7 @@ static struct validate dlis_validate = {
   VOlist0,
   1,
   NAME,
-  "l.list_id = %d",
+  "list.list_id = %d",
   1,
   0,
   access_list,
@@ -1339,22 +1500,36 @@ static char *amtl_fields[] = {
 };
 
 static struct valobj amtl_valobj[] = {
-  {V_ID, 0, LIST, NAME, LIST_ID, SMS_LIST},
-  {V_TYPE, 1, "member", 0, 0, SMS_TYPE},
-  {V_TYPEDATA, 2, 0, 0, 0, SMS_NO_MATCH},
+  {V_LOCK, 0, LIST, 0, LIST_ID, MR_DEADLOCK},
+  {V_ID, 0, LIST, NAME, LIST_ID, MR_LIST},
+  {V_TYPE, 1, "member", 0, 0, MR_TYPE},
+  {V_TYPEDATA, 2, 0, 0, 0, MR_NO_MATCH},
 };
 
-static struct validate amtl_validate = /* for amtl and dmfl */
+static struct validate amtl_validate =
 {
   amtl_valobj,
-  3,
-  "member_id",
-  "m.list_id = %d and m.member_type = \"%s\" and m.member_id = %d",
-  3,
+  4,
+  0,
+  0,
+  0,
   0,
   access_list,
   0,
-  followup_amtl,
+  add_member_to_list,
+};
+
+static struct validate dmfl_validate =
+{
+  amtl_valobj,
+  4,
+  0,
+  0,
+  0,
+  0,
+  access_list,
+  0,
+  delete_member_from_list,
 };
 
 static char *gaus_fields[] = {
@@ -1363,8 +1538,8 @@ static char *gaus_fields[] = {
 };
 
 static struct valobj gaus_valobj[] = {
-  {V_TYPE, 0, "gaus", 0, 0, SMS_TYPE},
-  {V_TYPEDATA, 1, 0, 0, 0, SMS_NO_MATCH},
+  {V_TYPE, 0, "gaus", 0, 0, MR_TYPE},
+  {V_TYPEDATA, 1, 0, 0, 0, MR_NO_MATCH},
 };
 
 static struct validate gaus_validate = {
@@ -1380,16 +1555,16 @@ static struct validate gaus_validate = {
 };
 
 static char *qgli_fields[] = {
-    "active", "public", "hidden", "maillist", "group",
+    "active", "public", "hidden", "maillist", "grouplist",
     "list",
 };
 
 static struct valobj qgli_valobj[] = {
-  {V_TYPE, 0, "boolean", 0, 0, SMS_TYPE},
-  {V_TYPE, 1, "boolean", 0, 0, SMS_TYPE},
-  {V_TYPE, 2, "boolean", 0, 0, SMS_TYPE},
-  {V_TYPE, 3, "boolean", 0, 0, SMS_TYPE},
-  {V_TYPE, 4, "boolean", 0, 0, SMS_TYPE},
+  {V_TYPE, 0, "boolean", 0, 0, MR_TYPE},
+  {V_TYPE, 1, "boolean", 0, 0, MR_TYPE},
+  {V_TYPE, 2, "boolean", 0, 0, MR_TYPE},
+  {V_TYPE, 3, "boolean", 0, 0, MR_TYPE},
+  {V_TYPE, 4, "boolean", 0, 0, MR_TYPE},
 };
 
 static struct validate qgli_validate = {
@@ -1423,12 +1598,12 @@ static struct validate gmol_validate = {
 
 static char *glom_fields[] = {
   "member_type", "member_name",
-  "list_name", "active", "public", "hidden", "maillist", "group",
+  "list_name", "active", "public", "hidden", "maillist", "grouplist",
 };
 
 static struct valobj glom_valobj[] = {
-  {V_TYPE, 0, "rmember", 0, 0, SMS_TYPE},
-  {V_TYPEDATA, 1, 0, 0, 0, SMS_NO_MATCH},
+  {V_TYPE, 0, "rmember", 0, 0, MR_TYPE},
+  {V_TYPEDATA, 1, 0, 0, 0, MR_NO_MATCH},
   {V_SORT, 0},
 };
 
@@ -1461,22 +1636,6 @@ static struct validate cmol_validate = {
   count_members_of_list,
 };
 
-static char *augr_fields[] = {
-  LOGIN,
-};
-
-static struct validate augr_validate = {
-  0,
-  0,
-  0,
-  0,
-  0,
-  0,
-  0,
-  0,
-  add_user_group,
-};
-
 static char *gzcl_fields[] = {
     CLASS,
     CLASS, "xmt_type", "xmt_name", "sub_type", "sub_name",
@@ -1502,21 +1661,21 @@ static char *azcl_fields[] = {
 
 static struct valobj azcl_valobj[] = {
   {V_CHAR, 0},
-  {V_TYPE, 1, ACE_TYPE, 0, 0, SMS_ACE},
-  {V_TYPEDATA, 2, 0, 0, LIST_ID, SMS_ACE},
-  {V_TYPE, 3, ACE_TYPE, 0, 0, SMS_ACE},
-  {V_TYPEDATA, 4, 0, 0, LIST_ID, SMS_ACE},
-  {V_TYPE, 5, ACE_TYPE, 0, 0, SMS_ACE},
-  {V_TYPEDATA, 6, 0, 0, LIST_ID, SMS_ACE},
-  {V_TYPE, 7, ACE_TYPE, 0, 0, SMS_ACE},
-  {V_TYPEDATA, 8, 0, 0, LIST_ID, SMS_ACE},
+  {V_TYPE, 1, ACE_TYPE, 0, 0, MR_ACE},
+  {V_TYPEDATA, 2, 0, 0, LIST_ID, MR_ACE},
+  {V_TYPE, 3, ACE_TYPE, 0, 0, MR_ACE},
+  {V_TYPEDATA, 4, 0, 0, LIST_ID, MR_ACE},
+  {V_TYPE, 5, ACE_TYPE, 0, 0, MR_ACE},
+  {V_TYPEDATA, 6, 0, 0, LIST_ID, MR_ACE},
+  {V_TYPE, 7, ACE_TYPE, 0, 0, MR_ACE},
+  {V_TYPEDATA, 8, 0, 0, LIST_ID, MR_ACE},
 };
 
 static struct validate azcl_validate = {
   azcl_valobj,
-  8,
+  9,
   CLASS,
-  "z.class = \"%s\"",
+  "zephyr.class = \"%s\"",
   1,
   0,
   0,
@@ -1530,22 +1689,22 @@ static char *uzcl_fields[] = {
 };
 
 static struct valobj uzcl_valobj[] = {
-  {V_RENAME, 1, "zephyr", CLASS, 0, SMS_NOT_UNIQUE},
-  {V_TYPE, 2, ACE_TYPE, 0, 0, SMS_ACE},
-  {V_TYPEDATA, 3, 0, 0, LIST_ID, SMS_ACE},
-  {V_TYPE, 4, ACE_TYPE, 0, 0, SMS_ACE},
-  {V_TYPEDATA, 5, 0, 0, LIST_ID, SMS_ACE},
-  {V_TYPE, 6, ACE_TYPE, 0, 0, SMS_ACE},
-  {V_TYPEDATA, 7, 0, 0, LIST_ID, SMS_ACE},
-  {V_TYPE, 8, ACE_TYPE, 0, 0, SMS_ACE},
-  {V_TYPEDATA, 9, 0, 0, LIST_ID, SMS_ACE},
+  {V_RENAME, 1, "zephyr", CLASS, 0, MR_NOT_UNIQUE},
+  {V_TYPE, 2, ACE_TYPE, 0, 0, MR_ACE},
+  {V_TYPEDATA, 3, 0, 0, LIST_ID, MR_ACE},
+  {V_TYPE, 4, ACE_TYPE, 0, 0, MR_ACE},
+  {V_TYPEDATA, 5, 0, 0, LIST_ID, MR_ACE},
+  {V_TYPE, 6, ACE_TYPE, 0, 0, MR_ACE},
+  {V_TYPEDATA, 7, 0, 0, LIST_ID, MR_ACE},
+  {V_TYPE, 8, ACE_TYPE, 0, 0, MR_ACE},
+  {V_TYPEDATA, 9, 0, 0, LIST_ID, MR_ACE},
 };
 
 static struct validate uzcl_validate = {
   uzcl_valobj,
   9,
   CLASS,
-  "z.class = \"%s\"",
+  "zephyr.class = \"%s\"",
   1,
   0,
   0,
@@ -1557,7 +1716,7 @@ static struct validate dzcl_validate = {
   0,
   0,
   CLASS,
-  "z.class = \"%s\"",
+  "zephyr.class = \"%s\"",
   1,
   0,
   0,
@@ -1565,31 +1724,107 @@ static struct validate dzcl_validate = {
   0,
 };
 
-static char *gasv_fields[] = {
-  SERVICE, "protocol", "port", DESC,
+static char *gsvc_fields[] = {
+  SERVICE,
+  SERVICE, "protocol", "port", DESC, MOD1, MOD2, MOD3
+};
+
+static char *asvc_fields[] = {
+  SERVICE, "protocol", "port", DESC
 };
 
-static char *gpcp_fields[] = {
+static struct validate asvc_validate = {
+  VOchar0,
+  1,
+  NAME,
+  "services.name = \"%s\"",
+  1,
+  0,
+  0,
+  0,
+  set_modtime,
+};
+
+static char *gpce_fields[] = {
     "printer",
-    "printer", "spooling_host", "spool_directory", "rprinter", "comments",
+    "printer", "spooling_host", "spool_directory", "rprinter",
+    "quotaserver", "authenticate", "price", "comments",
+    MOD1, MOD2, MOD3,
+};
+
+static struct validate gpce_validate = {
+  VOsort0,
+  1,
+  0,
+  0,
+  0,
+  0,
+  0,
+  0,
+  followup_gpce,
+};
+
+static char *apce_fields[] = {
+    "printer", "spooling_host", "spool_directory", "rprinter",
+    "quotaserver", "authenticate", "price", "comments",
     MOD1, MOD2, MOD3,
 };
 
-static char *apcp_fields[] = {
+static struct valobj apce_valobj[] = {
+    {V_CHAR, 0},
+    {V_ID, 1, MACHINE, NAME, MACH_ID, MR_MACHINE},
+    {V_ID, 4, MACHINE, NAME, MACH_ID, MR_MACHINE},
+};
+
+static struct validate apce_validate = {
+  apce_valobj,
+  3,
+  NAME,
+  "printcap.name = \"%s\"",
+  1,
+  0,
+  0,
+  0,
+  set_modtime,
+};
+
+static struct validate dpce_validate = {
+  0,
+  0,
+  NAME,
+  "printcap.name = \"%s\"",
+  1,
+  0,
+  0,
+  0,
+  0,
+};
+
+static char *gpcp_fields[] = {
+    "printer",
     "printer", "spooling_host", "spool_directory", "rprinter", "comments",
     MOD1, MOD2, MOD3,
 };
 
-static struct valobj apcp_valobj[] = {
+static char *gpdm_fields[] = {
+    NAME,
+    NAME, "rpcnum", "host", MOD1, MOD2, MOD3,
+};
+
+static char *apdm_fields[] = {
+    NAME, "rpcnum", "host"
+};
+
+static struct valobj apdm_valobj[] = {
     {V_CHAR, 0},
-    {V_ID, 1, MACHINE, NAME, MACH_ID, SMS_MACHINE},
+    {V_ID, 2, MACHINE, NAME, MACH_ID, MR_MACHINE},
 };
 
-static struct validate apcp_validate = {
-  apcp_valobj,
+static struct validate apdm_validate = {
+  apdm_valobj,
   2,
   NAME,
-  "p.name = \"%s\"",
+  "palladium.name = \"%s\"",
   1,
   0,
   0,
@@ -1597,11 +1832,11 @@ static struct validate apcp_validate = {
   set_modtime,
 };
 
-static struct validate dpcp_validate = {
+static struct validate dpdm_validate = {
   0,
   0,
   NAME,
-  "p.name = \"%s\"",
+  "palladium.name = \"%s\"",
   1,
   0,
   0,
@@ -1620,7 +1855,7 @@ static char *aali_fields[] = {
 
 static struct valobj aali_valobj[] = {
   {V_CHAR, 0},
-  {V_TYPE, 1, "alias", 0, 0, SMS_TYPE},
+  {V_TYPE, 1, "alias", 0, 0, MR_TYPE},
   {V_CHAR, 2},
 };
 
@@ -1628,7 +1863,7 @@ static struct validate aali_validate = {
   aali_valobj,
   3,
   "trans",
-  "a.name = \"%s\" and a.type = \"%s\" and a.trans = \"%s\"",
+  "alias.name = \"%s\" and alias.type = \"%s\" and alias.trans = \"%s\"",
   3,
   0,
   0,
@@ -1641,7 +1876,7 @@ static struct validate dali_validate =    /* DELETE_ALIAS */
   0,
   0,
   "trans",
-  "a.name = \"%s\" and a.type = \"%s\" and a.trans = \"%s\"",
+  "alias.name = \"%s\" and alias.type = \"%s\" and alias.trans = \"%s\"",
   3,
   0,
   0,
@@ -1654,7 +1889,7 @@ static char *gval_fields[] = {
 };
 
 static struct valobj gval_valobj[] = {
-  {V_NAME, 0, "values", NAME, 0, SMS_NO_MATCH},
+  {V_NAME, 0, "numvalues", NAME, 0, MR_NO_MATCH},
 };
 
 static struct validate gval_validate = {
@@ -1678,7 +1913,7 @@ static struct validate aval_validate =    /* for aval, uval, and dval */
   VOchar0,
   1,
   NAME,
-  "v.name = \"%s\"",
+  "numvalues.name = \"%s\"",
   1,
   0,
   0,
@@ -1691,7 +1926,7 @@ static char *dval_fields[] = {
 };
 
 static char *gats_fields[] = {
-  "table", "retrieves", "appends", "updates", "deletes", MOD1, MOD2, MOD3,
+  "table_name", "retrieves", "appends", "updates", "deletes", MOD1, MOD2, MOD3,
 };
 
 
@@ -1706,10 +1941,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "u",
     USERS,
-    "%c = u.login, %c = text(u.uid), %c = u.shell, %c = u.last, %c = u.first, %c = u.middle",
+    "login, text(uid), shell, last, first, middle FROM users",
     galo_fields,
     6,
-    "u.users_id != 0",
+    "users_id != 0",
     0,
     0,
   },
@@ -1721,10 +1956,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "u",
     USERS,
-    "%c = u.login, %c = text(u.uid), %c = u.shell, %c = u.last, %c = u.first, %c = u.middle",
+    "login, text(uid), shell, last, first, middle FROM users",
     galo_fields,
     6,
-    "u.status = 1",
+    "status = 1",
     0,
     0,
   },
@@ -1736,10 +1971,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "u",
     USERS,
-    "%c = u.login, %c = text(u.uid), %c = u.shell, %c = u.last, %c = u.first, %c = u.middle, %c = text(u.status), %c = u.mit_id, %c = u.mit_year, %c = u.modtime, %c = text(u.modby), %c = u.modwith",
+    "login, text(uid), shell, last, first, middle, text(status), mit_id, mit_year, modtime, text(modby), modwith FROM users",
     gubl_fields,
     12,
-    "u.login = \"%s\" and u.users_id != 0",
+    "login = '%s' and users_id != 0",
     1,
     &gubx_validate,
   },
@@ -1751,10 +1986,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "u",
     USERS,
-    "%c = u.login, %c = text(u.uid), %c = u.shell, %c = u.last, %c = u.first, %c = u.middle, %c = text(u.status), %c = u.mit_id, %c = u.mit_year, %c = u.modtime, %c = text(u.modby), %c = u.modwith",
+    "login, text(uid), shell, last, first, middle, text(status), mit_id, mit_year, modtime, text(modby), modwith FROM users",
     gubu_fields,
     12,
-    "u.uid = %s and u.users_id != 0",
+    "uid = %s and users_id != 0",
     1,
     &gubx_validate,
   },
@@ -1766,10 +2001,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "u",
     USERS,
-    "%c = u.login, %c = text(u.uid), %c = u.shell, %c = u.last, %c = u.first, %c = u.middle, %c = text(u.status), %c = u.mit_id, %c = u.mit_year, %c = u.modtime, %c = text(u.modby), %c = u.modwith",
+    "login, text(uid), shell, last, first, middle, text(status), mit_id, mit_year, modtime, text(modby), modwith FROM users",
     gubn_fields,
     12,
-    "u.first = \"%s\" and u.last = \"%s\" and u.users_id != 0",
+    "first = '%s' and last = '%s' and users_id != 0",
     2,
     &VDsortf,
   },
@@ -1781,10 +2016,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "u",
     USERS,
-    "%c = u.login, %c = text(u.uid), %c = u.shell, %c = u.last, %c = u.first, %c = u.middle, %c = text(u.status), %c = u.mit_id, %c = u.mit_year, %c = u.modtime, %c = text(u.modby), %c = u.modwith",
+    "login, text(uid), shell, last, first, middle, text(status), mit_id, mit_year, modtime, text(modby), modwith FROM users",
     gubc_fields,
     12,
-    "u.mit_year = uppercase(\"%s\") and u.users_id != 0",
+    "mit_year = uppercase('%s') and u.users_id != 0",
     1,
     &VDsortf,
   },
@@ -1796,25 +2031,25 @@ struct query Queries2[] = {
     RETRIEVE,
     "u",
     USERS,
-    "%c = u.login, %c = text(u.uid), %c = u.shell, %c = u.last, %c = u.first, %c = u.middle, %c = text(u.status), %c = u.mit_id, %c = u.mit_year, %c = u.modtime, %c = text(u.modby), %c = u.modwith",
+    "login, text(uid), shell, last, first, middle, text(status), mit_id, mit_year, modtime, text(modby), modwith FROM users",
     gubm_fields,
     12,
-    "u.mit_id = \"%s\" and u.users_id != 0",
+    "mit_id = '%s' and users_id != 0",
     1,
     &VDsortf,
   },
 
   {
-    /* Q_AUSR - ADD_USER */
+    /* Q_AUSR - ADD_USER */  /** Needs subselect */
     "add_user",
     "ausr",
     APPEND,
     "u",
     USERS,
-    "login = %c, users_id = values.value, uid = int4(%c), shell = %c, last = %c, first = %c, middle = %c, status = int4(%c), mit_id = %c, mit_year = %c",
+    "(login, users_id, uid, shell, last, first, middle, status, mit_id, mit_year) VALUES ( '%s', numvalues.value, %s, '%s', '%s',  '%s',  '%s',  %s, '%s',  '%s')",
     ausr_fields,
     9,
-    "values.name = \"users_id\"",
+    "numvalues.name = 'users_id'",
     0,
     &ausr_validate,
   },
@@ -1841,7 +2076,7 @@ struct query Queries2[] = {
     UPDATE,
     "u",
     USERS,
-    "login = %c, uid = int4(%c), shell = %c, last = %c, first = %c, middle = %c, status = int4(%c), mit_id = %c, mit_year = %c",
+    "SET login = '%s', uid = %s, shell = '%s', last = '%s', first = '%s', middle = '%s', status = %s, mit_id = '%s',  mit_year = '%s'",
     uusr_fields,
     9,
     "u.users_id = %d",
@@ -1856,7 +2091,7 @@ struct query Queries2[] = {
     UPDATE,
     "u",
     USERS,
-    "shell = %c",
+    "SET shell = '%s'",  
     uush_fields,
     1,
     "u.users_id = %d",
@@ -1871,7 +2106,7 @@ struct query Queries2[] = {
     UPDATE,
     "u",
     USERS,
-    "status = int4(%c)",
+    "status = %s",
     uust_fields,
     1,
     "u.users_id = %d",
@@ -1909,6 +2144,51 @@ struct query Queries2[] = {
     &dubu_validate,
   },
 
+  {
+    /* Q_GKUM - GET_KERBEROS_USER_MAP */
+    "get_kerberos_user_map",
+    "gkum",
+    RETRIEVE,
+    "k",
+    "krbmap",
+    "users.login, strings.string",
+    gkum_fields,
+    2,
+    "users.login = '%s' and strings.string = '%s' and k.users_id = users.users_id and k.string_id = strings.string_id",
+    2,
+    &VDsort2,
+  },
+
+  {
+    /* Q_AKUM - ADD_KERBEROS_USER_MAP */
+    "add_kerberos_user_map",
+    "akum",
+    APPEND,
+    "k",
+    "krbmap",
+    "(users_id, string_id) VALUES (%s, %s)",
+    akum_fields,
+    2,
+    0,
+    0,
+    &akum_validate,
+  },
+
+  {
+    /* Q_DKUM - DELETE_KERBEROS_USER_MAP */
+    "delete_kerberos_user_map",
+    "dkum",
+    DELETE,
+    "k",
+    "krbmap",
+    0,
+    akum_fields,
+    0,
+    "k.users_id = %d and k.string_id = %d",
+    2,
+    &dkum_validate,
+  },
+
   {
     /* Q_GFBL - GET_FINGER_BY_LOGIN */
     "get_finger_by_login",
@@ -1916,7 +2196,7 @@ struct query Queries2[] = {
     RETRIEVE,
     "u",
     USERS,
-    "%c = u.login,%c=u.fullname,%c=u.nickname,%c=u.home_addr,%c=u.home_phone,%c=u.office_addr,%c=u.office_phone,%c=u.mit_dept,%c=u.mit_affil,%c=u.fmodtime,%c=text(u.fmodby),%c=u.fmodwith",
+    "u.login, u.fullname, u.nickname, u.home_addr, u.home_phone, u.office_addr, u.office_phone, u.mit_dept, u.mit_affil, u.fmodtime, text(u.fmodby), u.fmodwith",
     gfbl_fields,
     12,
     "u.users_id = %d",
@@ -1931,7 +2211,7 @@ struct query Queries2[] = {
     UPDATE,
     "u",
     USERS,
-    "fullname=%c,nickname=%c,home_addr=%c,home_phone=%c,office_addr=%c,office_phone=%c,mit_dept=%c,mit_affil=%c",
+    "SET fullname= '%s',nickname= '%s',home_addr= '%s',home_phone= '%s',office_addr= '%s',office_phone= '%s',mit_dept= '%s',mit_affil= '%s'",
     ufbl_fields,
     8,
     "u.users_id = %d",
@@ -1946,7 +2226,7 @@ struct query Queries2[] = {
     RETRIEVE,
     "u",
     USERS,
-    "%c = u.login, %c = u.potype, %c = text(u.pop_id) + \":\" + text(u.box_id), %c = u.pmodtime, %c = text(u.pmodby), %c = u.pmodwith",
+    "u.login, u.potype, text(u.pop_id) + \":\" + text(u.box_id), u.pmodtime, text(u.pmodby), u.pmodwith",
     gpob_fields,
     6,
     "u.users_id = %d",
@@ -1961,10 +2241,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "u",
     USERS,
-    "%c = u.login, %c = u.potype, %c = text(u.pop_id) + \":\" + text(u.box_id)",
+    "u.login, u.potype, text(u.pop_id) + \":\" + text(u.box_id)",
     gpox_fields,
     3,
-    "u.potype != \"NONE\"",
+    "u.potype != 'NONE'",
     0,
     &gpox_validate,
   },
@@ -1976,10 +2256,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "u",
     USERS,
-    "%c = u.login, %c = u.potype, %c = text(u.pop_id) + \":\" + text(u.box_id)",
+    "u.login, u.potype, text(u.pop_id) + \":\" + text(u.box_id)",
     gpox_fields,
     3,
-    "u.potype = \"POP\"",
+    "u.potype = 'POP'",
     0,
     &gpox_validate
   },
@@ -1991,10 +2271,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "u",
     USERS,
-    "%c = u.login, %c = u.potype, %c = text(u.pop_id) + \":\" + text(u.box_id)",
+    "u.login, u.potype, text(u.pop_id) + \":\" + text(u.box_id)",
     gpox_fields,
     3,
-    "u.potype = \"SMTP\"",
+    "u.potype = 'SMTP'",
     0,
     &gpox_validate
   },
@@ -2021,7 +2301,7 @@ struct query Queries2[] = {
     UPDATE,
     "u",
     USERS,
-    "potype = \"POP\"",
+    "SET potype = 'POP'",
     spob_fields,
     0,
     "u.users_id = %d",
@@ -2036,7 +2316,7 @@ struct query Queries2[] = {
     UPDATE,
     "u",
     USERS,
-    "potype = \"NONE\"",
+    "SET potype = 'NONE'",
     spob_fields,
     0,
     "u.users_id = %d",
@@ -2051,10 +2331,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "m",
     MACHINE,
-    "%c = m.name, %c = m.type, %c = m.modtime, %c = text(m.modby), %c =m.modwith",
+    "m.name, m.type, m.modtime, text(m.modby), m.modwith",
     gmac_fields,
     5,
-    "m.name = uppercase(\"%s\") and m.mach_id != 0",
+    "m.name = uppercase('%s') and m.mach_id != 0",
     1,
     &VDsortf,
   },
@@ -2066,10 +2346,10 @@ struct query Queries2[] = {
     APPEND,
     "m",
     MACHINE,
-    "name = uppercase(%c), mach_id = values.value, type = %c",
+    "(name, mach_id, type) VALUES (uppercase('%s'),numvalues.value,'%s')",
     amac_fields,
     2,
-    "values.name = \"mach_id\"",
+    "numvalues.name = 'mach_id'",
     0,
     &amac_validate,
   },
@@ -2081,7 +2361,7 @@ struct query Queries2[] = {
     UPDATE,
     "m",
     MACHINE,
-    "name = uppercase(%c), type = %c",
+    "SET name = uppercase('%s'), type = '%s'",
     umac_fields,
     2,
     "m.mach_id = %d",
@@ -2111,10 +2391,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "c",
     CLUSTER,
-    "%c = c.name, %c = c.desc, %c = c.location, %c = c.modtime, %c = text(c.modby), %c = c.modwith",
+    "c.name, c.desc, c.location, c.modtime, text(c.modby), c.modwith",
     gclu_fields,
     6,
-    "c.name = \"%s\" and c.clu_id != 0",
+    "c.name = '%s' and c.clu_id != 0",
     1,
     &VDsortf,
   },
@@ -2126,10 +2406,10 @@ struct query Queries2[] = {
     APPEND,
     "c",
     CLUSTER,
-    "name = %c, clu_id = values.value, desc = %c, location = %c",
+    "(name, clu_id, desc, location) VALUES ('%s',numvalues.value,'%s','%s')",
     aclu_fields,
     3,
-    "values.name = \"clu_id\"",
+    "numvalues.name = 'clu_id'",
     0,
     &aclu_validate,
   },
@@ -2141,7 +2421,7 @@ struct query Queries2[] = {
     UPDATE,
     "c",
     CLUSTER,
-    "name = %c, desc = %c, location = %c",
+    "SET name = '%s', desc = '%s', location = '%s'",
     uclu_fields,
     3,
     "c.clu_id = %d",
@@ -2171,10 +2451,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "m",
     "mcmap",
-    "%c = machine.name, %c = cluster.name",
+    "machine.name, cluster.name",
     gmcm_fields,
     2,
-    "machine.name = uppercase(\"%s\") and cluster.name = \"%s\" and m.clu_id = cluster.clu_id and m.mach_id = machine.mach_id",
+    "machine.name = uppercase('%s') and cluster.name = '%s' and m.clu_id = cluster.clu_id and m.mach_id = machine.mach_id",
     2,
     &VDsort2,
   },
@@ -2186,7 +2466,7 @@ struct query Queries2[] = {
     APPEND,
     "m",
     "mcmap",
-    "mach_id = %i4, clu_id = %i4",
+    "(mach_id, clu_id) VALUES (%d, %d)",
     gmcm_fields,
     2,
     0,
@@ -2216,10 +2496,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "s",
     "svc",
-    "%c = cluster.name, %c = s.serv_label, %c = s.serv_cluster",
+    "cluster.name, s.serv_label, s.serv_cluster",
     gcld_fields,
     3,
-    "cluster.clu_id = s.clu_id and cluster.name = \"%s\" and s.serv_label = \"%s\"",
+    "cluster.clu_id = s.clu_id and cluster.name = '%s' and s.serv_label = '%s'",
     2,
     &VDsort2,
   },
@@ -2231,7 +2511,7 @@ struct query Queries2[] = {
     APPEND,
     "s",
     "svc",
-    "clu_id = %i4, serv_label = %c, serv_cluster = %c",
+    "(clu_id, serv_label, serv_cluster) VALUES (%d,'%s','%s')",
     acld_fields,
     3,
     (char *)0,
@@ -2249,7 +2529,7 @@ struct query Queries2[] = {
     (char *)0,
     acld_fields,
     0,
-    "s.clu_id = %d and s.serv_label = \"%s\" and s.serv_cluster = \"%s\"",
+    "s.clu_id = %d and s.serv_label = '%s' and s.serv_cluster = '%s'",
     3,
     &acld_validate,
   },
@@ -2261,10 +2541,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "s",
     "servers",
-    "%c = s.name, %c = text(s.update_int), %c = s.target_file, %c = s.script, %c = text(s.dfgen), %c = text(s.dfcheck), %c = s.type, %c = text(s.enable), %c = text(s.inprogress), %c = text(s.harderror), %c = s.errmsg, %c = s.acl_type, %c = text(s.acl_id), %c = s.modtime, %c = text(s.modby), %c = s.modwith",
+    "s.name, text(s.update_int), s.target_file, s.script, text(s.dfgen), text(s.dfcheck), s.type, text(s.enable), text(s.inprogress), text(s.harderror), s.errmsg, s.acl_type, text(s.acl_id), s.modtime, text(s.modby), s.modwith",
     gsin_fields,
     16,
-    "s.name = uppercase(\"%s\")",
+    "s.name = uppercase('%s')",
     1,
     &gsin_validate,
   },
@@ -2291,7 +2571,7 @@ struct query Queries2[] = {
     APPEND,
     "s",
     "servers",
-    "name = uppercase(%c), update_int = int4(%c), target_file = %c, script = %c, type = %c, enable = int1(%c), acl_type = %c, acl_id = %i4",
+    "(name, update_int, target_file, script, type, enable, acl_type, acl_id) VALUES (uppercase('%s'),%s,'%s','%s','%s',%s,'%s',%d)",
     asin_fields,
     8,
     (char *)0,
@@ -2306,10 +2586,10 @@ struct query Queries2[] = {
     UPDATE,
     "s",
     "servers",
-    "update_int = int4(%c), target_file = %c, script = %c, type = %c, enable = int1(%c), acl_type = %c, acl_id = %i4",
+    "SET update_int = %s, target_file = '%s', script = '%s', type = '%s', enable = %s, acl_type = '%s', acl_id = %d",
     asin_fields,
     7,
-    "s.name = uppercase(\"%s\")",
+    "s.name = uppercase('%s')",
     1,
     &asin_validate,
   },
@@ -2321,10 +2601,10 @@ struct query Queries2[] = {
     UPDATE,
     "s",
     "servers",
-    "harderror = 0, dfcheck = s.dfgen",
+    "SET harderror = 0, dfcheck = s.dfgen",
     dsin_fields,
     0,
-    "s.name = uppercase(\"%s\")",
+    "s.name = uppercase('%s')",
     1,
     &rsve_validate,
   },
@@ -2336,10 +2616,10 @@ struct query Queries2[] = {
     UPDATE,
     "s",
     "servers",
-    "dfgen = int4(%c), dfcheck = int4(%c), inprogress = int1(%c), harderror = int1(%c), errmsg = %c",
+    "SET dfgen = %s, dfcheck = %s, inprogress = %s, harderror = %s, errmsg = '%s'",
     ssif_fields,
     5,
-    "s.name = uppercase(\"%s\")",
+    "s.name = uppercase('%s')",
     1,
     &ssif_validate,
   },
@@ -2354,7 +2634,7 @@ struct query Queries2[] = {
     (char *)0,
     dsin_fields,
     0,
-    "s.name = uppercase(\"%s\")",
+    "s.name = uppercase('%s')",
     1,
     &dsin_validate,
   },
@@ -2366,10 +2646,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "sh",
     "serverhosts",
-    "%c = sh.service, %c = machine.name, %c = text(sh.enable), %c = text(sh.override), %c = text(sh.success), %c = text(sh.inprogress), %c = text(sh.hosterror), %c = sh.hosterrmsg, %c = text(sh.ltt), %c = text(sh.lts), %c = text(sh.value1), %c = text(sh.value2), %c = sh.value3, %c = sh.modtime, %c = text(sh.modby), %c = sh.modwith",
+    "sh.service, machine.name, text(sh.enable), text(sh.override), text(sh.success), text(sh.inprogress), text(sh.hosterror), sh.hosterrmsg, text(sh.ltt), text(sh.lts), text(sh.value1), text(sh.value2), sh.value3, sh.modtime, text(sh.modby), sh.modwith",
     gshi_fields,
     16,
-    "sh.service = uppercase(\"%s\") and machine.name = uppercase(\"%s\") and machine.mach_id = sh.mach_id",
+    "sh.service = uppercase('%s') and machine.name = uppercase('%s') and machine.mach_id = sh.mach_id",
     2,
     &gshi_validate,
   },
@@ -2396,7 +2676,7 @@ struct query Queries2[] = {
     APPEND,
     "sh",
     "serverhosts",
-    "service = uppercase(%c), mach_id = %i4, enable = int1(%c), value1 = int4(%c), value2 = int4(%c), value3 = %c",
+    "(service, mach_id, enable, value1, value2, value3) VALUES (uppercase('%s'), %d, %s, %s, %s, '%s')",
     ashi_fields,
     6,
     (char *)0,
@@ -2411,10 +2691,10 @@ struct query Queries2[] = {
     UPDATE,
     "sh",
     "serverhosts",
-    "enable = int1(%c), value1 = int4(%c), value2 = int4(%c), value3 = %c",
+    "SET enable = %s, value1 = %s, value2 = %s, value3 = '%s'",
     ashi_fields,
     4,
-    "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
+    "sh.service = uppercase('%s') and sh.mach_id = %d",
     2,
     &ashi_validate,
   },
@@ -2426,10 +2706,10 @@ struct query Queries2[] = {
     UPDATE,
     "sh",
     "serverhosts",
-    "hosterror = 0",
+    "SET hosterror = 0",
     dshi_fields,
     0,
-    "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
+    "sh.service = uppercase('%s') and sh.mach_id = %d",
     2,
     &rshe_validate,
   },
@@ -2441,10 +2721,10 @@ struct query Queries2[] = {
     UPDATE,
     "sh",
     "serverhosts",
-    "override = 1",
+    "SET override = 1",
     dshi_fields,
     0,
-    "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
+    "sh.service = uppercase('%s') and sh.mach_id = %d",
     2,
     &ssho_validate,
   },
@@ -2456,10 +2736,10 @@ struct query Queries2[] = {
     UPDATE,
     "s",
     "serverhosts",
-    "override = int1(%c), success = int1(%c), inprogress = int1(%c), hosterror = int1(%c), hosterrmsg = %c, ltt = int4(%c), lts = int4(%c)",
+    "SET override = %s, success = %s, inprogress = %s, hosterror = %s, hosterrmsg = '%s', ltt = %s, lts = %s",
     sshi_fields,
     7,
-    "s.service = uppercase(\"%s\") and s.mach_id = %d",
+    "s.service = uppercase('%s') and s.mach_id = machine.mach_id and machine.name = '%s'",
     2,
     &sshi_validate,
   },
@@ -2474,7 +2754,7 @@ struct query Queries2[] = {
     (char *)0,
     dshi_fields,
     0,
-    "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
+    "sh.service = uppercase('%s') and sh.mach_id = %d",
     2,
     &dshi_validate,
   },
@@ -2486,10 +2766,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "ha",
     "hostaccess",
-    "%c = machine.name, %c = ha.acl_type, %c = text(ha.acl_id), %c = ha.modtime, %c = text(ha.modby), %c = ha.modwith",
+    "machine.name, ha.acl_type, text(ha.acl_id), ha.modtime, text(ha.modby), ha.modwith",
     gsha_fields,
     6,
-    "machine.name = uppercase(\"%s\") and ha.mach_id = machine.mach_id",
+    "machine.name = uppercase('%s') and ha.mach_id = machine.mach_id",
     1,
     &gsha_validate,
   },
@@ -2501,7 +2781,7 @@ struct query Queries2[] = {
     APPEND,
     "ha",
     "hostaccess",
-    "mach_id = %i4, acl_type = %c, acl_id = %i4",
+    "(mach_id,acl_type,acl_id) VALUES (%d,'%s',%d)",
     asha_fields,
     3,
     0,
@@ -2516,7 +2796,7 @@ struct query Queries2[] = {
     UPDATE,
     "ha",
     "hostaccess",
-    "acl_type = %c, acl_id = %i4",
+    "SET acl_type = '%s', acl_id = %d",
     asha_fields,
     2,
     "ha.mach_id = %d",
@@ -2546,10 +2826,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "sh",
     "serverhosts",
-    "%c = sh.service, %c = machine.name",
+    "sh.service, machine.name",
     gslo_fields,
     2,
-    "sh.service = uppercase(\"%s\") and sh.mach_id = machine.mach_id",
+    "sh.service = uppercase('%s') and sh.mach_id = machine.mach_id",
     1,
     0,
   },
@@ -2561,10 +2841,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "fs",
     FILESYS,
-    "%c = fs.label, %c = fs.type, %c = machine.name, %c = fs.name, %c = fs.mount, %c = fs.access, %c = fs.comments, %c = users.login, %c = list.name, %c = text(fs.createflg), %c = fs.lockertype, %c = fs.modtime, %c = text(fs.modby), %c = fs.modwith",
+    "fs.label, fs.type, machine.name, fs.name, fs.mount, fs.access, fs.comments, users.login, list.name, text(fs.createflg), fs.lockertype, fs.modtime, text(fs.modby), fs.modwith",
     gfsl_fields,
     14,
-    "fs.label = \"%s\" and fs.mach_id = machine.mach_id and fs.owner = users.users_id and fs.owners = list.list_id",
+    "fs.label = '%s' and fs.mach_id = machine.mach_id and fs.owner = users.users_id and fs.owners = list.list_id",
     1,
     &VDsortf,
   },
@@ -2576,7 +2856,7 @@ struct query Queries2[] = {
     RETRIEVE,
     "fs",
     FILESYS,
-    "%c = fs.label, %c = fs.type, %c = machine.name, %c = fs.name, %c = fs.mount, %c = fs.access, %c = fs.comments, %c = users.login, %c = list.name, %c = text(fs.createflg), %c = fs.lockertype, %c = fs.modtime, %c = text(fs.modby), %c = fs.modwith",
+    "fs.label, fs.type, machine.name, fs.name, fs.mount, fs.access, fs.comments, users.login, list.name, text(fs.createflg), fs.lockertype, fs.modtime, text(fs.modby), fs.modwith",
     gfsm_fields,
     14,
     "fs.mach_id = %d and machine.mach_id = fs.mach_id and fs.owner = users.users_id and fs.owners = list.list_id",
@@ -2591,10 +2871,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "fs",
     FILESYS,
-    "%c = fs.label, %c = fs.type, %c = machine.name, %c = fs.name, %c = fs.mount, %c = fs.access, %c = fs.comments, %c = users.login, %c = list.name, %c = text(fs.createflg), %c = fs.lockertype, %c = fs.modtime, %c = text(fs.modby), %c = fs.modwith",
+    "fs.label, fs.type, machine.name, fs.name, fs.mount, fs.access, fs.comments, users.login, list.name, text(fs.createflg), fs.lockertype, fs.modtime, text(fs.modby), fs.modwith",
     gfsn_fields,
     14,
-    "fs.mach_id = %d and machine.mach_id = fs.mach_id and fs.owner = users.users_id and fs.owners = list.list_id and nfsphys.nfsphys_id = fs.phys_id and nfsphys.dir = \"%s\" and fs.type = \"NFS\"",
+    "fs.mach_id = %d and machine.mach_id = fs.mach_id and fs.owner = users.users_id and fs.owners = list.list_id and nfsphys.nfsphys_id = fs.phys_id and nfsphys.dir = '%s' and fs.type = 'NFS'",
     2,
     &gfsm_validate,
   },
@@ -2606,7 +2886,7 @@ struct query Queries2[] = {
     RETRIEVE,
     "fs",
     FILESYS,
-    "%c = fs.label, %c = fs.type, %c = machine.name, %c = fs.name, %c = fs.mount, %c = fs.access, %c = fs.comments, %c = users.login, %c = list.name, %c = text(fs.createflg), %c = fs.lockertype, %c = fs.modtime, %c = text(fs.modby), %c = fs.modwith",
+    "fs.label, fs.type, machine.name, fs.name, fs.mount, fs.access, fs.comments, users.login, list.name, text(fs.createflg), fs.lockertype, fs.modtime, text(fs.modby), fs.modwith",
     gfsg_fields,
     14,
     "fs.owners = %d and machine.mach_id = fs.mach_id and fs.owner = users.users_id and fs.owners = list.list_id",
@@ -2621,10 +2901,10 @@ struct query Queries2[] = {
     APPEND,
     "fs",
     FILESYS,
-    "filsys_id = values.value, label = %c, type = %c, mach_id = %i4, name = %c, mount = %c, access = %c, comments = %c, owner = %i4, owners = %i4, createflg = int1(%c), lockertype = %c",
+    "(filsys_id, label, type, mach_id, name, mount, access, comments, owner, owners, createflg, lockertype) VALUES (numvalues.value,'%s','%s',%d,'%s','%s','%s','%s',%d,%d,%s,'%s')",
     afil_fields,
     11,
-    "values.name = \"filsys_id\"",
+    "numvalues.name = 'filsys_id'",
     0,
     &afil_validate,
   },
@@ -2636,12 +2916,12 @@ struct query Queries2[] = {
     UPDATE,
     "fs",
     FILESYS,
-    "label = %c, type = %c, mach_id = %i4, name = %c, mount = %c, access = %c, comments = %c, owner = %i4, owners = %i4, createflg = int1(%c), lockertype = %c",
+    "SET label = '%s', type = '%s', mach_id = %d, name = '%s', mount = '%s', access = '%s', comments = '%s', owner = %d, owners = %d, createflg = %s, lockertype = '%s'",
     ufil_fields,
     11,
     "fs.filsys_id = %d",
     1,
-    &ufil_validate,
+    &ufil_validate,      
   },
 
   {
@@ -2666,7 +2946,7 @@ struct query Queries2[] = {
     RETRIEVE,
     "fg",
     "fsgroup",
-    "%c = filesys.label, %c = fg.key",
+    "filesys.label, fg.key",
     gfgm_fields,
     2,
     "fg.group_id = %d and filesys.filsys_id = fg.filsys_id",
@@ -2681,10 +2961,10 @@ struct query Queries2[] = {
     APPEND,
     "fg",
     "fsgroup",
-    "group_id = filesys.filsys_id, filsys_id = %i4, key = %c",
+    "(group_id,filsys_id,key) VALUES (filesys.filsys_id, %d, '%s')",
     gfgm_fields,
     2,
-    "filesys.filsys_id = %d and filesys.type = \"FSGROUP\"",
+    "filesys.filsys_id = %d and filesys.type = 'FSGROUP'",
     1,
     &aftg_validate,
   },
@@ -2711,7 +2991,7 @@ struct query Queries2[] = {
     RETRIEVE,
     "np",
     "nfsphys",
-    "%c = machine.name, %c = np.dir, %c = np.device, %c = text(np.status), %c = text(np.allocated), %c = text(np.size), %c = np.modtime, %c = text(np.modby), %c = np.modwith",
+    "machine.name, np.dir, np.device, text(np.status), text(np.allocated), text(np.size), np.modtime, text(np.modby), np.modwith",
     ganf_fields,
     9,
     "machine.mach_id = np.mach_id",
@@ -2726,10 +3006,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "np",
     "nfsphys",
-    "%c = machine.name, %c = np.dir, %c = np.device, %c = text(np.status), %c = text(np.allocated), %c = text(np.size), %c = np.modtime, %c = text(np.modby), %c = np.modwith",
+    "machine.name, np.dir, np.device, text(np.status), text(np.allocated), text(np.size), np.modtime, text(np.modby), np.modwith",
     gnfp_fields,
     9,
-    "np.mach_id = %d and np.dir = \"%s\" and machine.mach_id = np.mach_id",
+    "np.mach_id = %d and np.dir = '%s' and machine.mach_id = np.mach_id",
     2,
     &gnfp_validate,
   },
@@ -2741,10 +3021,10 @@ struct query Queries2[] = {
     APPEND,
     "np",
     "nfsphys",
-    "nfsphys_id = values.value, mach_id = %i4, dir = %c, device = %c, status = int4(%c), allocated = int4(%c), size = int4(%c)",
+    "(nfsphys_id, mach_id, dir, device, status, allocated, size) VALUES (numvalues.value, %d, '%s', '%s', %s, %s, %s)",
     ganf_fields,
     6,
-    "values.name = \"nfsphys_id\"",
+    "numvalues.name = 'nfsphys_id'",
     0,
     &anfp_validate,
   },
@@ -2756,10 +3036,10 @@ struct query Queries2[] = {
     UPDATE,
     "np",
     "nfsphys",
-    "device = %c, status = int4(%c), allocated = int4(%c), size = int4(%c)",
+    "SET device = '%s', status = '%s', allocated = %s, size = %s",
     gnfp_fields,
     4,
-    "np.mach_id = %d and np.dir = \"%s\"",
+    "np.mach_id = %d and np.dir = '%s'",
     2,
     &anfp_validate,
   },
@@ -2771,10 +3051,10 @@ struct query Queries2[] = {
     UPDATE,
     "np",
     "nfsphys",
-    "allocated = np.allocated + int4(%c)",
+    "SET np.allocated = np.allocated + %s",
     dnfp_fields,
     1,
-    "np.mach_id = %d and np.dir = \"%s\"",
+    "np.mach_id = %d and np.dir = '%s'",
     2,
     &anfp_validate,
   },
@@ -2789,22 +3069,97 @@ struct query Queries2[] = {
     (char *)0,
     dnfp_fields,
     0,
-    "np.mach_id = %d and np.dir = \"%s\"",
+    "np.mach_id = %d and np.dir = '%s'",
     2,
     &dnfp_validate,
   },
 
+  {
+    /* Q_GQOT - GET_QUOTA */
+    "get_quota",
+    "gqot",
+    RETRIEVE,
+    "q",
+    QUOTA,
+    "filesys.label, q.type, text(q.entity_id), text(q.quota), text(q.phys_id), machine.name, q.modtime, text(q.modby), q.modwith",
+    gqot_fields,
+    9,
+    "filesys.label = '%s' and q.type = '%s' and q.entity_id = %d and filesys.filsys_id = q.filsys_id and machine.mach_id = filesys.mach_id",
+    3,
+    &gqot_validate,
+  },
+
+  {
+    /* Q_GQBF - GET_QUOTA_BY_FILESYS */
+    "get_quota_by_filesys",
+    "gqbf",
+    RETRIEVE,
+    "q",
+    QUOTA,
+    "filesys.label, q.type, text(q.entity_id), text(q.quota), text(q.phys_id), machine.name, q.modtime, text(q.modby), q.modwith",
+    gqbf_fields,
+    9,
+    "filesys.label = '%s' and filesys.filsys_id = q.filsys_id and machine.mach_id = filesys.mach_id",
+    1,
+    &gqbf_validate,
+  },
+
+  {
+    /* Q_AQOT - ADD_QUOTA */
+    "add_quota",
+    "aqot",
+    APPEND,
+    "q",
+    QUOTA,
+    "(filsys_id, type, entity_id, quota, phys_id) VALUES (filesys.filsys_id, '%s', %d, %s, filesys.phys_id)",
+    aqot_fields,
+    3,
+    "filesys.filsys_id = %d",
+    1,
+    &aqot_validate,
+  },
+
+  {
+    /* Q_UQOT - UPDATE_QUOTA */
+    "update_quota",
+    "uqot",
+    UPDATE,
+    "q",
+    QUOTA,
+    "SET quota = %s",
+    aqot_fields,
+    1,
+    "q.filsys_id = %d and q.type = '%s' and q.entity_id = %d",
+    3,
+    &uqot_validate,
+  },
+
+  {
+    /* Q_DQOT - DELETE_QUOTA */
+    "delete_quota",
+    "dqot",
+    DELETE,
+    "q",
+    QUOTA,
+    (char *)0,
+    aqot_fields,
+    0,
+    "q.filsys_id = %d and q.type = '%s' and q.entity_id = %d",
+    3,
+    &dqot_validate,
+  },
+
   {
     /* Q_GNFQ - GET_NFS_QUOTAS */
     "get_nfs_quota",
     "gnfq",
     RETRIEVE,
-    "nq",
-    "nfsquota",
-    "%c = filesys.label, %c = users.login, %c = text(nq.quota), %c = nfsphys.dir, %c = machine.name, %c = nq.modtime, %c = text(nq.modby), %c = nq.modwith",
+    "q",
+    QUOTA,
+    "filesys.label, users.login, text(q.quota), text(q.phys_id), machine.name, q.modtime, text(q.modby), q.modwith",
     gnfq_fields,
     8,
-    "filesys.label = \"%s\" and nq.users_id = %d and filesys.filsys_id = nq.filsys_id and nfsphys.nfsphys_id = nq.phys_id and machine.mach_id = filesys.mach_id and users.users_id = nq.users_id",
+    "filesys.label = '%s' and q.type = 'USER' and q.entity_id = users.users_id and filesys.filsys_id = q.filsys_id and machine.mach_id = filesys.mach_id and users.login = '%s'",
     2,
     &gnfq_validate,
   },
@@ -2814,12 +3169,12 @@ struct query Queries2[] = {
     "get_nfs_quotas_by_partition",
     "gnqp",
     RETRIEVE,
-    "nq",
-    "nfsquota",
-    "%c = filesys.label, %c = users.login, %c = text(nq.quota), %c = nfsphys.dir, %c = machine.name",
+    "q",
+    QUOTA,
+    "filesys.label, users.login, text(q.quota), nfsphys.dir, machine.name",
     gnqp_fields,
     5,
-    "nfsphys.mach_id = %d and nfsphys.dir = \"%s\" and nq.phys_id = nfsphys.nfsphys_id and filesys.filsys_id = nq.filsys_id and users.users_id = nq.users_id and machine.mach_id = nfsphys.mach_id",
+    "nfsphys.mach_id = %d and nfsphys.dir = '%s' and q.phys_id = nfsphys.nfsphys_id and filesys.filsys_id = q.filsys_id and q.type = 'USER' and users.users_id = q.entity_id and machine.mach_id = nfsphys.mach_id",
     2,
     &VDmach,
   },
@@ -2829,9 +3184,9 @@ struct query Queries2[] = {
     "add_nfs_quota",
     "anfq",
     APPEND,
-    "nq",
-    "nfsquota",
-    "filsys_id = filesys.filsys_id, users_id = %i4, quota = int4(%c), phys_id = filesys.phys_id",
+    "q",
+    QUOTA,
+    "(filsys_id, type, entity_id, quota, phys_id) VALUES (filesys.filsys_id, 'USER', %d, %s, filesys.phys_id)",
     anfq_fields,
     2,
     "filesys.filsys_id = %d",
@@ -2844,12 +3199,12 @@ struct query Queries2[] = {
     "update_nfs_quota",
     "unfq",
     UPDATE,
-    "nq",
-    "nfsquota",
-    "quota = int4(%c)",
+    "q",
+    QUOTA,
+    "SET quota = %s",
     anfq_fields,
     1,
-    "nq.filsys_id = %d and nq.users_id = %d",
+    "q.filsys_id = %d and q.type = 'USER' and q.entity_id = %d",
     2,
     &unfq_validate,
   },
@@ -2859,12 +3214,12 @@ struct query Queries2[] = {
     "delete_nfs_quota",
     "dnfq",
     DELETE,
-    "nq",
-    "nfsquota",
+    "q",
+    QUOTA,
     (char *)0,
     anfq_fields,
     0,
-    "nq.filsys_id = %d and nq.users_id = %d",
+    "q.filsys_id = %d and q.type = 'USER' and q.entity_id = %d",
     2,
     &dnfq_validate,
   },
@@ -2891,10 +3246,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "l",
     LIST,
-    "%c = l.name",
+    "list.name",
     glin_fields,
     1,
-    "l.name = \"%s\" and l.list_id != 0",
+    "list.name = '%s' and list.list_id != 0",
     1,
     0
   },
@@ -2905,11 +3260,11 @@ struct query Queries2[] = {
     "alis",
     APPEND,
     "l",
-    LIST,
-    "list_id=values.value, name=%c, active=int1(%c), public=int1(%c), hidden=int1(%c), maillist=int1(%c), group=int1(%c), gid=int2(%c), acl_type=%c, acl_id=%i4, desc=%c",
+    LIST, 
+    "(list_id, name, active, public, hidden, maillist, grouplist, gid, acl_type, acl_id, desc) VALUES (numvalues.value,'%s',%s,%s,%s,%s,%s,%s,'%s',%d,'%s')",
     alis_fields,
     10,
-    "values.name = \"list_id\"",
+    "numvalues.name = 'list_id'",
     0,
     &alis_validate,
   },
@@ -2921,10 +3276,10 @@ struct query Queries2[] = {
     UPDATE,
     "l",
     LIST,
-    "name=%c, active=int1(%c), public=int1(%c), hidden=int1(%c), maillist=int1(%c), group=int1(%c), gid=int2(%c), acl_type=%c, acl_id=%i4, desc=%c",
+    "SET name='%s', active=%s, public=%s, hidden=%s, maillist=%s, grouplist=%s, gid=%s, acl_type='%s', acl_id=%d, desc='%s'",
     ulis_fields,
     10,
-    "l.list_id = %d",
+    "list.list_id = %d",
     1,
     &ulis_validate,
   },
@@ -2939,7 +3294,7 @@ struct query Queries2[] = {
     (char *)0,
     dlis_fields,
     0,
-    "l.list_id = %d",
+    "list.list_id = %d",
     1,
     &dlis_validate,
   },
@@ -2949,9 +3304,9 @@ struct query Queries2[] = {
     "add_member_to_list",
     "amtl",
     APPEND,
-    "m",
-    "members",
-    "list_id=%i4, member_type=%c, member_id=%i4",
+    0,
+    "imembers",
+    0,
     amtl_fields,
     3,
     (char *)0,
@@ -2964,14 +3319,14 @@ struct query Queries2[] = {
     "delete_member_from_list",
     "dmfl",
     DELETE,
-    "m",
-    "members",
+    0,
+    "imembers",
     (char *)0,
     amtl_fields,
     0,
-    "m.list_id = %d and m.member_type = \"%s\" and m.member_id = %d",
+    0,
     3,
-    &amtl_validate,
+    &dmfl_validate,
   },
 
   {
@@ -3010,7 +3365,7 @@ struct query Queries2[] = {
     "gmol",
     RETRIEVE,
     (char *)0,
-    "members",
+    "imembers",
     (char *)0,
     gmol_fields,
     0,
@@ -3025,7 +3380,7 @@ struct query Queries2[] = {
     "glom",
     RETRIEVE,
     0,
-    "members",
+    "imembers",
     0,
     glom_fields,
     6,
@@ -3040,7 +3395,7 @@ struct query Queries2[] = {
     "cmol",
     RETRIEVE,
     0,
-    "members",
+    "imembers",
     0,
     cmol_fields,
     1,
@@ -3048,22 +3403,7 @@ struct query Queries2[] = {
     1,
     &cmol_validate,
   },
-#ifdef notdef
-  {
-    /* Q_AUGR - ADD_USER_GROUP */
-    "add_user_group",
-    "augr",
-    APPEND,
-    (char *)0,
-    (char *)0,
-    (char *)0,
-    augr_fields,
-    1,
-    (char *)0,
-    0,
-    &augr_validate,
-  },    
-#endif
+
   {
     /* Q_GZCL - GET_ZEPHYR_CLASS */
     "get_zephyr_class",
@@ -3071,10 +3411,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "z",
     "zephyr",
-    "%c = z.class, %c = z.xmt_type, %c = text(z.xmt_id),%c = z.sub_type, %c = text(z.sub_id),%c = z.iws_type, %c = text(z.iws_id),%c = z.iui_type, %c = text(z.iui_id), %c=z.modtime, %c = text(z.modby), %c = z.modwith",
+    "z.class, z.xmt_type, text(z.xmt_id),z.sub_type, text(z.sub_id),z.iws_type, text(z.iws_id),z.iui_type, text(z.iui_id), z.modtime, text(z.modby), z.modwith",
     gzcl_fields,
     12,
-    "z.class = \"%s\"",
+    "z.class = '%s'",
     1,
     &gzcl_validate,
   },    
@@ -3086,7 +3426,7 @@ struct query Queries2[] = {
     APPEND,
     "z",
     "zephyr",
-    "class = %c, xmt_type = %c, xmt_id = %i4, sub_type = %c, sub_id = %i4, iws_type = %c, iws_id = %i4, iui_type = %c, iui_id = %i4",
+    "(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)",
     azcl_fields,
     9,
     0,
@@ -3101,10 +3441,10 @@ struct query Queries2[] = {
     UPDATE,
     "z",
     "zephyr",
-    "class = %c, xmt_type = %c, xmt_id = %i4, sub_type = %c, sub_id = %i4, iws_type = %c, iws_id = %i4, iui_type = %c, iui_id = %i4",
+    "SET class = '%s', xmt_type = '%d', xmt_id = %d, sub_type = '%s', sub_id = %d, iws_type = '%s', iws_id = %d, iui_type = '%s', iui_id = %d",
     uzcl_fields,
     9,
-    "z.class = \"%s\"",
+    "z.class = '%s'",
     1,
     &uzcl_validate,
   },    
@@ -3119,11 +3459,11 @@ struct query Queries2[] = {
     0,
     uzcl_fields,
     0,
-    "z.class = \"%s\"",
+    "z.class = '%s'",
     1,
     &dzcl_validate,
   },    
-#ifdef notdef
+
   {
     /* Q_GSVC - GET_SERVICE */
     "get_service",
@@ -3131,12 +3471,12 @@ struct query Queries2[] = {
     RETRIEVE,
     "s",
     "services",
-    "%c = s.name, %c = s.protocol, %c = text(s.port), %c = s.desc, %c = s.modtime, %c = text(s.modby), %c = s.modwith",
-    gasv_fields,
+    "s.name, s.protocol, text(s.port), s.desc, s.modtime, text(s.modby), s.modwith",
+    gsvc_fields,
     7,
-    (char *)0,
-    0,
-    &gsvc_validate,
+    "s.name = '%s'",
+    1,
+    &VDsortf,
   },
 
   {
@@ -3146,8 +3486,8 @@ struct query Queries2[] = {
     APPEND,
     "s",
     "services",
-    "name = %c, protocol = %c, port = int2(%c), desc = %c",
-    gasv_fields,
+    "(name, protocol, port, desc) VALUES ('%s','%s',%s,'%s')",
+    asvc_fields,
     4,
     (char *)0,
     0,
@@ -3162,13 +3502,58 @@ struct query Queries2[] = {
     "s",
     "services",
     0,
-    gasv_fields,
+    asvc_fields,
     0,
-    "s.name = \"%s\"",
+    "s.name = '%s'",
     1,
-    &dsvc_validate,
+    &asvc_validate,
   },
-#endif
+
+  {
+    /* Q_GPCE - GET_PRINTCAP_ENTRY */
+    "get_printcap_entry",
+    "gpce",
+    RETRIEVE,
+    "p",
+    "printcap",
+    "p.name, machine.name, p.dir, p.rp, text(p.quotaserver), text(p.auth), text(p.price), p.comments, p.modtime, text(p.modby), p.modwith",
+    gpce_fields,
+    11,
+    "p.name = '%s' and machine.mach_id = p.mach_id",
+    1,
+    &gpce_validate,
+  },
+
+  {
+    /* Q_APCE - ADD_PRINTCAP_ENTRY */
+    "add_printcap_entry",
+    "apce",
+    APPEND,
+    "p",
+    "printcap",
+    "(name, mach_id, dir, rp, quotaserver, auth, price, comments) VALUES ('%s',%d,'%s','%s',%d,%s,%s,'%s')",
+    apce_fields,
+    8,
+    0,
+    0,
+    &apce_validate,
+  },
+
+  {
+    /* Q_DPCE - DELETE_PRINTCAP_ENTRY */
+    "delete_printcap_entry",
+    "dpce",
+    DELETE,
+    "p",
+    "printcap",
+    0,
+    apce_fields,
+    0,
+    "p.name = '%s'",
+    1,
+    &dpce_validate,
+  },
+
   {
     /* Q_GPCP - GET_PRINTCAP */
     "get_printcap",
@@ -3176,42 +3561,72 @@ struct query Queries2[] = {
     RETRIEVE,
     "p",
     "printcap",
-    "%c = p.name, %c = machine.name, %c = p.dir, %c = p.rp, %c = p.comments, %c = p.modtime, %c = text(p.modby), %c = p.modwith",
+    "p.name, machine.name, p.dir, p.rp, p.comments, p.modtime, text(p.modby), p.modwith",
     gpcp_fields,
     8,
-    "p.name = \"%s\" and machine.mach_id = p.mach_id",
+    "p.name = '%s' and machine.mach_id = p.mach_id",
     1,
     &VDsortf,
   },
 
   {
-    /* Q_APCP - ADD_PRINTCAP */
-    "add_printcap",
-    "apcp",
-    APPEND,
+    /* Q_DPCP - DELETE_PRINTCAP */
+    "delete_printcap",
+    "dpcp",
+    DELETE,
     "p",
     "printcap",
-    "name = %c, mach_id = %i4, dir = %c, rp = %c, comments = %c",
-    apcp_fields,
-    5,
     0,
+    apce_fields,
     0,
-    &apcp_validate,
+    "p.name = '%s'",
+    1,
+    &dpce_validate,
   },
 
   {
-    /* Q_DPCP - DELETE_PRINTCAP */
-    "delete_printcap",
-    "dpcp",
+    /* Q_GPDM - GET_PALLADIUM */
+    "get_palladium",
+    "gpdm",
+    RETRIEVE,
+    "p",
+    "palladium",
+    "p.name, text(p.ident), machine.name, p.modtime, text(p.modby), p.modwith",
+    gpdm_fields,
+    6,
+    "p.name = '%s' and machine.mach_id = p.mach_id",
+    1,
+    &VDsortf,
+  },
+
+  {
+    /* Q_APDM - ADD_PALLADIUM */
+    "add_palladium",
+    "apdm",
+    APPEND,
+    "p",
+    "palladium",
+    "(name, ident, mach_id) VALUES ('%s',%s,%d)",
+    apdm_fields,
+    3,
+    0,
+    0,
+    &apdm_validate,
+  },
+
+  {
+    /* Q_DPDM - DELETE_PALLADIUM */
+    "delete_palladium",
+    "dpdm",
     DELETE,
     "p",
-    "printcap",
+    "palladium",
     0,
-    apcp_fields,
+    apdm_fields,
     0,
-    "p.name = \"%s\"",
+    "p.name = '%s'",
     1,
-    &dpcp_validate,
+    &dpdm_validate,
   },
 
   {
@@ -3221,10 +3636,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "a",
     "alias",
-    "%c = a.name, %c = a.type, %c = a.trans",
+    "a.name, a.type, a.trans",
     gali_fields,
     3,
-    "a.name = \"%s\" and a.type = \"%s\" and a.trans = \"%s\"",
+    "a.name = '%s' and a.type = '%s' and a.trans = '%s'",
     3,
     0,
   },
@@ -3236,7 +3651,7 @@ struct query Queries2[] = {
     APPEND,
     "a",
     "alias",
-    "name = %c, type = %c, trans = %c",
+    "(name, type, trans) VALUES ('%s', '%s', '%s')",
     aali_fields,
     3,
     (char *)0,
@@ -3254,7 +3669,7 @@ struct query Queries2[] = {
     (char *)0,
     aali_fields,
     0,
-    "a.name = \"%s\" and a.type = \"%s\" and a.trans = \"%s\"",
+    "a.name = '%s' and a.type = '%s' and a.trans = '%s'",
     3,
     &dali_validate,
   },
@@ -3266,10 +3681,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "v",
     "values",
-    "%c = text(v.value)",
+    "text(v.value)",
     gval_fields,
     1,
-    "v.name = \"%s\"",
+    "v.name = '%s'",
     1,
     &gval_validate,
   },
@@ -3280,8 +3695,8 @@ struct query Queries2[] = {
     "aval",
     APPEND,
     "v",
-    "values",
-    "name = %c, value = int4(%c)",
+    "numvalues",
+    "(name, value) VALUES ('%s', %s)",
     aval_fields,
     2,
     (char *)0,
@@ -3295,11 +3710,11 @@ struct query Queries2[] = {
     "uval",
     UPDATE,
     "v",
-    "values",
-    "value = int4(%c)",
+    "numvalues",
+    "SET value = %s",
     aval_fields,
     1,
-    "v.name = \"%s\"",
+    "v.name = '%s'",
     1,
     &aval_validate,
   },
@@ -3310,11 +3725,11 @@ struct query Queries2[] = {
     "dval",
     DELETE,
     "v",
-    "values",
+    "numvalues",
     (char *)0,
     dval_fields,
     0,
-    "v.name = \"%s\"",
+    "v.name = '%s'",
     1,
     &aval_validate,
   },
@@ -3326,7 +3741,7 @@ struct query Queries2[] = {
     RETRIEVE,
     "tbs",
     "tblstats",
-    "%c = tbs.table, %c = text(tbs.retrieves), %c = text(tbs.appends), %c = text(tbs.updates), %c = text(tbs.deletes), %c = tbs.modtime",
+    "tbs.table_name, text(tbs.retrieves), text(tbs.appends), text(tbs.updates), text(tbs.deletes), tbs.modtime",
     gats_fields,
     6,
     (char *)0,
This page took 3.609264 seconds and 4 git commands to generate.