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
22 * A word about validation objects and locking: The validation object
23 * for a query should also request locks on behalf of the pre-processing
24 * and post-processing routines. This helps to ensure that tables are
25 * accessed and locked in the proper order and thus avoids deadlock
29 static struct valobj VOsort0[] = {
33 static struct valobj VOwild0[] = {
37 static struct valobj VOupwild0[] = {
41 static struct valobj VOwild0sort[] = {
46 static struct valobj VOupwild0sort[] = {
51 static struct valobj VOwild01sort0[] = {
57 static struct valobj VOwild01sort01[] = {
64 static struct valobj VOwild012sort0[] = { /* get_alias */
72 static struct valobj VOuser0[] = {
73 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
77 static struct valobj VOuser0lock[] = {
78 {V_LOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
79 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
82 static struct valobj VOmach0[] = {
83 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
86 static struct valobj VOclu0[] = {
87 {V_ID, 0, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
90 static struct valobj VOlist0[] = {
91 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
95 static struct valobj VOchar0[] = {
101 static struct valobj VOfilsys0user1[] = {
102 {V_LOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
103 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
104 {V_ID, 1, USERS_TABLE, "login", "users_id", MR_USER},
109 * Commonly used validation records defined here so that they may
113 static struct validate VDmach = { VOmach0, 1 };
114 static struct validate VDwild0= { VOwild0, 1 };
115 static struct validate VDupwild0= { VOupwild0, 1 };
116 static struct validate VDwild2sort2 = { VOwild01sort01, 4 };
117 static struct validate VDwild3sort1 = { VOwild012sort0, 4 };
118 static struct validate VDsortf = {
130 static struct validate VDwildsortf = {
141 static struct validate VDsort0= { VOsort0, 1 };
144 static struct validate VDupwildsortf = {
157 static char *galo_fields[] = {
158 "login", "unix_uid", "shell", "last", "first", "middle",
161 static char *gual_fields[] = {
163 "login", "unix_uid", "shell", "last", "first", "middle", "status",
164 "clearid", "class", "comments", "signature", "secure", "modby", "modby", "modwith",
167 static char *gubl_fields[] = {
169 "login", "unix_uid", "shell", "last", "first", "middle", "status",
170 "clearid", "class", "modby", "modby", "modwith",
173 static struct validate gubl_validate =
186 static char *guau_fields[] = {
188 "login", "unix_uid", "shell", "last", "first", "middle", "status",
189 "clearid", "class", "comments", "signature", "secure", "modby", "modby", "modwith",
192 static char *guan_fields[] = {
194 "login", "unix_uid", "shell", "last", "first", "middle", "status",
195 "clearid", "class", "comments", "signature", "secure", "modby", "modby", "modwith",
198 static struct validate guan_validate =
211 static char *guac_fields[] = {
213 "login", "unix_uid", "shell", "last", "first", "middle", "status",
214 "clearid", "class", "comments", "signature", "secure", "modby", "modby", "modwith",
217 static char *guam_fields[] = {
219 "login", "unix_uid", "shell", "last", "first", "middle", "status",
220 "clearid", "class", "comments", "signature", "secure", "modby", "modby", "modwith",
223 static char *gubu_fields[] = {
225 "login", "unix_uid", "shell", "last", "first", "middle", "status",
226 "clearid", "class", "modby", "modby", "modwith",
229 static struct validate gubu_validate =
242 static char *gubn_fields[] = {
244 "login", "unix_uid", "shell", "last", "first", "middle", "status",
245 "clearid", "class", "modby", "modby", "modwith",
248 static struct validate gubn_validate =
261 static char *gubc_fields[] = {
263 "login", "unix_uid", "shell", "last", "first", "middle", "status",
264 "clearid", "class", "modby", "modby", "modwith",
267 static char *gubm_fields[] = {
269 "login", "unix_uid", "shell", "last", "first", "middle", "status",
270 "clearid", "class", "modby", "modby", "modwith",
273 static char *gudf_fields[] = {
275 "dirsuppress", "dirremote"
278 static struct validate gudf_validate =
291 static char *auac_fields[] = {
292 "login", "unix_uid", "shell", "last", "first", "middle", "status",
293 "clearid", "class", "comments", "signature", "secure",
296 static struct valobj auac_valobj[] = {
297 {V_LOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
298 {V_CHAR, 0, USERS_TABLE, "login"},
299 {V_CHAR, 2, USERS_TABLE, "shell"},
300 {V_CHAR, 3, USERS_TABLE, "last"},
301 {V_CHAR, 4, USERS_TABLE, "first"},
302 {V_CHAR, 5, USERS_TABLE, "middle"},
303 {V_CHAR, 7, USERS_TABLE, "clearid"},
304 {V_TYPE, 8, 0, "class", 0, MR_BAD_CLASS},
305 {V_ID, 9, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
308 static struct validate auac_validate = {
320 static struct validate ausr_validate = {
332 static char *rusr_fields[] = {
333 "unix_uid", "login", "fs_type"
336 static struct valobj rusr_valobj[] = {
337 {V_LOCK, 0, IMEMBERS_TABLE, 0, "list_id", MR_DEADLOCK},
338 {V_LOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
339 {V_LOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
340 {V_RLOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
341 {V_LOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
342 {V_LOCK, 0, NFSPHYS_TABLE, 0, "nfsphys_id", MR_DEADLOCK},
343 {V_LOCK, 0, QUOTA_TABLE, 0, "filsys_id", MR_DEADLOCK},
344 {V_RLOCK, 0, SERVERHOSTS_TABLE, 0, "mach_id", MR_DEADLOCK},
347 static struct validate rusr_validate = {
359 static char *uuac_fields[] = {
361 "newlogin", "unix_uid", "shell", "last", "first", "middle", "status",
362 "clearid", "class", "comments", "signature", "secure",
365 static struct valobj uuac_valobj[] = {
366 {V_LOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
367 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
368 {V_RENAME, 1, USERS_TABLE, "login", "users_id", MR_NOT_UNIQUE},
369 {V_CHAR, 3, USERS_TABLE, "shell"},
370 {V_CHAR, 4, USERS_TABLE, "first"},
371 {V_CHAR, 5, USERS_TABLE, "last"},
372 {V_CHAR, 6, USERS_TABLE, "middle"},
373 {V_CHAR, 8, USERS_TABLE, "clearid"},
374 {V_TYPE, 9, 0, "class", 0, MR_BAD_CLASS},
375 {V_ID, 10, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
378 static struct validate uuac_validate = {
390 static struct validate uusr_validate = {
402 static char *uush_fields[] = {
407 static struct valobj uush_valobj[] = {
408 {V_LOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
409 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
410 {V_CHAR, 1, USERS_TABLE, "shell"},
413 static struct validate uush_validate = {
425 static char *uust_fields[] = {
430 static char *uuss_fields[] = {
435 static struct validate uust_validate = {
447 static char *uudf_fields[] = {
449 "dirsuppress", "dirremote"
452 static struct validate uudf_validate = {
464 static char *dusr_fields[] = {
468 struct valobj dusr_valobj[]= {
469 {V_LOCK, 0, IMEMBERS_TABLE, 0, "list_id", MR_DEADLOCK},
470 {V_LOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
471 {V_LOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
472 {V_LOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
473 {V_LOCK, 0, QUOTA_TABLE, 0, "filsys_id", MR_DEADLOCK},
474 {V_LOCK, 0, HOSTACCESS_TABLE, 0, "mach_id", MR_DEADLOCK},
475 {V_LOCK, 0, KRBMAP_TABLE, 0, "users_id", MR_DEADLOCK},
476 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
479 static struct validate dusr_validate = {
491 static char *dubu_fields[] = {
495 static struct valobj dubu_valobj[] = {
496 {V_LOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
497 {V_ID, 0, USERS_TABLE, "unix_uid", "users_id", MR_USER}
500 static struct validate dubu_validate = {
512 static char *gkum_fields[] = { "login", "kerberos",
513 "login", "kerberos" };
515 static char *akum_fields[] = { "login", "kerberos" };
517 static struct valobj akum_valobj[] =
519 {V_LOCK, 0, KRBMAP_TABLE, 0, "users_id", MR_DEADLOCK},
520 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
521 {V_ID, 1, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
524 static struct validate akum_validate =
529 "users_id = %d or string_id = %d",
537 static struct validate dkum_validate =
542 "users_id = %d and string_id = %d",
550 static char *gfbl_fields[] = {
552 "login", "fullname", "nickname", "home_addr",
553 "home_phone", "office_addr", "office_phone", "department",
554 "affiliation", "modby", "modby", "modwith",
557 static struct validate gfbl_validate = {
569 static char *ufbl_fields[] = {
571 "fullname", "nickname", "home_addr",
572 "home_phone", "office_addr", "office_phone", "department",
576 static struct valobj ufbl_valobj[] = {
577 {V_LOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
578 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
579 {V_LEN, 1, USERS_TABLE, "fullname"},
580 {V_LEN, 2, USERS_TABLE, "nickname"},
581 {V_LEN, 3, USERS_TABLE, "home_addr"},
582 {V_LEN, 4, USERS_TABLE, "home_phone"},
583 {V_LEN, 5, USERS_TABLE, "office_addr"},
584 {V_LEN, 6, USERS_TABLE, "office_phone"},
585 {V_LEN, 7, USERS_TABLE, "department"},
586 {V_LEN, 8, USERS_TABLE, "affiliation"},
589 static struct validate ufbl_validate = {
601 static char *gpob_fields[] = {
603 "login", "type", "box", "modby", "modby", "modwith",
606 static struct validate gpob_validate = {
610 "potype != 'NONE' and users_id = %d",
618 static char *gpox_fields[] = {
619 "login", "type", "box",
622 struct valobj gpox_valobj[] = {
623 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
624 {V_RLOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK}
627 static struct validate gpox_validate = {
639 static char *spob_fields[] = {
640 "login", "type", "box",
643 static struct valobj spob_valobj[] = {
644 {V_LOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
645 {V_RLOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
646 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
647 {V_TYPE, 1, 0, "pobox", 0, MR_TYPE},
650 static struct validate spob_validate = /* SET_POBOX */
663 struct valobj spop_valobj[] = {
664 {V_LOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
665 {V_RLOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
666 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
669 static struct validate spop_validate = /* SET_POBOX_POP */
682 static struct validate dpob_validate = /* DELETE_POBOX */
695 static char *gmac_fields[] = {
697 "name", "type", "modby", "modby", "modwith",
700 static char *ghst_fields[] = {
701 "name", "address", "location", "network",
702 "name", "vendor", "model", "os", "location", "contact", "use", "status", "status_change", "network", "address", "ace_type", "ace_name", "admin_comment", "ops_comment", "created", "creator", "inuse", "modby", "modby", "modwith",
705 static struct valobj ghst_valobj[] = {
713 static struct validate ghst_validate = {
725 static char *ahst_fields[] = {
726 "name", "vendor", "model", "os", "location", "contact", "use", "status", "subnet", "address", "ace_type", "ace_name", "admin_comment", "ops_comment",
729 static struct valobj ahst_valobj[] = {
730 {V_CHAR, 0, MACHINE_TABLE, "name"},
731 {V_CHAR, 1, MACHINE_TABLE, "vendor"},
732 {V_CHAR, 2, MACHINE_TABLE, "model"},
733 {V_CHAR, 3, MACHINE_TABLE, "os"},
734 {V_CHAR, 4, MACHINE_TABLE, "location"},
735 {V_CHAR, 5, MACHINE_TABLE, "contact"},
736 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
737 {V_LOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
738 {V_RLOCK, 0, SUBNET_TABLE, 0, "snet_id", MR_DEADLOCK},
739 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
740 {V_RLOCK, 0, HOSTALIAS_TABLE, 0, "mach_id", MR_DEADLOCK},
741 {V_ID, 8, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
742 {V_TYPE, 10, 0, "ace_type", 0, MR_ACE},
743 {V_TYPEDATA, 11, 0, 0, 0, MR_ACE},
744 {V_ID, 12, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
745 {V_ID, 13, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
748 static struct validate ahst_validate = {
752 "name = UPPER('%s')",
757 set_uppercase_modtime,
760 static char *uhst_fields[] = {
762 "newname", "vendor", "model", "os", "location", "contact", "use", "status", "subnet", "address", "ace_type", "ace_name", "admin_comment", "ops_comment",
765 static struct valobj uhst_valobj[] = {
766 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
767 {V_LOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
768 {V_RLOCK, 0, SUBNET_TABLE, 0, "snet_id", MR_DEADLOCK},
769 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
770 {V_CHAR, 0, MACHINE_TABLE, "name"},
771 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
772 {V_RENAME, 1, MACHINE_TABLE, "name", "mach_id", MR_NOT_UNIQUE},
773 {V_CHAR, 2, MACHINE_TABLE, "vendor"},
774 {V_CHAR, 3, MACHINE_TABLE, "model"},
775 {V_CHAR, 4, MACHINE_TABLE, "os"},
776 {V_CHAR, 5, MACHINE_TABLE, "location"},
777 {V_ID, 9, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
778 {V_TYPE, 11, 0, "ace_type", 0, MR_ACE},
779 {V_TYPEDATA, 12, 0, 0, 0, MR_ACE},
780 {V_ID, 13, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
781 {V_ID, 14, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
784 static struct validate uhst_validate = {
796 static char *dhst_fields[] = {
800 static struct valobj dhst_valobj[] = {
801 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
802 {V_LOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
803 {V_RLOCK, 0, NFSPHYS_TABLE, 0, "nfsphys_id", MR_DEADLOCK},
804 {V_RLOCK, 0, SERVERHOSTS_TABLE, 0, "mach_id", MR_DEADLOCK},
805 {V_RLOCK, 0, HOSTACCESS_TABLE, 0, "mach_id", MR_DEADLOCK},
806 {V_RLOCK, 0, HOSTALIAS_TABLE, 0, "mach_id", MR_DEADLOCK},
807 {V_LOCK, 0, MCMAP_TABLE, 0, "mach_id", MR_DEADLOCK},
808 {V_RLOCK, 0, PRINTCAP_TABLE, 0, "mach_id", MR_DEADLOCK},
809 {V_RLOCK, 0, PALLADIUM_TABLE, 0, "mach_id", MR_DEADLOCK},
810 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
813 static struct validate dhst_validate = {
825 static char *ghal_fields[] = {
826 "alias", "canonical_hostname",
827 "alias", "canonical_hostname"
830 static struct valobj ghal_valobj[] = {
836 static struct validate ghal_validate = {
848 static struct valobj ahal_valobj[] = {
849 {V_CHAR, 0, HOSTALIAS_TABLE, "name"},
851 {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
854 static struct validate ahal_validate = {
866 static struct valobj dhal_valobj[] = {
868 {V_LOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
869 {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
872 static struct validate dhal_validate = {
876 "name = '%s' AND mach_id = %d",
884 static char *gsnt_fields[] = {
886 "name", "description", "address", "mask", "low", "high", "prefix", "ace_type", "ace_name",
887 "modby", "modby", "modwith"
890 static struct valobj gsnt_valobj[] = {
891 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
892 {V_RLOCK, 0, SUBNET_TABLE, 0, "snet_id", MR_DEADLOCK},
893 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
898 static struct validate gsnt_validate = {
910 static char *asnt_fields[] = {
911 "name", "description", "address", "mask", "low", "high", "prefix", "ace_type", "ace_name",
914 static struct valobj asnt_valobj[] = {
915 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
916 {V_LOCK, 0, SUBNET_TABLE, 0, "snet_id", MR_DEADLOCK},
917 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
918 {V_CHAR, 0, SUBNET_TABLE, "name"},
919 {V_LEN, 1, SUBNET_TABLE, "description"},
920 {V_LEN, 6, SUBNET_TABLE, "prefix"},
921 {V_TYPE, 7, 0, "ace_type", 0, MR_ACE},
922 {V_TYPEDATA, 8, 0, 0, 0, MR_ACE},
925 static struct validate asnt_validate =
930 "name = UPPER('%s')",
935 set_uppercase_modtime,
938 static char *usnt_fields[] = {
940 "newname", "description", "address", "mask", "low", "high", "prefix", "ace_type", "ace_name",
943 static struct valobj usnt_valobj[] = {
944 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
945 {V_LOCK, 0, SUBNET_TABLE, 0, "snet_id", MR_DEADLOCK},
946 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
947 {V_ID, 0, SUBNET_TABLE, "name", "snet_id", MR_NO_MATCH},
948 {V_RENAME, 1, SUBNET_TABLE, "name", "snet_id", MR_NOT_UNIQUE},
949 {V_LEN, 2, SUBNET_TABLE, "description"},
950 {V_LEN, 7, SUBNET_TABLE, "prefix"},
951 {V_TYPE, 8, 0, "ace_type", 0, MR_ACE},
952 {V_TYPEDATA, 9, 0, 0, 0, MR_ACE},
955 static struct validate usnt_validate =
968 static char *dsnt_fields[] = {
972 static struct valobj dsnt_valobj[] = {
973 {V_RLOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
974 {V_LOCK, 0, SUBNET_TABLE, 0, "snet_id", MR_DEADLOCK},
975 {V_ID, 0, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
978 static struct validate dsnt_validate = {
990 static char *gclu_fields[] = {
992 "name", "description", "location", "modby", "modby", "modwith",
995 static char *aclu_fields[] = {
996 "name", "description", "location",
999 static struct valobj aclu_valobj[] = {
1000 {V_LOCK, 0, CLUSTERS_TABLE, 0, "clu_id", MR_DEADLOCK},
1001 {V_CHAR, 0, CLUSTERS_TABLE, "name"},
1002 {V_LEN, 1, CLUSTERS_TABLE, "description"},
1003 {V_LEN, 2, CLUSTERS_TABLE, "location"},
1006 static struct validate aclu_validate =
1019 static char *uclu_fields[] = {
1021 "newname", "description", "location",
1024 static struct valobj uclu_valobj[] = {
1025 {V_LOCK, 0, CLUSTERS_TABLE, 0, "clu_id", MR_DEADLOCK},
1026 {V_ID, 0, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
1027 {V_RENAME, 1, CLUSTERS_TABLE, "name", "clu_id", MR_NOT_UNIQUE},
1028 {V_LEN, 2, CLUSTERS_TABLE, "description"},
1029 {V_LEN, 3, CLUSTERS_TABLE, "location"},
1032 static struct validate uclu_validate = {
1044 static char *dclu_fields[] = {
1048 static struct validate dclu_validate = {
1060 static char *gmcm_fields[] = {
1061 "machine", "cluster",
1062 "machine", "cluster",
1065 static struct valobj gmcm_valobj[] =
1073 static struct validate gmcm_validate = { gmcm_valobj, 4 };
1075 static struct valobj amtc_valobj[] = /* ADD_MACHINE_TO_CLUSTER */
1076 { /* DELETE_MACHINE_FROM_CLUSTER */
1077 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1078 {V_ID, 1, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
1081 static struct validate amtc_validate = /* for amtc and dmfc */
1086 "mach_id = %d and clu_id = %d",
1091 set_mach_modtime_by_id,
1094 static char *gcld_fields[] = {
1095 "cluster", "serv_label",
1096 "cluster", "serv_label", "serv_cluster",
1099 static char *acld_fields[] = {
1100 "cluster", "serv_label", "serv_cluster",
1103 static struct valobj acld_valobj[] =
1105 {V_ID, 0, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
1106 {V_CHAR, 1, SVC_TABLE, "serv_label"},
1107 {V_CHAR, 2, SVC_TABLE, "serv_cluster"}
1110 static struct validate acld_validate =
1115 "clu_id = %d AND serv_label = '%s' AND serv_cluster = '%s'",
1120 set_cluster_modtime_by_id,
1123 static struct valobj dcld_valobj[] =
1125 {V_ID, 0, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
1128 static struct validate dcld_validate =
1133 "clu_id = %d AND serv_label = '%s' AND serv_cluster = '%s'",
1138 set_cluster_modtime_by_id,
1141 static char *glin_fields[] = {
1143 "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
1144 "ace_type", "ace_name", "description", "modby", "modby", "modwith",
1147 static struct validate glin_validate = {
1154 access_vis_list_by_name,
1159 static char *alis_fields[] = {
1160 "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
1161 "ace_type", "ace_name", "description",
1164 static struct valobj alis_valobj[] = {
1165 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1166 {V_LOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1167 {V_CHAR, 0, LIST_TABLE, "name"},
1168 {V_TYPE, 7, 0, "ace_type", 0, MR_ACE},
1169 {V_TYPEDATA, 8, 0, 0, "list_id", MR_ACE},
1170 {V_LEN, 9, LIST_TABLE, "description"},
1173 static struct validate alis_validate = {
1185 static char *ulis_fields[] = {
1187 "newname", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
1188 "ace_type", "ace_name", "description",
1191 static struct valobj ulis_valobj[] = {
1192 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1193 {V_LOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1194 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
1195 {V_RENAME, 1, LIST_TABLE, "name", "list_id", MR_NOT_UNIQUE},
1196 {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
1197 {V_CHAR, 1, LIST_TABLE, "name"},
1198 {V_LEN, 10, LIST_TABLE, "description"},
1201 static struct validate ulis_validate = {
1213 static char *dlis_fields[] = {
1217 static struct valobj dlis_valobj[] = {
1218 {V_RLOCK, 0, CAPACLS_TABLE, 0, "list_id", MR_DEADLOCK},
1219 {V_RLOCK, 0, IMEMBERS_TABLE, 0, "list_id", MR_DEADLOCK},
1220 {V_RLOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1221 {V_LOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1222 {V_RLOCK, 0, QUOTA_TABLE, 0, "filsys_id", MR_DEADLOCK},
1223 {V_RLOCK, 0, ZEPHYR_TABLE, 0, "xmt_id", MR_DEADLOCK},
1224 {V_RLOCK, 0, HOSTACCESS_TABLE, 0, "mach_id", MR_DEADLOCK},
1225 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST}
1228 static struct validate dlis_validate = {
1240 static char *amtl_fields[] = {
1241 "list_name", "member_type", "member_name",
1244 static struct valobj amtl_valobj[] = {
1245 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1246 {V_LOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1247 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
1248 {V_TYPE, 1, 0, "member", 0, MR_TYPE},
1249 {V_TYPEDATA, 2, 0, 0, 0, MR_NO_MATCH},
1252 static struct validate amtl_validate =
1265 static struct validate dmfl_validate =
1275 delete_member_from_list,
1278 static char *gaus_fields[] = {
1279 "ace_type", "ace_name",
1280 "use_type", "use_name",
1283 static struct valobj gaus_valobj[] = {
1284 {V_RLOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1285 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1286 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1287 {V_RLOCK, 0, ZEPHYR_TABLE, 0, "xmt_id", MR_DEADLOCK},
1288 {V_RLOCK, 0, HOSTACCESS_TABLE, 0, "mach_id", MR_DEADLOCK},
1289 {V_TYPE, 0, 0, "gaus", 0, MR_TYPE},
1290 {V_TYPEDATA, 1, 0, 0, 0, MR_NO_MATCH},
1293 static struct validate gaus_validate = {
1305 static char *qgli_fields[] = {
1306 "active", "publicflg", "hidden", "maillist", "grouplist",
1310 static struct valobj qgli_valobj[] = {
1311 {V_TYPE, 0, 0, "boolean", 0, MR_TYPE},
1312 {V_TYPE, 1, 0, "boolean", 0, MR_TYPE},
1313 {V_TYPE, 2, 0, "boolean", 0, MR_TYPE},
1314 {V_TYPE, 3, 0, "boolean", 0, MR_TYPE},
1315 {V_TYPE, 4, 0, "boolean", 0, MR_TYPE},
1318 static struct validate qgli_validate = {
1327 qualified_get_lists,
1330 static char *gmol_fields[] = {
1332 "member_type", "member_name",
1335 static struct valobj gmol_valobj[] = {
1336 {V_LOCK, 0, IMEMBERS_TABLE, 0, "list_id", MR_DEADLOCK},
1337 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1338 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
1341 static struct validate gmol_validate = {
1348 access_visible_list,
1350 get_members_of_list,
1353 static struct validate geml_validate = {
1360 access_visible_list,
1362 get_end_members_of_list,
1365 static char *glom_fields[] = {
1366 "member_type", "member_name",
1367 "list_name", "active", "publicflg", "hidden", "maillist", "grouplist",
1370 static struct valobj glom_valobj[] = {
1371 {V_LOCK, 0, IMEMBERS_TABLE, 0, "list_id", MR_DEADLOCK},
1372 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1373 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1374 {V_TYPE, 0, 0, "rmember", 0, MR_TYPE},
1375 {V_TYPEDATA, 1, 0, 0, 0, MR_NO_MATCH},
1379 static struct validate glom_validate = {
1388 get_lists_of_member,
1391 static char *cmol_fields[] = {
1396 static struct validate cmol_validate = {
1403 access_visible_list,
1405 count_members_of_list,
1408 static char *gsin_fields[] = {
1410 "service", "update_int", "target_file", "script", "dfgen", "dfcheck",
1411 "type", "enable", "inprogress", "harderror", "errmsg",
1412 "ace_type", "ace_name", "modby", "modby", "modwith",
1415 static struct valobj gsin_valobj[] =
1417 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1418 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1422 static struct validate gsin_validate =
1435 static char *qgsv_fields[] = {
1436 "enable", "inprogress", "harderror",
1440 static struct valobj qgsv_valobj[] = {
1441 {V_TYPE, 0, 0, "boolean", 0, MR_TYPE},
1442 {V_TYPE, 1, 0, "boolean", 0, MR_TYPE},
1443 {V_TYPE, 2, 0, "boolean", 0, MR_TYPE},
1446 static struct validate qgsv_validate = {
1455 qualified_get_server,
1458 static char *asin_fields[] = {
1459 "service", "update_int", "target_file", "script", "type", "enable",
1460 "ace_type", "ace_name",
1463 static struct valobj asin_valobj[] = {
1464 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1465 {V_LOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
1466 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1467 {V_CHAR, 0, SERVERS_TABLE, "name"},
1468 {V_LEN, 2, SERVERS_TABLE, "target_file"},
1469 {V_LEN, 3, SERVERS_TABLE, "script"},
1470 {V_TYPE, 4, 0, "service", 0, MR_TYPE},
1471 {V_TYPE, 6, 0, "ace_type", 0, MR_ACE},
1472 {V_TYPEDATA, 7, 0, 0, 0, MR_ACE},
1475 static struct validate asin_validate = /* for asin, usin */
1480 "name = UPPER('%s')",
1485 set_uppercase_modtime,
1488 static struct validate rsve_validate = {
1492 "name = UPPER('%s')",
1497 set_uppercase_modtime,
1500 static char *ssif_fields[] = {
1501 "service", "dfgen", "dfcheck", "inprogress", "harderror", "errmsg",
1504 static struct valobj ssif_valobj[] = {
1505 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1506 {V_LOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
1507 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1508 {V_LEN, 5, SERVERS_TABLE, "errmsg"},
1511 static struct validate ssif_validate = {
1515 "name = UPPER('%s')",
1523 static char *dsin_fields[] = {
1527 static struct validate dsin_validate = {
1531 "name = UPPER('%s')",
1539 static char *gshi_fields[] = {
1540 "service", "machine",
1541 "service", "machine", "enable", "override", "success", "inprogress",
1542 "hosterror", "hosterrormsg", "ltt", "lts", "value1", "value2",
1543 "value3", "modby", "modby", "modwith",
1546 static struct valobj gshi_valobj[] = {
1551 static struct validate gshi_validate = {
1563 static char *qgsh_fields[] = {
1564 "service", "enable", "override", "success", "inprogress", "hosterror",
1565 "service", "machine",
1568 static struct valobj qgsh_valobj[] = {
1569 {V_TYPE, 1, 0, "boolean", 0, MR_TYPE},
1570 {V_TYPE, 2, 0, "boolean", 0, MR_TYPE},
1571 {V_TYPE, 3, 0, "boolean", 0, MR_TYPE},
1572 {V_TYPE, 4, 0, "boolean", 0, MR_TYPE},
1573 {V_TYPE, 5, 0, "boolean", 0, MR_TYPE},
1576 static struct validate qgsh_validate = {
1585 qualified_get_serverhost,
1588 static char *ashi_fields[] = {
1589 "service", "machine", "enable", "value1", "value2", "value3",
1592 static struct valobj ashi_valobj[] = {
1593 {V_LOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
1594 {V_NAME, 0, SERVERS_TABLE, "name", 0, MR_SERVICE},
1595 {V_LOCK, 0, SERVERHOSTS_TABLE, 0, "mach_id", MR_DEADLOCK},
1596 {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1597 {V_CHAR, 0, SERVERHOSTS_TABLE, "service"},
1598 {V_LEN, 5, SERVERHOSTS_TABLE, "value3"},
1601 static struct validate ashi_validate = /* ashi & ushi */
1606 "service = UPPER('%s') AND mach_id = %d",
1611 set_serverhost_modtime,
1614 static struct validate rshe_validate =
1619 "service = UPPER('%s') AND mach_id = %d",
1624 set_serverhost_modtime,
1627 static struct validate ssho_validate =
1632 "service = UPPER('%s') AND mach_id = %d",
1640 static char *sshi_fields[] = {
1641 "service", "machine", "override", "success", "inprogress",
1642 "hosterror", "errmsg", "ltt", "lts",
1645 static struct valobj sshi_valobj[] = {
1646 {V_RLOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
1647 {V_NAME, 0, SERVERS_TABLE, "name", 0, MR_SERVICE},
1648 {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE}, /** Was this ok to add? */
1649 {V_LEN, 5, SERVERS_TABLE, "errmsg"},
1652 static struct validate sshi_validate =
1665 static char *dshi_fields[] = {
1666 "service", "machine",
1669 static struct validate dshi_validate =
1674 "service = UPPER('%s') AND mach_id = %d",
1682 static char *gslo_fields[] = {
1684 "server", "machine",
1687 static char *gfsl_fields[] = {
1689 "label", "type", "machine", "name", "mount", "access", "comments", "owner", "owners",
1690 "create", "lockertype", "modby", "modby", "modwith",
1693 static char *gfsm_fields[] = {
1695 "label", "type", "machine", "name", "mount", "access", "comments", "owner", "owners",
1696 "create", "lockertype", "modby", "modby", "modwith",
1699 static struct valobj gfsm_valobj[] = {
1700 {V_RLOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1701 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1704 static struct validate gfsm_validate = {
1716 static char *gfsn_fields[] = {
1717 "machine", "parition",
1718 "label", "type", "machine", "name", "mount", "access", "comments", "owner", "owners",
1719 "create", "lockertype", "modby", "modby", "modwith",
1722 static struct valobj gfsn_valobj[] =
1724 {V_RLOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1725 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1729 static struct validate gfsn_validate = {
1741 static char *gfsp_fields[] = {
1743 "label", "type", "machine", "name", "mount", "access", "comments", "owner", "owners",
1744 "create", "lockertype", "modby", "modby", "modwith",
1747 static char *gfsg_fields[] = {
1749 "label", "type", "machine", "name", "mount", "access", "comments", "owner", "owners",
1750 "create", "lockertype", "modby", "modby", "modwith",
1753 static struct valobj gfsg_valobj[] = {
1754 {V_RLOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1755 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST}
1758 static struct validate gfsg_validate = {
1770 static char *afil_fields[] = {
1771 "label", "type", "machine", "name", "mount", "access", "comments", "owner", "owners",
1772 "create", "lockertype",
1775 static struct valobj afil_valobj[] = {
1776 {V_LOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1777 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1778 {V_RLOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
1779 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1780 {V_CHAR, 0, FILESYS_TABLE, "label"},
1781 {V_TYPE, 1, 0, "filesys", 0, MR_FSTYPE},
1782 {V_ID, 2, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1783 {V_CHAR, 3, FILESYS_TABLE, "name"},
1784 {V_LEN, 4, FILESYS_TABLE, "mount"},
1785 {V_LEN, 6, FILESYS_TABLE, "comments"},
1786 {V_ID, 7, USERS_TABLE, "login", "users_id", MR_USER},
1787 {V_ID, 8, LIST_TABLE, "name", "list_id", MR_LIST},
1788 {V_TYPE, 10, 0, "lockertype", 0, MR_TYPE},
1791 static struct validate afil_validate = {
1800 set_filesys_modtime,
1803 static char *ufil_fields[] = {
1804 "label", "newlabel", "type", "machine", "name", "mount", "access", "comments",
1805 "owner", "owners", "create", "lockertype",
1808 static struct valobj ufil_valobj[] = {
1809 {V_LOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1810 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1811 {V_RLOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
1812 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1813 {V_LOCK, 0, QUOTA_TABLE, 0, "filsys_id", MR_DEADLOCK},
1814 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
1815 {V_RENAME, 1, FILESYS_TABLE, "label", "filsys_id", MR_NOT_UNIQUE},
1816 {V_TYPE, 2, 0, "filesys", 0, MR_FSTYPE},
1817 {V_ID, 3, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1818 {V_CHAR, 4, FILESYS_TABLE, "name"},
1819 {V_LEN, 5, FILESYS_TABLE, "mount"},
1820 {V_LEN, 7, FILESYS_TABLE, "comments"},
1821 {V_ID, 8, USERS_TABLE, "login", "users_id", MR_USER},
1822 {V_ID, 9, LIST_TABLE, "name", "list_id", MR_LIST},
1823 {V_TYPE, 11, 0, "lockertype", 0, MR_TYPE},
1826 static struct validate ufil_validate = {
1835 set_filesys_modtime,
1838 static char *dfil_fields[] = {
1842 static struct valobj dfil_valobj[] = {
1843 {V_LOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1844 {V_LOCK, 0, NFSPHYS_TABLE, 0, "nfsphys_id", MR_DEADLOCK},
1845 {V_LOCK, 0, QUOTA_TABLE, 0, "filsys_id", MR_DEADLOCK},
1846 {V_LOCK, 0, FSGROUP_TABLE, 0, "filsys_id", MR_DEADLOCK},
1847 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
1850 static struct validate dfil_validate = {
1862 static char *gfgm_fields[] = {
1863 "fsgroup", "filesys", "sortkey"
1866 static struct valobj gfgm_valobj[] = {
1867 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
1872 static struct validate gfgm_validate = {
1884 static struct valobj aftg_valobj[] = {
1885 {V_LOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1886 {V_LOCK, 0, FSGROUP_TABLE, 0, "filsys_id", MR_DEADLOCK},
1887 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
1888 {V_ID, 1, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
1891 static struct validate aftg_validate = {
1895 "group_id = %d and filsys_id = %d",
1903 static char *ganf_fields[] = {
1904 "machine", "dir", "device", "status", "allocated", "size", "modby", "modby", "modwith",
1907 static char *gnfp_fields[] = {
1909 "machine", "dir", "device", "status", "allocated", "size", "modby", "modby", "modwith",
1912 static struct valobj gnfp_valobj[] = {
1913 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1914 {V_RLOCK, 0, NFSPHYS_TABLE, 0, "nfsphys_id", MR_DEADLOCK},
1918 static struct validate gnfp_validate = {
1930 static struct valobj anfp_valobj[] = {
1931 {V_RLOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
1932 {V_LOCK, 0, NFSPHYS_TABLE, 0, "nfsphys_id", MR_DEADLOCK},
1933 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1934 {V_CHAR, 1, NFSPHYS_TABLE, "dir"},
1935 {V_LEN, 2, NFSPHYS_TABLE, "device"},
1938 static struct validate anfp_validate = {
1942 "mach_id = %d and dir = '%s'",
1947 set_nfsphys_modtime,
1950 static struct validate unfp_validate = {
1954 "mach_id = %d and dir = '%s'",
1959 set_nfsphys_modtime,
1962 static char *ajnf_fields[] = {
1963 "machine", "dir", "adjustment",
1966 static char *dnfp_fields[] = {
1970 static struct valobj dnfp_valobj[] = {
1971 {V_RLOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1972 {V_LOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
1973 {V_LOCK, 0, NFSPHYS_TABLE, 0, "nfsphys_id", MR_DEADLOCK},
1974 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1978 static struct validate dnfp_validate = {
1982 "mach_id = %d and dir = '%s'",
1987 set_nfsphys_modtime,
1990 static char *gqot_fields[] = {
1991 "filesys", "type", "name",
1992 "filesys", "type", "name", "quota", "dir", "machine", "modby", "modby", "modwith",
1995 static struct valobj gqot_valobj[] = {
1996 {V_RLOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1997 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1998 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1999 {V_RLOCK, 0, NFSPHYS_TABLE, 0, "nfsphys_id", MR_DEADLOCK},
2000 {V_RLOCK, 0, QUOTA_TABLE, 0, "filsys_id", MR_DEADLOCK},
2002 {V_TYPE, 1, 0, "quota_type", 0, MR_TYPE},
2003 {V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
2004 {V_SORT, 0, 0, 0, 0, 0},
2007 static struct validate gqot_validate = {
2019 static char *gqbf_fields[] = {
2021 "filesys", "type", "name", "quota", "dir", "machine", "modby", "modby", "modwith",
2024 static struct validate gqbf_validate = {
2036 static char *aqot_fields[] = {
2037 "filesys", "type", "name", "quota",
2040 static struct valobj aqot_valobj[] = {
2041 {V_LOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
2042 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
2043 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
2044 {V_LOCK, 0, NFSPHYS_TABLE, 0, "nfsphys_id", MR_DEADLOCK},
2045 {V_LOCK, 0, QUOTA_TABLE, 0, "filsys_id", MR_DEADLOCK},
2046 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
2047 {V_TYPE, 1, 0, "quota_type", 0, MR_TYPE},
2048 {V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
2051 static struct validate aqot_validate = {
2055 "filsys_id = %d and type = '%s' and entity_id = %d",
2063 static struct validate uqot_validate = {
2067 "filsys_id = %d AND type = '%s' AND entity_id = %d",
2075 static struct validate dqot_validate = {
2079 "filsys_id = %d AND type = '%s' AND entity_id = %d",
2087 static char *gnfq_fields[] = {
2089 "filesys", "login", "quota", "dir", "machine", "modby", "modby", "modwith",
2092 static struct validate gnfq_validate = {
2104 static char *gnqp_fields[] = {
2106 "filesys", "login", "quota", "dir", "machine", "modby", "modby", "modwith",
2109 static struct valobj gnqp_valobj[] = {
2110 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2114 static struct validate gnqp_validate = { gnqp_valobj, 2, };
2116 static char *anfq_fields[] = {
2117 "filesys", "login", "quota",
2120 static struct validate anfq_validate = {
2124 "filsys_id = %d AND type = 'USER' AND entity_id = %d",
2132 static struct validate unfq_validate = {
2136 "filsys_id = %d AND type = 'USER' AND entity_id = %d",
2144 static struct validate dnfq_validate = {
2148 "filsys_id = %d AND entity_id = %d",
2156 static char *gzcl_fields[] = {
2158 "class", "xmt_type", "xmt_name", "sub_type", "sub_name",
2159 "iws_type", "iws_name", "iui_type", "iui_name", "modby", "modby", "modwith",
2162 static struct valobj gzcl_valobj[] = {
2163 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
2164 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
2165 {V_RLOCK, 0, ZEPHYR_TABLE, 0, "xmt_id", MR_DEADLOCK},
2169 static struct validate gzcl_validate = {
2181 static char *azcl_fields[] = {
2182 "class", "xmt_type", "xmt_name", "sub_type", "sub_name",
2183 "iws_type", "iws_name", "iui_type", "iui_name",
2186 static struct valobj azcl_valobj[] = {
2187 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
2188 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
2189 {V_LOCK, 0, ZEPHYR_TABLE, 0, "xmt_id", MR_DEADLOCK},
2190 {V_CHAR, 0, ZEPHYR_TABLE, "class"},
2191 {V_TYPE, 1, 0, "ace_type", 0, MR_ACE},
2192 {V_TYPEDATA, 2, 0, 0, "list_id", MR_ACE},
2193 {V_TYPE, 3, 0, "ace_type", 0, MR_ACE},
2194 {V_TYPEDATA, 4, 0, 0, "list_id", MR_ACE},
2195 {V_TYPE, 5, 0, "ace_type", 0, MR_ACE},
2196 {V_TYPEDATA, 6, 0, 0, "list_id", MR_ACE},
2197 {V_TYPE, 7, 0, "ace_type", 0, MR_ACE},
2198 {V_TYPEDATA, 8, 0, 0, "list_id", MR_ACE},
2201 static struct validate azcl_validate = {
2213 static char *uzcl_fields[] = {
2214 "class", "newclass", "xmt_type", "xmt_name", "sub_type", "sub_name",
2215 "iws_type", "iws_name", "iui_type", "iui_name",
2218 static struct valobj uzcl_valobj[] = {
2219 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
2220 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
2221 {V_LOCK, 0, ZEPHYR_TABLE, 0, "xmt_id", MR_DEADLOCK},
2222 {V_RENAME, 1, ZEPHYR_TABLE, "class", 0, MR_NOT_UNIQUE},
2223 {V_TYPE, 2, 0, "ace_type", 0, MR_ACE},
2224 {V_TYPEDATA, 3, 0, 0, "list_id", MR_ACE},
2225 {V_TYPE, 4, 0, "ace_type", 0, MR_ACE},
2226 {V_TYPEDATA, 5, 0, 0, "list_id", MR_ACE},
2227 {V_TYPE, 6, 0, "ace_type", 0, MR_ACE},
2228 {V_TYPEDATA, 7, 0, 0, "list_id", MR_ACE},
2229 {V_TYPE, 8, 0, "ace_type", 0, MR_ACE},
2230 {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
2233 static struct validate uzcl_validate = {
2245 static struct validate dzcl_validate = {
2257 static char *gsha_fields[] = {
2259 "machine", "ace_type", "ace_name", "modby", "modby", "modwith",
2262 static struct validate gsha_validate =
2275 static char *asha_fields[] = {
2276 "machine", "ace_type", "ace_name",
2279 static struct valobj asha_valobj[] = {
2280 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
2281 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2282 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
2283 {V_TYPE, 1, 0, "ace_type", 0, MR_ACE},
2284 {V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
2287 static struct validate asha_validate =
2300 static char *gsvc_fields[] = {
2302 "service", "protocol", "port", "description", "modby", "modby", "modwith",
2305 static char *asvc_fields[] = {
2306 "service", "protocol", "port", "description",
2309 static struct valobj asvc_valobj[] = {
2310 {V_CHAR, 0, SERVICES_TABLE, "name"},
2311 {V_CHAR, 1, SERVICES_TABLE, "protocol"},
2312 {V_CHAR, 3, SERVICES_TABLE, "description"},
2315 static struct validate asvc_validate = {
2327 static char *gpce_fields[] = {
2329 "printer", "spooling_host", "spool_directory", "rprinter",
2330 "quotaserver", "authenticate", "price", "comments",
2331 "modby", "modby", "modwith",
2334 static struct valobj gpce_valobj[] = {
2335 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
2336 {V_RLOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
2337 {V_RLOCK, 0, PRINTCAP_TABLE, 0, "mach_id", MR_DEADLOCK},
2342 static struct validate gpce_validate = {
2354 static char *apce_fields[] = {
2355 "printer", "spooling_host", "spool_directory", "rprinter",
2356 "quotaserver", "authenticate", "price", "comments",
2357 "modby", "modby", "modwith",
2360 static struct valobj apce_valobj[] = {
2361 {V_CHAR, 0, PRINTCAP_TABLE, "name"},
2362 {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2363 {V_LEN, 2, PRINTCAP_TABLE, "dir"},
2364 {V_LEN, 3, PRINTCAP_TABLE, "rp"},
2365 {V_ID, 4, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2366 {V_CHAR, 7, PRINTCAP_TABLE, "comments"},
2369 static struct validate apce_validate = {
2381 static struct validate dpce_validate = {
2393 static char *gpcp_fields[] = {
2395 "printer", "spooling_host", "spool_directory", "rprinter", "comments",
2396 "modby", "modby", "modwith",
2399 static char *gpdm_fields[] = {
2401 "name", "rpcnum", "host", "modby", "modby", "modwith",
2404 static char *apdm_fields[] = {
2405 "name", "rpcnum", "host"
2408 static struct valobj apdm_valobj[] = {
2409 {V_CHAR, 0, PALLADIUM_TABLE, "name"},
2410 {V_ID, 2, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2413 static struct validate apdm_validate = {
2425 static struct validate dpdm_validate = {
2437 static char *gali_fields[] = {
2438 "name", "type", "trans",
2439 "name", "type", "trans",
2442 static char *aali_fields[] = {
2443 "name", "type", "trans",
2446 static struct valobj aali_valobj[] = {
2447 {V_CHAR, 0, ALIAS_TABLE, "name"},
2448 {V_TYPE, 1, 0, "alias", 0, MR_TYPE},
2449 {V_CHAR, 2, ALIAS_TABLE, "trans"},
2452 static struct validate aali_validate = {
2456 "name = '%s' and type = '%s' and trans = '%s'",
2464 static struct validate dali_validate = /* DELETE_ALIAS */
2469 "name = '%s' and type = '%s' and trans = '%s'",
2477 static char *gval_fields[] = {
2481 static struct valobj gval_valobj[] = {
2482 {V_NAME, 0, NUMVALUES_TABLE, "name", 0, MR_NO_MATCH},
2485 static struct validate gval_validate = {
2497 static char *aval_fields[] = {
2501 static struct valobj aval_valobj[] = {
2502 {V_CHAR, 0, NUMVALUES_TABLE, "name"},
2505 static struct validate aval_validate = /* for aval, uval, and dval */
2518 static char *dval_fields[] = {
2522 static char *gats_fields[] = {
2523 "table_name", "appends", "updates", "deletes", "modby", "modby", "modwith",
2526 static char *_sdl_fields[] = {
2530 static struct validate _sdl_validate =
2545 /* Generalized Query Definitions */
2547 /* Note: For any query which uses prefetch_value, the vcnt should be
2548 * one less than the number of %-format specifiers in the tlist.
2551 struct query Queries2[] = {
2553 /* Q_GALO - GET_ALL_LOGINS */
2559 "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle FROM users u",
2568 /* Q_GAAL - GET_ALL_ACTIVE_LOGINS */
2569 "get_all_active_logins",
2574 "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle FROM users u",
2583 /* Q_GUAL - GET_USER_ACCOUNT_BY_LOGIN */
2584 "get_user_account_by_login",
2589 "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",
2592 "u.login LIKE '%s' ESCAPE '*' AND u.users_id != 0 AND u.comments = str.string_id",
2598 /* Q_GUAU - GET_USER_ACCOUNT_BY_UID */
2599 "get_user_account_by_uid",
2604 "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",
2607 "u.unix_uid = %s AND u.users_id != 0 AND u.comments = str.string_id",
2613 /* Q_GUAN - GET_USER_ACCOUNT_BY_NAME */
2614 "get_user_account_by_name",
2619 "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",
2622 "u.first LIKE '%s' ESCAPE '*' AND u.last LIKE '%s' ESCAPE '*' AND u.users_id != 0 and u.comments = str.string_id",
2628 /* Q_GUAC - GET_USER_ACCOUNT_BY_CLASS */
2629 "get_user_account_by_class",
2634 "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",
2637 "u.type = UPPER('%s') AND u.users_id != 0 AND u.comments = str.string_id",
2643 /* Q_GUAM - GET_USER_ACCOUNT_BY_MITID */
2644 "get_user_account_by_id",
2649 "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",
2652 "u.clearid LIKE '%s' ESCAPE '*' AND u.users_id != 0 AND u.comments = str.string_id",
2658 /* Q_GUBL - GET_USER_BY_LOGIN */
2659 "get_user_by_login",
2664 "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",
2667 "u.login LIKE '%s' ESCAPE '*' AND u.users_id != 0",
2673 /* Q_GUBU - GET_USER_BY_UID */
2679 "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",
2682 "u.unix_uid = %s AND u.users_id != 0",
2688 /* Q_GUBN - GET_USER_BY_NAME */
2694 "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",
2697 "u.first LIKE '%s' ESCAPE '*' AND u.last LIKE '%s' ESCAPE '*' AND u.users_id != 0",
2703 /* Q_GUBC - GET_USER_BY_CLASS */
2704 "get_user_by_class",
2709 "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",
2712 "u.type = UPPER('%s') AND u.users_id != 0",
2718 /* Q_GUBM - GET_USER_BY_MITID */
2719 "get_user_by_mitid",
2724 "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",
2727 "u.clearid LIKE '%s' ESCAPE '*' AND u.users_id != 0",
2733 /* Q_GUDF - GET_USER_DIRECTORY_FLAGS */
2734 "get_user_directory_flags",
2739 "u.dirsuppress, u.dirremote FROM users u",
2748 /* Q_AUAC - ADD_USER_ACCOUNT */ /* uses prefetch_value() for users_id */
2754 "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 */
2763 /* Q_AUSR - ADD_USER */ /* uses prefetch_value() for users_id */
2769 "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)",
2778 /* Q_RUSR - REGISTER_USER */
2793 /* Q_UUAC - UPDATE_USER_ACCOUNT */
2794 "update_user_account",
2799 "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 */
2808 /* Q_UUSR - UPDATE_USER */
2814 "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'",
2823 /* Q_UUSH - UPDATE_USER_SHELL */
2824 "update_user_shell",
2829 "users SET shell = '%s'",
2838 /* Q_UUST - UPDATE_USER_STATUS */
2839 "update_user_status",
2844 "users SET status = %s",
2853 /* Q_UUSS - UPDATE_USER_SECURITY_STATUS */
2854 "update_user_security_status",
2859 "users SET secure = %s",
2868 /* Q_UUDF - UPDATE_USER_DIRECTORY_FLAGS */
2869 "update_user_directory_flags",
2874 "users SET dirsuppress = %s, dirremote = %s",
2883 /* Q_DUSR - DELETE_USER */
2898 /* Q_DUBU - DELETE_USER_BY_UID */
2899 "delete_user_by_uid",
2913 /* Q_GKUM - GET_KERBEROS_USER_MAP */
2914 "get_kerberos_user_map",
2919 "u.login, str.string FROM krbmap km, users u, strings str",
2922 "u.login LIKE '%s' ESCAPE '*' AND str.string LIKE '%s' ESCAPE '*' AND km.users_id = u.users_id AND km.string_id = str.string_id",
2928 /* Q_AKUM - ADD_KERBEROS_USER_MAP */
2929 "add_kerberos_user_map",
2934 "INTO krbmap (users_id, string_id) VALUES (%d, %d)",
2943 /* Q_DKUM - DELETE_KERBEROS_USER_MAP */
2944 "delete_kerberos_user_map",
2952 "users_id = %d AND string_id = %d",
2958 /* Q_GFBL - GET_FINGER_BY_LOGIN */
2959 "get_finger_by_login",
2964 "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",
2973 /* Q_UFBL - UPDATE_FINGER_BY_LOGIN */
2974 "update_finger_by_login",
2979 "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))",
2988 /* Q_GPOB - GET_POBOX */
2994 "login, potype, pop_id || ':' || box_id, TO_CHAR(pmodtime, 'DD-mon-YYYY HH24:MI:SS'), pmodby, pmodwith FROM users",
3003 /* Q_GAPO - GET_ALL_POBOXES */
3009 "login, potype, pop_id || ':' || box_id FROM users",
3018 /* Q_GPOP - GET_POBOXES_POP */
3024 "login, potype, pop_id || ':' || box_id FROM users",
3033 /* Q_GPOF - GET_POBOXES_SMTP */
3039 "login, potype, pop_id || ':' || box_id FROM users",
3048 /* Q_SPOB - SET_POBOX */
3063 /* Q_SPOP - SET_POBOX_POP */
3069 "users SET potype = 'POP'",
3078 /* Q_DPOB - DELETE_POBOX */
3084 "users SET potype = 'NONE'",
3093 /* Q_GHST - GET_HOST */
3099 "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",
3102 "m.name LIKE '%s' ESCAPE '*' AND m.address LIKE '%s' ESCAPE '*' AND m.location LIKE '%s' ESCAPE '*' AND s.name LIKE '%s' ESCAPE '*' AND m.mach_id != 0 AND s.snet_id = m.snet_id",
3108 /* Q_AHST - ADD_HOST */ /* uses prefetch_value() for mach_id */
3114 "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)",
3123 /* Q_UHST - UPDATE_HOST */
3129 "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",
3138 /* Q_DHST - DELETE_HOST */
3153 /* Q_GMAC - GET_MACHINE */
3159 "name, vendor, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM machine",
3162 "name LIKE '%s' ESCAPE '*' AND mach_id != 0",
3168 /* Q_GHAL - GET_HOSTALIAS */
3174 "a.name, m.name FROM hostalias a, machine m",
3177 "m.mach_id = a.mach_id and a.name LIKE '%s' ESCAPE '*' AND m.name LIKE '%s' ESCAPE '*'",
3183 /* Q_AHAL - ADD_HOSTALIAS */
3189 "INTO hostalias (name, mach_id) VALUES (UPPER('%s'), %d)",
3198 /* Q_DHAL - DELETE_HOSTALIAS */
3207 "name = UPPER('%s') AND mach_id = %d",
3213 /* Q_GSNT - GET_SUBNET */
3219 "name, description, saddr, mask, low, high, prefix, owner_type, owner_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM subnet",
3222 "name LIKE '%s' ESCAPE '*' and snet_id != 0",
3228 /* Q_ASNT - ADD_SUBNET */
3234 "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)",
3243 /* Q_USNT - UPDATE_SUBNET */
3249 "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",
3258 /* Q_DSNT - DELETE_SUBNET */
3273 /* Q_GCLU - GET_CLUSTER */
3279 "name, description, location, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM clusters",
3282 "name LIKE '%s' ESCAPE '*' AND clu_id != 0",
3288 /* Q_ACLU - ADD_CLUSTER */ /* uses prefetch_value() for clu_id */
3294 "INTO clusters (name, description, location, clu_id) VALUES ('%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s)",
3303 /* Q_UCLU - UPDATE_CLUSTER */
3309 "clusters SET name = '%s', description = NVL('%s', CHR(0)), location = NVL('%s', CHR(0))",
3318 /* Q_DCLU - DELETE_CLUSTER */
3333 /* Q_GMCM - GET_MACHINE_TO_CLUSTER_MAP */
3334 "get_machine_to_cluster_map",
3339 "m.name, c.name FROM machine m, clusters c, mcmap mcm",
3342 "m.name LIKE '%s' ESCAPE '*' AND c.name LIKE '%s' ESCAPE '*' AND mcm.clu_id = c.clu_id AND mcm.mach_id = m.mach_id",
3348 /* Q_AMTC - ADD_MACHINE_TO_CLUSTER */
3349 "add_machine_to_cluster",
3354 "INTO mcmap (mach_id, clu_id) VALUES (%d, %d)",
3363 /* Q_DMFC - DELETE_MACHINE_FROM_CLUSTER */
3364 "delete_machine_from_cluster",
3372 "mach_id = %d AND clu_id = %d",
3378 /* Q_GCLD - GET_CLUSTER_DATA */
3384 "c.name, svc.serv_label, svc.serv_cluster FROM svc svc, clusters c",
3387 "c.clu_id = svc.clu_id AND c.name LIKE '%s' ESCAPE '*' AND svc.serv_label LIKE '%s' ESCAPE '*'",
3393 /* Q_ACLD - ADD_CLUSTER_DATA */
3399 "INTO svc (clu_id, serv_label, serv_cluster) VALUES (%d, '%s', '%s')",
3408 /* Q_DCLD - DELETE_CLUSTER_DATA */
3409 "delete_cluster_data",
3417 "clu_id = %d AND serv_label = '%s' AND serv_cluster = '%s'",
3423 /* Q_GLIN - GET_LIST_INFO */
3438 /* Q_EXLN - EXPAND_LIST_NAMES */
3439 "expand_list_names",
3447 "name LIKE '%s' ESCAPE '*' AND list_id != 0",
3453 /* Q_ALIS - ADD_LIST */ /* uses prefetch_value() for list_id */
3459 "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)",
3468 /* Q_ULIS - UPDATE_LIST */
3474 "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))",
3483 /* Q_DLIS - DELETE_LIST */
3498 /* Q_AMTL - ADD_MEMBER_TO_LIST */
3499 "add_member_to_list",
3513 /* Q_DMFL - DELETE_MEMBER_FROM_LIST */
3514 "delete_member_from_list",
3528 /* Q_GAUS - GET_ACE_USE */
3543 /* Q_QGLI - QUALIFIED_GET_LISTS */
3544 "qualified_get_lists",
3558 /* Q_GMOL - GET_MEMBERS_OF_LIST */
3559 "get_members_of_list",
3573 /* Q_GEML - GET_END_MEMBERS_OF_LIST */
3574 "get_end_members_of_list",
3588 /* Q_GLOM - GET_LISTS_OF_MEMBER */
3589 "get_lists_of_member",
3603 /* Q_CMOL - COUNT_MEMBERS_OF_LIST */
3604 "count_members_of_list",
3618 /* Q_GSIN - GET_SERVER_INFO */
3624 "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",
3627 "name LIKE '%s' ESCAPE '*'",
3633 /* Q_QGSV - QUALIFIED_GET_SERVER */
3634 "qualified_get_server",
3648 /* Q_ASIN - ADD_SERVER_INFO */
3654 "INTO servers (name, update_int, target_file, script, type, enable, acl_type, acl_id) VALUES (UPPER('%s'), %s, '%s', '%s', '%s', %s, '%s', %d)",
3663 /* Q_USIN - UPDATE_SERVER_INFO */
3664 "update_server_info",
3669 "servers SET update_int = %s, target_file = '%s', script = '%s', type = '%s', enable = %s, acl_type = '%s', acl_id = %d",
3672 "name = UPPER('%s')",
3678 /* Q_RSVE - RESET_SERVER_ERROR */
3679 "reset_server_error",
3684 "servers SET harderror = 0, dfcheck = dfgen",
3687 "name = UPPER('%s')",
3693 /* Q_SSIF - SET_SERVER_INTERNAL_FLAGS */
3694 "set_server_internal_flags",
3699 "servers SET dfgen = %s, dfcheck = %s, inprogress = %s, harderror = %s, errmsg = NVL('%s', CHR(0))",
3702 "name = UPPER('%s')",
3708 /* Q_DSIN - DELETE_SERVER_INFO */
3709 "delete_server_info",
3717 "name = UPPER('%s')",
3723 /* Q_GSHI - GET_SERVER_HOST_INFO */
3724 "get_server_host_info",
3729 "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",
3732 "sh.service LIKE '%s' ESCAPE '*' AND m.name LIKE '%s' ESCAPE '*' AND m.mach_id = sh.mach_id",
3738 /* Q_QGSH - QUALIFIED_GET_SERVER_HOST */
3739 "qualified_get_server_host",
3753 /* Q_ASHI - ADD_SERVER_HOST_INFO */
3754 "add_server_host_info",
3759 "INTO serverhosts (service, mach_id, enable, value1, value2, value3) VALUES (UPPER('%s'), %d, %s, %s, %s, NVL('%s', CHR(0)))",
3768 /* Q_USHI - UPDATE_SERVER_HOST_INFO */
3769 "update_server_host_info",
3774 "serverhosts SET enable = %s, value1 = %s, value2 = %s, value3 = NVL('%s', CHR(0))",
3777 "service = UPPER('%s') AND mach_id = %d",
3783 /* Q_RSHE - RESET_SERVER_HOST_ERROR */
3784 "reset_server_host_error",
3789 "serverhosts SET hosterror = 0",
3792 "service = UPPER('%s') AND mach_id = %d",
3798 /* Q_SSHO - SET_SERVER_HOST_OVERRIDE */
3799 "set_server_host_override",
3804 "serverhosts SET override = 1",
3807 "service = UPPER('%s') AND mach_id = %d",
3813 /* Q_SSHI - SET_SERVER_HOST_INTERNAL */
3814 "set_server_host_internal",
3819 "serverhosts SET override = %s, success = %s, inprogress = %s, hosterror = %s, hosterrmsg = NVL('%s', CHR(0)), ltt = %s, lts = %s",
3822 "service = UPPER('%s') AND mach_id = %d",
3828 /* Q_DSHI - DELETE_SERVER_HOST_INFO */
3829 "delete_server_host_info",
3837 "service = UPPER('%s') AND mach_id = %d",
3843 /* Q_GSLO - GET_SERVER_LOCATIONS */
3844 "get_server_locations",
3849 "sh.service, m.name FROM serverhosts sh, machine m",
3852 "sh.service LIKE '%s' ESCAPE '*' AND sh.mach_id = m.mach_id",
3858 /* Q_GFSL - GET_FILESYS_BY_LABEL */
3859 "get_filesys_by_label",
3864 "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",
3867 "fs.label LIKE '%s' ESCAPE '*' AND fs.mach_id = m.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id",
3873 /* Q_GFSM - GET_FILESYS_BY_MACHINE */
3874 "get_filesys_by_machine",
3879 "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",
3882 "fs.mach_id = %d AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id",
3888 /* Q_GFSN - GET_FILESYS_BY_NFSPHYS */
3889 "get_filesys_by_nfsphys",
3894 "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",
3897 "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' ESCAPE '*' AND fs.type = 'NFS'",
3903 /* Q_GFSG - GET_FILESYS_BY_GROUP */
3904 "get_filesys_by_group",
3909 "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",
3912 "fs.owners = %d AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id",
3918 /* Q_GFSP - GET_FILESYS_BY_PATH */
3919 "get_filesys_by_path",
3924 "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",
3927 "fs.name LIKE '%s' ESCAPE '*' AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = list_id",
3933 /* Q_AFIL - ADD_FILESYS */ /* uses prefetch_value() for filsys_id */
3939 "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)",
3948 /* Q_UFIL - UPDATE_FILESYS */
3954 "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'",
3963 /* Q_DFIL - DELETE_FILESYS */
3978 /* Q_GFGM - GET_FSGROUP_MEMBERS */
3979 "get_fsgroup_members",
3984 "fs.label, fg.key FROM fsgroup fg, filesys fs",
3987 "fg.group_id = %d AND fs.filsys_id = fg.filsys_id",
3993 /* Q_AFTG - ADD_FILESYS_TO_FSGROUP */
3994 "add_filesys_to_fsgroup",
3999 "INTO fsgroup (group_id, filsys_id, key) VALUES (%d, %d, '%s')",
4008 /* Q_RFFG - REMOVE_FILESYS_FROM_FSGROUP */
4009 "remove_filesys_from_fsgroup",
4017 "group_id = %d AND filsys_id = %d",
4023 /* Q_GANF - GET_ALL_NFSPHYS */
4029 "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",
4032 "m.mach_id = np.mach_id",
4038 /* Q_GNFP - GET_NFSPHYS */
4044 "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",
4047 "np.mach_id = %d AND np.dir LIKE '%s' ESCAPE '*' AND m.mach_id = np.mach_id",
4053 /* Q_ANFP - ADD_NFSPHYS */ /* uses prefetch_value() for nfsphys_id */
4059 "INTO nfsphys (mach_id, dir, device, status, allocated, partsize, nfsphys_id) VALUES (%d, '%s', NVL('%s', CHR(0)), %s, %s, %s, %s)",
4068 /* Q_UNFP - UPDATE_NFSPHYS */
4074 "nfsphys SET device = NVL('%s', CHR(0)), status = %s, allocated = %s, partsize = %s",
4077 "mach_id = %d AND dir = '%s'",
4083 /* Q_AJNF - ADJUST_NFSPHYS_ALLOCATION */
4084 "adjust_nfsphys_allocation",
4089 "nfsphys SET allocated = allocated + %s",
4092 "mach_id = %d AND dir = '%s'",
4098 /* Q_DNFP - DELETE_NFSPHYS */
4107 "mach_id = %d AND dir = '%s'",
4113 /* Q_GQOT - GET_QUOTA */
4119 "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",
4122 "fs.label LIKE '%s' ESCAPE '*' AND q.type = '%s' AND q.entity_id = %d AND fs.filsys_id = q.filsys_id AND m.mach_id = fs.mach_id",
4128 /* Q_GQBF - GET_QUOTA_BY_FILESYS */
4129 "get_quota_by_filesys",
4134 "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",
4137 "fs.label LIKE '%s' ESCAPE '*' AND fs.filsys_id = q.filsys_id AND m.mach_id = fs.mach_id",
4143 /* Q_AQOT - ADD_QUOTA */ /* prefetch_filsys() gets last 1 value */
4149 "INTO quota (filsys_id, type, entity_id, quota, phys_id) VALUES ('%s', %d, %d, %s, %s)",
4158 /* Q_UQOT - UPDATE_QUOTA */
4164 "quota SET quota = %s",
4173 /* Q_DQOT - DELETE_QUOTA */
4188 /* Q_GNFQ - GET_NFS_QUOTAS */
4194 "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",
4197 "fs.label LIKE '%s' ESCAPE '*' 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'",
4203 /* Q_GNQP - GET_NFS_QUOTAS_BY_PARTITION */
4204 "get_nfs_quotas_by_partition",
4209 "fs.label, u.login, q.quota, np.dir, m.name FROM quota q, filesys fs, users u, nfsphys np, machine m",
4212 "np.mach_id = %d AND np.dir LIKE '%s' ESCAPE '*' 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",
4218 /* Q_ANFQ - ADD_NFS_QUOTA */ /* prefetch_filsys() gets last 1 value */
4224 "INTO quota (type, filsys_id, entity_id, quota, phys_id ) VALUES ('USER', %d, %d, %s, %s)",
4233 /* Q_UNFQ - UPDATE_NFS_QUOTA */
4239 "quota SET quota = %s",
4248 /* Q_DNFQ - DELETE_NFS_QUOTA */
4263 /* Q_GZCL - GET_ZEPHYR_CLASS */
4269 "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",
4272 "class LIKE '%s' ESCAPE '*'",
4278 /* Q_AZCL - ADD_ZEPHYR_CLASS */
4284 "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)",
4293 /* Q_UZCL - UPDATE_ZEPHYR_CLASS */
4294 "update_zephyr_class",
4299 "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",
4308 /* Q_DZCL - DELETE_ZEPHYR_CLASS */
4309 "delete_zephyr_class",
4323 /* Q_GSHA - GET_SERVER_HOST_ACCESS */
4324 "get_server_host_access",
4329 "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",
4332 "m.name LIKE '%s' ESCAPE '*' AND ha.mach_id = m.mach_id",
4338 /* Q_ASHA - ADD_SERVER_HOST_ACCESS */
4339 "add_server_host_access",
4344 "INTO hostaccess (mach_id, acl_type, acl_id) VALUES (%d, '%s', %d)",
4353 /* Q_USHA - UPDATE_SERVER_HOST_ACCESS */
4354 "update_server_host_access",
4359 "hostaccess SET acl_type = '%s', acl_id = %d",
4368 /* Q_DSHA - DELETE_SERVER_HOST_ACCESS */
4369 "delete_server_host_access",
4383 /* Q_GSVC - GET_SERVICE */
4389 "name, protocol, port, description, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM services",
4392 "name LIKE '%s' ESCAPE '*'",
4398 /* Q_ASVC - ADD_SERVICE */
4404 "INTO services (name, protocol, port, description) VALUES ('%s', '%s', %s, NVL('%s', CHR(0)))",
4413 /* Q_DSVC - DELETE_SERVICE */
4428 /* Q_GPCE - GET_PRINTCAP_ENTRY */
4429 "get_printcap_entry",
4434 "pc.name, m.name, pc.dir, pc.rp, pc.quotaserver, pc.auth, pc.price, pc.comments, TO_CHAR(pc.modtime, 'DD-mon-YYYY HH24:MI:SS'), pc.modby, pc.modwith FROM printcap pc, machine m",
4437 "pc.name LIKE '%s' ESCAPE '*' AND m.mach_id = pc.mach_id",
4443 /* Q_APCE - ADD_PRINTCAP_ENTRY */
4444 "add_printcap_entry",
4449 "INTO printcap (name, mach_id, dir, rp, quotaserver, auth, price, comments) VALUES ('%s', %d, '%s', '%s', %d, %s, %s, NVL('%s', CHR(0)))",
4458 /* Q_DPCE - DELETE_PRINTCAP_ENTRY */
4459 "delete_printcap_entry",
4473 /* Q_GPCP - GET_PRINTCAP */
4479 "pc.name, m.name, pc.dir, pc.rp, pc.comments, TO_CHAR(pc.modtime, 'DD-mon-YYYY HH24:MI:SS'), pc.modby, pc.modwith FROM printcap pc, machine m",
4482 "pc.name LIKE '%s' ESCAPE '*' AND m.mach_id = pc.mach_id",
4488 /* Q_DPCP - DELETE_PRINTCAP */
4503 /* Q_GPDM - GET_PALLADIUM */
4509 "pal.name, pal.identifier, m.name, TO_CHAR(pal.modtime, 'DD-mon-YYYY HH24:MI:SS'), pal.modby, pal.modwith FROM palladium pal, machine m",
4512 "pal.name LIKE '%s' ESCAPE '*' AND m.mach_id = pal.mach_id",
4518 /* Q_APDM - ADD_PALLADIUM */
4524 "INTO palladium (name, identifier, mach_id) VALUES ('%s', %s, %d)",
4533 /* Q_DPDM - DELETE_PALLADIUM */
4548 /* Q_GALI - GET_ALIAS */
4554 "name, type, trans FROM alias",
4557 "name LIKE '%s' ESCAPE '*' AND type LIKE '%s' ESCAPE '*' AND trans LIKE '%s' ESCAPE '*'",
4563 /* Q_AALI - ADD_ALIAS */
4569 "INTO alias (name, type, trans) VALUES ('%s', '%s', '%s')",
4578 /* Q_DALI - DELETE_ALIAS */
4587 "name = '%s' AND type = '%s' AND trans = '%s'",
4593 /* Q_GVAL - GET_VALUE */
4599 "value FROM numvalues",
4608 /* Q_AVAL - ADD_VALUE */
4614 "INTO numvalues (name, value) VALUES ('%s', %s)",
4623 /* Q_UVAL - UPDATE_VALUE */
4629 "numvalues SET value = %s",
4638 /* Q_DVAL - DELETE_VALUE */
4653 /* Q_GATS - GET_ALL_TABLE_STATS */
4654 "get_all_table_stats",
4659 "table_name, appends, updates, deletes, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS') FROM tblstats",
4668 /* Q__SDL - _SET_DEBUG_LEVEL */
4684 int QueryCount2 = (sizeof(Queries2) / sizeof(struct query));