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();
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();
71 int add_member_to_list();
72 int delete_member_from_list();
74 int qualified_get_lists();
75 int get_members_of_list();
76 int qualified_get_server();
77 int qualified_get_serverhost();
79 int count_members_of_list();
80 int get_lists_of_member();
86 * These are commonly used strings in the table, defined here so that
90 static char ACE_NAME[] = "ace_name";
91 static char ACE_TYPE[] = "ace_type";
92 static char CLASS[] = "class";
93 static char CLU_ID[] = "clu_id";
94 static char CLUSTER[] = "cluster";
95 static char DESC[] = "description";
96 static char DEVICE[] = "device";
97 static char DIR[] = "dir";
98 static char FILESYS[] = "filesys";
99 static char FILSYS_ID[] = "filsys_id";
100 static char FIRST[] = "firstname";
101 static char LABEL[] = "label";
102 static char LAST[] = "lastname";
103 static char LIST[] = "list";
104 static char LIST_ID[] = "list_id";
105 static char LOCATION[] = "location";
106 static char LOGIN[] = "login";
107 static char MACH_ID[] = "mach_id";
108 static char MACHINE[] = "machine";
109 static char MIDDLE[] = "middle";
110 static char MIT_ID[] = "mit_id";
111 static char MOD1[] = "modtime";
112 static char MOD2[] = "modby";
113 static char MOD3[] = "modwith";
114 static char NAME[] = "name";
115 static char SERVICE[] = "service";
116 static char SHELL[] = "shell";
117 static char STATUS[] = "status";
118 static char TYPE[] = "type";
119 static char USERS[] = "users";
120 static char USERS_ID[] = "users_id";
121 static char UID[] = "uid";
126 * These are commonly used validation objects, defined here so that they
130 static struct valobj VOsort0[] = {
131 {V_SORT, 0, 0, 0, 0, 0},
134 static struct valobj VOdate1[] = {
135 {V_DATE, 1, 0, 0, 0, SMS_DATE},
138 static struct valobj VOuser0[] = {
139 {V_ID, 0, USERS, LOGIN, USERS_ID, SMS_USER},
142 static struct valobj VOuser0lock[] = {
143 {V_LOCK, 0, USERS, 0, USERS_ID, SMS_DEADLOCK},
144 {V_ID, 0, USERS, LOGIN, USERS_ID, SMS_USER},
147 static struct valobj VOmach0[] = {
148 {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE},
151 static struct valobj VOclu0[] = {
152 {V_ID, 0, CLUSTER, NAME, CLU_ID, SMS_CLUSTER},
155 static struct valobj VOlist0[] = {
156 {V_ID, 0, LIST, NAME, LIST_ID, SMS_LIST},
159 static struct valobj VOfilsys0[] = {
160 {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
163 static struct valobj VOchar0[] = {
167 static struct valobj VOsort01[] = {
172 static struct valobj VOuser0sort[] = {
173 {V_ID, 0, USERS, LOGIN, USERS_ID, SMS_USER},
177 static struct valobj VOfilsys0user1[] = {
178 {V_LOCK, 0, FILESYS, 0, FILSYS_ID, SMS_DEADLOCK},
179 {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
180 {V_ID, 1, USERS, LOGIN, USERS_ID, SMS_USER},
185 * Commonly used validation records defined here so that they may
189 static struct validate VDmach = { VOmach0, 1 };
190 static struct validate VDsort2= { VOsort01,2 };
191 static struct validate VDsortf = {
207 static char *galo_fields[] = {
208 LOGIN, UID, SHELL, LAST, FIRST, MIDDLE,
211 static char *gubl_fields[] = {
213 LOGIN, UID, SHELL, LAST, FIRST, MIDDLE, STATUS,
214 MIT_ID, CLASS, MOD1, MOD2, MOD3
217 static struct validate gubx_validate = /* gubl, gubu */
230 static char *gubu_fields[] = {
232 LOGIN, UID, SHELL, LAST, FIRST, MIDDLE, STATUS,
233 MIT_ID, CLASS, MOD1, MOD2, MOD3,
236 static char *gubn_fields[] = {
238 LOGIN, UID, SHELL, LAST, FIRST, MIDDLE, STATUS,
239 MIT_ID, CLASS, MOD1, MOD2, MOD3,
242 static char *gubc_fields[] = {
244 LOGIN, UID, SHELL, LAST, FIRST, MIDDLE, STATUS,
245 MIT_ID, CLASS, MOD1, MOD2, MOD3,
248 static char *gubm_fields[] = {
250 LOGIN, UID, SHELL, LAST, FIRST, MIDDLE, STATUS,
251 MIT_ID, CLASS, MOD1, MOD2, MOD3,
254 static char *ausr_fields[] = {
255 LOGIN, UID, SHELL, LAST, FIRST, MIDDLE, STATUS,
259 static struct valobj ausr_valobj[] = {
260 {V_LOCK, 0, USERS, 0, USERS_ID, SMS_DEADLOCK},
266 {V_TYPE, 8, CLASS, 0, 0, SMS_BAD_CLASS},
269 static struct validate ausr_validate = {
281 static char *rusr_fields[] = {
282 UID, LOGIN, "fs_type"
285 static struct validate rusr_validate = {
297 static char *uusr_fields[] = {
299 "newlogin", UID, SHELL, LAST, FIRST, MIDDLE, STATUS,
303 static struct valobj uusr_valobj[] = {
304 {V_LOCK, 0, USERS, 0, USERS_ID, SMS_DEADLOCK},
305 {V_ID, 0, USERS, LOGIN, USERS_ID, SMS_USER},
306 {V_RENAME, 1, USERS, LOGIN, USERS_ID, SMS_NOT_UNIQUE},
311 {V_TYPE, 9, CLASS, 0, 0, SMS_BAD_CLASS},
314 static struct validate uusr_validate = {
326 static char *uush_fields[] = {
331 static struct validate uush_validate = {
343 static char *uust_fields[] = {
348 static struct validate uust_validate = {
360 static char *dusr_fields[] = {
364 static struct validate dusr_validate = {
376 static char *dubu_fields[] = {
380 static struct valobj dubu_valobj[] = {
381 {V_LOCK, 0, USERS, 0, USERS_ID, SMS_DEADLOCK},
382 {V_ID, 0, USERS, UID, USERS_ID, SMS_USER}
385 static struct validate dubu_validate = {
397 static char *gkum_fields[] = { LOGIN, "kerberos",
400 static char *akum_fields[] = { LOGIN, "kerberos" };
402 static struct valobj akum_valobj[] =
404 {V_ID, 0, USERS, LOGIN, USERS_ID, SMS_USER},
405 {V_ID, 1, "strings", "string", "string_id", SMS_NO_MATCH},
408 static struct validate akum_validate =
413 "k.users_id = %d or k.string_id = %d",
421 static struct validate dkum_validate =
426 "k.users_id = %d and k.string_id = %d",
434 static char *gfbl_fields[] = {
436 LOGIN, "fullname", "nickname", "home_addr",
437 "home_phone", "office_address", "office_phone", "mit_dept",
438 "mit_affil", MOD1, MOD2, MOD3,
441 static struct validate gfbl_validate = {
453 static char *ufbl_fields[] = {
455 "fullname", "nickname", "home_addr",
456 "home_phone", "office_address", "office_phone", "mit_dept",
460 static struct validate ufbl_validate = {
472 static char *gpob_fields[] = {
474 LOGIN, TYPE, "box", MOD1, MOD2, MOD3,
477 static struct validate gpob_validate = {
481 "u.potype != \"NONE\" and u.users_id=%d",
489 static char *gpox_fields[] = {
493 static struct validate gpox_validate = {
505 static char *spob_fields[] = {
509 static struct valobj spob_valobj[] = {
510 {V_LOCK, 0, USERS, 0, USERS_ID, SMS_DEADLOCK},
511 {V_ID, 0, USERS, LOGIN, USERS_ID, SMS_USER},
512 {V_TYPE, 1, "pobox", 0, 0, SMS_TYPE},
515 static struct validate spob_validate = /* SET_POBOX */
528 static struct validate spop_validate = /* SET_POBOX_POP */
541 static struct validate dpob_validate = /* DELETE_POBOX */
554 static char *gmac_fields[] = {
556 NAME, TYPE, MOD1, MOD2, MOD3,
559 static char *amac_fields[] = {
563 static struct valobj amac_valobj[] = {
565 {V_LOCK, 0, MACHINE, 0, MACH_ID, SMS_DEADLOCK},
566 {V_TYPE, 1, "mac_type", 0, 0, SMS_TYPE},
569 static struct validate amac_validate = {
573 "m.name = uppercase(\"%s\")",
578 set_uppercase_modtime,
581 static char *umac_fields[] = {
586 static struct valobj umac_valobj[] = {
587 {V_LOCK, 0, MACHINE, 0, MACH_ID, SMS_DEADLOCK},
588 {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE},
589 {V_RENAME, 1, MACHINE, NAME, MACH_ID, SMS_NOT_UNIQUE},
590 {V_TYPE, 2, "mac_type", 0, 0, SMS_TYPE},
593 static struct validate umac_validate = {
605 static char *dmac_fields[] = {
609 static struct valobj dmac_valobj[] = {
610 {V_LOCK, 0, MACHINE, 0, MACH_ID, SMS_DEADLOCK},
611 {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE},
614 static struct validate dmac_validate = {
626 static char *gclu_fields[] = {
628 NAME, DESC, LOCATION, MOD1, MOD2, MOD3,
631 static char *aclu_fields[] = {
632 NAME, DESC, LOCATION,
635 static struct valobj aclu_valobj[] = {
636 {V_LOCK, 0, CLUSTER, 0, CLU_ID, SMS_DEADLOCK},
640 static struct validate aclu_validate = /* for aclu */
653 static char *uclu_fields[] = {
655 "newname", DESC, LOCATION,
658 static struct valobj uclu_valobj[] = {
659 {V_LOCK, 0, CLUSTER, 0, CLU_ID, SMS_DEADLOCK},
660 {V_ID, 0, CLUSTER, NAME, CLU_ID, SMS_CLUSTER},
661 {V_RENAME, 1, CLUSTER, NAME, CLU_ID, SMS_NOT_UNIQUE},
664 static struct validate uclu_validate = {
676 static char *dclu_fields[] = {
680 static struct validate dclu_validate = {
692 static char *gmcm_fields[] = {
697 static struct valobj amtc_valobj[] = /* ADD_MACHINE_TO_CLUSTER */
698 { /* DELETE_MACHINE_FROM_CLUSTER */
699 {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE},
700 {V_ID, 1, CLUSTER, NAME, CLU_ID, SMS_CLUSTER},
703 static struct validate amtc_validate = /* for amtc and dmfc */
708 "m.mach_id = %d and m.clu_id = %d",
713 set_mach_modtime_by_id,
716 static char *gcld_fields[] = {
717 CLUSTER, "serv_label",
718 CLUSTER, "serv_label", "serv_cluster",
721 static char *acld_fields[] = {
722 CLUSTER, "serv_label", "serv_cluster",
725 static struct valobj acld_valobj[] =
727 {V_ID, 0, CLUSTER, NAME, CLU_ID, SMS_CLUSTER},
731 static struct validate acld_validate = /* ADD_CLUSTER_DATA */
732 { /* DELETE_CLUSTER_DATA */
736 "s.clu_id = %d and s.serv_label = \"%s\" and s.serv_cluster = \"%s\"",
741 set_cluster_modtime_by_id,
744 static char *gsin_fields[] = {
746 SERVICE, "update_int", "target_file", "script", "dfgen", "dfcheck",
747 TYPE, "enable", "inprogress", "harderror", "errmsg",
748 ACE_TYPE, ACE_NAME, MOD1, MOD2, MOD3,
751 static struct validate gsin_validate =
764 static char *qgsv_fields[] = {
765 "enable", "inprogress", "harderror",
769 static struct valobj qgsv_valobj[] = {
770 {V_TYPE, 0, "boolean", 0, 0, SMS_TYPE},
771 {V_TYPE, 1, "boolean", 0, 0, SMS_TYPE},
772 {V_TYPE, 2, "boolean", 0, 0, SMS_TYPE},
775 static struct validate qgsv_validate = {
784 qualified_get_server,
787 static char *asin_fields[] = {
788 SERVICE, "update_int", "target_file", "script", TYPE, "enable",
792 static struct valobj asin_valobj[] = {
793 {V_LOCK, 0, MACHINE, 0, MACH_ID, SMS_DEADLOCK},
795 {V_TYPE, 4, "service", 0, 0, SMS_TYPE},
796 {V_TYPE, 6, ACE_TYPE, 0, 0, SMS_ACE},
797 {V_TYPEDATA, 7, 0, 0, 0, SMS_ACE},
800 static struct validate asin_validate = /* for asin, usin */
805 "s.name = uppercase(\"%s\")",
810 set_uppercase_modtime,
813 static struct validate rsve_validate = {
817 "s.name = uppercase(\"%s\")",
822 set_uppercase_modtime,
825 static char *ssif_fields[] = {
826 SERVICE, "dfgen", "dfcheck", "inprogress", "harderror", "errmsg",
829 static struct validate ssif_validate = {
833 "s.name = uppercase(\"%s\")",
841 static char *dsin_fields[] = {
845 static struct validate dsin_validate = {
849 "s.name = uppercase(\"%s\")",
857 static char *gshi_fields[] = {
859 SERVICE, MACHINE, "enable", "override", "success", "inprogress",
860 "hosterror", "hosterrormsg", "ltt", "lts", "value1", "value2",
861 "value3", MOD1, MOD2, MOD3,
864 static struct validate gshi_validate = {
876 static char *qgsh_fields[] = {
877 "service", "enable", "override", "success", "inprogress", "hosterror",
881 static struct valobj qgsh_valobj[] = {
882 {V_TYPE, 1, "boolean", 0, 0, SMS_TYPE},
883 {V_TYPE, 2, "boolean", 0, 0, SMS_TYPE},
884 {V_TYPE, 3, "boolean", 0, 0, SMS_TYPE},
885 {V_TYPE, 4, "boolean", 0, 0, SMS_TYPE},
886 {V_TYPE, 5, "boolean", 0, 0, SMS_TYPE},
889 static struct validate qgsh_validate = {
898 qualified_get_serverhost,
901 static char *ashi_fields[] = {
902 SERVICE, MACHINE, "enable", "value1", "value2", "value3",
905 static struct valobj ashi_valobj[] = {
906 {V_LOCK, 0, MACHINE, 0, MACH_ID, SMS_DEADLOCK},
907 {V_NAME, 0, "servers", NAME, 0, SMS_SERVICE},
908 {V_ID, 1, MACHINE, NAME, MACH_ID, SMS_MACHINE},
911 static struct validate ashi_validate = /* ashi & ushi */
916 "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
921 set_serverhost_modtime,
924 static struct validate rshe_validate =
929 "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
934 set_serverhost_modtime,
937 static struct validate ssho_validate =
942 "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
950 static char *sshi_fields[] = {
951 "service", MACHINE, "override", "success", "inprogress",
952 "hosterror", "errmsg", "ltt", "lts"
955 static struct valobj sshi_valobj[] = {
956 {V_NAME, 0, "servers", NAME, 0, SMS_SERVICE},
959 static struct validate sshi_validate =
972 static char *dshi_fields[] = {
976 static struct validate dshi_validate =
981 "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
989 static char *gsha_fields[] = {
991 MACHINE, ACE_TYPE, ACE_NAME, MOD1, MOD2, MOD3,
994 static struct validate gsha_validate =
1007 static char *asha_fields[] = {
1008 MACHINE, ACE_TYPE, ACE_NAME,
1011 static struct valobj asha_valobj[] = {
1012 {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE},
1013 {V_TYPE, 1, ACE_TYPE, 0, 0, SMS_ACE},
1014 {V_TYPEDATA, 2, 0, 0, 0, SMS_ACE},
1017 static struct validate asha_validate =
1030 static char *gslo_fields[] = {
1035 static char *gfsl_fields[] = {
1037 LABEL, TYPE, MACHINE, NAME, "mount", "access", "comments", "owner", "owners",
1038 "create", "lockertype", MOD1, MOD2, MOD3,
1041 static char *gfsm_fields[] = {
1043 LABEL, TYPE, MACHINE, NAME, "mount", "access", "comments", "owner", "owners",
1044 "create", "lockertype", MOD1, MOD2, MOD3,
1047 static struct validate gfsm_validate = {
1059 static char *gfsn_fields[] = {
1060 MACHINE, "parition",
1061 LABEL, TYPE, MACHINE, NAME, "mount", "access", "comments", "owner", "owners",
1062 "create", "lockertype", MOD1, MOD2, MOD3,
1065 static char *gfsg_fields[] = {
1067 LABEL, TYPE, MACHINE, NAME, "mount", "access", "comments", "owner", "owners",
1068 "create", "lockertype", MOD1, MOD2, MOD3,
1071 static struct validate gfsg_validate = {
1083 static char *afil_fields[] = {
1084 LABEL, TYPE, MACHINE, NAME, "mount", "access", "comments", "owner", "owners",
1085 "create", "lockertype",
1088 static struct valobj afil_valobj[] = {
1090 {V_LOCK, 0, FILESYS, 0, FILSYS_ID, SMS_DEADLOCK},
1091 {V_TYPE, 1, FILESYS, 0, 0, SMS_FSTYPE},
1092 {V_ID, 2, MACHINE, NAME, MACH_ID, SMS_MACHINE},
1094 {V_ID, 7, USERS, LOGIN, USERS_ID, SMS_USER},
1095 {V_ID, 8, LIST, NAME, LIST_ID, SMS_LIST},
1096 {V_TYPE, 10, "lockertype", 0, 0, SMS_TYPE}
1099 static struct validate afil_validate = {
1103 "fs.label = \"%s\"",
1108 set_filesys_modtime,
1111 static char *ufil_fields[] = {
1112 LABEL, "newlabel", TYPE, MACHINE, NAME, "mount", "access", "comments",
1113 "owner", "owners", "create", "lockertype",
1116 static struct valobj ufil_valobj[] = {
1117 {V_LOCK, 0, FILESYS, 0, FILSYS_ID, SMS_DEADLOCK},
1118 {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
1119 {V_RENAME, 1, FILESYS, LABEL, FILSYS_ID, SMS_NOT_UNIQUE},
1120 {V_TYPE, 2, FILESYS, 0, 0, SMS_FSTYPE},
1121 {V_ID, 3, MACHINE, NAME, MACH_ID, SMS_MACHINE},
1123 {V_ID, 8, USERS, LOGIN, USERS_ID, SMS_USER},
1124 {V_ID, 9, LIST, NAME, LIST_ID, SMS_LIST},
1125 {V_TYPE, 11, "lockertype", 0, 0, SMS_TYPE}
1128 static struct validate ufil_validate = {
1132 "fs.filsys_id = %d",
1137 set_filesys_modtime,
1140 static char *dfil_fields[] = {
1144 static struct valobj dfil_valobj[] = {
1145 {V_LOCK, 0, FILESYS, 0, FILSYS_ID, SMS_DEADLOCK},
1146 {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
1149 static struct validate dfil_validate = {
1153 "fs.filsys_id = %d",
1161 static char *gfgm_fields[] = {
1162 "fsgroup", FILESYS, "sortkey"
1165 static struct valobj gfgm_valobj[] = {
1166 {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
1171 static struct validate gfgm_validate = {
1183 static struct valobj aftg_valobj[] = {
1184 {V_LOCK, 0, FILESYS, 0, FILSYS_ID, SMS_DEADLOCK},
1185 {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
1186 {V_ID, 1, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
1189 static struct validate aftg_validate = {
1193 "fg.group_id = %d and fg.filsys_id = %d",
1201 static char *ganf_fields[] = {
1202 MACHINE, DIR, DEVICE, STATUS, "allocated", "size", MOD1, MOD2, MOD3,
1205 static char *gnfp_fields[] = {
1207 MACHINE, DIR, DEVICE, STATUS, "allocated", "size", MOD1, MOD2, MOD3,
1210 static struct validate gnfp_validate = {
1222 static struct valobj anfp_valobj[] = {
1223 {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE},
1227 static struct validate anfp_validate = {
1231 "np.mach_id = %d and np.dir = \"%s\"",
1236 set_nfsphys_modtime,
1239 static char *dnfp_fields[] = {
1243 static struct validate dnfp_validate = {
1247 "np.mach_id = %d and np.dir = \"%s\"",
1252 set_nfsphys_modtime,
1255 static char *gnfq_fields[] = {
1257 FILESYS, LOGIN, "quota", DIR, MACHINE, MOD1, MOD2, MOD3,
1260 static struct valobj gnfq_valobj[] = {
1261 {V_ID, 1, USERS, LOGIN, USERS_ID, SMS_USER},
1265 static struct validate gnfq_validate = {
1277 static char *gnqp_fields[] = {
1279 FILESYS, LOGIN, "quota", DIR, MACHINE, MOD1, MOD2, MOD3,
1282 static char *anfq_fields[] = {
1283 FILESYS, LOGIN, "quota",
1286 static struct validate anfq_validate = {
1290 "nq.filsys_id = %d and nq.users_id = %d",
1298 static struct validate unfq_validate = {
1302 "nq.filsys_id = %d and nq.users_id = %d",
1310 static struct validate dnfq_validate = {
1314 "nq.filsys_id = %d and nq.users_id = %d",
1322 static char *glin_fields[] = {
1324 NAME, "active", "public", "hidden", "maillist", "group", "gid",
1325 ACE_TYPE, ACE_NAME, DESC, MOD1, MOD2, MOD3,
1328 static struct validate glin_validate = {
1335 access_vis_list_by_name,
1340 static char *alis_fields[] = {
1341 NAME, "active", "public", "hidden", "maillist", "group", "gid",
1342 ACE_TYPE, ACE_NAME, DESC,
1345 static struct valobj alis_valobj[] = {
1346 {V_LOCK, 0, LIST, 0, LIST_ID, SMS_DEADLOCK},
1348 {V_TYPE, 7, ACE_TYPE, 0, 0, SMS_ACE},
1349 {V_TYPEDATA, 8, 0, 0, LIST_ID, SMS_ACE},
1352 static struct validate alis_validate = {
1364 static char *ulis_fields[] = {
1366 "newname", "active", "public", "hidden", "maillist", "group", "gid",
1367 ACE_TYPE, ACE_NAME, DESC,
1370 static struct valobj ulis_valobj[] = {
1371 {V_LOCK, 0, LIST, 0, LIST_ID, SMS_DEADLOCK},
1372 {V_ID, 0, LIST, NAME, LIST_ID, SMS_LIST},
1373 {V_RENAME, 1, LIST, NAME, LIST_ID, SMS_NOT_UNIQUE},
1374 {V_TYPE, 8, ACE_TYPE, 0, 0, SMS_ACE},
1375 {V_TYPEDATA, 9, 0, 0, LIST_ID, SMS_ACE},
1378 static struct validate ulis_validate = {
1390 static char *dlis_fields[] = {
1394 static struct validate dlis_validate = {
1406 static char *amtl_fields[] = {
1407 "list_name", "member_type", "member_name",
1410 static struct valobj amtl_valobj[] = {
1411 {V_LOCK, 0, LIST, 0, LIST_ID, SMS_DEADLOCK},
1412 {V_ID, 0, LIST, NAME, LIST_ID, SMS_LIST},
1413 {V_TYPE, 1, "member", 0, 0, SMS_TYPE},
1414 {V_TYPEDATA, 2, 0, 0, 0, SMS_NO_MATCH},
1417 static struct validate amtl_validate =
1430 static struct validate dmfl_validate =
1440 delete_member_from_list,
1443 static char *gaus_fields[] = {
1445 "use_type", "use_name",
1448 static struct valobj gaus_valobj[] = {
1449 {V_TYPE, 0, "gaus", 0, 0, SMS_TYPE},
1450 {V_TYPEDATA, 1, 0, 0, 0, SMS_NO_MATCH},
1453 static struct validate gaus_validate = {
1465 static char *qgli_fields[] = {
1466 "active", "public", "hidden", "maillist", "group",
1470 static struct valobj qgli_valobj[] = {
1471 {V_TYPE, 0, "boolean", 0, 0, SMS_TYPE},
1472 {V_TYPE, 1, "boolean", 0, 0, SMS_TYPE},
1473 {V_TYPE, 2, "boolean", 0, 0, SMS_TYPE},
1474 {V_TYPE, 3, "boolean", 0, 0, SMS_TYPE},
1475 {V_TYPE, 4, "boolean", 0, 0, SMS_TYPE},
1478 static struct validate qgli_validate = {
1487 qualified_get_lists,
1490 static char *gmol_fields[] = {
1492 "member_type", "member_name",
1495 static struct validate gmol_validate = {
1502 access_visible_list,
1504 get_members_of_list,
1507 static char *glom_fields[] = {
1508 "member_type", "member_name",
1509 "list_name", "active", "public", "hidden", "maillist", "group",
1512 static struct valobj glom_valobj[] = {
1513 {V_TYPE, 0, "rmember", 0, 0, SMS_TYPE},
1514 {V_TYPEDATA, 1, 0, 0, 0, SMS_NO_MATCH},
1518 static struct validate glom_validate = {
1527 get_lists_of_member,
1530 static char *cmol_fields[] = {
1535 static struct validate cmol_validate = {
1542 access_visible_list,
1544 count_members_of_list,
1547 static char *gzcl_fields[] = {
1549 CLASS, "xmt_type", "xmt_name", "sub_type", "sub_name",
1550 "iws_type", "iws_name", "iui_type", "iui_name", MOD1, MOD2, MOD3,
1553 static struct validate gzcl_validate = {
1565 static char *azcl_fields[] = {
1566 CLASS, "xmt_type", "xmt_name", "sub_type", "sub_name",
1567 "iws_type", "iws_name", "iui_type", "iui_name",
1570 static struct valobj azcl_valobj[] = {
1572 {V_TYPE, 1, ACE_TYPE, 0, 0, SMS_ACE},
1573 {V_TYPEDATA, 2, 0, 0, LIST_ID, SMS_ACE},
1574 {V_TYPE, 3, ACE_TYPE, 0, 0, SMS_ACE},
1575 {V_TYPEDATA, 4, 0, 0, LIST_ID, SMS_ACE},
1576 {V_TYPE, 5, ACE_TYPE, 0, 0, SMS_ACE},
1577 {V_TYPEDATA, 6, 0, 0, LIST_ID, SMS_ACE},
1578 {V_TYPE, 7, ACE_TYPE, 0, 0, SMS_ACE},
1579 {V_TYPEDATA, 8, 0, 0, LIST_ID, SMS_ACE},
1582 static struct validate azcl_validate = {
1594 static char *uzcl_fields[] = {
1595 CLASS, "newclass", "xmt_type", "xmt_name", "sub_type", "sub_name",
1596 "iws_type", "iws_name", "iui_type", "iui_name",
1599 static struct valobj uzcl_valobj[] = {
1600 {V_RENAME, 1, "zephyr", CLASS, 0, SMS_NOT_UNIQUE},
1601 {V_TYPE, 2, ACE_TYPE, 0, 0, SMS_ACE},
1602 {V_TYPEDATA, 3, 0, 0, LIST_ID, SMS_ACE},
1603 {V_TYPE, 4, ACE_TYPE, 0, 0, SMS_ACE},
1604 {V_TYPEDATA, 5, 0, 0, LIST_ID, SMS_ACE},
1605 {V_TYPE, 6, ACE_TYPE, 0, 0, SMS_ACE},
1606 {V_TYPEDATA, 7, 0, 0, LIST_ID, SMS_ACE},
1607 {V_TYPE, 8, ACE_TYPE, 0, 0, SMS_ACE},
1608 {V_TYPEDATA, 9, 0, 0, LIST_ID, SMS_ACE},
1611 static struct validate uzcl_validate = {
1623 static struct validate dzcl_validate = {
1635 static char *gasv_fields[] = {
1636 SERVICE, "protocol", "port", DESC,
1639 static char *gpcp_fields[] = {
1641 "printer", "spooling_host", "spool_directory", "rprinter", "comments",
1645 static char *apcp_fields[] = {
1646 "printer", "spooling_host", "spool_directory", "rprinter", "comments",
1650 static struct valobj apcp_valobj[] = {
1652 {V_ID, 1, MACHINE, NAME, MACH_ID, SMS_MACHINE},
1655 static struct validate apcp_validate = {
1667 static struct validate dpcp_validate = {
1679 static char *gpdm_fields[] = {
1681 NAME, "rpcnum", "host", MOD1, MOD2, MOD3,
1684 static char *apdm_fields[] = {
1685 NAME, "rpcnum", "host"
1688 static struct valobj apdm_valobj[] = {
1690 {V_ID, 2, MACHINE, NAME, MACH_ID, SMS_MACHINE},
1693 static struct validate apdm_validate = {
1705 static struct validate dpdm_validate = {
1717 static char *gali_fields[] = {
1718 NAME, TYPE, "trans",
1719 NAME, TYPE, "trans",
1722 static char *aali_fields[] = {
1723 NAME, TYPE, "trans",
1726 static struct valobj aali_valobj[] = {
1728 {V_TYPE, 1, "alias", 0, 0, SMS_TYPE},
1732 static struct validate aali_validate = {
1736 "a.name = \"%s\" and a.type = \"%s\" and a.trans = \"%s\"",
1744 static struct validate dali_validate = /* DELETE_ALIAS */
1749 "a.name = \"%s\" and a.type = \"%s\" and a.trans = \"%s\"",
1757 static char *gval_fields[] = {
1761 static struct valobj gval_valobj[] = {
1762 {V_NAME, 0, "values", NAME, 0, SMS_NO_MATCH},
1765 static struct validate gval_validate = {
1777 static char *aval_fields[] = {
1781 static struct validate aval_validate = /* for aval, uval, and dval */
1794 static char *dval_fields[] = {
1798 static char *gats_fields[] = {
1799 "table", "retrieves", "appends", "updates", "deletes", MOD1, MOD2, MOD3,
1804 /* Generalized Query Definitions */
1806 struct query Queries2[] = {
1808 /* Q_GALO - GET_ALL_LOGINS */
1814 "%c = u.login, %c = text(u.uid), %c = u.shell, %c = u.last, %c = u.first, %c = u.middle",
1823 /* Q_GAAL - GET_ALL_ACTIVE_LOGINS */
1824 "get_all_active_logins",
1829 "%c = u.login, %c = text(u.uid), %c = u.shell, %c = u.last, %c = u.first, %c = u.middle",
1838 /* Q_GUBL - GET_USER_BY_LOGIN */
1839 "get_user_by_login",
1844 "%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",
1847 "u.login = \"%s\" and u.users_id != 0",
1853 /* Q_GUBU - GET_USER_BY_UID */
1859 "%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",
1862 "u.uid = %s and u.users_id != 0",
1868 /* Q_GUBN - GET_USER_BY_NAME */
1874 "%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",
1877 "u.first = \"%s\" and u.last = \"%s\" and u.users_id != 0",
1883 /* Q_GUBC - GET_USER_BY_CLASS */
1884 "get_user_by_class",
1889 "%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",
1892 "u.mit_year = uppercase(\"%s\") and u.users_id != 0",
1898 /* Q_GUBM - GET_USER_BY_MITID */
1899 "get_user_by_mitid",
1904 "%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",
1907 "u.mit_id = \"%s\" and u.users_id != 0",
1913 /* Q_AUSR - ADD_USER */
1919 "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",
1922 "values.name = \"users_id\"",
1928 /* Q_RUSR - REGISTER_USER */
1943 /* Q_UUSR - UPDATE_USER */
1949 "login = %c, uid = int4(%c), shell = %c, last = %c, first = %c, middle = %c, status = int4(%c), mit_id = %c, mit_year = %c",
1958 /* Q_UUSH - UPDATE_USER_SHELL */
1959 "update_user_shell",
1973 /* Q_UUST - UPDATE_USER_STATUS */
1974 "update_user_status",
1979 "status = int4(%c)",
1988 /* Q_DUSR - DELETE_USER */
2003 /* Q_DUBU - DELETE_USER_BY_UID */
2004 "delete_user_by_uid",
2018 /* Q_GKUM - GET_KERBEROS_USER_MAP */
2019 "get_kerberos_user_map",
2024 "%c = users.login, %c = strings.string",
2027 "users.login = \"%s\" and strings.string = \"%s\" and k.users_id = users.users_id and k.string_id = strings.string_id",
2033 /* Q_AKUM - ADD_KERBEROS_USER_MAP */
2034 "add_kerberos_user_map",
2039 "users_id = %i4, string_id = %i4",
2048 /* Q_DKUM - DELETE_KERBEROS_USER_MAP */
2049 "delete_kerberos_user_map",
2057 "k.users_id = %d and k.string_id = %d",
2063 /* Q_GFBL - GET_FINGER_BY_LOGIN */
2064 "get_finger_by_login",
2069 "%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",
2078 /* Q_UFBL - UPDATE_FINGER_BY_LOGIN */
2079 "update_finger_by_login",
2084 "fullname=%c,nickname=%c,home_addr=%c,home_phone=%c,office_addr=%c,office_phone=%c,mit_dept=%c,mit_affil=%c",
2093 /* Q_GPOB - GET_POBOX */
2099 "%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",
2108 /* Q_GAPO - GET_ALL_POBOXES */
2114 "%c = u.login, %c = u.potype, %c = text(u.pop_id) + \":\" + text(u.box_id)",
2117 "u.potype != \"NONE\"",
2123 /* Q_GPOP - GET_POBOXES_POP */
2129 "%c = u.login, %c = u.potype, %c = text(u.pop_id) + \":\" + text(u.box_id)",
2132 "u.potype = \"POP\"",
2138 /* Q_GPOF - GET_POBOXES_SMTP */
2144 "%c = u.login, %c = u.potype, %c = text(u.pop_id) + \":\" + text(u.box_id)",
2147 "u.potype = \"SMTP\"",
2153 /* Q_SPOB - SET_POBOX */
2168 /* Q_SPOP - SET_POBOX_POP */
2183 /* Q_DPOB - DELETE_POBOX */
2189 "potype = \"NONE\"",
2198 /* Q_GMAC - GET_MACHINE */
2204 "%c = m.name, %c = m.type, %c = m.modtime, %c = text(m.modby), %c =m.modwith",
2207 "m.name = uppercase(\"%s\") and m.mach_id != 0",
2213 /* Q_AMAC - ADD_MACHINE */
2219 "name = uppercase(%c), mach_id = values.value, type = %c",
2222 "values.name = \"mach_id\"",
2228 /* Q_UMAC - UPDATE_MACHINE */
2234 "name = uppercase(%c), type = %c",
2243 /* Q_DMAC - DELETE_MACHINE */
2258 /* Q_GCLU - GET_CLUSTER */
2264 "%c = c.name, %c = c.desc, %c = c.location, %c = c.modtime, %c = text(c.modby), %c = c.modwith",
2267 "c.name = \"%s\" and c.clu_id != 0",
2273 /* Q_ACLU - ADD_CLUSTER */
2279 "name = %c, clu_id = values.value, desc = %c, location = %c",
2282 "values.name = \"clu_id\"",
2288 /* Q_UCLU - UPDATE_CLUSTER */
2294 "name = %c, desc = %c, location = %c",
2303 /* Q_DCLU - DELETE_CLUSTER */
2318 /* Q_GMCM - GET_MACHINE_TO_CLUSTER_MAP */
2319 "get_machine_to_cluster_map",
2324 "%c = machine.name, %c = cluster.name",
2327 "machine.name = uppercase(\"%s\") and cluster.name = \"%s\" and m.clu_id = cluster.clu_id and m.mach_id = machine.mach_id",
2333 /* Q_AMTC - ADD_MACHINE_TO_CLUSTER */
2334 "add_machine_to_cluster",
2339 "mach_id = %i4, clu_id = %i4",
2348 /* Q_DMFC - DELETE_MACHINE_FROM_CLUSTER */
2349 "delete_machine_from_cluster",
2357 "m.mach_id = %d and m.clu_id = %d",
2363 /* Q_GCLD - GET_CLUSTER_DATA */
2369 "%c = cluster.name, %c = s.serv_label, %c = s.serv_cluster",
2372 "cluster.clu_id = s.clu_id and cluster.name = \"%s\" and s.serv_label = \"%s\"",
2378 /* Q_ACLD - ADD_CLUSTER_DATA */
2384 "clu_id = %i4, serv_label = %c, serv_cluster = %c",
2393 /* Q_DCLD - DELETE_CLUSTER_DATA */
2394 "delete_cluster_data",
2402 "s.clu_id = %d and s.serv_label = \"%s\" and s.serv_cluster = \"%s\"",
2408 /* Q_GSIN - GET_SERVER_INFO */
2414 "%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",
2417 "s.name = uppercase(\"%s\")",
2423 /* Q_QGSV - QUALIFIED_GET_SERVER */
2424 "qualified_get_server",
2438 /* Q_ASIN - ADD_SERVER_INFO */
2444 "name = uppercase(%c), update_int = int4(%c), target_file = %c, script = %c, type = %c, enable = int1(%c), acl_type = %c, acl_id = %i4",
2453 /* Q_USIN - UPDATE_SERVER_INFO */
2454 "update_server_info",
2459 "update_int = int4(%c), target_file = %c, script = %c, type = %c, enable = int1(%c), acl_type = %c, acl_id = %i4",
2462 "s.name = uppercase(\"%s\")",
2468 /* Q_RSVE - RESET_SERVER_ERROR */
2469 "reset_server_error",
2474 "harderror = 0, dfcheck = s.dfgen",
2477 "s.name = uppercase(\"%s\")",
2483 /* Q_SSIF - SET_SERVER_INTERNAL_FLAGS */
2484 "set_server_internal_flags",
2489 "dfgen = int4(%c), dfcheck = int4(%c), inprogress = int1(%c), harderror = int1(%c), errmsg = %c",
2492 "s.name = uppercase(\"%s\")",
2498 /* Q_DSIN - DELETE_SERVER_INFO */
2499 "delete_server_info",
2507 "s.name = uppercase(\"%s\")",
2513 /* Q_GSHI - GET_SERVER_HOST_INFO */
2514 "get_server_host_info",
2519 "%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",
2522 "sh.service = uppercase(\"%s\") and machine.name = uppercase(\"%s\") and machine.mach_id = sh.mach_id",
2528 /* Q_QGSV - QUALIFIED_GET_SERVER_HOST */
2529 "qualified_get_server_host",
2543 /* Q_ASHI - ADD_SERVER_HOST_INFO */
2544 "add_server_host_info",
2549 "service = uppercase(%c), mach_id = %i4, enable = int1(%c), value1 = int4(%c), value2 = int4(%c), value3 = %c",
2558 /* Q_USHI - UPDATE_SERVER_HOST_INFO */
2559 "update_server_host_info",
2564 "enable = int1(%c), value1 = int4(%c), value2 = int4(%c), value3 = %c",
2567 "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
2573 /* Q_RSHE - RESET_SERVER_HOST_ERROR */
2574 "reset_server_host_error",
2582 "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
2588 /* Q_SSHO - SET_SERVER_HOST_OVERRIDE */
2589 "set_server_host_override",
2597 "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
2603 /* Q_SSHI - SET_SERVER_HOST_INTERNAL */
2604 "set_server_host_internal",
2609 "override = int1(%c), success = int1(%c), inprogress = int1(%c), hosterror = int1(%c), hosterrmsg = %c, ltt = int4(%c), lts = int4(%c)",
2612 "s.service = uppercase(\"%s\") and s.mach_id = machine.mach_id and machine.name = \"%s\"",
2618 /* Q_DSHI - DELETE_SERVER_HOST_INFO */
2619 "delete_server_host_info",
2627 "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
2633 /* Q_GSHA - GET_SERVER_HOST_ACCESS */
2634 "get_server_host_access",
2639 "%c = machine.name, %c = ha.acl_type, %c = text(ha.acl_id), %c = ha.modtime, %c = text(ha.modby), %c = ha.modwith",
2642 "machine.name = uppercase(\"%s\") and ha.mach_id = machine.mach_id",
2648 /* Q_ASHA - ADD_SERVER_HOST_ACCESS */
2649 "add_server_host_access",
2654 "mach_id = %i4, acl_type = %c, acl_id = %i4",
2663 /* Q_USHA - UPDATE_SERVER_HOST_ACCESS */
2664 "update_server_host_access",
2669 "acl_type = %c, acl_id = %i4",
2678 /* Q_DSHA - DELETE_SERVER_HOST_ACCESS */
2679 "delete_server_host_access",
2693 /* Q_GSLO - GET_SERVER_LOCATIONS */
2694 "get_server_locations",
2699 "%c = sh.service, %c = machine.name",
2702 "sh.service = uppercase(\"%s\") and sh.mach_id = machine.mach_id",
2708 /* Q_GFSL - GET_FILESYS_BY_LABEL */
2709 "get_filesys_by_label",
2714 "%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",
2717 "fs.label = \"%s\" and fs.mach_id = machine.mach_id and fs.owner = users.users_id and fs.owners = list.list_id",
2723 /* Q_GFSM - GET_FILESYS_BY_MACHINE */
2724 "get_filesys_by_machine",
2729 "%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",
2732 "fs.mach_id = %d and machine.mach_id = fs.mach_id and fs.owner = users.users_id and fs.owners = list.list_id",
2738 /* Q_GFSN - GET_FILESYS_BY_NFSPHYS */
2739 "get_filesys_by_nfsphys",
2744 "%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",
2747 "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\"",
2753 /* Q_GFSG - GET_FILESYS_BY_GROUP */
2754 "get_filesys_by_group",
2759 "%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",
2762 "fs.owners = %d and machine.mach_id = fs.mach_id and fs.owner = users.users_id and fs.owners = list.list_id",
2768 /* Q_AFIL - ADD_FILESYS */
2774 "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",
2777 "values.name = \"filsys_id\"",
2783 /* Q_UFIL - UPDATE_FILESYS */
2789 "label = %c, type = %c, mach_id = %i4, name = %c, mount = %c, access = %c, comments = %c, owner = %i4, owners = %i4, createflg = int1(%c), lockertype = %c",
2792 "fs.filsys_id = %d",
2798 /* Q_DFIL - DELETE_FILESYS */
2807 "fs.filsys_id = %d",
2813 /* Q_GFGM - GET_FSGROUOP_MEMBERS */
2814 "get_fsgroup_members",
2819 "%c = filesys.label, %c = fg.key",
2822 "fg.group_id = %d and filesys.filsys_id = fg.filsys_id",
2828 /* Q_AFTG - ADD_FILESYS_TO_FSGROUP */
2829 "add_filesys_to_fsgroup",
2834 "group_id = filesys.filsys_id, filsys_id = %i4, key = %c",
2837 "filesys.filsys_id = %d and filesys.type = \"FSGROUP\"",
2843 /* Q_RFFG - REMOVE_FILESYS_FROM_FSGROUP */
2844 "remove_filesys_from_fsgroup",
2852 "fg.group_id = %d and fg.filsys_id = %d",
2858 /* Q_GANF - GET_ALL_NFSPHYS */
2864 "%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",
2867 "machine.mach_id = np.mach_id",
2873 /* Q_GNFP - GET_NFSPHYS */
2879 "%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",
2882 "np.mach_id = %d and np.dir = \"%s\" and machine.mach_id = np.mach_id",
2888 /* Q_ANFP - ADD_NFSPHYS */
2894 "nfsphys_id = values.value, mach_id = %i4, dir = %c, device = %c, status = int4(%c), allocated = int4(%c), size = int4(%c)",
2897 "values.name = \"nfsphys_id\"",
2903 /* Q_UNFP - UPDATE_NFSPHYS */
2909 "device = %c, status = int4(%c), allocated = int4(%c), size = int4(%c)",
2912 "np.mach_id = %d and np.dir = \"%s\"",
2918 /* Q_AJNF - ADJUST_NFSPHYS_ALLOCATION */
2919 "adjust_nfsphys_allocation",
2924 "allocated = np.allocated + int4(%c)",
2927 "np.mach_id = %d and np.dir = \"%s\"",
2933 /* Q_DNFP - DELETE_NFSPHYS */
2942 "np.mach_id = %d and np.dir = \"%s\"",
2948 /* Q_GNFQ - GET_NFS_QUOTAS */
2954 "%c = filesys.label, %c = users.login, %c = text(nq.quota), %c = text(nq.phys_id), %c = machine.name, %c = nq.modtime, %c = text(nq.modby), %c = nq.modwith",
2957 "filesys.label = \"%s\" and nq.users_id = %d and filesys.filsys_id = nq.filsys_id and machine.mach_id = filesys.mach_id and users.users_id = nq.users_id",
2963 /* Q_GNQP - GET_NFS_QUOTAS_BY_PARTITION */
2964 "get_nfs_quotas_by_partition",
2969 "%c = filesys.label, %c = users.login, %c = text(nq.quota), %c = nfsphys.dir, %c = machine.name",
2972 "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",
2978 /* Q_ANFQ - ADD_NFS_QUOTA */
2984 "filsys_id = filesys.filsys_id, users_id = %i4, quota = int4(%c), phys_id = filesys.phys_id",
2987 "filesys.filsys_id = %d",
2993 /* Q_UNFQ - UPDATE_NFS_QUOTA */
3002 "nq.filsys_id = %d and nq.users_id = %d",
3008 /* Q_DNFQ - DELETE_NFS_QUOTA */
3017 "nq.filsys_id = %d and nq.users_id = %d",
3023 /* Q_GLIN - GET_LIST_INFO */
3038 /* Q_EXLN - EXPAND_LIST_NAMES */
3039 "expand_list_names",
3047 "l.name = \"%s\" and l.list_id != 0",
3053 /* Q_ALIS - ADD_LIST */
3059 "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",
3062 "values.name = \"list_id\"",
3068 /* Q_ULIS - UPDATE_LIST */
3074 "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",
3083 /* Q_DLIS - DELETE_LIST */
3098 /* Q_AMTL - ADD_MEMBER_TO_LIST */
3099 "add_member_to_list",
3113 /* Q_DMFL - DELETE_MEMBER_FROM_LIST */
3114 "delete_member_from_list",
3128 /* Q_GAUS - GET_ACE_USE */
3143 /* Q_QGLI - QUALIFIED_GET_LISTS */
3144 "qualified_get_lists",
3158 /* Q_GMOL - GET_MEMBERS_OF_LIST */
3159 "get_members_of_list",
3173 /* Q_GLOM - GET_LISTS_OF_MEMBER */
3174 "get_lists_of_member",
3188 /* Q_CMOL - COUNT_MEMBERS_OF_LIST */
3189 "count_members_of_list",
3203 /* Q_GZCL - GET_ZEPHYR_CLASS */
3209 "%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",
3218 /* Q_AZCL - ADD_ZEPHYR_CLASS */
3224 "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",
3233 /* Q_UZCL - UPDATE_ZEPHYR_CLASS */
3234 "update_zephyr_class",
3239 "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",
3248 /* Q_DZCL - DELETE_ZEPHYR_CLASS */
3249 "delete_zephyr_class",
3263 /* Q_GSVC - GET_SERVICE */
3269 "%c = s.name, %c = s.protocol, %c = text(s.port), %c = s.desc, %c = s.modtime, %c = text(s.modby), %c = s.modwith",
3278 /* Q_ASVC - ADD_SERVICE */
3284 "name = %c, protocol = %c, port = int2(%c), desc = %c",
3293 /* Q_DSVC - DELETE_SERVICE */
3308 /* Q_GPCP - GET_PRINTCAP */
3314 "%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",
3317 "p.name = \"%s\" and machine.mach_id = p.mach_id",
3323 /* Q_APCP - ADD_PRINTCAP */
3329 "name = %c, mach_id = %i4, dir = %c, rp = %c, comments = %c",
3338 /* Q_DPCP - DELETE_PRINTCAP */
3353 /* Q_GPDM - GET_PALLADIUM */
3359 "%c = p.name, %c = text(p.ident), %c = machine.name, %c = p.modtime, %c = text(p.modby), %c = p.modwith",
3362 "p.name = \"%s\" and machine.mach_id = p.mach_id",
3368 /* Q_APDM - ADD_PALLADIUM */
3374 "name = %c, ident = int4(%c), mach_id = %i4",
3383 /* Q_DPDM - DELETE_PALLADIUM */
3398 /* Q_GALI - GET_ALIAS */
3404 "%c = a.name, %c = a.type, %c = a.trans",
3407 "a.name = \"%s\" and a.type = \"%s\" and a.trans = \"%s\"",
3413 /* Q_AALI - ADD_ALIAS */
3419 "name = %c, type = %c, trans = %c",
3428 /* Q_DALI - DELETE_ALIAS */
3437 "a.name = \"%s\" and a.type = \"%s\" and a.trans = \"%s\"",
3443 /* Q_GVAL - GET_VALUE */
3449 "%c = text(v.value)",
3458 /* Q_AVAL - ADD_VALUE */
3464 "name = %c, value = int4(%c)",
3473 /* Q_UVAL - UPDATE_VALUE */
3488 /* Q_DVAL - DELETE_VALUE */
3503 /* Q_GATS - GET_ALL_TABLE_STATS */
3504 "get_all_table_stats",
3509 "%c = tbs.table, %c = text(tbs.retrieves), %c = text(tbs.appends), %c = text(tbs.updates), %c = text(tbs.deletes), %c = tbs.modtime",
3519 int QueryCount2 = (sizeof Queries2 / sizeof (struct query));