1 /* This file defines the query dispatch table for version 2 of the protocol
5 * Copyright 1987, 1988 by the Massachusetts Institute of Technology.
6 * For copying and distribution information, please see the file
10 #include <mit-copyright.h>
14 /* Specialized Support Query Routines */
16 /* Special Access Check Routines */
20 int access_visible_list();
21 int access_vis_list_by_name();
27 /* Query Setup Routines */
45 /* Query Followup Routines */
46 int followup_fix_modby();
57 int set_modtime_by_id();
58 int set_finger_modtime();
59 int set_pobox_modtime();
60 int set_uppercase_modtime();
61 int set_mach_modtime_by_id();
62 int set_cluster_modtime_by_id();
63 int set_serverhost_modtime();
64 int set_nfsphys_modtime();
65 int set_filesys_modtime();
66 int set_zephyr_modtime();
72 int qualified_get_lists();
73 int get_members_of_list();
74 int qualified_get_server();
75 int qualified_get_serverhost();
77 int count_members_of_list();
78 int get_lists_of_member();
85 * These are commonly used strings in the table, defined here so that
89 static char ACE_NAME[] = "ace_name";
90 static char ACE_TYPE[] = "ace_type";
91 static char CLASS[] = "class";
92 static char CLU_ID[] = "clu_id";
93 static char CLUSTER[] = "cluster";
94 static char DESC[] = "description";
95 static char DEVICE[] = "device";
96 static char DIR[] = "dir";
97 static char FILESYS[] = "filesys";
98 static char FILSYS_ID[] = "filsys_id";
99 static char FIRST[] = "firstname";
100 static char LABEL[] = "label";
101 static char LAST[] = "lastname";
102 static char LIST[] = "list";
103 static char LIST_ID[] = "list_id";
104 static char LOCATION[] = "location";
105 static char LOGIN[] = "login";
106 static char MACH_ID[] = "mach_id";
107 static char MACHINE[] = "machine";
108 static char MIDDLE[] = "middle";
109 static char MIT_ID[] = "mit_id";
110 static char MOD1[] = "modtime";
111 static char MOD2[] = "modby";
112 static char MOD3[] = "modwith";
113 static char NAME[] = "name";
114 static char SERVICE[] = "service";
115 static char SHELL[] = "shell";
116 static char STATUS[] = "status";
117 static char TYPE[] = "type";
118 static char USERS[] = "users";
119 static char USERS_ID[] = "users_id";
120 static char UID[] = "uid";
125 * These are commonly used validation objects, defined here so that they
129 static struct valobj VOsort0[] = {
130 {V_SORT, 0, 0, 0, 0, 0},
133 static struct valobj VOdate1[] = {
134 {V_DATE, 1, 0, 0, 0, SMS_DATE},
137 static struct valobj VOuser0[] = {
138 {V_ID, 0, USERS, LOGIN, USERS_ID, SMS_USER},
141 static struct valobj VOuser0lock[] = {
142 {V_LOCK, 0, USERS, 0, USERS_ID, SMS_DEADLOCK},
143 {V_ID, 0, USERS, LOGIN, USERS_ID, SMS_USER},
146 static struct valobj VOmach0[] = {
147 {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE},
150 static struct valobj VOclu0[] = {
151 {V_ID, 0, CLUSTER, NAME, CLU_ID, SMS_CLUSTER},
154 static struct valobj VOlist0[] = {
155 {V_ID, 0, LIST, NAME, LIST_ID, SMS_LIST},
158 static struct valobj VOfilsys0[] = {
159 {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
162 static struct valobj VOchar0[] = {
166 static struct valobj VOsort01[] = {
171 static struct valobj VOuser0sort[] = {
172 {V_ID, 0, USERS, LOGIN, USERS_ID, SMS_USER},
176 static struct valobj VOfilsys0user1[] = {
177 {V_LOCK, 0, FILESYS, 0, FILSYS_ID, SMS_DEADLOCK},
178 {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
179 {V_ID, 1, USERS, LOGIN, USERS_ID, SMS_USER},
184 * Commonly used validation records defined here so that they may
188 static struct validate VDmach = { VOmach0, 1 };
189 static struct validate VDsort2= { VOsort01,2 };
190 static struct validate VDsortf = {
206 static char *galo_fields[] = {
207 LOGIN, UID, SHELL, LAST, FIRST, MIDDLE,
210 static char *gubl_fields[] = {
212 LOGIN, UID, SHELL, LAST, FIRST, MIDDLE, STATUS,
213 MIT_ID, CLASS, MOD1, MOD2, MOD3
216 static struct validate gubx_validate = /* gubl, gubu */
229 static char *gubu_fields[] = {
231 LOGIN, UID, SHELL, LAST, FIRST, MIDDLE, STATUS,
232 MIT_ID, CLASS, MOD1, MOD2, MOD3,
235 static char *gubn_fields[] = {
237 LOGIN, UID, SHELL, LAST, FIRST, MIDDLE, STATUS,
238 MIT_ID, CLASS, MOD1, MOD2, MOD3,
241 static char *gubc_fields[] = {
243 LOGIN, UID, SHELL, LAST, FIRST, MIDDLE, STATUS,
244 MIT_ID, CLASS, MOD1, MOD2, MOD3,
247 static char *gubm_fields[] = {
249 LOGIN, UID, SHELL, LAST, FIRST, MIDDLE, STATUS,
250 MIT_ID, CLASS, MOD1, MOD2, MOD3,
253 static char *ausr_fields[] = {
254 LOGIN, UID, SHELL, LAST, FIRST, MIDDLE, STATUS,
258 static struct valobj ausr_valobj[] = {
259 {V_LOCK, 0, USERS, 0, USERS_ID, SMS_DEADLOCK},
265 {V_TYPE, 8, CLASS, 0, 0, SMS_BAD_CLASS},
268 static struct validate ausr_validate = {
280 static char *rusr_fields[] = {
281 UID, LOGIN, "fs_type"
284 static struct validate rusr_validate = {
296 static char *uusr_fields[] = {
298 "newlogin", UID, SHELL, LAST, FIRST, MIDDLE, STATUS,
302 static struct valobj uusr_valobj[] = {
303 {V_LOCK, 0, USERS, 0, USERS_ID, SMS_DEADLOCK},
304 {V_ID, 0, USERS, LOGIN, USERS_ID, SMS_USER},
305 {V_RENAME, 1, USERS, LOGIN, USERS_ID, SMS_NOT_UNIQUE},
310 {V_TYPE, 9, CLASS, 0, 0, SMS_BAD_CLASS},
313 static struct validate uusr_validate = {
325 static char *uush_fields[] = {
330 static struct validate uush_validate = {
342 static char *uust_fields[] = {
347 static struct validate uust_validate = {
359 static char *dusr_fields[] = {
363 static struct validate dusr_validate = {
375 static char *dubu_fields[] = {
379 static struct valobj dubu_valobj[] = {
380 {V_LOCK, 0, USERS, 0, USERS_ID, SMS_DEADLOCK},
381 {V_ID, 0, USERS, UID, USERS_ID, SMS_USER}
384 static struct validate dubu_validate = {
396 static char *gfbl_fields[] = {
398 LOGIN, "fullname", "nickname", "home_addr",
399 "home_phone", "office_address", "office_phone", "mit_dept",
400 "mit_affil", MOD1, MOD2, MOD3,
403 static struct validate gfbl_validate = {
415 static char *ufbl_fields[] = {
417 "fullname", "nickname", "home_addr",
418 "home_phone", "office_address", "office_phone", "mit_dept",
422 static struct validate ufbl_validate = {
434 static char *gpob_fields[] = {
436 LOGIN, TYPE, "box", MOD1, MOD2, MOD3,
439 static struct validate gpob_validate = {
443 "u.potype != \"NONE\" and u.users_id=%d",
451 static char *gpox_fields[] = {
455 static struct validate gpox_validate = {
467 static char *spob_fields[] = {
471 static struct valobj spob_valobj[] = {
472 {V_LOCK, 0, USERS, 0, USERS_ID, SMS_DEADLOCK},
473 {V_ID, 0, USERS, LOGIN, USERS_ID, SMS_USER},
474 {V_TYPE, 1, "pobox", 0, 0, SMS_TYPE},
477 static struct validate spob_validate = /* SET_POBOX */
490 static struct validate spop_validate = /* SET_POBOX_POP */
503 static struct validate dpob_validate = /* DELETE_POBOX */
516 static char *gmac_fields[] = {
518 NAME, TYPE, MOD1, MOD2, MOD3,
521 static char *amac_fields[] = {
525 static struct valobj amac_valobj[] = {
527 {V_LOCK, 0, MACHINE, 0, MACH_ID, SMS_DEADLOCK},
528 {V_TYPE, 1, "mac_type", 0, 0, SMS_TYPE},
531 static struct validate amac_validate = {
535 "m.name = uppercase(\"%s\")",
540 set_uppercase_modtime,
543 static char *umac_fields[] = {
548 static struct valobj umac_valobj[] = {
549 {V_LOCK, 0, MACHINE, 0, MACH_ID, SMS_DEADLOCK},
550 {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE},
551 {V_RENAME, 1, MACHINE, NAME, MACH_ID, SMS_NOT_UNIQUE},
552 {V_TYPE, 2, "mac_type", 0, 0, SMS_TYPE},
555 static struct validate umac_validate = {
567 static char *dmac_fields[] = {
571 static struct valobj dmac_valobj[] = {
572 {V_LOCK, 0, MACHINE, 0, MACH_ID, SMS_DEADLOCK},
573 {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE},
576 static struct validate dmac_validate = {
588 static char *gclu_fields[] = {
590 NAME, DESC, LOCATION, MOD1, MOD2, MOD3,
593 static char *aclu_fields[] = {
594 NAME, DESC, LOCATION,
597 static struct valobj aclu_valobj[] = {
598 {V_LOCK, 0, CLUSTER, 0, CLU_ID, SMS_DEADLOCK},
602 static struct validate aclu_validate = /* for aclu */
615 static char *uclu_fields[] = {
617 "newname", DESC, LOCATION,
620 static struct valobj uclu_valobj[] = {
621 {V_LOCK, 0, CLUSTER, 0, CLU_ID, SMS_DEADLOCK},
622 {V_ID, 0, CLUSTER, NAME, CLU_ID, SMS_CLUSTER},
623 {V_RENAME, 1, CLUSTER, NAME, CLU_ID, SMS_NOT_UNIQUE},
626 static struct validate uclu_validate = {
638 static char *dclu_fields[] = {
642 static struct validate dclu_validate = {
654 static char *gmcm_fields[] = {
659 static struct valobj amtc_valobj[] = /* ADD_MACHINE_TO_CLUSTER */
660 { /* DELETE_MACHINE_FROM_CLUSTER */
661 {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE},
662 {V_ID, 1, CLUSTER, NAME, CLU_ID, SMS_CLUSTER},
665 static struct validate amtc_validate = /* for amtc and dmfc */
670 "m.mach_id = %d and m.clu_id = %d",
675 set_mach_modtime_by_id,
678 static char *gcld_fields[] = {
679 CLUSTER, "serv_label",
680 CLUSTER, "serv_label", "serv_cluster",
683 static char *acld_fields[] = {
684 CLUSTER, "serv_label", "serv_cluster",
687 static struct valobj acld_valobj[] =
689 {V_ID, 0, CLUSTER, NAME, CLU_ID, SMS_CLUSTER},
693 static struct validate acld_validate = /* ADD_CLUSTER_DATA */
694 { /* DELETE_CLUSTER_DATA */
698 "s.clu_id = %d and s.serv_label = \"%s\" and s.serv_cluster = \"%s\"",
703 set_cluster_modtime_by_id,
706 static char *gsin_fields[] = {
708 SERVICE, "update_int", "target_file", "script", "dfgen", "dfcheck",
709 TYPE, "enable", "inprogress", "harderror", "errmsg",
710 ACE_TYPE, ACE_NAME, MOD1, MOD2, MOD3,
713 static struct validate gsin_validate =
726 static char *qgsv_fields[] = {
727 "enable", "inprogress", "harderror",
731 static struct valobj qgsv_valobj[] = {
732 {V_TYPE, 0, "boolean", 0, 0, SMS_TYPE},
733 {V_TYPE, 1, "boolean", 0, 0, SMS_TYPE},
734 {V_TYPE, 2, "boolean", 0, 0, SMS_TYPE},
737 static struct validate qgsv_validate = {
746 qualified_get_server,
749 static char *asin_fields[] = {
750 SERVICE, "update_int", "target_file", "script", TYPE, "enable",
754 static struct valobj asin_valobj[] = {
755 {V_LOCK, 0, MACHINE, 0, MACH_ID, SMS_DEADLOCK},
757 {V_TYPE, 4, "service", 0, 0, SMS_TYPE},
758 {V_TYPE, 6, ACE_TYPE, 0, 0, SMS_ACE},
759 {V_TYPEDATA, 7, 0, 0, 0, SMS_ACE},
762 static struct validate asin_validate = /* for asin, usin */
767 "s.name = uppercase(\"%s\")",
772 set_uppercase_modtime,
775 static struct validate rsve_validate = {
779 "s.name = uppercase(\"%s\")",
784 set_uppercase_modtime,
787 static char *ssif_fields[] = {
788 SERVICE, "dfgen", "dfcheck", "inprogress", "harderror", "errmsg",
791 static struct validate ssif_validate = {
795 "s.name = uppercase(\"%s\")",
803 static char *dsin_fields[] = {
807 static struct validate dsin_validate = {
811 "s.name = uppercase(\"%s\")",
819 static char *gshi_fields[] = {
821 SERVICE, MACHINE, "enable", "override", "success", "inprogress",
822 "hosterror", "hosterrormsg", "ltt", "lts", "value1", "value2",
823 "value3", MOD1, MOD2, MOD3,
826 static struct validate gshi_validate = {
838 static char *qgsh_fields[] = {
839 "service", "enable", "override", "success", "inprogress", "hosterror",
843 static struct valobj qgsh_valobj[] = {
844 {V_TYPE, 1, "boolean", 0, 0, SMS_TYPE},
845 {V_TYPE, 2, "boolean", 0, 0, SMS_TYPE},
846 {V_TYPE, 3, "boolean", 0, 0, SMS_TYPE},
847 {V_TYPE, 4, "boolean", 0, 0, SMS_TYPE},
848 {V_TYPE, 5, "boolean", 0, 0, SMS_TYPE},
851 static struct validate qgsh_validate = {
860 qualified_get_serverhost,
863 static char *ashi_fields[] = {
864 SERVICE, MACHINE, "enable", "value1", "value2", "value3",
867 static struct valobj ashi_valobj[] = {
868 {V_LOCK, 0, MACHINE, 0, MACH_ID, SMS_DEADLOCK},
869 {V_NAME, 0, "servers", NAME, 0, SMS_SERVICE},
870 {V_ID, 1, MACHINE, NAME, MACH_ID, SMS_MACHINE},
873 static struct validate ashi_validate = /* ashi & ushi */
878 "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
883 set_serverhost_modtime,
886 static struct validate rshe_validate =
891 "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
896 set_serverhost_modtime,
899 static struct validate ssho_validate =
904 "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
912 static char *sshi_fields[] = {
913 "service", MACHINE, "override", "success", "inprogress",
914 "hosterror", "errmsg", "ltt", "lts"
917 static struct valobj sshi_valobj[] = {
918 {V_NAME, 0, "servers", NAME, 0, SMS_SERVICE},
921 static struct validate sshi_validate =
934 static char *dshi_fields[] = {
938 static struct validate dshi_validate =
943 "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
951 static char *gsha_fields[] = {
953 MACHINE, ACE_TYPE, ACE_NAME, MOD1, MOD2, MOD3,
956 static struct validate gsha_validate =
969 static char *asha_fields[] = {
970 MACHINE, ACE_TYPE, ACE_NAME,
973 static struct valobj asha_valobj[] = {
974 {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE},
975 {V_TYPE, 1, ACE_TYPE, 0, 0, SMS_ACE},
976 {V_TYPEDATA, 2, 0, 0, 0, SMS_ACE},
979 static struct validate asha_validate =
992 static char *gslo_fields[] = {
997 static char *gfsl_fields[] = {
999 LABEL, TYPE, MACHINE, NAME, "mount", "access", "comments", "owner", "owners",
1000 "create", "lockertype", MOD1, MOD2, MOD3,
1003 static char *gfsm_fields[] = {
1005 LABEL, TYPE, MACHINE, NAME, "mount", "access", "comments", "owner", "owners",
1006 "create", "lockertype", MOD1, MOD2, MOD3,
1009 static struct validate gfsm_validate = {
1021 static char *gfsn_fields[] = {
1022 MACHINE, "parition",
1023 LABEL, TYPE, MACHINE, NAME, "mount", "access", "comments", "owner", "owners",
1024 "create", "lockertype", MOD1, MOD2, MOD3,
1027 static char *gfsg_fields[] = {
1029 LABEL, TYPE, MACHINE, NAME, "mount", "access", "comments", "owner", "owners",
1030 "create", "lockertype", MOD1, MOD2, MOD3,
1033 static struct validate gfsg_validate = {
1045 static char *afil_fields[] = {
1046 LABEL, TYPE, MACHINE, NAME, "mount", "access", "comments", "owner", "owners",
1047 "create", "lockertype",
1050 static struct valobj afil_valobj[] = {
1052 {V_LOCK, 0, FILESYS, 0, FILSYS_ID, SMS_DEADLOCK},
1053 {V_TYPE, 1, FILESYS, 0, 0, SMS_FSTYPE},
1054 {V_ID, 2, MACHINE, NAME, MACH_ID, SMS_MACHINE},
1056 {V_ID, 7, USERS, LOGIN, USERS_ID, SMS_USER},
1057 {V_ID, 8, LIST, NAME, LIST_ID, SMS_LIST},
1058 {V_TYPE, 10, "lockertype", 0, 0, SMS_TYPE}
1061 static struct validate afil_validate = {
1065 "fs.label = \"%s\"",
1070 set_filesys_modtime,
1073 static char *ufil_fields[] = {
1074 LABEL, "newlabel", TYPE, MACHINE, NAME, "mount", "access", "comments",
1075 "owner", "owners", "create", "lockertype",
1078 static struct valobj ufil_valobj[] = {
1079 {V_LOCK, 0, FILESYS, 0, FILSYS_ID, SMS_DEADLOCK},
1080 {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
1081 {V_RENAME, 1, FILESYS, LABEL, FILSYS_ID, SMS_NOT_UNIQUE},
1082 {V_TYPE, 2, FILESYS, 0, 0, SMS_FSTYPE},
1083 {V_ID, 3, MACHINE, NAME, MACH_ID, SMS_MACHINE},
1085 {V_ID, 8, USERS, LOGIN, USERS_ID, SMS_USER},
1086 {V_ID, 9, LIST, NAME, LIST_ID, SMS_LIST},
1087 {V_TYPE, 11, "lockertype", 0, 0, SMS_TYPE}
1090 static struct validate ufil_validate = {
1094 "fs.filsys_id = %d",
1099 set_filesys_modtime,
1102 static char *dfil_fields[] = {
1106 static struct valobj dfil_valobj[] = {
1107 {V_LOCK, 0, FILESYS, 0, FILSYS_ID, SMS_DEADLOCK},
1108 {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
1111 static struct validate dfil_validate = {
1115 "fs.filsys_id = %d",
1123 static char *gfgm_fields[] = {
1124 "fsgroup", FILESYS, "sortkey"
1127 static struct valobj gfgm_valobj[] = {
1128 {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
1133 static struct validate gfgm_validate = {
1145 static struct valobj aftg_valobj[] = {
1146 {V_LOCK, 0, FILESYS, 0, FILSYS_ID, SMS_DEADLOCK},
1147 {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
1148 {V_ID, 1, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
1151 static struct validate aftg_validate = {
1155 "fg.group_id = %d and fg.filsys_id = %d",
1163 static char *ganf_fields[] = {
1164 MACHINE, DIR, DEVICE, STATUS, "allocated", "size", MOD1, MOD2, MOD3,
1167 static char *gnfp_fields[] = {
1169 MACHINE, DIR, DEVICE, STATUS, "allocated", "size", MOD1, MOD2, MOD3,
1172 static struct validate gnfp_validate = {
1184 static struct valobj anfp_valobj[] = {
1185 {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE},
1189 static struct validate anfp_validate = {
1193 "np.mach_id = %d and np.dir = \"%s\"",
1198 set_nfsphys_modtime,
1201 static char *dnfp_fields[] = {
1205 static struct validate dnfp_validate = {
1209 "np.mach_id = %d and np.dir = \"%s\"",
1214 set_nfsphys_modtime,
1217 static char *gnfq_fields[] = {
1219 FILESYS, LOGIN, "quota", DIR, MACHINE, MOD1, MOD2, MOD3,
1222 static struct valobj gnfq_valobj[] = {
1223 {V_ID, 1, USERS, LOGIN, USERS_ID, SMS_USER},
1227 static struct validate gnfq_validate = {
1239 static char *gnqp_fields[] = {
1241 FILESYS, LOGIN, "quota", DIR, MACHINE, MOD1, MOD2, MOD3,
1244 static char *anfq_fields[] = {
1245 FILESYS, LOGIN, "quota",
1248 static struct validate anfq_validate = {
1252 "nq.filsys_id = %d and nq.users_id = %d",
1260 static struct validate unfq_validate = {
1264 "nq.filsys_id = %d and nq.users_id = %d",
1272 static struct validate dnfq_validate = {
1276 "nq.filsys_id = %d and nq.users_id = %d",
1284 static char *glin_fields[] = {
1286 NAME, "active", "public", "hidden", "maillist", "group", "gid",
1287 ACE_TYPE, ACE_NAME, DESC, MOD1, MOD2, MOD3,
1290 static struct validate glin_validate = {
1297 access_vis_list_by_name,
1302 static char *alis_fields[] = {
1303 NAME, "active", "public", "hidden", "maillist", "group", "gid",
1304 ACE_TYPE, ACE_NAME, DESC,
1307 static struct valobj alis_valobj[] = {
1308 {V_LOCK, 0, LIST, 0, LIST_ID, SMS_DEADLOCK},
1310 {V_TYPE, 7, ACE_TYPE, 0, 0, SMS_ACE},
1311 {V_TYPEDATA, 8, 0, 0, LIST_ID, SMS_ACE},
1314 static struct validate alis_validate = {
1326 static char *ulis_fields[] = {
1328 "newname", "active", "public", "hidden", "maillist", "group", "gid",
1329 ACE_TYPE, ACE_NAME, DESC,
1332 static struct valobj ulis_valobj[] = {
1333 {V_LOCK, 0, LIST, 0, LIST_ID, SMS_DEADLOCK},
1334 {V_ID, 0, LIST, NAME, LIST_ID, SMS_LIST},
1335 {V_RENAME, 1, LIST, NAME, LIST_ID, SMS_NOT_UNIQUE},
1336 {V_TYPE, 8, ACE_TYPE, 0, 0, SMS_ACE},
1337 {V_TYPEDATA, 9, 0, 0, LIST_ID, SMS_ACE},
1340 static struct validate ulis_validate = {
1352 static char *dlis_fields[] = {
1356 static struct validate dlis_validate = {
1368 static char *amtl_fields[] = {
1369 "list_name", "member_type", "member_name",
1372 static struct valobj amtl_valobj[] = {
1373 {V_LOCK, 0, LIST, 0, LIST_ID, SMS_DEADLOCK},
1374 {V_ID, 0, LIST, NAME, LIST_ID, SMS_LIST},
1375 {V_TYPE, 1, "member", 0, 0, SMS_TYPE},
1376 {V_TYPEDATA, 2, 0, 0, 0, SMS_NO_MATCH},
1379 static struct validate amtl_validate = /* for amtl and dmfl */
1384 "m.list_id = %d and m.member_type = \"%s\" and m.member_id = %d",
1392 static char *gaus_fields[] = {
1394 "use_type", "use_name",
1397 static struct valobj gaus_valobj[] = {
1398 {V_TYPE, 0, "gaus", 0, 0, SMS_TYPE},
1399 {V_TYPEDATA, 1, 0, 0, 0, SMS_NO_MATCH},
1402 static struct validate gaus_validate = {
1414 static char *qgli_fields[] = {
1415 "active", "public", "hidden", "maillist", "group",
1419 static struct valobj qgli_valobj[] = {
1420 {V_TYPE, 0, "boolean", 0, 0, SMS_TYPE},
1421 {V_TYPE, 1, "boolean", 0, 0, SMS_TYPE},
1422 {V_TYPE, 2, "boolean", 0, 0, SMS_TYPE},
1423 {V_TYPE, 3, "boolean", 0, 0, SMS_TYPE},
1424 {V_TYPE, 4, "boolean", 0, 0, SMS_TYPE},
1427 static struct validate qgli_validate = {
1436 qualified_get_lists,
1439 static char *gmol_fields[] = {
1441 "member_type", "member_name",
1444 static struct validate gmol_validate = {
1451 access_visible_list,
1453 get_members_of_list,
1456 static char *glom_fields[] = {
1457 "member_type", "member_name",
1458 "list_name", "active", "public", "hidden", "maillist", "group",
1461 static struct valobj glom_valobj[] = {
1462 {V_TYPE, 0, "rmember", 0, 0, SMS_TYPE},
1463 {V_TYPEDATA, 1, 0, 0, 0, SMS_NO_MATCH},
1467 static struct validate glom_validate = {
1476 get_lists_of_member,
1479 static char *cmol_fields[] = {
1484 static struct validate cmol_validate = {
1491 access_visible_list,
1493 count_members_of_list,
1496 static char *augr_fields[] = {
1500 static struct validate augr_validate = {
1512 static char *gzcl_fields[] = {
1514 CLASS, "xmt_type", "xmt_name", "sub_type", "sub_name",
1515 "iws_type", "iws_name", "iui_type", "iui_name", MOD1, MOD2, MOD3,
1518 static struct validate gzcl_validate = {
1530 static char *azcl_fields[] = {
1531 CLASS, "xmt_type", "xmt_name", "sub_type", "sub_name",
1532 "iws_type", "iws_name", "iui_type", "iui_name",
1535 static struct valobj azcl_valobj[] = {
1537 {V_TYPE, 1, ACE_TYPE, 0, 0, SMS_ACE},
1538 {V_TYPEDATA, 2, 0, 0, LIST_ID, SMS_ACE},
1539 {V_TYPE, 3, ACE_TYPE, 0, 0, SMS_ACE},
1540 {V_TYPEDATA, 4, 0, 0, LIST_ID, SMS_ACE},
1541 {V_TYPE, 5, ACE_TYPE, 0, 0, SMS_ACE},
1542 {V_TYPEDATA, 6, 0, 0, LIST_ID, SMS_ACE},
1543 {V_TYPE, 7, ACE_TYPE, 0, 0, SMS_ACE},
1544 {V_TYPEDATA, 8, 0, 0, LIST_ID, SMS_ACE},
1547 static struct validate azcl_validate = {
1559 static char *uzcl_fields[] = {
1560 CLASS, "newclass", "xmt_type", "xmt_name", "sub_type", "sub_name",
1561 "iws_type", "iws_name", "iui_type", "iui_name",
1564 static struct valobj uzcl_valobj[] = {
1565 {V_RENAME, 1, "zephyr", CLASS, 0, SMS_NOT_UNIQUE},
1566 {V_TYPE, 2, ACE_TYPE, 0, 0, SMS_ACE},
1567 {V_TYPEDATA, 3, 0, 0, LIST_ID, SMS_ACE},
1568 {V_TYPE, 4, ACE_TYPE, 0, 0, SMS_ACE},
1569 {V_TYPEDATA, 5, 0, 0, LIST_ID, SMS_ACE},
1570 {V_TYPE, 6, ACE_TYPE, 0, 0, SMS_ACE},
1571 {V_TYPEDATA, 7, 0, 0, LIST_ID, SMS_ACE},
1572 {V_TYPE, 8, ACE_TYPE, 0, 0, SMS_ACE},
1573 {V_TYPEDATA, 9, 0, 0, LIST_ID, SMS_ACE},
1576 static struct validate uzcl_validate = {
1588 static struct validate dzcl_validate = {
1600 static char *gasv_fields[] = {
1601 SERVICE, "protocol", "port", DESC,
1604 static char *gpcp_fields[] = {
1606 "printer", "spooling_host", "spool_directory", "rprinter", "comments",
1610 static char *apcp_fields[] = {
1611 "printer", "spooling_host", "spool_directory", "rprinter", "comments",
1615 static struct valobj apcp_valobj[] = {
1617 {V_ID, 1, MACHINE, NAME, MACH_ID, SMS_MACHINE},
1620 static struct validate apcp_validate = {
1632 static struct validate dpcp_validate = {
1644 static char *gali_fields[] = {
1645 NAME, TYPE, "trans",
1646 NAME, TYPE, "trans",
1649 static char *aali_fields[] = {
1650 NAME, TYPE, "trans",
1653 static struct valobj aali_valobj[] = {
1655 {V_TYPE, 1, "alias", 0, 0, SMS_TYPE},
1659 static struct validate aali_validate = {
1663 "a.name = \"%s\" and a.type = \"%s\" and a.trans = \"%s\"",
1671 static struct validate dali_validate = /* DELETE_ALIAS */
1676 "a.name = \"%s\" and a.type = \"%s\" and a.trans = \"%s\"",
1684 static char *gval_fields[] = {
1688 static struct valobj gval_valobj[] = {
1689 {V_NAME, 0, "values", NAME, 0, SMS_NO_MATCH},
1692 static struct validate gval_validate = {
1704 static char *aval_fields[] = {
1708 static struct validate aval_validate = /* for aval, uval, and dval */
1721 static char *dval_fields[] = {
1725 static char *gats_fields[] = {
1726 "table", "retrieves", "appends", "updates", "deletes", MOD1, MOD2, MOD3,
1731 /* Generalized Query Definitions */
1733 struct query Queries2[] = {
1735 /* Q_GALO - GET_ALL_LOGINS */
1741 "%c = u.login, %c = text(u.uid), %c = u.shell, %c = u.last, %c = u.first, %c = u.middle",
1750 /* Q_GAAL - GET_ALL_ACTIVE_LOGINS */
1751 "get_all_active_logins",
1756 "%c = u.login, %c = text(u.uid), %c = u.shell, %c = u.last, %c = u.first, %c = u.middle",
1765 /* Q_GUBL - GET_USER_BY_LOGIN */
1766 "get_user_by_login",
1771 "%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",
1774 "u.login = \"%s\" and u.users_id != 0",
1780 /* Q_GUBU - GET_USER_BY_UID */
1786 "%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",
1789 "u.uid = %s and u.users_id != 0",
1795 /* Q_GUBN - GET_USER_BY_NAME */
1801 "%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",
1804 "u.first = \"%s\" and u.last = \"%s\" and u.users_id != 0",
1810 /* Q_GUBC - GET_USER_BY_CLASS */
1811 "get_user_by_class",
1816 "%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",
1819 "u.mit_year = uppercase(\"%s\") and u.users_id != 0",
1825 /* Q_GUBM - GET_USER_BY_MITID */
1826 "get_user_by_mitid",
1831 "%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",
1834 "u.mit_id = \"%s\" and u.users_id != 0",
1840 /* Q_AUSR - ADD_USER */
1846 "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",
1849 "values.name = \"users_id\"",
1855 /* Q_RUSR - REGISTER_USER */
1870 /* Q_UUSR - UPDATE_USER */
1876 "login = %c, uid = int4(%c), shell = %c, last = %c, first = %c, middle = %c, status = int4(%c), mit_id = %c, mit_year = %c",
1885 /* Q_UUSH - UPDATE_USER_SHELL */
1886 "update_user_shell",
1900 /* Q_UUST - UPDATE_USER_STATUS */
1901 "update_user_status",
1906 "status = int4(%c)",
1915 /* Q_DUSR - DELETE_USER */
1930 /* Q_DUBU - DELETE_USER_BY_UID */
1931 "delete_user_by_uid",
1945 /* Q_GFBL - GET_FINGER_BY_LOGIN */
1946 "get_finger_by_login",
1951 "%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",
1960 /* Q_UFBL - UPDATE_FINGER_BY_LOGIN */
1961 "update_finger_by_login",
1966 "fullname=%c,nickname=%c,home_addr=%c,home_phone=%c,office_addr=%c,office_phone=%c,mit_dept=%c,mit_affil=%c",
1975 /* Q_GPOB - GET_POBOX */
1981 "%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",
1990 /* Q_GAPO - GET_ALL_POBOXES */
1996 "%c = u.login, %c = u.potype, %c = text(u.pop_id) + \":\" + text(u.box_id)",
1999 "u.potype != \"NONE\"",
2005 /* Q_GPOP - GET_POBOXES_POP */
2011 "%c = u.login, %c = u.potype, %c = text(u.pop_id) + \":\" + text(u.box_id)",
2014 "u.potype = \"POP\"",
2020 /* Q_GPOF - GET_POBOXES_SMTP */
2026 "%c = u.login, %c = u.potype, %c = text(u.pop_id) + \":\" + text(u.box_id)",
2029 "u.potype = \"SMTP\"",
2035 /* Q_SPOB - SET_POBOX */
2050 /* Q_SPOP - SET_POBOX_POP */
2065 /* Q_DPOB - DELETE_POBOX */
2071 "potype = \"NONE\"",
2080 /* Q_GMAC - GET_MACHINE */
2086 "%c = m.name, %c = m.type, %c = m.modtime, %c = text(m.modby), %c =m.modwith",
2089 "m.name = uppercase(\"%s\") and m.mach_id != 0",
2095 /* Q_AMAC - ADD_MACHINE */
2101 "name = uppercase(%c), mach_id = values.value, type = %c",
2104 "values.name = \"mach_id\"",
2110 /* Q_UMAC - UPDATE_MACHINE */
2116 "name = uppercase(%c), type = %c",
2125 /* Q_DMAC - DELETE_MACHINE */
2140 /* Q_GCLU - GET_CLUSTER */
2146 "%c = c.name, %c = c.desc, %c = c.location, %c = c.modtime, %c = text(c.modby), %c = c.modwith",
2149 "c.name = \"%s\" and c.clu_id != 0",
2155 /* Q_ACLU - ADD_CLUSTER */
2161 "name = %c, clu_id = values.value, desc = %c, location = %c",
2164 "values.name = \"clu_id\"",
2170 /* Q_UCLU - UPDATE_CLUSTER */
2176 "name = %c, desc = %c, location = %c",
2185 /* Q_DCLU - DELETE_CLUSTER */
2200 /* Q_GMCM - GET_MACHINE_TO_CLUSTER_MAP */
2201 "get_machine_to_cluster_map",
2206 "%c = machine.name, %c = cluster.name",
2209 "machine.name = uppercase(\"%s\") and cluster.name = \"%s\" and m.clu_id = cluster.clu_id and m.mach_id = machine.mach_id",
2215 /* Q_AMTC - ADD_MACHINE_TO_CLUSTER */
2216 "add_machine_to_cluster",
2221 "mach_id = %i4, clu_id = %i4",
2230 /* Q_DMFC - DELETE_MACHINE_FROM_CLUSTER */
2231 "delete_machine_from_cluster",
2239 "m.mach_id = %d and m.clu_id = %d",
2245 /* Q_GCLD - GET_CLUSTER_DATA */
2251 "%c = cluster.name, %c = s.serv_label, %c = s.serv_cluster",
2254 "cluster.clu_id = s.clu_id and cluster.name = \"%s\" and s.serv_label = \"%s\"",
2260 /* Q_ACLD - ADD_CLUSTER_DATA */
2266 "clu_id = %i4, serv_label = %c, serv_cluster = %c",
2275 /* Q_DCLD - DELETE_CLUSTER_DATA */
2276 "delete_cluster_data",
2284 "s.clu_id = %d and s.serv_label = \"%s\" and s.serv_cluster = \"%s\"",
2290 /* Q_GSIN - GET_SERVER_INFO */
2296 "%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",
2299 "s.name = uppercase(\"%s\")",
2305 /* Q_QGSV - QUALIFIED_GET_SERVER */
2306 "qualified_get_server",
2320 /* Q_ASIN - ADD_SERVER_INFO */
2326 "name = uppercase(%c), update_int = int4(%c), target_file = %c, script = %c, type = %c, enable = int1(%c), acl_type = %c, acl_id = %i4",
2335 /* Q_USIN - UPDATE_SERVER_INFO */
2336 "update_server_info",
2341 "update_int = int4(%c), target_file = %c, script = %c, type = %c, enable = int1(%c), acl_type = %c, acl_id = %i4",
2344 "s.name = uppercase(\"%s\")",
2350 /* Q_RSVE - RESET_SERVER_ERROR */
2351 "reset_server_error",
2356 "harderror = 0, dfcheck = s.dfgen",
2359 "s.name = uppercase(\"%s\")",
2365 /* Q_SSIF - SET_SERVER_INTERNAL_FLAGS */
2366 "set_server_internal_flags",
2371 "dfgen = int4(%c), dfcheck = int4(%c), inprogress = int1(%c), harderror = int1(%c), errmsg = %c",
2374 "s.name = uppercase(\"%s\")",
2380 /* Q_DSIN - DELETE_SERVER_INFO */
2381 "delete_server_info",
2389 "s.name = uppercase(\"%s\")",
2395 /* Q_GSHI - GET_SERVER_HOST_INFO */
2396 "get_server_host_info",
2401 "%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",
2404 "sh.service = uppercase(\"%s\") and machine.name = uppercase(\"%s\") and machine.mach_id = sh.mach_id",
2410 /* Q_QGSV - QUALIFIED_GET_SERVER_HOST */
2411 "qualified_get_server_host",
2425 /* Q_ASHI - ADD_SERVER_HOST_INFO */
2426 "add_server_host_info",
2431 "service = uppercase(%c), mach_id = %i4, enable = int1(%c), value1 = int4(%c), value2 = int4(%c), value3 = %c",
2440 /* Q_USHI - UPDATE_SERVER_HOST_INFO */
2441 "update_server_host_info",
2446 "enable = int1(%c), value1 = int4(%c), value2 = int4(%c), value3 = %c",
2449 "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
2455 /* Q_RSHE - RESET_SERVER_HOST_ERROR */
2456 "reset_server_host_error",
2464 "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
2470 /* Q_SSHO - SET_SERVER_HOST_OVERRIDE */
2471 "set_server_host_override",
2479 "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
2485 /* Q_SSHI - SET_SERVER_HOST_INTERNAL */
2486 "set_server_host_internal",
2491 "override = int1(%c), success = int1(%c), inprogress = int1(%c), hosterror = int1(%c), hosterrmsg = %c, ltt = int4(%c), lts = int4(%c)",
2494 "s.service = uppercase(\"%s\") and s.mach_id = machine.mach_id and machine.name = \"%s\"",
2500 /* Q_DSHI - DELETE_SERVER_HOST_INFO */
2501 "delete_server_host_info",
2509 "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
2515 /* Q_GSHA - GET_SERVER_HOST_ACCESS */
2516 "get_server_host_access",
2521 "%c = machine.name, %c = ha.acl_type, %c = text(ha.acl_id), %c = ha.modtime, %c = text(ha.modby), %c = ha.modwith",
2524 "machine.name = uppercase(\"%s\") and ha.mach_id = machine.mach_id",
2530 /* Q_ASHA - ADD_SERVER_HOST_ACCESS */
2531 "add_server_host_access",
2536 "mach_id = %i4, acl_type = %c, acl_id = %i4",
2545 /* Q_USHA - UPDATE_SERVER_HOST_ACCESS */
2546 "update_server_host_access",
2551 "acl_type = %c, acl_id = %i4",
2560 /* Q_DSHA - DELETE_SERVER_HOST_ACCESS */
2561 "delete_server_host_access",
2575 /* Q_GSLO - GET_SERVER_LOCATIONS */
2576 "get_server_locations",
2581 "%c = sh.service, %c = machine.name",
2584 "sh.service = uppercase(\"%s\") and sh.mach_id = machine.mach_id",
2590 /* Q_GFSL - GET_FILESYS_BY_LABEL */
2591 "get_filesys_by_label",
2596 "%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",
2599 "fs.label = \"%s\" and fs.mach_id = machine.mach_id and fs.owner = users.users_id and fs.owners = list.list_id",
2605 /* Q_GFSM - GET_FILESYS_BY_MACHINE */
2606 "get_filesys_by_machine",
2611 "%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",
2614 "fs.mach_id = %d and machine.mach_id = fs.mach_id and fs.owner = users.users_id and fs.owners = list.list_id",
2620 /* Q_GFSN - GET_FILESYS_BY_NFSPHYS */
2621 "get_filesys_by_nfsphys",
2626 "%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",
2629 "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\"",
2635 /* Q_GFSG - GET_FILESYS_BY_GROUP */
2636 "get_filesys_by_group",
2641 "%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",
2644 "fs.owners = %d and machine.mach_id = fs.mach_id and fs.owner = users.users_id and fs.owners = list.list_id",
2650 /* Q_AFIL - ADD_FILESYS */
2656 "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",
2659 "values.name = \"filsys_id\"",
2665 /* Q_UFIL - UPDATE_FILESYS */
2671 "label = %c, type = %c, mach_id = %i4, name = %c, mount = %c, access = %c, comments = %c, owner = %i4, owners = %i4, createflg = int1(%c), lockertype = %c",
2674 "fs.filsys_id = %d",
2680 /* Q_DFIL - DELETE_FILESYS */
2689 "fs.filsys_id = %d",
2695 /* Q_GFGM - GET_FSGROUOP_MEMBERS */
2696 "get_fsgroup_members",
2701 "%c = filesys.label, %c = fg.key",
2704 "fg.group_id = %d and filesys.filsys_id = fg.filsys_id",
2710 /* Q_AFTG - ADD_FILESYS_TO_FSGROUP */
2711 "add_filesys_to_fsgroup",
2716 "group_id = filesys.filsys_id, filsys_id = %i4, key = %c",
2719 "filesys.filsys_id = %d and filesys.type = \"FSGROUP\"",
2725 /* Q_RFFG - REMOVE_FILESYS_FROM_FSGROUP */
2726 "remove_filesys_from_fsgroup",
2734 "fg.group_id = %d and fg.filsys_id = %d",
2740 /* Q_GANF - GET_ALL_NFSPHYS */
2746 "%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",
2749 "machine.mach_id = np.mach_id",
2755 /* Q_GNFP - GET_NFSPHYS */
2761 "%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",
2764 "np.mach_id = %d and np.dir = \"%s\" and machine.mach_id = np.mach_id",
2770 /* Q_ANFP - ADD_NFSPHYS */
2776 "nfsphys_id = values.value, mach_id = %i4, dir = %c, device = %c, status = int4(%c), allocated = int4(%c), size = int4(%c)",
2779 "values.name = \"nfsphys_id\"",
2785 /* Q_UNFP - UPDATE_NFSPHYS */
2791 "device = %c, status = int4(%c), allocated = int4(%c), size = int4(%c)",
2794 "np.mach_id = %d and np.dir = \"%s\"",
2800 /* Q_AJNF - ADJUST_NFSPHYS_ALLOCATION */
2801 "adjust_nfsphys_allocation",
2806 "allocated = np.allocated + int4(%c)",
2809 "np.mach_id = %d and np.dir = \"%s\"",
2815 /* Q_DNFP - DELETE_NFSPHYS */
2824 "np.mach_id = %d and np.dir = \"%s\"",
2830 /* Q_GNFQ - GET_NFS_QUOTAS */
2836 "%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",
2839 "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",
2845 /* Q_GNQP - GET_NFS_QUOTAS_BY_PARTITION */
2846 "get_nfs_quotas_by_partition",
2851 "%c = filesys.label, %c = users.login, %c = text(nq.quota), %c = nfsphys.dir, %c = machine.name",
2854 "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",
2860 /* Q_ANFQ - ADD_NFS_QUOTA */
2866 "filsys_id = filesys.filsys_id, users_id = %i4, quota = int4(%c), phys_id = filesys.phys_id",
2869 "filesys.filsys_id = %d",
2875 /* Q_UNFQ - UPDATE_NFS_QUOTA */
2884 "nq.filsys_id = %d and nq.users_id = %d",
2890 /* Q_DNFQ - DELETE_NFS_QUOTA */
2899 "nq.filsys_id = %d and nq.users_id = %d",
2905 /* Q_GLIN - GET_LIST_INFO */
2920 /* Q_EXLN - EXPAND_LIST_NAMES */
2921 "expand_list_names",
2929 "l.name = \"%s\" and l.list_id != 0",
2935 /* Q_ALIS - ADD_LIST */
2941 "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",
2944 "values.name = \"list_id\"",
2950 /* Q_ULIS - UPDATE_LIST */
2956 "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",
2965 /* Q_DLIS - DELETE_LIST */
2980 /* Q_AMTL - ADD_MEMBER_TO_LIST */
2981 "add_member_to_list",
2986 "list_id=%i4, member_type=%c, member_id=%i4",
2995 /* Q_DMFL - DELETE_MEMBER_FROM_LIST */
2996 "delete_member_from_list",
3004 "m.list_id = %d and m.member_type = \"%s\" and m.member_id = %d",
3010 /* Q_GAUS - GET_ACE_USE */
3025 /* Q_QGLI - QUALIFIED_GET_LISTS */
3026 "qualified_get_lists",
3040 /* Q_GMOL - GET_MEMBERS_OF_LIST */
3041 "get_members_of_list",
3055 /* Q_GLOM - GET_LISTS_OF_MEMBER */
3056 "get_lists_of_member",
3070 /* Q_CMOL - COUNT_MEMBERS_OF_LIST */
3071 "count_members_of_list",
3085 /* Q_AUGR - ADD_USER_GROUP */
3100 /* Q_GZCL - GET_ZEPHYR_CLASS */
3106 "%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",
3115 /* Q_AZCL - ADD_ZEPHYR_CLASS */
3121 "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",
3130 /* Q_UZCL - UPDATE_ZEPHYR_CLASS */
3131 "update_zephyr_class",
3136 "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",
3145 /* Q_DZCL - DELETE_ZEPHYR_CLASS */
3146 "delete_zephyr_class",
3160 /* Q_GSVC - GET_SERVICE */
3166 "%c = s.name, %c = s.protocol, %c = text(s.port), %c = s.desc, %c = s.modtime, %c = text(s.modby), %c = s.modwith",
3175 /* Q_ASVC - ADD_SERVICE */
3181 "name = %c, protocol = %c, port = int2(%c), desc = %c",
3190 /* Q_DSVC - DELETE_SERVICE */
3205 /* Q_GPCP - GET_PRINTCAP */
3211 "%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",
3214 "p.name = \"%s\" and machine.mach_id = p.mach_id",
3220 /* Q_APCP - ADD_PRINTCAP */
3226 "name = %c, mach_id = %i4, dir = %c, rp = %c, comments = %c",
3235 /* Q_DPCP - DELETE_PRINTCAP */
3250 /* Q_GALI - GET_ALIAS */
3256 "%c = a.name, %c = a.type, %c = a.trans",
3259 "a.name = \"%s\" and a.type = \"%s\" and a.trans = \"%s\"",
3265 /* Q_AALI - ADD_ALIAS */
3271 "name = %c, type = %c, trans = %c",
3280 /* Q_DALI - DELETE_ALIAS */
3289 "a.name = \"%s\" and a.type = \"%s\" and a.trans = \"%s\"",
3295 /* Q_GVAL - GET_VALUE */
3301 "%c = text(v.value)",
3310 /* Q_AVAL - ADD_VALUE */
3316 "name = %c, value = int4(%c)",
3325 /* Q_UVAL - UPDATE_VALUE */
3340 /* Q_DVAL - DELETE_VALUE */
3355 /* Q_GATS - GET_ALL_TABLE_STATS */
3356 "get_all_table_stats",
3361 "%c = tbs.table, %c = text(tbs.retrieves), %c = text(tbs.appends), %c = text(tbs.updates), %c = text(tbs.deletes), %c = tbs.modtime",
3371 int QueryCount2 = (sizeof Queries2 / sizeof (struct query));