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 */
46 /* Query Followup Routines */
47 int followup_fix_modby();
58 int set_modtime_by_id();
59 int set_finger_modtime();
60 int set_pobox_modtime();
61 int set_uppercase_modtime();
62 int set_mach_modtime_by_id();
63 int set_cluster_modtime_by_id();
64 int set_serverhost_modtime();
65 int set_nfsphys_modtime();
66 int set_filesys_modtime();
67 int set_zephyr_modtime();
72 int add_member_to_list();
73 int delete_member_from_list();
75 int qualified_get_lists();
76 int get_members_of_list();
77 int qualified_get_server();
78 int qualified_get_serverhost();
80 int count_members_of_list();
81 int get_lists_of_member();
87 * These are commonly used strings in the table, defined here so that
91 static char ACE_NAME[] = "ace_name";
92 static char ACE_TYPE[] = "ace_type";
93 static char CLASS[] = "class";
94 static char CLU_ID[] = "clu_id";
95 static char CLUSTER[] = "cluster";
96 static char DESC[] = "description";
97 static char DEVICE[] = "device";
98 static char DIR[] = "dir";
99 static char FILESYS[] = "filesys";
100 static char FILSYS_ID[] = "filsys_id";
101 static char FIRST[] = "firstname";
102 static char LABEL[] = "label";
103 static char LAST[] = "lastname";
104 static char LIST[] = "list";
105 static char LIST_ID[] = "list_id";
106 static char LOCATION[] = "location";
107 static char LOGIN[] = "login";
108 static char MACH_ID[] = "mach_id";
109 static char MACHINE[] = "machine";
110 static char MIDDLE[] = "middle";
111 static char MIT_ID[] = "mit_id";
112 static char MOD1[] = "modtime";
113 static char MOD2[] = "modby";
114 static char MOD3[] = "modwith";
115 static char NAME[] = "name";
116 static char QUOTA[] = "quota";
117 static char QUOTA_TYPE[] = "quota_type";
118 static char SERVICE[] = "service";
119 static char SHELL[] = "shell";
120 static char STATUS[] = "status";
121 static char TYPE[] = "type";
122 static char USERS[] = "users";
123 static char USERS_ID[] = "users_id";
124 static char UID[] = "uid";
129 * These are commonly used validation objects, defined here so that they
133 static struct valobj VOsort0[] = {
134 {V_SORT, 0, 0, 0, 0, 0},
137 static struct valobj VOdate1[] = {
138 {V_DATE, 1, 0, 0, 0, MR_DATE},
141 static struct valobj VOuser0[] = {
142 {V_ID, 0, USERS, LOGIN, USERS_ID, MR_USER},
145 static struct valobj VOuser0lock[] = {
146 {V_LOCK, 0, USERS, 0, USERS_ID, MR_DEADLOCK},
147 {V_ID, 0, USERS, LOGIN, USERS_ID, MR_USER},
150 static struct valobj VOmach0[] = {
151 {V_ID, 0, MACHINE, NAME, MACH_ID, MR_MACHINE},
154 static struct valobj VOclu0[] = {
155 {V_ID, 0, CLUSTER, NAME, CLU_ID, MR_CLUSTER},
158 static struct valobj VOlist0[] = {
159 {V_ID, 0, LIST, NAME, LIST_ID, MR_LIST},
162 static struct valobj VOfilsys0[] = {
163 {V_ID, 0, FILESYS, LABEL, FILSYS_ID, MR_FILESYS},
166 static struct valobj VOchar0[] = {
170 static struct valobj VOsort01[] = {
175 static struct valobj VOuser0sort[] = {
176 {V_ID, 0, USERS, LOGIN, USERS_ID, MR_USER},
180 static struct valobj VOfilsys0user1[] = {
181 {V_LOCK, 0, FILESYS, 0, FILSYS_ID, MR_DEADLOCK},
182 {V_ID, 0, FILESYS, LABEL, FILSYS_ID, MR_FILESYS},
183 {V_ID, 1, USERS, LOGIN, USERS_ID, MR_USER},
188 * Commonly used validation records defined here so that they may
192 static struct validate VDmach = { VOmach0, 1 };
193 static struct validate VDsort2= { VOsort01,2 };
194 static struct validate VDsortf = {
210 static char *galo_fields[] = {
211 LOGIN, UID, SHELL, LAST, FIRST, MIDDLE,
214 static char *gubl_fields[] = {
216 LOGIN, UID, SHELL, LAST, FIRST, MIDDLE, STATUS,
217 MIT_ID, CLASS, MOD1, MOD2, MOD3
220 static struct validate gubx_validate = /* gubl, gubu */
233 static char *gubu_fields[] = {
235 LOGIN, UID, SHELL, LAST, FIRST, MIDDLE, STATUS,
236 MIT_ID, CLASS, MOD1, MOD2, MOD3,
239 static char *gubn_fields[] = {
241 LOGIN, UID, SHELL, LAST, FIRST, MIDDLE, STATUS,
242 MIT_ID, CLASS, MOD1, MOD2, MOD3,
245 static char *gubc_fields[] = {
247 LOGIN, UID, SHELL, LAST, FIRST, MIDDLE, STATUS,
248 MIT_ID, CLASS, MOD1, MOD2, MOD3,
251 static char *gubm_fields[] = {
253 LOGIN, UID, SHELL, LAST, FIRST, MIDDLE, STATUS,
254 MIT_ID, CLASS, MOD1, MOD2, MOD3,
257 static char *ausr_fields[] = {
258 LOGIN, UID, SHELL, LAST, FIRST, MIDDLE, STATUS,
262 static struct valobj ausr_valobj[] = {
263 {V_LOCK, 0, USERS, 0, USERS_ID, MR_DEADLOCK},
269 {V_TYPE, 8, CLASS, 0, 0, MR_BAD_CLASS},
272 static struct validate ausr_validate = {
276 "users.login = \"%s\"",
284 static char *rusr_fields[] = {
285 UID, LOGIN, "fs_type"
288 static struct valobj rusr_valobj[] = {
289 {V_LOCK, 0, USERS, 0, USERS_ID, MR_DEADLOCK},
290 {V_LOCK, 0, LIST, 0, LIST_ID, MR_DEADLOCK},
291 {V_LOCK, 0, FILESYS, 0, FILSYS_ID, MR_DEADLOCK},
292 {V_LOCK, 0, "nfsphys", 0, "nfsphys_id", MR_DEADLOCK},
295 static struct validate rusr_validate = {
307 static char *uusr_fields[] = {
309 "newlogin", UID, SHELL, LAST, FIRST, MIDDLE, STATUS,
313 static struct valobj uusr_valobj[] = {
314 {V_LOCK, 0, USERS, 0, USERS_ID, MR_DEADLOCK},
315 {V_ID, 0, USERS, LOGIN, USERS_ID, MR_USER},
316 {V_RENAME, 1, USERS, LOGIN, USERS_ID, MR_NOT_UNIQUE},
321 {V_TYPE, 9, CLASS, 0, 0, MR_BAD_CLASS},
324 static struct validate uusr_validate = {
336 static char *uush_fields[] = {
341 static struct validate uush_validate = {
353 static char *uust_fields[] = {
358 static struct validate uust_validate = {
370 static char *dusr_fields[] = {
374 static struct validate dusr_validate = {
386 static char *dubu_fields[] = {
390 static struct valobj dubu_valobj[] = {
391 {V_LOCK, 0, USERS, 0, USERS_ID, MR_DEADLOCK},
392 {V_ID, 0, USERS, UID, USERS_ID, MR_USER}
395 static struct validate dubu_validate = {
407 static char *gkum_fields[] = { LOGIN, "kerberos",
410 static char *akum_fields[] = { LOGIN, "kerberos" };
412 static struct valobj akum_valobj[] =
414 {V_ID, 0, USERS, LOGIN, USERS_ID, MR_USER},
415 {V_ID, 1, "strings", "string", "string_id", MR_NO_MATCH},
418 static struct validate akum_validate =
423 "kerberos.users_id = %d or kerberos.string_id = %d",
431 static struct validate dkum_validate =
436 "kerberos.users_id = %d and kerberos.string_id = %d",
444 static char *gfbl_fields[] = {
446 LOGIN, "fullname", "nickname", "home_addr",
447 "home_phone", "office_address", "office_phone", "mit_dept",
448 "mit_affil", MOD1, MOD2, MOD3,
451 static struct validate gfbl_validate = {
463 static char *ufbl_fields[] = {
465 "fullname", "nickname", "home_addr",
466 "home_phone", "office_address", "office_phone", "mit_dept",
470 static struct validate ufbl_validate = {
482 static char *gpob_fields[] = {
484 LOGIN, TYPE, "box", MOD1, MOD2, MOD3,
487 static struct validate gpob_validate = {
491 "users.potype != \"NONE\" and users.users_id=%d",
499 static char *gpox_fields[] = {
503 static struct validate gpox_validate = {
515 static char *spob_fields[] = {
519 static struct valobj spob_valobj[] = {
520 {V_LOCK, 0, USERS, 0, USERS_ID, MR_DEADLOCK},
521 {V_ID, 0, USERS, LOGIN, USERS_ID, MR_USER},
522 {V_TYPE, 1, "pobox", 0, 0, MR_TYPE},
525 static struct validate spob_validate = /* SET_POBOX */
538 static struct validate spop_validate = /* SET_POBOX_POP */
551 static struct validate dpob_validate = /* DELETE_POBOX */
564 static char *gmac_fields[] = {
566 NAME, TYPE, MOD1, MOD2, MOD3,
569 static char *amac_fields[] = {
573 static struct valobj amac_valobj[] = {
575 {V_LOCK, 0, MACHINE, 0, MACH_ID, MR_DEADLOCK},
576 {V_TYPE, 1, "mac_type", 0, 0, MR_TYPE},
579 static struct validate amac_validate = {
583 "imembers.name = uppercase(\"%s\")",
588 set_uppercase_modtime,
591 static char *umac_fields[] = {
596 static struct valobj umac_valobj[] = {
597 {V_LOCK, 0, MACHINE, 0, MACH_ID, MR_DEADLOCK},
598 {V_ID, 0, MACHINE, NAME, MACH_ID, MR_MACHINE},
599 {V_RENAME, 1, MACHINE, NAME, MACH_ID, MR_NOT_UNIQUE},
600 {V_TYPE, 2, "mac_type", 0, 0, MR_TYPE},
603 static struct validate umac_validate = {
615 static char *dmac_fields[] = {
619 static struct valobj dmac_valobj[] = {
620 {V_LOCK, 0, MACHINE, 0, MACH_ID, MR_DEADLOCK},
621 {V_ID, 0, MACHINE, NAME, MACH_ID, MR_MACHINE},
624 static struct validate dmac_validate = {
636 static char *gclu_fields[] = {
638 NAME, DESC, LOCATION, MOD1, MOD2, MOD3,
641 static char *aclu_fields[] = {
642 NAME, DESC, LOCATION,
645 static struct valobj aclu_valobj[] = {
646 {V_LOCK, 0, CLUSTER, 0, CLU_ID, MR_DEADLOCK},
650 static struct validate aclu_validate = /* for aclu */
655 "clusters.name = \"%s\"",
663 static char *uclu_fields[] = {
665 "newname", DESC, LOCATION,
668 static struct valobj uclu_valobj[] = {
669 {V_LOCK, 0, CLUSTER, 0, CLU_ID, MR_DEADLOCK},
670 {V_ID, 0, CLUSTER, NAME, CLU_ID, MR_CLUSTER},
671 {V_RENAME, 1, CLUSTER, NAME, CLU_ID, MR_NOT_UNIQUE},
674 static struct validate uclu_validate = {
686 static char *dclu_fields[] = {
690 static struct validate dclu_validate = {
702 static char *gmcm_fields[] = {
707 static struct valobj amtc_valobj[] = /* ADD_MACHINE_TO_CLUSTER */
708 { /* DELETE_MACHINE_FROM_CLUSTER */
709 {V_ID, 0, MACHINE, NAME, MACH_ID, MR_MACHINE},
710 {V_ID, 1, CLUSTER, NAME, CLU_ID, MR_CLUSTER},
713 static struct validate amtc_validate = /* for amtc and dmfc */
718 "imembers.mach_id = %d and imembers.clu_id = %d",
723 set_mach_modtime_by_id,
726 static char *gcld_fields[] = {
727 CLUSTER, "serv_label",
728 CLUSTER, "serv_label", "serv_cluster",
731 static char *acld_fields[] = {
732 CLUSTER, "serv_label", "serv_cluster",
735 static struct valobj acld_valobj[] =
737 {V_ID, 0, CLUSTER, NAME, CLU_ID, MR_CLUSTER},
741 static struct validate acld_validate = /* ADD_CLUSTER_DATA */
742 { /* DELETE_CLUSTER_DATA */
746 "svc.clu_id = %d and svc.serv_label = \"%s\" and svc.serv_cluster = \"%s\"",
751 set_cluster_modtime_by_id,
754 static char *gsin_fields[] = {
756 SERVICE, "update_int", "target_file", "script", "dfgen", "dfcheck",
757 TYPE, "enable", "inprogress", "harderror", "errmsg",
758 ACE_TYPE, ACE_NAME, MOD1, MOD2, MOD3,
761 static struct validate gsin_validate =
774 static char *qgsv_fields[] = {
775 "enable", "inprogress", "harderror",
779 static struct valobj qgsv_valobj[] = {
780 {V_TYPE, 0, "boolean", 0, 0, MR_TYPE},
781 {V_TYPE, 1, "boolean", 0, 0, MR_TYPE},
782 {V_TYPE, 2, "boolean", 0, 0, MR_TYPE},
785 static struct validate qgsv_validate = {
794 qualified_get_server,
797 static char *asin_fields[] = {
798 SERVICE, "update_int", "target_file", "script", TYPE, "enable",
802 static struct valobj asin_valobj[] = {
803 {V_LOCK, 0, MACHINE, 0, MACH_ID, MR_DEADLOCK},
805 {V_TYPE, 4, "service", 0, 0, MR_TYPE},
806 {V_TYPE, 6, ACE_TYPE, 0, 0, MR_ACE},
807 {V_TYPEDATA, 7, 0, 0, 0, MR_ACE},
810 static struct validate asin_validate = /* for asin, usin */
815 "services.name = uppercase(\"%s\")",
820 set_uppercase_modtime,
823 static struct validate rsve_validate = {
827 "services.name = uppercase(\"%s\")",
832 set_uppercase_modtime,
835 static char *ssif_fields[] = {
836 SERVICE, "dfgen", "dfcheck", "inprogress", "harderror", "errmsg",
839 static struct validate ssif_validate = {
843 "services.name = uppercase(\"%s\")",
851 static char *dsin_fields[] = {
855 static struct validate dsin_validate = {
859 "services.name = uppercase(\"%s\")",
867 static char *gshi_fields[] = {
869 SERVICE, MACHINE, "enable", "override", "success", "inprogress",
870 "hosterror", "hosterrormsg", "ltt", "lts", "value1", "value2",
871 "value3", MOD1, MOD2, MOD3,
874 static struct validate gshi_validate = {
886 static char *qgsh_fields[] = {
887 "service", "enable", "override", "success", "inprogress", "hosterror",
891 static struct valobj qgsh_valobj[] = {
892 {V_TYPE, 1, "boolean", 0, 0, MR_TYPE},
893 {V_TYPE, 2, "boolean", 0, 0, MR_TYPE},
894 {V_TYPE, 3, "boolean", 0, 0, MR_TYPE},
895 {V_TYPE, 4, "boolean", 0, 0, MR_TYPE},
896 {V_TYPE, 5, "boolean", 0, 0, MR_TYPE},
899 static struct validate qgsh_validate = {
908 qualified_get_serverhost,
911 static char *ashi_fields[] = {
912 SERVICE, MACHINE, "enable", "value1", "value2", "value3",
915 static struct valobj ashi_valobj[] = {
916 {V_LOCK, 0, MACHINE, 0, MACH_ID, MR_DEADLOCK},
917 {V_NAME, 0, "servers", NAME, 0, MR_SERVICE},
918 {V_ID, 1, MACHINE, NAME, MACH_ID, MR_MACHINE},
921 static struct validate ashi_validate = /* ashi & ushi */
926 "serverhosts.service = uppercase(\"%s\") and serverhosts.mach_id = %d",
931 set_serverhost_modtime,
934 static struct validate rshe_validate =
939 "serverhosts.service = uppercase(\"%s\") and serverhosts.mach_id = %d",
944 set_serverhost_modtime,
947 static struct validate ssho_validate =
952 "serverhosts.service = uppercase(\"%s\") and serverhosts.mach_id = %d",
960 static char *sshi_fields[] = {
961 "service", MACHINE, "override", "success", "inprogress",
962 "hosterror", "errmsg", "ltt", "lts"
965 static struct valobj sshi_valobj[] = {
966 {V_NAME, 0, "servers", NAME, 0, MR_SERVICE},
969 static struct validate sshi_validate =
982 static char *dshi_fields[] = {
986 static struct validate dshi_validate =
991 "serverhosts.service = uppercase(\"%s\") and serverhosts.mach_id = %d",
999 static char *gsha_fields[] = {
1001 MACHINE, ACE_TYPE, ACE_NAME, MOD1, MOD2, MOD3,
1004 static struct validate gsha_validate =
1017 static char *asha_fields[] = {
1018 MACHINE, ACE_TYPE, ACE_NAME,
1021 static struct valobj asha_valobj[] = {
1022 {V_ID, 0, MACHINE, NAME, MACH_ID, MR_MACHINE},
1023 {V_TYPE, 1, ACE_TYPE, 0, 0, MR_ACE},
1024 {V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
1027 static struct validate asha_validate =
1032 "hostaccess.mach_id = %d",
1040 static char *gslo_fields[] = {
1045 static char *gfsl_fields[] = {
1047 LABEL, TYPE, MACHINE, NAME, "mount", "access", "comments", "owner", "owners",
1048 "create", "lockertype", MOD1, MOD2, MOD3,
1051 static char *gfsm_fields[] = {
1053 LABEL, TYPE, MACHINE, NAME, "mount", "access", "comments", "owner", "owners",
1054 "create", "lockertype", MOD1, MOD2, MOD3,
1057 static struct validate gfsm_validate = {
1069 static char *gfsn_fields[] = {
1070 MACHINE, "parition",
1071 LABEL, TYPE, MACHINE, NAME, "mount", "access", "comments", "owner", "owners",
1072 "create", "lockertype", MOD1, MOD2, MOD3,
1075 static char *gfsg_fields[] = {
1077 LABEL, TYPE, MACHINE, NAME, "mount", "access", "comments", "owner", "owners",
1078 "create", "lockertype", MOD1, MOD2, MOD3,
1081 static struct validate gfsg_validate = {
1093 static char *afil_fields[] = {
1094 LABEL, TYPE, MACHINE, NAME, "mount", "access", "comments", "owner", "owners",
1095 "create", "lockertype",
1098 static struct valobj afil_valobj[] = {
1100 {V_LOCK, 0, FILESYS, 0, FILSYS_ID, MR_DEADLOCK},
1101 {V_TYPE, 1, FILESYS, 0, 0, MR_FSTYPE},
1102 {V_ID, 2, MACHINE, NAME, MACH_ID, MR_MACHINE},
1104 {V_ID, 7, USERS, LOGIN, USERS_ID, MR_USER},
1105 {V_ID, 8, LIST, NAME, LIST_ID, MR_LIST},
1106 {V_TYPE, 10, "lockertype", 0, 0, MR_TYPE}
1109 static struct validate afil_validate = {
1113 "filesys.label = \"%s\"",
1118 set_filesys_modtime,
1121 static char *ufil_fields[] = {
1122 LABEL, "newlabel", TYPE, MACHINE, NAME, "mount", "access", "comments",
1123 "owner", "owners", "create", "lockertype",
1126 static struct valobj ufil_valobj[] = {
1127 {V_LOCK, 0, FILESYS, 0, FILSYS_ID, MR_DEADLOCK},
1128 {V_ID, 0, FILESYS, LABEL, FILSYS_ID, MR_FILESYS},
1129 {V_RENAME, 1, FILESYS, LABEL, FILSYS_ID, MR_NOT_UNIQUE},
1130 {V_TYPE, 2, FILESYS, 0, 0, MR_FSTYPE},
1131 {V_ID, 3, MACHINE, NAME, MACH_ID, MR_MACHINE},
1133 {V_ID, 8, USERS, LOGIN, USERS_ID, MR_USER},
1134 {V_ID, 9, LIST, NAME, LIST_ID, MR_LIST},
1135 {V_TYPE, 11, "lockertype", 0, 0, MR_TYPE}
1138 static struct validate ufil_validate = {
1142 "filesys.filsys_id = %d",
1147 set_filesys_modtime,
1150 static char *dfil_fields[] = {
1154 static struct valobj dfil_valobj[] = {
1155 {V_LOCK, 0, FILESYS, 0, FILSYS_ID, MR_DEADLOCK},
1156 {V_ID, 0, FILESYS, LABEL, FILSYS_ID, MR_FILESYS},
1159 static struct validate dfil_validate = {
1163 "filesys.filsys_id = %d",
1171 static char *gfgm_fields[] = {
1172 "fsgroup", FILESYS, "sortkey"
1175 static struct valobj gfgm_valobj[] = {
1176 {V_ID, 0, FILESYS, LABEL, FILSYS_ID, MR_FILESYS},
1181 static struct validate gfgm_validate = {
1193 static struct valobj aftg_valobj[] = {
1194 {V_LOCK, 0, FILESYS, 0, FILSYS_ID, MR_DEADLOCK},
1195 {V_ID, 0, FILESYS, LABEL, FILSYS_ID, MR_FILESYS},
1196 {V_ID, 1, FILESYS, LABEL, FILSYS_ID, MR_FILESYS},
1199 static struct validate aftg_validate = {
1203 "fsgroup.group_id = %d and fsgroup.filsys_id = %d",
1211 static char *ganf_fields[] = {
1212 MACHINE, DIR, DEVICE, STATUS, "allocated", "size", MOD1, MOD2, MOD3,
1215 static char *gnfp_fields[] = {
1217 MACHINE, DIR, DEVICE, STATUS, "allocated", "size", MOD1, MOD2, MOD3,
1220 static struct validate gnfp_validate = {
1232 static struct valobj anfp_valobj[] = {
1233 {V_ID, 0, MACHINE, NAME, MACH_ID, MR_MACHINE},
1237 static struct validate anfp_validate = {
1241 "nfsphys.mach_id = %d and nfsphys.dir = \"%s\"",
1246 set_nfsphys_modtime,
1249 static char *dnfp_fields[] = {
1253 static struct validate dnfp_validate = {
1257 "nfsphys.mach_id = %d and nfsphys.dir = \"%s\"",
1262 set_nfsphys_modtime,
1265 static char *gqot_fields[] = {
1266 FILESYS, TYPE, NAME,
1267 FILESYS, TYPE, NAME, QUOTA, DIR, MACHINE, MOD1, MOD2, MOD3,
1270 static struct valobj gqot_valobj[] = {
1271 {V_TYPE, 1, QUOTA_TYPE, 0, 0, MR_TYPE},
1272 {V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
1273 {V_SORT, 0, 0, 0, 0, 0},
1276 static struct validate gqot_validate = {
1288 static char *gqbf_fields[] = {
1290 FILESYS, TYPE, NAME, QUOTA, DIR, MACHINE, MOD1, MOD2, MOD3,
1293 static struct validate gqbf_validate = {
1305 static char *aqot_fields[] = {
1306 FILESYS, TYPE, NAME, QUOTA,
1309 static struct valobj aqot_valobj[] = {
1310 {V_LOCK, 0, FILESYS, 0, FILSYS_ID, MR_DEADLOCK},
1311 {V_ID, 0, FILESYS, LABEL, FILSYS_ID, MR_FILESYS},
1312 {V_TYPE, 1, QUOTA_TYPE, 0, 0, MR_TYPE},
1313 {V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
1316 static struct validate aqot_validate = {
1320 "quota.filsys_id = %d and quota.type = \"%s\" and quota.entity_id = %d",
1328 static struct validate uqot_validate = {
1332 "quota.filsys_id = %d and quota.type = \"%s\" and quota.entity_id = %d",
1340 static struct validate dqot_validate = {
1344 "quota.filsys_id = %d and quota.type = \"%s\" and quota.entity_id = %d",
1352 static char *gnfq_fields[] = {
1354 FILESYS, LOGIN, QUOTA, DIR, MACHINE, MOD1, MOD2, MOD3,
1357 static struct validate gnfq_validate = {
1369 static char *gnqp_fields[] = {
1371 FILESYS, LOGIN, QUOTA, DIR, MACHINE, MOD1, MOD2, MOD3,
1374 static char *anfq_fields[] = {
1375 FILESYS, LOGIN, QUOTA,
1378 static struct validate anfq_validate = {
1382 "quota.filsys_id = %d and quota.type = \"USER\" and quota.entity_id = %d",
1390 static struct validate unfq_validate = {
1394 "quota.filsys_id = %d and quota.type = \"USER\" and quota.entity_id = %d",
1402 static struct validate dnfq_validate = {
1406 "quota.filsys_id = %d and quota.entity_id = %d",
1414 static char *glin_fields[] = {
1416 NAME, "active", "public", "hidden", "maillist", "grouplist", "gid",
1417 ACE_TYPE, ACE_NAME, DESC, MOD1, MOD2, MOD3,
1420 static struct validate glin_validate = {
1427 access_vis_list_by_name,
1432 static char *alis_fields[] = {
1433 NAME, "active", "public", "hidden", "maillist", "grouplist", "gid",
1434 ACE_TYPE, ACE_NAME, DESC,
1437 static struct valobj alis_valobj[] = {
1438 {V_LOCK, 0, LIST, 0, LIST_ID, MR_DEADLOCK},
1440 {V_TYPE, 7, ACE_TYPE, 0, 0, MR_ACE},
1441 {V_TYPEDATA, 8, 0, 0, LIST_ID, MR_ACE},
1444 static struct validate alis_validate = {
1448 "list.name = \"%s\"",
1456 static char *ulis_fields[] = {
1458 "newname", "active", "public", "hidden", "maillist", "grouplist", "gid",
1459 ACE_TYPE, ACE_NAME, DESC,
1462 static struct valobj ulis_valobj[] = {
1463 {V_LOCK, 0, LIST, 0, LIST_ID, MR_DEADLOCK},
1464 {V_ID, 0, LIST, NAME, LIST_ID, MR_LIST},
1465 {V_RENAME, 1, LIST, NAME, LIST_ID, MR_NOT_UNIQUE},
1466 {V_TYPE, 8, ACE_TYPE, 0, 0, MR_ACE},
1467 {V_TYPEDATA, 9, 0, 0, LIST_ID, MR_ACE},
1470 static struct validate ulis_validate = {
1474 "list.list_id = %d",
1482 static char *dlis_fields[] = {
1486 static struct validate dlis_validate = {
1490 "list.list_id = %d",
1498 static char *amtl_fields[] = {
1499 "list_name", "member_type", "member_name",
1502 static struct valobj amtl_valobj[] = {
1503 {V_LOCK, 0, LIST, 0, LIST_ID, MR_DEADLOCK},
1504 {V_ID, 0, LIST, NAME, LIST_ID, MR_LIST},
1505 {V_TYPE, 1, "member", 0, 0, MR_TYPE},
1506 {V_TYPEDATA, 2, 0, 0, 0, MR_NO_MATCH},
1509 static struct validate amtl_validate =
1522 static struct validate dmfl_validate =
1532 delete_member_from_list,
1535 static char *gaus_fields[] = {
1537 "use_type", "use_name",
1540 static struct valobj gaus_valobj[] = {
1541 {V_TYPE, 0, "gaus", 0, 0, MR_TYPE},
1542 {V_TYPEDATA, 1, 0, 0, 0, MR_NO_MATCH},
1545 static struct validate gaus_validate = {
1557 static char *qgli_fields[] = {
1558 "active", "public", "hidden", "maillist", "grouplist",
1562 static struct valobj qgli_valobj[] = {
1563 {V_TYPE, 0, "boolean", 0, 0, MR_TYPE},
1564 {V_TYPE, 1, "boolean", 0, 0, MR_TYPE},
1565 {V_TYPE, 2, "boolean", 0, 0, MR_TYPE},
1566 {V_TYPE, 3, "boolean", 0, 0, MR_TYPE},
1567 {V_TYPE, 4, "boolean", 0, 0, MR_TYPE},
1570 static struct validate qgli_validate = {
1579 qualified_get_lists,
1582 static char *gmol_fields[] = {
1584 "member_type", "member_name",
1587 static struct validate gmol_validate = {
1594 access_visible_list,
1596 get_members_of_list,
1599 static char *glom_fields[] = {
1600 "member_type", "member_name",
1601 "list_name", "active", "public", "hidden", "maillist", "grouplist",
1604 static struct valobj glom_valobj[] = {
1605 {V_TYPE, 0, "rmember", 0, 0, MR_TYPE},
1606 {V_TYPEDATA, 1, 0, 0, 0, MR_NO_MATCH},
1610 static struct validate glom_validate = {
1619 get_lists_of_member,
1622 static char *cmol_fields[] = {
1627 static struct validate cmol_validate = {
1634 access_visible_list,
1636 count_members_of_list,
1639 static char *gzcl_fields[] = {
1641 CLASS, "xmt_type", "xmt_name", "sub_type", "sub_name",
1642 "iws_type", "iws_name", "iui_type", "iui_name", MOD1, MOD2, MOD3,
1645 static struct validate gzcl_validate = {
1657 static char *azcl_fields[] = {
1658 CLASS, "xmt_type", "xmt_name", "sub_type", "sub_name",
1659 "iws_type", "iws_name", "iui_type", "iui_name",
1662 static struct valobj azcl_valobj[] = {
1664 {V_TYPE, 1, ACE_TYPE, 0, 0, MR_ACE},
1665 {V_TYPEDATA, 2, 0, 0, LIST_ID, MR_ACE},
1666 {V_TYPE, 3, ACE_TYPE, 0, 0, MR_ACE},
1667 {V_TYPEDATA, 4, 0, 0, LIST_ID, MR_ACE},
1668 {V_TYPE, 5, ACE_TYPE, 0, 0, MR_ACE},
1669 {V_TYPEDATA, 6, 0, 0, LIST_ID, MR_ACE},
1670 {V_TYPE, 7, ACE_TYPE, 0, 0, MR_ACE},
1671 {V_TYPEDATA, 8, 0, 0, LIST_ID, MR_ACE},
1674 static struct validate azcl_validate = {
1678 "zephyr.class = \"%s\"",
1686 static char *uzcl_fields[] = {
1687 CLASS, "newclass", "xmt_type", "xmt_name", "sub_type", "sub_name",
1688 "iws_type", "iws_name", "iui_type", "iui_name",
1691 static struct valobj uzcl_valobj[] = {
1692 {V_RENAME, 1, "zephyr", CLASS, 0, MR_NOT_UNIQUE},
1693 {V_TYPE, 2, ACE_TYPE, 0, 0, MR_ACE},
1694 {V_TYPEDATA, 3, 0, 0, LIST_ID, MR_ACE},
1695 {V_TYPE, 4, ACE_TYPE, 0, 0, MR_ACE},
1696 {V_TYPEDATA, 5, 0, 0, LIST_ID, MR_ACE},
1697 {V_TYPE, 6, ACE_TYPE, 0, 0, MR_ACE},
1698 {V_TYPEDATA, 7, 0, 0, LIST_ID, MR_ACE},
1699 {V_TYPE, 8, ACE_TYPE, 0, 0, MR_ACE},
1700 {V_TYPEDATA, 9, 0, 0, LIST_ID, MR_ACE},
1703 static struct validate uzcl_validate = {
1707 "zephyr.class = \"%s\"",
1715 static struct validate dzcl_validate = {
1719 "zephyr.class = \"%s\"",
1727 static char *gsvc_fields[] = {
1729 SERVICE, "protocol", "port", DESC, MOD1, MOD2, MOD3
1732 static char *asvc_fields[] = {
1733 SERVICE, "protocol", "port", DESC
1736 static struct validate asvc_validate = {
1740 "services.name = \"%s\"",
1748 static char *gpce_fields[] = {
1750 "printer", "spooling_host", "spool_directory", "rprinter",
1751 "quotaserver", "authenticate", "price", "comments",
1755 static struct validate gpce_validate = {
1767 static char *apce_fields[] = {
1768 "printer", "spooling_host", "spool_directory", "rprinter",
1769 "quotaserver", "authenticate", "price", "comments",
1773 static struct valobj apce_valobj[] = {
1775 {V_ID, 1, MACHINE, NAME, MACH_ID, MR_MACHINE},
1776 {V_ID, 4, MACHINE, NAME, MACH_ID, MR_MACHINE},
1779 static struct validate apce_validate = {
1783 "printcap.name = \"%s\"",
1791 static struct validate dpce_validate = {
1795 "printcap.name = \"%s\"",
1803 static char *gpcp_fields[] = {
1805 "printer", "spooling_host", "spool_directory", "rprinter", "comments",
1809 static char *gpdm_fields[] = {
1811 NAME, "rpcnum", "host", MOD1, MOD2, MOD3,
1814 static char *apdm_fields[] = {
1815 NAME, "rpcnum", "host"
1818 static struct valobj apdm_valobj[] = {
1820 {V_ID, 2, MACHINE, NAME, MACH_ID, MR_MACHINE},
1823 static struct validate apdm_validate = {
1827 "palladium.name = \"%s\"",
1835 static struct validate dpdm_validate = {
1839 "palladium.name = \"%s\"",
1847 static char *gali_fields[] = {
1848 NAME, TYPE, "trans",
1849 NAME, TYPE, "trans",
1852 static char *aali_fields[] = {
1853 NAME, TYPE, "trans",
1856 static struct valobj aali_valobj[] = {
1858 {V_TYPE, 1, "alias", 0, 0, MR_TYPE},
1862 static struct validate aali_validate = {
1866 "alias.name = \"%s\" and alias.type = \"%s\" and alias.trans = \"%s\"",
1874 static struct validate dali_validate = /* DELETE_ALIAS */
1879 "alias.name = \"%s\" and alias.type = \"%s\" and alias.trans = \"%s\"",
1887 static char *gval_fields[] = {
1891 static struct valobj gval_valobj[] = {
1892 {V_NAME, 0, "numvalues", NAME, 0, MR_NO_MATCH},
1895 static struct validate gval_validate = {
1907 static char *aval_fields[] = {
1911 static struct validate aval_validate = /* for aval, uval, and dval */
1916 "numvalues.name = \"%s\"",
1924 static char *dval_fields[] = {
1928 static char *gats_fields[] = {
1929 "table_name", "retrieves", "appends", "updates", "deletes", MOD1, MOD2, MOD3,
1934 /* Generalized Query Definitions */
1936 struct query Queries2[] = {
1938 /* Q_GALO - GET_ALL_LOGINS */
1944 "login, text(uid), shell, last, first, middle FROM users",
1953 /* Q_GAAL - GET_ALL_ACTIVE_LOGINS */
1954 "get_all_active_logins",
1959 "login, text(uid), shell, last, first, middle FROM users",
1968 /* Q_GUBL - GET_USER_BY_LOGIN */
1969 "get_user_by_login",
1974 "login, text(uid), shell, last, first, middle, text(status), mit_id, mit_year, modtime, text(modby), modwith FROM users",
1977 "login = '%s' and users_id != 0",
1983 /* Q_GUBU - GET_USER_BY_UID */
1989 "login, text(uid), shell, last, first, middle, text(status), mit_id, mit_year, modtime, text(modby), modwith FROM users",
1992 "uid = %s and users_id != 0",
1998 /* Q_GUBN - GET_USER_BY_NAME */
2004 "login, text(uid), shell, last, first, middle, text(status), mit_id, mit_year, modtime, text(modby), modwith FROM users",
2007 "first = '%s' and last = '%s' and users_id != 0",
2013 /* Q_GUBC - GET_USER_BY_CLASS */
2014 "get_user_by_class",
2019 "login, text(uid), shell, last, first, middle, text(status), mit_id, mit_year, modtime, text(modby), modwith FROM users",
2022 "mit_year = uppercase('%s') and u.users_id != 0",
2028 /* Q_GUBM - GET_USER_BY_MITID */
2029 "get_user_by_mitid",
2034 "login, text(uid), shell, last, first, middle, text(status), mit_id, mit_year, modtime, text(modby), modwith FROM users",
2037 "mit_id = '%s' and users_id != 0",
2043 /* Q_AUSR - ADD_USER */ /** Needs subselect */
2049 "(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')",
2052 "numvalues.name = 'users_id'",
2058 /* Q_RUSR - REGISTER_USER */
2073 /* Q_UUSR - UPDATE_USER */
2079 "SET login = '%s', uid = %s, shell = '%s', last = '%s', first = '%s', middle = '%s', status = %s, mit_id = '%s', mit_year = '%s'",
2088 /* Q_UUSH - UPDATE_USER_SHELL */
2089 "update_user_shell",
2103 /* Q_UUST - UPDATE_USER_STATUS */
2104 "update_user_status",
2118 /* Q_DUSR - DELETE_USER */
2133 /* Q_DUBU - DELETE_USER_BY_UID */
2134 "delete_user_by_uid",
2148 /* Q_GKUM - GET_KERBEROS_USER_MAP */
2149 "get_kerberos_user_map",
2154 "users.login, strings.string",
2157 "users.login = '%s' and strings.string = '%s' and k.users_id = users.users_id and k.string_id = strings.string_id",
2163 /* Q_AKUM - ADD_KERBEROS_USER_MAP */
2164 "add_kerberos_user_map",
2169 "(users_id, string_id) VALUES (%s, %s)",
2178 /* Q_DKUM - DELETE_KERBEROS_USER_MAP */
2179 "delete_kerberos_user_map",
2187 "k.users_id = %d and k.string_id = %d",
2193 /* Q_GFBL - GET_FINGER_BY_LOGIN */
2194 "get_finger_by_login",
2199 "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",
2208 /* Q_UFBL - UPDATE_FINGER_BY_LOGIN */
2209 "update_finger_by_login",
2214 "SET fullname= '%s',nickname= '%s',home_addr= '%s',home_phone= '%s',office_addr= '%s',office_phone= '%s',mit_dept= '%s',mit_affil= '%s'",
2223 /* Q_GPOB - GET_POBOX */
2229 "u.login, u.potype, text(u.pop_id) + \":\" + text(u.box_id), u.pmodtime, text(u.pmodby), u.pmodwith",
2238 /* Q_GAPO - GET_ALL_POBOXES */
2244 "u.login, u.potype, text(u.pop_id) + \":\" + text(u.box_id)",
2247 "u.potype != 'NONE'",
2253 /* Q_GPOP - GET_POBOXES_POP */
2259 "u.login, u.potype, text(u.pop_id) + \":\" + text(u.box_id)",
2268 /* Q_GPOF - GET_POBOXES_SMTP */
2274 "u.login, u.potype, text(u.pop_id) + \":\" + text(u.box_id)",
2277 "u.potype = 'SMTP'",
2283 /* Q_SPOB - SET_POBOX */
2298 /* Q_SPOP - SET_POBOX_POP */
2304 "SET potype = 'POP'",
2313 /* Q_DPOB - DELETE_POBOX */
2319 "SET potype = 'NONE'",
2328 /* Q_GMAC - GET_MACHINE */
2334 "m.name, m.type, m.modtime, text(m.modby), m.modwith",
2337 "m.name = uppercase('%s') and m.mach_id != 0",
2343 /* Q_AMAC - ADD_MACHINE */
2349 "(name, mach_id, type) VALUES (uppercase('%s'),numvalues.value,'%s')",
2352 "numvalues.name = 'mach_id'",
2358 /* Q_UMAC - UPDATE_MACHINE */
2364 "SET name = uppercase('%s'), type = '%s'",
2373 /* Q_DMAC - DELETE_MACHINE */
2388 /* Q_GCLU - GET_CLUSTER */
2394 "c.name, c.desc, c.location, c.modtime, text(c.modby), c.modwith",
2397 "c.name = '%s' and c.clu_id != 0",
2403 /* Q_ACLU - ADD_CLUSTER */
2409 "(name, clu_id, desc, location) VALUES ('%s',numvalues.value,'%s','%s')",
2412 "numvalues.name = 'clu_id'",
2418 /* Q_UCLU - UPDATE_CLUSTER */
2424 "SET name = '%s', desc = '%s', location = '%s'",
2433 /* Q_DCLU - DELETE_CLUSTER */
2448 /* Q_GMCM - GET_MACHINE_TO_CLUSTER_MAP */
2449 "get_machine_to_cluster_map",
2454 "machine.name, cluster.name",
2457 "machine.name = uppercase('%s') and cluster.name = '%s' and m.clu_id = cluster.clu_id and m.mach_id = machine.mach_id",
2463 /* Q_AMTC - ADD_MACHINE_TO_CLUSTER */
2464 "add_machine_to_cluster",
2469 "(mach_id, clu_id) VALUES (%d, %d)",
2478 /* Q_DMFC - DELETE_MACHINE_FROM_CLUSTER */
2479 "delete_machine_from_cluster",
2487 "m.mach_id = %d and m.clu_id = %d",
2493 /* Q_GCLD - GET_CLUSTER_DATA */
2499 "cluster.name, s.serv_label, s.serv_cluster",
2502 "cluster.clu_id = s.clu_id and cluster.name = '%s' and s.serv_label = '%s'",
2508 /* Q_ACLD - ADD_CLUSTER_DATA */
2514 "(clu_id, serv_label, serv_cluster) VALUES (%d,'%s','%s')",
2523 /* Q_DCLD - DELETE_CLUSTER_DATA */
2524 "delete_cluster_data",
2532 "s.clu_id = %d and s.serv_label = '%s' and s.serv_cluster = '%s'",
2538 /* Q_GSIN - GET_SERVER_INFO */
2544 "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",
2547 "s.name = uppercase('%s')",
2553 /* Q_QGSV - QUALIFIED_GET_SERVER */
2554 "qualified_get_server",
2568 /* Q_ASIN - ADD_SERVER_INFO */
2574 "(name, update_int, target_file, script, type, enable, acl_type, acl_id) VALUES (uppercase('%s'),%s,'%s','%s','%s',%s,'%s',%d)",
2583 /* Q_USIN - UPDATE_SERVER_INFO */
2584 "update_server_info",
2589 "SET update_int = %s, target_file = '%s', script = '%s', type = '%s', enable = %s, acl_type = '%s', acl_id = %d",
2592 "s.name = uppercase('%s')",
2598 /* Q_RSVE - RESET_SERVER_ERROR */
2599 "reset_server_error",
2604 "SET harderror = 0, dfcheck = s.dfgen",
2607 "s.name = uppercase('%s')",
2613 /* Q_SSIF - SET_SERVER_INTERNAL_FLAGS */
2614 "set_server_internal_flags",
2619 "SET dfgen = %s, dfcheck = %s, inprogress = %s, harderror = %s, errmsg = '%s'",
2622 "s.name = uppercase('%s')",
2628 /* Q_DSIN - DELETE_SERVER_INFO */
2629 "delete_server_info",
2637 "s.name = uppercase('%s')",
2643 /* Q_GSHI - GET_SERVER_HOST_INFO */
2644 "get_server_host_info",
2649 "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",
2652 "sh.service = uppercase('%s') and machine.name = uppercase('%s') and machine.mach_id = sh.mach_id",
2658 /* Q_QGSV - QUALIFIED_GET_SERVER_HOST */
2659 "qualified_get_server_host",
2673 /* Q_ASHI - ADD_SERVER_HOST_INFO */
2674 "add_server_host_info",
2679 "(service, mach_id, enable, value1, value2, value3) VALUES (uppercase('%s'), %d, %s, %s, %s, '%s')",
2688 /* Q_USHI - UPDATE_SERVER_HOST_INFO */
2689 "update_server_host_info",
2694 "SET enable = %s, value1 = %s, value2 = %s, value3 = '%s'",
2697 "sh.service = uppercase('%s') and sh.mach_id = %d",
2703 /* Q_RSHE - RESET_SERVER_HOST_ERROR */
2704 "reset_server_host_error",
2709 "SET hosterror = 0",
2712 "sh.service = uppercase('%s') and sh.mach_id = %d",
2718 /* Q_SSHO - SET_SERVER_HOST_OVERRIDE */
2719 "set_server_host_override",
2727 "sh.service = uppercase('%s') and sh.mach_id = %d",
2733 /* Q_SSHI - SET_SERVER_HOST_INTERNAL */
2734 "set_server_host_internal",
2739 "SET override = %s, success = %s, inprogress = %s, hosterror = %s, hosterrmsg = '%s', ltt = %s, lts = %s",
2742 "s.service = uppercase('%s') and s.mach_id = machine.mach_id and machine.name = '%s'",
2748 /* Q_DSHI - DELETE_SERVER_HOST_INFO */
2749 "delete_server_host_info",
2757 "sh.service = uppercase('%s') and sh.mach_id = %d",
2763 /* Q_GSHA - GET_SERVER_HOST_ACCESS */
2764 "get_server_host_access",
2769 "machine.name, ha.acl_type, text(ha.acl_id), ha.modtime, text(ha.modby), ha.modwith",
2772 "machine.name = uppercase('%s') and ha.mach_id = machine.mach_id",
2778 /* Q_ASHA - ADD_SERVER_HOST_ACCESS */
2779 "add_server_host_access",
2784 "(mach_id,acl_type,acl_id) VALUES (%d,'%s',%d)",
2793 /* Q_USHA - UPDATE_SERVER_HOST_ACCESS */
2794 "update_server_host_access",
2799 "SET acl_type = '%s', acl_id = %d",
2808 /* Q_DSHA - DELETE_SERVER_HOST_ACCESS */
2809 "delete_server_host_access",
2823 /* Q_GSLO - GET_SERVER_LOCATIONS */
2824 "get_server_locations",
2829 "sh.service, machine.name",
2832 "sh.service = uppercase('%s') and sh.mach_id = machine.mach_id",
2838 /* Q_GFSL - GET_FILESYS_BY_LABEL */
2839 "get_filesys_by_label",
2844 "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",
2847 "fs.label = '%s' and fs.mach_id = machine.mach_id and fs.owner = users.users_id and fs.owners = list.list_id",
2853 /* Q_GFSM - GET_FILESYS_BY_MACHINE */
2854 "get_filesys_by_machine",
2859 "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",
2862 "fs.mach_id = %d and machine.mach_id = fs.mach_id and fs.owner = users.users_id and fs.owners = list.list_id",
2868 /* Q_GFSN - GET_FILESYS_BY_NFSPHYS */
2869 "get_filesys_by_nfsphys",
2874 "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",
2877 "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'",
2883 /* Q_GFSG - GET_FILESYS_BY_GROUP */
2884 "get_filesys_by_group",
2889 "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",
2892 "fs.owners = %d and machine.mach_id = fs.mach_id and fs.owner = users.users_id and fs.owners = list.list_id",
2898 /* Q_AFIL - ADD_FILESYS */
2904 "(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')",
2907 "numvalues.name = 'filsys_id'",
2913 /* Q_UFIL - UPDATE_FILESYS */
2919 "SET label = '%s', type = '%s', mach_id = %d, name = '%s', mount = '%s', access = '%s', comments = '%s', owner = %d, owners = %d, createflg = %s, lockertype = '%s'",
2922 "fs.filsys_id = %d",
2928 /* Q_DFIL - DELETE_FILESYS */
2937 "fs.filsys_id = %d",
2943 /* Q_GFGM - GET_FSGROUOP_MEMBERS */
2944 "get_fsgroup_members",
2949 "filesys.label, fg.key",
2952 "fg.group_id = %d and filesys.filsys_id = fg.filsys_id",
2958 /* Q_AFTG - ADD_FILESYS_TO_FSGROUP */
2959 "add_filesys_to_fsgroup",
2964 "(group_id,filsys_id,key) VALUES (filesys.filsys_id, %d, '%s')",
2967 "filesys.filsys_id = %d and filesys.type = 'FSGROUP'",
2973 /* Q_RFFG - REMOVE_FILESYS_FROM_FSGROUP */
2974 "remove_filesys_from_fsgroup",
2982 "fg.group_id = %d and fg.filsys_id = %d",
2988 /* Q_GANF - GET_ALL_NFSPHYS */
2994 "machine.name, np.dir, np.device, text(np.status), text(np.allocated), text(np.size), np.modtime, text(np.modby), np.modwith",
2997 "machine.mach_id = np.mach_id",
3003 /* Q_GNFP - GET_NFSPHYS */
3009 "machine.name, np.dir, np.device, text(np.status), text(np.allocated), text(np.size), np.modtime, text(np.modby), np.modwith",
3012 "np.mach_id = %d and np.dir = '%s' and machine.mach_id = np.mach_id",
3018 /* Q_ANFP - ADD_NFSPHYS */
3024 "(nfsphys_id, mach_id, dir, device, status, allocated, size) VALUES (numvalues.value, %d, '%s', '%s', %s, %s, %s)",
3027 "numvalues.name = 'nfsphys_id'",
3033 /* Q_UNFP - UPDATE_NFSPHYS */
3039 "SET device = '%s', status = '%s', allocated = %s, size = %s",
3042 "np.mach_id = %d and np.dir = '%s'",
3048 /* Q_AJNF - ADJUST_NFSPHYS_ALLOCATION */
3049 "adjust_nfsphys_allocation",
3054 "SET np.allocated = np.allocated + %s",
3057 "np.mach_id = %d and np.dir = '%s'",
3063 /* Q_DNFP - DELETE_NFSPHYS */
3072 "np.mach_id = %d and np.dir = '%s'",
3078 /* Q_GQOT - GET_QUOTA */
3084 "filesys.label, q.type, text(q.entity_id), text(q.quota), text(q.phys_id), machine.name, q.modtime, text(q.modby), q.modwith",
3087 "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",
3093 /* Q_GQBF - GET_QUOTA_BY_FILESYS */
3094 "get_quota_by_filesys",
3099 "filesys.label, q.type, text(q.entity_id), text(q.quota), text(q.phys_id), machine.name, q.modtime, text(q.modby), q.modwith",
3102 "filesys.label = '%s' and filesys.filsys_id = q.filsys_id and machine.mach_id = filesys.mach_id",
3108 /* Q_AQOT - ADD_QUOTA */
3114 "(filsys_id, type, entity_id, quota, phys_id) VALUES (filesys.filsys_id, '%s', %d, %s, filesys.phys_id)",
3117 "filesys.filsys_id = %d",
3123 /* Q_UQOT - UPDATE_QUOTA */
3132 "q.filsys_id = %d and q.type = '%s' and q.entity_id = %d",
3138 /* Q_DQOT - DELETE_QUOTA */
3147 "q.filsys_id = %d and q.type = '%s' and q.entity_id = %d",
3153 /* Q_GNFQ - GET_NFS_QUOTAS */
3159 "filesys.label, users.login, text(q.quota), text(q.phys_id), machine.name, q.modtime, text(q.modby), q.modwith",
3162 "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'",
3168 /* Q_GNQP - GET_NFS_QUOTAS_BY_PARTITION */
3169 "get_nfs_quotas_by_partition",
3174 "filesys.label, users.login, text(q.quota), nfsphys.dir, machine.name",
3177 "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",
3183 /* Q_ANFQ - ADD_NFS_QUOTA */
3189 "(filsys_id, type, entity_id, quota, phys_id) VALUES (filesys.filsys_id, 'USER', %d, %s, filesys.phys_id)",
3192 "filesys.filsys_id = %d",
3198 /* Q_UNFQ - UPDATE_NFS_QUOTA */
3207 "q.filsys_id = %d and q.type = 'USER' and q.entity_id = %d",
3213 /* Q_DNFQ - DELETE_NFS_QUOTA */
3222 "q.filsys_id = %d and q.type = 'USER' and q.entity_id = %d",
3228 /* Q_GLIN - GET_LIST_INFO */
3243 /* Q_EXLN - EXPAND_LIST_NAMES */
3244 "expand_list_names",
3252 "list.name = '%s' and list.list_id != 0",
3258 /* Q_ALIS - ADD_LIST */
3264 "(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')",
3267 "numvalues.name = 'list_id'",
3273 /* Q_ULIS - UPDATE_LIST */
3279 "SET name='%s', active=%s, public=%s, hidden=%s, maillist=%s, grouplist=%s, gid=%s, acl_type='%s', acl_id=%d, desc='%s'",
3282 "list.list_id = %d",
3288 /* Q_DLIS - DELETE_LIST */
3297 "list.list_id = %d",
3303 /* Q_AMTL - ADD_MEMBER_TO_LIST */
3304 "add_member_to_list",
3318 /* Q_DMFL - DELETE_MEMBER_FROM_LIST */
3319 "delete_member_from_list",
3333 /* Q_GAUS - GET_ACE_USE */
3348 /* Q_QGLI - QUALIFIED_GET_LISTS */
3349 "qualified_get_lists",
3363 /* Q_GMOL - GET_MEMBERS_OF_LIST */
3364 "get_members_of_list",
3378 /* Q_GLOM - GET_LISTS_OF_MEMBER */
3379 "get_lists_of_member",
3393 /* Q_CMOL - COUNT_MEMBERS_OF_LIST */
3394 "count_members_of_list",
3408 /* Q_GZCL - GET_ZEPHYR_CLASS */
3414 "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",
3423 /* Q_AZCL - ADD_ZEPHYR_CLASS */
3429 "(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)",
3438 /* Q_UZCL - UPDATE_ZEPHYR_CLASS */
3439 "update_zephyr_class",
3444 "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",
3453 /* Q_DZCL - DELETE_ZEPHYR_CLASS */
3454 "delete_zephyr_class",
3468 /* Q_GSVC - GET_SERVICE */
3474 "s.name, s.protocol, text(s.port), s.desc, s.modtime, text(s.modby), s.modwith",
3483 /* Q_ASVC - ADD_SERVICE */
3489 "(name, protocol, port, desc) VALUES ('%s','%s',%s,'%s')",
3498 /* Q_DSVC - DELETE_SERVICE */
3513 /* Q_GPCE - GET_PRINTCAP_ENTRY */
3514 "get_printcap_entry",
3519 "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",
3522 "p.name = '%s' and machine.mach_id = p.mach_id",
3528 /* Q_APCE - ADD_PRINTCAP_ENTRY */
3529 "add_printcap_entry",
3534 "(name, mach_id, dir, rp, quotaserver, auth, price, comments) VALUES ('%s',%d,'%s','%s',%d,%s,%s,'%s')",
3543 /* Q_DPCE - DELETE_PRINTCAP_ENTRY */
3544 "delete_printcap_entry",
3558 /* Q_GPCP - GET_PRINTCAP */
3564 "p.name, machine.name, p.dir, p.rp, p.comments, p.modtime, text(p.modby), p.modwith",
3567 "p.name = '%s' and machine.mach_id = p.mach_id",
3573 /* Q_DPCP - DELETE_PRINTCAP */
3588 /* Q_GPDM - GET_PALLADIUM */
3594 "p.name, text(p.ident), machine.name, p.modtime, text(p.modby), p.modwith",
3597 "p.name = '%s' and machine.mach_id = p.mach_id",
3603 /* Q_APDM - ADD_PALLADIUM */
3609 "(name, ident, mach_id) VALUES ('%s',%s,%d)",
3618 /* Q_DPDM - DELETE_PALLADIUM */
3633 /* Q_GALI - GET_ALIAS */
3639 "a.name, a.type, a.trans",
3642 "a.name = '%s' and a.type = '%s' and a.trans = '%s'",
3648 /* Q_AALI - ADD_ALIAS */
3654 "(name, type, trans) VALUES ('%s', '%s', '%s')",
3663 /* Q_DALI - DELETE_ALIAS */
3672 "a.name = '%s' and a.type = '%s' and a.trans = '%s'",
3678 /* Q_GVAL - GET_VALUE */
3693 /* Q_AVAL - ADD_VALUE */
3699 "(name, value) VALUES ('%s', %s)",
3708 /* Q_UVAL - UPDATE_VALUE */
3723 /* Q_DVAL - DELETE_VALUE */
3738 /* Q_GATS - GET_ALL_TABLE_STATS */
3739 "get_all_table_stats",
3744 "tbs.table_name, text(tbs.retrieves), text(tbs.appends), text(tbs.updates), text(tbs.deletes), tbs.modtime",
3754 int QueryCount2 = (sizeof Queries2 / sizeof (struct query));