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 VOwild0[] = {
33 static struct valobj VOupwild0[] = {
37 static struct valobj VOwild01[] = {
42 static struct valobj VOwild012[] = {
49 static struct valobj VOuser0[] = {
50 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
54 static struct valobj VOuser0lock[] = {
55 {V_LOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
56 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
59 static struct valobj VOmach0[] = {
60 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
63 static struct valobj VOclu0[] = {
64 {V_ID, 0, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
67 static struct valobj VOlist0[] = {
68 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
72 static struct valobj VOchar0[] = {
78 static struct valobj VOfilsys0user1[] = {
79 {V_LOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
80 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
81 {V_ID, 1, USERS_TABLE, "login", "users_id", MR_USER},
86 * Commonly used validation records defined here so that they may
90 static struct validate VDmach = { VOmach0, 1 };
91 static struct validate VDwild0= { VOwild0, 1 };
92 static struct validate VDupwild0= { VOupwild0, 1 };
93 static struct validate VDwild2 = { VOwild01, 2 };
94 static struct validate VDwild3 = { VOwild012, 3 };
95 static struct validate VDfix_modby = {
107 static struct validate VDwild_fix_modby = {
119 static struct validate VDupwild_fix_modby = {
132 static char *galo_fields[] = {
133 "login", "unix_uid", "shell", "last", "first", "middle",
136 static char *gual_fields[] = {
138 "login", "unix_uid", "shell", "last", "first", "middle", "status",
139 "clearid", "class", "comments", "signature", "secure", "modby", "modby", "modwith",
142 static char *gubl_fields[] = {
144 "login", "unix_uid", "shell", "last", "first", "middle", "status",
145 "clearid", "class", "modby", "modby", "modwith",
148 static struct validate gubl_validate =
161 static char *guau_fields[] = {
163 "login", "unix_uid", "shell", "last", "first", "middle", "status",
164 "clearid", "class", "comments", "signature", "secure", "modby", "modby", "modwith",
167 static char *guan_fields[] = {
169 "login", "unix_uid", "shell", "last", "first", "middle", "status",
170 "clearid", "class", "comments", "signature", "secure", "modby", "modby", "modwith",
173 static struct validate guan_validate =
186 static char *guac_fields[] = {
188 "login", "unix_uid", "shell", "last", "first", "middle", "status",
189 "clearid", "class", "comments", "signature", "secure", "modby", "modby", "modwith",
192 static char *guam_fields[] = {
194 "login", "unix_uid", "shell", "last", "first", "middle", "status",
195 "clearid", "class", "comments", "signature", "secure", "modby", "modby", "modwith",
198 static char *gubu_fields[] = {
200 "login", "unix_uid", "shell", "last", "first", "middle", "status",
201 "clearid", "class", "modby", "modby", "modwith",
204 static struct validate gubu_validate =
217 static char *gubn_fields[] = {
219 "login", "unix_uid", "shell", "last", "first", "middle", "status",
220 "clearid", "class", "modby", "modby", "modwith",
223 static struct validate gubn_validate =
236 static char *gubc_fields[] = {
238 "login", "unix_uid", "shell", "last", "first", "middle", "status",
239 "clearid", "class", "modby", "modby", "modwith",
242 static char *gubm_fields[] = {
244 "login", "unix_uid", "shell", "last", "first", "middle", "status",
245 "clearid", "class", "modby", "modby", "modwith",
248 static char *gudf_fields[] = {
250 "dirsuppress", "dirremote"
253 static struct validate gudf_validate =
266 static char *auac_fields[] = {
267 "login", "unix_uid", "shell", "last", "first", "middle", "status",
268 "clearid", "class", "comments", "signature", "secure",
271 static struct valobj auac_valobj[] = {
272 {V_LOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
273 {V_CHAR, 0, USERS_TABLE, "login"},
274 {V_CHAR, 2, USERS_TABLE, "shell"},
275 {V_CHAR, 3, USERS_TABLE, "last"},
276 {V_CHAR, 4, USERS_TABLE, "first"},
277 {V_CHAR, 5, USERS_TABLE, "middle"},
278 {V_CHAR, 7, USERS_TABLE, "clearid"},
279 {V_TYPE, 8, 0, "class", 0, MR_BAD_CLASS},
280 {V_ID, 9, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
283 static struct validate auac_validate = {
295 static struct validate ausr_validate = {
307 static char *rusr_fields[] = {
308 "unix_uid", "login", "fs_type"
311 static struct valobj rusr_valobj[] = {
312 {V_LOCK, 0, IMEMBERS_TABLE, 0, "list_id", MR_DEADLOCK},
313 {V_LOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
314 {V_LOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
315 {V_RLOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
316 {V_LOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
317 {V_LOCK, 0, NFSPHYS_TABLE, 0, "nfsphys_id", MR_DEADLOCK},
318 {V_LOCK, 0, QUOTA_TABLE, 0, "filsys_id", MR_DEADLOCK},
319 {V_RLOCK, 0, SERVERHOSTS_TABLE, 0, "mach_id", MR_DEADLOCK},
322 static struct validate rusr_validate = {
334 static char *uuac_fields[] = {
336 "newlogin", "unix_uid", "shell", "last", "first", "middle", "status",
337 "clearid", "class", "comments", "signature", "secure",
340 static struct valobj uuac_valobj[] = {
341 {V_LOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
342 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
343 {V_RENAME, 1, USERS_TABLE, "login", "users_id", MR_NOT_UNIQUE},
344 {V_CHAR, 3, USERS_TABLE, "shell"},
345 {V_CHAR, 4, USERS_TABLE, "first"},
346 {V_CHAR, 5, USERS_TABLE, "last"},
347 {V_CHAR, 6, USERS_TABLE, "middle"},
348 {V_CHAR, 8, USERS_TABLE, "clearid"},
349 {V_TYPE, 9, 0, "class", 0, MR_BAD_CLASS},
350 {V_ID, 10, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
353 static struct validate uuac_validate = {
365 static struct validate uusr_validate = {
377 static char *uush_fields[] = {
382 static struct valobj uush_valobj[] = {
383 {V_LOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
384 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
385 {V_CHAR, 1, USERS_TABLE, "shell"},
388 static struct validate uush_validate = {
400 static char *uust_fields[] = {
405 static char *uuss_fields[] = {
410 static struct validate uust_validate = {
422 static char *uudf_fields[] = {
424 "dirsuppress", "dirremote"
427 static struct validate uudf_validate = {
439 static char *dusr_fields[] = {
443 struct valobj dusr_valobj[]= {
444 {V_LOCK, 0, IMEMBERS_TABLE, 0, "list_id", MR_DEADLOCK},
445 {V_LOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
446 {V_LOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
447 {V_LOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
448 {V_LOCK, 0, QUOTA_TABLE, 0, "filsys_id", MR_DEADLOCK},
449 {V_LOCK, 0, HOSTACCESS_TABLE, 0, "mach_id", MR_DEADLOCK},
450 {V_LOCK, 0, KRBMAP_TABLE, 0, "users_id", MR_DEADLOCK},
451 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
454 static struct validate dusr_validate = {
466 static char *dubu_fields[] = {
470 static struct valobj dubu_valobj[] = {
471 {V_LOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
472 {V_ID, 0, USERS_TABLE, "unix_uid", "users_id", MR_USER}
475 static struct validate dubu_validate = {
487 static char *gkum_fields[] = { "login", "kerberos",
488 "login", "kerberos" };
490 static char *akum_fields[] = { "login", "kerberos" };
492 static struct valobj akum_valobj[] =
494 {V_LOCK, 0, KRBMAP_TABLE, 0, "users_id", MR_DEADLOCK},
495 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
496 {V_ID, 1, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
499 static struct validate akum_validate =
504 "users_id = %d or string_id = %d",
512 static struct validate dkum_validate =
517 "users_id = %d and string_id = %d",
525 static char *gfbl_fields[] = {
527 "login", "fullname", "nickname", "home_addr",
528 "home_phone", "office_addr", "office_phone", "department",
529 "affiliation", "modby", "modby", "modwith",
532 static struct validate gfbl_validate = {
544 static char *ufbl_fields[] = {
546 "fullname", "nickname", "home_addr",
547 "home_phone", "office_addr", "office_phone", "department",
551 static struct valobj ufbl_valobj[] = {
552 {V_LOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
553 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
554 {V_LEN, 1, USERS_TABLE, "fullname"},
555 {V_LEN, 2, USERS_TABLE, "nickname"},
556 {V_LEN, 3, USERS_TABLE, "home_addr"},
557 {V_LEN, 4, USERS_TABLE, "home_phone"},
558 {V_LEN, 5, USERS_TABLE, "office_addr"},
559 {V_LEN, 6, USERS_TABLE, "office_phone"},
560 {V_LEN, 7, USERS_TABLE, "department"},
561 {V_LEN, 8, USERS_TABLE, "affiliation"},
564 static struct validate ufbl_validate = {
576 static char *gpob_fields[] = {
578 "login", "type", "box", "modby", "modby", "modwith",
581 static struct validate gpob_validate = {
585 "potype != 'NONE' and users_id = %d",
593 static char *gpox_fields[] = {
594 "login", "type", "box",
597 struct valobj gpox_valobj[] = {
598 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
599 {V_RLOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK}
602 static struct validate gpox_validate = {
614 static char *spob_fields[] = {
615 "login", "type", "box",
618 static struct valobj spob_valobj[] = {
619 {V_LOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
620 {V_RLOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
621 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
622 {V_TYPE, 1, 0, "pobox", 0, MR_TYPE},
625 static struct validate spob_validate = /* SET_POBOX */
638 struct valobj spop_valobj[] = {
639 {V_LOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
640 {V_RLOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
641 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
644 static struct validate spop_validate = /* SET_POBOX_POP */
657 static struct validate dpob_validate = /* DELETE_POBOX */
670 static char *gmac_fields[] = {
672 "name", "type", "modby", "modby", "modwith",
675 static char *ghst_fields[] = {
676 "name", "address", "location", "network",
677 "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",
680 static struct valobj ghst_valobj[] = {
687 static struct validate ghst_validate = {
699 static char *ahst_fields[] = {
700 "name", "vendor", "model", "os", "location", "contact", "use", "status", "subnet", "address", "ace_type", "ace_name", "admin_comment", "ops_comment",
703 static struct valobj ahst_valobj[] = {
704 {V_CHAR, 0, MACHINE_TABLE, "name"},
705 {V_CHAR, 1, MACHINE_TABLE, "vendor"},
706 {V_CHAR, 2, MACHINE_TABLE, "model"},
707 {V_CHAR, 3, MACHINE_TABLE, "os"},
708 {V_CHAR, 4, MACHINE_TABLE, "location"},
709 {V_CHAR, 5, MACHINE_TABLE, "contact"},
710 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
711 {V_LOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
712 {V_RLOCK, 0, SUBNET_TABLE, 0, "snet_id", MR_DEADLOCK},
713 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
714 {V_RLOCK, 0, HOSTALIAS_TABLE, 0, "mach_id", MR_DEADLOCK},
715 {V_ID, 8, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
716 {V_TYPE, 10, 0, "ace_type", 0, MR_ACE},
717 {V_TYPEDATA, 11, 0, 0, 0, MR_ACE},
718 {V_ID, 12, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
719 {V_ID, 13, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
722 static struct validate ahst_validate = {
726 "name = UPPER('%s')",
731 set_uppercase_modtime,
734 static char *uhst_fields[] = {
736 "newname", "vendor", "model", "os", "location", "contact", "use", "status", "subnet", "address", "ace_type", "ace_name", "admin_comment", "ops_comment",
739 static struct valobj uhst_valobj[] = {
740 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
741 {V_LOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
742 {V_RLOCK, 0, SUBNET_TABLE, 0, "snet_id", MR_DEADLOCK},
743 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
744 {V_CHAR, 0, MACHINE_TABLE, "name"},
745 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
746 {V_RENAME, 1, MACHINE_TABLE, "name", "mach_id", MR_NOT_UNIQUE},
747 {V_CHAR, 2, MACHINE_TABLE, "vendor"},
748 {V_CHAR, 3, MACHINE_TABLE, "model"},
749 {V_CHAR, 4, MACHINE_TABLE, "os"},
750 {V_CHAR, 5, MACHINE_TABLE, "location"},
751 {V_ID, 9, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
752 {V_TYPE, 11, 0, "ace_type", 0, MR_ACE},
753 {V_TYPEDATA, 12, 0, 0, 0, MR_ACE},
754 {V_ID, 13, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
755 {V_ID, 14, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
758 static struct validate uhst_validate = {
770 static char *dhst_fields[] = {
774 static struct valobj dhst_valobj[] = {
775 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
776 {V_LOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
777 {V_RLOCK, 0, NFSPHYS_TABLE, 0, "nfsphys_id", MR_DEADLOCK},
778 {V_RLOCK, 0, SERVERHOSTS_TABLE, 0, "mach_id", MR_DEADLOCK},
779 {V_RLOCK, 0, HOSTACCESS_TABLE, 0, "mach_id", MR_DEADLOCK},
780 {V_RLOCK, 0, HOSTALIAS_TABLE, 0, "mach_id", MR_DEADLOCK},
781 {V_LOCK, 0, MCMAP_TABLE, 0, "mach_id", MR_DEADLOCK},
782 {V_RLOCK, 0, PRINTCAP_TABLE, 0, "mach_id", MR_DEADLOCK},
783 {V_RLOCK, 0, PALLADIUM_TABLE, 0, "mach_id", MR_DEADLOCK},
784 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
787 static struct validate dhst_validate = {
799 static char *ghal_fields[] = {
800 "alias", "canonical_hostname",
801 "alias", "canonical_hostname"
804 static struct valobj ghal_valobj[] = {
809 static struct validate ghal_validate = {
821 static struct valobj ahal_valobj[] = {
822 {V_CHAR, 0, HOSTALIAS_TABLE, "name"},
824 {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
827 static struct validate ahal_validate = {
839 static struct valobj dhal_valobj[] = {
841 {V_LOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
842 {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
845 static struct validate dhal_validate = {
849 "name = '%s' AND mach_id = %d",
857 static char *gsnt_fields[] = {
859 "name", "description", "address", "mask", "low", "high", "prefix", "ace_type", "ace_name",
860 "modby", "modby", "modwith"
863 static struct valobj gsnt_valobj[] = {
864 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
865 {V_RLOCK, 0, SUBNET_TABLE, 0, "snet_id", MR_DEADLOCK},
866 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
870 static struct validate gsnt_validate = {
882 static char *asnt_fields[] = {
883 "name", "description", "address", "mask", "low", "high", "prefix", "ace_type", "ace_name",
886 static struct valobj asnt_valobj[] = {
887 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
888 {V_LOCK, 0, SUBNET_TABLE, 0, "snet_id", MR_DEADLOCK},
889 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
890 {V_CHAR, 0, SUBNET_TABLE, "name"},
891 {V_LEN, 1, SUBNET_TABLE, "description"},
892 {V_LEN, 6, SUBNET_TABLE, "prefix"},
893 {V_TYPE, 7, 0, "ace_type", 0, MR_ACE},
894 {V_TYPEDATA, 8, 0, 0, 0, MR_ACE},
897 static struct validate asnt_validate =
902 "name = UPPER('%s')",
907 set_uppercase_modtime,
910 static char *usnt_fields[] = {
912 "newname", "description", "address", "mask", "low", "high", "prefix", "ace_type", "ace_name",
915 static struct valobj usnt_valobj[] = {
916 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
917 {V_LOCK, 0, SUBNET_TABLE, 0, "snet_id", MR_DEADLOCK},
918 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
919 {V_ID, 0, SUBNET_TABLE, "name", "snet_id", MR_NO_MATCH},
920 {V_RENAME, 1, SUBNET_TABLE, "name", "snet_id", MR_NOT_UNIQUE},
921 {V_LEN, 2, SUBNET_TABLE, "description"},
922 {V_LEN, 7, SUBNET_TABLE, "prefix"},
923 {V_TYPE, 8, 0, "ace_type", 0, MR_ACE},
924 {V_TYPEDATA, 9, 0, 0, 0, MR_ACE},
927 static struct validate usnt_validate =
940 static char *dsnt_fields[] = {
944 static struct valobj dsnt_valobj[] = {
945 {V_RLOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
946 {V_LOCK, 0, SUBNET_TABLE, 0, "snet_id", MR_DEADLOCK},
947 {V_ID, 0, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
950 static struct validate dsnt_validate = {
962 static char *gclu_fields[] = {
964 "name", "description", "location", "modby", "modby", "modwith",
967 static char *aclu_fields[] = {
968 "name", "description", "location",
971 static struct valobj aclu_valobj[] = {
972 {V_LOCK, 0, CLUSTERS_TABLE, 0, "clu_id", MR_DEADLOCK},
973 {V_CHAR, 0, CLUSTERS_TABLE, "name"},
974 {V_LEN, 1, CLUSTERS_TABLE, "description"},
975 {V_LEN, 2, CLUSTERS_TABLE, "location"},
978 static struct validate aclu_validate =
991 static char *uclu_fields[] = {
993 "newname", "description", "location",
996 static struct valobj uclu_valobj[] = {
997 {V_LOCK, 0, CLUSTERS_TABLE, 0, "clu_id", MR_DEADLOCK},
998 {V_ID, 0, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
999 {V_RENAME, 1, CLUSTERS_TABLE, "name", "clu_id", MR_NOT_UNIQUE},
1000 {V_LEN, 2, CLUSTERS_TABLE, "description"},
1001 {V_LEN, 3, CLUSTERS_TABLE, "location"},
1004 static struct validate uclu_validate = {
1016 static char *dclu_fields[] = {
1020 static struct validate dclu_validate = {
1032 static char *gmcm_fields[] = {
1033 "machine", "cluster",
1034 "machine", "cluster",
1037 static struct valobj gmcm_valobj[] =
1043 static struct validate gmcm_validate = { gmcm_valobj, 2 };
1045 static struct valobj amtc_valobj[] = /* ADD_MACHINE_TO_CLUSTER */
1046 { /* DELETE_MACHINE_FROM_CLUSTER */
1047 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1048 {V_ID, 1, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
1051 static struct validate amtc_validate = /* for amtc and dmfc */
1056 "mach_id = %d and clu_id = %d",
1061 set_mach_modtime_by_id,
1064 static char *gcld_fields[] = {
1065 "cluster", "serv_label",
1066 "cluster", "serv_label", "serv_cluster",
1069 static char *acld_fields[] = {
1070 "cluster", "serv_label", "serv_cluster",
1073 static struct valobj acld_valobj[] =
1075 {V_ID, 0, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
1076 {V_CHAR, 1, SVC_TABLE, "serv_label"},
1077 {V_CHAR, 2, SVC_TABLE, "serv_cluster"}
1080 static struct validate acld_validate =
1085 "clu_id = %d AND serv_label = '%s' AND serv_cluster = '%s'",
1090 set_cluster_modtime_by_id,
1093 static struct valobj dcld_valobj[] =
1095 {V_ID, 0, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
1098 static struct validate dcld_validate =
1103 "clu_id = %d AND serv_label = '%s' AND serv_cluster = '%s'",
1108 set_cluster_modtime_by_id,
1111 static char *glin_fields[] = {
1113 "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
1114 "ace_type", "ace_name", "description", "modby", "modby", "modwith",
1117 static struct validate glin_validate = {
1124 access_vis_list_by_name,
1129 static char *alis_fields[] = {
1130 "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
1131 "ace_type", "ace_name", "description",
1134 static struct valobj alis_valobj[] = {
1135 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1136 {V_LOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1137 {V_CHAR, 0, LIST_TABLE, "name"},
1138 {V_TYPE, 7, 0, "ace_type", 0, MR_ACE},
1139 {V_TYPEDATA, 8, 0, 0, "list_id", MR_ACE},
1140 {V_LEN, 9, LIST_TABLE, "description"},
1143 static struct validate alis_validate = {
1155 static char *ulis_fields[] = {
1157 "newname", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
1158 "ace_type", "ace_name", "description",
1161 static struct valobj ulis_valobj[] = {
1162 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1163 {V_LOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1164 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
1165 {V_RENAME, 1, LIST_TABLE, "name", "list_id", MR_NOT_UNIQUE},
1166 {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
1167 {V_CHAR, 1, LIST_TABLE, "name"},
1168 {V_LEN, 10, LIST_TABLE, "description"},
1171 static struct validate ulis_validate = {
1183 static char *dlis_fields[] = {
1187 static struct valobj dlis_valobj[] = {
1188 {V_RLOCK, 0, CAPACLS_TABLE, 0, "list_id", MR_DEADLOCK},
1189 {V_RLOCK, 0, IMEMBERS_TABLE, 0, "list_id", MR_DEADLOCK},
1190 {V_RLOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1191 {V_LOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1192 {V_RLOCK, 0, QUOTA_TABLE, 0, "filsys_id", MR_DEADLOCK},
1193 {V_RLOCK, 0, ZEPHYR_TABLE, 0, "xmt_id", MR_DEADLOCK},
1194 {V_RLOCK, 0, HOSTACCESS_TABLE, 0, "mach_id", MR_DEADLOCK},
1195 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST}
1198 static struct validate dlis_validate = {
1210 static char *amtl_fields[] = {
1211 "list_name", "member_type", "member_name",
1214 static struct valobj amtl_valobj[] = {
1215 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1216 {V_LOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1217 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
1218 {V_TYPE, 1, 0, "member", 0, MR_TYPE},
1219 {V_TYPEDATA, 2, 0, 0, 0, MR_NO_MATCH},
1222 static struct validate amtl_validate =
1235 static struct validate dmfl_validate =
1245 delete_member_from_list,
1248 static char *gaus_fields[] = {
1249 "ace_type", "ace_name",
1250 "use_type", "use_name",
1253 static struct valobj gaus_valobj[] = {
1254 {V_RLOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1255 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1256 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1257 {V_RLOCK, 0, ZEPHYR_TABLE, 0, "xmt_id", MR_DEADLOCK},
1258 {V_RLOCK, 0, HOSTACCESS_TABLE, 0, "mach_id", MR_DEADLOCK},
1259 {V_TYPE, 0, 0, "gaus", 0, MR_TYPE},
1260 {V_TYPEDATA, 1, 0, 0, 0, MR_NO_MATCH},
1263 static struct validate gaus_validate = {
1275 static char *qgli_fields[] = {
1276 "active", "publicflg", "hidden", "maillist", "grouplist",
1280 static struct valobj qgli_valobj[] = {
1281 {V_TYPE, 0, 0, "boolean", 0, MR_TYPE},
1282 {V_TYPE, 1, 0, "boolean", 0, MR_TYPE},
1283 {V_TYPE, 2, 0, "boolean", 0, MR_TYPE},
1284 {V_TYPE, 3, 0, "boolean", 0, MR_TYPE},
1285 {V_TYPE, 4, 0, "boolean", 0, MR_TYPE},
1288 static struct validate qgli_validate = {
1297 qualified_get_lists,
1300 static char *gmol_fields[] = {
1302 "member_type", "member_name",
1305 static struct valobj gmol_valobj[] = {
1306 {V_LOCK, 0, IMEMBERS_TABLE, 0, "list_id", MR_DEADLOCK},
1307 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1308 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
1311 static struct validate gmol_validate = {
1318 access_visible_list,
1320 get_members_of_list,
1323 static struct validate geml_validate = {
1330 access_visible_list,
1332 get_end_members_of_list,
1335 static char *glom_fields[] = {
1336 "member_type", "member_name",
1337 "list_name", "active", "publicflg", "hidden", "maillist", "grouplist",
1340 static struct valobj glom_valobj[] = {
1341 {V_LOCK, 0, IMEMBERS_TABLE, 0, "list_id", MR_DEADLOCK},
1342 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1343 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1344 {V_TYPE, 0, 0, "rmember", 0, MR_TYPE},
1345 {V_TYPEDATA, 1, 0, 0, 0, MR_NO_MATCH},
1348 static struct validate glom_validate = {
1357 get_lists_of_member,
1360 static char *cmol_fields[] = {
1365 static struct validate cmol_validate = {
1372 access_visible_list,
1374 count_members_of_list,
1377 static char *gsin_fields[] = {
1379 "service", "update_int", "target_file", "script", "dfgen", "dfcheck",
1380 "type", "enable", "inprogress", "harderror", "errmsg",
1381 "ace_type", "ace_name", "modby", "modby", "modwith",
1384 static struct valobj gsin_valobj[] =
1386 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1387 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1391 static struct validate gsin_validate =
1404 static char *qgsv_fields[] = {
1405 "enable", "inprogress", "harderror",
1409 static struct valobj qgsv_valobj[] = {
1410 {V_TYPE, 0, 0, "boolean", 0, MR_TYPE},
1411 {V_TYPE, 1, 0, "boolean", 0, MR_TYPE},
1412 {V_TYPE, 2, 0, "boolean", 0, MR_TYPE},
1415 static struct validate qgsv_validate = {
1424 qualified_get_server,
1427 static char *asin_fields[] = {
1428 "service", "update_int", "target_file", "script", "type", "enable",
1429 "ace_type", "ace_name",
1432 static struct valobj asin_valobj[] = {
1433 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1434 {V_LOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
1435 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1436 {V_CHAR, 0, SERVERS_TABLE, "name"},
1437 {V_LEN, 2, SERVERS_TABLE, "target_file"},
1438 {V_LEN, 3, SERVERS_TABLE, "script"},
1439 {V_TYPE, 4, 0, "service", 0, MR_TYPE},
1440 {V_TYPE, 6, 0, "ace_type", 0, MR_ACE},
1441 {V_TYPEDATA, 7, 0, 0, 0, MR_ACE},
1444 static struct validate asin_validate = /* for asin, usin */
1449 "name = UPPER('%s')",
1454 set_uppercase_modtime,
1457 static struct validate rsve_validate = {
1461 "name = UPPER('%s')",
1466 set_uppercase_modtime,
1469 static char *ssif_fields[] = {
1470 "service", "dfgen", "dfcheck", "inprogress", "harderror", "errmsg",
1473 static struct valobj ssif_valobj[] = {
1474 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1475 {V_LOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
1476 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1477 {V_LEN, 5, SERVERS_TABLE, "errmsg"},
1480 static struct validate ssif_validate = {
1484 "name = UPPER('%s')",
1492 static char *dsin_fields[] = {
1496 static struct validate dsin_validate = {
1500 "name = UPPER('%s')",
1508 static char *gshi_fields[] = {
1509 "service", "machine",
1510 "service", "machine", "enable", "override", "success", "inprogress",
1511 "hosterror", "hosterrormsg", "ltt", "lts", "value1", "value2",
1512 "value3", "modby", "modby", "modwith",
1515 static struct valobj gshi_valobj[] = {
1520 static struct validate gshi_validate = {
1532 static char *qgsh_fields[] = {
1533 "service", "enable", "override", "success", "inprogress", "hosterror",
1534 "service", "machine",
1537 static struct valobj qgsh_valobj[] = {
1538 {V_TYPE, 1, 0, "boolean", 0, MR_TYPE},
1539 {V_TYPE, 2, 0, "boolean", 0, MR_TYPE},
1540 {V_TYPE, 3, 0, "boolean", 0, MR_TYPE},
1541 {V_TYPE, 4, 0, "boolean", 0, MR_TYPE},
1542 {V_TYPE, 5, 0, "boolean", 0, MR_TYPE},
1545 static struct validate qgsh_validate = {
1554 qualified_get_serverhost,
1557 static char *ashi_fields[] = {
1558 "service", "machine", "enable", "value1", "value2", "value3",
1561 static struct valobj ashi_valobj[] = {
1562 {V_LOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
1563 {V_NAME, 0, SERVERS_TABLE, "name", 0, MR_SERVICE},
1564 {V_LOCK, 0, SERVERHOSTS_TABLE, 0, "mach_id", MR_DEADLOCK},
1565 {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1566 {V_CHAR, 0, SERVERHOSTS_TABLE, "service"},
1567 {V_LEN, 5, SERVERHOSTS_TABLE, "value3"},
1570 static struct validate ashi_validate = /* ashi & ushi */
1575 "service = UPPER('%s') AND mach_id = %d",
1580 set_serverhost_modtime,
1583 static struct validate rshe_validate =
1588 "service = UPPER('%s') AND mach_id = %d",
1593 set_serverhost_modtime,
1596 static struct validate ssho_validate =
1601 "service = UPPER('%s') AND mach_id = %d",
1609 static char *sshi_fields[] = {
1610 "service", "machine", "override", "success", "inprogress",
1611 "hosterror", "errmsg", "ltt", "lts",
1614 static struct valobj sshi_valobj[] = {
1615 {V_RLOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
1616 {V_NAME, 0, SERVERS_TABLE, "name", 0, MR_SERVICE},
1617 {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE}, /** Was this ok to add? */
1618 {V_LEN, 5, SERVERS_TABLE, "errmsg"},
1621 static struct validate sshi_validate =
1634 static char *dshi_fields[] = {
1635 "service", "machine",
1638 static struct validate dshi_validate =
1643 "service = UPPER('%s') AND mach_id = %d",
1651 static char *gslo_fields[] = {
1653 "server", "machine",
1656 static char *gfsl_fields[] = {
1658 "label", "type", "machine", "name", "mount", "access", "comments", "owner", "owners",
1659 "create", "lockertype", "modby", "modby", "modwith",
1662 static char *gfsm_fields[] = {
1664 "label", "type", "machine", "name", "mount", "access", "comments", "owner", "owners",
1665 "create", "lockertype", "modby", "modby", "modwith",
1668 static struct valobj gfsm_valobj[] = {
1669 {V_RLOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1670 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1673 static struct validate gfsm_validate = {
1685 static char *gfsn_fields[] = {
1686 "machine", "parition",
1687 "label", "type", "machine", "name", "mount", "access", "comments", "owner", "owners",
1688 "create", "lockertype", "modby", "modby", "modwith",
1691 static struct valobj gfsn_valobj[] =
1693 {V_RLOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1694 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1698 static struct validate gfsn_validate = {
1710 static char *gfsp_fields[] = {
1712 "label", "type", "machine", "name", "mount", "access", "comments", "owner", "owners",
1713 "create", "lockertype", "modby", "modby", "modwith",
1716 static char *gfsg_fields[] = {
1718 "label", "type", "machine", "name", "mount", "access", "comments", "owner", "owners",
1719 "create", "lockertype", "modby", "modby", "modwith",
1722 static struct valobj gfsg_valobj[] = {
1723 {V_RLOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1724 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST}
1727 static struct validate gfsg_validate = {
1739 static char *afil_fields[] = {
1740 "label", "type", "machine", "name", "mount", "access", "comments", "owner", "owners",
1741 "create", "lockertype",
1744 static struct valobj afil_valobj[] = {
1745 {V_LOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1746 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1747 {V_RLOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
1748 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1749 {V_CHAR, 0, FILESYS_TABLE, "label"},
1750 {V_TYPE, 1, 0, "filesys", 0, MR_FSTYPE},
1751 {V_ID, 2, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1752 {V_CHAR, 3, FILESYS_TABLE, "name"},
1753 {V_LEN, 4, FILESYS_TABLE, "mount"},
1754 {V_LEN, 6, FILESYS_TABLE, "comments"},
1755 {V_ID, 7, USERS_TABLE, "login", "users_id", MR_USER},
1756 {V_ID, 8, LIST_TABLE, "name", "list_id", MR_LIST},
1757 {V_TYPE, 10, 0, "lockertype", 0, MR_TYPE},
1760 static struct validate afil_validate = {
1769 set_filesys_modtime,
1772 static char *ufil_fields[] = {
1773 "label", "newlabel", "type", "machine", "name", "mount", "access", "comments",
1774 "owner", "owners", "create", "lockertype",
1777 static struct valobj ufil_valobj[] = {
1778 {V_LOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1779 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1780 {V_RLOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
1781 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1782 {V_LOCK, 0, QUOTA_TABLE, 0, "filsys_id", MR_DEADLOCK},
1783 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
1784 {V_RENAME, 1, FILESYS_TABLE, "label", "filsys_id", MR_NOT_UNIQUE},
1785 {V_TYPE, 2, 0, "filesys", 0, MR_FSTYPE},
1786 {V_ID, 3, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1787 {V_CHAR, 4, FILESYS_TABLE, "name"},
1788 {V_LEN, 5, FILESYS_TABLE, "mount"},
1789 {V_LEN, 7, FILESYS_TABLE, "comments"},
1790 {V_ID, 8, USERS_TABLE, "login", "users_id", MR_USER},
1791 {V_ID, 9, LIST_TABLE, "name", "list_id", MR_LIST},
1792 {V_TYPE, 11, 0, "lockertype", 0, MR_TYPE},
1795 static struct validate ufil_validate = {
1804 set_filesys_modtime,
1807 static char *dfil_fields[] = {
1811 static struct valobj dfil_valobj[] = {
1812 {V_LOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1813 {V_LOCK, 0, NFSPHYS_TABLE, 0, "nfsphys_id", MR_DEADLOCK},
1814 {V_LOCK, 0, QUOTA_TABLE, 0, "filsys_id", MR_DEADLOCK},
1815 {V_LOCK, 0, FSGROUP_TABLE, 0, "filsys_id", MR_DEADLOCK},
1816 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
1819 static struct validate dfil_validate = {
1831 static char *gfgm_fields[] = {
1832 "fsgroup", "filesys", "sortkey"
1835 static struct valobj gfgm_valobj[] = {
1836 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
1839 static struct validate gfgm_validate = {
1851 static struct valobj aftg_valobj[] = {
1852 {V_LOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1853 {V_LOCK, 0, FSGROUP_TABLE, 0, "filsys_id", MR_DEADLOCK},
1854 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
1855 {V_ID, 1, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
1858 static struct validate aftg_validate = {
1862 "group_id = %d and filsys_id = %d",
1870 static char *ganf_fields[] = {
1871 "machine", "dir", "device", "status", "allocated", "size", "modby", "modby", "modwith",
1874 static char *gnfp_fields[] = {
1876 "machine", "dir", "device", "status", "allocated", "size", "modby", "modby", "modwith",
1879 static struct valobj gnfp_valobj[] = {
1880 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1881 {V_RLOCK, 0, NFSPHYS_TABLE, 0, "nfsphys_id", MR_DEADLOCK},
1885 static struct validate gnfp_validate = {
1897 static struct valobj anfp_valobj[] = {
1898 {V_RLOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
1899 {V_LOCK, 0, NFSPHYS_TABLE, 0, "nfsphys_id", MR_DEADLOCK},
1900 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1901 {V_CHAR, 1, NFSPHYS_TABLE, "dir"},
1902 {V_LEN, 2, NFSPHYS_TABLE, "device"},
1905 static struct validate anfp_validate = {
1909 "mach_id = %d and dir = '%s'",
1914 set_nfsphys_modtime,
1917 static struct validate unfp_validate = {
1921 "mach_id = %d and dir = '%s'",
1926 set_nfsphys_modtime,
1929 static char *ajnf_fields[] = {
1930 "machine", "dir", "adjustment",
1933 static char *dnfp_fields[] = {
1937 static struct valobj dnfp_valobj[] = {
1938 {V_RLOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1939 {V_LOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
1940 {V_LOCK, 0, NFSPHYS_TABLE, 0, "nfsphys_id", MR_DEADLOCK},
1941 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1945 static struct validate dnfp_validate = {
1949 "mach_id = %d and dir = '%s'",
1954 set_nfsphys_modtime,
1957 static char *gqot_fields[] = {
1958 "filesys", "type", "name",
1959 "filesys", "type", "name", "quota", "dir", "machine", "modby", "modby", "modwith",
1962 static struct valobj gqot_valobj[] = {
1963 {V_RLOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1964 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1965 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1966 {V_RLOCK, 0, NFSPHYS_TABLE, 0, "nfsphys_id", MR_DEADLOCK},
1967 {V_RLOCK, 0, QUOTA_TABLE, 0, "filsys_id", MR_DEADLOCK},
1969 {V_TYPE, 1, 0, "quota_type", 0, MR_TYPE},
1970 {V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
1973 static struct validate gqot_validate = {
1985 static char *gqbf_fields[] = {
1987 "filesys", "type", "name", "quota", "dir", "machine", "modby", "modby", "modwith",
1990 static struct validate gqbf_validate = {
2002 static char *aqot_fields[] = {
2003 "filesys", "type", "name", "quota",
2006 static struct valobj aqot_valobj[] = {
2007 {V_LOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
2008 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
2009 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
2010 {V_LOCK, 0, NFSPHYS_TABLE, 0, "nfsphys_id", MR_DEADLOCK},
2011 {V_LOCK, 0, QUOTA_TABLE, 0, "filsys_id", MR_DEADLOCK},
2012 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
2013 {V_TYPE, 1, 0, "quota_type", 0, MR_TYPE},
2014 {V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
2017 static struct validate aqot_validate = {
2021 "filsys_id = %d and type = '%s' and entity_id = %d",
2029 static struct validate uqot_validate = {
2033 "filsys_id = %d AND type = '%s' AND entity_id = %d",
2041 static struct validate dqot_validate = {
2045 "filsys_id = %d AND type = '%s' AND entity_id = %d",
2053 static char *gnfq_fields[] = {
2055 "filesys", "login", "quota", "dir", "machine", "modby", "modby", "modwith",
2058 static struct validate gnfq_validate = {
2070 static char *gnqp_fields[] = {
2072 "filesys", "login", "quota", "dir", "machine", "modby", "modby", "modwith",
2075 static struct valobj gnqp_valobj[] = {
2076 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2080 static struct validate gnqp_validate = { gnqp_valobj, 2, };
2082 static char *anfq_fields[] = {
2083 "filesys", "login", "quota",
2086 static struct validate anfq_validate = {
2090 "filsys_id = %d AND type = 'USER' AND entity_id = %d",
2098 static struct validate unfq_validate = {
2102 "filsys_id = %d AND type = 'USER' AND entity_id = %d",
2110 static struct validate dnfq_validate = {
2114 "filsys_id = %d AND entity_id = %d",
2122 static char *gzcl_fields[] = {
2124 "class", "xmt_type", "xmt_name", "sub_type", "sub_name",
2125 "iws_type", "iws_name", "iui_type", "iui_name", "modby", "modby", "modwith",
2128 static struct valobj gzcl_valobj[] = {
2129 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
2130 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
2131 {V_RLOCK, 0, ZEPHYR_TABLE, 0, "xmt_id", MR_DEADLOCK},
2134 static struct validate gzcl_validate = {
2146 static char *azcl_fields[] = {
2147 "class", "xmt_type", "xmt_name", "sub_type", "sub_name",
2148 "iws_type", "iws_name", "iui_type", "iui_name",
2151 static struct valobj azcl_valobj[] = {
2152 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
2153 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
2154 {V_LOCK, 0, ZEPHYR_TABLE, 0, "xmt_id", MR_DEADLOCK},
2155 {V_CHAR, 0, ZEPHYR_TABLE, "class"},
2156 {V_TYPE, 1, 0, "ace_type", 0, MR_ACE},
2157 {V_TYPEDATA, 2, 0, 0, "list_id", MR_ACE},
2158 {V_TYPE, 3, 0, "ace_type", 0, MR_ACE},
2159 {V_TYPEDATA, 4, 0, 0, "list_id", MR_ACE},
2160 {V_TYPE, 5, 0, "ace_type", 0, MR_ACE},
2161 {V_TYPEDATA, 6, 0, 0, "list_id", MR_ACE},
2162 {V_TYPE, 7, 0, "ace_type", 0, MR_ACE},
2163 {V_TYPEDATA, 8, 0, 0, "list_id", MR_ACE},
2166 static struct validate azcl_validate = {
2178 static char *uzcl_fields[] = {
2179 "class", "newclass", "xmt_type", "xmt_name", "sub_type", "sub_name",
2180 "iws_type", "iws_name", "iui_type", "iui_name",
2183 static struct valobj uzcl_valobj[] = {
2184 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
2185 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
2186 {V_LOCK, 0, ZEPHYR_TABLE, 0, "xmt_id", MR_DEADLOCK},
2187 {V_RENAME, 1, ZEPHYR_TABLE, "class", 0, MR_NOT_UNIQUE},
2188 {V_TYPE, 2, 0, "ace_type", 0, MR_ACE},
2189 {V_TYPEDATA, 3, 0, 0, "list_id", MR_ACE},
2190 {V_TYPE, 4, 0, "ace_type", 0, MR_ACE},
2191 {V_TYPEDATA, 5, 0, 0, "list_id", MR_ACE},
2192 {V_TYPE, 6, 0, "ace_type", 0, MR_ACE},
2193 {V_TYPEDATA, 7, 0, 0, "list_id", MR_ACE},
2194 {V_TYPE, 8, 0, "ace_type", 0, MR_ACE},
2195 {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
2198 static struct validate uzcl_validate = {
2210 static struct validate dzcl_validate = {
2222 static char *gsha_fields[] = {
2224 "machine", "ace_type", "ace_name", "modby", "modby", "modwith",
2227 static struct validate gsha_validate =
2240 static char *asha_fields[] = {
2241 "machine", "ace_type", "ace_name",
2244 static struct valobj asha_valobj[] = {
2245 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
2246 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2247 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
2248 {V_TYPE, 1, 0, "ace_type", 0, MR_ACE},
2249 {V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
2252 static struct validate asha_validate =
2265 static char *gsvc_fields[] = {
2267 "service", "protocol", "port", "description", "modby", "modby", "modwith",
2270 static char *asvc_fields[] = {
2271 "service", "protocol", "port", "description",
2274 static struct valobj asvc_valobj[] = {
2275 {V_CHAR, 0, SERVICES_TABLE, "name"},
2276 {V_CHAR, 1, SERVICES_TABLE, "protocol"},
2277 {V_CHAR, 3, SERVICES_TABLE, "description"},
2280 static struct validate asvc_validate = {
2292 static char *gpce_fields[] = {
2294 "printer", "spooling_host", "spool_directory", "rprinter",
2295 "quotaserver", "authenticate", "price", "comments",
2296 "modby", "modby", "modwith",
2299 static struct valobj gpce_valobj[] = {
2300 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
2301 {V_RLOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
2302 {V_RLOCK, 0, PRINTCAP_TABLE, 0, "mach_id", MR_DEADLOCK},
2306 static struct validate gpce_validate = {
2318 static char *apce_fields[] = {
2319 "printer", "spooling_host", "spool_directory", "rprinter",
2320 "quotaserver", "authenticate", "price", "comments",
2321 "modby", "modby", "modwith",
2324 static struct valobj apce_valobj[] = {
2325 {V_CHAR, 0, PRINTCAP_TABLE, "name"},
2326 {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2327 {V_LEN, 2, PRINTCAP_TABLE, "dir"},
2328 {V_LEN, 3, PRINTCAP_TABLE, "rp"},
2329 {V_ID, 4, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2330 {V_CHAR, 7, PRINTCAP_TABLE, "comments"},
2333 static struct validate apce_validate = {
2345 static struct validate dpce_validate = {
2357 static char *gpcp_fields[] = {
2359 "printer", "spooling_host", "spool_directory", "rprinter", "comments",
2360 "modby", "modby", "modwith",
2363 static char *gpdm_fields[] = {
2365 "name", "rpcnum", "host", "modby", "modby", "modwith",
2368 static char *apdm_fields[] = {
2369 "name", "rpcnum", "host"
2372 static struct valobj apdm_valobj[] = {
2373 {V_CHAR, 0, PALLADIUM_TABLE, "name"},
2374 {V_ID, 2, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2377 static struct validate apdm_validate = {
2389 static struct validate dpdm_validate = {
2401 static char *gali_fields[] = {
2402 "name", "type", "trans",
2403 "name", "type", "trans",
2406 static char *aali_fields[] = {
2407 "name", "type", "trans",
2410 static struct valobj aali_valobj[] = {
2411 {V_CHAR, 0, ALIAS_TABLE, "name"},
2412 {V_TYPE, 1, 0, "alias", 0, MR_TYPE},
2413 {V_CHAR, 2, ALIAS_TABLE, "trans"},
2416 static struct validate aali_validate = {
2420 "name = '%s' and type = '%s' and trans = '%s'",
2428 static struct validate dali_validate = /* DELETE_ALIAS */
2433 "name = '%s' and type = '%s' and trans = '%s'",
2441 static char *gval_fields[] = {
2445 static struct valobj gval_valobj[] = {
2446 {V_NAME, 0, NUMVALUES_TABLE, "name", 0, MR_NO_MATCH},
2449 static struct validate gval_validate = {
2461 static char *aval_fields[] = {
2465 static struct valobj aval_valobj[] = {
2466 {V_CHAR, 0, NUMVALUES_TABLE, "name"},
2469 static struct validate aval_validate = /* for aval, uval, and dval */
2482 static char *dval_fields[] = {
2486 static char *gats_fields[] = {
2487 "table_name", "appends", "updates", "deletes", "modby", "modby", "modwith",
2490 static char *_sdl_fields[] = {
2494 static struct validate _sdl_validate =
2509 /* Generalized Query Definitions */
2511 /* Note: For any query which uses prefetch_value, the vcnt should be
2512 * one less than the number of %-format specifiers in the tlist.
2515 struct query Queries2[] = {
2517 /* Q_GALO - GET_ALL_LOGINS */
2523 "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle FROM users u",
2533 /* Q_GAAL - GET_ALL_ACTIVE_LOGINS */
2534 "get_all_active_logins",
2539 "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle FROM users u",
2549 /* Q_GUAL - GET_USER_ACCOUNT_BY_LOGIN */
2550 "get_user_account_by_login",
2555 "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",
2558 "u.login LIKE '%s' ESCAPE '*' AND u.users_id != 0 AND u.comments = str.string_id",
2565 /* Q_GUAU - GET_USER_ACCOUNT_BY_UID */
2566 "get_user_account_by_uid",
2571 "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",
2574 "u.unix_uid = %s AND u.users_id != 0 AND u.comments = str.string_id",
2581 /* Q_GUAN - GET_USER_ACCOUNT_BY_NAME */
2582 "get_user_account_by_name",
2587 "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",
2590 "u.first LIKE '%s' ESCAPE '*' AND u.last LIKE '%s' ESCAPE '*' AND u.users_id != 0 and u.comments = str.string_id",
2597 /* Q_GUAC - GET_USER_ACCOUNT_BY_CLASS */
2598 "get_user_account_by_class",
2603 "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",
2606 "u.type = UPPER('%s') AND u.users_id != 0 AND u.comments = str.string_id",
2613 /* Q_GUAM - GET_USER_ACCOUNT_BY_MITID */
2614 "get_user_account_by_id",
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.clearid LIKE '%s' ESCAPE '*' AND u.users_id != 0 AND u.comments = str.string_id",
2629 /* Q_GUBL - GET_USER_BY_LOGIN */
2630 "get_user_by_login",
2635 "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",
2638 "u.login LIKE '%s' ESCAPE '*' AND u.users_id != 0",
2645 /* Q_GUBU - GET_USER_BY_UID */
2651 "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",
2654 "u.unix_uid = %s AND u.users_id != 0",
2661 /* Q_GUBN - GET_USER_BY_NAME */
2667 "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",
2670 "u.first LIKE '%s' ESCAPE '*' AND u.last LIKE '%s' ESCAPE '*' AND u.users_id != 0",
2677 /* Q_GUBC - GET_USER_BY_CLASS */
2678 "get_user_by_class",
2683 "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",
2686 "u.type = UPPER('%s') AND u.users_id != 0",
2693 /* Q_GUBM - GET_USER_BY_MITID */
2694 "get_user_by_mitid",
2699 "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",
2702 "u.clearid LIKE '%s' ESCAPE '*' AND u.users_id != 0",
2709 /* Q_GUDF - GET_USER_DIRECTORY_FLAGS */
2710 "get_user_directory_flags",
2715 "u.dirsuppress, u.dirremote FROM users u",
2725 /* Q_AUAC - ADD_USER_ACCOUNT */ /* uses prefetch_value() for users_id */
2731 "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 */
2741 /* Q_AUSR - ADD_USER */ /* uses prefetch_value() for users_id */
2747 "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)",
2757 /* Q_RUSR - REGISTER_USER */
2773 /* Q_UUAC - UPDATE_USER_ACCOUNT */
2774 "update_user_account",
2779 "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 */
2789 /* Q_UUSR - UPDATE_USER */
2795 "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'",
2805 /* Q_UUSH - UPDATE_USER_SHELL */
2806 "update_user_shell",
2811 "users SET shell = '%s'",
2821 /* Q_UUST - UPDATE_USER_STATUS */
2822 "update_user_status",
2827 "users SET status = %s",
2837 /* Q_UUSS - UPDATE_USER_SECURITY_STATUS */
2838 "update_user_security_status",
2843 "users SET secure = %s",
2853 /* Q_UUDF - UPDATE_USER_DIRECTORY_FLAGS */
2854 "update_user_directory_flags",
2859 "users SET dirsuppress = %s, dirremote = %s",
2869 /* Q_DUSR - DELETE_USER */
2885 /* Q_DUBU - DELETE_USER_BY_UID */
2886 "delete_user_by_uid",
2901 /* Q_GKUM - GET_KERBEROS_USER_MAP */
2902 "get_kerberos_user_map",
2907 "u.login, str.string FROM krbmap km, users u, strings str",
2910 "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",
2912 "u.login, str.string",
2917 /* Q_AKUM - ADD_KERBEROS_USER_MAP */
2918 "add_kerberos_user_map",
2923 "INTO krbmap (users_id, string_id) VALUES (%d, %d)",
2933 /* Q_DKUM - DELETE_KERBEROS_USER_MAP */
2934 "delete_kerberos_user_map",
2942 "users_id = %d AND string_id = %d",
2949 /* Q_GFBL - GET_FINGER_BY_LOGIN */
2950 "get_finger_by_login",
2955 "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",
2965 /* Q_UFBL - UPDATE_FINGER_BY_LOGIN */
2966 "update_finger_by_login",
2971 "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))",
2981 /* Q_GPOB - GET_POBOX */
2987 "login, potype, pop_id || ':' || box_id, TO_CHAR(pmodtime, 'DD-mon-YYYY HH24:MI:SS'), pmodby, pmodwith FROM users",
2997 /* Q_GAPO - GET_ALL_POBOXES */
3003 "login, potype, pop_id || ':' || box_id FROM users",
3013 /* Q_GPOP - GET_POBOXES_POP */
3019 "login, potype, pop_id || ':' || box_id FROM users",
3029 /* Q_GPOF - GET_POBOXES_SMTP */
3035 "login, potype, pop_id || ':' || box_id FROM users",
3045 /* Q_SPOB - SET_POBOX */
3061 /* Q_SPOP - SET_POBOX_POP */
3067 "users SET potype = 'POP'",
3077 /* Q_DPOB - DELETE_POBOX */
3083 "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",
3109 /* Q_AHST - ADD_HOST */ /* uses prefetch_value() for mach_id */
3115 "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)",
3125 /* Q_UHST - UPDATE_HOST */
3131 "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",
3141 /* Q_DHST - DELETE_HOST */
3157 /* Q_GMAC - GET_MACHINE */
3163 "name, vendor, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM machine",
3166 "name LIKE '%s' ESCAPE '*' AND mach_id != 0",
3169 &VDupwild_fix_modby,
3173 /* Q_GHAL - GET_HOSTALIAS */
3179 "a.name, m.name FROM hostalias a, machine m",
3182 "m.mach_id = a.mach_id and a.name LIKE '%s' ESCAPE '*' AND m.name LIKE '%s' ESCAPE '*'",
3189 /* Q_AHAL - ADD_HOSTALIAS */
3195 "INTO hostalias (name, mach_id) VALUES (UPPER('%s'), %d)",
3205 /* Q_DHAL - DELETE_HOSTALIAS */
3214 "name = UPPER('%s') AND mach_id = %d",
3221 /* Q_GSNT - GET_SUBNET */
3227 "name, description, saddr, mask, low, high, prefix, owner_type, owner_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM subnet",
3230 "name LIKE '%s' ESCAPE '*' and snet_id != 0",
3237 /* Q_ASNT - ADD_SUBNET */
3243 "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)",
3253 /* Q_USNT - UPDATE_SUBNET */
3259 "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",
3269 /* Q_DSNT - DELETE_SUBNET */
3285 /* Q_GCLU - GET_CLUSTER */
3291 "name, description, location, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM clusters",
3294 "name LIKE '%s' ESCAPE '*' AND clu_id != 0",
3301 /* Q_ACLU - ADD_CLUSTER */ /* uses prefetch_value() for clu_id */
3307 "INTO clusters (name, description, location, clu_id) VALUES ('%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s)",
3317 /* Q_UCLU - UPDATE_CLUSTER */
3323 "clusters SET name = '%s', description = NVL('%s', CHR(0)), location = NVL('%s', CHR(0))",
3333 /* Q_DCLU - DELETE_CLUSTER */
3349 /* Q_GMCM - GET_MACHINE_TO_CLUSTER_MAP */
3350 "get_machine_to_cluster_map",
3355 "m.name, c.name FROM machine m, clusters c, mcmap mcm",
3358 "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",
3365 /* Q_AMTC - ADD_MACHINE_TO_CLUSTER */
3366 "add_machine_to_cluster",
3371 "INTO mcmap (mach_id, clu_id) VALUES (%d, %d)",
3381 /* Q_DMFC - DELETE_MACHINE_FROM_CLUSTER */
3382 "delete_machine_from_cluster",
3390 "mach_id = %d AND clu_id = %d",
3397 /* Q_GCLD - GET_CLUSTER_DATA */
3403 "c.name, svc.serv_label, svc.serv_cluster FROM svc svc, clusters c",
3406 "c.clu_id = svc.clu_id AND c.name LIKE '%s' ESCAPE '*' AND svc.serv_label LIKE '%s' ESCAPE '*'",
3408 "c.name, svc.serv_label",
3413 /* Q_ACLD - ADD_CLUSTER_DATA */
3419 "INTO svc (clu_id, serv_label, serv_cluster) VALUES (%d, '%s', '%s')",
3429 /* Q_DCLD - DELETE_CLUSTER_DATA */
3430 "delete_cluster_data",
3438 "clu_id = %d AND serv_label = '%s' AND serv_cluster = '%s'",
3445 /* Q_GLIN - GET_LIST_INFO */
3461 /* Q_EXLN - EXPAND_LIST_NAMES */
3462 "expand_list_names",
3470 "name LIKE '%s' ESCAPE '*' AND list_id != 0",
3477 /* Q_ALIS - ADD_LIST */ /* uses prefetch_value() for list_id */
3483 "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)",
3493 /* Q_ULIS - UPDATE_LIST */
3499 "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))",
3509 /* Q_DLIS - DELETE_LIST */
3525 /* Q_AMTL - ADD_MEMBER_TO_LIST */
3526 "add_member_to_list",
3541 /* Q_DMFL - DELETE_MEMBER_FROM_LIST */
3542 "delete_member_from_list",
3557 /* Q_GAUS - GET_ACE_USE */
3573 /* Q_QGLI - QUALIFIED_GET_LISTS */
3574 "qualified_get_lists",
3589 /* Q_GMOL - GET_MEMBERS_OF_LIST */
3590 "get_members_of_list",
3605 /* Q_GEML - GET_END_MEMBERS_OF_LIST */
3606 "get_end_members_of_list",
3621 /* Q_GLOM - GET_LISTS_OF_MEMBER */
3622 "get_lists_of_member",
3637 /* Q_CMOL - COUNT_MEMBERS_OF_LIST */
3638 "count_members_of_list",
3653 /* Q_GSIN - GET_SERVER_INFO */
3659 "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",
3662 "name LIKE '%s' ESCAPE '*'",
3669 /* Q_QGSV - QUALIFIED_GET_SERVER */
3670 "qualified_get_server",
3685 /* Q_ASIN - ADD_SERVER_INFO */
3691 "INTO servers (name, update_int, target_file, script, type, enable, acl_type, acl_id) VALUES (UPPER('%s'), %s, '%s', '%s', '%s', %s, '%s', %d)",
3701 /* Q_USIN - UPDATE_SERVER_INFO */
3702 "update_server_info",
3707 "servers SET update_int = %s, target_file = '%s', script = '%s', type = '%s', enable = %s, acl_type = '%s', acl_id = %d",
3710 "name = UPPER('%s')",
3717 /* Q_RSVE - RESET_SERVER_ERROR */
3718 "reset_server_error",
3723 "servers SET harderror = 0, dfcheck = dfgen",
3726 "name = UPPER('%s')",
3733 /* Q_SSIF - SET_SERVER_INTERNAL_FLAGS */
3734 "set_server_internal_flags",
3739 "servers SET dfgen = %s, dfcheck = %s, inprogress = %s, harderror = %s, errmsg = NVL('%s', CHR(0))",
3742 "name = UPPER('%s')",
3749 /* Q_DSIN - DELETE_SERVER_INFO */
3750 "delete_server_info",
3758 "name = UPPER('%s')",
3765 /* Q_GSHI - GET_SERVER_HOST_INFO */
3766 "get_server_host_info",
3771 "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",
3774 "sh.service LIKE '%s' ESCAPE '*' AND m.name LIKE '%s' ESCAPE '*' AND m.mach_id = sh.mach_id",
3776 "sh.service, m.name",
3781 /* Q_QGSH - QUALIFIED_GET_SERVER_HOST */
3782 "qualified_get_server_host",
3797 /* Q_ASHI - ADD_SERVER_HOST_INFO */
3798 "add_server_host_info",
3803 "INTO serverhosts (service, mach_id, enable, value1, value2, value3) VALUES (UPPER('%s'), %d, %s, %s, %s, NVL('%s', CHR(0)))",
3813 /* Q_USHI - UPDATE_SERVER_HOST_INFO */
3814 "update_server_host_info",
3819 "serverhosts SET enable = %s, value1 = %s, value2 = %s, value3 = NVL('%s', CHR(0))",
3822 "service = UPPER('%s') AND mach_id = %d",
3829 /* Q_RSHE - RESET_SERVER_HOST_ERROR */
3830 "reset_server_host_error",
3835 "serverhosts SET hosterror = 0",
3838 "service = UPPER('%s') AND mach_id = %d",
3845 /* Q_SSHO - SET_SERVER_HOST_OVERRIDE */
3846 "set_server_host_override",
3851 "serverhosts SET override = 1",
3854 "service = UPPER('%s') AND mach_id = %d",
3861 /* Q_SSHI - SET_SERVER_HOST_INTERNAL */
3862 "set_server_host_internal",
3867 "serverhosts SET override = %s, success = %s, inprogress = %s, hosterror = %s, hosterrmsg = NVL('%s', CHR(0)), ltt = %s, lts = %s",
3870 "service = UPPER('%s') AND mach_id = %d",
3877 /* Q_DSHI - DELETE_SERVER_HOST_INFO */
3878 "delete_server_host_info",
3886 "service = UPPER('%s') AND mach_id = %d",
3893 /* Q_GSLO - GET_SERVER_LOCATIONS */
3894 "get_server_locations",
3899 "sh.service, m.name FROM serverhosts sh, machine m",
3902 "sh.service LIKE '%s' ESCAPE '*' AND sh.mach_id = m.mach_id",
3904 "sh.service, m.name",
3909 /* Q_GFSL - GET_FILESYS_BY_LABEL */
3910 "get_filesys_by_label",
3915 "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",
3918 "fs.label LIKE '%s' ESCAPE '*' AND fs.mach_id = m.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id",
3925 /* Q_GFSM - GET_FILESYS_BY_MACHINE */
3926 "get_filesys_by_machine",
3931 "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",
3934 "fs.mach_id = %d AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id",
3941 /* Q_GFSN - GET_FILESYS_BY_NFSPHYS */
3942 "get_filesys_by_nfsphys",
3947 "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",
3950 "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'",
3957 /* Q_GFSG - GET_FILESYS_BY_GROUP */
3958 "get_filesys_by_group",
3963 "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",
3966 "fs.owners = %d AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id",
3973 /* Q_GFSP - GET_FILESYS_BY_PATH */
3974 "get_filesys_by_path",
3979 "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",
3982 "fs.name LIKE '%s' ESCAPE '*' AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = list_id",
3989 /* Q_AFIL - ADD_FILESYS */ /* uses prefetch_value() for filsys_id */
3995 "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)",
4005 /* Q_UFIL - UPDATE_FILESYS */
4011 "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'",
4021 /* Q_DFIL - DELETE_FILESYS */
4037 /* Q_GFGM - GET_FSGROUP_MEMBERS */
4038 "get_fsgroup_members",
4043 "fs.label, fg.key FROM fsgroup fg, filesys fs",
4046 "fg.group_id = %d AND fs.filsys_id = fg.filsys_id",
4053 /* Q_AFTG - ADD_FILESYS_TO_FSGROUP */
4054 "add_filesys_to_fsgroup",
4059 "INTO fsgroup (group_id, filsys_id, key) VALUES (%d, %d, '%s')",
4069 /* Q_RFFG - REMOVE_FILESYS_FROM_FSGROUP */
4070 "remove_filesys_from_fsgroup",
4078 "group_id = %d AND filsys_id = %d",
4085 /* Q_GANF - GET_ALL_NFSPHYS */
4091 "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",
4094 "m.mach_id = np.mach_id",
4101 /* Q_GNFP - GET_NFSPHYS */
4107 "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",
4110 "np.mach_id = %d AND np.dir LIKE '%s' ESCAPE '*' AND m.mach_id = np.mach_id",
4117 /* Q_ANFP - ADD_NFSPHYS */ /* uses prefetch_value() for nfsphys_id */
4123 "INTO nfsphys (mach_id, dir, device, status, allocated, partsize, nfsphys_id) VALUES (%d, '%s', NVL('%s', CHR(0)), %s, %s, %s, %s)",
4133 /* Q_UNFP - UPDATE_NFSPHYS */
4139 "nfsphys SET device = NVL('%s', CHR(0)), status = %s, allocated = %s, partsize = %s",
4142 "mach_id = %d AND dir = '%s'",
4149 /* Q_AJNF - ADJUST_NFSPHYS_ALLOCATION */
4150 "adjust_nfsphys_allocation",
4155 "nfsphys SET allocated = allocated + %s",
4158 "mach_id = %d AND dir = '%s'",
4165 /* Q_DNFP - DELETE_NFSPHYS */
4174 "mach_id = %d AND dir = '%s'",
4181 /* Q_GQOT - GET_QUOTA */
4187 "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",
4190 "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",
4197 /* Q_GQBF - GET_QUOTA_BY_FILESYS */
4198 "get_quota_by_filesys",
4203 "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",
4206 "fs.label LIKE '%s' ESCAPE '*' AND fs.filsys_id = q.filsys_id AND m.mach_id = fs.mach_id",
4213 /* Q_AQOT - ADD_QUOTA */ /* prefetch_filsys() gets last 1 value */
4219 "INTO quota (filsys_id, type, entity_id, quota, phys_id) VALUES ('%s', %d, %d, %s, %s)",
4229 /* Q_UQOT - UPDATE_QUOTA */
4235 "quota SET quota = %s",
4245 /* Q_DQOT - DELETE_QUOTA */
4261 /* Q_GNFQ - GET_NFS_QUOTAS */
4267 "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",
4270 "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'",
4272 "fs.label, u.login",
4277 /* Q_GNQP - GET_NFS_QUOTAS_BY_PARTITION */
4278 "get_nfs_quotas_by_partition",
4283 "fs.label, u.login, q.quota, np.dir, m.name FROM quota q, filesys fs, users u, nfsphys np, machine m",
4286 "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",
4293 /* Q_ANFQ - ADD_NFS_QUOTA */ /* prefetch_filsys() gets last 1 value */
4299 "INTO quota (type, filsys_id, entity_id, quota, phys_id ) VALUES ('USER', %d, %d, %s, %s)",
4309 /* Q_UNFQ - UPDATE_NFS_QUOTA */
4315 "quota SET quota = %s",
4325 /* Q_DNFQ - DELETE_NFS_QUOTA */
4341 /* Q_GZCL - GET_ZEPHYR_CLASS */
4347 "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",
4350 "class LIKE '%s' ESCAPE '*'",
4357 /* Q_AZCL - ADD_ZEPHYR_CLASS */
4363 "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)",
4373 /* Q_UZCL - UPDATE_ZEPHYR_CLASS */
4374 "update_zephyr_class",
4379 "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",
4389 /* Q_DZCL - DELETE_ZEPHYR_CLASS */
4390 "delete_zephyr_class",
4405 /* Q_GSHA - GET_SERVER_HOST_ACCESS */
4406 "get_server_host_access",
4411 "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",
4414 "m.name LIKE '%s' ESCAPE '*' AND ha.mach_id = m.mach_id",
4421 /* Q_ASHA - ADD_SERVER_HOST_ACCESS */
4422 "add_server_host_access",
4427 "INTO hostaccess (mach_id, acl_type, acl_id) VALUES (%d, '%s', %d)",
4437 /* Q_USHA - UPDATE_SERVER_HOST_ACCESS */
4438 "update_server_host_access",
4443 "hostaccess SET acl_type = '%s', acl_id = %d",
4453 /* Q_DSHA - DELETE_SERVER_HOST_ACCESS */
4454 "delete_server_host_access",
4469 /* Q_GSVC - GET_SERVICE */
4475 "name, protocol, port, description, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM services",
4478 "name LIKE '%s' ESCAPE '*'",
4485 /* Q_ASVC - ADD_SERVICE */
4491 "INTO services (name, protocol, port, description) VALUES ('%s', '%s', %s, NVL('%s', CHR(0)))",
4501 /* Q_DSVC - DELETE_SERVICE */
4517 /* Q_GPCE - GET_PRINTCAP_ENTRY */
4518 "get_printcap_entry",
4523 "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",
4526 "pc.name LIKE '%s' ESCAPE '*' AND m.mach_id = pc.mach_id",
4533 /* Q_APCE - ADD_PRINTCAP_ENTRY */
4534 "add_printcap_entry",
4539 "INTO printcap (name, mach_id, dir, rp, quotaserver, auth, price, comments) VALUES ('%s', %d, '%s', '%s', %d, %s, %s, NVL('%s', CHR(0)))",
4549 /* Q_DPCE - DELETE_PRINTCAP_ENTRY */
4550 "delete_printcap_entry",
4565 /* Q_GPCP - GET_PRINTCAP */
4571 "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",
4574 "pc.name LIKE '%s' ESCAPE '*' AND m.mach_id = pc.mach_id",
4581 /* Q_DPCP - DELETE_PRINTCAP */
4597 /* Q_GPDM - GET_PALLADIUM */
4603 "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",
4606 "pal.name LIKE '%s' ESCAPE '*' AND m.mach_id = pal.mach_id",
4613 /* Q_APDM - ADD_PALLADIUM */
4619 "INTO palladium (name, identifier, mach_id) VALUES ('%s', %s, %d)",
4629 /* Q_DPDM - DELETE_PALLADIUM */
4645 /* Q_GALI - GET_ALIAS */
4651 "name, type, trans FROM alias",
4654 "name LIKE '%s' ESCAPE '*' AND type LIKE '%s' ESCAPE '*' AND trans LIKE '%s' ESCAPE '*'",
4656 "type, name, trans",
4661 /* Q_AALI - ADD_ALIAS */
4667 "INTO alias (name, type, trans) VALUES ('%s', '%s', '%s')",
4677 /* Q_DALI - DELETE_ALIAS */
4686 "name = '%s' AND type = '%s' AND trans = '%s'",
4693 /* Q_GVAL - GET_VALUE */
4699 "value FROM numvalues",
4709 /* Q_AVAL - ADD_VALUE */
4715 "INTO numvalues (name, value) VALUES ('%s', %s)",
4725 /* Q_UVAL - UPDATE_VALUE */
4731 "numvalues SET value = %s",
4741 /* Q_DVAL - DELETE_VALUE */
4757 /* Q_GATS - GET_ALL_TABLE_STATS */
4758 "get_all_table_stats",
4763 "table_name, appends, updates, deletes, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS') FROM tblstats",
4773 /* Q__SDL - _SET_DEBUG_LEVEL */
4790 int QueryCount2 = (sizeof(Queries2) / sizeof(struct query));