3 * This file defines the query dispatch table for version 2 of the protocol
5 * Copyright (C) 1987-1998 by the Massachusetts Institute of Technology.
6 * For copying and distribution information, please see the file
10 #include <mit-copyright.h>
11 #include "mr_server.h"
17 * These are commonly used validation objects, defined here so that they
21 static struct valobj VOuser0[] = {
22 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
25 static struct valobj VOmach0[] = {
26 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
29 static struct valobj VOclu0[] = {
30 {V_ID, 0, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
33 static struct valobj VOsnet0[] = {
34 {V_ID, 0, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
37 static struct valobj VOlist0[] = {
38 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
41 static struct valobj VOfilesys0[] = {
42 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
45 static struct valobj VOnum0[] = {
50 * Commonly used validation records defined here so that they may
54 static struct validate VDmach = { VOmach0, 1 };
56 static struct validate VDfix_modby = {
70 static char *galo_fields[] = {
71 "login", "unix_uid", "shell", "last", "first", "middle",
74 static char *gual_fields[] = {
76 "login", "unix_uid", "shell", "last", "first", "middle", "status",
77 "clearid", "class", "comments", "signature", "secure",
78 "modtime", "modby", "modwith",
81 static char *gubl_fields[] = {
83 "login", "unix_uid", "shell", "last", "first", "middle", "status",
84 "clearid", "class", "modtime", "modby", "modwith",
87 static struct validate gubl_validate =
100 static char *guau_fields[] = {
102 "login", "unix_uid", "shell", "last", "first", "middle", "status",
103 "clearid", "class", "comments", "signature", "secure",
104 "modtime", "modby", "modwith",
107 static char *guan_fields[] = {
109 "login", "unix_uid", "shell", "last", "first", "middle", "status",
110 "clearid", "class", "comments", "signature", "secure",
111 "modtime", "modby", "modwith",
114 static struct validate guan_validate =
127 static char *guac_fields[] = {
129 "login", "unix_uid", "shell", "last", "first", "middle", "status",
130 "clearid", "class", "comments", "signature", "secure",
131 "modtime", "modby", "modwith",
134 static char *guam_fields[] = {
136 "login", "unix_uid", "shell", "last", "first", "middle", "status",
137 "clearid", "class", "comments", "signature", "secure",
138 "modtime", "modby", "modwith",
141 static char *gubu_fields[] = {
143 "login", "unix_uid", "shell", "last", "first", "middle", "status",
144 "clearid", "class", "modtime", "modby", "modwith",
147 static struct validate gubu_validate =
160 static char *gubn_fields[] = {
162 "login", "unix_uid", "shell", "last", "first", "middle", "status",
163 "clearid", "class", "modtime", "modby", "modwith",
166 static struct validate gubn_validate =
179 static char *gubc_fields[] = {
181 "login", "unix_uid", "shell", "last", "first", "middle", "status",
182 "clearid", "class", "modtime", "modby", "modwith",
185 static char *gubm_fields[] = {
187 "login", "unix_uid", "shell", "last", "first", "middle", "status",
188 "clearid", "class", "modtime", "modby", "modwith",
191 static char *auac_fields[] = {
192 "login", "unix_uid", "shell", "last", "first", "middle", "status",
193 "clearid", "class", "comments", "signature", "secure",
196 static struct valobj auac_valobj[] = {
197 {V_CHAR, 0, USERS_TABLE, "login"},
199 {V_CHAR, 2, USERS_TABLE, "shell"},
200 {V_CHAR, 3, USERS_TABLE, "last"},
201 {V_CHAR, 4, USERS_TABLE, "first"},
202 {V_CHAR, 5, USERS_TABLE, "middle"},
204 {V_CHAR, 7, USERS_TABLE, "clearid"},
205 {V_TYPE, 8, 0, "class", 0, MR_BAD_CLASS},
206 {V_ID, 9, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
210 static struct validate auac_validate = {
222 static struct validate ausr_validate = {
234 static char *rusr_fields[] = {
235 "unix_uid", "login", "fs_type"
238 static struct valobj rusr_valobj[] = {
240 {V_CHAR, 1, USERS_TABLE, "login"},
244 static struct validate rusr_validate = {
256 static char *uuac_fields[] = {
258 "newlogin", "unix_uid", "shell", "last", "first", "middle", "status",
259 "clearid", "class", "comments", "signature", "secure",
262 static struct valobj uuac_valobj[] = {
263 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
264 {V_RENAME, 1, USERS_TABLE, "login", "users_id", MR_NOT_UNIQUE},
266 {V_CHAR, 3, USERS_TABLE, "shell"},
267 {V_CHAR, 4, USERS_TABLE, "first"},
268 {V_CHAR, 5, USERS_TABLE, "last"},
269 {V_CHAR, 6, USERS_TABLE, "middle"},
271 {V_CHAR, 8, USERS_TABLE, "clearid"},
272 {V_TYPE, 9, 0, "class", 0, MR_BAD_CLASS},
273 {V_ID, 10, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
277 static struct validate uuac_validate = {
289 static struct validate uusr_validate = {
301 static char *uush_fields[] = {
306 static struct valobj uush_valobj[] = {
307 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
308 {V_CHAR, 1, USERS_TABLE, "shell"},
311 static struct validate uush_validate = {
323 static char *uust_fields[] = {
328 static char *uuss_fields[] = {
333 static struct valobj uust_valobj[] = {
334 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
339 static struct validate uust_validate = {
351 static char *dusr_fields[] = {
355 static struct validate dusr_validate = {
367 static char *gkum_fields[] = { "login", "kerberos",
368 "login", "kerberos" };
370 static char *akum_fields[] = { "login", "kerberos" };
372 static struct valobj akum_valobj[] =
374 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
375 {V_ID, 1, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
378 static struct validate akum_validate =
383 "users_id = %d or string_id = %d",
391 static struct validate dkum_validate =
396 "users_id = %d and string_id = %d",
404 static char *gfbl_fields[] = {
406 "login", "fullname", "nickname", "home_addr",
407 "home_phone", "office_addr", "office_phone", "department",
408 "affiliation", "modtime", "modby", "modwith",
411 static struct validate gfbl_validate = {
423 static char *ufbl_fields[] = {
425 "fullname", "nickname", "home_addr",
426 "home_phone", "office_addr", "office_phone", "department",
430 static struct valobj ufbl_valobj[] = {
431 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
432 {V_LEN, 1, USERS_TABLE, "fullname"},
433 {V_LEN, 2, USERS_TABLE, "nickname"},
434 {V_LEN, 3, USERS_TABLE, "home_addr"},
435 {V_LEN, 4, USERS_TABLE, "home_phone"},
436 {V_LEN, 5, USERS_TABLE, "office_addr"},
437 {V_LEN, 6, USERS_TABLE, "office_phone"},
438 {V_LEN, 7, USERS_TABLE, "department"},
439 {V_LEN, 8, USERS_TABLE, "affiliation"},
442 static struct validate ufbl_validate = {
454 static char *gpob_fields[] = {
456 "login", "type", "box", "modtime", "modby", "modwith",
459 static struct validate gpob_validate = {
463 "potype != 'NONE' and users_id = %d",
471 static char *gpox_fields[] = {
472 "login", "type", "box",
475 static struct validate gpox_validate = {
487 static char *spob_fields[] = {
488 "login", "type", "box",
491 static struct valobj spob_valobj[] = {
492 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
493 {V_TYPE, 1, 0, "pobox", 0, MR_TYPE},
496 static struct validate spob_validate = /* SET_POBOX */
509 static struct validate spop_validate = /* SET_POBOX_POP */
522 static struct validate dpob_validate = /* DELETE_POBOX */
535 static char *gmac_fields[] = {
537 "name", "type", "modtime", "modby", "modwith",
540 static char *ghst_fields[] = {
541 "name", "address", "location", "network",
542 "name", "vendor", "model", "os", "location", "contact", "use",
543 "status", "status_change", "network", "address", "ace_type",
544 "ace_name", "admin_comment", "ops_comment", "created", "creator",
545 "inuse", "modtime", "modby", "modwith",
548 static struct validate ghst_validate = {
560 static char *ghha_fields[] = {
565 static char *ahst_fields[] = {
566 "name", "vendor", "model", "os", "location", "contact", "use",
567 "status", "subnet", "address", "ace_type", "ace_name",
568 "admin_comment", "ops_comment",
571 static struct valobj ahst_valobj[] = {
572 {V_CHAR, 0, MACHINE_TABLE, "name"},
573 {V_CHAR, 1, MACHINE_TABLE, "vendor"},
574 {V_CHAR, 2, MACHINE_TABLE, "model"},
575 {V_CHAR, 3, MACHINE_TABLE, "os"},
576 {V_CHAR, 4, MACHINE_TABLE, "location"},
577 {V_CHAR, 5, MACHINE_TABLE, "contact"},
580 {V_ID, 8, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
581 {V_TYPE, 10, 0, "ace_type", 0, MR_ACE},
582 {V_TYPEDATA, 11, 0, 0, 0, MR_ACE},
583 {V_ID, 12, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
584 {V_ID, 13, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
587 static struct validate ahst_validate = {
591 "name = UPPER('%s')",
596 set_uppercase_modtime,
599 static char *uhst_fields[] = {
601 "newname", "vendor", "model", "os", "location", "contact", "use",
602 "status", "subnet", "address", "ace_type", "ace_name",
603 "admin_comment", "ops_comment",
606 static struct valobj uhst_valobj[] = {
607 {V_CHAR, 0, MACHINE_TABLE, "name"},
608 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
609 {V_RENAME, 1, MACHINE_TABLE, "name", "mach_id", MR_NOT_UNIQUE},
610 {V_CHAR, 2, MACHINE_TABLE, "vendor"},
611 {V_CHAR, 3, MACHINE_TABLE, "model"},
612 {V_CHAR, 4, MACHINE_TABLE, "os"},
613 {V_CHAR, 5, MACHINE_TABLE, "location"},
614 {V_CHAR, 6, MACHINE_TABLE, "contact"},
617 {V_ID, 9, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
618 {V_TYPE, 11, 0, "ace_type", 0, MR_ACE},
619 {V_TYPEDATA, 12, 0, 0, 0, MR_ACE},
620 {V_ID, 13, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
621 {V_ID, 14, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
624 static struct validate uhst_validate = {
636 static char *uhha_fields[] = {
641 static struct valobj uhha_valobj[] = {
642 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
643 {V_CHAR, 1, MACHINE_TABLE, "hwaddr"},
646 static struct validate uhha_validate = {
658 static char *dhst_fields[] = {
662 static struct validate dhst_validate = {
674 static char *ghal_fields[] = {
675 "alias", "canonical_hostname",
676 "alias", "canonical_hostname"
679 static struct validate ghal_validate = {
691 static struct valobj ahal_valobj[] = {
692 {V_CHAR, 0, HOSTALIAS_TABLE, "name"},
693 {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
696 static struct validate ahal_validate = {
700 "name = UPPER('%s')",
708 static struct valobj dhal_valobj[] = {
709 {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
712 static struct validate dhal_validate = {
716 "name = UPPER('%s') AND mach_id = %d",
724 static char *gsnt_fields[] = {
726 "name", "description", "address", "mask", "low", "high", "prefix",
727 "ace_type", "ace_name", "modtime", "modby", "modwith"
730 static struct validate gsnt_validate = {
742 static char *asnt_fields[] = {
743 "name", "description", "address", "mask", "low", "high", "prefix",
744 "ace_type", "ace_name",
747 static struct valobj asnt_valobj[] = {
748 {V_CHAR, 0, SUBNET_TABLE, "name"},
749 {V_LEN, 1, SUBNET_TABLE, "description"},
754 {V_LEN, 6, SUBNET_TABLE, "prefix"},
755 {V_TYPE, 7, 0, "ace_type", 0, MR_ACE},
756 {V_TYPEDATA, 8, 0, 0, 0, MR_ACE},
759 static struct validate asnt_validate =
764 "name = UPPER('%s')",
769 set_uppercase_modtime,
772 static char *usnt_fields[] = {
774 "newname", "description", "address", "mask", "low", "high", "prefix",
775 "ace_type", "ace_name",
778 static struct valobj usnt_valobj[] = {
779 {V_ID, 0, SUBNET_TABLE, "name", "snet_id", MR_NO_MATCH},
780 {V_RENAME, 1, SUBNET_TABLE, "name", "snet_id", MR_NOT_UNIQUE},
781 {V_LEN, 2, SUBNET_TABLE, "description"},
786 {V_LEN, 7, SUBNET_TABLE, "prefix"},
787 {V_TYPE, 8, 0, "ace_type", 0, MR_ACE},
788 {V_TYPEDATA, 9, 0, 0, 0, MR_ACE},
791 static struct validate usnt_validate =
804 static char *dsnt_fields[] = {
808 static struct validate dsnt_validate = {
820 static char *gclu_fields[] = {
822 "name", "description", "location", "modtime", "modby", "modwith",
825 static char *aclu_fields[] = {
826 "name", "description", "location",
829 static struct valobj aclu_valobj[] = {
830 {V_CHAR, 0, CLUSTERS_TABLE, "name"},
831 {V_LEN, 1, CLUSTERS_TABLE, "description"},
832 {V_LEN, 2, CLUSTERS_TABLE, "location"},
835 static struct validate aclu_validate =
848 static char *uclu_fields[] = {
850 "newname", "description", "location",
853 static struct valobj uclu_valobj[] = {
854 {V_ID, 0, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
855 {V_RENAME, 1, CLUSTERS_TABLE, "name", "clu_id", MR_NOT_UNIQUE},
856 {V_LEN, 2, CLUSTERS_TABLE, "description"},
857 {V_LEN, 3, CLUSTERS_TABLE, "location"},
860 static struct validate uclu_validate = {
872 static char *dclu_fields[] = {
876 static struct validate dclu_validate = {
888 static char *gmcm_fields[] = {
889 "machine", "cluster",
890 "machine", "cluster",
893 static struct valobj amtc_valobj[] = /* ADD_MACHINE_TO_CLUSTER */
894 { /* DELETE_MACHINE_FROM_CLUSTER */
895 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
896 {V_ID, 1, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
899 static struct validate amtc_validate = /* for amtc and dmfc */
904 "mach_id = %d and clu_id = %d",
909 set_mach_modtime_by_id,
912 static char *gcld_fields[] = {
913 "cluster", "serv_label",
914 "cluster", "serv_label", "serv_cluster",
917 static char *acld_fields[] = {
918 "cluster", "serv_label", "serv_cluster",
921 static struct valobj acld_valobj[] =
923 {V_ID, 0, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
924 {V_CHAR, 1, SVC_TABLE, "serv_label"},
925 {V_CHAR, 2, SVC_TABLE, "serv_cluster"}
928 static struct validate acld_validate =
933 "clu_id = %d AND serv_label = '%s' AND serv_cluster = '%s'",
938 set_cluster_modtime_by_id,
941 static struct validate dcld_validate =
946 "clu_id = %d AND serv_label = '%s' AND serv_cluster = '%s'",
951 set_cluster_modtime_by_id,
954 static char *glin_fields[] = {
956 "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
957 "ace_type", "ace_name", "description", "modtime", "modby", "modwith",
960 static struct validate glin_validate = {
967 access_vis_list_by_name,
972 static char *alis_fields[] = {
973 "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
974 "ace_type", "ace_name", "description",
977 static struct valobj alis_valobj[] = {
978 {V_CHAR, 0, LIST_TABLE, "name"},
985 {V_TYPE, 7, 0, "ace_type", 0, MR_ACE},
986 {V_TYPEDATA, 8, 0, 0, "list_id", MR_ACE},
987 {V_LEN, 9, LIST_TABLE, "description"},
990 static struct validate alis_validate = {
1002 static char *ulis_fields[] = {
1004 "newname", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
1005 "ace_type", "ace_name", "description",
1008 static struct valobj ulis_valobj[] = {
1009 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
1010 {V_RENAME, 1, LIST_TABLE, "name", "list_id", MR_NOT_UNIQUE},
1017 {V_TYPE, 8, 0, "ace_type", 0, MR_ACE},
1018 {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
1019 {V_LEN, 10, LIST_TABLE, "description"},
1022 static struct validate ulis_validate = {
1034 static char *dlis_fields[] = {
1038 static struct validate dlis_validate = {
1050 static char *amtl_fields[] = {
1051 "list_name", "member_type", "member_name",
1054 static char *atml_fields[] = {
1055 "list_name", "member_type", "member_name", "tag",
1058 static struct valobj amtl_valobj[] = {
1059 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
1060 {V_TYPE, 1, 0, "member", 0, MR_TYPE},
1061 {V_TYPEDATA, 2, 0, 0, 0, MR_NO_MATCH},
1062 {V_ID, 3, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
1065 static struct validate amtl_validate =
1078 static struct validate atml_validate =
1091 static struct validate tmol_validate =
1096 "list_id = %d AND member_type = '%s' AND member_id = %d",
1104 static struct validate dmfl_validate =
1114 delete_member_from_list,
1117 static char *gaus_fields[] = {
1118 "ace_type", "ace_name",
1119 "use_type", "use_name",
1122 static struct valobj gaus_valobj[] = {
1123 {V_TYPE, 0, 0, "gaus", 0, MR_TYPE},
1124 {V_TYPEDATA, 1, 0, 0, 0, MR_NO_MATCH},
1127 static struct validate gaus_validate = {
1139 static char *qgli_fields[] = {
1140 "active", "publicflg", "hidden", "maillist", "grouplist",
1144 static struct valobj qgli_valobj[] = {
1145 {V_TYPE, 0, 0, "boolean", 0, MR_TYPE},
1146 {V_TYPE, 1, 0, "boolean", 0, MR_TYPE},
1147 {V_TYPE, 2, 0, "boolean", 0, MR_TYPE},
1148 {V_TYPE, 3, 0, "boolean", 0, MR_TYPE},
1149 {V_TYPE, 4, 0, "boolean", 0, MR_TYPE},
1152 static struct validate qgli_validate = {
1161 qualified_get_lists,
1164 static char *gmol_fields[] = {
1166 "member_type", "member_name",
1169 static char *gtml_fields[] = {
1171 "member_type", "member_name", "tag",
1174 static struct validate gmol_validate = {
1181 access_visible_list,
1183 get_members_of_list,
1186 static char *glom_fields[] = {
1187 "member_type", "member_name",
1188 "list_name", "active", "publicflg", "hidden", "maillist", "grouplist",
1191 static struct valobj glom_valobj[] = {
1192 {V_TYPE, 0, 0, "rmember", 0, MR_TYPE},
1193 {V_TYPEDATA, 1, 0, 0, 0, MR_NO_MATCH},
1196 static struct validate glom_validate = {
1205 get_lists_of_member,
1208 static char *cmol_fields[] = {
1213 static struct validate cmol_validate = {
1220 access_visible_list,
1222 count_members_of_list,
1225 static char *gsin_fields[] = {
1227 "service", "update_int", "target_file", "script", "dfgen", "dfcheck",
1228 "type", "enable", "inprogress", "harderror", "errmsg",
1229 "ace_type", "ace_name", "modtime", "modby", "modwith",
1232 static struct validate gsin_validate =
1245 static char *qgsv_fields[] = {
1246 "enable", "inprogress", "harderror",
1250 static struct valobj qgsv_valobj[] = {
1251 {V_TYPE, 0, 0, "boolean", 0, MR_TYPE},
1252 {V_TYPE, 1, 0, "boolean", 0, MR_TYPE},
1253 {V_TYPE, 2, 0, "boolean", 0, MR_TYPE},
1256 static struct validate qgsv_validate = {
1265 qualified_get_server,
1268 static char *asin_fields[] = {
1269 "service", "update_int", "target_file", "script", "type", "enable",
1270 "ace_type", "ace_name",
1273 static struct valobj asin_valobj[] = {
1274 {V_CHAR, 0, SERVERS_TABLE, "name"},
1276 {V_LEN, 2, SERVERS_TABLE, "target_file"},
1277 {V_LEN, 3, SERVERS_TABLE, "script"},
1278 {V_TYPE, 4, 0, "service", 0, MR_TYPE},
1280 {V_TYPE, 6, 0, "ace_type", 0, MR_ACE},
1281 {V_TYPEDATA, 7, 0, 0, 0, MR_ACE},
1284 static struct validate asin_validate = /* for asin, usin */
1289 "name = UPPER('%s')",
1294 set_uppercase_modtime,
1297 static struct validate rsve_validate = {
1301 "name = UPPER('%s')",
1306 set_uppercase_modtime,
1309 static char *ssif_fields[] = {
1310 "service", "dfgen", "dfcheck", "inprogress", "harderror", "errmsg",
1313 static struct valobj ssif_valobj[] = {
1314 {V_NAME, 0, SERVERS_TABLE, "name", 0, MR_SERVICE},
1319 {V_LEN, 5, SERVERS_TABLE, "errmsg"},
1322 static struct validate ssif_validate = {
1326 "name = UPPER('%s')",
1334 static char *dsin_fields[] = {
1338 static struct validate dsin_validate = {
1342 "name = UPPER('%s')",
1350 static char *gshi_fields[] = {
1351 "service", "machine",
1352 "service", "machine", "enable", "override", "success", "inprogress",
1353 "hosterror", "hosterrormsg", "ltt", "lts", "value1", "value2",
1354 "value3", "modtime", "modby", "modwith",
1357 static struct validate gshi_validate = {
1369 static char *qgsh_fields[] = {
1370 "service", "enable", "override", "success", "inprogress", "hosterror",
1371 "service", "machine",
1374 static struct valobj qgsh_valobj[] = {
1375 {V_TYPE, 1, 0, "boolean", 0, MR_TYPE},
1376 {V_TYPE, 2, 0, "boolean", 0, MR_TYPE},
1377 {V_TYPE, 3, 0, "boolean", 0, MR_TYPE},
1378 {V_TYPE, 4, 0, "boolean", 0, MR_TYPE},
1379 {V_TYPE, 5, 0, "boolean", 0, MR_TYPE},
1382 static struct validate qgsh_validate = {
1391 qualified_get_serverhost,
1394 static char *ashi_fields[] = {
1395 "service", "machine", "enable", "value1", "value2", "value3",
1398 static struct valobj ashi_valobj[] = {
1399 {V_NAME, 0, SERVERS_TABLE, "name", 0, MR_SERVICE},
1400 {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1404 {V_LEN, 5, SERVERHOSTS_TABLE, "value3"},
1407 static struct validate ashi_validate = /* ashi & ushi */
1412 "service = UPPER('%s') AND mach_id = %d",
1417 set_serverhost_modtime,
1420 static struct validate rshe_validate =
1425 "service = UPPER('%s') AND mach_id = %d",
1430 set_serverhost_modtime,
1433 static struct validate ssho_validate =
1438 "service = UPPER('%s') AND mach_id = %d",
1446 static char *sshi_fields[] = {
1447 "service", "machine", "override", "success", "inprogress",
1448 "hosterror", "errmsg", "ltt", "lts",
1451 static struct valobj sshi_valobj[] = {
1452 {V_NAME, 0, SERVERS_TABLE, "name", 0, MR_SERVICE},
1453 {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1458 {V_LEN, 6, SERVERHOSTS_TABLE, "hosterrmsg"},
1463 static struct validate sshi_validate =
1476 static char *dshi_fields[] = {
1477 "service", "machine",
1480 static struct validate dshi_validate =
1485 "service = UPPER('%s') AND mach_id = %d",
1493 static char *gslo_fields[] = {
1495 "server", "machine",
1498 static char *gfsl_fields[] = {
1500 "label", "type", "machine", "name", "mount", "access", "comments",
1501 "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith",
1504 static char *gfsm_fields[] = {
1506 "label", "type", "machine", "name", "mount", "access", "comments",
1507 "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith",
1510 static struct validate gfsm_validate = {
1522 static char *gfsn_fields[] = {
1523 "machine", "parition",
1524 "label", "type", "machine", "name", "mount", "access", "comments",
1525 "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith",
1528 static struct validate gfsn_validate = {
1540 static char *gfsp_fields[] = {
1542 "label", "type", "machine", "name", "mount", "access", "comments",
1543 "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith",
1546 static char *gfsg_fields[] = {
1548 "label", "type", "machine", "name", "mount", "access", "comments",
1549 "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith",
1552 static struct validate gfsg_validate = {
1564 static char *afil_fields[] = {
1565 "label", "type", "machine", "name", "mount", "access", "comments",
1566 "owner", "owners", "create", "lockertype",
1569 static struct valobj afil_valobj[] = {
1570 {V_CHAR, 0, FILESYS_TABLE, "label"},
1571 {V_TYPE, 1, 0, "filesys", 0, MR_FSTYPE},
1572 {V_ID, 2, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1573 {V_CHAR, 3, FILESYS_TABLE, "name"},
1574 {V_LEN, 4, FILESYS_TABLE, "mount"},
1575 {V_LEN, 5, FILESYS_TABLE, "rwaccess"},
1576 {V_LEN, 6, FILESYS_TABLE, "comments"},
1577 {V_ID, 7, USERS_TABLE, "login", "users_id", MR_USER},
1578 {V_ID, 8, LIST_TABLE, "name", "list_id", MR_LIST},
1580 {V_TYPE, 10, 0, "lockertype", 0, MR_TYPE},
1583 static struct validate afil_validate = {
1592 set_filesys_modtime,
1595 static char *ufil_fields[] = {
1596 "label", "newlabel", "type", "machine", "name", "mount", "access",
1597 "comments", "owner", "owners", "create", "lockertype",
1600 static struct valobj ufil_valobj[] = {
1601 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
1602 {V_RENAME, 1, FILESYS_TABLE, "label", "filsys_id", MR_NOT_UNIQUE},
1603 {V_TYPE, 2, 0, "filesys", 0, MR_FSTYPE},
1604 {V_ID, 3, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1605 {V_CHAR, 4, FILESYS_TABLE, "name"},
1606 {V_LEN, 5, FILESYS_TABLE, "mount"},
1607 {V_LEN, 6, FILESYS_TABLE, "rwaccess"},
1608 {V_LEN, 7, FILESYS_TABLE, "comments"},
1609 {V_ID, 8, USERS_TABLE, "login", "users_id", MR_USER},
1610 {V_ID, 9, LIST_TABLE, "name", "list_id", MR_LIST},
1612 {V_TYPE, 11, 0, "lockertype", 0, MR_TYPE},
1615 static struct validate ufil_validate = {
1624 set_filesys_modtime,
1627 static char *dfil_fields[] = {
1631 static struct validate dfil_validate = {
1643 static char *gfgm_fields[] = {
1644 "fsgroup", "filesys", "sortkey"
1647 static struct validate gfgm_validate = {
1659 static struct valobj aftg_valobj[] = {
1660 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
1661 {V_ID, 1, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
1664 static struct validate aftg_validate = {
1668 "group_id = %d and filsys_id = %d",
1676 static char *ganf_fields[] = {
1677 "machine", "dir", "device", "status", "allocated", "size",
1678 "modtime", "modby", "modwith",
1681 static char *gnfp_fields[] = {
1683 "machine", "dir", "device", "status", "allocated", "size",
1684 "modtime", "modby", "modwith",
1687 static struct validate gnfp_validate = {
1699 static struct valobj anfp_valobj[] = {
1700 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1701 {V_CHAR, 1, NFSPHYS_TABLE, "dir"},
1702 {V_LEN, 2, NFSPHYS_TABLE, "device"},
1708 static struct validate anfp_validate = {
1712 "mach_id = %d and dir = '%s'",
1717 set_nfsphys_modtime,
1720 static struct validate unfp_validate = {
1724 "mach_id = %d and dir = '%s'",
1729 set_nfsphys_modtime,
1732 static char *ajnf_fields[] = {
1733 "machine", "dir", "adjustment",
1736 static struct valobj ajnf_valobj[] = {
1737 {V_ID, 0, MACHINE_TABLE, NAME, "mach_id", MR_MACHINE},
1738 {V_CHAR, 1, NFSPHYS_TABLE, "dir"},
1742 static struct validate ajnf_validate = {
1746 "mach_id = %d and dir = '%s'",
1751 set_nfsphys_modtime,
1754 static char *dnfp_fields[] = {
1758 static struct validate dnfp_validate = {
1762 "mach_id = %d and dir = '%s'",
1767 set_nfsphys_modtime,
1770 static char *gqot_fields[] = {
1771 "filesys", "type", "name",
1772 "filesys", "type", "name", "quota", "dir", "machine",
1773 "modtime", "modby", "modwith",
1776 static struct valobj gqot_valobj[] = {
1777 {V_TYPE, 1, 0, "quota_type", 0, MR_TYPE},
1778 {V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
1781 static struct validate gqot_validate = {
1793 static char *gqbf_fields[] = {
1795 "filesys", "type", "name", "quota", "dir", "machine",
1796 "modtime", "modby", "modwith",
1799 static struct validate gqbf_validate = {
1811 static char *aqot_fields[] = {
1812 "filesys", "type", "name", "quota",
1815 static struct valobj aqot_valobj[] = {
1816 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
1817 {V_TYPE, 1, 0, "quota_type", 0, MR_TYPE},
1818 {V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
1822 static struct validate aqot_validate = {
1826 "filsys_id = %d and type = '%s' and entity_id = %d",
1834 static struct validate uqot_validate = {
1838 "filsys_id = %d AND type = '%s' AND entity_id = %d",
1846 static struct validate dqot_validate = {
1850 "filsys_id = %d AND type = '%s' AND entity_id = %d",
1858 static char *gnfq_fields[] = {
1860 "filesys", "login", "quota", "dir", "machine",
1861 "modtime", "modby", "modwith",
1864 static struct validate gnfq_validate = {
1876 static char *gnqp_fields[] = {
1878 "filesys", "login", "quota", "dir", "machine",
1879 "modtime", "modby", "modwith",
1882 static char *anfq_fields[] = {
1883 "filesys", "login", "quota",
1886 static struct valobj anfq_valobj[] = {
1887 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
1888 {V_ID, 1, USERS_TABLE, "login", "users_id", MR_USER},
1892 static struct validate anfq_validate = {
1896 "filsys_id = %d AND type = 'USER' AND entity_id = %d",
1904 static struct validate unfq_validate = {
1908 "filsys_id = %d AND type = 'USER' AND entity_id = %d",
1916 static struct validate dnfq_validate = {
1920 "filsys_id = %d AND entity_id = %d",
1928 static char *gzcl_fields[] = {
1930 "class", "xmt_type", "xmt_name", "sub_type", "sub_name",
1931 "iws_type", "iws_name", "iui_type", "iui_name",
1932 "modtime", "modby", "modwith",
1935 static struct validate gzcl_validate = {
1947 static char *azcl_fields[] = {
1948 "class", "xmt_type", "xmt_name", "sub_type", "sub_name",
1949 "iws_type", "iws_name", "iui_type", "iui_name",
1952 static struct valobj azcl_valobj[] = {
1953 {V_CHAR, 0, ZEPHYR_TABLE, "class"},
1954 {V_TYPE, 1, 0, "zace_type", 0, MR_ACE},
1955 {V_TYPEDATA, 2, 0, 0, "list_id", MR_ACE},
1956 {V_TYPE, 3, 0, "zace_type", 0, MR_ACE},
1957 {V_TYPEDATA, 4, 0, 0, "list_id", MR_ACE},
1958 {V_TYPE, 5, 0, "zace_type", 0, MR_ACE},
1959 {V_TYPEDATA, 6, 0, 0, "list_id", MR_ACE},
1960 {V_TYPE, 7, 0, "zace_type", 0, MR_ACE},
1961 {V_TYPEDATA, 8, 0, 0, "list_id", MR_ACE},
1964 static struct validate azcl_validate = {
1976 static char *uzcl_fields[] = {
1977 "class", "newclass", "xmt_type", "xmt_name", "sub_type", "sub_name",
1978 "iws_type", "iws_name", "iui_type", "iui_name",
1981 static struct valobj uzcl_valobj[] = {
1982 {V_NAME, 0, ZEPHYR_TABLE, "class", 0, MR_BAD_CLASS},
1983 {V_RENAME, 1, ZEPHYR_TABLE, "class", 0, MR_NOT_UNIQUE},
1984 {V_TYPE, 2, 0, "zace_type", 0, MR_ACE},
1985 {V_TYPEDATA, 3, 0, 0, "list_id", MR_ACE},
1986 {V_TYPE, 4, 0, "zace_type", 0, MR_ACE},
1987 {V_TYPEDATA, 5, 0, 0, "list_id", MR_ACE},
1988 {V_TYPE, 6, 0, "zace_type", 0, MR_ACE},
1989 {V_TYPEDATA, 7, 0, 0, "list_id", MR_ACE},
1990 {V_TYPE, 8, 0, "zace_type", 0, MR_ACE},
1991 {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
1994 static struct validate uzcl_validate = {
2006 static struct validate dzcl_validate = {
2018 static char *gsha_fields[] = {
2020 "machine", "ace_type", "ace_name", "modtime", "modby", "modwith",
2023 static struct validate gsha_validate =
2036 static char *asha_fields[] = {
2037 "machine", "ace_type", "ace_name",
2040 static struct valobj asha_valobj[] = {
2041 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2042 {V_TYPE, 1, 0, "ace_type", 0, MR_ACE},
2043 {V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
2046 static struct validate asha_validate =
2059 static char *gacl_fields[] = {
2060 "machine", "target",
2061 "machine", "target", "kind", "list",
2064 static char *aacl_fields[] = {
2065 "machine", "target", "kind", "list",
2068 static char *dacl_fields[] = {
2069 "machine", "target",
2072 static struct valobj aacl_valobj[] = {
2073 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2074 {V_CHAR, 1, ACL_TABLE, "target"},
2075 {V_TYPE, 2, 0, "acl_kind", 0, MR_TYPE},
2076 {V_ID, 3, LIST_TABLE, "name", "list_id", MR_LIST},
2079 static struct validate gacl_validate =
2092 static struct validate aacl_validate =
2097 "mach_id = %d AND target = '%s'",
2105 static char *gsvc_fields[] = {
2107 "service", "protocol", "port", "description", "modtime", "modby", "modwith",
2110 static char *asvc_fields[] = {
2111 "service", "protocol", "port", "description",
2114 static struct valobj asvc_valobj[] = {
2115 {V_CHAR, 0, SERVICES_TABLE, "name"},
2116 {V_CHAR, 1, SERVICES_TABLE, "protocol"},
2118 {V_CHAR, 3, SERVICES_TABLE, "description"},
2121 static struct validate asvc_validate = {
2133 static char *gprn_fields[] = {
2135 "name", "type", "hwtype", "duplexname", "hostname",
2136 "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
2137 "banner", "location", "contact", "modtime", "modby", "modwith"
2140 static char *gpbd_fields[] = {
2142 "name", "type", "hwtype", "duplexname", "hostname",
2143 "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
2144 "banner", "location", "contact", "modtime", "modby", "modwith"
2147 static char *gpbe_fields[] = {
2149 "name", "type", "hwtype", "duplexname", "hostname",
2150 "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
2151 "banner", "location", "contact", "modtime", "modby", "modwith"
2154 static char *gpbh_fields[] = {
2156 "name", "type", "hwtype", "duplexname", "hostname",
2157 "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
2158 "banner", "location", "contact", "modtime", "modby", "modwith"
2161 static char *gpbr_fields[] = {
2163 "name", "type", "hwtype", "duplexname", "hostname",
2164 "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
2165 "banner", "location", "contact", "modtime", "modby", "modwith"
2168 static char *gpbl_fields[] = {
2170 "name", "type", "hwtype", "duplexname", "hostname",
2171 "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
2172 "banner", "location", "contact", "modtime", "modby", "modwith"
2175 static char *gpbc_fields[] = {
2177 "name", "type", "hwtype", "duplexname", "hostname",
2178 "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
2179 "banner", "location", "contact", "modtime", "modby", "modwith"
2182 static char *aprn_fields[] = {
2183 "printer", "type", "hwtype", "duplexname", "hostname",
2184 "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
2185 "banner", "location", "contact",
2188 static struct valobj aprn_valobj[] = {
2189 {V_CHAR, 0, PRINTERS_TABLE, "name"},
2190 {V_TYPE, 1, 0, "printertype", 0, MR_TYPE},
2191 {V_TYPE, 2, 0, "printerhwtype", 0, MR_TYPE},
2192 {V_CHAR, 3, PRINTERS_TABLE, "duplexname"},
2193 {V_ID, 4, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2194 {V_ID, 5, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2195 {V_ID, 6, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2196 {V_CHAR, 7, PRINTERS_TABLE, "rp"},
2197 {V_ID, 8, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2200 {V_ID, 11, LIST_TABLE, "name", "list_id", MR_LIST},
2201 {V_ID, 12, LIST_TABLE, "name", "list_id", MR_LIST},
2203 {V_CHAR, 14, PRINTERS_TABLE, "location"},
2204 {V_CHAR, 15, PRINTERS_TABLE, "contact"},
2207 static struct validate aprn_validate = {
2219 static char *uprn_fields[] = {
2221 "printer", "type", "hwtype", "duplexname", "hostname",
2222 "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
2223 "banner", "location", "contact",
2226 static struct valobj uprn_valobj[] = {
2227 {V_CHAR, 0, PRINTERS_TABLE, "name"},
2228 {V_CHAR, 1, PRINTERS_TABLE, "name"},
2229 {V_TYPE, 2, 0, "printertype", 0, MR_TYPE},
2230 {V_TYPE, 3, 0, "printerhwtype", 0, MR_TYPE},
2231 {V_CHAR, 4, PRINTERS_TABLE, "duplexname"},
2232 {V_ID, 5, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2233 {V_ID, 6, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2234 {V_ID, 7, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2235 {V_CHAR, 8, PRINTERS_TABLE, "rp"},
2236 {V_ID, 9, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2239 {V_ID, 12, LIST_TABLE, "name", "list_id", MR_LIST},
2240 {V_ID, 13, LIST_TABLE, "name", "list_id", MR_LIST},
2242 {V_CHAR, 15, PRINTERS_TABLE, "location"},
2243 {V_CHAR, 16, PRINTERS_TABLE, "contact"},
2246 static struct validate uprn_validate = {
2258 static struct validate dprn_validate = {
2270 static char *gpsv_fields[] = {
2272 "host", "kind", "printer_types", "owner_type", "owner_name",
2273 "lpc_acl", "modtime", "modby", "modwith"
2276 static struct valobj gpsv_valobj[] = {
2277 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2280 static struct validate gpsv_validate = {
2292 static char *apsv_fields[] = {
2293 "host", "kind", "printer_types", "owner_type", "owner_name", "lpc_acl"
2296 static struct valobj apsv_valobj[] = {
2297 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2298 {V_TYPE, 1, 0, "lpd_kind", 0, MR_TYPE},
2299 {V_ID, 2, STRINGS_TABLE, "string", "string_id", MR_STRING},
2300 {V_TYPE, 3, 0, "ace_type", 0, MR_ACE},
2301 {V_TYPEDATA, 4, 0, 0, 0, MR_ACE},
2302 {V_ID, 5, LIST_TABLE, "name", "list_id", MR_LIST},
2305 static struct validate apsv_validate = {
2317 static char *dpsv_fields[] = {
2321 static struct validate dpsv_validate = {
2333 static char *gali_fields[] = {
2334 "name", "type", "trans",
2335 "name", "type", "trans",
2338 static char *aali_fields[] = {
2339 "name", "type", "trans",
2342 static struct valobj aali_valobj[] = {
2343 {V_CHAR, 0, ALIAS_TABLE, "name"},
2344 {V_TYPE, 1, 0, "alias", 0, MR_TYPE},
2345 {V_CHAR, 2, ALIAS_TABLE, "trans"},
2348 static struct validate aali_validate = {
2352 "name = '%s' and type = '%s' and trans = '%s'",
2360 static struct validate dali_validate = /* DELETE_ALIAS */
2365 "name = '%s' and type = '%s' and trans = '%s'",
2373 static char *gval_fields[] = {
2377 static struct valobj gval_valobj[] = {
2378 {V_NAME, 0, NUMVALUES_TABLE, "name", 0, MR_NO_MATCH},
2381 static struct validate gval_validate = {
2393 static char *aval_fields[] = {
2397 static struct valobj aval_valobj[] = {
2398 {V_CHAR, 0, NUMVALUES_TABLE, "name"},
2402 static struct validate aval_validate = /* for aval, uval, and dval */
2415 static char *dval_fields[] = {
2419 static char *gats_fields[] = {
2420 "table_name", "appends", "updates", "deletes",
2421 "modtime", "modby", "modwith",
2424 static char *_sdl_fields[] = {
2428 static struct validate _sdl_validate =
2443 /* Generalized Query Definitions */
2445 /* Note: For any query which uses prefetch_value, the vcnt should be
2446 * one less than the number of %-format specifiers in the tlist.
2449 struct query Queries2[] = {
2451 /* Q_GALO - GET_ALL_LOGINS */
2457 "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle FROM users u",
2467 /* Q_GAAL - GET_ALL_ACTIVE_LOGINS */
2468 "get_all_active_logins",
2473 "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle FROM users u",
2483 /* Q_GUAL - GET_USER_ACCOUNT_BY_LOGIN */
2484 "get_user_account_by_login",
2489 "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, u.signature, u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
2492 "u.login LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
2499 /* Q_GUAU - GET_USER_ACCOUNT_BY_UID */
2500 "get_user_account_by_uid",
2505 "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, u.signature, u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
2508 "u.unix_uid = %s AND u.users_id != 0 AND u.comments = str.string_id",
2515 /* Q_GUAN - GET_USER_ACCOUNT_BY_NAME */
2516 "get_user_account_by_name",
2521 "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, u.signature, u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
2524 "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0 and u.comments = str.string_id",
2531 /* Q_GUAC - GET_USER_ACCOUNT_BY_CLASS */
2532 "get_user_account_by_class",
2537 "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, u.signature, u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
2540 "u.type = UPPER('%s') AND u.users_id != 0 AND u.comments = str.string_id",
2547 /* Q_GUAM - GET_USER_ACCOUNT_BY_MITID */
2548 "get_user_account_by_id",
2553 "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, u.signature, u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
2556 "u.clearid LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
2563 /* Q_GUBL - GET_USER_BY_LOGIN */
2564 "get_user_by_login",
2569 "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
2572 "u.login LIKE '%s' AND u.users_id != 0",
2579 /* Q_GUBU - GET_USER_BY_UID */
2585 "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
2588 "u.unix_uid = %s AND u.users_id != 0",
2595 /* Q_GUBN - GET_USER_BY_NAME */
2601 "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
2604 "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0",
2611 /* Q_GUBC - GET_USER_BY_CLASS */
2612 "get_user_by_class",
2617 "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
2620 "u.type = UPPER('%s') AND u.users_id != 0",
2627 /* Q_GUBM - GET_USER_BY_MITID */
2628 "get_user_by_mitid",
2633 "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
2636 "u.clearid LIKE '%s' AND u.users_id != 0",
2643 /* Q_AUAC - ADD_USER_ACCOUNT */ /* uses prefetch_value() for users_id */
2649 "INTO users (login, unix_uid, shell, last, first, middle, status, clearid, type, comments, signature, secure, users_id) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', %d, LENGTH(NVL('%s', CHR(0))), %s, %s)", /* followup_ausr fixes signature field */
2659 /* Q_AUSR - ADD_USER */ /* uses prefetch_value() for users_id */
2665 "INTO users (login, unix_uid, shell, last, first, middle, status, clearid, type, comments, signature, secure, users_id) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', 0, CHR(0), 0, %s)",
2675 /* Q_RUSR - REGISTER_USER */
2691 /* Q_UUAC - UPDATE_USER_ACCOUNT */
2692 "update_user_account",
2697 "users SET login = '%s', unix_uid = %s, shell = '%s', last = NVL('%s', CHR(0)), first = NVL('%s', CHR(0)), middle = NVL('%s', CHR(0)), status = %s, clearid = NVL('%s', CHR(0)), type = '%s', comments = %d, signature = LENGTH(NVL('%s', CHR(0))), secure = %s", /* followup_uuac fixes signature */
2707 /* Q_UUSR - UPDATE_USER */
2713 "users SET login = '%s', unix_uid = %s, shell = '%s', last = NVL('%s', CHR(0)), first = NVL('%s', CHR(0)), middle = NVL('%s', CHR(0)), status = %s, clearid = NVL('%s', CHR(0)), type = '%s'",
2723 /* Q_UUSH - UPDATE_USER_SHELL */
2724 "update_user_shell",
2729 "users SET shell = '%s'",
2739 /* Q_UUST - UPDATE_USER_STATUS */
2740 "update_user_status",
2745 "users SET status = %s",
2755 /* Q_UUSS - UPDATE_USER_SECURITY_STATUS */
2756 "update_user_security_status",
2761 "users SET secure = %s",
2771 /* Q_DUSR - DELETE_USER */
2787 /* Q_GKUM - GET_KERBEROS_USER_MAP */
2788 "get_kerberos_user_map",
2793 "u.login, str.string FROM krbmap km, users u, strings str",
2796 "u.login LIKE '%s' AND str.string LIKE '%s' AND km.users_id = u.users_id AND km.string_id = str.string_id",
2798 "u.login, str.string",
2803 /* Q_AKUM - ADD_KERBEROS_USER_MAP */
2804 "add_kerberos_user_map",
2809 "INTO krbmap (users_id, string_id) VALUES (%d, %d)",
2819 /* Q_DKUM - DELETE_KERBEROS_USER_MAP */
2820 "delete_kerberos_user_map",
2828 "users_id = %d AND string_id = %d",
2835 /* Q_GFBL - GET_FINGER_BY_LOGIN */
2836 "get_finger_by_login",
2841 "login, fullname, nickname, home_addr, home_phone, office_addr, office_phone, department, affiliation, TO_CHAR(fmodtime, 'DD-mon-YYYY HH24:MI:SS'), fmodby, fmodwith FROM users",
2851 /* Q_UFBL - UPDATE_FINGER_BY_LOGIN */
2852 "update_finger_by_login",
2857 "users SET fullname= NVL('%s', CHR(0)), nickname= NVL('%s', CHR(0)), home_addr= NVL('%s', CHR(0)), home_phone= NVL('%s', CHR(0)), office_addr= NVL('%s', CHR(0)), office_phone= NVL('%s', CHR(0)), department= NVL('%s', CHR(0)), affiliation= NVL('%s', CHR(0))",
2867 /* Q_GPOB - GET_POBOX */
2873 "login, potype, pop_id || ':' || box_id, TO_CHAR(pmodtime, 'DD-mon-YYYY HH24:MI:SS'), pmodby, pmodwith FROM users",
2883 /* Q_GAPO - GET_ALL_POBOXES */
2889 "login, potype, pop_id || ':' || box_id FROM users",
2899 /* Q_GPOP - GET_POBOXES_POP */
2905 "login, potype, pop_id || ':' || box_id FROM users",
2915 /* Q_GPOF - GET_POBOXES_SMTP */
2921 "login, potype, pop_id || ':' || box_id FROM users",
2931 /* Q_SPOB - SET_POBOX */
2947 /* Q_SPOP - SET_POBOX_POP */
2953 "users SET potype = 'POP'",
2963 /* Q_DPOB - DELETE_POBOX */
2969 "users SET potype = 'NONE'",
2979 /* Q_GHST - GET_HOST */
2985 "m.name, m.vendor, m.model, m.os, m.location, m.contact, m.use, m.status, TO_CHAR(m.statuschange, 'DD-mon-YYYY HH24:MI:SS'), s.name, m.address, m.owner_type, m.owner_id, m.acomment, m.ocomment, TO_CHAR(m.created, 'DD-mon-YYYY HH24:MI:SS'), m.creator, TO_CHAR(m.inuse, 'DD-mon-YYYY HH24:MI:SS'), TO_CHAR(m.modtime, 'DD-mon-YYYY HH24:MI:SS'), m.modby, m.modwith FROM machine m, subnet s",
2988 "m.name LIKE UPPER('%s') AND m.address LIKE '%s' AND m.location LIKE UPPER('%s') AND s.name LIKE UPPER('%s') AND m.mach_id != 0 AND s.snet_id = m.snet_id",
2995 /* Q_GHBH - GET_HOST_BY_HWADDR */
2996 "get_host_by_hwaddr",
3001 "m.name, m.vendor, m.model, m.os, m.location, m.contact, m.use, m.status, TO_CHAR(m.statuschange, 'DD-mon-YYYY HH24:MI:SS'), s.name, m.address, m.owner_type, m.owner_id, m.acomment, m.ocomment, TO_CHAR(m.created, 'DD-mon-YYYY HH24:MI:SS'), m.creator, TO_CHAR(m.inuse, 'DD-mon-YYYY HH24:MI:SS'), TO_CHAR(m.modtime, 'DD-mon-YYYY HH24:MI:SS'), m.modby, m.modwith FROM machine m, subnet s",
3004 "m.hwaddr LIKE LOWER('%s') AND m.mach_id != 0 AND s.snet_id = m.snet_id",
3011 /* Q_GHHA - GET_HOST_HWADDR */
3017 "m.hwaddr FROM machine m",
3020 "m.name LIKE UPPER('%s')",
3027 /* Q_AHST - ADD_HOST */ /* uses prefetch_value() for mach_id */
3033 "INTO machine (name, vendor, model, os, location, contact, use, status, statuschange, snet_id, address, owner_type, owner_id, acomment, ocomment, created, inuse, mach_id, creator) VALUES (UPPER('%s'), NVL(UPPER('%s'), CHR(0)), NVL(UPPER('%s'), CHR(0)), NVL(UPPER('%s'), CHR(0)), NVL(UPPER('%s'), CHR(0)), NVL('%s', CHR(0)), %s, %s, SYSDATE, %d, '%s', '%s', %d, %d, %d, SYSDATE, SYSDATE, %s, %s)",
3043 /* Q_UHST - UPDATE_HOST */
3049 "machine SET name = NVL(UPPER('%s'), CHR(0)), vendor = NVL(UPPER('%s'), CHR(0)), model = NVL(UPPER('%s'), CHR(0)), os = NVL(UPPER('%s'), CHR(0)), location = NVL(UPPER('%s'), CHR(0)), contact = NVL('%s', CHR(0)), use = %s, status = %s, snet_id = %d, address = '%s', owner_type = '%s', owner_id = %d, acomment = %d, ocomment = %d",
3059 /* Q_UHHA - UPDATE_HOST_HWADDR */
3060 "update_host_hwaddr",
3065 "machine SET hwaddr = NVL('%s', CHR(0))",
3075 /* Q_DHST - DELETE_HOST */
3091 /* Q_GMAC - GET_MACHINE */
3097 "name, vendor, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM machine",
3100 "name LIKE UPPER('%s') AND mach_id != 0",
3107 /* Q_GHAL - GET_HOSTALIAS */
3113 "a.name, m.name FROM hostalias a, machine m",
3116 "m.mach_id = a.mach_id and a.name LIKE UPPER('%s') AND m.name LIKE UPPER('%s')",
3123 /* Q_AHAL - ADD_HOSTALIAS */
3129 "INTO hostalias (name, mach_id) VALUES (UPPER('%s'), %d)",
3139 /* Q_DHAL - DELETE_HOSTALIAS */
3148 "name = UPPER('%s') AND mach_id = %d",
3155 /* Q_GSNT - GET_SUBNET */
3161 "name, description, saddr, mask, low, high, prefix, owner_type, owner_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM subnet",
3164 "name LIKE UPPER('%s')",
3171 /* Q_ASNT - ADD_SUBNET */
3177 "INTO subnet (name, description, saddr, mask, low, high, prefix, owner_type, owner_id, snet_id) VALUES (UPPER('%s'), NVL('%s', CHR(0)), %s, %s, %s, %s, NVL('%s', CHR(0)), '%s', %d, %s)",
3187 /* Q_USNT - UPDATE_SUBNET */
3193 "subnet SET name = UPPER('%s'), description = NVL('%s', CHR(0)), saddr = %s, mask = %s, low = %s, high = %s, prefix = NVL('%s', CHR(0)), owner_type = '%s', owner_id = %d",
3203 /* Q_DSNT - DELETE_SUBNET */
3219 /* Q_GCLU - GET_CLUSTER */
3225 "name, description, location, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM clusters",
3228 "name LIKE '%s' AND clu_id != 0",
3235 /* Q_ACLU - ADD_CLUSTER */ /* uses prefetch_value() for clu_id */
3241 "INTO clusters (name, description, location, clu_id) VALUES ('%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s)",
3251 /* Q_UCLU - UPDATE_CLUSTER */
3257 "clusters SET name = '%s', description = NVL('%s', CHR(0)), location = NVL('%s', CHR(0))",
3267 /* Q_DCLU - DELETE_CLUSTER */
3283 /* Q_GMCM - GET_MACHINE_TO_CLUSTER_MAP */
3284 "get_machine_to_cluster_map",
3289 "m.name, c.name FROM machine m, clusters c, mcmap mcm",
3292 "m.name LIKE UPPER('%s') AND c.name LIKE '%s' AND mcm.clu_id = c.clu_id AND mcm.mach_id = m.mach_id",
3299 /* Q_AMTC - ADD_MACHINE_TO_CLUSTER */
3300 "add_machine_to_cluster",
3305 "INTO mcmap (mach_id, clu_id) VALUES (%d, %d)",
3315 /* Q_DMFC - DELETE_MACHINE_FROM_CLUSTER */
3316 "delete_machine_from_cluster",
3324 "mach_id = %d AND clu_id = %d",
3331 /* Q_GCLD - GET_CLUSTER_DATA */
3337 "c.name, svc.serv_label, svc.serv_cluster FROM svc svc, clusters c",
3340 "c.clu_id = svc.clu_id AND c.name LIKE '%s' AND svc.serv_label LIKE '%s'",
3342 "c.name, svc.serv_label",
3347 /* Q_ACLD - ADD_CLUSTER_DATA */
3353 "INTO svc (clu_id, serv_label, serv_cluster) VALUES (%d, '%s', '%s')",
3363 /* Q_DCLD - DELETE_CLUSTER_DATA */
3364 "delete_cluster_data",
3372 "clu_id = %d AND serv_label = '%s' AND serv_cluster = '%s'",
3379 /* Q_GLIN - GET_LIST_INFO */
3385 "name, active, publicflg, hidden, maillist, grouplist, gid, acl_type, acl_id, description, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM list",
3395 /* Q_EXLN - EXPAND_LIST_NAMES */
3396 "expand_list_names",
3404 "name LIKE '%s' AND list_id != 0",
3411 /* Q_ALIS - ADD_LIST */ /* uses prefetch_value() for list_id */
3417 "INTO list (name, active, publicflg, hidden, maillist, grouplist, gid, acl_type, acl_id, description, list_id) VALUES ('%s', %s, %s, %s, %s, %s, %s, '%s', %d, NVL('%s', CHR(0)), %s)",
3427 /* Q_ULIS - UPDATE_LIST */
3433 "list SET name = '%s', active = %s, publicflg = %s, hidden = %s, maillist = %s, grouplist = %s, gid = %s, acl_type = '%s', acl_id = %d, description = NVL('%s', CHR(0))",
3443 /* Q_DLIS - DELETE_LIST */
3459 /* Q_AMTL - ADD_MEMBER_TO_LIST */
3460 "add_member_to_list",
3475 /* Q_ATML - ADD_TAGGED_MEMBER_TO_LIST */
3476 "add_tagged_member_to_list",
3491 /* Q_TMOL - TAG_MEMBER_OF_LIST */
3492 "tag_member_of_list",
3497 "imembers SET tag = %d",
3500 "list_id = %d AND member_type = '%s' and member_id = %d",
3507 /* Q_DMFL - DELETE_MEMBER_FROM_LIST */
3508 "delete_member_from_list",
3523 /* Q_GAUS - GET_ACE_USE */
3539 /* Q_QGLI - QUALIFIED_GET_LISTS */
3540 "qualified_get_lists",
3555 /* Q_GMOL - GET_MEMBERS_OF_LIST */
3556 "get_members_of_list",
3571 /* Q_GEML - GET_END_MEMBERS_OF_LIST */
3572 "get_end_members_of_list",
3587 /* Q_GTML - GET_TAGGED_MEMBERS_OF_LIST */
3588 "get_tagged_members_of_list",
3603 /* Q_GLOM - GET_LISTS_OF_MEMBER */
3604 "get_lists_of_member",
3619 /* Q_CMOL - COUNT_MEMBERS_OF_LIST */
3620 "count_members_of_list",
3635 /* Q_GSIN - GET_SERVER_INFO */
3641 "name, update_int, target_file, script, dfgen, dfcheck, type, enable, inprogress, harderror, errmsg, acl_type, acl_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM servers",
3644 "name LIKE UPPER('%s')",
3651 /* Q_QGSV - QUALIFIED_GET_SERVER */
3652 "qualified_get_server",
3667 /* Q_ASIN - ADD_SERVER_INFO */
3673 "INTO servers (name, update_int, target_file, script, type, enable, acl_type, acl_id) VALUES (UPPER('%s'), %s, '%s', '%s', '%s', %s, '%s', %d)",
3683 /* Q_USIN - UPDATE_SERVER_INFO */
3684 "update_server_info",
3689 "servers SET update_int = %s, target_file = '%s', script = '%s', type = '%s', enable = %s, acl_type = '%s', acl_id = %d",
3692 "name = UPPER('%s')",
3699 /* Q_RSVE - RESET_SERVER_ERROR */
3700 "reset_server_error",
3705 "servers SET harderror = 0, dfcheck = dfgen",
3708 "name = UPPER('%s')",
3715 /* Q_SSIF - SET_SERVER_INTERNAL_FLAGS */
3716 "set_server_internal_flags",
3721 "servers SET dfgen = %s, dfcheck = %s, inprogress = %s, harderror = %s, errmsg = NVL('%s', CHR(0))",
3724 "name = UPPER('%s')",
3731 /* Q_DSIN - DELETE_SERVER_INFO */
3732 "delete_server_info",
3740 "name = UPPER('%s')",
3747 /* Q_GSHI - GET_SERVER_HOST_INFO */
3748 "get_server_host_info",
3753 "sh.service, m.name, sh.enable, sh.override, sh.success, sh.inprogress, sh.hosterror, sh.hosterrmsg, sh.ltt, sh.lts, sh.value1, sh.value2, sh.value3, TO_CHAR(sh.modtime, 'DD-mon-YYYY HH24:MI:SS'), sh.modby, sh.modwith FROM serverhosts sh, machine m",
3756 "sh.service LIKE UPPER('%s') AND m.name LIKE UPPER('%s') AND m.mach_id = sh.mach_id",
3758 "sh.service, m.name",
3763 /* Q_QGSH - QUALIFIED_GET_SERVER_HOST */
3764 "qualified_get_server_host",
3779 /* Q_ASHI - ADD_SERVER_HOST_INFO */
3780 "add_server_host_info",
3785 "INTO serverhosts (service, mach_id, enable, value1, value2, value3) VALUES (UPPER('%s'), %d, %s, %s, %s, NVL('%s', CHR(0)))",
3795 /* Q_USHI - UPDATE_SERVER_HOST_INFO */
3796 "update_server_host_info",
3801 "serverhosts SET enable = %s, value1 = %s, value2 = %s, value3 = NVL('%s', CHR(0))",
3804 "service = UPPER('%s') AND mach_id = %d",
3811 /* Q_RSHE - RESET_SERVER_HOST_ERROR */
3812 "reset_server_host_error",
3817 "serverhosts SET hosterror = 0",
3820 "service = UPPER('%s') AND mach_id = %d",
3827 /* Q_SSHO - SET_SERVER_HOST_OVERRIDE */
3828 "set_server_host_override",
3833 "serverhosts SET override = 1",
3836 "service = UPPER('%s') AND mach_id = %d",
3843 /* Q_SSHI - SET_SERVER_HOST_INTERNAL */
3844 "set_server_host_internal",
3849 "serverhosts SET override = %s, success = %s, inprogress = %s, hosterror = %s, hosterrmsg = NVL('%s', CHR(0)), ltt = %s, lts = %s",
3852 "service = UPPER('%s') AND mach_id = %d",
3859 /* Q_DSHI - DELETE_SERVER_HOST_INFO */
3860 "delete_server_host_info",
3868 "service = UPPER('%s') AND mach_id = %d",
3875 /* Q_GSLO - GET_SERVER_LOCATIONS */
3876 "get_server_locations",
3881 "sh.service, m.name FROM serverhosts sh, machine m",
3884 "sh.service LIKE UPPER('%s') AND sh.mach_id = m.mach_id",
3886 "sh.service, m.name",
3891 /* Q_GFSL - GET_FILESYS_BY_LABEL */
3892 "get_filesys_by_label",
3897 "fs.label, fs.type, m.name, fs.name, fs.mount, fs.rwaccess, fs.comments, u.login, l.name, fs.createflg, fs.lockertype, TO_CHAR(fs.modtime, 'DD-mon-YYYY HH24:MI:SS'), fs.modby, fs.modwith FROM filesys fs, machine m, users u, list l",
3900 "fs.label LIKE '%s' AND fs.mach_id = m.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id",
3907 /* Q_GFSM - GET_FILESYS_BY_MACHINE */
3908 "get_filesys_by_machine",
3913 "fs.label, fs.type, m.name, fs.name, fs.mount, fs.rwaccess, fs.comments, u.login, l.name, fs.createflg, fs.lockertype, TO_CHAR(fs.modtime, 'DD-mon-YYYY HH24:MI:SS'), fs.modby, fs.modwith FROM filesys fs, machine m, users u, list l",
3916 "fs.mach_id = %d AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id",
3923 /* Q_GFSN - GET_FILESYS_BY_NFSPHYS */
3924 "get_filesys_by_nfsphys",
3929 "fs.label, fs.type, m.name, fs.name, fs.mount, fs.rwaccess, fs.comments, u.login, l.name, fs.createflg, fs.lockertype, TO_CHAR(fs.modtime, 'DD-mon-YYYY HH24:MI:SS'), fs.modby, fs.modwith FROM filesys fs, machine m, users u, list l, nfsphys np",
3932 "fs.mach_id = %d AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id AND np.nfsphys_id = fs.phys_id AND np.dir LIKE '%s' AND fs.type = 'NFS'",
3939 /* Q_GFSG - GET_FILESYS_BY_GROUP */
3940 "get_filesys_by_group",
3945 "fs.label, fs.type, m.name, fs.name, fs.mount, fs.rwaccess, fs.comments, u.login, l.name, fs.createflg, fs.lockertype, TO_CHAR(fs.modtime, 'DD-mon-YYYY HH24:MI:SS'), fs.modby, fs.modwith FROM filesys fs, machine m, users u, list l",
3948 "fs.owners = %d AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id",
3955 /* Q_GFSP - GET_FILESYS_BY_PATH */
3956 "get_filesys_by_path",
3961 "fs.label, fs.type, m.name, fs.name, fs.mount, fs.rwaccess, fs.comments, u.login, l.name, fs.createflg, fs.lockertype, TO_CHAR(fs.modtime, 'DD-mon-YYYY HH24:MI:SS'), fs.modby, fs.modwith FROM filesys fs, machine m, users u, list l",
3964 "fs.name LIKE '%s' AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = list_id",
3971 /* Q_AFIL - ADD_FILESYS */ /* uses prefetch_value() for filsys_id */
3977 "INTO filesys (label, type, mach_id, name, mount, rwaccess, comments, owner, owners, createflg, lockertype, filsys_id) VALUES ('%s', '%s', %d, NVL('%s', CHR(0)), '%s', '%s', NVL('%s', CHR(0)), %d, %d, %s, '%s', %s)",
3987 /* Q_UFIL - UPDATE_FILESYS */
3993 "filesys SET label = '%s', type = '%s', mach_id = %d, name = NVL('%s', CHR(0)), mount = '%s', rwaccess = '%s', comments = NVL('%s', CHR(0)), owner = %d, owners = %d, createflg = %s, lockertype = '%s'",
4003 /* Q_DFIL - DELETE_FILESYS */
4019 /* Q_GFGM - GET_FSGROUP_MEMBERS */
4020 "get_fsgroup_members",
4025 "fs.label, fg.key FROM fsgroup fg, filesys fs",
4028 "fg.group_id = %d AND fs.filsys_id = fg.filsys_id",
4035 /* Q_AFTG - ADD_FILESYS_TO_FSGROUP */
4036 "add_filesys_to_fsgroup",
4041 "INTO fsgroup (group_id, filsys_id, key) VALUES (%d, %d, '%s')",
4051 /* Q_RFFG - REMOVE_FILESYS_FROM_FSGROUP */
4052 "remove_filesys_from_fsgroup",
4060 "group_id = %d AND filsys_id = %d",
4067 /* Q_GANF - GET_ALL_NFSPHYS */
4073 "m.name, np.dir, np.device, np.status, np.allocated, np.partsize, TO_CHAR(np.modtime, 'DD-mon-YYYY HH24:MI:SS'), np.modby, np.modwith FROM nfsphys np, machine m",
4076 "m.mach_id = np.mach_id",
4083 /* Q_GNFP - GET_NFSPHYS */
4089 "m.name, np.dir, np.device, np.status, np.allocated, np.partsize, TO_CHAR(np.modtime, 'DD-mon-YYYY HH24:MI:SS'), np.modby, np.modwith FROM nfsphys np, machine m",
4092 "np.mach_id = %d AND np.dir LIKE '%s' AND m.mach_id = np.mach_id",
4099 /* Q_ANFP - ADD_NFSPHYS */ /* uses prefetch_value() for nfsphys_id */
4105 "INTO nfsphys (mach_id, dir, device, status, allocated, partsize, nfsphys_id) VALUES (%d, '%s', NVL('%s', CHR(0)), %s, %s, %s, %s)",
4115 /* Q_UNFP - UPDATE_NFSPHYS */
4121 "nfsphys SET device = NVL('%s', CHR(0)), status = %s, allocated = %s, partsize = %s",
4124 "mach_id = %d AND dir = '%s'",
4131 /* Q_AJNF - ADJUST_NFSPHYS_ALLOCATION */
4132 "adjust_nfsphys_allocation",
4137 "nfsphys SET allocated = allocated + %s",
4140 "mach_id = %d AND dir = '%s'",
4147 /* Q_DNFP - DELETE_NFSPHYS */
4156 "mach_id = %d AND dir = '%s'",
4163 /* Q_GQOT - GET_QUOTA */
4169 "fs.label, q.type, q.entity_id, q.quota, q.phys_id, m.name, TO_CHAR(q.modtime, 'DD-mon-YYYY HH24:MI:SS'), q.modby, q.modwith FROM quota q, filesys fs, machine m",
4172 "fs.label LIKE '%s' AND q.type = '%s' AND q.entity_id = %d AND fs.filsys_id = q.filsys_id AND m.mach_id = fs.mach_id",
4179 /* Q_GQBF - GET_QUOTA_BY_FILESYS */
4180 "get_quota_by_filesys",
4185 "fs.label, q.type, q.entity_id, q.quota, q.phys_id, m.name, TO_CHAR(q.modtime, 'DD-mon-YYYY HH24:MI:SS'), q.modby, q.modwith FROM quota q, filesys fs, machine m",
4188 "fs.label LIKE '%s' AND fs.filsys_id = q.filsys_id AND m.mach_id = fs.mach_id",
4195 /* Q_AQOT - ADD_QUOTA */ /* prefetch_filsys() gets last 1 value */
4201 "INTO quota (filsys_id, type, entity_id, quota, phys_id) VALUES ('%s', %d, %d, %s, %s)",
4211 /* Q_UQOT - UPDATE_QUOTA */
4217 "quota SET quota = %s",
4227 /* Q_DQOT - DELETE_QUOTA */
4243 /* Q_GNFQ - GET_NFS_QUOTAS */
4249 "fs.label, u.login, q.quota, q.phys_id, m.name, TO_CHAR(q.modtime, 'DD-mon-YYYY HH24:MI:SS'), q.modby, q.modwith FROM quota q, filesys fs, users u, machine m",
4252 "fs.label LIKE '%s' AND q.type = 'USER' AND q.entity_id = u.users_id AND fs.filsys_id = q.filsys_id AND m.mach_id = fs.mach_id AND u.login = '%s'",
4254 "fs.label, u.login",
4259 /* Q_GNQP - GET_NFS_QUOTAS_BY_PARTITION */
4260 "get_nfs_quotas_by_partition",
4265 "fs.label, u.login, q.quota, np.dir, m.name FROM quota q, filesys fs, users u, nfsphys np, machine m",
4268 "np.mach_id = %d AND np.dir LIKE '%s' AND q.phys_id = np.nfsphys_id AND fs.filsys_id = q.filsys_id AND q.type = 'USER' AND u.users_id = q.entity_id AND m.mach_id = np.mach_id",
4275 /* Q_ANFQ - ADD_NFS_QUOTA */ /* prefetch_filsys() gets last 1 value */
4281 "INTO quota (type, filsys_id, entity_id, quota, phys_id ) VALUES ('USER', %d, %d, %s, %s)",
4291 /* Q_UNFQ - UPDATE_NFS_QUOTA */
4297 "quota SET quota = %s",
4307 /* Q_DNFQ - DELETE_NFS_QUOTA */
4323 /* Q_GZCL - GET_ZEPHYR_CLASS */
4329 "class, xmt_type, xmt_id, sub_type, sub_id, iws_type, iws_id, iui_type, iui_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM zephyr",
4339 /* Q_AZCL - ADD_ZEPHYR_CLASS */
4345 "INTO zephyr (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)",
4355 /* Q_UZCL - UPDATE_ZEPHYR_CLASS */
4356 "update_zephyr_class",
4361 "zephyr SET class = '%s', xmt_type = '%s', xmt_id = %d, sub_type = '%s', sub_id = %d, iws_type = '%s', iws_id = %d, iui_type = '%s', iui_id = %d",
4371 /* Q_DZCL - DELETE_ZEPHYR_CLASS */
4372 "delete_zephyr_class",
4387 /* Q_GSHA - GET_SERVER_HOST_ACCESS */
4388 "get_server_host_access",
4393 "m.name, ha.acl_type, ha.acl_id, TO_CHAR(ha.modtime, 'DD-mon-YYYY HH24:MI:SS'), ha.modby, ha.modwith FROM hostaccess ha, machine m",
4396 "m.name LIKE UPPER('%s') AND ha.mach_id = m.mach_id",
4403 /* Q_ASHA - ADD_SERVER_HOST_ACCESS */
4404 "add_server_host_access",
4409 "INTO hostaccess (mach_id, acl_type, acl_id) VALUES (%d, '%s', %d)",
4419 /* Q_USHA - UPDATE_SERVER_HOST_ACCESS */
4420 "update_server_host_access",
4425 "hostaccess SET acl_type = '%s', acl_id = %d",
4435 /* Q_DSHA - DELETE_SERVER_HOST_ACCESS */
4436 "delete_server_host_access",
4451 /* Q_GACL - GET_ACL */
4457 "m.name, ac.target, ac.kind, l.name FROM acl ac, machine m, list l",
4460 "m.mach_id = %d AND m.mach_id = ac.mach_id AND ac.target LIKE '%s' AND l.list_id = ac.list_id",
4462 "m.name, ac.target, ac.kind",
4467 /* Q_AACL - ADD_ACL */
4473 "INTO acl (mach_id, target, kind, list_id) VALUES (%d, '%s', '%s', %d)",
4483 /* Q_DACL - DELETE_ACL */
4492 "mach_id = %d AND target = '%s'",
4499 /* Q_GSVC - GET_SERVICE */
4505 "name, protocol, port, description, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM services",
4515 /* Q_ASVC - ADD_SERVICE */
4521 "INTO services (name, protocol, port, description) VALUES ('%s', '%s', %s, NVL('%s', CHR(0)))",
4531 /* Q_DSVC - DELETE_SERVICE */
4547 /* Q_GPRN - GET_PRINTER */
4553 "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
4556 "pr.name LIKE '%s' AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl",
4563 /* Q_GPBD - GET_PRINTER_BY_DUPLEXNAME */
4564 "get_printer_by_duplexname",
4569 "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
4572 "pr.duplexname LIKE '%s' AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl",
4579 /* Q_GPBE - GET_PRINTER_BY_ETHERNET */
4580 "get_printer_by_ethernet",
4585 "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
4588 "m1.hwaddr LIKE LOWER('%s') AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl",
4595 /* Q_GPBH - GET_PRINTER_BY_HOSTNAME */
4596 "get_printer_by_hostname",
4601 "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
4604 "m1.name LIKE UPPER('%s') AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl",
4611 /* Q_GPBR - GET_PRINTER_BY_RM */
4612 "get_printer_by_rm",
4617 "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
4620 "m3.name LIKE UPPER('%s') AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl",
4627 /* Q_GPBL - GET_PRINTER_BY_LOCATION */
4628 "get_printer_by_location",
4633 "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
4636 "UPPER(pr.location) LIKE UPPER('%s') AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl",
4643 /* Q_GPBC - GET_PRINTER_BY_CONTACT */
4644 "get_printer_by_contact",
4649 "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
4652 "UPPER(pr.contact) LIKE UPPER('%s') AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl",
4659 /* Q_APRN - ADD_PRINTER */
4665 "INTO printers (name, type, hwtype, duplexname, mach_id, loghost, rm, rp, rq, ka, pc, ac, lpc_acl, banner, location, contact) VALUES ('%s', '%s', '%s', NVL('%s', CHR(0)), %d, %d, %d, NVL('%s', CHR(0)), %d, %s, %s, %d, %d, %s, NVL('%s', CHR(0)), NVL('%s', CHR(0)))",
4675 /* Q_UPRN - UPDATE_PRINTER */
4681 "printers SET name = '%s', type = '%s', hwtype = '%s', duplexname = NVL('%s', CHR(0)), mach_id = %d, loghost = %d, rm = %d, rp = NVL('%s', CHR(0)), rq = %d, ka = %d, pc = %d, ac = %d, lpc_acl = %d, banner = %d, location = NVL('%s', CHR(0)), contact = NVL('%s', CHR(0))",
4691 /* Q_DPRN - DELETE_PRINTER */
4707 /* Q_GPSV - GET_PRINT_SERVER */
4713 "m.name, ps.kind, s.string, ps.owner_type, ps.owner_id, l.name, TO_CHAR(ps.modtime, 'DD-mon-YYYY HH24:MI:SS'), ps.modby, ps.modwith FROM printservers ps, machine m, strings s, list l",
4716 "ps.mach_id = %d AND m.mach_id = ps.mach_id AND s.string_id = ps.printer_types AND l.list_id = ps.lpc_acl",
4723 /* Q_APSV - ADD_PRINT_SERVER */
4729 "INTO printservers (mach_id, kind, printer_types, owner_type, owner_id, lpc_acl) VALUES (%d, '%s', %d, '%s', %d, %d)",
4739 /* Q_UPSV - UPDATE_PRINT_SERVER */
4740 "update_print_server",
4745 "printservers SET kind = '%s', printer_types = %d, owner_type = '%s', owner_id = %d, lpc_acl = %d",
4755 /* Q_DPSV - DELETE_PRINT_SERVER */
4756 "delete_print_server",
4771 /* Q_GALI - GET_ALIAS */
4777 "name, type, trans FROM alias",
4780 "name LIKE '%s' AND type LIKE '%s' AND trans LIKE '%s'",
4782 "type, name, trans",
4787 /* Q_AALI - ADD_ALIAS */
4793 "INTO alias (name, type, trans) VALUES ('%s', '%s', '%s')",
4803 /* Q_DALI - DELETE_ALIAS */
4812 "name = '%s' AND type = '%s' AND trans = '%s'",
4819 /* Q_GVAL - GET_VALUE */
4825 "value FROM numvalues",
4835 /* Q_AVAL - ADD_VALUE */
4841 "INTO numvalues (name, value) VALUES ('%s', %s)",
4851 /* Q_UVAL - UPDATE_VALUE */
4857 "numvalues SET value = %s",
4867 /* Q_DVAL - DELETE_VALUE */
4883 /* Q_GATS - GET_ALL_TABLE_STATS */
4884 "get_all_table_stats",
4889 "table_name, appends, updates, deletes, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS') FROM tblstats",
4899 /* Q__SDL - _SET_DEBUG_LEVEL */
4916 int QueryCount2 = (sizeof(Queries2) / sizeof(struct query));