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 valobj rusr_valobj[] = {
286 {V_LOCK, 0, USERS, 0, USERS_ID, SMS_DEADLOCK},
287 {V_LOCK, 0, LIST, 0, LIST_ID, SMS_DEADLOCK},
288 {V_LOCK, 0, FILESYS, 0, FILSYS_ID, SMS_DEADLOCK},
289 {V_LOCK, 0, "nfsphys", 0, "nfsphys_id", SMS_DEADLOCK},
292 static struct validate rusr_validate = {
304 static char *uusr_fields[] = {
306 "newlogin", UID, SHELL, LAST, FIRST, MIDDLE, STATUS,
310 static struct valobj uusr_valobj[] = {
311 {V_LOCK, 0, USERS, 0, USERS_ID, SMS_DEADLOCK},
312 {V_ID, 0, USERS, LOGIN, USERS_ID, SMS_USER},
313 {V_RENAME, 1, USERS, LOGIN, USERS_ID, SMS_NOT_UNIQUE},
318 {V_TYPE, 9, CLASS, 0, 0, SMS_BAD_CLASS},
321 static struct validate uusr_validate = {
333 static char *uush_fields[] = {
338 static struct validate uush_validate = {
350 static char *uust_fields[] = {
355 static struct validate uust_validate = {
367 static char *dusr_fields[] = {
371 static struct validate dusr_validate = {
383 static char *dubu_fields[] = {
387 static struct valobj dubu_valobj[] = {
388 {V_LOCK, 0, USERS, 0, USERS_ID, SMS_DEADLOCK},
389 {V_ID, 0, USERS, UID, USERS_ID, SMS_USER}
392 static struct validate dubu_validate = {
404 static char *gkum_fields[] = { LOGIN, "kerberos",
407 static char *akum_fields[] = { LOGIN, "kerberos" };
409 static struct valobj akum_valobj[] =
411 {V_ID, 0, USERS, LOGIN, USERS_ID, SMS_USER},
412 {V_ID, 1, "strings", "string", "string_id", SMS_NO_MATCH},
415 static struct validate akum_validate =
420 "k.users_id = %d or k.string_id = %d",
428 static struct validate dkum_validate =
433 "k.users_id = %d and k.string_id = %d",
441 static char *gfbl_fields[] = {
443 LOGIN, "fullname", "nickname", "home_addr",
444 "home_phone", "office_address", "office_phone", "mit_dept",
445 "mit_affil", MOD1, MOD2, MOD3,
448 static struct validate gfbl_validate = {
460 static char *ufbl_fields[] = {
462 "fullname", "nickname", "home_addr",
463 "home_phone", "office_address", "office_phone", "mit_dept",
467 static struct validate ufbl_validate = {
479 static char *gpob_fields[] = {
481 LOGIN, TYPE, "box", MOD1, MOD2, MOD3,
484 static struct validate gpob_validate = {
488 "u.potype != \"NONE\" and u.users_id=%d",
496 static char *gpox_fields[] = {
500 static struct validate gpox_validate = {
512 static char *spob_fields[] = {
516 static struct valobj spob_valobj[] = {
517 {V_LOCK, 0, USERS, 0, USERS_ID, SMS_DEADLOCK},
518 {V_ID, 0, USERS, LOGIN, USERS_ID, SMS_USER},
519 {V_TYPE, 1, "pobox", 0, 0, SMS_TYPE},
522 static struct validate spob_validate = /* SET_POBOX */
535 static struct validate spop_validate = /* SET_POBOX_POP */
548 static struct validate dpob_validate = /* DELETE_POBOX */
561 static char *gmac_fields[] = {
563 NAME, TYPE, MOD1, MOD2, MOD3,
566 static char *amac_fields[] = {
570 static struct valobj amac_valobj[] = {
572 {V_LOCK, 0, MACHINE, 0, MACH_ID, SMS_DEADLOCK},
573 {V_TYPE, 1, "mac_type", 0, 0, SMS_TYPE},
576 static struct validate amac_validate = {
580 "m.name = uppercase(\"%s\")",
585 set_uppercase_modtime,
588 static char *umac_fields[] = {
593 static struct valobj umac_valobj[] = {
594 {V_LOCK, 0, MACHINE, 0, MACH_ID, SMS_DEADLOCK},
595 {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE},
596 {V_RENAME, 1, MACHINE, NAME, MACH_ID, SMS_NOT_UNIQUE},
597 {V_TYPE, 2, "mac_type", 0, 0, SMS_TYPE},
600 static struct validate umac_validate = {
612 static char *dmac_fields[] = {
616 static struct valobj dmac_valobj[] = {
617 {V_LOCK, 0, MACHINE, 0, MACH_ID, SMS_DEADLOCK},
618 {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE},
621 static struct validate dmac_validate = {
633 static char *gclu_fields[] = {
635 NAME, DESC, LOCATION, MOD1, MOD2, MOD3,
638 static char *aclu_fields[] = {
639 NAME, DESC, LOCATION,
642 static struct valobj aclu_valobj[] = {
643 {V_LOCK, 0, CLUSTER, 0, CLU_ID, SMS_DEADLOCK},
647 static struct validate aclu_validate = /* for aclu */
660 static char *uclu_fields[] = {
662 "newname", DESC, LOCATION,
665 static struct valobj uclu_valobj[] = {
666 {V_LOCK, 0, CLUSTER, 0, CLU_ID, SMS_DEADLOCK},
667 {V_ID, 0, CLUSTER, NAME, CLU_ID, SMS_CLUSTER},
668 {V_RENAME, 1, CLUSTER, NAME, CLU_ID, SMS_NOT_UNIQUE},
671 static struct validate uclu_validate = {
683 static char *dclu_fields[] = {
687 static struct validate dclu_validate = {
699 static char *gmcm_fields[] = {
704 static struct valobj amtc_valobj[] = /* ADD_MACHINE_TO_CLUSTER */
705 { /* DELETE_MACHINE_FROM_CLUSTER */
706 {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE},
707 {V_ID, 1, CLUSTER, NAME, CLU_ID, SMS_CLUSTER},
710 static struct validate amtc_validate = /* for amtc and dmfc */
715 "m.mach_id = %d and m.clu_id = %d",
720 set_mach_modtime_by_id,
723 static char *gcld_fields[] = {
724 CLUSTER, "serv_label",
725 CLUSTER, "serv_label", "serv_cluster",
728 static char *acld_fields[] = {
729 CLUSTER, "serv_label", "serv_cluster",
732 static struct valobj acld_valobj[] =
734 {V_ID, 0, CLUSTER, NAME, CLU_ID, SMS_CLUSTER},
738 static struct validate acld_validate = /* ADD_CLUSTER_DATA */
739 { /* DELETE_CLUSTER_DATA */
743 "s.clu_id = %d and s.serv_label = \"%s\" and s.serv_cluster = \"%s\"",
748 set_cluster_modtime_by_id,
751 static char *gsin_fields[] = {
753 SERVICE, "update_int", "target_file", "script", "dfgen", "dfcheck",
754 TYPE, "enable", "inprogress", "harderror", "errmsg",
755 ACE_TYPE, ACE_NAME, MOD1, MOD2, MOD3,
758 static struct validate gsin_validate =
771 static char *qgsv_fields[] = {
772 "enable", "inprogress", "harderror",
776 static struct valobj qgsv_valobj[] = {
777 {V_TYPE, 0, "boolean", 0, 0, SMS_TYPE},
778 {V_TYPE, 1, "boolean", 0, 0, SMS_TYPE},
779 {V_TYPE, 2, "boolean", 0, 0, SMS_TYPE},
782 static struct validate qgsv_validate = {
791 qualified_get_server,
794 static char *asin_fields[] = {
795 SERVICE, "update_int", "target_file", "script", TYPE, "enable",
799 static struct valobj asin_valobj[] = {
800 {V_LOCK, 0, MACHINE, 0, MACH_ID, SMS_DEADLOCK},
802 {V_TYPE, 4, "service", 0, 0, SMS_TYPE},
803 {V_TYPE, 6, ACE_TYPE, 0, 0, SMS_ACE},
804 {V_TYPEDATA, 7, 0, 0, 0, SMS_ACE},
807 static struct validate asin_validate = /* for asin, usin */
812 "s.name = uppercase(\"%s\")",
817 set_uppercase_modtime,
820 static struct validate rsve_validate = {
824 "s.name = uppercase(\"%s\")",
829 set_uppercase_modtime,
832 static char *ssif_fields[] = {
833 SERVICE, "dfgen", "dfcheck", "inprogress", "harderror", "errmsg",
836 static struct validate ssif_validate = {
840 "s.name = uppercase(\"%s\")",
848 static char *dsin_fields[] = {
852 static struct validate dsin_validate = {
856 "s.name = uppercase(\"%s\")",
864 static char *gshi_fields[] = {
866 SERVICE, MACHINE, "enable", "override", "success", "inprogress",
867 "hosterror", "hosterrormsg", "ltt", "lts", "value1", "value2",
868 "value3", MOD1, MOD2, MOD3,
871 static struct validate gshi_validate = {
883 static char *qgsh_fields[] = {
884 "service", "enable", "override", "success", "inprogress", "hosterror",
888 static struct valobj qgsh_valobj[] = {
889 {V_TYPE, 1, "boolean", 0, 0, SMS_TYPE},
890 {V_TYPE, 2, "boolean", 0, 0, SMS_TYPE},
891 {V_TYPE, 3, "boolean", 0, 0, SMS_TYPE},
892 {V_TYPE, 4, "boolean", 0, 0, SMS_TYPE},
893 {V_TYPE, 5, "boolean", 0, 0, SMS_TYPE},
896 static struct validate qgsh_validate = {
905 qualified_get_serverhost,
908 static char *ashi_fields[] = {
909 SERVICE, MACHINE, "enable", "value1", "value2", "value3",
912 static struct valobj ashi_valobj[] = {
913 {V_LOCK, 0, MACHINE, 0, MACH_ID, SMS_DEADLOCK},
914 {V_NAME, 0, "servers", NAME, 0, SMS_SERVICE},
915 {V_ID, 1, MACHINE, NAME, MACH_ID, SMS_MACHINE},
918 static struct validate ashi_validate = /* ashi & ushi */
923 "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
928 set_serverhost_modtime,
931 static struct validate rshe_validate =
936 "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
941 set_serverhost_modtime,
944 static struct validate ssho_validate =
949 "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
957 static char *sshi_fields[] = {
958 "service", MACHINE, "override", "success", "inprogress",
959 "hosterror", "errmsg", "ltt", "lts"
962 static struct valobj sshi_valobj[] = {
963 {V_NAME, 0, "servers", NAME, 0, SMS_SERVICE},
966 static struct validate sshi_validate =
979 static char *dshi_fields[] = {
983 static struct validate dshi_validate =
988 "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
996 static char *gsha_fields[] = {
998 MACHINE, ACE_TYPE, ACE_NAME, MOD1, MOD2, MOD3,
1001 static struct validate gsha_validate =
1014 static char *asha_fields[] = {
1015 MACHINE, ACE_TYPE, ACE_NAME,
1018 static struct valobj asha_valobj[] = {
1019 {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE},
1020 {V_TYPE, 1, ACE_TYPE, 0, 0, SMS_ACE},
1021 {V_TYPEDATA, 2, 0, 0, 0, SMS_ACE},
1024 static struct validate asha_validate =
1037 static char *gslo_fields[] = {
1042 static char *gfsl_fields[] = {
1044 LABEL, TYPE, MACHINE, NAME, "mount", "access", "comments", "owner", "owners",
1045 "create", "lockertype", MOD1, MOD2, MOD3,
1048 static char *gfsm_fields[] = {
1050 LABEL, TYPE, MACHINE, NAME, "mount", "access", "comments", "owner", "owners",
1051 "create", "lockertype", MOD1, MOD2, MOD3,
1054 static struct validate gfsm_validate = {
1066 static char *gfsn_fields[] = {
1067 MACHINE, "parition",
1068 LABEL, TYPE, MACHINE, NAME, "mount", "access", "comments", "owner", "owners",
1069 "create", "lockertype", MOD1, MOD2, MOD3,
1072 static char *gfsg_fields[] = {
1074 LABEL, TYPE, MACHINE, NAME, "mount", "access", "comments", "owner", "owners",
1075 "create", "lockertype", MOD1, MOD2, MOD3,
1078 static struct validate gfsg_validate = {
1090 static char *afil_fields[] = {
1091 LABEL, TYPE, MACHINE, NAME, "mount", "access", "comments", "owner", "owners",
1092 "create", "lockertype",
1095 static struct valobj afil_valobj[] = {
1097 {V_LOCK, 0, FILESYS, 0, FILSYS_ID, SMS_DEADLOCK},
1098 {V_TYPE, 1, FILESYS, 0, 0, SMS_FSTYPE},
1099 {V_ID, 2, MACHINE, NAME, MACH_ID, SMS_MACHINE},
1101 {V_ID, 7, USERS, LOGIN, USERS_ID, SMS_USER},
1102 {V_ID, 8, LIST, NAME, LIST_ID, SMS_LIST},
1103 {V_TYPE, 10, "lockertype", 0, 0, SMS_TYPE}
1106 static struct validate afil_validate = {
1110 "fs.label = \"%s\"",
1115 set_filesys_modtime,
1118 static char *ufil_fields[] = {
1119 LABEL, "newlabel", TYPE, MACHINE, NAME, "mount", "access", "comments",
1120 "owner", "owners", "create", "lockertype",
1123 static struct valobj ufil_valobj[] = {
1124 {V_LOCK, 0, FILESYS, 0, FILSYS_ID, SMS_DEADLOCK},
1125 {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
1126 {V_RENAME, 1, FILESYS, LABEL, FILSYS_ID, SMS_NOT_UNIQUE},
1127 {V_TYPE, 2, FILESYS, 0, 0, SMS_FSTYPE},
1128 {V_ID, 3, MACHINE, NAME, MACH_ID, SMS_MACHINE},
1130 {V_ID, 8, USERS, LOGIN, USERS_ID, SMS_USER},
1131 {V_ID, 9, LIST, NAME, LIST_ID, SMS_LIST},
1132 {V_TYPE, 11, "lockertype", 0, 0, SMS_TYPE}
1135 static struct validate ufil_validate = {
1139 "fs.filsys_id = %d",
1144 set_filesys_modtime,
1147 static char *dfil_fields[] = {
1151 static struct valobj dfil_valobj[] = {
1152 {V_LOCK, 0, FILESYS, 0, FILSYS_ID, SMS_DEADLOCK},
1153 {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
1156 static struct validate dfil_validate = {
1160 "fs.filsys_id = %d",
1168 static char *gfgm_fields[] = {
1169 "fsgroup", FILESYS, "sortkey"
1172 static struct valobj gfgm_valobj[] = {
1173 {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
1178 static struct validate gfgm_validate = {
1190 static struct valobj aftg_valobj[] = {
1191 {V_LOCK, 0, FILESYS, 0, FILSYS_ID, SMS_DEADLOCK},
1192 {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
1193 {V_ID, 1, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS},
1196 static struct validate aftg_validate = {
1200 "fg.group_id = %d and fg.filsys_id = %d",
1208 static char *ganf_fields[] = {
1209 MACHINE, DIR, DEVICE, STATUS, "allocated", "size", MOD1, MOD2, MOD3,
1212 static char *gnfp_fields[] = {
1214 MACHINE, DIR, DEVICE, STATUS, "allocated", "size", MOD1, MOD2, MOD3,
1217 static struct validate gnfp_validate = {
1229 static struct valobj anfp_valobj[] = {
1230 {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE},
1234 static struct validate anfp_validate = {
1238 "np.mach_id = %d and np.dir = \"%s\"",
1243 set_nfsphys_modtime,
1246 static char *dnfp_fields[] = {
1250 static struct validate dnfp_validate = {
1254 "np.mach_id = %d and np.dir = \"%s\"",
1259 set_nfsphys_modtime,
1262 static char *gnfq_fields[] = {
1264 FILESYS, LOGIN, "quota", DIR, MACHINE, MOD1, MOD2, MOD3,
1267 static struct valobj gnfq_valobj[] = {
1268 {V_ID, 1, USERS, LOGIN, USERS_ID, SMS_USER},
1272 static struct validate gnfq_validate = {
1284 static char *gnqp_fields[] = {
1286 FILESYS, LOGIN, "quota", DIR, MACHINE, MOD1, MOD2, MOD3,
1289 static char *anfq_fields[] = {
1290 FILESYS, LOGIN, "quota",
1293 static struct validate anfq_validate = {
1297 "nq.filsys_id = %d and nq.users_id = %d",
1305 static struct validate unfq_validate = {
1309 "nq.filsys_id = %d and nq.users_id = %d",
1317 static struct validate dnfq_validate = {
1321 "nq.filsys_id = %d and nq.users_id = %d",
1329 static char *glin_fields[] = {
1331 NAME, "active", "public", "hidden", "maillist", "group", "gid",
1332 ACE_TYPE, ACE_NAME, DESC, MOD1, MOD2, MOD3,
1335 static struct validate glin_validate = {
1342 access_vis_list_by_name,
1347 static char *alis_fields[] = {
1348 NAME, "active", "public", "hidden", "maillist", "group", "gid",
1349 ACE_TYPE, ACE_NAME, DESC,
1352 static struct valobj alis_valobj[] = {
1353 {V_LOCK, 0, LIST, 0, LIST_ID, SMS_DEADLOCK},
1355 {V_TYPE, 7, ACE_TYPE, 0, 0, SMS_ACE},
1356 {V_TYPEDATA, 8, 0, 0, LIST_ID, SMS_ACE},
1359 static struct validate alis_validate = {
1371 static char *ulis_fields[] = {
1373 "newname", "active", "public", "hidden", "maillist", "group", "gid",
1374 ACE_TYPE, ACE_NAME, DESC,
1377 static struct valobj ulis_valobj[] = {
1378 {V_LOCK, 0, LIST, 0, LIST_ID, SMS_DEADLOCK},
1379 {V_ID, 0, LIST, NAME, LIST_ID, SMS_LIST},
1380 {V_RENAME, 1, LIST, NAME, LIST_ID, SMS_NOT_UNIQUE},
1381 {V_TYPE, 8, ACE_TYPE, 0, 0, SMS_ACE},
1382 {V_TYPEDATA, 9, 0, 0, LIST_ID, SMS_ACE},
1385 static struct validate ulis_validate = {
1397 static char *dlis_fields[] = {
1401 static struct validate dlis_validate = {
1413 static char *amtl_fields[] = {
1414 "list_name", "member_type", "member_name",
1417 static struct valobj amtl_valobj[] = {
1418 {V_LOCK, 0, LIST, 0, LIST_ID, SMS_DEADLOCK},
1419 {V_ID, 0, LIST, NAME, LIST_ID, SMS_LIST},
1420 {V_TYPE, 1, "member", 0, 0, SMS_TYPE},
1421 {V_TYPEDATA, 2, 0, 0, 0, SMS_NO_MATCH},
1424 static struct validate amtl_validate =
1437 static struct validate dmfl_validate =
1447 delete_member_from_list,
1450 static char *gaus_fields[] = {
1452 "use_type", "use_name",
1455 static struct valobj gaus_valobj[] = {
1456 {V_TYPE, 0, "gaus", 0, 0, SMS_TYPE},
1457 {V_TYPEDATA, 1, 0, 0, 0, SMS_NO_MATCH},
1460 static struct validate gaus_validate = {
1472 static char *qgli_fields[] = {
1473 "active", "public", "hidden", "maillist", "group",
1477 static struct valobj qgli_valobj[] = {
1478 {V_TYPE, 0, "boolean", 0, 0, SMS_TYPE},
1479 {V_TYPE, 1, "boolean", 0, 0, SMS_TYPE},
1480 {V_TYPE, 2, "boolean", 0, 0, SMS_TYPE},
1481 {V_TYPE, 3, "boolean", 0, 0, SMS_TYPE},
1482 {V_TYPE, 4, "boolean", 0, 0, SMS_TYPE},
1485 static struct validate qgli_validate = {
1494 qualified_get_lists,
1497 static char *gmol_fields[] = {
1499 "member_type", "member_name",
1502 static struct validate gmol_validate = {
1509 access_visible_list,
1511 get_members_of_list,
1514 static char *glom_fields[] = {
1515 "member_type", "member_name",
1516 "list_name", "active", "public", "hidden", "maillist", "group",
1519 static struct valobj glom_valobj[] = {
1520 {V_TYPE, 0, "rmember", 0, 0, SMS_TYPE},
1521 {V_TYPEDATA, 1, 0, 0, 0, SMS_NO_MATCH},
1525 static struct validate glom_validate = {
1534 get_lists_of_member,
1537 static char *cmol_fields[] = {
1542 static struct validate cmol_validate = {
1549 access_visible_list,
1551 count_members_of_list,
1554 static char *gzcl_fields[] = {
1556 CLASS, "xmt_type", "xmt_name", "sub_type", "sub_name",
1557 "iws_type", "iws_name", "iui_type", "iui_name", MOD1, MOD2, MOD3,
1560 static struct validate gzcl_validate = {
1572 static char *azcl_fields[] = {
1573 CLASS, "xmt_type", "xmt_name", "sub_type", "sub_name",
1574 "iws_type", "iws_name", "iui_type", "iui_name",
1577 static struct valobj azcl_valobj[] = {
1579 {V_TYPE, 1, ACE_TYPE, 0, 0, SMS_ACE},
1580 {V_TYPEDATA, 2, 0, 0, LIST_ID, SMS_ACE},
1581 {V_TYPE, 3, ACE_TYPE, 0, 0, SMS_ACE},
1582 {V_TYPEDATA, 4, 0, 0, LIST_ID, SMS_ACE},
1583 {V_TYPE, 5, ACE_TYPE, 0, 0, SMS_ACE},
1584 {V_TYPEDATA, 6, 0, 0, LIST_ID, SMS_ACE},
1585 {V_TYPE, 7, ACE_TYPE, 0, 0, SMS_ACE},
1586 {V_TYPEDATA, 8, 0, 0, LIST_ID, SMS_ACE},
1589 static struct validate azcl_validate = {
1601 static char *uzcl_fields[] = {
1602 CLASS, "newclass", "xmt_type", "xmt_name", "sub_type", "sub_name",
1603 "iws_type", "iws_name", "iui_type", "iui_name",
1606 static struct valobj uzcl_valobj[] = {
1607 {V_RENAME, 1, "zephyr", CLASS, 0, SMS_NOT_UNIQUE},
1608 {V_TYPE, 2, ACE_TYPE, 0, 0, SMS_ACE},
1609 {V_TYPEDATA, 3, 0, 0, LIST_ID, SMS_ACE},
1610 {V_TYPE, 4, ACE_TYPE, 0, 0, SMS_ACE},
1611 {V_TYPEDATA, 5, 0, 0, LIST_ID, SMS_ACE},
1612 {V_TYPE, 6, ACE_TYPE, 0, 0, SMS_ACE},
1613 {V_TYPEDATA, 7, 0, 0, LIST_ID, SMS_ACE},
1614 {V_TYPE, 8, ACE_TYPE, 0, 0, SMS_ACE},
1615 {V_TYPEDATA, 9, 0, 0, LIST_ID, SMS_ACE},
1618 static struct validate uzcl_validate = {
1630 static struct validate dzcl_validate = {
1642 static char *gasv_fields[] = {
1643 SERVICE, "protocol", "port", DESC,
1646 static char *gpcp_fields[] = {
1648 "printer", "spooling_host", "spool_directory", "rprinter", "comments",
1652 static char *apcp_fields[] = {
1653 "printer", "spooling_host", "spool_directory", "rprinter", "comments",
1657 static struct valobj apcp_valobj[] = {
1659 {V_ID, 1, MACHINE, NAME, MACH_ID, SMS_MACHINE},
1662 static struct validate apcp_validate = {
1674 static struct validate dpcp_validate = {
1686 static char *gpdm_fields[] = {
1688 NAME, "rpcnum", "host", MOD1, MOD2, MOD3,
1691 static char *apdm_fields[] = {
1692 NAME, "rpcnum", "host"
1695 static struct valobj apdm_valobj[] = {
1697 {V_ID, 2, MACHINE, NAME, MACH_ID, SMS_MACHINE},
1700 static struct validate apdm_validate = {
1712 static struct validate dpdm_validate = {
1724 static char *gali_fields[] = {
1725 NAME, TYPE, "trans",
1726 NAME, TYPE, "trans",
1729 static char *aali_fields[] = {
1730 NAME, TYPE, "trans",
1733 static struct valobj aali_valobj[] = {
1735 {V_TYPE, 1, "alias", 0, 0, SMS_TYPE},
1739 static struct validate aali_validate = {
1743 "a.name = \"%s\" and a.type = \"%s\" and a.trans = \"%s\"",
1751 static struct validate dali_validate = /* DELETE_ALIAS */
1756 "a.name = \"%s\" and a.type = \"%s\" and a.trans = \"%s\"",
1764 static char *gval_fields[] = {
1768 static struct valobj gval_valobj[] = {
1769 {V_NAME, 0, "values", NAME, 0, SMS_NO_MATCH},
1772 static struct validate gval_validate = {
1784 static char *aval_fields[] = {
1788 static struct validate aval_validate = /* for aval, uval, and dval */
1801 static char *dval_fields[] = {
1805 static char *gats_fields[] = {
1806 "table", "retrieves", "appends", "updates", "deletes", MOD1, MOD2, MOD3,
1811 /* Generalized Query Definitions */
1813 struct query Queries2[] = {
1815 /* Q_GALO - GET_ALL_LOGINS */
1821 "%c = u.login, %c = text(u.uid), %c = u.shell, %c = u.last, %c = u.first, %c = u.middle",
1830 /* Q_GAAL - GET_ALL_ACTIVE_LOGINS */
1831 "get_all_active_logins",
1836 "%c = u.login, %c = text(u.uid), %c = u.shell, %c = u.last, %c = u.first, %c = u.middle",
1845 /* Q_GUBL - GET_USER_BY_LOGIN */
1846 "get_user_by_login",
1851 "%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",
1854 "u.login = \"%s\" and u.users_id != 0",
1860 /* Q_GUBU - GET_USER_BY_UID */
1866 "%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",
1869 "u.uid = %s and u.users_id != 0",
1875 /* Q_GUBN - GET_USER_BY_NAME */
1881 "%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",
1884 "u.first = \"%s\" and u.last = \"%s\" and u.users_id != 0",
1890 /* Q_GUBC - GET_USER_BY_CLASS */
1891 "get_user_by_class",
1896 "%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",
1899 "u.mit_year = uppercase(\"%s\") and u.users_id != 0",
1905 /* Q_GUBM - GET_USER_BY_MITID */
1906 "get_user_by_mitid",
1911 "%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",
1914 "u.mit_id = \"%s\" and u.users_id != 0",
1920 /* Q_AUSR - ADD_USER */
1926 "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",
1929 "values.name = \"users_id\"",
1935 /* Q_RUSR - REGISTER_USER */
1950 /* Q_UUSR - UPDATE_USER */
1956 "login = %c, uid = int4(%c), shell = %c, last = %c, first = %c, middle = %c, status = int4(%c), mit_id = %c, mit_year = %c",
1965 /* Q_UUSH - UPDATE_USER_SHELL */
1966 "update_user_shell",
1980 /* Q_UUST - UPDATE_USER_STATUS */
1981 "update_user_status",
1986 "status = int4(%c)",
1995 /* Q_DUSR - DELETE_USER */
2010 /* Q_DUBU - DELETE_USER_BY_UID */
2011 "delete_user_by_uid",
2025 /* Q_GKUM - GET_KERBEROS_USER_MAP */
2026 "get_kerberos_user_map",
2031 "%c = users.login, %c = strings.string",
2034 "users.login = \"%s\" and strings.string = \"%s\" and k.users_id = users.users_id and k.string_id = strings.string_id",
2040 /* Q_AKUM - ADD_KERBEROS_USER_MAP */
2041 "add_kerberos_user_map",
2046 "users_id = %i4, string_id = %i4",
2055 /* Q_DKUM - DELETE_KERBEROS_USER_MAP */
2056 "delete_kerberos_user_map",
2064 "k.users_id = %d and k.string_id = %d",
2070 /* Q_GFBL - GET_FINGER_BY_LOGIN */
2071 "get_finger_by_login",
2076 "%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",
2085 /* Q_UFBL - UPDATE_FINGER_BY_LOGIN */
2086 "update_finger_by_login",
2091 "fullname=%c,nickname=%c,home_addr=%c,home_phone=%c,office_addr=%c,office_phone=%c,mit_dept=%c,mit_affil=%c",
2100 /* Q_GPOB - GET_POBOX */
2106 "%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",
2115 /* Q_GAPO - GET_ALL_POBOXES */
2121 "%c = u.login, %c = u.potype, %c = text(u.pop_id) + \":\" + text(u.box_id)",
2124 "u.potype != \"NONE\"",
2130 /* Q_GPOP - GET_POBOXES_POP */
2136 "%c = u.login, %c = u.potype, %c = text(u.pop_id) + \":\" + text(u.box_id)",
2139 "u.potype = \"POP\"",
2145 /* Q_GPOF - GET_POBOXES_SMTP */
2151 "%c = u.login, %c = u.potype, %c = text(u.pop_id) + \":\" + text(u.box_id)",
2154 "u.potype = \"SMTP\"",
2160 /* Q_SPOB - SET_POBOX */
2175 /* Q_SPOP - SET_POBOX_POP */
2190 /* Q_DPOB - DELETE_POBOX */
2196 "potype = \"NONE\"",
2205 /* Q_GMAC - GET_MACHINE */
2211 "%c = m.name, %c = m.type, %c = m.modtime, %c = text(m.modby), %c =m.modwith",
2214 "m.name = uppercase(\"%s\") and m.mach_id != 0",
2220 /* Q_AMAC - ADD_MACHINE */
2226 "name = uppercase(%c), mach_id = values.value, type = %c",
2229 "values.name = \"mach_id\"",
2235 /* Q_UMAC - UPDATE_MACHINE */
2241 "name = uppercase(%c), type = %c",
2250 /* Q_DMAC - DELETE_MACHINE */
2265 /* Q_GCLU - GET_CLUSTER */
2271 "%c = c.name, %c = c.desc, %c = c.location, %c = c.modtime, %c = text(c.modby), %c = c.modwith",
2274 "c.name = \"%s\" and c.clu_id != 0",
2280 /* Q_ACLU - ADD_CLUSTER */
2286 "name = %c, clu_id = values.value, desc = %c, location = %c",
2289 "values.name = \"clu_id\"",
2295 /* Q_UCLU - UPDATE_CLUSTER */
2301 "name = %c, desc = %c, location = %c",
2310 /* Q_DCLU - DELETE_CLUSTER */
2325 /* Q_GMCM - GET_MACHINE_TO_CLUSTER_MAP */
2326 "get_machine_to_cluster_map",
2331 "%c = machine.name, %c = cluster.name",
2334 "machine.name = uppercase(\"%s\") and cluster.name = \"%s\" and m.clu_id = cluster.clu_id and m.mach_id = machine.mach_id",
2340 /* Q_AMTC - ADD_MACHINE_TO_CLUSTER */
2341 "add_machine_to_cluster",
2346 "mach_id = %i4, clu_id = %i4",
2355 /* Q_DMFC - DELETE_MACHINE_FROM_CLUSTER */
2356 "delete_machine_from_cluster",
2364 "m.mach_id = %d and m.clu_id = %d",
2370 /* Q_GCLD - GET_CLUSTER_DATA */
2376 "%c = cluster.name, %c = s.serv_label, %c = s.serv_cluster",
2379 "cluster.clu_id = s.clu_id and cluster.name = \"%s\" and s.serv_label = \"%s\"",
2385 /* Q_ACLD - ADD_CLUSTER_DATA */
2391 "clu_id = %i4, serv_label = %c, serv_cluster = %c",
2400 /* Q_DCLD - DELETE_CLUSTER_DATA */
2401 "delete_cluster_data",
2409 "s.clu_id = %d and s.serv_label = \"%s\" and s.serv_cluster = \"%s\"",
2415 /* Q_GSIN - GET_SERVER_INFO */
2421 "%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",
2424 "s.name = uppercase(\"%s\")",
2430 /* Q_QGSV - QUALIFIED_GET_SERVER */
2431 "qualified_get_server",
2445 /* Q_ASIN - ADD_SERVER_INFO */
2451 "name = uppercase(%c), update_int = int4(%c), target_file = %c, script = %c, type = %c, enable = int1(%c), acl_type = %c, acl_id = %i4",
2460 /* Q_USIN - UPDATE_SERVER_INFO */
2461 "update_server_info",
2466 "update_int = int4(%c), target_file = %c, script = %c, type = %c, enable = int1(%c), acl_type = %c, acl_id = %i4",
2469 "s.name = uppercase(\"%s\")",
2475 /* Q_RSVE - RESET_SERVER_ERROR */
2476 "reset_server_error",
2481 "harderror = 0, dfcheck = s.dfgen",
2484 "s.name = uppercase(\"%s\")",
2490 /* Q_SSIF - SET_SERVER_INTERNAL_FLAGS */
2491 "set_server_internal_flags",
2496 "dfgen = int4(%c), dfcheck = int4(%c), inprogress = int1(%c), harderror = int1(%c), errmsg = %c",
2499 "s.name = uppercase(\"%s\")",
2505 /* Q_DSIN - DELETE_SERVER_INFO */
2506 "delete_server_info",
2514 "s.name = uppercase(\"%s\")",
2520 /* Q_GSHI - GET_SERVER_HOST_INFO */
2521 "get_server_host_info",
2526 "%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",
2529 "sh.service = uppercase(\"%s\") and machine.name = uppercase(\"%s\") and machine.mach_id = sh.mach_id",
2535 /* Q_QGSV - QUALIFIED_GET_SERVER_HOST */
2536 "qualified_get_server_host",
2550 /* Q_ASHI - ADD_SERVER_HOST_INFO */
2551 "add_server_host_info",
2556 "service = uppercase(%c), mach_id = %i4, enable = int1(%c), value1 = int4(%c), value2 = int4(%c), value3 = %c",
2565 /* Q_USHI - UPDATE_SERVER_HOST_INFO */
2566 "update_server_host_info",
2571 "enable = int1(%c), value1 = int4(%c), value2 = int4(%c), value3 = %c",
2574 "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
2580 /* Q_RSHE - RESET_SERVER_HOST_ERROR */
2581 "reset_server_host_error",
2589 "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
2595 /* Q_SSHO - SET_SERVER_HOST_OVERRIDE */
2596 "set_server_host_override",
2604 "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
2610 /* Q_SSHI - SET_SERVER_HOST_INTERNAL */
2611 "set_server_host_internal",
2616 "override = int1(%c), success = int1(%c), inprogress = int1(%c), hosterror = int1(%c), hosterrmsg = %c, ltt = int4(%c), lts = int4(%c)",
2619 "s.service = uppercase(\"%s\") and s.mach_id = machine.mach_id and machine.name = \"%s\"",
2625 /* Q_DSHI - DELETE_SERVER_HOST_INFO */
2626 "delete_server_host_info",
2634 "sh.service = uppercase(\"%s\") and sh.mach_id = %d",
2640 /* Q_GSHA - GET_SERVER_HOST_ACCESS */
2641 "get_server_host_access",
2646 "%c = machine.name, %c = ha.acl_type, %c = text(ha.acl_id), %c = ha.modtime, %c = text(ha.modby), %c = ha.modwith",
2649 "machine.name = uppercase(\"%s\") and ha.mach_id = machine.mach_id",
2655 /* Q_ASHA - ADD_SERVER_HOST_ACCESS */
2656 "add_server_host_access",
2661 "mach_id = %i4, acl_type = %c, acl_id = %i4",
2670 /* Q_USHA - UPDATE_SERVER_HOST_ACCESS */
2671 "update_server_host_access",
2676 "acl_type = %c, acl_id = %i4",
2685 /* Q_DSHA - DELETE_SERVER_HOST_ACCESS */
2686 "delete_server_host_access",
2700 /* Q_GSLO - GET_SERVER_LOCATIONS */
2701 "get_server_locations",
2706 "%c = sh.service, %c = machine.name",
2709 "sh.service = uppercase(\"%s\") and sh.mach_id = machine.mach_id",
2715 /* Q_GFSL - GET_FILESYS_BY_LABEL */
2716 "get_filesys_by_label",
2721 "%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",
2724 "fs.label = \"%s\" and fs.mach_id = machine.mach_id and fs.owner = users.users_id and fs.owners = list.list_id",
2730 /* Q_GFSM - GET_FILESYS_BY_MACHINE */
2731 "get_filesys_by_machine",
2736 "%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",
2739 "fs.mach_id = %d and machine.mach_id = fs.mach_id and fs.owner = users.users_id and fs.owners = list.list_id",
2745 /* Q_GFSN - GET_FILESYS_BY_NFSPHYS */
2746 "get_filesys_by_nfsphys",
2751 "%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",
2754 "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\"",
2760 /* Q_GFSG - GET_FILESYS_BY_GROUP */
2761 "get_filesys_by_group",
2766 "%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",
2769 "fs.owners = %d and machine.mach_id = fs.mach_id and fs.owner = users.users_id and fs.owners = list.list_id",
2775 /* Q_AFIL - ADD_FILESYS */
2781 "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",
2784 "values.name = \"filsys_id\"",
2790 /* Q_UFIL - UPDATE_FILESYS */
2796 "label = %c, type = %c, mach_id = %i4, name = %c, mount = %c, access = %c, comments = %c, owner = %i4, owners = %i4, createflg = int1(%c), lockertype = %c",
2799 "fs.filsys_id = %d",
2805 /* Q_DFIL - DELETE_FILESYS */
2814 "fs.filsys_id = %d",
2820 /* Q_GFGM - GET_FSGROUOP_MEMBERS */
2821 "get_fsgroup_members",
2826 "%c = filesys.label, %c = fg.key",
2829 "fg.group_id = %d and filesys.filsys_id = fg.filsys_id",
2835 /* Q_AFTG - ADD_FILESYS_TO_FSGROUP */
2836 "add_filesys_to_fsgroup",
2841 "group_id = filesys.filsys_id, filsys_id = %i4, key = %c",
2844 "filesys.filsys_id = %d and filesys.type = \"FSGROUP\"",
2850 /* Q_RFFG - REMOVE_FILESYS_FROM_FSGROUP */
2851 "remove_filesys_from_fsgroup",
2859 "fg.group_id = %d and fg.filsys_id = %d",
2865 /* Q_GANF - GET_ALL_NFSPHYS */
2871 "%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",
2874 "machine.mach_id = np.mach_id",
2880 /* Q_GNFP - GET_NFSPHYS */
2886 "%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",
2889 "np.mach_id = %d and np.dir = \"%s\" and machine.mach_id = np.mach_id",
2895 /* Q_ANFP - ADD_NFSPHYS */
2901 "nfsphys_id = values.value, mach_id = %i4, dir = %c, device = %c, status = int4(%c), allocated = int4(%c), size = int4(%c)",
2904 "values.name = \"nfsphys_id\"",
2910 /* Q_UNFP - UPDATE_NFSPHYS */
2916 "device = %c, status = int4(%c), allocated = int4(%c), size = int4(%c)",
2919 "np.mach_id = %d and np.dir = \"%s\"",
2925 /* Q_AJNF - ADJUST_NFSPHYS_ALLOCATION */
2926 "adjust_nfsphys_allocation",
2931 "allocated = np.allocated + int4(%c)",
2934 "np.mach_id = %d and np.dir = \"%s\"",
2940 /* Q_DNFP - DELETE_NFSPHYS */
2949 "np.mach_id = %d and np.dir = \"%s\"",
2955 /* Q_GNFQ - GET_NFS_QUOTAS */
2961 "%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",
2964 "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",
2970 /* Q_GNQP - GET_NFS_QUOTAS_BY_PARTITION */
2971 "get_nfs_quotas_by_partition",
2976 "%c = filesys.label, %c = users.login, %c = text(nq.quota), %c = nfsphys.dir, %c = machine.name",
2979 "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",
2985 /* Q_ANFQ - ADD_NFS_QUOTA */
2991 "filsys_id = filesys.filsys_id, users_id = %i4, quota = int4(%c), phys_id = filesys.phys_id",
2994 "filesys.filsys_id = %d",
3000 /* Q_UNFQ - UPDATE_NFS_QUOTA */
3009 "nq.filsys_id = %d and nq.users_id = %d",
3015 /* Q_DNFQ - DELETE_NFS_QUOTA */
3024 "nq.filsys_id = %d and nq.users_id = %d",
3030 /* Q_GLIN - GET_LIST_INFO */
3045 /* Q_EXLN - EXPAND_LIST_NAMES */
3046 "expand_list_names",
3054 "l.name = \"%s\" and l.list_id != 0",
3060 /* Q_ALIS - ADD_LIST */
3066 "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",
3069 "values.name = \"list_id\"",
3075 /* Q_ULIS - UPDATE_LIST */
3081 "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",
3090 /* Q_DLIS - DELETE_LIST */
3105 /* Q_AMTL - ADD_MEMBER_TO_LIST */
3106 "add_member_to_list",
3120 /* Q_DMFL - DELETE_MEMBER_FROM_LIST */
3121 "delete_member_from_list",
3135 /* Q_GAUS - GET_ACE_USE */
3150 /* Q_QGLI - QUALIFIED_GET_LISTS */
3151 "qualified_get_lists",
3165 /* Q_GMOL - GET_MEMBERS_OF_LIST */
3166 "get_members_of_list",
3180 /* Q_GLOM - GET_LISTS_OF_MEMBER */
3181 "get_lists_of_member",
3195 /* Q_CMOL - COUNT_MEMBERS_OF_LIST */
3196 "count_members_of_list",
3210 /* Q_GZCL - GET_ZEPHYR_CLASS */
3216 "%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",
3225 /* Q_AZCL - ADD_ZEPHYR_CLASS */
3231 "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",
3240 /* Q_UZCL - UPDATE_ZEPHYR_CLASS */
3241 "update_zephyr_class",
3246 "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",
3255 /* Q_DZCL - DELETE_ZEPHYR_CLASS */
3256 "delete_zephyr_class",
3270 /* Q_GSVC - GET_SERVICE */
3276 "%c = s.name, %c = s.protocol, %c = text(s.port), %c = s.desc, %c = s.modtime, %c = text(s.modby), %c = s.modwith",
3285 /* Q_ASVC - ADD_SERVICE */
3291 "name = %c, protocol = %c, port = int2(%c), desc = %c",
3300 /* Q_DSVC - DELETE_SERVICE */
3315 /* Q_GPCP - GET_PRINTCAP */
3321 "%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",
3324 "p.name = \"%s\" and machine.mach_id = p.mach_id",
3330 /* Q_APCP - ADD_PRINTCAP */
3336 "name = %c, mach_id = %i4, dir = %c, rp = %c, comments = %c",
3345 /* Q_DPCP - DELETE_PRINTCAP */
3360 /* Q_GPDM - GET_PALLADIUM */
3366 "%c = p.name, %c = text(p.ident), %c = machine.name, %c = p.modtime, %c = text(p.modby), %c = p.modwith",
3369 "p.name = \"%s\" and machine.mach_id = p.mach_id",
3375 /* Q_APDM - ADD_PALLADIUM */
3381 "name = %c, ident = int4(%c), mach_id = %i4",
3390 /* Q_DPDM - DELETE_PALLADIUM */
3405 /* Q_GALI - GET_ALIAS */
3411 "%c = a.name, %c = a.type, %c = a.trans",
3414 "a.name = \"%s\" and a.type = \"%s\" and a.trans = \"%s\"",
3420 /* Q_AALI - ADD_ALIAS */
3426 "name = %c, type = %c, trans = %c",
3435 /* Q_DALI - DELETE_ALIAS */
3444 "a.name = \"%s\" and a.type = \"%s\" and a.trans = \"%s\"",
3450 /* Q_GVAL - GET_VALUE */
3456 "%c = text(v.value)",
3465 /* Q_AVAL - ADD_VALUE */
3471 "name = %c, value = int4(%c)",
3480 /* Q_UVAL - UPDATE_VALUE */
3495 /* Q_DVAL - DELETE_VALUE */
3510 /* Q_GATS - GET_ALL_TABLE_STATS */
3511 "get_all_table_stats",
3516 "%c = tbs.table, %c = text(tbs.retrieves), %c = text(tbs.appends), %c = text(tbs.updates), %c = text(tbs.deletes), %c = tbs.modtime",
3526 int QueryCount2 = (sizeof Queries2 / sizeof (struct query));