3 * This file defines the query dispatch table
5 * Copyright (C) 1987-1998 by the Massachusetts Institute of Technology.
6 * For copying and distribution information, please see the file
10 #include <mit-copyright.h>
11 #include "mr_server.h"
17 * These are commonly used validation objects, defined here so that they
21 static struct valobj VOuser0[] = {
22 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
25 static struct valobj VOmach0[] = {
26 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
29 static struct valobj VOclu0[] = {
30 {V_ID, 0, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
33 static struct valobj VOsnet0[] = {
34 {V_ID, 0, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
37 static struct valobj VOlist0[] = {
38 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
41 static struct valobj VOfilesys0[] = {
42 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
45 static struct valobj VOcon0[] = {
46 {V_ID, 0, CONTAINERS_TABLE, "name", "cnt_id", MR_CONTAINER},
49 static struct valobj VOnum0[] = {
54 * Commonly used validation records defined here so that they may
58 static struct validate VDmach = { VOmach0, 1 };
60 static struct validate VDfix_modby = {
74 static char *galo2_fields[] = {
75 "login", "unix_uid", "shell", "last", "first", "middle",
78 static char *galo_fields[] = {
79 "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
82 static char *gual2_fields[] = {
84 "login", "unix_uid", "shell", "last", "first", "middle", "status",
85 "clearid", "class", "comments", "signature", "secure",
86 "modtime", "modby", "modwith",
89 static char *gual_fields[] = {
91 "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
92 "status", "clearid", "class", "comments", "signature", "secure",
93 "modtime", "modby", "modwith", "created", "creator",
96 static char *gubl2_fields[] = {
98 "login", "unix_uid", "shell", "last", "first", "middle", "status",
99 "clearid", "class", "modtime", "modby", "modwith",
102 static char *gubl_fields[] = {
104 "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
105 "status", "clearid", "class", "modtime", "modby", "modwith", "created",
109 static struct validate gubl_validate =
122 static char *guau2_fields[] = {
124 "login", "unix_uid", "shell", "last", "first", "middle", "status",
125 "clearid", "class", "comments", "signature", "secure",
126 "modtime", "modby", "modwith",
129 static char *guau_fields[] = {
131 "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
132 "status", "clearid", "class", "comments", "signature", "secure",
133 "modtime", "modby", "modwith", "created", "creator",
136 static char *guan2_fields[] = {
138 "login", "unix_uid", "shell", "last", "first", "middle", "status",
139 "clearid", "class", "comments", "signature", "secure",
140 "modtime", "modby", "modwith",
143 static char *guan_fields[] = {
145 "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
146 "status", "clearid", "class", "comments", "signature", "secure",
147 "modtime", "modby", "modwith", "created", "creator",
150 static struct validate guan_validate =
163 static char *guac2_fields[] = {
165 "login", "unix_uid", "shell", "last", "first", "middle", "status",
166 "clearid", "class", "comments", "signature", "secure",
167 "modtime", "modby", "modwith",
170 static char *guac_fields[] = {
172 "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
173 "status", "clearid", "class", "comments", "signature", "secure",
174 "modtime", "modby", "modwith", "created", "creator",
177 static char *guam2_fields[] = {
179 "login", "unix_uid", "shell", "last", "first", "middle", "status",
180 "clearid", "class", "comments", "signature", "secure",
181 "modtime", "modby", "modwith",
184 static char *guam_fields[] = {
186 "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
187 "status", "clearid", "class", "comments", "signature", "secure",
188 "modtime", "modby", "modwith", "created", "creator",
191 static char *gubu2_fields[] = {
193 "login", "unix_uid", "shell", "last", "first", "middle", "status",
194 "clearid", "class", "modtime", "modby", "modwith",
197 static char *gubu_fields[] = {
199 "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
200 "status", "clearid", "class", "modtime", "modby", "modwith", "created",
204 static struct validate gubu_validate =
217 static char *gubn2_fields[] = {
219 "login", "unix_uid", "shell", "last", "first", "middle", "status",
220 "clearid", "class", "modtime", "modby", "modwith",
223 static char *gubn_fields[] = {
225 "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
226 "status", "clearid", "class", "modtime", "modby", "modwith", "created",
230 static struct validate gubn_validate =
243 static char *gubc2_fields[] = {
245 "login", "unix_uid", "shell", "last", "first", "middle", "status",
246 "clearid", "class", "modtime", "modby", "modwith",
249 static char *gubc_fields[] = {
251 "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
252 "status", "clearid", "class", "modtime", "modby", "modwith",
253 "created", "creator",
256 static char *gubm2_fields[] = {
258 "login", "unix_uid", "shell", "last", "first", "middle", "status",
259 "clearid", "class", "modtime", "modby", "modwith",
262 static char *gubm_fields[] = {
264 "login", "unix_uid", "shell", "winconsoleshell", "last", "first",
265 "middle", "status", "clearid", "class", "modtime", "modby", "modwith",
266 "created", "creator",
269 static char *auac2_fields[] = {
270 "login", "unix_uid", "shell", "last", "first", "middle", "status",
271 "clearid", "class", "comments", "signature", "secure",
274 static char *auac_fields[] = {
275 "login", "unix_uid", "shell", "winconsoleshell", "last", "first",
276 "middle", "status", "clearid", "class", "comments", "signature", "secure",
279 static struct valobj auac2_valobj[] = {
280 {V_CHAR, 0, USERS_TABLE, "login"},
282 {V_CHAR, 2, USERS_TABLE, "shell"},
283 {V_CHAR, 3, USERS_TABLE, "last"},
284 {V_CHAR, 4, USERS_TABLE, "first"},
285 {V_CHAR, 5, USERS_TABLE, "middle"},
287 {V_CHAR, 7, USERS_TABLE, "clearid"},
288 {V_TYPE, 8, 0, "class", 0, MR_BAD_CLASS},
289 {V_ID, 9, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
293 static struct valobj auac_valobj[] = {
294 {V_CHAR, 0, USERS_TABLE, "login"},
296 {V_CHAR, 2, USERS_TABLE, "shell"},
297 {V_CHAR, 3, USERS_TABLE, "winconsoleshell"},
298 {V_CHAR, 4, USERS_TABLE, "last"},
299 {V_CHAR, 5, USERS_TABLE, "first"},
300 {V_CHAR, 6, USERS_TABLE, "middle"},
302 {V_CHAR, 8, USERS_TABLE, "clearid"},
303 {V_TYPE, 9, 0, "class", 0, MR_BAD_CLASS},
304 {V_ID, 10, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
308 static struct validate auac2_validate = {
320 static struct validate auac_validate = {
332 static struct validate ausr2_validate = {
344 static struct validate ausr_validate = {
356 static char *rusr_fields[] = {
357 "unix_uid", "login", "pobox_type"
360 static struct valobj rusr_valobj[] = {
362 {V_CHAR, 1, USERS_TABLE, "login"},
365 static struct validate rusr_validate = {
377 static char *uuac2_fields[] = {
379 "newlogin", "unix_uid", "shell", "last", "first", "middle", "status",
380 "clearid", "class", "comments", "signature", "secure",
383 static char *uuac_fields[] = {
385 "newlogin", "unix_uid", "shell", "winconsoleshell", "last", "first",
386 "middle", "status", "clearid", "class", "comments", "signature", "secure",
389 static struct valobj uuac2_valobj[] = {
390 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
391 {V_RENAME, 1, USERS_TABLE, "login", "users_id", MR_NOT_UNIQUE},
393 {V_CHAR, 3, USERS_TABLE, "shell"},
394 {V_CHAR, 4, USERS_TABLE, "first"},
395 {V_CHAR, 5, USERS_TABLE, "last"},
396 {V_CHAR, 6, USERS_TABLE, "middle"},
398 {V_CHAR, 8, USERS_TABLE, "clearid"},
399 {V_TYPE, 9, 0, "class", 0, MR_BAD_CLASS},
400 {V_ID, 10, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
404 static struct valobj uuac_valobj[] = {
405 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
406 {V_RENAME, 1, USERS_TABLE, "login", "users_id", MR_NOT_UNIQUE},
408 {V_CHAR, 3, USERS_TABLE, "shell"},
409 {V_CHAR, 4, USERS_TABLE, "winconsoleshell"},
410 {V_CHAR, 5, USERS_TABLE, "first"},
411 {V_CHAR, 6, USERS_TABLE, "last"},
412 {V_CHAR, 7, USERS_TABLE, "middle"},
414 {V_CHAR, 9, USERS_TABLE, "clearid"},
415 {V_TYPE, 10, 0, "class", 0, MR_BAD_CLASS},
416 {V_ID, 11, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
420 static struct validate uuac2_validate = {
432 static struct validate uuac_validate = {
444 static struct validate uusr2_validate = {
456 static struct validate uusr_validate = {
468 static char *uush_fields[] = {
473 static struct valobj uush_valobj[] = {
474 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
475 {V_CHAR, 1, USERS_TABLE, "shell"},
478 static struct validate uush_validate = {
490 static char *uuws_fields[] = {
495 static struct valobj uuws_valobj[] = {
496 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
497 {V_CHAR, 1, USERS_TABLE, "winconsoleshell"},
500 static struct validate uuws_validate = {
512 static char *uust_fields[] = {
517 static char *uuss_fields[] = {
522 static struct valobj uust_valobj[] = {
523 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
528 static struct validate uust_validate = {
540 static char *dusr_fields[] = {
544 static struct validate dusr_validate = {
556 static char *aurv_fields[] = {
557 "login", "reservation",
560 static struct validate aurv_validate = {
572 static char *gurv_fields[] = {
577 static struct validate gurv_validate = {
586 get_user_reservations,
589 static char *gubr_fields[] = {
594 static struct validate gubr_validate = {
603 get_user_by_reservation,
606 static char *gkum_fields[] = { "login", "kerberos",
607 "login", "kerberos" };
609 static char *akum_fields[] = { "login", "kerberos" };
611 static struct valobj akum_valobj[] =
613 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
614 {V_ID, 1, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
617 static struct validate akum_validate =
622 "users_id = %d or string_id = %d",
630 static struct validate dkum_validate =
635 "users_id = %d and string_id = %d",
643 static char *gfbl_fields[] = {
645 "login", "fullname", "nickname", "home_addr",
646 "home_phone", "office_addr", "office_phone", "department",
647 "affiliation", "modtime", "modby", "modwith",
650 static struct validate gfbl_validate = {
662 static char *ufbl_fields[] = {
664 "fullname", "nickname", "home_addr",
665 "home_phone", "office_addr", "office_phone", "department",
669 static struct valobj ufbl_valobj[] = {
670 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
671 {V_LEN, 1, USERS_TABLE, "fullname"},
672 {V_LEN, 2, USERS_TABLE, "nickname"},
673 {V_LEN, 3, USERS_TABLE, "home_addr"},
674 {V_LEN, 4, USERS_TABLE, "home_phone"},
675 {V_LEN, 5, USERS_TABLE, "office_addr"},
676 {V_LEN, 6, USERS_TABLE, "office_phone"},
677 {V_LEN, 7, USERS_TABLE, "department"},
678 {V_LEN, 8, USERS_TABLE, "affiliation"},
681 static struct validate ufbl_validate = {
693 static char *gpob_fields[] = {
695 "login", "type", "box", "address", "modtime", "modby", "modwith",
698 static struct validate gpob_validate = {
702 "potype != 'NONE' and users_id = %d",
710 static char *gpox_fields[] = {
711 "login", "type", "box",
714 static struct validate gpox_validate = {
726 static char *spob_fields[] = {
727 "login", "type", "box",
730 static struct valobj spob_valobj[] = {
731 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
732 {V_TYPE, 1, 0, "pobox", 0, MR_TYPE},
735 static struct validate spob_validate = /* SET_POBOX */
748 static struct validate spop_validate = /* SET_POBOX_POP */
761 static struct validate dpob_validate = /* DELETE_POBOX */
774 static char *gmac_fields[] = {
776 "name", "type", "modtime", "modby", "modwith",
779 static char *ghst2_fields[] = {
780 "name", "address", "location", "network",
781 "name", "vendor", "model", "os", "location", "contact", "use",
782 "status", "status_change", "network", "address", "ace_type",
783 "ace_name", "admin_comment", "ops_comment", "created", "creator",
784 "inuse", "modtime", "modby", "modwith",
787 static char *ghbh2_fields[] = {
789 "name", "vendor", "model", "os", "location", "contact", "use",
790 "status", "status_change", "network", "address", "ace_type",
791 "ace_name", "admin_comment", "ops_comment", "created", "creator",
792 "inuse", "modtime", "modby", "modwith",
795 static char *ghst6_fields[] = {
796 "name", "address", "location", "network",
797 "name", "vendor", "model", "os", "location", "contact", "billing_contact",
798 "use", "status", "status_change", "network", "address", "ace_type",
799 "ace_name", "admin_comment", "ops_comment", "created", "creator",
800 "inuse", "modtime", "modby", "modwith",
803 static char *ghbh6_fields[] = {
805 "name", "vendor", "model", "os", "location", "contact", "billing_contact",
806 "use", "status", "status_change", "network", "address", "ace_type",
807 "ace_name", "admin_comment", "ops_comment", "created", "creator",
808 "inuse", "modtime", "modby", "modwith",
811 static char *ghst_fields[] = {
812 "name", "address", "location", "network",
813 "name", "vendor", "model", "os", "location", "contact", "billing_contact",
814 "account_number", "use", "status", "status_change", "network", "address",
815 "ace_type", "ace_name", "admin_comment", "ops_comment", "created", "creator",
816 "inuse", "modtime", "modby", "modwith",
819 static char *ghbh_fields[] = {
821 "name", "vendor", "model", "os", "location", "contact", "billing_contact",
822 "account_number", "use", "status", "status_change", "network", "address",
823 "ace_type", "ace_name", "admin_comment", "ops_comment", "created", "creator",
824 "inuse", "modtime", "modby", "modwith",
827 static char *ghba_fields[] = {
829 "name", "vendor", "model", "os", "location", "contact", "billing_contact",
830 "account_number", "use", "status", "status_change", "network", "address",
831 "ace_type", "ace_name", "admin_comment", "ops_comment", "created", "creator",
832 "inuse", "modtime", "modby", "modwith",
835 static struct validate ghst_validate = {
847 static char *ghha_fields[] = {
852 static char *ahst2_fields[] = {
853 "name", "vendor", "model", "os", "location", "contact", "use",
854 "status", "subnet", "address", "ace_type", "ace_name",
855 "admin_comment", "ops_comment",
858 static struct valobj ahst2_valobj[] = {
859 {V_CHAR, 0, MACHINE_TABLE, "name"},
860 {V_CHAR, 1, MACHINE_TABLE, "vendor"},
861 {V_CHAR, 2, MACHINE_TABLE, "model"},
862 {V_CHAR, 3, MACHINE_TABLE, "os"},
863 {V_CHAR, 4, MACHINE_TABLE, "location"},
864 {V_CHAR, 5, MACHINE_TABLE, "contact"},
867 {V_ID, 8, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
868 {V_TYPE, 10, 0, "ace_type", 0, MR_ACE},
869 {V_TYPEDATA, 11, 0, 0, 0, MR_ACE},
870 {V_ID, 12, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
871 {V_ID, 13, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
874 static struct validate ahst2_validate = {
878 "name = UPPER('%s')",
883 set_uppercase_modtime,
886 static char *ahst6_fields[] = {
887 "name", "vendor", "model", "os", "location", "contact", "billing_contact",
888 "use", "status", "subnet", "address", "ace_type", "ace_name",
889 "admin_comment", "ops_comment",
892 static struct valobj ahst6_valobj[] = {
893 {V_CHAR, 0, MACHINE_TABLE, "name"},
894 {V_CHAR, 1, MACHINE_TABLE, "vendor"},
895 {V_CHAR, 2, MACHINE_TABLE, "model"},
896 {V_CHAR, 3, MACHINE_TABLE, "os"},
897 {V_CHAR, 4, MACHINE_TABLE, "location"},
898 {V_CHAR, 5, MACHINE_TABLE, "contact"},
899 {V_CHAR, 6, MACHINE_TABLE, "billing_contact"},
902 {V_ID, 9, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
903 {V_TYPE, 11, 0, "ace_type", 0, MR_ACE},
904 {V_TYPEDATA, 12, 0, 0, 0, MR_ACE},
905 {V_ID, 13, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
906 {V_ID, 14, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
909 static struct validate ahst6_validate = {
913 "name = UPPER('%s')",
918 set_uppercase_modtime,
921 static char *ahst_fields[] = {
922 "name", "vendor", "model", "os", "location", "contact", "billing_contact",
923 "account_number", "use", "status", "subnet", "address", "ace_type",
924 "ace_name", "admin_comment", "ops_comment",
927 static struct valobj ahst_valobj[] = {
928 {V_CHAR, 0, MACHINE_TABLE, "name"},
929 {V_CHAR, 1, MACHINE_TABLE, "vendor"},
930 {V_CHAR, 2, MACHINE_TABLE, "model"},
931 {V_CHAR, 3, MACHINE_TABLE, "os"},
932 {V_CHAR, 4, MACHINE_TABLE, "location"},
933 {V_CHAR, 5, MACHINE_TABLE, "contact"},
934 {V_CHAR, 6, MACHINE_TABLE, "billing_contact"},
935 {V_CHAR, 7, MACHINE_TABLE, "account_number"},
938 {V_ID, 10, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
939 {V_TYPE, 12, 0, "ace_type", 0, MR_ACE},
940 {V_TYPEDATA, 13, 0, 0, 0, MR_ACE},
941 {V_ID, 14, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
942 {V_ID, 15, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
945 static struct validate ahst_validate = {
949 "name = UPPER('%s')",
954 set_uppercase_modtime,
957 static char *uhst2_fields[] = {
959 "newname", "vendor", "model", "os", "location", "contact", "use",
960 "status", "subnet", "address", "ace_type", "ace_name",
961 "admin_comment", "ops_comment",
964 static struct valobj uhst2_valobj[] = {
965 {V_CHAR, 0, MACHINE_TABLE, "name"},
966 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
967 {V_RENAME, 1, MACHINE_TABLE, "name", "mach_id", MR_NOT_UNIQUE},
968 {V_CHAR, 2, MACHINE_TABLE, "vendor"},
969 {V_CHAR, 3, MACHINE_TABLE, "model"},
970 {V_CHAR, 4, MACHINE_TABLE, "os"},
971 {V_CHAR, 5, MACHINE_TABLE, "location"},
972 {V_CHAR, 6, MACHINE_TABLE, "contact"},
975 {V_ID, 9, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
976 {V_TYPE, 11, 0, "ace_type", 0, MR_ACE},
977 {V_TYPEDATA, 12, 0, 0, 0, MR_ACE},
978 {V_ID, 13, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
979 {V_ID, 14, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
982 static struct validate uhst2_validate = {
994 static char *uhst6_fields[] = {
996 "newname", "vendor", "model", "os", "location", "contact", "billing_contact",
997 "use", "status", "subnet", "address", "ace_type", "ace_name",
998 "admin_comment", "ops_comment",
1001 static struct valobj uhst6_valobj[] = {
1002 {V_CHAR, 0, MACHINE_TABLE, "name"},
1003 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1004 {V_RENAME, 1, MACHINE_TABLE, "name", "mach_id", MR_NOT_UNIQUE},
1005 {V_CHAR, 2, MACHINE_TABLE, "vendor"},
1006 {V_CHAR, 3, MACHINE_TABLE, "model"},
1007 {V_CHAR, 4, MACHINE_TABLE, "os"},
1008 {V_CHAR, 5, MACHINE_TABLE, "location"},
1009 {V_CHAR, 6, MACHINE_TABLE, "contact"},
1010 {V_CHAR, 7, MACHINE_TABLE, "billing_contact"},
1013 {V_ID, 10, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
1014 {V_TYPE, 12, 0, "ace_type", 0, MR_ACE},
1015 {V_TYPEDATA, 13, 0, 0, 0, MR_ACE},
1016 {V_ID, 14, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
1017 {V_ID, 15, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
1020 static struct validate uhst6_validate = {
1032 static char *uhst_fields[] = {
1034 "newname", "vendor", "model", "os", "location", "contact", "billing_contact",
1035 "account_number", "use", "status", "subnet", "address", "ace_type",
1036 "ace_name", "admin_comment", "ops_comment",
1039 static struct valobj uhst_valobj[] = {
1040 {V_CHAR, 0, MACHINE_TABLE, "name"},
1041 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1042 {V_RENAME, 1, MACHINE_TABLE, "name", "mach_id", MR_NOT_UNIQUE},
1043 {V_CHAR, 2, MACHINE_TABLE, "vendor"},
1044 {V_CHAR, 3, MACHINE_TABLE, "model"},
1045 {V_CHAR, 4, MACHINE_TABLE, "os"},
1046 {V_CHAR, 5, MACHINE_TABLE, "location"},
1047 {V_CHAR, 6, MACHINE_TABLE, "contact"},
1048 {V_CHAR, 7, MACHINE_TABLE, "billing_contact"},
1049 {V_CHAR, 8, MACHINE_TABLE, "account_number"},
1052 {V_ID, 11, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
1053 {V_TYPE, 13, 0, "ace_type", 0, MR_ACE},
1054 {V_TYPEDATA, 14, 0, 0, 0, MR_ACE},
1055 {V_ID, 15, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
1056 {V_ID, 16, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
1059 static struct validate uhst_validate = {
1071 static char *uhha_fields[] = {
1076 static struct valobj uhha_valobj[] = {
1077 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1078 {V_CHAR, 1, MACHINE_TABLE, "hwaddr"},
1081 static struct validate uhha_validate = {
1093 static char *dhst_fields[] = {
1097 static struct validate dhst_validate = {
1109 static char *ghal_fields[] = {
1110 "alias", "canonical_hostname",
1111 "alias", "canonical_hostname"
1114 static struct validate ghal_validate = {
1126 static struct valobj ahal_valobj[] = {
1127 {V_CHAR, 0, HOSTALIAS_TABLE, "name"},
1128 {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1131 static struct validate ahal_validate = {
1135 "name = UPPER('%s')",
1143 static struct valobj dhal_valobj[] = {
1144 {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1147 static struct validate dhal_validate = {
1151 "name = UPPER('%s') AND mach_id = %d",
1159 static char *gsnt2_fields[] = {
1161 "name", "description", "address", "mask", "low", "high", "prefix",
1162 "ace_type", "ace_name", "modtime", "modby", "modwith"
1165 static char *gsnt_fields[] = {
1167 "name", "description", "status", "contact", "account_number", "address",
1168 "mask", "low", "high", "prefix", "ace_type", "ace_name", "modtime",
1172 static struct validate gsnt_validate = {
1184 static char *asnt2_fields[] = {
1185 "name", "description", "address", "mask", "low", "high", "prefix",
1186 "ace_type", "ace_name",
1189 static struct valobj asnt2_valobj[] = {
1190 {V_CHAR, 0, SUBNET_TABLE, "name"},
1191 {V_LEN, 1, SUBNET_TABLE, "description"},
1196 {V_LEN, 6, SUBNET_TABLE, "prefix"},
1197 {V_TYPE, 7, 0, "ace_type", 0, MR_ACE},
1198 {V_TYPEDATA, 8, 0, 0, 0, MR_ACE},
1201 static struct validate asnt2_validate =
1206 "name = UPPER('%s')",
1211 set_uppercase_modtime,
1214 static char *asnt_fields[] = {
1215 "name", "description", "status", "contact", "account_number", "address",
1216 "mask", "low", "high", "prefix", "ace_type", "ace_name",
1219 static struct valobj asnt_valobj[] = {
1220 {V_CHAR, 0, SUBNET_TABLE, "name"},
1221 {V_LEN, 1, SUBNET_TABLE, "description"},
1223 {V_CHAR, 3, SUBNET_TABLE, "contact"},
1224 {V_CHAR, 4, SUBNET_TABLE, "account_number"},
1229 {V_LEN, 9, SUBNET_TABLE, "prefix"},
1230 {V_TYPE, 10, 0, "ace_type", 0, MR_ACE},
1231 {V_TYPEDATA, 11, 0, 0, 0, MR_ACE},
1234 static struct validate asnt_validate =
1239 "name = UPPER('%s')",
1244 set_uppercase_modtime,
1247 static char *usnt2_fields[] = {
1249 "newname", "description", "address", "mask", "low", "high", "prefix",
1250 "ace_type", "ace_name",
1253 static struct valobj usnt2_valobj[] = {
1254 {V_ID, 0, SUBNET_TABLE, "name", "snet_id", MR_NO_MATCH},
1255 {V_RENAME, 1, SUBNET_TABLE, "name", "snet_id", MR_NOT_UNIQUE},
1256 {V_LEN, 2, SUBNET_TABLE, "description"},
1261 {V_LEN, 7, SUBNET_TABLE, "prefix"},
1262 {V_TYPE, 8, 0, "ace_type", 0, MR_ACE},
1263 {V_TYPEDATA, 9, 0, 0, 0, MR_ACE},
1266 static struct validate usnt2_validate =
1279 static char *usnt_fields[] = {
1281 "newname", "description", "status", "contact", "account_number", "address",
1282 "mask", "low", "high", "prefix", "ace_type", "ace_name",
1285 static struct valobj usnt_valobj[] = {
1286 {V_ID, 0, SUBNET_TABLE, "name", "snet_id", MR_NO_MATCH},
1287 {V_RENAME, 1, SUBNET_TABLE, "name", "snet_id", MR_NOT_UNIQUE},
1288 {V_LEN, 2, SUBNET_TABLE, "description"},
1290 {V_CHAR, 4, SUBNET_TABLE, "contact"},
1291 {V_CHAR, 5, SUBNET_TABLE, "account_number"},
1296 {V_LEN, 10, SUBNET_TABLE, "prefix"},
1297 {V_TYPE, 11, 0, "ace_type", 0, MR_ACE},
1298 {V_TYPEDATA, 12, 0, 0, 0, MR_ACE},
1301 static struct validate usnt_validate =
1314 static char *dsnt_fields[] = {
1318 static struct validate dsnt_validate = {
1330 static char *gclu_fields[] = {
1332 "name", "description", "location", "modtime", "modby", "modwith",
1335 static char *aclu_fields[] = {
1336 "name", "description", "location",
1339 static struct valobj aclu_valobj[] = {
1340 {V_CHAR, 0, CLUSTERS_TABLE, "name"},
1341 {V_LEN, 1, CLUSTERS_TABLE, "description"},
1342 {V_LEN, 2, CLUSTERS_TABLE, "location"},
1345 static struct validate aclu_validate =
1358 static char *uclu_fields[] = {
1360 "newname", "description", "location",
1363 static struct valobj uclu_valobj[] = {
1364 {V_ID, 0, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
1365 {V_RENAME, 1, CLUSTERS_TABLE, "name", "clu_id", MR_NOT_UNIQUE},
1366 {V_LEN, 2, CLUSTERS_TABLE, "description"},
1367 {V_LEN, 3, CLUSTERS_TABLE, "location"},
1370 static struct validate uclu_validate = {
1382 static char *dclu_fields[] = {
1386 static struct validate dclu_validate = {
1398 static char *gmcm_fields[] = {
1399 "machine", "cluster",
1400 "machine", "cluster",
1403 static struct valobj amtc_valobj[] = /* ADD_MACHINE_TO_CLUSTER */
1404 { /* DELETE_MACHINE_FROM_CLUSTER */
1405 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1406 {V_ID, 1, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
1409 static struct validate amtc_validate = /* for amtc and dmfc */
1414 "mach_id = %d and clu_id = %d",
1419 set_mach_modtime_by_id,
1422 static char *gcld_fields[] = {
1423 "cluster", "serv_label",
1424 "cluster", "serv_label", "serv_cluster",
1427 static char *acld_fields[] = {
1428 "cluster", "serv_label", "serv_cluster",
1431 static struct valobj acld_valobj[] =
1433 {V_ID, 0, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
1434 {V_CHAR, 1, SVC_TABLE, "serv_label"},
1435 {V_CHAR, 2, SVC_TABLE, "serv_cluster"}
1438 static struct validate acld_validate =
1443 "clu_id = %d AND serv_label = '%s' AND serv_cluster = '%s'",
1448 set_cluster_modtime_by_id,
1451 static struct validate dcld_validate =
1456 "clu_id = %d AND serv_label = '%s' AND serv_cluster = '%s'",
1461 set_cluster_modtime_by_id,
1464 static char *glin2_fields[] = {
1466 "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
1467 "ace_type", "ace_name", "description", "modtime", "modby", "modwith",
1470 static char *glin3_fields[] = {
1472 "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
1473 "nfsgroup", "ace_type", "ace_name", "description", "modtime", "modby",
1477 static char *glin_fields[] = {
1479 "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
1480 "nfsgroup", "ace_type", "ace_name", "memace_type", "memace_name",
1481 "description", "modtime", "modby", "modwith",
1484 static struct validate glin_validate = {
1491 access_vis_list_by_name,
1496 static char *alis2_fields[] = {
1497 "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
1498 "ace_type", "ace_name", "description",
1501 static struct valobj alis2_valobj[] = {
1502 {V_CHAR, 0, LIST_TABLE, "name"},
1509 {V_TYPE, 7, 0, "ace_type", 0, MR_ACE},
1510 {V_TYPEDATA, 8, 0, 0, "list_id", MR_ACE},
1511 {V_LEN, 9, LIST_TABLE, "description"},
1514 static struct validate alis2_validate = {
1526 static char *alis3_fields[] = {
1527 "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
1528 "nfsgroup", "ace_type", "ace_name", "description",
1531 static struct valobj alis3_valobj[] = {
1532 {V_CHAR, 0, LIST_TABLE, "name"},
1540 {V_TYPE, 8, 0, "ace_type", 0, MR_ACE},
1541 {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
1542 {V_LEN, 10, LIST_TABLE, "description"},
1545 static struct validate alis3_validate = {
1557 static char *alis_fields[] = {
1558 "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
1559 "nfsgroup", "ace_type", "ace_name", "memace_type", "memace_name",
1563 static struct valobj alis_valobj[] = {
1564 {V_CHAR, 0, LIST_TABLE, "name"},
1572 {V_TYPE, 8, 0, "ace_type", 0, MR_ACE},
1573 {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
1574 {V_TYPE, 10, 0, "ace_type", 0, MR_ACE},
1575 {V_TYPEDATA, 11, 0, 0, "list_id", MR_ACE},
1576 {V_LEN, 12, LIST_TABLE, "description"},
1579 static struct validate alis_validate = {
1591 static char *ulis2_fields[] = {
1593 "newname", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
1594 "ace_type", "ace_name", "description",
1597 static struct valobj ulis2_valobj[] = {
1598 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
1599 {V_RENAME, 1, LIST_TABLE, "name", "list_id", MR_NOT_UNIQUE},
1606 {V_TYPE, 8, 0, "ace_type", 0, MR_ACE},
1607 {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
1608 {V_LEN, 10, LIST_TABLE, "description"},
1611 static struct validate ulis2_validate = {
1623 static char *ulis3_fields[] = {
1625 "newname", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
1626 "nfsgroup", "ace_type", "ace_name", "description",
1629 static struct valobj ulis3_valobj[] = {
1630 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
1631 {V_RENAME, 1, LIST_TABLE, "name", "list_id", MR_NOT_UNIQUE},
1639 {V_TYPE, 9, 0, "ace_type", 0, MR_ACE},
1640 {V_TYPEDATA, 10, 0, 0, "list_id", MR_ACE},
1641 {V_LEN, 11, LIST_TABLE, "description"},
1644 static struct validate ulis3_validate = {
1656 static char *ulis_fields[] = {
1658 "newname", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
1659 "nfsgroup", "ace_type", "ace_name", "memace_type", "memace_name",
1663 static struct valobj ulis_valobj[] = {
1664 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
1665 {V_RENAME, 1, LIST_TABLE, "name", "list_id", MR_NOT_UNIQUE},
1673 {V_TYPE, 9, 0, "ace_type", 0, MR_ACE},
1674 {V_TYPEDATA, 10, 0, 0, "list_id", MR_ACE},
1675 {V_TYPE, 11, 0, "ace_type", 0, MR_ACE},
1676 {V_TYPEDATA, 12, 0, 0, "list_id", MR_ACE},
1677 {V_LEN, 13, LIST_TABLE, "description"},
1680 static struct validate ulis_validate = {
1692 static char *dlis_fields[] = {
1696 static struct validate dlis_validate = {
1708 static char *amtl_fields[] = {
1709 "list_name", "member_type", "member_name",
1712 static char *atml_fields[] = {
1713 "list_name", "member_type", "member_name", "tag",
1716 static struct valobj amtl_valobj[] = {
1717 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
1718 {V_TYPE, 1, 0, "member", 0, MR_TYPE},
1719 {V_TYPEDATA, 2, 0, 0, 0, MR_NO_MATCH},
1720 {V_ID, 3, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
1723 static struct validate amtl_validate =
1736 static struct validate atml_validate =
1749 static struct validate tmol_validate =
1762 static struct validate dmfl_validate =
1772 delete_member_from_list,
1775 static char *gaus_fields[] = {
1776 "ace_type", "ace_name",
1777 "use_type", "use_name",
1780 static struct valobj gaus_valobj[] = {
1781 {V_TYPE, 0, 0, "gaus", 0, MR_TYPE},
1782 {V_TYPEDATA, 1, 0, 0, 0, MR_NO_MATCH},
1785 static struct validate gaus_validate = {
1797 static char *ghbo_fields[] = {
1798 "ace_type", "ace_name",
1802 static struct valobj ghbo_valobj[] = {
1803 {V_TYPE, 0, 0, "gaus", 0, MR_TYPE},
1804 {V_TYPEDATA, 1, 0, 0, 0, MR_NO_MATCH},
1807 static struct validate ghbo_validate = {
1819 static char *qgli_fields[] = {
1820 "active", "publicflg", "hidden", "maillist", "grouplist",
1824 static struct valobj qgli_valobj[] = {
1825 {V_TYPE, 0, 0, "boolean", 0, MR_TYPE},
1826 {V_TYPE, 1, 0, "boolean", 0, MR_TYPE},
1827 {V_TYPE, 2, 0, "boolean", 0, MR_TYPE},
1828 {V_TYPE, 3, 0, "boolean", 0, MR_TYPE},
1829 {V_TYPE, 4, 0, "boolean", 0, MR_TYPE},
1832 static struct validate qgli_validate = {
1841 qualified_get_lists,
1844 static char *gmol_fields[] = {
1846 "member_type", "member_name",
1849 static char *gtml_fields[] = {
1851 "member_type", "member_name", "tag",
1854 static struct validate gmol_validate = {
1861 access_visible_list,
1863 get_members_of_list,
1866 static char *glom_fields[] = {
1867 "member_type", "member_name",
1868 "list_name", "active", "publicflg", "hidden", "maillist", "grouplist",
1871 static struct valobj glom_valobj[] = {
1872 {V_TYPE, 0, 0, "rmember", 0, MR_TYPE},
1873 {V_TYPEDATA, 1, 0, 0, 0, MR_NO_MATCH},
1876 static struct validate glom_validate = {
1885 get_lists_of_member,
1888 static char *cmol_fields[] = {
1893 static struct validate cmol_validate = {
1900 access_visible_list,
1902 count_members_of_list,
1905 static char *gsin_fields[] = {
1907 "service", "update_int", "target_file", "script", "dfgen", "dfcheck",
1908 "type", "enable", "inprogress", "harderror", "errmsg",
1909 "ace_type", "ace_name", "modtime", "modby", "modwith",
1912 static struct validate gsin_validate =
1925 static char *qgsv_fields[] = {
1926 "enable", "inprogress", "harderror",
1930 static struct valobj qgsv_valobj[] = {
1931 {V_TYPE, 0, 0, "boolean", 0, MR_TYPE},
1932 {V_TYPE, 1, 0, "boolean", 0, MR_TYPE},
1933 {V_TYPE, 2, 0, "boolean", 0, MR_TYPE},
1936 static struct validate qgsv_validate = {
1945 qualified_get_server,
1948 static char *asin_fields[] = {
1949 "service", "update_int", "target_file", "script", "type", "enable",
1950 "ace_type", "ace_name",
1953 static struct valobj asin_valobj[] = {
1954 {V_CHAR, 0, SERVERS_TABLE, "name"},
1956 {V_LEN, 2, SERVERS_TABLE, "target_file"},
1957 {V_LEN, 3, SERVERS_TABLE, "script"},
1958 {V_TYPE, 4, 0, "service", 0, MR_TYPE},
1960 {V_TYPE, 6, 0, "ace_type", 0, MR_ACE},
1961 {V_TYPEDATA, 7, 0, 0, 0, MR_ACE},
1964 static struct validate asin_validate = /* for asin, usin */
1969 "name = UPPER('%s')",
1974 set_uppercase_modtime,
1977 static struct validate rsve_validate = {
1981 "name = UPPER('%s')",
1986 set_uppercase_modtime,
1989 static char *ssif_fields[] = {
1990 "service", "dfgen", "dfcheck", "inprogress", "harderror", "errmsg",
1993 static struct valobj ssif_valobj[] = {
1994 {V_NAME, 0, SERVERS_TABLE, "name", 0, MR_SERVICE},
1999 {V_LEN, 5, SERVERS_TABLE, "errmsg"},
2002 static struct validate ssif_validate = {
2006 "name = UPPER('%s')",
2014 static char *dsin_fields[] = {
2018 static struct validate dsin_validate = {
2022 "name = UPPER('%s')",
2030 static char *gshi_fields[] = {
2031 "service", "machine",
2032 "service", "machine", "enable", "override", "success", "inprogress",
2033 "hosterror", "hosterrormsg", "ltt", "lts", "value1", "value2",
2034 "value3", "modtime", "modby", "modwith",
2037 static struct validate gshi_validate = {
2049 static char *qgsh_fields[] = {
2050 "service", "enable", "override", "success", "inprogress", "hosterror",
2051 "service", "machine",
2054 static struct valobj qgsh_valobj[] = {
2055 {V_TYPE, 1, 0, "boolean", 0, MR_TYPE},
2056 {V_TYPE, 2, 0, "boolean", 0, MR_TYPE},
2057 {V_TYPE, 3, 0, "boolean", 0, MR_TYPE},
2058 {V_TYPE, 4, 0, "boolean", 0, MR_TYPE},
2059 {V_TYPE, 5, 0, "boolean", 0, MR_TYPE},
2062 static struct validate qgsh_validate = {
2071 qualified_get_serverhost,
2074 static char *ashi_fields[] = {
2075 "service", "machine", "enable", "value1", "value2", "value3",
2078 static struct valobj ashi_valobj[] = {
2079 {V_NAME, 0, SERVERS_TABLE, "name", 0, MR_SERVICE},
2080 {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2084 {V_LEN, 5, SERVERHOSTS_TABLE, "value3"},
2087 static struct validate ashi_validate = /* ashi & ushi */
2092 "service = UPPER('%s') AND mach_id = %d",
2097 set_serverhost_modtime,
2100 static struct validate rshe_validate =
2105 "service = UPPER('%s') AND mach_id = %d",
2110 set_serverhost_modtime,
2113 static struct validate ssho_validate =
2118 "service = UPPER('%s') AND mach_id = %d",
2126 static char *sshi_fields[] = {
2127 "service", "machine", "override", "success", "inprogress",
2128 "hosterror", "errmsg", "ltt", "lts",
2131 static struct valobj sshi_valobj[] = {
2132 {V_NAME, 0, SERVERS_TABLE, "name", 0, MR_SERVICE},
2133 {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2138 {V_LEN, 6, SERVERHOSTS_TABLE, "hosterrmsg"},
2143 static struct validate sshi_validate =
2156 static char *dshi_fields[] = {
2157 "service", "machine",
2160 static struct validate dshi_validate =
2165 "service = UPPER('%s') AND mach_id = %d",
2173 static char *gslo_fields[] = {
2175 "server", "machine",
2178 static char *gfsl_fields[] = {
2180 "label", "type", "machine", "name", "mount", "access", "comments",
2181 "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith",
2184 static struct validate gfsl_validate = {
2196 static char *gfsm_fields[] = {
2198 "label", "type", "machine", "name", "mount", "access", "comments",
2199 "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith",
2202 static struct validate gfsm_validate = {
2214 static char *gfsn_fields[] = {
2215 "machine", "partition",
2216 "label", "type", "machine", "name", "mount", "access", "comments",
2217 "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith",
2220 static struct validate gfsn_validate = {
2232 static char *gfsp_fields[] = {
2234 "label", "type", "machine", "name", "mount", "access", "comments",
2235 "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith",
2238 static char *gfsg_fields[] = {
2240 "label", "type", "machine", "name", "mount", "access", "comments",
2241 "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith",
2244 static struct validate gfsg_validate = {
2256 static char *afil_fields[] = {
2257 "label", "type", "machine", "name", "mount", "access", "comments",
2258 "owner", "owners", "create", "lockertype",
2261 static struct valobj afil_valobj[] = {
2262 {V_CHAR, 0, FILESYS_TABLE, "label"},
2263 {V_TYPE, 1, 0, "filesys", 0, MR_FSTYPE},
2264 {V_ID, 2, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2265 {V_CHAR, 3, FILESYS_TABLE, "name"},
2266 {V_LEN, 4, FILESYS_TABLE, "mount"},
2267 {V_LEN, 5, FILESYS_TABLE, "rwaccess"},
2268 {V_LEN, 6, FILESYS_TABLE, "comments"},
2269 {V_ID, 7, USERS_TABLE, "login", "users_id", MR_USER},
2270 {V_ID, 8, LIST_TABLE, "name", "list_id", MR_LIST},
2272 {V_TYPE, 10, 0, "lockertype", 0, MR_TYPE},
2275 static struct validate afil_validate = {
2284 set_filesys_modtime,
2287 static char *ufil_fields[] = {
2288 "label", "newlabel", "type", "machine", "name", "mount", "access",
2289 "comments", "owner", "owners", "create", "lockertype",
2292 static struct valobj ufil_valobj[] = {
2293 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
2294 {V_RENAME, 1, FILESYS_TABLE, "label", "filsys_id", MR_NOT_UNIQUE},
2295 {V_TYPE, 2, 0, "filesys", 0, MR_FSTYPE},
2296 {V_ID, 3, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2297 {V_CHAR, 4, FILESYS_TABLE, "name"},
2298 {V_LEN, 5, FILESYS_TABLE, "mount"},
2299 {V_LEN, 6, FILESYS_TABLE, "rwaccess"},
2300 {V_LEN, 7, FILESYS_TABLE, "comments"},
2301 {V_ID, 8, USERS_TABLE, "login", "users_id", MR_USER},
2302 {V_ID, 9, LIST_TABLE, "name", "list_id", MR_LIST},
2304 {V_TYPE, 11, 0, "lockertype", 0, MR_TYPE},
2307 static struct validate ufil_validate = {
2316 set_filesys_modtime,
2319 static char *dfil_fields[] = {
2323 static struct validate dfil_validate = {
2335 static char *gfgm_fields[] = {
2336 "fsgroup", "filesys", "sortkey"
2339 static struct validate gfgm_validate = {
2351 static struct valobj aftg_valobj[] = {
2352 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
2353 {V_ID, 1, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
2356 static struct validate aftg_validate = {
2360 "group_id = %d and filsys_id = %d",
2368 static char *ganf_fields[] = {
2369 "machine", "dir", "device", "status", "allocated", "size",
2370 "modtime", "modby", "modwith",
2373 static char *gnfp_fields[] = {
2375 "machine", "dir", "device", "status", "allocated", "size",
2376 "modtime", "modby", "modwith",
2379 static struct validate gnfp_validate = {
2391 static struct valobj anfp_valobj[] = {
2392 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2393 {V_CHAR, 1, NFSPHYS_TABLE, "dir"},
2394 {V_LEN, 2, NFSPHYS_TABLE, "device"},
2400 static struct validate anfp_validate = {
2404 "mach_id = %d and dir = '%s'",
2409 set_nfsphys_modtime,
2412 static struct validate unfp_validate = {
2416 "mach_id = %d and dir = '%s'",
2421 set_nfsphys_modtime,
2424 static char *ajnf_fields[] = {
2425 "machine", "dir", "adjustment",
2428 static struct valobj ajnf_valobj[] = {
2429 {V_ID, 0, MACHINE_TABLE, NAME, "mach_id", MR_MACHINE},
2430 {V_CHAR, 1, NFSPHYS_TABLE, "dir"},
2434 static struct validate ajnf_validate = {
2438 "mach_id = %d and dir = '%s'",
2443 set_nfsphys_modtime,
2446 static char *dnfp_fields[] = {
2450 static struct validate dnfp_validate = {
2454 "mach_id = %d and dir = '%s'",
2459 set_nfsphys_modtime,
2462 static char *gqot_fields[] = {
2463 "filesys", "type", "name",
2464 "filesys", "type", "name", "quota", "dir", "machine",
2465 "modtime", "modby", "modwith",
2468 static struct valobj gqot_valobj[] = {
2469 {V_TYPE, 1, 0, "quota_type", 0, MR_TYPE},
2470 {V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
2473 static struct validate gqot_validate = {
2485 static char *gqbf_fields[] = {
2487 "filesys", "type", "name", "quota", "dir", "machine",
2488 "modtime", "modby", "modwith",
2491 static struct validate gqbf_validate = {
2503 static char *aqot_fields[] = {
2504 "filesys", "type", "name", "quota",
2507 static struct valobj aqot_valobj[] = {
2508 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
2509 {V_TYPE, 1, 0, "quota_type", 0, MR_TYPE},
2510 {V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
2514 static struct validate aqot_validate = {
2518 "filsys_id = %d and type = '%s' and entity_id = %d",
2526 static struct validate uqot_validate = {
2530 "filsys_id = %d AND type = '%s' AND entity_id = %d",
2538 static struct validate dqot_validate = {
2542 "filsys_id = %d AND type = '%s' AND entity_id = %d",
2550 static char *gnfq_fields[] = {
2552 "filesys", "login", "quota", "dir", "machine",
2553 "modtime", "modby", "modwith",
2556 static struct validate gnfq_validate = {
2568 static char *gnqp_fields[] = {
2570 "filesys", "login", "quota", "dir", "machine",
2571 "modtime", "modby", "modwith",
2574 static char *anfq_fields[] = {
2575 "filesys", "login", "quota",
2578 static struct valobj anfq_valobj[] = {
2579 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
2580 {V_ID, 1, USERS_TABLE, "login", "users_id", MR_USER},
2584 static struct validate anfq_validate = {
2588 "filsys_id = %d AND type = 'USER' AND entity_id = %d",
2596 static struct validate unfq_validate = {
2600 "filsys_id = %d AND type = 'USER' AND entity_id = %d",
2608 static struct validate dnfq_validate = {
2612 "filsys_id = %d AND entity_id = %d",
2620 static char *gzcl2_fields[] = {
2622 "class", "xmt_type", "xmt_name", "sub_type", "sub_name",
2623 "iws_type", "iws_name", "iui_type", "iui_name",
2624 "modtime", "modby", "modwith",
2627 static char *gzcl_fields[] = {
2629 "class", "xmt_type", "xmt_name", "sub_type", "sub_name",
2630 "iws_type", "iws_name", "iui_type", "iui_name", "owner_type",
2631 "owner_id", "modtime", "modby", "modwith",
2634 static struct validate gzcl_validate = {
2646 static char *azcl2_fields[] = {
2647 "class", "xmt_type", "xmt_name", "sub_type", "sub_name",
2648 "iws_type", "iws_name", "iui_type", "iui_name",
2651 static struct valobj azcl2_valobj[] = {
2652 {V_CHAR, 0, ZEPHYR_TABLE, "class"},
2653 {V_TYPE, 1, 0, "zace_type", 0, MR_ACE},
2654 {V_TYPEDATA, 2, 0, 0, "list_id", MR_ACE},
2655 {V_TYPE, 3, 0, "zace_type", 0, MR_ACE},
2656 {V_TYPEDATA, 4, 0, 0, "list_id", MR_ACE},
2657 {V_TYPE, 5, 0, "zace_type", 0, MR_ACE},
2658 {V_TYPEDATA, 6, 0, 0, "list_id", MR_ACE},
2659 {V_TYPE, 7, 0, "zace_type", 0, MR_ACE},
2660 {V_TYPEDATA, 8, 0, 0, "list_id", MR_ACE},
2663 static struct validate azcl2_validate = {
2675 static char *azcl_fields[] = {
2676 "class", "xmt_type", "xmt_name", "sub_type", "sub_name",
2677 "iws_type", "iws_name", "iui_type", "iui_name", "owner_type",
2681 static struct valobj azcl_valobj[] = {
2682 {V_CHAR, 0, ZEPHYR_TABLE, "class"},
2683 {V_TYPE, 1, 0, "zace_type", 0, MR_ACE},
2684 {V_TYPEDATA, 2, 0, 0, "list_id", MR_ACE},
2685 {V_TYPE, 3, 0, "zace_type", 0, MR_ACE},
2686 {V_TYPEDATA, 4, 0, 0, "list_id", MR_ACE},
2687 {V_TYPE, 5, 0, "zace_type", 0, MR_ACE},
2688 {V_TYPEDATA, 6, 0, 0, "list_id", MR_ACE},
2689 {V_TYPE, 7, 0, "zace_type", 0, MR_ACE},
2690 {V_TYPEDATA, 8, 0, 0, "list_id", MR_ACE},
2691 {V_TYPE, 9, 0, "ace_type", 0, MR_ACE},
2692 {V_TYPEDATA, 10, 0, 0, "list_id", MR_ACE},
2695 static struct validate azcl_validate = {
2707 static char *uzcl2_fields[] = {
2708 "class", "newclass", "xmt_type", "xmt_name", "sub_type", "sub_name",
2709 "iws_type", "iws_name", "iui_type", "iui_name",
2712 static struct valobj uzcl2_valobj[] = {
2713 {V_NAME, 0, ZEPHYR_TABLE, "class", 0, MR_BAD_CLASS},
2714 {V_RENAME, 1, ZEPHYR_TABLE, "class", 0, MR_NOT_UNIQUE},
2715 {V_TYPE, 2, 0, "zace_type", 0, MR_ACE},
2716 {V_TYPEDATA, 3, 0, 0, "list_id", MR_ACE},
2717 {V_TYPE, 4, 0, "zace_type", 0, MR_ACE},
2718 {V_TYPEDATA, 5, 0, 0, "list_id", MR_ACE},
2719 {V_TYPE, 6, 0, "zace_type", 0, MR_ACE},
2720 {V_TYPEDATA, 7, 0, 0, "list_id", MR_ACE},
2721 {V_TYPE, 8, 0, "zace_type", 0, MR_ACE},
2722 {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
2725 static struct validate uzcl2_validate = {
2737 static char *uzcl_fields[] = {
2738 "class", "newclass", "xmt_type", "xmt_name", "sub_type", "sub_name",
2739 "iws_type", "iws_name", "iui_type", "iui_name", "owner_type", "owner_id",
2742 static struct valobj uzcl_valobj[] = {
2743 {V_NAME, 0, ZEPHYR_TABLE, "class", 0, MR_BAD_CLASS},
2744 {V_RENAME, 1, ZEPHYR_TABLE, "class", 0, MR_NOT_UNIQUE},
2745 {V_TYPE, 2, 0, "zace_type", 0, MR_ACE},
2746 {V_TYPEDATA, 3, 0, 0, "list_id", MR_ACE},
2747 {V_TYPE, 4, 0, "zace_type", 0, MR_ACE},
2748 {V_TYPEDATA, 5, 0, 0, "list_id", MR_ACE},
2749 {V_TYPE, 6, 0, "zace_type", 0, MR_ACE},
2750 {V_TYPEDATA, 7, 0, 0, "list_id", MR_ACE},
2751 {V_TYPE, 8, 0, "zace_type", 0, MR_ACE},
2752 {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
2753 {V_TYPE, 10, 0, "ace_type", 0, MR_ACE},
2754 {V_TYPEDATA, 11, 0, 0, "list_id", MR_ACE},
2757 static struct validate uzcl_validate = {
2769 static struct validate dzcl_validate = {
2781 static char *gsha_fields[] = {
2783 "machine", "ace_type", "ace_name", "modtime", "modby", "modwith",
2786 static struct validate gsha_validate =
2799 static char *asha_fields[] = {
2800 "machine", "ace_type", "ace_name",
2803 static struct valobj asha_valobj[] = {
2804 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2805 {V_TYPE, 1, 0, "ace_type", 0, MR_ACE},
2806 {V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
2809 static struct validate asha_validate =
2822 static char *gacl_fields[] = {
2823 "machine", "target",
2824 "machine", "target", "kind", "list",
2827 static char *aacl_fields[] = {
2828 "machine", "target", "kind", "list",
2831 static char *dacl_fields[] = {
2832 "machine", "target",
2835 static struct valobj aacl_valobj[] = {
2836 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2837 {V_CHAR, 1, ACL_TABLE, "target"},
2838 {V_TYPE, 2, 0, "acl_kind", 0, MR_TYPE},
2839 {V_ID, 3, LIST_TABLE, "name", "list_id", MR_LIST},
2842 static struct validate gacl_validate =
2855 static struct validate aacl_validate =
2860 "mach_id = %d AND target = '%s'",
2868 static char *gsvc_fields[] = {
2869 "service", "protocol",
2870 "service", "protocol", "port", "description", "modtime", "modby", "modwith",
2873 static char *asvc_fields[] = {
2874 "service", "protocol", "port", "description",
2877 static char *dsvc_fields[] = {
2878 "service", "protocol",
2881 static struct valobj asvc_valobj[] = {
2882 {V_CHAR, 0, SERVICES_TABLE, "name"},
2883 {V_CHAR, 1, SERVICES_TABLE, "protocol"},
2885 {V_CHAR, 3, SERVICES_TABLE, "description"},
2888 static struct validate asvc_validate = {
2892 "name = '%s' AND protocol = '%s'",
2897 set_service_modtime,
2900 static struct validate dsvc_validate = {
2904 "name = '%s' AND protocol = '%s'",
2912 static char *gprn_fields[] = {
2914 "name", "type", "hwtype", "duplexname", "hostname",
2915 "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
2916 "banner", "location", "contact", "modtime", "modby", "modwith"
2919 static char *gpbd_fields[] = {
2921 "name", "type", "hwtype", "duplexname", "hostname",
2922 "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
2923 "banner", "location", "contact", "modtime", "modby", "modwith"
2926 static char *gpbe_fields[] = {
2928 "name", "type", "hwtype", "duplexname", "hostname",
2929 "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
2930 "banner", "location", "contact", "modtime", "modby", "modwith"
2933 static char *gpbh_fields[] = {
2935 "name", "type", "hwtype", "duplexname", "hostname",
2936 "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
2937 "banner", "location", "contact", "modtime", "modby", "modwith"
2940 static char *gpbr_fields[] = {
2942 "name", "type", "hwtype", "duplexname", "hostname",
2943 "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
2944 "banner", "location", "contact", "modtime", "modby", "modwith"
2947 static char *gpbl_fields[] = {
2949 "name", "type", "hwtype", "duplexname", "hostname",
2950 "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
2951 "banner", "location", "contact", "modtime", "modby", "modwith"
2954 static char *gpbc_fields[] = {
2956 "name", "type", "hwtype", "duplexname", "hostname",
2957 "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
2958 "banner", "location", "contact", "modtime", "modby", "modwith"
2961 static char *aprn_fields[] = {
2962 "printer", "type", "hwtype", "duplexname", "hostname",
2963 "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
2964 "banner", "location", "contact",
2967 static struct valobj aprn_valobj[] = {
2968 {V_CHAR, 0, PRINTERS_TABLE, "name"},
2969 {V_TYPE, 1, 0, "printertype", 0, MR_TYPE},
2970 {V_TYPE, 2, 0, "printerhwtype", 0, MR_TYPE},
2971 {V_CHAR, 3, PRINTERS_TABLE, "duplexname"},
2972 {V_ID, 4, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2973 {V_ID, 5, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2974 {V_ID, 6, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2975 {V_CHAR, 7, PRINTERS_TABLE, "rp"},
2976 {V_ID, 8, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2979 {V_ID, 11, LIST_TABLE, "name", "list_id", MR_LIST},
2980 {V_ID, 12, LIST_TABLE, "name", "list_id", MR_LIST},
2982 {V_CHAR, 14, PRINTERS_TABLE, "location"},
2983 {V_CHAR, 15, PRINTERS_TABLE, "contact"},
2986 static struct validate aprn_validate = {
2998 static char *uprn_fields[] = {
3000 "printer", "type", "hwtype", "duplexname", "hostname",
3001 "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
3002 "banner", "location", "contact",
3005 static struct valobj uprn_valobj[] = {
3006 {V_CHAR, 0, PRINTERS_TABLE, "name"},
3007 {V_CHAR, 1, PRINTERS_TABLE, "name"},
3008 {V_TYPE, 2, 0, "printertype", 0, MR_TYPE},
3009 {V_TYPE, 3, 0, "printerhwtype", 0, MR_TYPE},
3010 {V_CHAR, 4, PRINTERS_TABLE, "duplexname"},
3011 {V_ID, 5, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3012 {V_ID, 6, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3013 {V_ID, 7, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3014 {V_CHAR, 8, PRINTERS_TABLE, "rp"},
3015 {V_ID, 9, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3018 {V_ID, 12, LIST_TABLE, "name", "list_id", MR_LIST},
3019 {V_ID, 13, LIST_TABLE, "name", "list_id", MR_LIST},
3021 {V_CHAR, 15, PRINTERS_TABLE, "location"},
3022 {V_CHAR, 16, PRINTERS_TABLE, "contact"},
3025 static struct validate uprn_validate = {
3037 static struct validate dprn_validate = {
3049 static char *gpsv_fields[] = {
3051 "host", "kind", "printer_types", "owner_type", "owner_name",
3052 "lpc_acl", "modtime", "modby", "modwith"
3055 static struct valobj gpsv_valobj[] = {
3056 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3059 static struct validate gpsv_validate = {
3071 static char *apsv_fields[] = {
3072 "host", "kind", "printer_types", "owner_type", "owner_name", "lpc_acl"
3075 static struct valobj apsv_valobj[] = {
3076 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3077 {V_TYPE, 1, 0, "lpd_kind", 0, MR_TYPE},
3078 {V_ID, 2, STRINGS_TABLE, "string", "string_id", MR_STRING},
3079 {V_TYPE, 3, 0, "ace_type", 0, MR_ACE},
3080 {V_TYPEDATA, 4, 0, 0, 0, MR_ACE},
3081 {V_ID, 5, LIST_TABLE, "name", "list_id", MR_LIST},
3084 static struct validate apsv_validate = {
3096 static char *dpsv_fields[] = {
3100 static struct validate dpsv_validate = {
3112 static char *gali_fields[] = {
3113 "name", "type", "trans",
3114 "name", "type", "trans",
3117 static char *aali_fields[] = {
3118 "name", "type", "trans",
3121 static struct valobj aali_valobj[] = {
3122 {V_CHAR, 0, ALIAS_TABLE, "name"},
3123 {V_TYPE, 1, 0, "alias", 0, MR_TYPE},
3124 {V_CHAR, 2, ALIAS_TABLE, "trans"},
3127 static struct validate aali_validate = {
3131 "name = '%s' and type = '%s' and trans = '%s'",
3139 static struct validate dali_validate = /* DELETE_ALIAS */
3144 "name = '%s' and type = '%s' and trans = '%s'",
3152 static char *gval_fields[] = {
3156 static struct valobj gval_valobj[] = {
3157 {V_NAME, 0, NUMVALUES_TABLE, "name", 0, MR_NO_MATCH},
3160 static struct validate gval_validate = {
3172 static char *aval_fields[] = {
3176 static struct valobj aval_valobj[] = {
3177 {V_CHAR, 0, NUMVALUES_TABLE, "name"},
3181 static struct validate aval_validate = /* for aval, uval, and dval */
3194 static char *dval_fields[] = {
3198 static char *gats_fields[] = {
3199 "table_name", "appends", "updates", "deletes",
3200 "modtime", "modby", "modwith",
3203 static char *_sdl_fields[] = {
3207 static struct validate _sdl_validate =
3220 static char *gusl_fields[] = {
3221 "login", "domain_sid",
3222 "login", "sid", "created",
3225 static struct validate gusl_validate =
3238 static char *glsn_fields[] = {
3239 "name", "domain_sid",
3240 "name", "sid", "created",
3243 static struct validate glsn_validate =
3256 static char *ausl_fields[] = {
3260 static struct validate ausl_validate =
3265 "users_id = %d AND sid = '%s'",
3273 static char *alsn_fields[] = {
3277 static struct validate alsn_validate =
3282 "list_id = %d AND sid = '%s'",
3290 static char *gdds_fields[] = {
3294 static char *gcon_fields[] = {
3296 "name", "description", "location", "contact",
3297 "ace_type", "ace_name", "memace_type", "memace_name", "modtime", "modby", "modwith",
3300 static struct validate gcon_validate = {
3312 static char *acon_fields[] = {
3313 "name", "description", "location", "contact",
3314 "ace_type", "ace_name", "memace_type", "memace_name",
3317 static struct valobj acon_valobj[] = {
3318 {V_CHAR, 0, CONTAINERS_TABLE, "name"},
3319 {V_LEN, 1, CONTAINERS_TABLE, "description"},
3320 {V_CHAR, 2, CONTAINERS_TABLE, "location"},
3321 {V_CHAR, 3, CONTAINERS_TABLE, "contact"},
3322 {V_TYPE, 4, 0, "ace_type", 0, MR_ACE},
3323 {V_TYPEDATA, 5, 0, 0, 0, MR_ACE},
3324 {V_TYPE, 6, 0, "ace_type", 0, MR_ACE},
3325 {V_TYPEDATA, 7, 0, 0, 0, MR_ACE},
3328 static struct validate acon_validate =
3341 static char *ucon_fields[] = {
3343 "newname", "description", "location", "contact",
3344 "ace_type", "ace_name", "memace_type", "memace_name",
3347 static struct valobj ucon_valobj[] = {
3348 {V_ID, 0, CONTAINERS_TABLE, "name", "cnt_id", MR_CONTAINER},
3349 {V_RENAME, 1, CONTAINERS_TABLE, "name", "cnt_id", MR_NOT_UNIQUE},
3350 {V_LEN, 2, CONTAINERS_TABLE, "description"},
3351 {V_CHAR, 3, CONTAINERS_TABLE, "location"},
3352 {V_CHAR, 4, CONTAINERS_TABLE, "contact"},
3353 {V_TYPE, 5, 0, "ace_type", 0, MR_ACE},
3354 {V_TYPEDATA, 6, 0, 0, 0, MR_ACE},
3355 {V_TYPE, 7, 0, "ace_type", 0, MR_ACE},
3356 {V_TYPEDATA, 8, 0, 0, 0, MR_ACE},
3359 static struct validate ucon_validate =
3372 static char *dcon_fields[] = {
3376 static struct validate dcon_validate =
3389 static char *amcn_fields[] = {
3390 "machine", "container",
3393 static struct valobj amcn_valobj[] = /* ADD_MACHINE_TO_CONTAINER */
3394 { /* DELETE_MACHINE_FROM_CONTAINER */
3395 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3396 {V_ID, 1, CONTAINERS_TABLE, "name", "cnt_id", MR_CONTAINER},
3399 static struct validate amcn_validate = /* for amtn and dmfn */
3409 set_mach_modtime_by_id,
3412 static struct validate dmcn_validate = /* for amtn and dmfn */
3417 "mach_id = %d and cnt_id = %d",
3422 set_mach_modtime_by_id,
3425 static char *gmnm_fields[] = {
3427 "machine", "container",
3430 static char *gmoc_fields[] = {
3437 static struct validate gmoc_validate =
3447 get_machines_of_container,
3450 static char *gsoc_fields[] = {
3456 static struct validate gsoc_validate =
3466 get_subcontainers_of_container,
3469 static char *gtlc_fields[] = {
3474 /* Generalized Query Definitions */
3476 /* Multiple versions of the same query MUST be listed in ascending
3480 /* Note: For any query which uses prefetch_value, the vcnt should be
3481 * one less than the number of %-format specifiers in the tlist.
3484 struct query Queries[] = {
3486 /* Q_GALO - GET_ALL_LOGINS, v2 */
3493 "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle FROM users u",
3503 /* Q_GALO - GET_ALL_LOGINS, v3 */
3510 "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle FROM users u",
3520 /* Q_GAAL - GET_ALL_ACTIVE_LOGINS, v2 */
3521 "get_all_active_logins",
3527 "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle FROM users u",
3537 /* Q_GAAL - GET_ALL_ACTIVE_LOGINS, v3 */
3538 "get_all_active_logins",
3544 "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle FROM users u",
3554 /* Q_GUAL - GET_USER_ACCOUNT_BY_LOGIN, v2 */
3555 "get_user_account_by_login",
3561 "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
3564 "u.login LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
3571 /* Q_GUAL - GET_USER_ACCOUNT_BY_LOGIN, v3 */
3572 "get_user_account_by_login",
3578 "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
3581 "u.login LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
3588 /* Q_GUAU - GET_USER_ACCOUNT_BY_UID, v2 */
3589 "get_user_account_by_uid",
3595 "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
3598 "u.unix_uid = %s AND u.users_id != 0 AND u.comments = str.string_id",
3605 /* Q_GUAU - GET_USER_ACCOUNT_BY_UID, v3 */
3606 "get_user_account_by_uid",
3612 "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
3615 "u.unix_uid = %s AND u.users_id != 0 AND u.comments = str.string_id",
3622 /* Q_GUAN - GET_USER_ACCOUNT_BY_NAME, v2 */
3623 "get_user_account_by_name",
3629 "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
3632 "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0 and u.comments = str.string_id",
3639 /* Q_GUAN - GET_USER_ACCOUNT_BY_NAME, v3 */
3640 "get_user_account_by_name",
3646 "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
3649 "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0 and u.comments = str.string_id",
3656 /* Q_GUAC - GET_USER_ACCOUNT_BY_CLASS, v2 */
3657 "get_user_account_by_class",
3663 "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
3666 "u.type = UPPER('%s') AND u.users_id != 0 AND u.comments = str.string_id",
3673 /* Q_GUAC - GET_USER_ACCOUNT_BY_CLASS, v3 */
3674 "get_user_account_by_class",
3680 "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
3683 "u.type = UPPER('%s') AND u.users_id != 0 AND u.comments = str.string_id",
3690 /* Q_GUAM - GET_USER_ACCOUNT_BY_MITID, v2 */
3691 "get_user_account_by_id",
3697 "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
3700 "u.clearid LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
3707 /* Q_GUAM - GET_USER_ACCOUNT_BY_MITID, v3 */
3708 "get_user_account_by_id",
3714 "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
3717 "u.clearid LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
3724 /* Q_GUBL - GET_USER_BY_LOGIN, v2 */
3725 "get_user_by_login",
3731 "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",
3734 "u.login LIKE '%s' AND u.users_id != 0",
3741 /* Q_GUBL - GET_USER_BY_LOGIN, v3 */
3742 "get_user_by_login",
3748 "u.login, u.unix_uid, u.shell, u.winconsoleshell, 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, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u",
3751 "u.login LIKE '%s' AND u.users_id != 0",
3758 /* Q_GUBU - GET_USER_BY_UID, v2 */
3765 "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",
3768 "u.unix_uid = %s AND u.users_id != 0",
3775 /* Q_GUBU - GET_USER_BY_UID, v3 */
3782 "u.login, u.unix_uid, u.shell, u.winconsoleshell, 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, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u",
3785 "u.unix_uid = %s AND u.users_id != 0",
3792 /* Q_GUBN - GET_USER_BY_NAME, v2 */
3799 "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",
3802 "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0",
3809 /* Q_GUBN - GET_USER_BY_NAME, v3 */
3816 "u.login, u.unix_uid, u.shell, u.winconsoleshell, 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, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u",
3819 "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0",
3826 /* Q_GUBC - GET_USER_BY_CLASS, v2 */
3827 "get_user_by_class",
3833 "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",
3836 "u.type = UPPER('%s') AND u.users_id != 0",
3843 /* Q_GUBC - GET_USER_BY_CLASS, v3 */
3844 "get_user_by_class",
3850 "u.login, u.unix_uid, u.shell, u.winconsoleshell, 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, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS') FROM users u",
3853 "u.type = UPPER('%s') AND u.users_id != 0",
3860 /* Q_GUBM - GET_USER_BY_MITID, v2 */
3861 "get_user_by_mitid",
3867 "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",
3870 "u.clearid LIKE '%s' AND u.users_id != 0",
3877 /* Q_GUBM - GET_USER_BY_MITID, v3 */
3878 "get_user_by_mitid",
3884 "u.login, u.unix_uid, u.shell, u.winconsoleshell, 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, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u",
3887 "u.clearid LIKE '%s' AND u.users_id != 0",
3894 /* Q_AUAC - ADD_USER_ACCOUNT, v2 */ /* uses prefetch_value() for users_id */
3901 /* We set signature to "NVL(CHR(0), '%s')", which is to say, "CHR(0)",
3902 * but using up one argv element.
3904 "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, NVL(CHR(0), '%s'), %s, %s)",
3914 /* Q_AUAC - ADD_USER_ACCOUNT, v3 */ /* uses prefetch_value() for users_id */
3921 /* We set signature to "NVL(CHR(0), '%s')", which is to say, "CHR(0)",
3922 * but using up one argv element.
3924 "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, users_id, created, creator) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', %d, NVL(CHR(0), '%s'), %s, %s, SYSDATE, %s)",
3934 /* Q_AUSR - ADD_USER, v2 */ /* uses prefetch_value() for users_id */
3941 "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)",
3951 /* Q_AUSR - ADD_USER, v3 */ /* uses prefetch_value() for users_id */
3958 "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, users_id, created, creator) 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, SYSDATE, %s)",
3968 /* Q_RUSR - REGISTER_USER */
3985 /* Q_UUAC - UPDATE_USER_ACCOUNT, v2 */
3986 "update_user_account",
3992 /* See comment in auac about signature. */
3993 "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 = NVL(CHR(0), '%s'), secure = %s",
4003 /* Q_UUAC - UPDATE_USER_ACCOUNT, v3 */
4004 "update_user_account",
4010 /* See comment in auac about signature. */
4011 "users SET login = '%s', unix_uid = %s, shell = '%s', winconsoleshell = '%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 = NVL(CHR(0), '%s'), secure = %s",
4021 /* Q_UUSR - UPDATE_USER, v2 */
4028 "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'",
4038 /* Q_UUSR - UPDATE_USER, v3 */
4045 "users SET login = '%s', unix_uid = %s, shell = '%s', winconsoleshell = '%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'",
4055 /* Q_UUSH - UPDATE_USER_SHELL */
4056 "update_user_shell",
4062 "users SET shell = '%s'",
4072 /* Q_UUWS - UPDATE_USER_WINDOWS_SHELL */
4073 "update_user_windows_shell",
4079 "users SET winconsoleshell = '%s'",
4089 /* Q_UUST - UPDATE_USER_STATUS */
4090 "update_user_status",
4096 "users SET status = %s",
4106 /* Q_UUSS - UPDATE_USER_SECURITY_STATUS */
4107 "update_user_security_status",
4113 "users SET secure = %s",
4123 /* Q_DUSR - DELETE_USER */
4140 /* Q_AURV - ADD_USER_RESERVATION */
4141 "add_user_reservation",
4157 /* Q_GURV - GET_USER_RESERVATIONS */
4158 "get_user_reservations",
4174 /* Q_GUBR - GET_USER_BY_RESERVATION */
4175 "get_user_by_reservation",
4191 /* Q_DURV - DELETE_USER_RESERVATION */
4192 "delete_user_reservation",
4208 /* Q_GKUM - GET_KERBEROS_USER_MAP */
4209 "get_kerberos_user_map",
4215 "u.login, str.string FROM krbmap km, users u, strings str",
4218 "u.login LIKE '%s' AND str.string LIKE '%s' AND km.users_id = u.users_id AND km.string_id = str.string_id",
4220 "u.login, str.string",
4225 /* Q_AKUM - ADD_KERBEROS_USER_MAP */
4226 "add_kerberos_user_map",
4232 "INTO krbmap (users_id, string_id) VALUES (%d, %d)",
4242 /* Q_DKUM - DELETE_KERBEROS_USER_MAP */
4243 "delete_kerberos_user_map",
4252 "users_id = %d AND string_id = %d",
4259 /* Q_GFBL - GET_FINGER_BY_LOGIN */
4260 "get_finger_by_login",
4266 "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",
4276 /* Q_UFBL - UPDATE_FINGER_BY_LOGIN */
4277 "update_finger_by_login",
4283 "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))",
4293 /* Q_GPOB - GET_POBOX */
4300 "login, potype, users_id, CHR(0), TO_CHAR(pmodtime, 'DD-mon-YYYY HH24:MI:SS'), pmodby, pmodwith FROM users",
4310 /* Q_GAPO - GET_ALL_POBOXES */
4317 "login, potype, pop_id || ':' || box_id FROM users",
4327 /* Q_GPOP - GET_POBOXES_POP */
4334 "login, potype, users_id FROM users",
4344 /* Q_GPOF - GET_POBOXES_SMTP */
4351 "login, potype, users_id FROM users",
4361 /* Q_SPOB - SET_POBOX */
4378 /* Q_SPOP - SET_POBOX_POP */
4395 /* Q_DPOB - DELETE_POBOX */
4402 "users SET potype = 'NONE'",
4412 /* Q_GHST - GET_HOST, v2 */
4419 "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",
4422 "m.name LIKE UPPER('%s') AND m.address LIKE '%s' AND m.location LIKE UPPER('%s') AND s.name LIKE UPPER('%s') AND m.mach_id != 0 AND s.snet_id = m.snet_id",
4429 /* Q_GHST - GET_HOST, v6 */
4436 "m.name, m.vendor, m.model, m.os, m.location, m.contact, m.billing_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",
4439 "m.name LIKE UPPER('%s') AND m.address LIKE '%s' AND m.location LIKE UPPER('%s') AND s.name LIKE UPPER('%s') AND m.mach_id != 0 AND s.snet_id = m.snet_id",
4446 /* Q_GHST - GET_HOST, v8 */
4453 "m.name, m.vendor, m.model, m.os, m.location, m.contact, m.billing_contact, m.account_number, 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",
4456 "m.name LIKE UPPER('%s') AND m.address LIKE '%s' AND m.location LIKE UPPER('%s') AND s.name LIKE UPPER('%s') AND m.mach_id != 0 AND s.snet_id = m.snet_id",
4463 /* Q_GHBH - GET_HOST_BY_HWADDR, v2 */
4464 "get_host_by_hwaddr",
4470 "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",
4473 "m.hwaddr LIKE LOWER('%s') AND m.mach_id != 0 AND s.snet_id = m.snet_id",
4480 /* Q_GHBH - GET_HOST_BY_HWADDR, v6 */
4481 "get_host_by_hwaddr",
4487 "m.name, m.vendor, m.model, m.os, m.location, m.contact, m.billing_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",
4490 "m.hwaddr LIKE LOWER('%s') AND m.mach_id != 0 AND s.snet_id = m.snet_id",
4497 /* Q_GHBH - GET_HOST_BY_HWADDR, v8 */
4498 "get_host_by_hwaddr",
4504 "m.name, m.vendor, m.model, m.os, m.location, m.contact, m.billing_contact, m.account_number, 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",
4507 "m.hwaddr LIKE LOWER('%s') AND m.mach_id != 0 AND s.snet_id = m.snet_id",
4514 /* Q_GHBA - GET_HOST_BY_ACCOUNT_NUMBER, v8 */
4515 "get_host_by_account_number",
4521 "m.name, m.vendor, m.model, m.os, m.location, m.contact, m.billing_contact, m.account_number, 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",
4524 "m.account_number LIKE '%s' AND m.mach_id != 0 and s.snet_id = m.snet_id",
4531 /* Q_GHHA - GET_HOST_HWADDR */
4538 "m.hwaddr FROM machine m",
4541 "m.name LIKE UPPER('%s')",
4548 /* Q_AHST - ADD_HOST, v2 */ /* uses prefetch_value() for mach_id */
4555 "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)",
4565 /* Q_AHST - ADD_HOST, v6 */ /* uses prefetch_value() for mach_id */
4572 "INTO machine (name, vendor, model, os, location, contact, billing_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)), NVL('%s', CHR(0)), %s, %s, SYSDATE, %d, '%s', '%s', %d, %d, %d, SYSDATE, SYSDATE, %s, %s)",
4582 /* Q_AHST - ADD_HOST, v8 */ /* Uses prefetch_value() for mach_id */
4589 "INTO machine (name, vendor, model, os, location, contact, billing_contact, account_number, 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)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, %s, SYSDATE, %d, '%s', '%s', %d, %d, %d, SYSDATE, SYSDATE, %s, %s)",
4599 /* Q_UHST - UPDATE_HOST, v2 */
4606 "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",
4616 /* Q_UHST - UPDATE_HOST, v6 */
4623 "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)), billing_contact = NVL('%s', CHR(0)), use = %s, status = %s, snet_id = %d, address = '%s', owner_type = '%s', owner_id = %d, acomment = %d, ocomment = %d",
4633 /* Q_UHST - UPDATE_HOST, v8 */
4640 "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)), billing_contact = NVL('%s', CHR(0)), account_number = NVL('%s', CHR(0)), use = %s, status = %s, snet_id = %d, address = '%s', owner_type = '%s', owner_id = %d, acomment = %d, ocomment = %d",
4650 /* Q_UHHA - UPDATE_HOST_HWADDR */
4651 "update_host_hwaddr",
4657 "machine SET hwaddr = NVL('%s', CHR(0))",
4667 /* Q_DHST - DELETE_HOST */
4684 /* Q_GMAC - GET_MACHINE */
4691 "name, vendor, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM machine",
4694 "name LIKE UPPER('%s') AND mach_id != 0",
4701 /* Q_GHAL - GET_HOSTALIAS */
4708 "a.name, m.name FROM hostalias a, machine m",
4711 "m.mach_id = a.mach_id and a.name LIKE UPPER('%s') AND m.name LIKE UPPER('%s')",
4718 /* Q_AHAL - ADD_HOSTALIAS */
4725 "INTO hostalias (name, mach_id) VALUES (UPPER('%s'), %d)",
4735 /* Q_DHAL - DELETE_HOSTALIAS */
4745 "name = UPPER('%s') AND mach_id = %d",
4752 /* Q_GSNT - GET_SUBNET, v2 */
4759 "name, description, saddr, mask, low, high, prefix, owner_type, owner_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM subnet",
4762 "name LIKE UPPER('%s')",
4769 /* Q_GSNT - GET_SUBNET, v8 */
4776 "name, description, status, contact, account_number, saddr, mask, low, high, prefix, owner_type, owner_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM subnet",
4779 "name LIKE UPPER('%s')",
4786 /* Q_ASNT - ADD_SUBNET, v2 */
4793 "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)",
4803 /* Q_ASNT - ADD_SUBNET, v8 */
4810 "INTO subnet (name, description, status, contact, account_number, saddr, mask, low, high, prefix, owner_type, owner_id, snet_id) VALUES (UPPER('%s'), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, %s, %s, %s, NVL('%s', CHR(0)), '%s', %d, %s)",
4820 /* Q_USNT - UPDATE_SUBNET, v2 */
4827 "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",
4837 /* Q_USNT - UPDATE_SUBNET, v8 */
4844 "subnet SET name = UPPER('%s'), description = NVL('%s', CHR(0)), status = %s, contact = NVL('%s', CHR(0)), account_number = NVL('%s', CHR(0)), saddr = %s, mask = %s, low = %s, high = %s, prefix = NVL('%s', CHR(0)), owner_type = '%s', owner_id = %d",
4854 /* Q_DSNT - DELETE_SUBNET */
4871 /* Q_GCLU - GET_CLUSTER */
4878 "name, description, location, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM clusters",
4881 "name LIKE '%s' AND clu_id != 0",
4888 /* Q_ACLU - ADD_CLUSTER */ /* uses prefetch_value() for clu_id */
4895 "INTO clusters (name, description, location, clu_id) VALUES ('%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s)",
4905 /* Q_UCLU - UPDATE_CLUSTER */
4912 "clusters SET name = '%s', description = NVL('%s', CHR(0)), location = NVL('%s', CHR(0))",
4922 /* Q_DCLU - DELETE_CLUSTER */
4939 /* Q_GMCM - GET_MACHINE_TO_CLUSTER_MAP */
4940 "get_machine_to_cluster_map",
4946 "m.name, c.name FROM machine m, clusters c, mcmap mcm",
4949 "m.name LIKE UPPER('%s') AND c.name LIKE '%s' AND mcm.clu_id = c.clu_id AND mcm.mach_id = m.mach_id",
4956 /* Q_AMTC - ADD_MACHINE_TO_CLUSTER */
4957 "add_machine_to_cluster",
4963 "INTO mcmap (mach_id, clu_id) VALUES (%d, %d)",
4973 /* Q_DMFC - DELETE_MACHINE_FROM_CLUSTER */
4974 "delete_machine_from_cluster",
4983 "mach_id = %d AND clu_id = %d",
4990 /* Q_GCLD - GET_CLUSTER_DATA */
4997 "c.name, svc.serv_label, svc.serv_cluster FROM svc svc, clusters c",
5000 "c.clu_id = svc.clu_id AND c.name LIKE '%s' AND svc.serv_label LIKE '%s'",
5002 "c.name, svc.serv_label",
5007 /* Q_ACLD - ADD_CLUSTER_DATA */
5014 "INTO svc (clu_id, serv_label, serv_cluster) VALUES (%d, '%s', '%s')",
5024 /* Q_DCLD - DELETE_CLUSTER_DATA */
5025 "delete_cluster_data",
5034 "clu_id = %d AND serv_label = '%s' AND serv_cluster = '%s'",
5041 /* Q_GLIN - GET_LIST_INFO, v2 */
5048 "name, active, publicflg, hidden, maillist, grouplist, gid, acl_type, acl_id, description, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM list",
5058 /* Q_GLIN - GET_LIST_INFO, v3 */
5065 "name, active, publicflg, hidden, maillist, grouplist, gid, nfsgroup, acl_type, acl_id, description, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM list",
5075 /* Q_GLIN - GET_LIST_INFO, v4 */
5082 "name, active, publicflg, hidden, maillist, grouplist, gid, nfsgroup, acl_type, acl_id, memacl_type, memacl_id, description, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM list",
5092 /* Q_EXLN - EXPAND_LIST_NAMES */
5093 "expand_list_names",
5102 "name LIKE '%s' AND list_id != 0",
5109 /* Q_ALIS - ADD_LIST, v2 */ /* uses prefetch_value() for list_id */
5116 "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)",
5126 /* Q_ALIS - ADD_LIST, v3 */ /* uses prefetch_value() for list_id */
5133 "INTO list (name, active, publicflg, hidden, maillist, grouplist, gid, nfsgroup, acl_type, acl_id, description, list_id) VALUES ('%s', %s, %s, %s, %s, %s, %s, %s, '%s', %d, NVL('%s', CHR(0)), %s)",
5143 /* Q_ALIS - ADD_LIST, v4 */ /* uses prefetch_value() for list_id */
5150 "INTO list (name, active, publicflg, hidden, maillist, grouplist, gid, nfsgroup, acl_type, acl_id, memacl_type, memacl_id, description, list_id) VALUES ('%s', %s, %s, %s, %s, %s, %s, %s, '%s', %d, '%s', %d, NVL('%s', CHR(0)), %s)",
5160 /* Q_ULIS - UPDATE_LIST, v2 */
5167 "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))",
5177 /* Q_ULIS - UPDATE_LIST, v3 */
5184 "list SET name = '%s', active = %s, publicflg = %s, hidden = %s, maillist = %s, grouplist = %s, gid = %s, nfsgroup = %s, acl_type = '%s', acl_id = %d, description = NVL('%s', CHR(0))",
5194 /* Q_ULIS, UPDATE_LIST, v4 */
5201 "list SET name = '%s', active = %s, publicflg = %s, hidden = %s, maillist = %s, grouplist = %s, gid = %s, nfsgroup = %s, acl_type = '%s', acl_id = %d, memacl_type = '%s', memacl_id = %d, description = NVL('%s', CHR(0))",
5211 /* Q_DLIS - DELETE_LIST */
5228 /* Q_AMTL - ADD_MEMBER_TO_LIST */
5229 "add_member_to_list",
5245 /* Q_ATML - ADD_TAGGED_MEMBER_TO_LIST */
5246 "add_tagged_member_to_list",
5262 /* Q_TMOL - TAG_MEMBER_OF_LIST */
5263 "tag_member_of_list",
5279 /* Q_DMFL - DELETE_MEMBER_FROM_LIST */
5280 "delete_member_from_list",
5296 /* Q_GAUS - GET_ACE_USE */
5313 /* Q_GHBO - GET_HOST_BY_OWNER */
5314 "get_host_by_owner",
5330 /* Q_QGLI - QUALIFIED_GET_LISTS */
5331 "qualified_get_lists",
5347 /* Q_GMOL - GET_MEMBERS_OF_LIST */
5348 "get_members_of_list",
5364 /* Q_GEML - GET_END_MEMBERS_OF_LIST */
5365 "get_end_members_of_list",
5381 /* Q_GTML - GET_TAGGED_MEMBERS_OF_LIST */
5382 "get_tagged_members_of_list",
5398 /* Q_GLOM - GET_LISTS_OF_MEMBER */
5399 "get_lists_of_member",
5415 /* Q_CMOL - COUNT_MEMBERS_OF_LIST */
5416 "count_members_of_list",
5432 /* Q_GSIN - GET_SERVER_INFO */
5439 "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",
5442 "name LIKE UPPER('%s')",
5449 /* Q_QGSV - QUALIFIED_GET_SERVER */
5450 "qualified_get_server",
5466 /* Q_ASIN - ADD_SERVER_INFO */
5473 "INTO servers (name, update_int, target_file, script, type, enable, acl_type, acl_id) VALUES (UPPER('%s'), %s, '%s', '%s', '%s', %s, '%s', %d)",
5483 /* Q_USIN - UPDATE_SERVER_INFO */
5484 "update_server_info",
5490 "servers SET update_int = %s, target_file = '%s', script = '%s', type = '%s', enable = %s, acl_type = '%s', acl_id = %d",
5493 "name = UPPER('%s')",
5500 /* Q_RSVE - RESET_SERVER_ERROR */
5501 "reset_server_error",
5507 "servers SET harderror = 0, dfcheck = dfgen",
5510 "name = UPPER('%s')",
5517 /* Q_SSIF - SET_SERVER_INTERNAL_FLAGS */
5518 "set_server_internal_flags",
5524 "servers SET dfgen = %s, dfcheck = %s, inprogress = %s, harderror = %s, errmsg = NVL('%s', CHR(0))",
5527 "name = UPPER('%s')",
5534 /* Q_DSIN - DELETE_SERVER_INFO */
5535 "delete_server_info",
5544 "name = UPPER('%s')",
5551 /* Q_GSHI - GET_SERVER_HOST_INFO */
5552 "get_server_host_info",
5558 "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",
5561 "sh.service LIKE UPPER('%s') AND m.name LIKE UPPER('%s') AND m.mach_id = sh.mach_id",
5563 "sh.service, m.name",
5568 /* Q_QGSH - QUALIFIED_GET_SERVER_HOST */
5569 "qualified_get_server_host",
5585 /* Q_ASHI - ADD_SERVER_HOST_INFO */
5586 "add_server_host_info",
5592 "INTO serverhosts (service, mach_id, enable, value1, value2, value3) VALUES (UPPER('%s'), %d, %s, %s, %s, NVL('%s', CHR(0)))",
5602 /* Q_USHI - UPDATE_SERVER_HOST_INFO */
5603 "update_server_host_info",
5609 "serverhosts SET enable = %s, value1 = %s, value2 = %s, value3 = NVL('%s', CHR(0))",
5612 "service = UPPER('%s') AND mach_id = %d",
5619 /* Q_RSHE - RESET_SERVER_HOST_ERROR */
5620 "reset_server_host_error",
5626 "serverhosts SET hosterror = 0",
5629 "service = UPPER('%s') AND mach_id = %d",
5636 /* Q_SSHO - SET_SERVER_HOST_OVERRIDE */
5637 "set_server_host_override",
5643 "serverhosts SET override = 1",
5646 "service = UPPER('%s') AND mach_id = %d",
5653 /* Q_SSHI - SET_SERVER_HOST_INTERNAL */
5654 "set_server_host_internal",
5660 "serverhosts SET override = %s, success = %s, inprogress = %s, hosterror = %s, hosterrmsg = NVL('%s', CHR(0)), ltt = %s, lts = %s",
5663 "service = UPPER('%s') AND mach_id = %d",
5670 /* Q_DSHI - DELETE_SERVER_HOST_INFO */
5671 "delete_server_host_info",
5680 "service = UPPER('%s') AND mach_id = %d",
5687 /* Q_GSLO - GET_SERVER_LOCATIONS */
5688 "get_server_locations",
5694 "sh.service, m.name FROM serverhosts sh, machine m",
5697 "sh.service LIKE UPPER('%s') AND sh.mach_id = m.mach_id",
5699 "sh.service, m.name",
5704 /* Q_GFSL - GET_FILESYS_BY_LABEL */
5705 "get_filesys_by_label",
5711 "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",
5714 "fs.label LIKE '%s' AND fs.mach_id = m.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id",
5721 /* Q_GFSM - GET_FILESYS_BY_MACHINE */
5722 "get_filesys_by_machine",
5728 "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",
5731 "fs.mach_id = %d AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id",
5738 /* Q_GFSN - GET_FILESYS_BY_NFSPHYS */
5739 "get_filesys_by_nfsphys",
5745 "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",
5748 "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'",
5755 /* Q_GFSG - GET_FILESYS_BY_GROUP */
5756 "get_filesys_by_group",
5762 "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",
5765 "fs.owners = %d AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id",
5772 /* Q_GFSP - GET_FILESYS_BY_PATH */
5773 "get_filesys_by_path",
5779 "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",
5782 "fs.name LIKE '%s' AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = list_id",
5789 /* Q_AFIL - ADD_FILESYS */ /* uses prefetch_value() for filsys_id */
5796 "INTO filesys (label, type, mach_id, name, mount, rwaccess, comments, owner, owners, createflg, lockertype, filsys_id) VALUES ('%s', '%s', %d, NVL('%s', CHR(0)), NVL('%s', CHR(0)), '%s', NVL('%s', CHR(0)), %d, %d, %s, '%s', %s)",
5806 /* Q_UFIL - UPDATE_FILESYS */
5813 "filesys SET label = '%s', type = '%s', mach_id = %d, name = NVL('%s', CHR(0)), mount = NVL('%s', CHR(0)), rwaccess = '%s', comments = NVL('%s', CHR(0)), owner = %d, owners = %d, createflg = %s, lockertype = '%s'",
5823 /* Q_DFIL - DELETE_FILESYS */
5840 /* Q_GFGM - GET_FSGROUP_MEMBERS */
5841 "get_fsgroup_members",
5847 "fs.label, fg.key FROM fsgroup fg, filesys fs",
5850 "fg.group_id = %d AND fs.filsys_id = fg.filsys_id",
5857 /* Q_AFTG - ADD_FILESYS_TO_FSGROUP */
5858 "add_filesys_to_fsgroup",
5864 "INTO fsgroup (group_id, filsys_id, key) VALUES (%d, %d, '%s')",
5874 /* Q_RFFG - REMOVE_FILESYS_FROM_FSGROUP */
5875 "remove_filesys_from_fsgroup",
5884 "group_id = %d AND filsys_id = %d",
5891 /* Q_GANF - GET_ALL_NFSPHYS */
5898 "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",
5901 "m.mach_id = np.mach_id",
5908 /* Q_GNFP - GET_NFSPHYS */
5915 "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",
5918 "np.mach_id = %d AND np.dir LIKE '%s' AND m.mach_id = np.mach_id",
5925 /* Q_ANFP - ADD_NFSPHYS */ /* uses prefetch_value() for nfsphys_id */
5932 "INTO nfsphys (mach_id, dir, device, status, allocated, partsize, nfsphys_id) VALUES (%d, '%s', NVL('%s', CHR(0)), %s, %s, %s, %s)",
5942 /* Q_UNFP - UPDATE_NFSPHYS */
5949 "nfsphys SET device = NVL('%s', CHR(0)), status = %s, allocated = %s, partsize = %s",
5952 "mach_id = %d AND dir = '%s'",
5959 /* Q_AJNF - ADJUST_NFSPHYS_ALLOCATION */
5960 "adjust_nfsphys_allocation",
5966 "nfsphys SET allocated = allocated + %s",
5969 "mach_id = %d AND dir = '%s'",
5976 /* Q_DNFP - DELETE_NFSPHYS */
5986 "mach_id = %d AND dir = '%s'",
5993 /* Q_GQOT - GET_QUOTA */
6000 "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",
6003 "fs.label LIKE '%s' AND q.type = '%s' AND q.entity_id = %d AND fs.filsys_id = q.filsys_id AND m.mach_id = fs.mach_id",
6010 /* Q_GQBF - GET_QUOTA_BY_FILESYS */
6011 "get_quota_by_filesys",
6017 "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",
6020 "fs.label LIKE '%s' AND fs.filsys_id = q.filsys_id AND m.mach_id = fs.mach_id",
6027 /* Q_AQOT - ADD_QUOTA */ /* prefetch_filsys() gets last 1 value */
6034 "INTO quota (filsys_id, type, entity_id, quota, phys_id) VALUES ('%s', %d, %d, %s, %s)",
6044 /* Q_UQOT - UPDATE_QUOTA */
6051 "quota SET quota = %s",
6061 /* Q_DQOT - DELETE_QUOTA */
6078 /* Q_GNFQ - GET_NFS_QUOTAS */
6085 "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",
6088 "fs.label LIKE '%s' AND q.type = 'USER' AND q.entity_id = u.users_id AND fs.filsys_id = q.filsys_id AND m.mach_id = fs.mach_id AND u.login = '%s'",
6090 "fs.label, u.login",
6095 /* Q_GNQP - GET_NFS_QUOTAS_BY_PARTITION */
6096 "get_nfs_quotas_by_partition",
6102 "fs.label, u.login, q.quota, np.dir, m.name FROM quota q, filesys fs, users u, nfsphys np, machine m",
6105 "np.mach_id = %d AND np.dir LIKE '%s' AND q.phys_id = np.nfsphys_id AND fs.filsys_id = q.filsys_id AND q.type = 'USER' AND u.users_id = q.entity_id AND m.mach_id = np.mach_id",
6112 /* Q_ANFQ - ADD_NFS_QUOTA */ /* prefetch_filsys() gets last 1 value */
6119 "INTO quota (type, filsys_id, entity_id, quota, phys_id ) VALUES ('USER', %d, %d, %s, %s)",
6129 /* Q_UNFQ - UPDATE_NFS_QUOTA */
6136 "quota SET quota = %s",
6146 /* Q_DNFQ - DELETE_NFS_QUOTA */
6163 /* Q_GZCL - GET_ZEPHYR_CLASS, v2 */
6170 "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",
6180 /* Q_GZCL - GET_ZEPHYR_CLASS, v5 */
6187 "class, xmt_type, xmt_id, sub_type, sub_id, iws_type, iws_id, iui_type, iui_id, owner_type, owner_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM zephyr",
6197 /* Q_AZCL - ADD_ZEPHYR_CLASS, v2 */
6204 "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)",
6214 /* Q_AZCL - ADD_ZEPHYR_CLASS, v5 */
6221 "INTO zephyr (class, xmt_type, xmt_id, sub_type, sub_id, iws_type, iws_id, iui_type, iui_id, owner_type, owner_id) VALUES ('%s', '%s', %d, '%s', %d, '%s', %d, '%s', %d, '%s', %d)",
6231 /* Q_UZCL - UPDATE_ZEPHYR_CLASS, v2 */
6232 "update_zephyr_class",
6238 "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",
6248 /* Q_UZCL - UPDATE_ZEPHYR_CLASS, v5 */
6249 "update_zephyr_class",
6255 "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, owner_type = '%s', owner_id = %d",
6265 /* Q_DZCL - DELETE_ZEPHYR_CLASS */
6266 "delete_zephyr_class",
6282 /* Q_GSHA - GET_SERVER_HOST_ACCESS */
6283 "get_server_host_access",
6289 "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",
6292 "m.name LIKE UPPER('%s') AND ha.mach_id = m.mach_id",
6299 /* Q_ASHA - ADD_SERVER_HOST_ACCESS */
6300 "add_server_host_access",
6306 "INTO hostaccess (mach_id, acl_type, acl_id) VALUES (%d, '%s', %d)",
6316 /* Q_USHA - UPDATE_SERVER_HOST_ACCESS */
6317 "update_server_host_access",
6323 "hostaccess SET acl_type = '%s', acl_id = %d",
6333 /* Q_DSHA - DELETE_SERVER_HOST_ACCESS */
6334 "delete_server_host_access",
6350 /* Q_GACL - GET_ACL */
6357 "m.name, ac.target, ac.kind, l.name FROM acl ac, machine m, list l",
6360 "m.mach_id = %d AND m.mach_id = ac.mach_id AND ac.target LIKE '%s' AND l.list_id = ac.list_id",
6362 "m.name, ac.target, ac.kind",
6367 /* Q_AACL - ADD_ACL */
6374 "INTO acl (mach_id, target, kind, list_id) VALUES (%d, '%s', '%s', %d)",
6384 /* Q_DACL - DELETE_ACL */
6394 "mach_id = %d AND target = '%s'",
6401 /* Q_GSVC - GET_SERVICE */
6408 "name, protocol, port, description, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM services",
6411 "name LIKE '%s' AND protocol LIKE '%s'",
6418 /* Q_ASVC - ADD_SERVICE */
6425 "INTO services (name, protocol, port, description) VALUES ('%s', '%s', %s, NVL('%s', CHR(0)))",
6435 /* Q_DSVC - DELETE_SERVICE */
6445 "name = '%s' AND protocol = '%s'",
6452 /* Q_GPRN - GET_PRINTER */
6459 "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
6462 "pr.name LIKE '%s' AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl",
6469 /* Q_GPBD - GET_PRINTER_BY_DUPLEXNAME */
6470 "get_printer_by_duplexname",
6476 "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
6479 "pr.duplexname LIKE '%s' AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl",
6486 /* Q_GPBE - GET_PRINTER_BY_ETHERNET */
6487 "get_printer_by_ethernet",
6493 "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
6496 "m1.hwaddr LIKE LOWER('%s') AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl",
6503 /* Q_GPBH - GET_PRINTER_BY_HOSTNAME */
6504 "get_printer_by_hostname",
6510 "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
6513 "m1.name LIKE UPPER('%s') AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl",
6520 /* Q_GPBR - GET_PRINTER_BY_RM */
6521 "get_printer_by_rm",
6527 "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
6530 "m3.name LIKE UPPER('%s') AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl",
6537 /* Q_GPBL - GET_PRINTER_BY_LOCATION */
6538 "get_printer_by_location",
6544 "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
6547 "UPPER(pr.location) LIKE UPPER('%s') AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl",
6554 /* Q_GPBC - GET_PRINTER_BY_CONTACT */
6555 "get_printer_by_contact",
6561 "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
6564 "UPPER(pr.contact) LIKE UPPER('%s') AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl",
6571 /* Q_APRN - ADD_PRINTER */
6578 "INTO printers (name, type, hwtype, duplexname, mach_id, loghost, rm, rp, rq, ka, pc, ac, lpc_acl, banner, location, contact) VALUES ('%s', '%s', '%s', NVL('%s', CHR(0)), %d, %d, %d, NVL('%s', CHR(0)), %d, %s, %s, %d, %d, %s, NVL('%s', CHR(0)), NVL('%s', CHR(0)))",
6588 /* Q_UPRN - UPDATE_PRINTER */
6595 "printers SET name = '%s', type = '%s', hwtype = '%s', duplexname = NVL('%s', CHR(0)), mach_id = %d, loghost = %d, rm = %d, rp = NVL('%s', CHR(0)), rq = %d, ka = %d, pc = %d, ac = %d, lpc_acl = %d, banner = %d, location = NVL('%s', CHR(0)), contact = NVL('%s', CHR(0))",
6605 /* Q_DPRN - DELETE_PRINTER */
6622 /* Q_GPSV - GET_PRINT_SERVER */
6629 "m.name, ps.kind, s.string, ps.owner_type, ps.owner_id, l.name, TO_CHAR(ps.modtime, 'DD-mon-YYYY HH24:MI:SS'), ps.modby, ps.modwith FROM printservers ps, machine m, strings s, list l",
6632 "ps.mach_id = %d AND m.mach_id = ps.mach_id AND s.string_id = ps.printer_types AND l.list_id = ps.lpc_acl",
6639 /* Q_APSV - ADD_PRINT_SERVER */
6646 "INTO printservers (mach_id, kind, printer_types, owner_type, owner_id, lpc_acl) VALUES (%d, '%s', %d, '%s', %d, %d)",
6656 /* Q_UPSV - UPDATE_PRINT_SERVER */
6657 "update_print_server",
6663 "printservers SET kind = '%s', printer_types = %d, owner_type = '%s', owner_id = %d, lpc_acl = %d",
6673 /* Q_DPSV - DELETE_PRINT_SERVER */
6674 "delete_print_server",
6690 /* Q_GALI - GET_ALIAS */
6697 "name, type, trans FROM alias",
6700 "name LIKE '%s' AND type LIKE '%s' AND trans LIKE '%s'",
6702 "type, name, trans",
6707 /* Q_AALI - ADD_ALIAS */
6714 "INTO alias (name, type, trans) VALUES ('%s', '%s', '%s')",
6724 /* Q_DALI - DELETE_ALIAS */
6734 "name = '%s' AND type = '%s' AND trans = '%s'",
6741 /* Q_GVAL - GET_VALUE */
6748 "value FROM numvalues",
6758 /* Q_AVAL - ADD_VALUE */
6765 "INTO numvalues (name, value) VALUES ('%s', %s)",
6775 /* Q_UVAL - UPDATE_VALUE */
6782 "numvalues SET value = %s",
6792 /* Q_DVAL - DELETE_VALUE */
6809 /* Q_GATS - GET_ALL_TABLE_STATS */
6810 "get_all_table_stats",
6816 "table_name, appends, updates, deletes, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS') FROM tblstats",
6826 /* Q__SDL - _SET_DEBUG_LEVEL */
6843 /* Q_GUSL - GET_USER_SIDS_BY_LOGIN, v4 */
6844 "get_user_sids_by_login",
6850 "u.login, us.sid, TO_CHAR(us.created, 'YYYY-MM-DD HH24:MI:SS') FROM users u, usersids us",
6853 "us.users_id = %d AND u.users_id = us.users_id AND SUBSTR(us.sid, 1, LENGTH(us.sid)-8) = '%s'",
6860 /* Q_AUSL - ADD_USER_SID_BY_LOGIN, v4 */
6861 "add_user_sid_by_login",
6867 "INTO usersids (users_id, sid) VALUES (%d, '%s')",
6877 /* Q_GLSN - GET_LIST_SIDS_BY_NAME, v4 */
6878 "get_list_sids_by_name",
6884 "l.name, ls.sid, TO_CHAR(ls.created, 'YYYY-MM-DD HH24:MI:SS') FROM list l, listsids ls",
6887 "ls.list_id = %d AND l.list_id = ls.list_id AND SUBSTR(ls.sid, 1, LENGTH(ls.sid)-8) = '%s'",
6894 /* Q_ALSN - ADD_LIST_SID_BY_NAME, v4 */
6895 "add_list_sid_by_name",
6901 "INTO listsids (list_id, sid) VALUES (%d, '%s')",
6911 /* Q_GDDS - GET_DISTINCT_DOMAIN_SIDS, v4 */
6912 "get_distinct_domain_sids",
6918 "DISTINCT SUBSTR(sid, 1, LENGTH(sid)-8) FROM usersids",
6928 /* Q_GCON - GET_CONTAINER, v7 */
6935 "name, description, location, contact, acl_type, acl_id, memacl_type, memacl_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM containers",
6938 "name = '%s' AND cnt_id != 0",
6945 /* Q_ACON - ADD_CONTAINER, v7 */ /* uses prefetch_value() for cnt_id */
6952 "INTO containers (name, description, location, contact, acl_type, acl_id, memacl_type, memacl_id, cnt_id) VALUES ('%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), '%s', %d, '%s', %d, %s)",
6962 /* Q_UCON - UPDATE_CONTAINER, v7 */
6979 /* Q_DCON - DELETE_CONTAINER, v7 */
6996 /* Q_AMCN - ADD_MACHINE_TO_CONTAINER, v7 */
6997 "add_machine_to_container",
7003 "INTO mcntmap (mach_id, cnt_id) VALUES (%d, %d)",
7013 /* Q_DMCN - DELETE_MACHINE_FROM_CONTAINER, v7 */
7014 "delete_machine_from_container",
7023 "mach_id = %d AND cnt_id = %d",
7030 /* Q_GMNM - GET_MACHINE_TO_CONTAINER_MAP, v7 */
7031 "get_machine_to_container_map",
7037 "m.name, c.name FROM machine m, containers c, mcntmap mcn",
7040 "m.name = UPPER('%s') AND mcn.cnt_id = c.cnt_id AND mcn.mach_id = m.mach_id",
7047 /* Q_GMOC - GET_MACHINES_OF_CONTAINER, v7 */
7048 "get_machines_of_container",
7064 /* Q_GSOC - GET_SUBCONTAINERS_OF_CONTAINER, v7 */
7065 "get_subcontainers_of_container",
7081 /* Q_GTLC - GET_TOPLEVEL_CONTAINERS, v7 */
7082 "get_toplevel_containers",
7088 "name FROM containers",
7091 "name NOT LIKE '%%/%%'",
7099 int QueryCount = (sizeof(Queries) / sizeof(struct query));