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},
53 static struct valobj VOmach0[] = {
54 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
57 static struct valobj VOclu0[] = {
58 {V_ID, 0, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
61 static struct valobj VOlist0[] = {
62 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
65 static struct valobj VOnum0[] = {
70 * Commonly used validation records defined here so that they may
74 static struct validate VDmach = { VOmach0, 1 };
75 static struct validate VDwild0= { VOwild0, 1 };
76 static struct validate VDupwild0= { VOupwild0, 1 };
77 static struct validate VDwild2 = { VOwild01, 2 };
78 static struct validate VDwild3 = { VOwild012, 3 };
79 static struct validate VDfix_modby = {
91 static struct validate VDwild_fix_modby = {
103 static struct validate VDupwild_fix_modby = {
116 static char *galo_fields[] = {
117 "login", "unix_uid", "shell", "last", "first", "middle",
120 static char *gual_fields[] = {
122 "login", "unix_uid", "shell", "last", "first", "middle", "status",
123 "clearid", "class", "comments", "signature", "secure", "modby", "modby", "modwith",
126 static char *gubl_fields[] = {
128 "login", "unix_uid", "shell", "last", "first", "middle", "status",
129 "clearid", "class", "modby", "modby", "modwith",
132 static struct validate gubl_validate =
145 static char *guau_fields[] = {
147 "login", "unix_uid", "shell", "last", "first", "middle", "status",
148 "clearid", "class", "comments", "signature", "secure", "modby", "modby", "modwith",
151 static char *guan_fields[] = {
153 "login", "unix_uid", "shell", "last", "first", "middle", "status",
154 "clearid", "class", "comments", "signature", "secure", "modby", "modby", "modwith",
157 static struct validate guan_validate =
170 static char *guac_fields[] = {
172 "login", "unix_uid", "shell", "last", "first", "middle", "status",
173 "clearid", "class", "comments", "signature", "secure", "modby", "modby", "modwith",
176 static char *guam_fields[] = {
178 "login", "unix_uid", "shell", "last", "first", "middle", "status",
179 "clearid", "class", "comments", "signature", "secure", "modby", "modby", "modwith",
182 static char *gubu_fields[] = {
184 "login", "unix_uid", "shell", "last", "first", "middle", "status",
185 "clearid", "class", "modby", "modby", "modwith",
188 static struct validate gubu_validate =
201 static char *gubn_fields[] = {
203 "login", "unix_uid", "shell", "last", "first", "middle", "status",
204 "clearid", "class", "modby", "modby", "modwith",
207 static struct validate gubn_validate =
220 static char *gubc_fields[] = {
222 "login", "unix_uid", "shell", "last", "first", "middle", "status",
223 "clearid", "class", "modby", "modby", "modwith",
226 static char *gubm_fields[] = {
228 "login", "unix_uid", "shell", "last", "first", "middle", "status",
229 "clearid", "class", "modby", "modby", "modwith",
232 static char *gudf_fields[] = {
234 "dirsuppress", "dirremote"
237 static struct validate gudf_validate =
250 static char *auac_fields[] = {
251 "login", "unix_uid", "shell", "last", "first", "middle", "status",
252 "clearid", "class", "comments", "signature", "secure",
255 static struct valobj auac_valobj[] = {
256 {V_LOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
257 {V_CHAR, 0, USERS_TABLE, "login"},
259 {V_CHAR, 2, USERS_TABLE, "shell"},
260 {V_CHAR, 3, USERS_TABLE, "last"},
261 {V_CHAR, 4, USERS_TABLE, "first"},
262 {V_CHAR, 5, USERS_TABLE, "middle"},
264 {V_CHAR, 7, USERS_TABLE, "clearid"},
265 {V_TYPE, 8, 0, "class", 0, MR_BAD_CLASS},
266 {V_ID, 9, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
270 static struct validate auac_validate = {
282 static struct validate ausr_validate = {
294 static char *rusr_fields[] = {
295 "unix_uid", "login", "fs_type"
298 static struct valobj rusr_valobj[] = {
299 {V_LOCK, 0, IMEMBERS_TABLE, 0, "list_id", MR_DEADLOCK},
300 {V_LOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
301 {V_LOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
302 {V_RLOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
303 {V_LOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
304 {V_LOCK, 0, NFSPHYS_TABLE, 0, "nfsphys_id", MR_DEADLOCK},
305 {V_LOCK, 0, QUOTA_TABLE, 0, "filsys_id", MR_DEADLOCK},
306 {V_RLOCK, 0, SERVERHOSTS_TABLE, 0, "mach_id", MR_DEADLOCK},
312 static struct validate rusr_validate = {
324 static char *uuac_fields[] = {
326 "newlogin", "unix_uid", "shell", "last", "first", "middle", "status",
327 "clearid", "class", "comments", "signature", "secure",
330 static struct valobj uuac_valobj[] = {
331 {V_LOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
332 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
333 {V_RENAME, 1, USERS_TABLE, "login", "users_id", MR_NOT_UNIQUE},
335 {V_CHAR, 3, USERS_TABLE, "shell"},
336 {V_CHAR, 4, USERS_TABLE, "first"},
337 {V_CHAR, 5, USERS_TABLE, "last"},
338 {V_CHAR, 6, USERS_TABLE, "middle"},
340 {V_CHAR, 8, USERS_TABLE, "clearid"},
341 {V_TYPE, 9, 0, "class", 0, MR_BAD_CLASS},
342 {V_ID, 10, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
346 static struct validate uuac_validate = {
358 static struct validate uusr_validate = {
370 static char *uush_fields[] = {
375 static struct valobj uush_valobj[] = {
376 {V_LOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
377 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
378 {V_CHAR, 1, USERS_TABLE, "shell"},
381 static struct validate uush_validate = {
393 static char *uust_fields[] = {
398 static char *uuss_fields[] = {
403 static struct valobj uust_valobj[] = {
404 {V_LOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
405 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
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_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
705 {V_LOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
706 {V_RLOCK, 0, SUBNET_TABLE, 0, "snet_id", MR_DEADLOCK},
707 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
708 {V_RLOCK, 0, HOSTALIAS_TABLE, 0, "mach_id", MR_DEADLOCK},
709 {V_CHAR, 0, MACHINE_TABLE, "name"},
710 {V_CHAR, 1, MACHINE_TABLE, "vendor"},
711 {V_CHAR, 2, MACHINE_TABLE, "model"},
712 {V_CHAR, 3, MACHINE_TABLE, "os"},
713 {V_CHAR, 4, MACHINE_TABLE, "location"},
714 {V_CHAR, 5, MACHINE_TABLE, "contact"},
717 {V_ID, 8, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
718 {V_TYPE, 10, 0, "ace_type", 0, MR_ACE},
719 {V_TYPEDATA, 11, 0, 0, 0, MR_ACE},
720 {V_ID, 12, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
721 {V_ID, 13, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
724 static struct validate ahst_validate = {
728 "name = UPPER('%s')",
733 set_uppercase_modtime,
736 static char *uhst_fields[] = {
738 "newname", "vendor", "model", "os", "location", "contact", "use", "status", "subnet", "address", "ace_type", "ace_name", "admin_comment", "ops_comment",
741 static struct valobj uhst_valobj[] = {
742 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
743 {V_LOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
744 {V_RLOCK, 0, SUBNET_TABLE, 0, "snet_id", MR_DEADLOCK},
745 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
746 {V_CHAR, 0, MACHINE_TABLE, "name"},
747 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
748 {V_RENAME, 1, MACHINE_TABLE, "name", "mach_id", MR_NOT_UNIQUE},
749 {V_CHAR, 2, MACHINE_TABLE, "vendor"},
750 {V_CHAR, 3, MACHINE_TABLE, "model"},
751 {V_CHAR, 4, MACHINE_TABLE, "os"},
752 {V_CHAR, 5, MACHINE_TABLE, "location"},
753 {V_CHAR, 6, MACHINE_TABLE, "contact"},
756 {V_ID, 9, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
757 {V_TYPE, 11, 0, "ace_type", 0, MR_ACE},
758 {V_TYPEDATA, 12, 0, 0, 0, MR_ACE},
759 {V_ID, 13, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
760 {V_ID, 14, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
763 static struct validate uhst_validate = {
775 static char *dhst_fields[] = {
779 static struct valobj dhst_valobj[] = {
780 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
781 {V_LOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
782 {V_RLOCK, 0, NFSPHYS_TABLE, 0, "nfsphys_id", MR_DEADLOCK},
783 {V_RLOCK, 0, SERVERHOSTS_TABLE, 0, "mach_id", MR_DEADLOCK},
784 {V_RLOCK, 0, HOSTACCESS_TABLE, 0, "mach_id", MR_DEADLOCK},
785 {V_RLOCK, 0, HOSTALIAS_TABLE, 0, "mach_id", MR_DEADLOCK},
786 {V_LOCK, 0, MCMAP_TABLE, 0, "mach_id", MR_DEADLOCK},
787 {V_RLOCK, 0, PRINTCAP_TABLE, 0, "mach_id", MR_DEADLOCK},
788 {V_RLOCK, 0, PALLADIUM_TABLE, 0, "mach_id", MR_DEADLOCK},
789 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
792 static struct validate dhst_validate = {
804 static char *ghal_fields[] = {
805 "alias", "canonical_hostname",
806 "alias", "canonical_hostname"
809 static struct valobj ghal_valobj[] = {
814 static struct validate ghal_validate = {
826 static struct valobj ahal_valobj[] = {
827 {V_CHAR, 0, HOSTALIAS_TABLE, "name"},
829 {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
832 static struct validate ahal_validate = {
844 static struct valobj dhal_valobj[] = {
846 {V_LOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
847 {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
850 static struct validate dhal_validate = {
854 "name = '%s' AND mach_id = %d",
862 static char *gsnt_fields[] = {
864 "name", "description", "address", "mask", "low", "high", "prefix", "ace_type", "ace_name",
865 "modby", "modby", "modwith"
868 static struct valobj gsnt_valobj[] = {
869 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
870 {V_RLOCK, 0, SUBNET_TABLE, 0, "snet_id", MR_DEADLOCK},
871 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
875 static struct validate gsnt_validate = {
887 static char *asnt_fields[] = {
888 "name", "description", "address", "mask", "low", "high", "prefix", "ace_type", "ace_name",
891 static struct valobj asnt_valobj[] = {
892 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
893 {V_LOCK, 0, SUBNET_TABLE, 0, "snet_id", MR_DEADLOCK},
894 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
895 {V_CHAR, 0, SUBNET_TABLE, "name"},
896 {V_LEN, 1, SUBNET_TABLE, "description"},
901 {V_LEN, 6, SUBNET_TABLE, "prefix"},
902 {V_TYPE, 7, 0, "ace_type", 0, MR_ACE},
903 {V_TYPEDATA, 8, 0, 0, 0, MR_ACE},
906 static struct validate asnt_validate =
911 "name = UPPER('%s')",
916 set_uppercase_modtime,
919 static char *usnt_fields[] = {
921 "newname", "description", "address", "mask", "low", "high", "prefix", "ace_type", "ace_name",
924 static struct valobj usnt_valobj[] = {
925 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
926 {V_LOCK, 0, SUBNET_TABLE, 0, "snet_id", MR_DEADLOCK},
927 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
928 {V_ID, 0, SUBNET_TABLE, "name", "snet_id", MR_NO_MATCH},
929 {V_RENAME, 1, SUBNET_TABLE, "name", "snet_id", MR_NOT_UNIQUE},
930 {V_LEN, 2, SUBNET_TABLE, "description"},
935 {V_LEN, 7, SUBNET_TABLE, "prefix"},
936 {V_TYPE, 8, 0, "ace_type", 0, MR_ACE},
937 {V_TYPEDATA, 9, 0, 0, 0, MR_ACE},
940 static struct validate usnt_validate =
953 static char *dsnt_fields[] = {
957 static struct valobj dsnt_valobj[] = {
958 {V_RLOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
959 {V_LOCK, 0, SUBNET_TABLE, 0, "snet_id", MR_DEADLOCK},
960 {V_ID, 0, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
963 static struct validate dsnt_validate = {
975 static char *gclu_fields[] = {
977 "name", "description", "location", "modby", "modby", "modwith",
980 static char *aclu_fields[] = {
981 "name", "description", "location",
984 static struct valobj aclu_valobj[] = {
985 {V_LOCK, 0, CLUSTERS_TABLE, 0, "clu_id", MR_DEADLOCK},
986 {V_CHAR, 0, CLUSTERS_TABLE, "name"},
987 {V_LEN, 1, CLUSTERS_TABLE, "description"},
988 {V_LEN, 2, CLUSTERS_TABLE, "location"},
991 static struct validate aclu_validate =
1004 static char *uclu_fields[] = {
1006 "newname", "description", "location",
1009 static struct valobj uclu_valobj[] = {
1010 {V_LOCK, 0, CLUSTERS_TABLE, 0, "clu_id", MR_DEADLOCK},
1011 {V_ID, 0, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
1012 {V_RENAME, 1, CLUSTERS_TABLE, "name", "clu_id", MR_NOT_UNIQUE},
1013 {V_LEN, 2, CLUSTERS_TABLE, "description"},
1014 {V_LEN, 3, CLUSTERS_TABLE, "location"},
1017 static struct validate uclu_validate = {
1029 static char *dclu_fields[] = {
1033 static struct validate dclu_validate = {
1045 static char *gmcm_fields[] = {
1046 "machine", "cluster",
1047 "machine", "cluster",
1050 static struct valobj gmcm_valobj[] =
1056 static struct validate gmcm_validate = { gmcm_valobj, 2 };
1058 static struct valobj amtc_valobj[] = /* ADD_MACHINE_TO_CLUSTER */
1059 { /* DELETE_MACHINE_FROM_CLUSTER */
1060 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1061 {V_ID, 1, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
1064 static struct validate amtc_validate = /* for amtc and dmfc */
1069 "mach_id = %d and clu_id = %d",
1074 set_mach_modtime_by_id,
1077 static char *gcld_fields[] = {
1078 "cluster", "serv_label",
1079 "cluster", "serv_label", "serv_cluster",
1082 static char *acld_fields[] = {
1083 "cluster", "serv_label", "serv_cluster",
1086 static struct valobj acld_valobj[] =
1088 {V_ID, 0, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
1089 {V_CHAR, 1, SVC_TABLE, "serv_label"},
1090 {V_CHAR, 2, SVC_TABLE, "serv_cluster"}
1093 static struct validate acld_validate =
1098 "clu_id = %d AND serv_label = '%s' AND serv_cluster = '%s'",
1103 set_cluster_modtime_by_id,
1106 static struct valobj dcld_valobj[] =
1108 {V_ID, 0, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
1111 static struct validate dcld_validate =
1116 "clu_id = %d AND serv_label = '%s' AND serv_cluster = '%s'",
1121 set_cluster_modtime_by_id,
1124 static char *glin_fields[] = {
1126 "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
1127 "ace_type", "ace_name", "description", "modby", "modby", "modwith",
1130 static struct validate glin_validate = {
1137 access_vis_list_by_name,
1142 static char *alis_fields[] = {
1143 "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
1144 "ace_type", "ace_name", "description",
1147 static struct valobj alis_valobj[] = {
1148 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1149 {V_LOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1150 {V_CHAR, 0, LIST_TABLE, "name"},
1157 {V_TYPE, 7, 0, "ace_type", 0, MR_ACE},
1158 {V_TYPEDATA, 8, 0, 0, "list_id", MR_ACE},
1159 {V_LEN, 9, LIST_TABLE, "description"},
1162 static struct validate alis_validate = {
1174 static char *ulis_fields[] = {
1176 "newname", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
1177 "ace_type", "ace_name", "description",
1180 static struct valobj ulis_valobj[] = {
1181 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1182 {V_LOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1183 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
1184 {V_RENAME, 1, LIST_TABLE, "name", "list_id", MR_NOT_UNIQUE},
1191 {V_TYPE, 8, 0, "ace_type", 0, MR_ACE},
1192 {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
1193 {V_LEN, 10, LIST_TABLE, "description"},
1196 static struct validate ulis_validate = {
1208 static char *dlis_fields[] = {
1212 static struct valobj dlis_valobj[] = {
1213 {V_RLOCK, 0, CAPACLS_TABLE, 0, "list_id", MR_DEADLOCK},
1214 {V_RLOCK, 0, IMEMBERS_TABLE, 0, "list_id", MR_DEADLOCK},
1215 {V_RLOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1216 {V_LOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1217 {V_RLOCK, 0, QUOTA_TABLE, 0, "filsys_id", MR_DEADLOCK},
1218 {V_RLOCK, 0, ZEPHYR_TABLE, 0, "xmt_id", MR_DEADLOCK},
1219 {V_RLOCK, 0, HOSTACCESS_TABLE, 0, "mach_id", MR_DEADLOCK},
1220 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST}
1223 static struct validate dlis_validate = {
1235 static char *amtl_fields[] = {
1236 "list_name", "member_type", "member_name",
1239 static struct valobj amtl_valobj[] = {
1240 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1241 {V_LOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1242 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
1243 {V_TYPE, 1, 0, "member", 0, MR_TYPE},
1244 {V_TYPEDATA, 2, 0, 0, 0, MR_NO_MATCH},
1247 static struct validate amtl_validate =
1260 static struct validate dmfl_validate =
1270 delete_member_from_list,
1273 static char *gaus_fields[] = {
1274 "ace_type", "ace_name",
1275 "use_type", "use_name",
1278 static struct valobj gaus_valobj[] = {
1279 {V_RLOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1280 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1281 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1282 {V_RLOCK, 0, ZEPHYR_TABLE, 0, "xmt_id", MR_DEADLOCK},
1283 {V_RLOCK, 0, HOSTACCESS_TABLE, 0, "mach_id", MR_DEADLOCK},
1284 {V_TYPE, 0, 0, "gaus", 0, MR_TYPE},
1285 {V_TYPEDATA, 1, 0, 0, 0, MR_NO_MATCH},
1288 static struct validate gaus_validate = {
1300 static char *qgli_fields[] = {
1301 "active", "publicflg", "hidden", "maillist", "grouplist",
1305 static struct valobj qgli_valobj[] = {
1306 {V_TYPE, 0, 0, "boolean", 0, MR_TYPE},
1307 {V_TYPE, 1, 0, "boolean", 0, MR_TYPE},
1308 {V_TYPE, 2, 0, "boolean", 0, MR_TYPE},
1309 {V_TYPE, 3, 0, "boolean", 0, MR_TYPE},
1310 {V_TYPE, 4, 0, "boolean", 0, MR_TYPE},
1313 static struct validate qgli_validate = {
1322 qualified_get_lists,
1325 static char *gmol_fields[] = {
1327 "member_type", "member_name",
1330 static struct valobj gmol_valobj[] = {
1331 {V_LOCK, 0, IMEMBERS_TABLE, 0, "list_id", MR_DEADLOCK},
1332 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1333 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
1336 static struct validate gmol_validate = {
1343 access_visible_list,
1345 get_members_of_list,
1348 static struct validate geml_validate = {
1355 access_visible_list,
1357 get_end_members_of_list,
1360 static char *glom_fields[] = {
1361 "member_type", "member_name",
1362 "list_name", "active", "publicflg", "hidden", "maillist", "grouplist",
1365 static struct valobj glom_valobj[] = {
1366 {V_LOCK, 0, IMEMBERS_TABLE, 0, "list_id", MR_DEADLOCK},
1367 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1368 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1369 {V_TYPE, 0, 0, "rmember", 0, MR_TYPE},
1370 {V_TYPEDATA, 1, 0, 0, 0, MR_NO_MATCH},
1373 static struct validate glom_validate = {
1382 get_lists_of_member,
1385 static char *cmol_fields[] = {
1390 static struct validate cmol_validate = {
1397 access_visible_list,
1399 count_members_of_list,
1402 static char *gsin_fields[] = {
1404 "service", "update_int", "target_file", "script", "dfgen", "dfcheck",
1405 "type", "enable", "inprogress", "harderror", "errmsg",
1406 "ace_type", "ace_name", "modby", "modby", "modwith",
1409 static struct valobj gsin_valobj[] =
1411 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1412 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1416 static struct validate gsin_validate =
1429 static char *qgsv_fields[] = {
1430 "enable", "inprogress", "harderror",
1434 static struct valobj qgsv_valobj[] = {
1435 {V_TYPE, 0, 0, "boolean", 0, MR_TYPE},
1436 {V_TYPE, 1, 0, "boolean", 0, MR_TYPE},
1437 {V_TYPE, 2, 0, "boolean", 0, MR_TYPE},
1440 static struct validate qgsv_validate = {
1449 qualified_get_server,
1452 static char *asin_fields[] = {
1453 "service", "update_int", "target_file", "script", "type", "enable",
1454 "ace_type", "ace_name",
1457 static struct valobj asin_valobj[] = {
1458 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1459 {V_LOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
1460 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1461 {V_CHAR, 0, SERVERS_TABLE, "name"},
1463 {V_LEN, 2, SERVERS_TABLE, "target_file"},
1464 {V_LEN, 3, SERVERS_TABLE, "script"},
1465 {V_TYPE, 4, 0, "service", 0, MR_TYPE},
1467 {V_TYPE, 6, 0, "ace_type", 0, MR_ACE},
1468 {V_TYPEDATA, 7, 0, 0, 0, MR_ACE},
1471 static struct validate asin_validate = /* for asin, usin */
1476 "name = UPPER('%s')",
1481 set_uppercase_modtime,
1484 static struct validate rsve_validate = {
1488 "name = UPPER('%s')",
1493 set_uppercase_modtime,
1496 static char *ssif_fields[] = {
1497 "service", "dfgen", "dfcheck", "inprogress", "harderror", "errmsg",
1500 static struct valobj ssif_valobj[] = {
1501 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1502 {V_LOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
1503 {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},
1600 {V_LEN, 5, SERVERHOSTS_TABLE, "value3"},
1603 static struct validate ashi_validate = /* ashi & ushi */
1608 "service = UPPER('%s') AND mach_id = %d",
1613 set_serverhost_modtime,
1616 static struct validate rshe_validate =
1621 "service = UPPER('%s') AND mach_id = %d",
1626 set_serverhost_modtime,
1629 static struct validate ssho_validate =
1634 "service = UPPER('%s') AND mach_id = %d",
1642 static char *sshi_fields[] = {
1643 "service", "machine", "override", "success", "inprogress",
1644 "hosterror", "errmsg", "ltt", "lts",
1647 static struct valobj sshi_valobj[] = {
1648 {V_RLOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
1649 {V_NAME, 0, SERVERS_TABLE, "name", 0, MR_SERVICE},
1650 {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1655 {V_LEN, 6, SERVERHOSTS_TABLE, "hosterrmsg"},
1660 static struct validate sshi_validate =
1673 static char *dshi_fields[] = {
1674 "service", "machine",
1677 static struct validate dshi_validate =
1682 "service = UPPER('%s') AND mach_id = %d",
1690 static char *gslo_fields[] = {
1692 "server", "machine",
1695 static char *gfsl_fields[] = {
1697 "label", "type", "machine", "name", "mount", "access", "comments", "owner", "owners",
1698 "create", "lockertype", "modby", "modby", "modwith",
1701 static char *gfsm_fields[] = {
1703 "label", "type", "machine", "name", "mount", "access", "comments", "owner", "owners",
1704 "create", "lockertype", "modby", "modby", "modwith",
1707 static struct valobj gfsm_valobj[] = {
1708 {V_RLOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1709 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1712 static struct validate gfsm_validate = {
1724 static char *gfsn_fields[] = {
1725 "machine", "parition",
1726 "label", "type", "machine", "name", "mount", "access", "comments", "owner", "owners",
1727 "create", "lockertype", "modby", "modby", "modwith",
1730 static struct valobj gfsn_valobj[] =
1732 {V_RLOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1733 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1737 static struct validate gfsn_validate = {
1749 static char *gfsp_fields[] = {
1751 "label", "type", "machine", "name", "mount", "access", "comments", "owner", "owners",
1752 "create", "lockertype", "modby", "modby", "modwith",
1755 static char *gfsg_fields[] = {
1757 "label", "type", "machine", "name", "mount", "access", "comments", "owner", "owners",
1758 "create", "lockertype", "modby", "modby", "modwith",
1761 static struct valobj gfsg_valobj[] = {
1762 {V_RLOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1763 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST}
1766 static struct validate gfsg_validate = {
1778 static char *afil_fields[] = {
1779 "label", "type", "machine", "name", "mount", "access", "comments", "owner", "owners",
1780 "create", "lockertype",
1783 static struct valobj afil_valobj[] = {
1784 {V_LOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1785 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1786 {V_RLOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
1787 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1788 {V_CHAR, 0, FILESYS_TABLE, "label"},
1789 {V_TYPE, 1, 0, "filesys", 0, MR_FSTYPE},
1790 {V_ID, 2, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1791 {V_CHAR, 3, FILESYS_TABLE, "name"},
1792 {V_LEN, 4, FILESYS_TABLE, "mount"},
1793 {V_LEN, 5, FILESYS_TABLE, "rwaccess"},
1794 {V_LEN, 6, FILESYS_TABLE, "comments"},
1795 {V_ID, 7, USERS_TABLE, "login", "users_id", MR_USER},
1796 {V_ID, 8, LIST_TABLE, "name", "list_id", MR_LIST},
1798 {V_TYPE, 10, 0, "lockertype", 0, MR_TYPE},
1801 static struct validate afil_validate = {
1810 set_filesys_modtime,
1813 static char *ufil_fields[] = {
1814 "label", "newlabel", "type", "machine", "name", "mount", "access", "comments",
1815 "owner", "owners", "create", "lockertype",
1818 static struct valobj ufil_valobj[] = {
1819 {V_LOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1820 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
1821 {V_RLOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
1822 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
1823 {V_LOCK, 0, QUOTA_TABLE, 0, "filsys_id", MR_DEADLOCK},
1824 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
1825 {V_RENAME, 1, FILESYS_TABLE, "label", "filsys_id", MR_NOT_UNIQUE},
1826 {V_TYPE, 2, 0, "filesys", 0, MR_FSTYPE},
1827 {V_ID, 3, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1828 {V_CHAR, 4, FILESYS_TABLE, "name"},
1829 {V_LEN, 5, FILESYS_TABLE, "mount"},
1830 {V_LEN, 6, FILESYS_TABLE, "rwaccess"},
1831 {V_LEN, 7, FILESYS_TABLE, "comments"},
1832 {V_ID, 8, USERS_TABLE, "login", "users_id", MR_USER},
1833 {V_ID, 9, LIST_TABLE, "name", "list_id", MR_LIST},
1835 {V_TYPE, 11, 0, "lockertype", 0, MR_TYPE},
1838 static struct validate ufil_validate = {
1847 set_filesys_modtime,
1850 static char *dfil_fields[] = {
1854 static struct valobj dfil_valobj[] = {
1855 {V_LOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1856 {V_LOCK, 0, NFSPHYS_TABLE, 0, "nfsphys_id", MR_DEADLOCK},
1857 {V_LOCK, 0, QUOTA_TABLE, 0, "filsys_id", MR_DEADLOCK},
1858 {V_LOCK, 0, FSGROUP_TABLE, 0, "filsys_id", MR_DEADLOCK},
1859 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
1862 static struct validate dfil_validate = {
1874 static char *gfgm_fields[] = {
1875 "fsgroup", "filesys", "sortkey"
1878 static struct valobj gfgm_valobj[] = {
1879 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
1882 static struct validate gfgm_validate = {
1894 static struct valobj aftg_valobj[] = {
1895 {V_LOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
1896 {V_LOCK, 0, FSGROUP_TABLE, 0, "filsys_id", MR_DEADLOCK},
1897 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
1898 {V_ID, 1, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
1901 static struct validate aftg_validate = {
1905 "group_id = %d and filsys_id = %d",
1913 static char *ganf_fields[] = {
1914 "machine", "dir", "device", "status", "allocated", "size", "modby", "modby", "modwith",
1917 static char *gnfp_fields[] = {
1919 "machine", "dir", "device", "status", "allocated", "size", "modby", "modby", "modwith",
1922 static struct valobj gnfp_valobj[] = {
1923 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1924 {V_RLOCK, 0, NFSPHYS_TABLE, 0, "nfsphys_id", MR_DEADLOCK},
1928 static struct validate gnfp_validate = {
1940 static struct valobj anfp_valobj[] = {
1941 {V_RLOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
1942 {V_LOCK, 0, NFSPHYS_TABLE, 0, "nfsphys_id", MR_DEADLOCK},
1943 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1944 {V_CHAR, 1, NFSPHYS_TABLE, "dir"},
1945 {V_LEN, 2, NFSPHYS_TABLE, "device"},
1951 static struct validate anfp_validate = {
1955 "mach_id = %d and dir = '%s'",
1960 set_nfsphys_modtime,
1963 static struct validate unfp_validate = {
1967 "mach_id = %d and dir = '%s'",
1972 set_nfsphys_modtime,
1975 static char *ajnf_fields[] = {
1976 "machine", "dir", "adjustment",
1979 static struct valobj ajnf_valobj[] = {
1980 {V_RLOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
1981 {V_LOCK, 0, NFSPHYS_TABLE, 0, "nfsphys_id", MR_DEADLOCK},
1982 {V_ID, 0, MACHINE_TABLE, NAME, "mach_id", MR_MACHINE},
1983 {V_CHAR, 1, NFSPHYS_TABLE, "dir"},
1987 static struct validate ajnf_validate = {
1991 "mach_id = %d and dir = '%s'",
1996 set_nfsphys_modtime,
1999 static char *dnfp_fields[] = {
2003 static struct valobj dnfp_valobj[] = {
2004 {V_RLOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
2005 {V_LOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
2006 {V_LOCK, 0, NFSPHYS_TABLE, 0, "nfsphys_id", MR_DEADLOCK},
2007 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2010 static struct validate dnfp_validate = {
2014 "mach_id = %d and dir = '%s'",
2019 set_nfsphys_modtime,
2022 static char *gqot_fields[] = {
2023 "filesys", "type", "name",
2024 "filesys", "type", "name", "quota", "dir", "machine", "modby", "modby", "modwith",
2027 static struct valobj gqot_valobj[] = {
2028 {V_RLOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
2029 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
2030 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
2031 {V_RLOCK, 0, NFSPHYS_TABLE, 0, "nfsphys_id", MR_DEADLOCK},
2032 {V_RLOCK, 0, QUOTA_TABLE, 0, "filsys_id", MR_DEADLOCK},
2034 {V_TYPE, 1, 0, "quota_type", 0, MR_TYPE},
2035 {V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
2038 static struct validate gqot_validate = {
2050 static char *gqbf_fields[] = {
2052 "filesys", "type", "name", "quota", "dir", "machine", "modby", "modby", "modwith",
2055 static struct validate gqbf_validate = {
2067 static char *aqot_fields[] = {
2068 "filesys", "type", "name", "quota",
2071 static struct valobj aqot_valobj[] = {
2072 {V_LOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
2073 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
2074 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
2075 {V_LOCK, 0, NFSPHYS_TABLE, 0, "nfsphys_id", MR_DEADLOCK},
2076 {V_LOCK, 0, QUOTA_TABLE, 0, "filsys_id", MR_DEADLOCK},
2077 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
2078 {V_TYPE, 1, 0, "quota_type", 0, MR_TYPE},
2079 {V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
2083 static struct validate aqot_validate = {
2087 "filsys_id = %d and type = '%s' and entity_id = %d",
2095 static struct validate uqot_validate = {
2099 "filsys_id = %d AND type = '%s' AND entity_id = %d",
2107 static struct validate dqot_validate = {
2111 "filsys_id = %d AND type = '%s' AND entity_id = %d",
2119 static char *gnfq_fields[] = {
2121 "filesys", "login", "quota", "dir", "machine", "modby", "modby", "modwith",
2124 static struct validate gnfq_validate = {
2136 static char *gnqp_fields[] = {
2138 "filesys", "login", "quota", "dir", "machine", "modby", "modby", "modwith",
2141 static struct valobj gnqp_valobj[] = {
2142 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2146 static struct validate gnqp_validate = { gnqp_valobj, 2, };
2148 static char *anfq_fields[] = {
2149 "filesys", "login", "quota",
2152 static struct valobj anfq_valobj[] = {
2153 {V_LOCK, 0, FILESYS_TABLE, 0, "filsys_id", MR_DEADLOCK},
2154 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
2155 {V_ID, 1, USERS_TABLE, "login", "users_id", MR_USER},
2159 static struct validate anfq_validate = {
2163 "filsys_id = %d AND type = 'USER' AND entity_id = %d",
2171 static struct validate unfq_validate = {
2175 "filsys_id = %d AND type = 'USER' AND entity_id = %d",
2183 static struct validate dnfq_validate = {
2187 "filsys_id = %d AND entity_id = %d",
2195 static char *gzcl_fields[] = {
2197 "class", "xmt_type", "xmt_name", "sub_type", "sub_name",
2198 "iws_type", "iws_name", "iui_type", "iui_name", "modby", "modby", "modwith",
2201 static struct valobj gzcl_valobj[] = {
2202 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
2203 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
2204 {V_RLOCK, 0, ZEPHYR_TABLE, 0, "xmt_id", MR_DEADLOCK},
2207 static struct validate gzcl_validate = {
2219 static char *azcl_fields[] = {
2220 "class", "xmt_type", "xmt_name", "sub_type", "sub_name",
2221 "iws_type", "iws_name", "iui_type", "iui_name",
2224 static struct valobj azcl_valobj[] = {
2225 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
2226 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
2227 {V_LOCK, 0, ZEPHYR_TABLE, 0, "xmt_id", MR_DEADLOCK},
2228 {V_CHAR, 0, ZEPHYR_TABLE, "class"},
2229 {V_TYPE, 1, 0, "ace_type", 0, MR_ACE},
2230 {V_TYPEDATA, 2, 0, 0, "list_id", MR_ACE},
2231 {V_TYPE, 3, 0, "ace_type", 0, MR_ACE},
2232 {V_TYPEDATA, 4, 0, 0, "list_id", MR_ACE},
2233 {V_TYPE, 5, 0, "ace_type", 0, MR_ACE},
2234 {V_TYPEDATA, 6, 0, 0, "list_id", MR_ACE},
2235 {V_TYPE, 7, 0, "ace_type", 0, MR_ACE},
2236 {V_TYPEDATA, 8, 0, 0, "list_id", MR_ACE},
2239 static struct validate azcl_validate = {
2251 static char *uzcl_fields[] = {
2252 "class", "newclass", "xmt_type", "xmt_name", "sub_type", "sub_name",
2253 "iws_type", "iws_name", "iui_type", "iui_name",
2256 static struct valobj uzcl_valobj[] = {
2257 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
2258 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
2259 {V_LOCK, 0, ZEPHYR_TABLE, 0, "xmt_id", MR_DEADLOCK},
2260 {V_RENAME, 1, ZEPHYR_TABLE, "class", 0, MR_NOT_UNIQUE},
2261 {V_TYPE, 2, 0, "ace_type", 0, MR_ACE},
2262 {V_TYPEDATA, 3, 0, 0, "list_id", MR_ACE},
2263 {V_TYPE, 4, 0, "ace_type", 0, MR_ACE},
2264 {V_TYPEDATA, 5, 0, 0, "list_id", MR_ACE},
2265 {V_TYPE, 6, 0, "ace_type", 0, MR_ACE},
2266 {V_TYPEDATA, 7, 0, 0, "list_id", MR_ACE},
2267 {V_TYPE, 8, 0, "ace_type", 0, MR_ACE},
2268 {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
2271 static struct validate uzcl_validate = {
2283 static struct validate dzcl_validate = {
2295 static char *gsha_fields[] = {
2297 "machine", "ace_type", "ace_name", "modby", "modby", "modwith",
2300 static struct validate gsha_validate =
2313 static char *asha_fields[] = {
2314 "machine", "ace_type", "ace_name",
2317 static struct valobj asha_valobj[] = {
2318 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
2319 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2320 {V_RLOCK, 0, LIST_TABLE, 0, "list_id", MR_DEADLOCK},
2321 {V_TYPE, 1, 0, "ace_type", 0, MR_ACE},
2322 {V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
2325 static struct validate asha_validate =
2338 static char *gsvc_fields[] = {
2340 "service", "protocol", "port", "description", "modby", "modby", "modwith",
2343 static char *asvc_fields[] = {
2344 "service", "protocol", "port", "description",
2347 static struct valobj asvc_valobj[] = {
2348 {V_CHAR, 0, SERVICES_TABLE, "name"},
2349 {V_CHAR, 1, SERVICES_TABLE, "protocol"},
2351 {V_CHAR, 3, SERVICES_TABLE, "description"},
2354 static struct validate asvc_validate = {
2366 static char *gpce_fields[] = {
2368 "printer", "spooling_host", "spool_directory", "rprinter",
2369 "quotaserver", "authenticate", "price", "comments",
2370 "modby", "modby", "modwith",
2373 static struct valobj gpce_valobj[] = {
2374 {V_RLOCK, 0, USERS_TABLE, 0, "users_id", MR_DEADLOCK},
2375 {V_RLOCK, 0, MACHINE_TABLE, 0, "mach_id", MR_DEADLOCK},
2376 {V_RLOCK, 0, PRINTCAP_TABLE, 0, "mach_id", MR_DEADLOCK},
2380 static struct validate gpce_validate = {
2392 static char *apce_fields[] = {
2393 "printer", "spooling_host", "spool_directory", "rprinter",
2394 "quotaserver", "authenticate", "price", "comments",
2395 "modby", "modby", "modwith",
2398 static struct valobj apce_valobj[] = {
2399 {V_CHAR, 0, PRINTCAP_TABLE, "name"},
2400 {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2401 {V_LEN, 2, PRINTCAP_TABLE, "dir"},
2402 {V_LEN, 3, PRINTCAP_TABLE, "rp"},
2403 {V_ID, 4, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2406 {V_CHAR, 7, PRINTCAP_TABLE, "comments"},
2409 static struct validate apce_validate = {
2421 static struct validate dpce_validate = {
2433 static char *gpcp_fields[] = {
2435 "printer", "spooling_host", "spool_directory", "rprinter", "comments",
2436 "modby", "modby", "modwith",
2439 static char *gpdm_fields[] = {
2441 "name", "rpcnum", "host", "modby", "modby", "modwith",
2444 static char *apdm_fields[] = {
2445 "name", "rpcnum", "host"
2448 static struct valobj apdm_valobj[] = {
2449 {V_CHAR, 0, PALLADIUM_TABLE, "name"},
2451 {V_ID, 2, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2454 static struct validate apdm_validate = {
2466 static struct validate dpdm_validate = {
2478 static char *gali_fields[] = {
2479 "name", "type", "trans",
2480 "name", "type", "trans",
2483 static char *aali_fields[] = {
2484 "name", "type", "trans",
2487 static struct valobj aali_valobj[] = {
2488 {V_CHAR, 0, ALIAS_TABLE, "name"},
2489 {V_TYPE, 1, 0, "alias", 0, MR_TYPE},
2490 {V_CHAR, 2, ALIAS_TABLE, "trans"},
2493 static struct validate aali_validate = {
2497 "name = '%s' and type = '%s' and trans = '%s'",
2505 static struct validate dali_validate = /* DELETE_ALIAS */
2510 "name = '%s' and type = '%s' and trans = '%s'",
2518 static char *gval_fields[] = {
2522 static struct valobj gval_valobj[] = {
2523 {V_NAME, 0, NUMVALUES_TABLE, "name", 0, MR_NO_MATCH},
2526 static struct validate gval_validate = {
2538 static char *aval_fields[] = {
2542 static struct valobj aval_valobj[] = {
2543 {V_CHAR, 0, NUMVALUES_TABLE, "name"},
2547 static struct validate aval_validate = /* for aval, uval, and dval */
2560 static char *dval_fields[] = {
2564 static char *gats_fields[] = {
2565 "table_name", "appends", "updates", "deletes", "modby", "modby", "modwith",
2568 static char *_sdl_fields[] = {
2572 static struct validate _sdl_validate =
2587 /* Generalized Query Definitions */
2589 /* Note: For any query which uses prefetch_value, the vcnt should be
2590 * one less than the number of %-format specifiers in the tlist.
2593 struct query Queries2[] = {
2595 /* Q_GALO - GET_ALL_LOGINS */
2601 "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle FROM users u",
2611 /* Q_GAAL - GET_ALL_ACTIVE_LOGINS */
2612 "get_all_active_logins",
2617 "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle FROM users u",
2627 /* Q_GUAL - GET_USER_ACCOUNT_BY_LOGIN */
2628 "get_user_account_by_login",
2633 "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",
2636 "u.login LIKE '%s' ESCAPE '*' AND u.users_id != 0 AND u.comments = str.string_id",
2643 /* Q_GUAU - GET_USER_ACCOUNT_BY_UID */
2644 "get_user_account_by_uid",
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.unix_uid = %s AND u.users_id != 0 AND u.comments = str.string_id",
2659 /* Q_GUAN - GET_USER_ACCOUNT_BY_NAME */
2660 "get_user_account_by_name",
2665 "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",
2668 "u.first LIKE '%s' ESCAPE '*' AND u.last LIKE '%s' ESCAPE '*' AND u.users_id != 0 and u.comments = str.string_id",
2675 /* Q_GUAC - GET_USER_ACCOUNT_BY_CLASS */
2676 "get_user_account_by_class",
2681 "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",
2684 "u.type = UPPER('%s') AND u.users_id != 0 AND u.comments = str.string_id",
2691 /* Q_GUAM - GET_USER_ACCOUNT_BY_MITID */
2692 "get_user_account_by_id",
2697 "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",
2700 "u.clearid LIKE '%s' ESCAPE '*' AND u.users_id != 0 AND u.comments = str.string_id",
2707 /* Q_GUBL - GET_USER_BY_LOGIN */
2708 "get_user_by_login",
2713 "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",
2716 "u.login LIKE '%s' ESCAPE '*' AND u.users_id != 0",
2723 /* Q_GUBU - GET_USER_BY_UID */
2729 "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",
2732 "u.unix_uid = %s AND u.users_id != 0",
2739 /* Q_GUBN - GET_USER_BY_NAME */
2745 "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",
2748 "u.first LIKE '%s' ESCAPE '*' AND u.last LIKE '%s' ESCAPE '*' AND u.users_id != 0",
2755 /* Q_GUBC - GET_USER_BY_CLASS */
2756 "get_user_by_class",
2761 "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",
2764 "u.type = UPPER('%s') AND u.users_id != 0",
2771 /* Q_GUBM - GET_USER_BY_MITID */
2772 "get_user_by_mitid",
2777 "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",
2780 "u.clearid LIKE '%s' ESCAPE '*' AND u.users_id != 0",
2787 /* Q_GUDF - GET_USER_DIRECTORY_FLAGS */
2788 "get_user_directory_flags",
2793 "u.dirsuppress, u.dirremote FROM users u",
2803 /* Q_AUAC - ADD_USER_ACCOUNT */ /* uses prefetch_value() for users_id */
2809 "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 */
2819 /* Q_AUSR - ADD_USER */ /* uses prefetch_value() for users_id */
2825 "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)",
2835 /* Q_RUSR - REGISTER_USER */
2851 /* Q_UUAC - UPDATE_USER_ACCOUNT */
2852 "update_user_account",
2857 "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 */
2867 /* Q_UUSR - UPDATE_USER */
2873 "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'",
2883 /* Q_UUSH - UPDATE_USER_SHELL */
2884 "update_user_shell",
2889 "users SET shell = '%s'",
2899 /* Q_UUST - UPDATE_USER_STATUS */
2900 "update_user_status",
2905 "users SET status = %s",
2915 /* Q_UUSS - UPDATE_USER_SECURITY_STATUS */
2916 "update_user_security_status",
2921 "users SET secure = %s",
2931 /* Q_UUDF - UPDATE_USER_DIRECTORY_FLAGS */
2932 "update_user_directory_flags",
2937 "users SET dirsuppress = %s, dirremote = %s",
2947 /* Q_DUSR - DELETE_USER */
2963 /* Q_DUBU - DELETE_USER_BY_UID */
2964 "delete_user_by_uid",
2979 /* Q_GKUM - GET_KERBEROS_USER_MAP */
2980 "get_kerberos_user_map",
2985 "u.login, str.string FROM krbmap km, users u, strings str",
2988 "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",
2990 "u.login, str.string",
2995 /* Q_AKUM - ADD_KERBEROS_USER_MAP */
2996 "add_kerberos_user_map",
3001 "INTO krbmap (users_id, string_id) VALUES (%d, %d)",
3011 /* Q_DKUM - DELETE_KERBEROS_USER_MAP */
3012 "delete_kerberos_user_map",
3020 "users_id = %d AND string_id = %d",
3027 /* Q_GFBL - GET_FINGER_BY_LOGIN */
3028 "get_finger_by_login",
3033 "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",
3043 /* Q_UFBL - UPDATE_FINGER_BY_LOGIN */
3044 "update_finger_by_login",
3049 "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))",
3059 /* Q_GPOB - GET_POBOX */
3065 "login, potype, pop_id || ':' || box_id, TO_CHAR(pmodtime, 'DD-mon-YYYY HH24:MI:SS'), pmodby, pmodwith FROM users",
3075 /* Q_GAPO - GET_ALL_POBOXES */
3081 "login, potype, pop_id || ':' || box_id FROM users",
3091 /* Q_GPOP - GET_POBOXES_POP */
3097 "login, potype, pop_id || ':' || box_id FROM users",
3107 /* Q_GPOF - GET_POBOXES_SMTP */
3113 "login, potype, pop_id || ':' || box_id FROM users",
3123 /* Q_SPOB - SET_POBOX */
3139 /* Q_SPOP - SET_POBOX_POP */
3145 "users SET potype = 'POP'",
3155 /* Q_DPOB - DELETE_POBOX */
3161 "users SET potype = 'NONE'",
3171 /* Q_GHST - GET_HOST */
3177 "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",
3180 "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",
3187 /* Q_AHST - ADD_HOST */ /* uses prefetch_value() for mach_id */
3193 "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)",
3203 /* Q_UHST - UPDATE_HOST */
3209 "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",
3219 /* Q_DHST - DELETE_HOST */
3235 /* Q_GMAC - GET_MACHINE */
3241 "name, vendor, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM machine",
3244 "name LIKE '%s' ESCAPE '*' AND mach_id != 0",
3247 &VDupwild_fix_modby,
3251 /* Q_GHAL - GET_HOSTALIAS */
3257 "a.name, m.name FROM hostalias a, machine m",
3260 "m.mach_id = a.mach_id and a.name LIKE '%s' ESCAPE '*' AND m.name LIKE '%s' ESCAPE '*'",
3267 /* Q_AHAL - ADD_HOSTALIAS */
3273 "INTO hostalias (name, mach_id) VALUES (UPPER('%s'), %d)",
3283 /* Q_DHAL - DELETE_HOSTALIAS */
3292 "name = UPPER('%s') AND mach_id = %d",
3299 /* Q_GSNT - GET_SUBNET */
3305 "name, description, saddr, mask, low, high, prefix, owner_type, owner_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM subnet",
3308 "name LIKE '%s' ESCAPE '*' and snet_id != 0",
3315 /* Q_ASNT - ADD_SUBNET */
3321 "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)",
3331 /* Q_USNT - UPDATE_SUBNET */
3337 "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",
3347 /* Q_DSNT - DELETE_SUBNET */
3363 /* Q_GCLU - GET_CLUSTER */
3369 "name, description, location, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM clusters",
3372 "name LIKE '%s' ESCAPE '*' AND clu_id != 0",
3379 /* Q_ACLU - ADD_CLUSTER */ /* uses prefetch_value() for clu_id */
3385 "INTO clusters (name, description, location, clu_id) VALUES ('%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s)",
3395 /* Q_UCLU - UPDATE_CLUSTER */
3401 "clusters SET name = '%s', description = NVL('%s', CHR(0)), location = NVL('%s', CHR(0))",
3411 /* Q_DCLU - DELETE_CLUSTER */
3427 /* Q_GMCM - GET_MACHINE_TO_CLUSTER_MAP */
3428 "get_machine_to_cluster_map",
3433 "m.name, c.name FROM machine m, clusters c, mcmap mcm",
3436 "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",
3443 /* Q_AMTC - ADD_MACHINE_TO_CLUSTER */
3444 "add_machine_to_cluster",
3449 "INTO mcmap (mach_id, clu_id) VALUES (%d, %d)",
3459 /* Q_DMFC - DELETE_MACHINE_FROM_CLUSTER */
3460 "delete_machine_from_cluster",
3468 "mach_id = %d AND clu_id = %d",
3475 /* Q_GCLD - GET_CLUSTER_DATA */
3481 "c.name, svc.serv_label, svc.serv_cluster FROM svc svc, clusters c",
3484 "c.clu_id = svc.clu_id AND c.name LIKE '%s' ESCAPE '*' AND svc.serv_label LIKE '%s' ESCAPE '*'",
3486 "c.name, svc.serv_label",
3491 /* Q_ACLD - ADD_CLUSTER_DATA */
3497 "INTO svc (clu_id, serv_label, serv_cluster) VALUES (%d, '%s', '%s')",
3507 /* Q_DCLD - DELETE_CLUSTER_DATA */
3508 "delete_cluster_data",
3516 "clu_id = %d AND serv_label = '%s' AND serv_cluster = '%s'",
3523 /* Q_GLIN - GET_LIST_INFO */
3539 /* Q_EXLN - EXPAND_LIST_NAMES */
3540 "expand_list_names",
3548 "name LIKE '%s' ESCAPE '*' AND list_id != 0",
3555 /* Q_ALIS - ADD_LIST */ /* uses prefetch_value() for list_id */
3561 "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)",
3571 /* Q_ULIS - UPDATE_LIST */
3577 "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))",
3587 /* Q_DLIS - DELETE_LIST */
3603 /* Q_AMTL - ADD_MEMBER_TO_LIST */
3604 "add_member_to_list",
3619 /* Q_DMFL - DELETE_MEMBER_FROM_LIST */
3620 "delete_member_from_list",
3635 /* Q_GAUS - GET_ACE_USE */
3651 /* Q_QGLI - QUALIFIED_GET_LISTS */
3652 "qualified_get_lists",
3667 /* Q_GMOL - GET_MEMBERS_OF_LIST */
3668 "get_members_of_list",
3683 /* Q_GEML - GET_END_MEMBERS_OF_LIST */
3684 "get_end_members_of_list",
3699 /* Q_GLOM - GET_LISTS_OF_MEMBER */
3700 "get_lists_of_member",
3715 /* Q_CMOL - COUNT_MEMBERS_OF_LIST */
3716 "count_members_of_list",
3731 /* Q_GSIN - GET_SERVER_INFO */
3737 "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",
3740 "name LIKE '%s' ESCAPE '*'",
3747 /* Q_QGSV - QUALIFIED_GET_SERVER */
3748 "qualified_get_server",
3763 /* Q_ASIN - ADD_SERVER_INFO */
3769 "INTO servers (name, update_int, target_file, script, type, enable, acl_type, acl_id) VALUES (UPPER('%s'), %s, '%s', '%s', '%s', %s, '%s', %d)",
3779 /* Q_USIN - UPDATE_SERVER_INFO */
3780 "update_server_info",
3785 "servers SET update_int = %s, target_file = '%s', script = '%s', type = '%s', enable = %s, acl_type = '%s', acl_id = %d",
3788 "name = UPPER('%s')",
3795 /* Q_RSVE - RESET_SERVER_ERROR */
3796 "reset_server_error",
3801 "servers SET harderror = 0, dfcheck = dfgen",
3804 "name = UPPER('%s')",
3811 /* Q_SSIF - SET_SERVER_INTERNAL_FLAGS */
3812 "set_server_internal_flags",
3817 "servers SET dfgen = %s, dfcheck = %s, inprogress = %s, harderror = %s, errmsg = NVL('%s', CHR(0))",
3820 "name = UPPER('%s')",
3827 /* Q_DSIN - DELETE_SERVER_INFO */
3828 "delete_server_info",
3836 "name = UPPER('%s')",
3843 /* Q_GSHI - GET_SERVER_HOST_INFO */
3844 "get_server_host_info",
3849 "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",
3852 "sh.service LIKE '%s' ESCAPE '*' AND m.name LIKE '%s' ESCAPE '*' AND m.mach_id = sh.mach_id",
3854 "sh.service, m.name",
3859 /* Q_QGSH - QUALIFIED_GET_SERVER_HOST */
3860 "qualified_get_server_host",
3875 /* Q_ASHI - ADD_SERVER_HOST_INFO */
3876 "add_server_host_info",
3881 "INTO serverhosts (service, mach_id, enable, value1, value2, value3) VALUES (UPPER('%s'), %d, %s, %s, %s, NVL('%s', CHR(0)))",
3891 /* Q_USHI - UPDATE_SERVER_HOST_INFO */
3892 "update_server_host_info",
3897 "serverhosts SET enable = %s, value1 = %s, value2 = %s, value3 = NVL('%s', CHR(0))",
3900 "service = UPPER('%s') AND mach_id = %d",
3907 /* Q_RSHE - RESET_SERVER_HOST_ERROR */
3908 "reset_server_host_error",
3913 "serverhosts SET hosterror = 0",
3916 "service = UPPER('%s') AND mach_id = %d",
3923 /* Q_SSHO - SET_SERVER_HOST_OVERRIDE */
3924 "set_server_host_override",
3929 "serverhosts SET override = 1",
3932 "service = UPPER('%s') AND mach_id = %d",
3939 /* Q_SSHI - SET_SERVER_HOST_INTERNAL */
3940 "set_server_host_internal",
3945 "serverhosts SET override = %s, success = %s, inprogress = %s, hosterror = %s, hosterrmsg = NVL('%s', CHR(0)), ltt = %s, lts = %s",
3948 "service = UPPER('%s') AND mach_id = %d",
3955 /* Q_DSHI - DELETE_SERVER_HOST_INFO */
3956 "delete_server_host_info",
3964 "service = UPPER('%s') AND mach_id = %d",
3971 /* Q_GSLO - GET_SERVER_LOCATIONS */
3972 "get_server_locations",
3977 "sh.service, m.name FROM serverhosts sh, machine m",
3980 "sh.service LIKE '%s' ESCAPE '*' AND sh.mach_id = m.mach_id",
3982 "sh.service, m.name",
3987 /* Q_GFSL - GET_FILESYS_BY_LABEL */
3988 "get_filesys_by_label",
3993 "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",
3996 "fs.label LIKE '%s' ESCAPE '*' AND fs.mach_id = m.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id",
4003 /* Q_GFSM - GET_FILESYS_BY_MACHINE */
4004 "get_filesys_by_machine",
4009 "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",
4012 "fs.mach_id = %d AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id",
4019 /* Q_GFSN - GET_FILESYS_BY_NFSPHYS */
4020 "get_filesys_by_nfsphys",
4025 "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",
4028 "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'",
4035 /* Q_GFSG - GET_FILESYS_BY_GROUP */
4036 "get_filesys_by_group",
4041 "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",
4044 "fs.owners = %d AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id",
4051 /* Q_GFSP - GET_FILESYS_BY_PATH */
4052 "get_filesys_by_path",
4057 "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",
4060 "fs.name LIKE '%s' ESCAPE '*' AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = list_id",
4067 /* Q_AFIL - ADD_FILESYS */ /* uses prefetch_value() for filsys_id */
4073 "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)",
4083 /* Q_UFIL - UPDATE_FILESYS */
4089 "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'",
4099 /* Q_DFIL - DELETE_FILESYS */
4115 /* Q_GFGM - GET_FSGROUP_MEMBERS */
4116 "get_fsgroup_members",
4121 "fs.label, fg.key FROM fsgroup fg, filesys fs",
4124 "fg.group_id = %d AND fs.filsys_id = fg.filsys_id",
4131 /* Q_AFTG - ADD_FILESYS_TO_FSGROUP */
4132 "add_filesys_to_fsgroup",
4137 "INTO fsgroup (group_id, filsys_id, key) VALUES (%d, %d, '%s')",
4147 /* Q_RFFG - REMOVE_FILESYS_FROM_FSGROUP */
4148 "remove_filesys_from_fsgroup",
4156 "group_id = %d AND filsys_id = %d",
4163 /* Q_GANF - GET_ALL_NFSPHYS */
4169 "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",
4172 "m.mach_id = np.mach_id",
4179 /* Q_GNFP - GET_NFSPHYS */
4185 "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",
4188 "np.mach_id = %d AND np.dir LIKE '%s' ESCAPE '*' AND m.mach_id = np.mach_id",
4195 /* Q_ANFP - ADD_NFSPHYS */ /* uses prefetch_value() for nfsphys_id */
4201 "INTO nfsphys (mach_id, dir, device, status, allocated, partsize, nfsphys_id) VALUES (%d, '%s', NVL('%s', CHR(0)), %s, %s, %s, %s)",
4211 /* Q_UNFP - UPDATE_NFSPHYS */
4217 "nfsphys SET device = NVL('%s', CHR(0)), status = %s, allocated = %s, partsize = %s",
4220 "mach_id = %d AND dir = '%s'",
4227 /* Q_AJNF - ADJUST_NFSPHYS_ALLOCATION */
4228 "adjust_nfsphys_allocation",
4233 "nfsphys SET allocated = allocated + %s",
4236 "mach_id = %d AND dir = '%s'",
4243 /* Q_DNFP - DELETE_NFSPHYS */
4252 "mach_id = %d AND dir = '%s'",
4259 /* Q_GQOT - GET_QUOTA */
4265 "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",
4268 "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",
4275 /* Q_GQBF - GET_QUOTA_BY_FILESYS */
4276 "get_quota_by_filesys",
4281 "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",
4284 "fs.label LIKE '%s' ESCAPE '*' AND fs.filsys_id = q.filsys_id AND m.mach_id = fs.mach_id",
4291 /* Q_AQOT - ADD_QUOTA */ /* prefetch_filsys() gets last 1 value */
4297 "INTO quota (filsys_id, type, entity_id, quota, phys_id) VALUES ('%s', %d, %d, %s, %s)",
4307 /* Q_UQOT - UPDATE_QUOTA */
4313 "quota SET quota = %s",
4323 /* Q_DQOT - DELETE_QUOTA */
4339 /* Q_GNFQ - GET_NFS_QUOTAS */
4345 "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",
4348 "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'",
4350 "fs.label, u.login",
4355 /* Q_GNQP - GET_NFS_QUOTAS_BY_PARTITION */
4356 "get_nfs_quotas_by_partition",
4361 "fs.label, u.login, q.quota, np.dir, m.name FROM quota q, filesys fs, users u, nfsphys np, machine m",
4364 "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",
4371 /* Q_ANFQ - ADD_NFS_QUOTA */ /* prefetch_filsys() gets last 1 value */
4377 "INTO quota (type, filsys_id, entity_id, quota, phys_id ) VALUES ('USER', %d, %d, %s, %s)",
4387 /* Q_UNFQ - UPDATE_NFS_QUOTA */
4393 "quota SET quota = %s",
4403 /* Q_DNFQ - DELETE_NFS_QUOTA */
4419 /* Q_GZCL - GET_ZEPHYR_CLASS */
4425 "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",
4428 "class LIKE '%s' ESCAPE '*'",
4435 /* Q_AZCL - ADD_ZEPHYR_CLASS */
4441 "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)",
4451 /* Q_UZCL - UPDATE_ZEPHYR_CLASS */
4452 "update_zephyr_class",
4457 "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",
4467 /* Q_DZCL - DELETE_ZEPHYR_CLASS */
4468 "delete_zephyr_class",
4483 /* Q_GSHA - GET_SERVER_HOST_ACCESS */
4484 "get_server_host_access",
4489 "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",
4492 "m.name LIKE '%s' ESCAPE '*' AND ha.mach_id = m.mach_id",
4499 /* Q_ASHA - ADD_SERVER_HOST_ACCESS */
4500 "add_server_host_access",
4505 "INTO hostaccess (mach_id, acl_type, acl_id) VALUES (%d, '%s', %d)",
4515 /* Q_USHA - UPDATE_SERVER_HOST_ACCESS */
4516 "update_server_host_access",
4521 "hostaccess SET acl_type = '%s', acl_id = %d",
4531 /* Q_DSHA - DELETE_SERVER_HOST_ACCESS */
4532 "delete_server_host_access",
4547 /* Q_GSVC - GET_SERVICE */
4553 "name, protocol, port, description, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM services",
4556 "name LIKE '%s' ESCAPE '*'",
4563 /* Q_ASVC - ADD_SERVICE */
4569 "INTO services (name, protocol, port, description) VALUES ('%s', '%s', %s, NVL('%s', CHR(0)))",
4579 /* Q_DSVC - DELETE_SERVICE */
4595 /* Q_GPCE - GET_PRINTCAP_ENTRY */
4596 "get_printcap_entry",
4601 "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",
4604 "pc.name LIKE '%s' ESCAPE '*' AND m.mach_id = pc.mach_id",
4611 /* Q_APCE - ADD_PRINTCAP_ENTRY */
4612 "add_printcap_entry",
4617 "INTO printcap (name, mach_id, dir, rp, quotaserver, auth, price, comments) VALUES ('%s', %d, '%s', '%s', %d, %s, %s, NVL('%s', CHR(0)))",
4627 /* Q_DPCE - DELETE_PRINTCAP_ENTRY */
4628 "delete_printcap_entry",
4643 /* Q_GPCP - GET_PRINTCAP */
4649 "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",
4652 "pc.name LIKE '%s' ESCAPE '*' AND m.mach_id = pc.mach_id",
4659 /* Q_DPCP - DELETE_PRINTCAP */
4675 /* Q_GPDM - GET_PALLADIUM */
4681 "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",
4684 "pal.name LIKE '%s' ESCAPE '*' AND m.mach_id = pal.mach_id",
4691 /* Q_APDM - ADD_PALLADIUM */
4697 "INTO palladium (name, identifier, mach_id) VALUES ('%s', %s, %d)",
4707 /* Q_DPDM - DELETE_PALLADIUM */
4723 /* Q_GALI - GET_ALIAS */
4729 "name, type, trans FROM alias",
4732 "name LIKE '%s' ESCAPE '*' AND type LIKE '%s' ESCAPE '*' AND trans LIKE '%s' ESCAPE '*'",
4734 "type, name, trans",
4739 /* Q_AALI - ADD_ALIAS */
4745 "INTO alias (name, type, trans) VALUES ('%s', '%s', '%s')",
4755 /* Q_DALI - DELETE_ALIAS */
4764 "name = '%s' AND type = '%s' AND trans = '%s'",
4771 /* Q_GVAL - GET_VALUE */
4777 "value FROM numvalues",
4787 /* Q_AVAL - ADD_VALUE */
4793 "INTO numvalues (name, value) VALUES ('%s', %s)",
4803 /* Q_UVAL - UPDATE_VALUE */
4809 "numvalues SET value = %s",
4819 /* Q_DVAL - DELETE_VALUE */
4835 /* Q_GATS - GET_ALL_TABLE_STATS */
4836 "get_all_table_stats",
4841 "table_name, appends, updates, deletes, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS') FROM tblstats",
4851 /* Q__SDL - _SET_DEBUG_LEVEL */
4868 int QueryCount2 = (sizeof(Queries2) / sizeof(struct query));