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",
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",
108 static struct validate gubl_validate =
121 static char *guau2_fields[] = {
123 "login", "unix_uid", "shell", "last", "first", "middle", "status",
124 "clearid", "class", "comments", "signature", "secure",
125 "modtime", "modby", "modwith",
128 static char *guau_fields[] = {
130 "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
131 "status", "clearid", "class", "comments", "signature", "secure",
132 "modtime", "modby", "modwith",
135 static char *guan2_fields[] = {
137 "login", "unix_uid", "shell", "last", "first", "middle", "status",
138 "clearid", "class", "comments", "signature", "secure",
139 "modtime", "modby", "modwith",
142 static char *guan_fields[] = {
144 "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
145 "status", "clearid", "class", "comments", "signature", "secure",
146 "modtime", "modby", "modwith",
149 static struct validate guan_validate =
162 static char *guac2_fields[] = {
164 "login", "unix_uid", "shell", "last", "first", "middle", "status",
165 "clearid", "class", "comments", "signature", "secure",
166 "modtime", "modby", "modwith",
169 static char *guac_fields[] = {
171 "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
172 "status", "clearid", "class", "comments", "signature", "secure",
173 "modtime", "modby", "modwith",
176 static char *guam2_fields[] = {
178 "login", "unix_uid", "shell", "last", "first", "middle", "status",
179 "clearid", "class", "comments", "signature", "secure",
180 "modtime", "modby", "modwith",
183 static char *guam_fields[] = {
185 "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
186 "status", "clearid", "class", "comments", "signature", "secure",
187 "modtime", "modby", "modwith",
190 static char *gubu2_fields[] = {
192 "login", "unix_uid", "shell", "last", "first", "middle", "status",
193 "clearid", "class", "modtime", "modby", "modwith",
196 static char *gubu_fields[] = {
198 "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
199 "status", "clearid", "class", "modtime", "modby", "modwith",
202 static struct validate gubu_validate =
215 static char *gubn2_fields[] = {
217 "login", "unix_uid", "shell", "last", "first", "middle", "status",
218 "clearid", "class", "modtime", "modby", "modwith",
221 static char *gubn_fields[] = {
223 "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
224 "status", "clearid", "class", "modtime", "modby", "modwith",
227 static struct validate gubn_validate =
240 static char *gubc2_fields[] = {
242 "login", "unix_uid", "shell", "last", "first", "middle", "status",
243 "clearid", "class", "modtime", "modby", "modwith",
246 static char *gubc_fields[] = {
248 "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
249 "status", "clearid", "class", "modtime", "modby", "modwith",
252 static char *gubm2_fields[] = {
254 "login", "unix_uid", "shell", "last", "first", "middle", "status",
255 "clearid", "class", "modtime", "modby", "modwith",
258 static char *gubm_fields[] = {
260 "login", "unix_uid", "shell", "winconsoleshell", "last", "first",
261 "middle", "status", "clearid", "class", "modtime", "modby", "modwith",
264 static char *auac2_fields[] = {
265 "login", "unix_uid", "shell", "last", "first", "middle", "status",
266 "clearid", "class", "comments", "signature", "secure",
269 static char *auac_fields[] = {
270 "login", "unix_uid", "shell", "winconsoleshell", "last", "first",
271 "middle", "status", "clearid", "class", "comments", "signature", "secure",
274 static struct valobj auac2_valobj[] = {
275 {V_CHAR, 0, USERS_TABLE, "login"},
277 {V_CHAR, 2, USERS_TABLE, "shell"},
278 {V_CHAR, 3, USERS_TABLE, "last"},
279 {V_CHAR, 4, USERS_TABLE, "first"},
280 {V_CHAR, 5, USERS_TABLE, "middle"},
282 {V_CHAR, 7, USERS_TABLE, "clearid"},
283 {V_TYPE, 8, 0, "class", 0, MR_BAD_CLASS},
284 {V_ID, 9, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
288 static struct valobj auac_valobj[] = {
289 {V_CHAR, 0, USERS_TABLE, "login"},
291 {V_CHAR, 2, USERS_TABLE, "shell"},
292 {V_CHAR, 3, USERS_TABLE, "winconsoleshell"},
293 {V_CHAR, 4, USERS_TABLE, "last"},
294 {V_CHAR, 5, USERS_TABLE, "first"},
295 {V_CHAR, 6, USERS_TABLE, "middle"},
297 {V_CHAR, 8, USERS_TABLE, "clearid"},
298 {V_TYPE, 9, 0, "class", 0, MR_BAD_CLASS},
299 {V_ID, 10, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
303 static struct validate auac2_validate = {
315 static struct validate auac_validate = {
327 static struct validate ausr2_validate = {
339 static struct validate ausr_validate = {
351 static char *rusr_fields[] = {
352 "unix_uid", "login", "pobox_type"
355 static struct valobj rusr_valobj[] = {
357 {V_CHAR, 1, USERS_TABLE, "login"},
360 static struct validate rusr_validate = {
372 static char *uuac2_fields[] = {
374 "newlogin", "unix_uid", "shell", "last", "first", "middle", "status",
375 "clearid", "class", "comments", "signature", "secure",
378 static char *uuac_fields[] = {
380 "newlogin", "unix_uid", "shell", "winconsoleshell", "last", "first",
381 "middle", "status", "clearid", "class", "comments", "signature", "secure",
384 static struct valobj uuac2_valobj[] = {
385 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
386 {V_RENAME, 1, USERS_TABLE, "login", "users_id", MR_NOT_UNIQUE},
388 {V_CHAR, 3, USERS_TABLE, "shell"},
389 {V_CHAR, 4, USERS_TABLE, "first"},
390 {V_CHAR, 5, USERS_TABLE, "last"},
391 {V_CHAR, 6, USERS_TABLE, "middle"},
393 {V_CHAR, 8, USERS_TABLE, "clearid"},
394 {V_TYPE, 9, 0, "class", 0, MR_BAD_CLASS},
395 {V_ID, 10, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
399 static struct valobj uuac_valobj[] = {
400 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
401 {V_RENAME, 1, USERS_TABLE, "login", "users_id", MR_NOT_UNIQUE},
403 {V_CHAR, 3, USERS_TABLE, "shell"},
404 {V_CHAR, 4, USERS_TABLE, "winconsoleshell"},
405 {V_CHAR, 5, USERS_TABLE, "first"},
406 {V_CHAR, 6, USERS_TABLE, "last"},
407 {V_CHAR, 7, USERS_TABLE, "middle"},
409 {V_CHAR, 9, USERS_TABLE, "clearid"},
410 {V_TYPE, 10, 0, "class", 0, MR_BAD_CLASS},
411 {V_ID, 11, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
415 static struct validate uuac2_validate = {
427 static struct validate uuac_validate = {
439 static struct validate uusr2_validate = {
451 static struct validate uusr_validate = {
463 static char *uush_fields[] = {
468 static struct valobj uush_valobj[] = {
469 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
470 {V_CHAR, 1, USERS_TABLE, "shell"},
473 static struct validate uush_validate = {
485 static char *uuws_fields[] = {
490 static struct valobj uuws_valobj[] = {
491 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
492 {V_CHAR, 1, USERS_TABLE, "winconsoleshell"},
495 static struct validate uuws_validate = {
507 static char *uust_fields[] = {
512 static char *uuss_fields[] = {
517 static struct valobj uust_valobj[] = {
518 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
523 static struct validate uust_validate = {
535 static char *dusr_fields[] = {
539 static struct validate dusr_validate = {
551 static char *aurv_fields[] = {
552 "login", "reservation",
555 static struct validate aurv_validate = {
567 static char *gurv_fields[] = {
572 static struct validate gurv_validate = {
581 get_user_reservations,
584 static char *gubr_fields[] = {
589 static struct validate gubr_validate = {
598 get_user_by_reservation,
601 static char *gkum_fields[] = { "login", "kerberos",
602 "login", "kerberos" };
604 static char *akum_fields[] = { "login", "kerberos" };
606 static struct valobj akum_valobj[] =
608 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
609 {V_ID, 1, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
612 static struct validate akum_validate =
617 "users_id = %d or string_id = %d",
625 static struct validate dkum_validate =
630 "users_id = %d and string_id = %d",
638 static char *gfbl_fields[] = {
640 "login", "fullname", "nickname", "home_addr",
641 "home_phone", "office_addr", "office_phone", "department",
642 "affiliation", "modtime", "modby", "modwith",
645 static struct validate gfbl_validate = {
657 static char *ufbl_fields[] = {
659 "fullname", "nickname", "home_addr",
660 "home_phone", "office_addr", "office_phone", "department",
664 static struct valobj ufbl_valobj[] = {
665 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
666 {V_LEN, 1, USERS_TABLE, "fullname"},
667 {V_LEN, 2, USERS_TABLE, "nickname"},
668 {V_LEN, 3, USERS_TABLE, "home_addr"},
669 {V_LEN, 4, USERS_TABLE, "home_phone"},
670 {V_LEN, 5, USERS_TABLE, "office_addr"},
671 {V_LEN, 6, USERS_TABLE, "office_phone"},
672 {V_LEN, 7, USERS_TABLE, "department"},
673 {V_LEN, 8, USERS_TABLE, "affiliation"},
676 static struct validate ufbl_validate = {
688 static char *gpob_fields[] = {
690 "login", "type", "box", "address", "modtime", "modby", "modwith",
693 static struct validate gpob_validate = {
697 "potype != 'NONE' and users_id = %d",
705 static char *gpox_fields[] = {
706 "login", "type", "box",
709 static struct validate gpox_validate = {
721 static char *spob_fields[] = {
722 "login", "type", "box",
725 static struct valobj spob_valobj[] = {
726 {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
727 {V_TYPE, 1, 0, "pobox", 0, MR_TYPE},
730 static struct validate spob_validate = /* SET_POBOX */
743 static struct validate spop_validate = /* SET_POBOX_POP */
756 static struct validate dpob_validate = /* DELETE_POBOX */
769 static char *gmac_fields[] = {
771 "name", "type", "modtime", "modby", "modwith",
774 static char *ghst2_fields[] = {
775 "name", "address", "location", "network",
776 "name", "vendor", "model", "os", "location", "contact", "use",
777 "status", "status_change", "network", "address", "ace_type",
778 "ace_name", "admin_comment", "ops_comment", "created", "creator",
779 "inuse", "modtime", "modby", "modwith",
782 static char *ghbh2_fields[] = {
784 "name", "vendor", "model", "os", "location", "contact", "use",
785 "status", "status_change", "network", "address", "ace_type",
786 "ace_name", "admin_comment", "ops_comment", "created", "creator",
787 "inuse", "modtime", "modby", "modwith",
790 static char *ghst6_fields[] = {
791 "name", "address", "location", "network",
792 "name", "vendor", "model", "os", "location", "contact", "billing_contact",
793 "use", "status", "status_change", "network", "address", "ace_type",
794 "ace_name", "admin_comment", "ops_comment", "created", "creator",
795 "inuse", "modtime", "modby", "modwith",
798 static char *ghbh6_fields[] = {
800 "name", "vendor", "model", "os", "location", "contact", "billing_contact",
801 "use", "status", "status_change", "network", "address", "ace_type",
802 "ace_name", "admin_comment", "ops_comment", "created", "creator",
803 "inuse", "modtime", "modby", "modwith",
806 static char *ghst_fields[] = {
807 "name", "address", "location", "network",
808 "name", "vendor", "model", "os", "location", "contact", "billing_contact",
809 "account_number", "use", "status", "status_change", "network", "address",
810 "ace_type", "ace_name", "admin_comment", "ops_comment", "created", "creator",
811 "inuse", "modtime", "modby", "modwith",
814 static char *ghbh_fields[] = {
816 "name", "vendor", "model", "os", "location", "contact", "billing_contact",
817 "account_number", "use", "status", "status_change", "network", "address",
818 "ace_type", "ace_name", "admin_comment", "ops_comment", "created", "creator",
819 "inuse", "modtime", "modby", "modwith",
822 static char *ghba_fields[] = {
824 "name", "vendor", "model", "os", "location", "contact", "billing_contact",
825 "account_number", "use", "status", "status_change", "network", "address",
826 "ace_type", "ace_name", "admin_comment", "ops_comment", "created", "creator",
827 "inuse", "modtime", "modby", "modwith",
830 static struct validate ghst_validate = {
842 static char *ghha_fields[] = {
847 static char *ahst2_fields[] = {
848 "name", "vendor", "model", "os", "location", "contact", "use",
849 "status", "subnet", "address", "ace_type", "ace_name",
850 "admin_comment", "ops_comment",
853 static struct valobj ahst2_valobj[] = {
854 {V_CHAR, 0, MACHINE_TABLE, "name"},
855 {V_CHAR, 1, MACHINE_TABLE, "vendor"},
856 {V_CHAR, 2, MACHINE_TABLE, "model"},
857 {V_CHAR, 3, MACHINE_TABLE, "os"},
858 {V_CHAR, 4, MACHINE_TABLE, "location"},
859 {V_CHAR, 5, MACHINE_TABLE, "contact"},
862 {V_ID, 8, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
863 {V_TYPE, 10, 0, "ace_type", 0, MR_ACE},
864 {V_TYPEDATA, 11, 0, 0, 0, MR_ACE},
865 {V_ID, 12, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
866 {V_ID, 13, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
869 static struct validate ahst2_validate = {
873 "name = UPPER('%s')",
878 set_uppercase_modtime,
881 static char *ahst6_fields[] = {
882 "name", "vendor", "model", "os", "location", "contact", "billing_contact",
883 "use", "status", "subnet", "address", "ace_type", "ace_name",
884 "admin_comment", "ops_comment",
887 static struct valobj ahst6_valobj[] = {
888 {V_CHAR, 0, MACHINE_TABLE, "name"},
889 {V_CHAR, 1, MACHINE_TABLE, "vendor"},
890 {V_CHAR, 2, MACHINE_TABLE, "model"},
891 {V_CHAR, 3, MACHINE_TABLE, "os"},
892 {V_CHAR, 4, MACHINE_TABLE, "location"},
893 {V_CHAR, 5, MACHINE_TABLE, "contact"},
894 {V_CHAR, 6, MACHINE_TABLE, "billing_contact"},
897 {V_ID, 9, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
898 {V_TYPE, 11, 0, "ace_type", 0, MR_ACE},
899 {V_TYPEDATA, 12, 0, 0, 0, MR_ACE},
900 {V_ID, 13, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
901 {V_ID, 14, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
904 static struct validate ahst6_validate = {
908 "name = UPPER('%s')",
913 set_uppercase_modtime,
916 static char *ahst_fields[] = {
917 "name", "vendor", "model", "os", "location", "contact", "billing_contact",
918 "account_number", "use", "status", "subnet", "address", "ace_type",
919 "ace_name", "admin_comment", "ops_comment",
922 static struct valobj ahst_valobj[] = {
923 {V_CHAR, 0, MACHINE_TABLE, "name"},
924 {V_CHAR, 1, MACHINE_TABLE, "vendor"},
925 {V_CHAR, 2, MACHINE_TABLE, "model"},
926 {V_CHAR, 3, MACHINE_TABLE, "os"},
927 {V_CHAR, 4, MACHINE_TABLE, "location"},
928 {V_CHAR, 5, MACHINE_TABLE, "contact"},
929 {V_CHAR, 6, MACHINE_TABLE, "billing_contact"},
930 {V_CHAR, 7, MACHINE_TABLE, "account_number"},
933 {V_ID, 10, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
934 {V_TYPE, 12, 0, "ace_type", 0, MR_ACE},
935 {V_TYPEDATA, 13, 0, 0, 0, MR_ACE},
936 {V_ID, 14, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
937 {V_ID, 15, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
940 static struct validate ahst_validate = {
944 "name = UPPER('%s')",
949 set_uppercase_modtime,
952 static char *uhst2_fields[] = {
954 "newname", "vendor", "model", "os", "location", "contact", "use",
955 "status", "subnet", "address", "ace_type", "ace_name",
956 "admin_comment", "ops_comment",
959 static struct valobj uhst2_valobj[] = {
960 {V_CHAR, 0, MACHINE_TABLE, "name"},
961 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
962 {V_RENAME, 1, MACHINE_TABLE, "name", "mach_id", MR_NOT_UNIQUE},
963 {V_CHAR, 2, MACHINE_TABLE, "vendor"},
964 {V_CHAR, 3, MACHINE_TABLE, "model"},
965 {V_CHAR, 4, MACHINE_TABLE, "os"},
966 {V_CHAR, 5, MACHINE_TABLE, "location"},
967 {V_CHAR, 6, MACHINE_TABLE, "contact"},
970 {V_ID, 9, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
971 {V_TYPE, 11, 0, "ace_type", 0, MR_ACE},
972 {V_TYPEDATA, 12, 0, 0, 0, MR_ACE},
973 {V_ID, 13, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
974 {V_ID, 14, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
977 static struct validate uhst2_validate = {
989 static char *uhst6_fields[] = {
991 "newname", "vendor", "model", "os", "location", "contact", "billing_contact",
992 "use", "status", "subnet", "address", "ace_type", "ace_name",
993 "admin_comment", "ops_comment",
996 static struct valobj uhst6_valobj[] = {
997 {V_CHAR, 0, MACHINE_TABLE, "name"},
998 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
999 {V_RENAME, 1, MACHINE_TABLE, "name", "mach_id", MR_NOT_UNIQUE},
1000 {V_CHAR, 2, MACHINE_TABLE, "vendor"},
1001 {V_CHAR, 3, MACHINE_TABLE, "model"},
1002 {V_CHAR, 4, MACHINE_TABLE, "os"},
1003 {V_CHAR, 5, MACHINE_TABLE, "location"},
1004 {V_CHAR, 6, MACHINE_TABLE, "contact"},
1005 {V_CHAR, 7, MACHINE_TABLE, "billing_contact"},
1008 {V_ID, 10, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
1009 {V_TYPE, 12, 0, "ace_type", 0, MR_ACE},
1010 {V_TYPEDATA, 13, 0, 0, 0, MR_ACE},
1011 {V_ID, 14, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
1012 {V_ID, 15, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
1015 static struct validate uhst6_validate = {
1027 static char *uhst_fields[] = {
1029 "newname", "vendor", "model", "os", "location", "contact", "billing_contact",
1030 "account_number", "use", "status", "subnet", "address", "ace_type",
1031 "ace_name", "admin_comment", "ops_comment",
1034 static struct valobj uhst_valobj[] = {
1035 {V_CHAR, 0, MACHINE_TABLE, "name"},
1036 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1037 {V_RENAME, 1, MACHINE_TABLE, "name", "mach_id", MR_NOT_UNIQUE},
1038 {V_CHAR, 2, MACHINE_TABLE, "vendor"},
1039 {V_CHAR, 3, MACHINE_TABLE, "model"},
1040 {V_CHAR, 4, MACHINE_TABLE, "os"},
1041 {V_CHAR, 5, MACHINE_TABLE, "location"},
1042 {V_CHAR, 6, MACHINE_TABLE, "contact"},
1043 {V_CHAR, 7, MACHINE_TABLE, "billing_contact"},
1044 {V_CHAR, 8, MACHINE_TABLE, "account_number"},
1047 {V_ID, 11, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
1048 {V_TYPE, 13, 0, "ace_type", 0, MR_ACE},
1049 {V_TYPEDATA, 14, 0, 0, 0, MR_ACE},
1050 {V_ID, 15, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
1051 {V_ID, 16, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
1054 static struct validate uhst_validate = {
1066 static char *uhha_fields[] = {
1071 static struct valobj uhha_valobj[] = {
1072 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1073 {V_CHAR, 1, MACHINE_TABLE, "hwaddr"},
1076 static struct validate uhha_validate = {
1088 static char *dhst_fields[] = {
1092 static struct validate dhst_validate = {
1104 static char *ghal_fields[] = {
1105 "alias", "canonical_hostname",
1106 "alias", "canonical_hostname"
1109 static struct validate ghal_validate = {
1121 static struct valobj ahal_valobj[] = {
1122 {V_CHAR, 0, HOSTALIAS_TABLE, "name"},
1123 {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1126 static struct validate ahal_validate = {
1130 "name = UPPER('%s')",
1138 static struct valobj dhal_valobj[] = {
1139 {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1142 static struct validate dhal_validate = {
1146 "name = UPPER('%s') AND mach_id = %d",
1154 static char *gsnt2_fields[] = {
1156 "name", "description", "address", "mask", "low", "high", "prefix",
1157 "ace_type", "ace_name", "modtime", "modby", "modwith"
1160 static char *gsnt_fields[] = {
1162 "name", "description", "status", "contact", "account_number", "address",
1163 "mask", "low", "high", "prefix", "ace_type", "ace_name", "modtime",
1167 static struct validate gsnt_validate = {
1179 static char *asnt2_fields[] = {
1180 "name", "description", "address", "mask", "low", "high", "prefix",
1181 "ace_type", "ace_name",
1184 static struct valobj asnt2_valobj[] = {
1185 {V_CHAR, 0, SUBNET_TABLE, "name"},
1186 {V_LEN, 1, SUBNET_TABLE, "description"},
1191 {V_LEN, 6, SUBNET_TABLE, "prefix"},
1192 {V_TYPE, 7, 0, "ace_type", 0, MR_ACE},
1193 {V_TYPEDATA, 8, 0, 0, 0, MR_ACE},
1196 static struct validate asnt2_validate =
1201 "name = UPPER('%s')",
1206 set_uppercase_modtime,
1209 static char *asnt_fields[] = {
1210 "name", "description", "status", "contact", "account_number", "address",
1211 "mask", "low", "high", "prefix", "ace_type", "ace_name",
1214 static struct valobj asnt_valobj[] = {
1215 {V_CHAR, 0, SUBNET_TABLE, "name"},
1216 {V_LEN, 1, SUBNET_TABLE, "description"},
1218 {V_CHAR, 3, SUBNET_TABLE, "contact"},
1219 {V_CHAR, 4, SUBNET_TABLE, "account_number"},
1224 {V_LEN, 9, SUBNET_TABLE, "prefix"},
1225 {V_TYPE, 10, 0, "ace_type", 0, MR_ACE},
1226 {V_TYPEDATA, 11, 0, 0, 0, MR_ACE},
1229 static struct validate asnt_validate =
1234 "name = UPPER('%s')",
1239 set_uppercase_modtime,
1242 static char *usnt2_fields[] = {
1244 "newname", "description", "address", "mask", "low", "high", "prefix",
1245 "ace_type", "ace_name",
1248 static struct valobj usnt2_valobj[] = {
1249 {V_ID, 0, SUBNET_TABLE, "name", "snet_id", MR_NO_MATCH},
1250 {V_RENAME, 1, SUBNET_TABLE, "name", "snet_id", MR_NOT_UNIQUE},
1251 {V_LEN, 2, SUBNET_TABLE, "description"},
1256 {V_LEN, 7, SUBNET_TABLE, "prefix"},
1257 {V_TYPE, 8, 0, "ace_type", 0, MR_ACE},
1258 {V_TYPEDATA, 9, 0, 0, 0, MR_ACE},
1261 static struct validate usnt2_validate =
1274 static char *usnt_fields[] = {
1276 "newname", "description", "status", "contact", "account_number", "address",
1277 "mask", "low", "high", "prefix", "ace_type", "ace_name",
1280 static struct valobj usnt_valobj[] = {
1281 {V_ID, 0, SUBNET_TABLE, "name", "snet_id", MR_NO_MATCH},
1282 {V_RENAME, 1, SUBNET_TABLE, "name", "snet_id", MR_NOT_UNIQUE},
1283 {V_LEN, 2, SUBNET_TABLE, "description"},
1285 {V_CHAR, 4, SUBNET_TABLE, "contact"},
1286 {V_CHAR, 5, SUBNET_TABLE, "account_number"},
1291 {V_LEN, 10, SUBNET_TABLE, "prefix"},
1292 {V_TYPE, 11, 0, "ace_type", 0, MR_ACE},
1293 {V_TYPEDATA, 12, 0, 0, 0, MR_ACE},
1296 static struct validate usnt_validate =
1309 static char *dsnt_fields[] = {
1313 static struct validate dsnt_validate = {
1325 static char *gclu_fields[] = {
1327 "name", "description", "location", "modtime", "modby", "modwith",
1330 static char *aclu_fields[] = {
1331 "name", "description", "location",
1334 static struct valobj aclu_valobj[] = {
1335 {V_CHAR, 0, CLUSTERS_TABLE, "name"},
1336 {V_LEN, 1, CLUSTERS_TABLE, "description"},
1337 {V_LEN, 2, CLUSTERS_TABLE, "location"},
1340 static struct validate aclu_validate =
1353 static char *uclu_fields[] = {
1355 "newname", "description", "location",
1358 static struct valobj uclu_valobj[] = {
1359 {V_ID, 0, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
1360 {V_RENAME, 1, CLUSTERS_TABLE, "name", "clu_id", MR_NOT_UNIQUE},
1361 {V_LEN, 2, CLUSTERS_TABLE, "description"},
1362 {V_LEN, 3, CLUSTERS_TABLE, "location"},
1365 static struct validate uclu_validate = {
1377 static char *dclu_fields[] = {
1381 static struct validate dclu_validate = {
1393 static char *gmcm_fields[] = {
1394 "machine", "cluster",
1395 "machine", "cluster",
1398 static struct valobj amtc_valobj[] = /* ADD_MACHINE_TO_CLUSTER */
1399 { /* DELETE_MACHINE_FROM_CLUSTER */
1400 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1401 {V_ID, 1, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
1404 static struct validate amtc_validate = /* for amtc and dmfc */
1409 "mach_id = %d and clu_id = %d",
1414 set_mach_modtime_by_id,
1417 static char *gcld_fields[] = {
1418 "cluster", "serv_label",
1419 "cluster", "serv_label", "serv_cluster",
1422 static char *acld_fields[] = {
1423 "cluster", "serv_label", "serv_cluster",
1426 static struct valobj acld_valobj[] =
1428 {V_ID, 0, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
1429 {V_CHAR, 1, SVC_TABLE, "serv_label"},
1430 {V_CHAR, 2, SVC_TABLE, "serv_cluster"}
1433 static struct validate acld_validate =
1438 "clu_id = %d AND serv_label = '%s' AND serv_cluster = '%s'",
1443 set_cluster_modtime_by_id,
1446 static struct validate dcld_validate =
1451 "clu_id = %d AND serv_label = '%s' AND serv_cluster = '%s'",
1456 set_cluster_modtime_by_id,
1459 static char *glin2_fields[] = {
1461 "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
1462 "ace_type", "ace_name", "description", "modtime", "modby", "modwith",
1465 static char *glin3_fields[] = {
1467 "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
1468 "nfsgroup", "ace_type", "ace_name", "description", "modtime", "modby",
1472 static char *glin_fields[] = {
1474 "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
1475 "nfsgroup", "ace_type", "ace_name", "memace_type", "memace_name",
1476 "description", "modtime", "modby", "modwith",
1479 static struct validate glin_validate = {
1486 access_vis_list_by_name,
1491 static char *alis2_fields[] = {
1492 "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
1493 "ace_type", "ace_name", "description",
1496 static struct valobj alis2_valobj[] = {
1497 {V_CHAR, 0, LIST_TABLE, "name"},
1504 {V_TYPE, 7, 0, "ace_type", 0, MR_ACE},
1505 {V_TYPEDATA, 8, 0, 0, "list_id", MR_ACE},
1506 {V_LEN, 9, LIST_TABLE, "description"},
1509 static struct validate alis2_validate = {
1521 static char *alis3_fields[] = {
1522 "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
1523 "nfsgroup", "ace_type", "ace_name", "description",
1526 static struct valobj alis3_valobj[] = {
1527 {V_CHAR, 0, LIST_TABLE, "name"},
1535 {V_TYPE, 8, 0, "ace_type", 0, MR_ACE},
1536 {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
1537 {V_LEN, 10, LIST_TABLE, "description"},
1540 static struct validate alis3_validate = {
1552 static char *alis_fields[] = {
1553 "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
1554 "nfsgroup", "ace_type", "ace_name", "memace_type", "memace_name",
1558 static struct valobj alis_valobj[] = {
1559 {V_CHAR, 0, LIST_TABLE, "name"},
1567 {V_TYPE, 8, 0, "ace_type", 0, MR_ACE},
1568 {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
1569 {V_TYPE, 10, 0, "ace_type", 0, MR_ACE},
1570 {V_TYPEDATA, 11, 0, 0, "list_id", MR_ACE},
1571 {V_LEN, 12, LIST_TABLE, "description"},
1574 static struct validate alis_validate = {
1586 static char *ulis2_fields[] = {
1588 "newname", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
1589 "ace_type", "ace_name", "description",
1592 static struct valobj ulis2_valobj[] = {
1593 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
1594 {V_RENAME, 1, LIST_TABLE, "name", "list_id", MR_NOT_UNIQUE},
1601 {V_TYPE, 8, 0, "ace_type", 0, MR_ACE},
1602 {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
1603 {V_LEN, 10, LIST_TABLE, "description"},
1606 static struct validate ulis2_validate = {
1618 static char *ulis3_fields[] = {
1620 "newname", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
1621 "nfsgroup", "ace_type", "ace_name", "description",
1624 static struct valobj ulis3_valobj[] = {
1625 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
1626 {V_RENAME, 1, LIST_TABLE, "name", "list_id", MR_NOT_UNIQUE},
1634 {V_TYPE, 9, 0, "ace_type", 0, MR_ACE},
1635 {V_TYPEDATA, 10, 0, 0, "list_id", MR_ACE},
1636 {V_LEN, 11, LIST_TABLE, "description"},
1639 static struct validate ulis3_validate = {
1651 static char *ulis_fields[] = {
1653 "newname", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
1654 "nfsgroup", "ace_type", "ace_name", "memace_type", "memace_name",
1658 static struct valobj ulis_valobj[] = {
1659 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
1660 {V_RENAME, 1, LIST_TABLE, "name", "list_id", MR_NOT_UNIQUE},
1668 {V_TYPE, 9, 0, "ace_type", 0, MR_ACE},
1669 {V_TYPEDATA, 10, 0, 0, "list_id", MR_ACE},
1670 {V_TYPE, 11, 0, "ace_type", 0, MR_ACE},
1671 {V_TYPEDATA, 12, 0, 0, "list_id", MR_ACE},
1672 {V_LEN, 13, LIST_TABLE, "description"},
1675 static struct validate ulis_validate = {
1687 static char *dlis_fields[] = {
1691 static struct validate dlis_validate = {
1703 static char *amtl_fields[] = {
1704 "list_name", "member_type", "member_name",
1707 static char *atml_fields[] = {
1708 "list_name", "member_type", "member_name", "tag",
1711 static struct valobj amtl_valobj[] = {
1712 {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
1713 {V_TYPE, 1, 0, "member", 0, MR_TYPE},
1714 {V_TYPEDATA, 2, 0, 0, 0, MR_NO_MATCH},
1715 {V_ID, 3, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
1718 static struct validate amtl_validate =
1731 static struct validate atml_validate =
1744 static struct validate tmol_validate =
1757 static struct validate dmfl_validate =
1767 delete_member_from_list,
1770 static char *gaus_fields[] = {
1771 "ace_type", "ace_name",
1772 "use_type", "use_name",
1775 static struct valobj gaus_valobj[] = {
1776 {V_TYPE, 0, 0, "gaus", 0, MR_TYPE},
1777 {V_TYPEDATA, 1, 0, 0, 0, MR_NO_MATCH},
1780 static struct validate gaus_validate = {
1792 static char *ghbo_fields[] = {
1793 "ace_type", "ace_name",
1797 static struct valobj ghbo_valobj[] = {
1798 {V_TYPE, 0, 0, "gaus", 0, MR_TYPE},
1799 {V_TYPEDATA, 1, 0, 0, 0, MR_NO_MATCH},
1802 static struct validate ghbo_validate = {
1814 static char *qgli_fields[] = {
1815 "active", "publicflg", "hidden", "maillist", "grouplist",
1819 static struct valobj qgli_valobj[] = {
1820 {V_TYPE, 0, 0, "boolean", 0, MR_TYPE},
1821 {V_TYPE, 1, 0, "boolean", 0, MR_TYPE},
1822 {V_TYPE, 2, 0, "boolean", 0, MR_TYPE},
1823 {V_TYPE, 3, 0, "boolean", 0, MR_TYPE},
1824 {V_TYPE, 4, 0, "boolean", 0, MR_TYPE},
1827 static struct validate qgli_validate = {
1836 qualified_get_lists,
1839 static char *gmol_fields[] = {
1841 "member_type", "member_name",
1844 static char *gtml_fields[] = {
1846 "member_type", "member_name", "tag",
1849 static struct validate gmol_validate = {
1856 access_visible_list,
1858 get_members_of_list,
1861 static char *glom_fields[] = {
1862 "member_type", "member_name",
1863 "list_name", "active", "publicflg", "hidden", "maillist", "grouplist",
1866 static struct valobj glom_valobj[] = {
1867 {V_TYPE, 0, 0, "rmember", 0, MR_TYPE},
1868 {V_TYPEDATA, 1, 0, 0, 0, MR_NO_MATCH},
1871 static struct validate glom_validate = {
1880 get_lists_of_member,
1883 static char *cmol_fields[] = {
1888 static struct validate cmol_validate = {
1895 access_visible_list,
1897 count_members_of_list,
1900 static char *gsin_fields[] = {
1902 "service", "update_int", "target_file", "script", "dfgen", "dfcheck",
1903 "type", "enable", "inprogress", "harderror", "errmsg",
1904 "ace_type", "ace_name", "modtime", "modby", "modwith",
1907 static struct validate gsin_validate =
1920 static char *qgsv_fields[] = {
1921 "enable", "inprogress", "harderror",
1925 static struct valobj qgsv_valobj[] = {
1926 {V_TYPE, 0, 0, "boolean", 0, MR_TYPE},
1927 {V_TYPE, 1, 0, "boolean", 0, MR_TYPE},
1928 {V_TYPE, 2, 0, "boolean", 0, MR_TYPE},
1931 static struct validate qgsv_validate = {
1940 qualified_get_server,
1943 static char *asin_fields[] = {
1944 "service", "update_int", "target_file", "script", "type", "enable",
1945 "ace_type", "ace_name",
1948 static struct valobj asin_valobj[] = {
1949 {V_CHAR, 0, SERVERS_TABLE, "name"},
1951 {V_LEN, 2, SERVERS_TABLE, "target_file"},
1952 {V_LEN, 3, SERVERS_TABLE, "script"},
1953 {V_TYPE, 4, 0, "service", 0, MR_TYPE},
1955 {V_TYPE, 6, 0, "ace_type", 0, MR_ACE},
1956 {V_TYPEDATA, 7, 0, 0, 0, MR_ACE},
1959 static struct validate asin_validate = /* for asin, usin */
1964 "name = UPPER('%s')",
1969 set_uppercase_modtime,
1972 static struct validate rsve_validate = {
1976 "name = UPPER('%s')",
1981 set_uppercase_modtime,
1984 static char *ssif_fields[] = {
1985 "service", "dfgen", "dfcheck", "inprogress", "harderror", "errmsg",
1988 static struct valobj ssif_valobj[] = {
1989 {V_NAME, 0, SERVERS_TABLE, "name", 0, MR_SERVICE},
1994 {V_LEN, 5, SERVERS_TABLE, "errmsg"},
1997 static struct validate ssif_validate = {
2001 "name = UPPER('%s')",
2009 static char *dsin_fields[] = {
2013 static struct validate dsin_validate = {
2017 "name = UPPER('%s')",
2025 static char *gshi_fields[] = {
2026 "service", "machine",
2027 "service", "machine", "enable", "override", "success", "inprogress",
2028 "hosterror", "hosterrormsg", "ltt", "lts", "value1", "value2",
2029 "value3", "modtime", "modby", "modwith",
2032 static struct validate gshi_validate = {
2044 static char *qgsh_fields[] = {
2045 "service", "enable", "override", "success", "inprogress", "hosterror",
2046 "service", "machine",
2049 static struct valobj qgsh_valobj[] = {
2050 {V_TYPE, 1, 0, "boolean", 0, MR_TYPE},
2051 {V_TYPE, 2, 0, "boolean", 0, MR_TYPE},
2052 {V_TYPE, 3, 0, "boolean", 0, MR_TYPE},
2053 {V_TYPE, 4, 0, "boolean", 0, MR_TYPE},
2054 {V_TYPE, 5, 0, "boolean", 0, MR_TYPE},
2057 static struct validate qgsh_validate = {
2066 qualified_get_serverhost,
2069 static char *ashi_fields[] = {
2070 "service", "machine", "enable", "value1", "value2", "value3",
2073 static struct valobj ashi_valobj[] = {
2074 {V_NAME, 0, SERVERS_TABLE, "name", 0, MR_SERVICE},
2075 {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2079 {V_LEN, 5, SERVERHOSTS_TABLE, "value3"},
2082 static struct validate ashi_validate = /* ashi & ushi */
2087 "service = UPPER('%s') AND mach_id = %d",
2092 set_serverhost_modtime,
2095 static struct validate rshe_validate =
2100 "service = UPPER('%s') AND mach_id = %d",
2105 set_serverhost_modtime,
2108 static struct validate ssho_validate =
2113 "service = UPPER('%s') AND mach_id = %d",
2121 static char *sshi_fields[] = {
2122 "service", "machine", "override", "success", "inprogress",
2123 "hosterror", "errmsg", "ltt", "lts",
2126 static struct valobj sshi_valobj[] = {
2127 {V_NAME, 0, SERVERS_TABLE, "name", 0, MR_SERVICE},
2128 {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2133 {V_LEN, 6, SERVERHOSTS_TABLE, "hosterrmsg"},
2138 static struct validate sshi_validate =
2151 static char *dshi_fields[] = {
2152 "service", "machine",
2155 static struct validate dshi_validate =
2160 "service = UPPER('%s') AND mach_id = %d",
2168 static char *gslo_fields[] = {
2170 "server", "machine",
2173 static char *gfsl_fields[] = {
2175 "label", "type", "machine", "name", "mount", "access", "comments",
2176 "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith",
2179 static struct validate gfsl_validate = {
2191 static char *gfsm_fields[] = {
2193 "label", "type", "machine", "name", "mount", "access", "comments",
2194 "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith",
2197 static struct validate gfsm_validate = {
2209 static char *gfsn_fields[] = {
2210 "machine", "partition",
2211 "label", "type", "machine", "name", "mount", "access", "comments",
2212 "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith",
2215 static struct validate gfsn_validate = {
2227 static char *gfsp_fields[] = {
2229 "label", "type", "machine", "name", "mount", "access", "comments",
2230 "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith",
2233 static char *gfsg_fields[] = {
2235 "label", "type", "machine", "name", "mount", "access", "comments",
2236 "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith",
2239 static struct validate gfsg_validate = {
2251 static char *afil_fields[] = {
2252 "label", "type", "machine", "name", "mount", "access", "comments",
2253 "owner", "owners", "create", "lockertype",
2256 static struct valobj afil_valobj[] = {
2257 {V_CHAR, 0, FILESYS_TABLE, "label"},
2258 {V_TYPE, 1, 0, "filesys", 0, MR_FSTYPE},
2259 {V_ID, 2, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2260 {V_CHAR, 3, FILESYS_TABLE, "name"},
2261 {V_LEN, 4, FILESYS_TABLE, "mount"},
2262 {V_LEN, 5, FILESYS_TABLE, "rwaccess"},
2263 {V_LEN, 6, FILESYS_TABLE, "comments"},
2264 {V_ID, 7, USERS_TABLE, "login", "users_id", MR_USER},
2265 {V_ID, 8, LIST_TABLE, "name", "list_id", MR_LIST},
2267 {V_TYPE, 10, 0, "lockertype", 0, MR_TYPE},
2270 static struct validate afil_validate = {
2279 set_filesys_modtime,
2282 static char *ufil_fields[] = {
2283 "label", "newlabel", "type", "machine", "name", "mount", "access",
2284 "comments", "owner", "owners", "create", "lockertype",
2287 static struct valobj ufil_valobj[] = {
2288 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
2289 {V_RENAME, 1, FILESYS_TABLE, "label", "filsys_id", MR_NOT_UNIQUE},
2290 {V_TYPE, 2, 0, "filesys", 0, MR_FSTYPE},
2291 {V_ID, 3, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2292 {V_CHAR, 4, FILESYS_TABLE, "name"},
2293 {V_LEN, 5, FILESYS_TABLE, "mount"},
2294 {V_LEN, 6, FILESYS_TABLE, "rwaccess"},
2295 {V_LEN, 7, FILESYS_TABLE, "comments"},
2296 {V_ID, 8, USERS_TABLE, "login", "users_id", MR_USER},
2297 {V_ID, 9, LIST_TABLE, "name", "list_id", MR_LIST},
2299 {V_TYPE, 11, 0, "lockertype", 0, MR_TYPE},
2302 static struct validate ufil_validate = {
2311 set_filesys_modtime,
2314 static char *dfil_fields[] = {
2318 static struct validate dfil_validate = {
2330 static char *gfgm_fields[] = {
2331 "fsgroup", "filesys", "sortkey"
2334 static struct validate gfgm_validate = {
2346 static struct valobj aftg_valobj[] = {
2347 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
2348 {V_ID, 1, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
2351 static struct validate aftg_validate = {
2355 "group_id = %d and filsys_id = %d",
2363 static char *ganf_fields[] = {
2364 "machine", "dir", "device", "status", "allocated", "size",
2365 "modtime", "modby", "modwith",
2368 static char *gnfp_fields[] = {
2370 "machine", "dir", "device", "status", "allocated", "size",
2371 "modtime", "modby", "modwith",
2374 static struct validate gnfp_validate = {
2386 static struct valobj anfp_valobj[] = {
2387 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2388 {V_CHAR, 1, NFSPHYS_TABLE, "dir"},
2389 {V_LEN, 2, NFSPHYS_TABLE, "device"},
2395 static struct validate anfp_validate = {
2399 "mach_id = %d and dir = '%s'",
2404 set_nfsphys_modtime,
2407 static struct validate unfp_validate = {
2411 "mach_id = %d and dir = '%s'",
2416 set_nfsphys_modtime,
2419 static char *ajnf_fields[] = {
2420 "machine", "dir", "adjustment",
2423 static struct valobj ajnf_valobj[] = {
2424 {V_ID, 0, MACHINE_TABLE, NAME, "mach_id", MR_MACHINE},
2425 {V_CHAR, 1, NFSPHYS_TABLE, "dir"},
2429 static struct validate ajnf_validate = {
2433 "mach_id = %d and dir = '%s'",
2438 set_nfsphys_modtime,
2441 static char *dnfp_fields[] = {
2445 static struct validate dnfp_validate = {
2449 "mach_id = %d and dir = '%s'",
2454 set_nfsphys_modtime,
2457 static char *gqot_fields[] = {
2458 "filesys", "type", "name",
2459 "filesys", "type", "name", "quota", "dir", "machine",
2460 "modtime", "modby", "modwith",
2463 static struct valobj gqot_valobj[] = {
2464 {V_TYPE, 1, 0, "quota_type", 0, MR_TYPE},
2465 {V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
2468 static struct validate gqot_validate = {
2480 static char *gqbf_fields[] = {
2482 "filesys", "type", "name", "quota", "dir", "machine",
2483 "modtime", "modby", "modwith",
2486 static struct validate gqbf_validate = {
2498 static char *aqot_fields[] = {
2499 "filesys", "type", "name", "quota",
2502 static struct valobj aqot_valobj[] = {
2503 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
2504 {V_TYPE, 1, 0, "quota_type", 0, MR_TYPE},
2505 {V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
2509 static struct validate aqot_validate = {
2513 "filsys_id = %d and type = '%s' and entity_id = %d",
2521 static struct validate uqot_validate = {
2525 "filsys_id = %d AND type = '%s' AND entity_id = %d",
2533 static struct validate dqot_validate = {
2537 "filsys_id = %d AND type = '%s' AND entity_id = %d",
2545 static char *gnfq_fields[] = {
2547 "filesys", "login", "quota", "dir", "machine",
2548 "modtime", "modby", "modwith",
2551 static struct validate gnfq_validate = {
2563 static char *gnqp_fields[] = {
2565 "filesys", "login", "quota", "dir", "machine",
2566 "modtime", "modby", "modwith",
2569 static char *anfq_fields[] = {
2570 "filesys", "login", "quota",
2573 static struct valobj anfq_valobj[] = {
2574 {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
2575 {V_ID, 1, USERS_TABLE, "login", "users_id", MR_USER},
2579 static struct validate anfq_validate = {
2583 "filsys_id = %d AND type = 'USER' AND entity_id = %d",
2591 static struct validate unfq_validate = {
2595 "filsys_id = %d AND type = 'USER' AND entity_id = %d",
2603 static struct validate dnfq_validate = {
2607 "filsys_id = %d AND entity_id = %d",
2615 static char *gzcl2_fields[] = {
2617 "class", "xmt_type", "xmt_name", "sub_type", "sub_name",
2618 "iws_type", "iws_name", "iui_type", "iui_name",
2619 "modtime", "modby", "modwith",
2622 static char *gzcl_fields[] = {
2624 "class", "xmt_type", "xmt_name", "sub_type", "sub_name",
2625 "iws_type", "iws_name", "iui_type", "iui_name", "owner_type",
2626 "owner_id", "modtime", "modby", "modwith",
2629 static struct validate gzcl_validate = {
2641 static char *azcl2_fields[] = {
2642 "class", "xmt_type", "xmt_name", "sub_type", "sub_name",
2643 "iws_type", "iws_name", "iui_type", "iui_name",
2646 static struct valobj azcl2_valobj[] = {
2647 {V_CHAR, 0, ZEPHYR_TABLE, "class"},
2648 {V_TYPE, 1, 0, "zace_type", 0, MR_ACE},
2649 {V_TYPEDATA, 2, 0, 0, "list_id", MR_ACE},
2650 {V_TYPE, 3, 0, "zace_type", 0, MR_ACE},
2651 {V_TYPEDATA, 4, 0, 0, "list_id", MR_ACE},
2652 {V_TYPE, 5, 0, "zace_type", 0, MR_ACE},
2653 {V_TYPEDATA, 6, 0, 0, "list_id", MR_ACE},
2654 {V_TYPE, 7, 0, "zace_type", 0, MR_ACE},
2655 {V_TYPEDATA, 8, 0, 0, "list_id", MR_ACE},
2658 static struct validate azcl2_validate = {
2670 static char *azcl_fields[] = {
2671 "class", "xmt_type", "xmt_name", "sub_type", "sub_name",
2672 "iws_type", "iws_name", "iui_type", "iui_name", "owner_type",
2676 static struct valobj azcl_valobj[] = {
2677 {V_CHAR, 0, ZEPHYR_TABLE, "class"},
2678 {V_TYPE, 1, 0, "zace_type", 0, MR_ACE},
2679 {V_TYPEDATA, 2, 0, 0, "list_id", MR_ACE},
2680 {V_TYPE, 3, 0, "zace_type", 0, MR_ACE},
2681 {V_TYPEDATA, 4, 0, 0, "list_id", MR_ACE},
2682 {V_TYPE, 5, 0, "zace_type", 0, MR_ACE},
2683 {V_TYPEDATA, 6, 0, 0, "list_id", MR_ACE},
2684 {V_TYPE, 7, 0, "zace_type", 0, MR_ACE},
2685 {V_TYPEDATA, 8, 0, 0, "list_id", MR_ACE},
2686 {V_TYPE, 9, 0, "ace_type", 0, MR_ACE},
2687 {V_TYPEDATA, 10, 0, 0, "list_id", MR_ACE},
2690 static struct validate azcl_validate = {
2702 static char *uzcl2_fields[] = {
2703 "class", "newclass", "xmt_type", "xmt_name", "sub_type", "sub_name",
2704 "iws_type", "iws_name", "iui_type", "iui_name",
2707 static struct valobj uzcl2_valobj[] = {
2708 {V_NAME, 0, ZEPHYR_TABLE, "class", 0, MR_BAD_CLASS},
2709 {V_RENAME, 1, ZEPHYR_TABLE, "class", 0, MR_NOT_UNIQUE},
2710 {V_TYPE, 2, 0, "zace_type", 0, MR_ACE},
2711 {V_TYPEDATA, 3, 0, 0, "list_id", MR_ACE},
2712 {V_TYPE, 4, 0, "zace_type", 0, MR_ACE},
2713 {V_TYPEDATA, 5, 0, 0, "list_id", MR_ACE},
2714 {V_TYPE, 6, 0, "zace_type", 0, MR_ACE},
2715 {V_TYPEDATA, 7, 0, 0, "list_id", MR_ACE},
2716 {V_TYPE, 8, 0, "zace_type", 0, MR_ACE},
2717 {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
2720 static struct validate uzcl2_validate = {
2732 static char *uzcl_fields[] = {
2733 "class", "newclass", "xmt_type", "xmt_name", "sub_type", "sub_name",
2734 "iws_type", "iws_name", "iui_type", "iui_name", "owner_type", "owner_id",
2737 static struct valobj uzcl_valobj[] = {
2738 {V_NAME, 0, ZEPHYR_TABLE, "class", 0, MR_BAD_CLASS},
2739 {V_RENAME, 1, ZEPHYR_TABLE, "class", 0, MR_NOT_UNIQUE},
2740 {V_TYPE, 2, 0, "zace_type", 0, MR_ACE},
2741 {V_TYPEDATA, 3, 0, 0, "list_id", MR_ACE},
2742 {V_TYPE, 4, 0, "zace_type", 0, MR_ACE},
2743 {V_TYPEDATA, 5, 0, 0, "list_id", MR_ACE},
2744 {V_TYPE, 6, 0, "zace_type", 0, MR_ACE},
2745 {V_TYPEDATA, 7, 0, 0, "list_id", MR_ACE},
2746 {V_TYPE, 8, 0, "zace_type", 0, MR_ACE},
2747 {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
2748 {V_TYPE, 10, 0, "ace_type", 0, MR_ACE},
2749 {V_TYPEDATA, 11, 0, 0, "list_id", MR_ACE},
2752 static struct validate uzcl_validate = {
2764 static struct validate dzcl_validate = {
2776 static char *gsha_fields[] = {
2778 "machine", "ace_type", "ace_name", "modtime", "modby", "modwith",
2781 static struct validate gsha_validate =
2794 static char *asha_fields[] = {
2795 "machine", "ace_type", "ace_name",
2798 static struct valobj asha_valobj[] = {
2799 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2800 {V_TYPE, 1, 0, "ace_type", 0, MR_ACE},
2801 {V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
2804 static struct validate asha_validate =
2817 static char *gacl_fields[] = {
2818 "machine", "target",
2819 "machine", "target", "kind", "list",
2822 static char *aacl_fields[] = {
2823 "machine", "target", "kind", "list",
2826 static char *dacl_fields[] = {
2827 "machine", "target",
2830 static struct valobj aacl_valobj[] = {
2831 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2832 {V_CHAR, 1, ACL_TABLE, "target"},
2833 {V_TYPE, 2, 0, "acl_kind", 0, MR_TYPE},
2834 {V_ID, 3, LIST_TABLE, "name", "list_id", MR_LIST},
2837 static struct validate gacl_validate =
2850 static struct validate aacl_validate =
2855 "mach_id = %d AND target = '%s'",
2863 static char *gsvc_fields[] = {
2864 "service", "protocol",
2865 "service", "protocol", "port", "description", "modtime", "modby", "modwith",
2868 static char *asvc_fields[] = {
2869 "service", "protocol", "port", "description",
2872 static char *dsvc_fields[] = {
2873 "service", "protocol",
2876 static struct valobj asvc_valobj[] = {
2877 {V_CHAR, 0, SERVICES_TABLE, "name"},
2878 {V_CHAR, 1, SERVICES_TABLE, "protocol"},
2880 {V_CHAR, 3, SERVICES_TABLE, "description"},
2883 static struct validate asvc_validate = {
2887 "name = '%s' AND protocol = '%s'",
2892 set_service_modtime,
2895 static struct validate dsvc_validate = {
2899 "name = '%s' AND protocol = '%s'",
2907 static char *gprn_fields[] = {
2909 "name", "type", "hwtype", "duplexname", "hostname",
2910 "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
2911 "banner", "location", "contact", "modtime", "modby", "modwith"
2914 static char *gpbd_fields[] = {
2916 "name", "type", "hwtype", "duplexname", "hostname",
2917 "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
2918 "banner", "location", "contact", "modtime", "modby", "modwith"
2921 static char *gpbe_fields[] = {
2923 "name", "type", "hwtype", "duplexname", "hostname",
2924 "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
2925 "banner", "location", "contact", "modtime", "modby", "modwith"
2928 static char *gpbh_fields[] = {
2930 "name", "type", "hwtype", "duplexname", "hostname",
2931 "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
2932 "banner", "location", "contact", "modtime", "modby", "modwith"
2935 static char *gpbr_fields[] = {
2937 "name", "type", "hwtype", "duplexname", "hostname",
2938 "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
2939 "banner", "location", "contact", "modtime", "modby", "modwith"
2942 static char *gpbl_fields[] = {
2944 "name", "type", "hwtype", "duplexname", "hostname",
2945 "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
2946 "banner", "location", "contact", "modtime", "modby", "modwith"
2949 static char *gpbc_fields[] = {
2951 "name", "type", "hwtype", "duplexname", "hostname",
2952 "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
2953 "banner", "location", "contact", "modtime", "modby", "modwith"
2956 static char *aprn_fields[] = {
2957 "printer", "type", "hwtype", "duplexname", "hostname",
2958 "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
2959 "banner", "location", "contact",
2962 static struct valobj aprn_valobj[] = {
2963 {V_CHAR, 0, PRINTERS_TABLE, "name"},
2964 {V_TYPE, 1, 0, "printertype", 0, MR_TYPE},
2965 {V_TYPE, 2, 0, "printerhwtype", 0, MR_TYPE},
2966 {V_CHAR, 3, PRINTERS_TABLE, "duplexname"},
2967 {V_ID, 4, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2968 {V_ID, 5, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2969 {V_ID, 6, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2970 {V_CHAR, 7, PRINTERS_TABLE, "rp"},
2971 {V_ID, 8, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2974 {V_ID, 11, LIST_TABLE, "name", "list_id", MR_LIST},
2975 {V_ID, 12, LIST_TABLE, "name", "list_id", MR_LIST},
2977 {V_CHAR, 14, PRINTERS_TABLE, "location"},
2978 {V_CHAR, 15, PRINTERS_TABLE, "contact"},
2981 static struct validate aprn_validate = {
2993 static char *uprn_fields[] = {
2995 "printer", "type", "hwtype", "duplexname", "hostname",
2996 "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
2997 "banner", "location", "contact",
3000 static struct valobj uprn_valobj[] = {
3001 {V_CHAR, 0, PRINTERS_TABLE, "name"},
3002 {V_CHAR, 1, PRINTERS_TABLE, "name"},
3003 {V_TYPE, 2, 0, "printertype", 0, MR_TYPE},
3004 {V_TYPE, 3, 0, "printerhwtype", 0, MR_TYPE},
3005 {V_CHAR, 4, PRINTERS_TABLE, "duplexname"},
3006 {V_ID, 5, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3007 {V_ID, 6, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3008 {V_ID, 7, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3009 {V_CHAR, 8, PRINTERS_TABLE, "rp"},
3010 {V_ID, 9, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3013 {V_ID, 12, LIST_TABLE, "name", "list_id", MR_LIST},
3014 {V_ID, 13, LIST_TABLE, "name", "list_id", MR_LIST},
3016 {V_CHAR, 15, PRINTERS_TABLE, "location"},
3017 {V_CHAR, 16, PRINTERS_TABLE, "contact"},
3020 static struct validate uprn_validate = {
3032 static struct validate dprn_validate = {
3044 static char *gpsv_fields[] = {
3046 "host", "kind", "printer_types", "owner_type", "owner_name",
3047 "lpc_acl", "modtime", "modby", "modwith"
3050 static struct valobj gpsv_valobj[] = {
3051 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3054 static struct validate gpsv_validate = {
3066 static char *apsv_fields[] = {
3067 "host", "kind", "printer_types", "owner_type", "owner_name", "lpc_acl"
3070 static struct valobj apsv_valobj[] = {
3071 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3072 {V_TYPE, 1, 0, "lpd_kind", 0, MR_TYPE},
3073 {V_ID, 2, STRINGS_TABLE, "string", "string_id", MR_STRING},
3074 {V_TYPE, 3, 0, "ace_type", 0, MR_ACE},
3075 {V_TYPEDATA, 4, 0, 0, 0, MR_ACE},
3076 {V_ID, 5, LIST_TABLE, "name", "list_id", MR_LIST},
3079 static struct validate apsv_validate = {
3091 static char *dpsv_fields[] = {
3095 static struct validate dpsv_validate = {
3107 static char *gali_fields[] = {
3108 "name", "type", "trans",
3109 "name", "type", "trans",
3112 static char *aali_fields[] = {
3113 "name", "type", "trans",
3116 static struct valobj aali_valobj[] = {
3117 {V_CHAR, 0, ALIAS_TABLE, "name"},
3118 {V_TYPE, 1, 0, "alias", 0, MR_TYPE},
3119 {V_CHAR, 2, ALIAS_TABLE, "trans"},
3122 static struct validate aali_validate = {
3126 "name = '%s' and type = '%s' and trans = '%s'",
3134 static struct validate dali_validate = /* DELETE_ALIAS */
3139 "name = '%s' and type = '%s' and trans = '%s'",
3147 static char *gval_fields[] = {
3151 static struct valobj gval_valobj[] = {
3152 {V_NAME, 0, NUMVALUES_TABLE, "name", 0, MR_NO_MATCH},
3155 static struct validate gval_validate = {
3167 static char *aval_fields[] = {
3171 static struct valobj aval_valobj[] = {
3172 {V_CHAR, 0, NUMVALUES_TABLE, "name"},
3176 static struct validate aval_validate = /* for aval, uval, and dval */
3189 static char *dval_fields[] = {
3193 static char *gats_fields[] = {
3194 "table_name", "appends", "updates", "deletes",
3195 "modtime", "modby", "modwith",
3198 static char *_sdl_fields[] = {
3202 static struct validate _sdl_validate =
3215 static char *gusl_fields[] = {
3216 "login", "domain_sid",
3217 "login", "sid", "created",
3220 static struct validate gusl_validate =
3233 static char *glsn_fields[] = {
3234 "name", "domain_sid",
3235 "name", "sid", "created",
3238 static struct validate glsn_validate =
3251 static char *ausl_fields[] = {
3255 static struct validate ausl_validate =
3260 "users_id = %d AND sid = '%s'",
3268 static char *alsn_fields[] = {
3272 static struct validate alsn_validate =
3277 "list_id = %d AND sid = '%s'",
3285 static char *gdds_fields[] = {
3289 static char *gcon_fields[] = {
3291 "name", "description", "location", "contact",
3292 "ace_type", "ace_name", "memace_type", "memace_name", "modtime", "modby", "modwith",
3295 static struct validate gcon_validate = {
3307 static char *acon_fields[] = {
3308 "name", "description", "location", "contact",
3309 "ace_type", "ace_name", "memace_type", "memace_name",
3312 static struct valobj acon_valobj[] = {
3313 {V_CHAR, 0, CONTAINERS_TABLE, "name"},
3314 {V_LEN, 1, CONTAINERS_TABLE, "description"},
3315 {V_CHAR, 2, CONTAINERS_TABLE, "location"},
3316 {V_CHAR, 3, CONTAINERS_TABLE, "contact"},
3317 {V_TYPE, 4, 0, "ace_type", 0, MR_ACE},
3318 {V_TYPEDATA, 5, 0, 0, 0, MR_ACE},
3319 {V_TYPE, 6, 0, "ace_type", 0, MR_ACE},
3320 {V_TYPEDATA, 7, 0, 0, 0, MR_ACE},
3323 static struct validate acon_validate =
3336 static char *ucon_fields[] = {
3338 "newname", "description", "location", "contact",
3339 "ace_type", "ace_name", "memace_type", "memace_name",
3342 static struct valobj ucon_valobj[] = {
3343 {V_ID, 0, CONTAINERS_TABLE, "name", "cnt_id", MR_CONTAINER},
3344 {V_RENAME, 1, CONTAINERS_TABLE, "name", "cnt_id", MR_NOT_UNIQUE},
3345 {V_LEN, 2, CONTAINERS_TABLE, "description"},
3346 {V_CHAR, 3, CONTAINERS_TABLE, "location"},
3347 {V_CHAR, 4, CONTAINERS_TABLE, "contact"},
3348 {V_TYPE, 5, 0, "ace_type", 0, MR_ACE},
3349 {V_TYPEDATA, 6, 0, 0, 0, MR_ACE},
3350 {V_TYPE, 7, 0, "ace_type", 0, MR_ACE},
3351 {V_TYPEDATA, 8, 0, 0, 0, MR_ACE},
3354 static struct validate ucon_validate =
3367 static char *dcon_fields[] = {
3371 static struct validate dcon_validate =
3384 static char *amcn_fields[] = {
3385 "machine", "container",
3388 static struct valobj amcn_valobj[] = /* ADD_MACHINE_TO_CONTAINER */
3389 { /* DELETE_MACHINE_FROM_CONTAINER */
3390 {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3391 {V_ID, 1, CONTAINERS_TABLE, "name", "cnt_id", MR_CONTAINER},
3394 static struct validate amcn_validate = /* for amtn and dmfn */
3404 set_mach_modtime_by_id,
3407 static struct validate dmcn_validate = /* for amtn and dmfn */
3412 "mach_id = %d and cnt_id = %d",
3417 set_mach_modtime_by_id,
3420 static char *gmnm_fields[] = {
3422 "machine", "container",
3425 static char *gmoc_fields[] = {
3432 static struct validate gmoc_validate =
3442 get_machines_of_container,
3445 static char *gsoc_fields[] = {
3451 static struct validate gsoc_validate =
3461 get_subcontainers_of_container,
3464 static char *gtlc_fields[] = {
3469 /* Generalized Query Definitions */
3471 /* Multiple versions of the same query MUST be listed in ascending
3475 /* Note: For any query which uses prefetch_value, the vcnt should be
3476 * one less than the number of %-format specifiers in the tlist.
3479 struct query Queries[] = {
3481 /* Q_GALO - GET_ALL_LOGINS, v2 */
3488 "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle FROM users u",
3498 /* Q_GALO - GET_ALL_LOGINS, v3 */
3505 "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle FROM users u",
3515 /* Q_GAAL - GET_ALL_ACTIVE_LOGINS, v2 */
3516 "get_all_active_logins",
3522 "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle FROM users u",
3532 /* Q_GAAL - GET_ALL_ACTIVE_LOGINS, v3 */
3533 "get_all_active_logins",
3539 "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle FROM users u",
3549 /* Q_GUAL - GET_USER_ACCOUNT_BY_LOGIN, v2 */
3550 "get_user_account_by_login",
3556 "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",
3559 "u.login LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
3566 /* Q_GUAL - GET_USER_ACCOUNT_BY_LOGIN, v3 */
3567 "get_user_account_by_login",
3573 "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 FROM users u, strings str",
3576 "u.login LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
3583 /* Q_GUAU - GET_USER_ACCOUNT_BY_UID, v2 */
3584 "get_user_account_by_uid",
3590 "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",
3593 "u.unix_uid = %s AND u.users_id != 0 AND u.comments = str.string_id",
3600 /* Q_GUAU - GET_USER_ACCOUNT_BY_UID, v3 */
3601 "get_user_account_by_uid",
3607 "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 FROM users u, strings str",
3610 "u.unix_uid = %s AND u.users_id != 0 AND u.comments = str.string_id",
3617 /* Q_GUAN - GET_USER_ACCOUNT_BY_NAME, v2 */
3618 "get_user_account_by_name",
3624 "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",
3627 "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0 and u.comments = str.string_id",
3634 /* Q_GUAN - GET_USER_ACCOUNT_BY_NAME, v3 */
3635 "get_user_account_by_name",
3641 "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 FROM users u, strings str",
3644 "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0 and u.comments = str.string_id",
3651 /* Q_GUAC - GET_USER_ACCOUNT_BY_CLASS, v2 */
3652 "get_user_account_by_class",
3658 "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",
3661 "u.type = UPPER('%s') AND u.users_id != 0 AND u.comments = str.string_id",
3668 /* Q_GUAC - GET_USER_ACCOUNT_BY_CLASS, v3 */
3669 "get_user_account_by_class",
3675 "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 FROM users u, strings str",
3678 "u.type = UPPER('%s') AND u.users_id != 0 AND u.comments = str.string_id",
3685 /* Q_GUAM - GET_USER_ACCOUNT_BY_MITID, v2 */
3686 "get_user_account_by_id",
3692 "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",
3695 "u.clearid LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
3702 /* Q_GUAM - GET_USER_ACCOUNT_BY_MITID, v3 */
3703 "get_user_account_by_id",
3709 "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 FROM users u, strings str",
3712 "u.clearid LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
3719 /* Q_GUBL - GET_USER_BY_LOGIN, v2 */
3720 "get_user_by_login",
3726 "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",
3729 "u.login LIKE '%s' AND u.users_id != 0",
3736 /* Q_GUBL - GET_USER_BY_LOGIN, v3 */
3737 "get_user_by_login",
3743 "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 FROM users u",
3746 "u.login LIKE '%s' AND u.users_id != 0",
3753 /* Q_GUBU - GET_USER_BY_UID, v2 */
3760 "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",
3763 "u.unix_uid = %s AND u.users_id != 0",
3770 /* Q_GUBU - GET_USER_BY_UID, v3 */
3777 "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 FROM users u",
3780 "u.unix_uid = %s AND u.users_id != 0",
3787 /* Q_GUBN - GET_USER_BY_NAME, v2 */
3794 "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",
3797 "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0",
3804 /* Q_GUBN - GET_USER_BY_NAME, v3 */
3811 "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 FROM users u",
3814 "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0",
3821 /* Q_GUBC - GET_USER_BY_CLASS, v2 */
3822 "get_user_by_class",
3828 "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",
3831 "u.type = UPPER('%s') AND u.users_id != 0",
3838 /* Q_GUBC - GET_USER_BY_CLASS, v3 */
3839 "get_user_by_class",
3845 "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 FROM users u",
3848 "u.type = UPPER('%s') AND u.users_id != 0",
3855 /* Q_GUBM - GET_USER_BY_MITID, v2 */
3856 "get_user_by_mitid",
3862 "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",
3865 "u.clearid LIKE '%s' AND u.users_id != 0",
3872 /* Q_GUBM - GET_USER_BY_MITID, v3 */
3873 "get_user_by_mitid",
3879 "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 FROM users u",
3882 "u.clearid LIKE '%s' AND u.users_id != 0",
3889 /* Q_AUAC - ADD_USER_ACCOUNT, v2 */ /* uses prefetch_value() for users_id */
3896 /* We set signature to "NVL(CHR(0), '%s')", which is to say, "CHR(0)",
3897 * but using up one argv element.
3899 "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)",
3909 /* Q_AUAC - ADD_USER_ACCOUNT, v3 */ /* uses prefetch_value() for users_id */
3916 /* We set signature to "NVL(CHR(0), '%s')", which is to say, "CHR(0)",
3917 * but using up one argv element.
3919 "INTO users (login, unix_uid, shell, winconsoleshell, 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)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', %d, NVL(CHR(0), '%s'), %s, %s)",
3929 /* Q_AUSR - ADD_USER, v2 */ /* uses prefetch_value() for users_id */
3936 "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)",
3946 /* Q_AUSR - ADD_USER, v3 */ /* uses prefetch_value() for users_id */
3953 "INTO users (login, unix_uid, shell, winconsoleshell, 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)",
3963 /* Q_RUSR - REGISTER_USER */
3980 /* Q_UUAC - UPDATE_USER_ACCOUNT, v2 */
3981 "update_user_account",
3987 /* See comment in auac about signature. */
3988 "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",
3998 /* Q_UUAC - UPDATE_USER_ACCOUNT, v3 */
3999 "update_user_account",
4005 /* See comment in auac about signature. */
4006 "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",
4016 /* Q_UUSR - UPDATE_USER, v2 */
4023 "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'",
4033 /* Q_UUSR - UPDATE_USER, v3 */
4040 "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'",
4050 /* Q_UUSH - UPDATE_USER_SHELL */
4051 "update_user_shell",
4057 "users SET shell = '%s'",
4067 /* Q_UUWS - UPDATE_USER_WINDOWS_SHELL */
4068 "update_user_windows_shell",
4074 "users SET winconsoleshell = '%s'",
4084 /* Q_UUST - UPDATE_USER_STATUS */
4085 "update_user_status",
4091 "users SET status = %s",
4101 /* Q_UUSS - UPDATE_USER_SECURITY_STATUS */
4102 "update_user_security_status",
4108 "users SET secure = %s",
4118 /* Q_DUSR - DELETE_USER */
4135 /* Q_AURV - ADD_USER_RESERVATION */
4136 "add_user_reservation",
4152 /* Q_GURV - GET_USER_RESERVATIONS */
4153 "get_user_reservations",
4169 /* Q_GUBR - GET_USER_BY_RESERVATION */
4170 "get_user_by_reservation",
4186 /* Q_DURV - DELETE_USER_RESERVATION */
4187 "delete_user_reservation",
4203 /* Q_GKUM - GET_KERBEROS_USER_MAP */
4204 "get_kerberos_user_map",
4210 "u.login, str.string FROM krbmap km, users u, strings str",
4213 "u.login LIKE '%s' AND str.string LIKE '%s' AND km.users_id = u.users_id AND km.string_id = str.string_id",
4215 "u.login, str.string",
4220 /* Q_AKUM - ADD_KERBEROS_USER_MAP */
4221 "add_kerberos_user_map",
4227 "INTO krbmap (users_id, string_id) VALUES (%d, %d)",
4237 /* Q_DKUM - DELETE_KERBEROS_USER_MAP */
4238 "delete_kerberos_user_map",
4247 "users_id = %d AND string_id = %d",
4254 /* Q_GFBL - GET_FINGER_BY_LOGIN */
4255 "get_finger_by_login",
4261 "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",
4271 /* Q_UFBL - UPDATE_FINGER_BY_LOGIN */
4272 "update_finger_by_login",
4278 "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))",
4288 /* Q_GPOB - GET_POBOX */
4295 "login, potype, users_id, CHR(0), TO_CHAR(pmodtime, 'DD-mon-YYYY HH24:MI:SS'), pmodby, pmodwith FROM users",
4305 /* Q_GAPO - GET_ALL_POBOXES */
4312 "login, potype, pop_id || ':' || box_id FROM users",
4322 /* Q_GPOP - GET_POBOXES_POP */
4329 "login, potype, users_id FROM users",
4339 /* Q_GPOF - GET_POBOXES_SMTP */
4346 "login, potype, users_id FROM users",
4356 /* Q_SPOB - SET_POBOX */
4373 /* Q_SPOP - SET_POBOX_POP */
4390 /* Q_DPOB - DELETE_POBOX */
4397 "users SET potype = 'NONE'",
4407 /* Q_GHST - GET_HOST, v2 */
4414 "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",
4417 "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",
4424 /* Q_GHST - GET_HOST, v6 */
4431 "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",
4434 "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",
4441 /* Q_GHST - GET_HOST, v8 */
4448 "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",
4451 "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",
4458 /* Q_GHBH - GET_HOST_BY_HWADDR, v2 */
4459 "get_host_by_hwaddr",
4465 "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",
4468 "m.hwaddr LIKE LOWER('%s') AND m.mach_id != 0 AND s.snet_id = m.snet_id",
4475 /* Q_GHBH - GET_HOST_BY_HWADDR, v6 */
4476 "get_host_by_hwaddr",
4482 "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",
4485 "m.hwaddr LIKE LOWER('%s') AND m.mach_id != 0 AND s.snet_id = m.snet_id",
4492 /* Q_GHBH - GET_HOST_BY_HWADDR, v8 */
4493 "get_host_by_hwaddr",
4499 "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",
4502 "m.hwaddr LIKE LOWER('%s') AND m.mach_id != 0 AND s.snet_id = m.snet_id",
4509 /* Q_GHBA - GET_HOST_BY_ACCOUNT_NUMBER, v8 */
4510 "get_host_by_account_number",
4516 "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",
4519 "m.account_number LIKE '%s' AND m.mach_id != 0 and s.snet_id = m.snet_id",
4526 /* Q_GHHA - GET_HOST_HWADDR */
4533 "m.hwaddr FROM machine m",
4536 "m.name LIKE UPPER('%s')",
4543 /* Q_AHST - ADD_HOST, v2 */ /* uses prefetch_value() for mach_id */
4550 "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)",
4560 /* Q_AHST - ADD_HOST, v6 */ /* uses prefetch_value() for mach_id */
4567 "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)",
4577 /* Q_AHST - ADD_HOST, v8 */ /* Uses prefetch_value() for mach_id */
4584 "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)",
4594 /* Q_UHST - UPDATE_HOST, v2 */
4601 "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",
4611 /* Q_UHST - UPDATE_HOST, v6 */
4618 "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",
4628 /* Q_UHST - UPDATE_HOST, v8 */
4635 "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",
4645 /* Q_UHHA - UPDATE_HOST_HWADDR */
4646 "update_host_hwaddr",
4652 "machine SET hwaddr = NVL('%s', CHR(0))",
4662 /* Q_DHST - DELETE_HOST */
4679 /* Q_GMAC - GET_MACHINE */
4686 "name, vendor, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM machine",
4689 "name LIKE UPPER('%s') AND mach_id != 0",
4696 /* Q_GHAL - GET_HOSTALIAS */
4703 "a.name, m.name FROM hostalias a, machine m",
4706 "m.mach_id = a.mach_id and a.name LIKE UPPER('%s') AND m.name LIKE UPPER('%s')",
4713 /* Q_AHAL - ADD_HOSTALIAS */
4720 "INTO hostalias (name, mach_id) VALUES (UPPER('%s'), %d)",
4730 /* Q_DHAL - DELETE_HOSTALIAS */
4740 "name = UPPER('%s') AND mach_id = %d",
4747 /* Q_GSNT - GET_SUBNET, v2 */
4754 "name, description, saddr, mask, low, high, prefix, owner_type, owner_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM subnet",
4757 "name LIKE UPPER('%s')",
4764 /* Q_GSNT - GET_SUBNET, v8 */
4771 "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",
4774 "name LIKE UPPER('%s')",
4781 /* Q_ASNT - ADD_SUBNET, v2 */
4788 "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)",
4798 /* Q_ASNT - ADD_SUBNET, v8 */
4805 "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)), %s, %s, %s, %s, %s, NVL('%s', CHR(0)), '%s', %d, %s)",
4815 /* Q_USNT - UPDATE_SUBNET, v2 */
4822 "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",
4832 /* Q_USNT - UPDATE_SUBNET, v8 */
4839 "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",
4849 /* Q_DSNT - DELETE_SUBNET */
4866 /* Q_GCLU - GET_CLUSTER */
4873 "name, description, location, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM clusters",
4876 "name LIKE '%s' AND clu_id != 0",
4883 /* Q_ACLU - ADD_CLUSTER */ /* uses prefetch_value() for clu_id */
4890 "INTO clusters (name, description, location, clu_id) VALUES ('%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s)",
4900 /* Q_UCLU - UPDATE_CLUSTER */
4907 "clusters SET name = '%s', description = NVL('%s', CHR(0)), location = NVL('%s', CHR(0))",
4917 /* Q_DCLU - DELETE_CLUSTER */
4934 /* Q_GMCM - GET_MACHINE_TO_CLUSTER_MAP */
4935 "get_machine_to_cluster_map",
4941 "m.name, c.name FROM machine m, clusters c, mcmap mcm",
4944 "m.name LIKE UPPER('%s') AND c.name LIKE '%s' AND mcm.clu_id = c.clu_id AND mcm.mach_id = m.mach_id",
4951 /* Q_AMTC - ADD_MACHINE_TO_CLUSTER */
4952 "add_machine_to_cluster",
4958 "INTO mcmap (mach_id, clu_id) VALUES (%d, %d)",
4968 /* Q_DMFC - DELETE_MACHINE_FROM_CLUSTER */
4969 "delete_machine_from_cluster",
4978 "mach_id = %d AND clu_id = %d",
4985 /* Q_GCLD - GET_CLUSTER_DATA */
4992 "c.name, svc.serv_label, svc.serv_cluster FROM svc svc, clusters c",
4995 "c.clu_id = svc.clu_id AND c.name LIKE '%s' AND svc.serv_label LIKE '%s'",
4997 "c.name, svc.serv_label",
5002 /* Q_ACLD - ADD_CLUSTER_DATA */
5009 "INTO svc (clu_id, serv_label, serv_cluster) VALUES (%d, '%s', '%s')",
5019 /* Q_DCLD - DELETE_CLUSTER_DATA */
5020 "delete_cluster_data",
5029 "clu_id = %d AND serv_label = '%s' AND serv_cluster = '%s'",
5036 /* Q_GLIN - GET_LIST_INFO, v2 */
5043 "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",
5053 /* Q_GLIN - GET_LIST_INFO, v3 */
5060 "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",
5070 /* Q_GLIN - GET_LIST_INFO, v4 */
5077 "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",
5087 /* Q_EXLN - EXPAND_LIST_NAMES */
5088 "expand_list_names",
5097 "name LIKE '%s' AND list_id != 0",
5104 /* Q_ALIS - ADD_LIST, v2 */ /* uses prefetch_value() for list_id */
5111 "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)",
5121 /* Q_ALIS - ADD_LIST, v3 */ /* uses prefetch_value() for list_id */
5128 "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)",
5138 /* Q_ALIS - ADD_LIST, v4 */ /* uses prefetch_value() for list_id */
5145 "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)",
5155 /* Q_ULIS - UPDATE_LIST, v2 */
5162 "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))",
5172 /* Q_ULIS - UPDATE_LIST, v3 */
5179 "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))",
5189 /* Q_ULIS, UPDATE_LIST, v4 */
5196 "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))",
5206 /* Q_DLIS - DELETE_LIST */
5223 /* Q_AMTL - ADD_MEMBER_TO_LIST */
5224 "add_member_to_list",
5240 /* Q_ATML - ADD_TAGGED_MEMBER_TO_LIST */
5241 "add_tagged_member_to_list",
5257 /* Q_TMOL - TAG_MEMBER_OF_LIST */
5258 "tag_member_of_list",
5274 /* Q_DMFL - DELETE_MEMBER_FROM_LIST */
5275 "delete_member_from_list",
5291 /* Q_GAUS - GET_ACE_USE */
5308 /* Q_GHBO - GET_HOST_BY_OWNER */
5309 "get_host_by_owner",
5325 /* Q_QGLI - QUALIFIED_GET_LISTS */
5326 "qualified_get_lists",
5342 /* Q_GMOL - GET_MEMBERS_OF_LIST */
5343 "get_members_of_list",
5359 /* Q_GEML - GET_END_MEMBERS_OF_LIST */
5360 "get_end_members_of_list",
5376 /* Q_GTML - GET_TAGGED_MEMBERS_OF_LIST */
5377 "get_tagged_members_of_list",
5393 /* Q_GLOM - GET_LISTS_OF_MEMBER */
5394 "get_lists_of_member",
5410 /* Q_CMOL - COUNT_MEMBERS_OF_LIST */
5411 "count_members_of_list",
5427 /* Q_GSIN - GET_SERVER_INFO */
5434 "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",
5437 "name LIKE UPPER('%s')",
5444 /* Q_QGSV - QUALIFIED_GET_SERVER */
5445 "qualified_get_server",
5461 /* Q_ASIN - ADD_SERVER_INFO */
5468 "INTO servers (name, update_int, target_file, script, type, enable, acl_type, acl_id) VALUES (UPPER('%s'), %s, '%s', '%s', '%s', %s, '%s', %d)",
5478 /* Q_USIN - UPDATE_SERVER_INFO */
5479 "update_server_info",
5485 "servers SET update_int = %s, target_file = '%s', script = '%s', type = '%s', enable = %s, acl_type = '%s', acl_id = %d",
5488 "name = UPPER('%s')",
5495 /* Q_RSVE - RESET_SERVER_ERROR */
5496 "reset_server_error",
5502 "servers SET harderror = 0, dfcheck = dfgen",
5505 "name = UPPER('%s')",
5512 /* Q_SSIF - SET_SERVER_INTERNAL_FLAGS */
5513 "set_server_internal_flags",
5519 "servers SET dfgen = %s, dfcheck = %s, inprogress = %s, harderror = %s, errmsg = NVL('%s', CHR(0))",
5522 "name = UPPER('%s')",
5529 /* Q_DSIN - DELETE_SERVER_INFO */
5530 "delete_server_info",
5539 "name = UPPER('%s')",
5546 /* Q_GSHI - GET_SERVER_HOST_INFO */
5547 "get_server_host_info",
5553 "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",
5556 "sh.service LIKE UPPER('%s') AND m.name LIKE UPPER('%s') AND m.mach_id = sh.mach_id",
5558 "sh.service, m.name",
5563 /* Q_QGSH - QUALIFIED_GET_SERVER_HOST */
5564 "qualified_get_server_host",
5580 /* Q_ASHI - ADD_SERVER_HOST_INFO */
5581 "add_server_host_info",
5587 "INTO serverhosts (service, mach_id, enable, value1, value2, value3) VALUES (UPPER('%s'), %d, %s, %s, %s, NVL('%s', CHR(0)))",
5597 /* Q_USHI - UPDATE_SERVER_HOST_INFO */
5598 "update_server_host_info",
5604 "serverhosts SET enable = %s, value1 = %s, value2 = %s, value3 = NVL('%s', CHR(0))",
5607 "service = UPPER('%s') AND mach_id = %d",
5614 /* Q_RSHE - RESET_SERVER_HOST_ERROR */
5615 "reset_server_host_error",
5621 "serverhosts SET hosterror = 0",
5624 "service = UPPER('%s') AND mach_id = %d",
5631 /* Q_SSHO - SET_SERVER_HOST_OVERRIDE */
5632 "set_server_host_override",
5638 "serverhosts SET override = 1",
5641 "service = UPPER('%s') AND mach_id = %d",
5648 /* Q_SSHI - SET_SERVER_HOST_INTERNAL */
5649 "set_server_host_internal",
5655 "serverhosts SET override = %s, success = %s, inprogress = %s, hosterror = %s, hosterrmsg = NVL('%s', CHR(0)), ltt = %s, lts = %s",
5658 "service = UPPER('%s') AND mach_id = %d",
5665 /* Q_DSHI - DELETE_SERVER_HOST_INFO */
5666 "delete_server_host_info",
5675 "service = UPPER('%s') AND mach_id = %d",
5682 /* Q_GSLO - GET_SERVER_LOCATIONS */
5683 "get_server_locations",
5689 "sh.service, m.name FROM serverhosts sh, machine m",
5692 "sh.service LIKE UPPER('%s') AND sh.mach_id = m.mach_id",
5694 "sh.service, m.name",
5699 /* Q_GFSL - GET_FILESYS_BY_LABEL */
5700 "get_filesys_by_label",
5706 "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",
5709 "fs.label LIKE '%s' AND fs.mach_id = m.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id",
5716 /* Q_GFSM - GET_FILESYS_BY_MACHINE */
5717 "get_filesys_by_machine",
5723 "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",
5726 "fs.mach_id = %d AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id",
5733 /* Q_GFSN - GET_FILESYS_BY_NFSPHYS */
5734 "get_filesys_by_nfsphys",
5740 "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",
5743 "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'",
5750 /* Q_GFSG - GET_FILESYS_BY_GROUP */
5751 "get_filesys_by_group",
5757 "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",
5760 "fs.owners = %d AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id",
5767 /* Q_GFSP - GET_FILESYS_BY_PATH */
5768 "get_filesys_by_path",
5774 "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",
5777 "fs.name LIKE '%s' AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = list_id",
5784 /* Q_AFIL - ADD_FILESYS */ /* uses prefetch_value() for filsys_id */
5791 "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)",
5801 /* Q_UFIL - UPDATE_FILESYS */
5808 "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'",
5818 /* Q_DFIL - DELETE_FILESYS */
5835 /* Q_GFGM - GET_FSGROUP_MEMBERS */
5836 "get_fsgroup_members",
5842 "fs.label, fg.key FROM fsgroup fg, filesys fs",
5845 "fg.group_id = %d AND fs.filsys_id = fg.filsys_id",
5852 /* Q_AFTG - ADD_FILESYS_TO_FSGROUP */
5853 "add_filesys_to_fsgroup",
5859 "INTO fsgroup (group_id, filsys_id, key) VALUES (%d, %d, '%s')",
5869 /* Q_RFFG - REMOVE_FILESYS_FROM_FSGROUP */
5870 "remove_filesys_from_fsgroup",
5879 "group_id = %d AND filsys_id = %d",
5886 /* Q_GANF - GET_ALL_NFSPHYS */
5893 "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",
5896 "m.mach_id = np.mach_id",
5903 /* Q_GNFP - GET_NFSPHYS */
5910 "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",
5913 "np.mach_id = %d AND np.dir LIKE '%s' AND m.mach_id = np.mach_id",
5920 /* Q_ANFP - ADD_NFSPHYS */ /* uses prefetch_value() for nfsphys_id */
5927 "INTO nfsphys (mach_id, dir, device, status, allocated, partsize, nfsphys_id) VALUES (%d, '%s', NVL('%s', CHR(0)), %s, %s, %s, %s)",
5937 /* Q_UNFP - UPDATE_NFSPHYS */
5944 "nfsphys SET device = NVL('%s', CHR(0)), status = %s, allocated = %s, partsize = %s",
5947 "mach_id = %d AND dir = '%s'",
5954 /* Q_AJNF - ADJUST_NFSPHYS_ALLOCATION */
5955 "adjust_nfsphys_allocation",
5961 "nfsphys SET allocated = allocated + %s",
5964 "mach_id = %d AND dir = '%s'",
5971 /* Q_DNFP - DELETE_NFSPHYS */
5981 "mach_id = %d AND dir = '%s'",
5988 /* Q_GQOT - GET_QUOTA */
5995 "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",
5998 "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",
6005 /* Q_GQBF - GET_QUOTA_BY_FILESYS */
6006 "get_quota_by_filesys",
6012 "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",
6015 "fs.label LIKE '%s' AND fs.filsys_id = q.filsys_id AND m.mach_id = fs.mach_id",
6022 /* Q_AQOT - ADD_QUOTA */ /* prefetch_filsys() gets last 1 value */
6029 "INTO quota (filsys_id, type, entity_id, quota, phys_id) VALUES ('%s', %d, %d, %s, %s)",
6039 /* Q_UQOT - UPDATE_QUOTA */
6046 "quota SET quota = %s",
6056 /* Q_DQOT - DELETE_QUOTA */
6073 /* Q_GNFQ - GET_NFS_QUOTAS */
6080 "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",
6083 "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'",
6085 "fs.label, u.login",
6090 /* Q_GNQP - GET_NFS_QUOTAS_BY_PARTITION */
6091 "get_nfs_quotas_by_partition",
6097 "fs.label, u.login, q.quota, np.dir, m.name FROM quota q, filesys fs, users u, nfsphys np, machine m",
6100 "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",
6107 /* Q_ANFQ - ADD_NFS_QUOTA */ /* prefetch_filsys() gets last 1 value */
6114 "INTO quota (type, filsys_id, entity_id, quota, phys_id ) VALUES ('USER', %d, %d, %s, %s)",
6124 /* Q_UNFQ - UPDATE_NFS_QUOTA */
6131 "quota SET quota = %s",
6141 /* Q_DNFQ - DELETE_NFS_QUOTA */
6158 /* Q_GZCL - GET_ZEPHYR_CLASS, v2 */
6165 "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",
6175 /* Q_GZCL - GET_ZEPHYR_CLASS, v5 */
6182 "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",
6192 /* Q_AZCL - ADD_ZEPHYR_CLASS, v2 */
6199 "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)",
6209 /* Q_AZCL - ADD_ZEPHYR_CLASS, v5 */
6216 "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)",
6226 /* Q_UZCL - UPDATE_ZEPHYR_CLASS, v2 */
6227 "update_zephyr_class",
6233 "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",
6243 /* Q_UZCL - UPDATE_ZEPHYR_CLASS, v5 */
6244 "update_zephyr_class",
6250 "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",
6260 /* Q_DZCL - DELETE_ZEPHYR_CLASS */
6261 "delete_zephyr_class",
6277 /* Q_GSHA - GET_SERVER_HOST_ACCESS */
6278 "get_server_host_access",
6284 "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",
6287 "m.name LIKE UPPER('%s') AND ha.mach_id = m.mach_id",
6294 /* Q_ASHA - ADD_SERVER_HOST_ACCESS */
6295 "add_server_host_access",
6301 "INTO hostaccess (mach_id, acl_type, acl_id) VALUES (%d, '%s', %d)",
6311 /* Q_USHA - UPDATE_SERVER_HOST_ACCESS */
6312 "update_server_host_access",
6318 "hostaccess SET acl_type = '%s', acl_id = %d",
6328 /* Q_DSHA - DELETE_SERVER_HOST_ACCESS */
6329 "delete_server_host_access",
6345 /* Q_GACL - GET_ACL */
6352 "m.name, ac.target, ac.kind, l.name FROM acl ac, machine m, list l",
6355 "m.mach_id = %d AND m.mach_id = ac.mach_id AND ac.target LIKE '%s' AND l.list_id = ac.list_id",
6357 "m.name, ac.target, ac.kind",
6362 /* Q_AACL - ADD_ACL */
6369 "INTO acl (mach_id, target, kind, list_id) VALUES (%d, '%s', '%s', %d)",
6379 /* Q_DACL - DELETE_ACL */
6389 "mach_id = %d AND target = '%s'",
6396 /* Q_GSVC - GET_SERVICE */
6403 "name, protocol, port, description, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM services",
6406 "name LIKE '%s' AND protocol LIKE '%s'",
6413 /* Q_ASVC - ADD_SERVICE */
6420 "INTO services (name, protocol, port, description) VALUES ('%s', '%s', %s, NVL('%s', CHR(0)))",
6430 /* Q_DSVC - DELETE_SERVICE */
6440 "name = '%s' AND protocol = '%s'",
6447 /* Q_GPRN - GET_PRINTER */
6454 "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",
6457 "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",
6464 /* Q_GPBD - GET_PRINTER_BY_DUPLEXNAME */
6465 "get_printer_by_duplexname",
6471 "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",
6474 "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",
6481 /* Q_GPBE - GET_PRINTER_BY_ETHERNET */
6482 "get_printer_by_ethernet",
6488 "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",
6491 "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",
6498 /* Q_GPBH - GET_PRINTER_BY_HOSTNAME */
6499 "get_printer_by_hostname",
6505 "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",
6508 "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",
6515 /* Q_GPBR - GET_PRINTER_BY_RM */
6516 "get_printer_by_rm",
6522 "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",
6525 "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",
6532 /* Q_GPBL - GET_PRINTER_BY_LOCATION */
6533 "get_printer_by_location",
6539 "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",
6542 "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",
6549 /* Q_GPBC - GET_PRINTER_BY_CONTACT */
6550 "get_printer_by_contact",
6556 "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",
6559 "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",
6566 /* Q_APRN - ADD_PRINTER */
6573 "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)))",
6583 /* Q_UPRN - UPDATE_PRINTER */
6590 "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))",
6600 /* Q_DPRN - DELETE_PRINTER */
6617 /* Q_GPSV - GET_PRINT_SERVER */
6624 "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",
6627 "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",
6634 /* Q_APSV - ADD_PRINT_SERVER */
6641 "INTO printservers (mach_id, kind, printer_types, owner_type, owner_id, lpc_acl) VALUES (%d, '%s', %d, '%s', %d, %d)",
6651 /* Q_UPSV - UPDATE_PRINT_SERVER */
6652 "update_print_server",
6658 "printservers SET kind = '%s', printer_types = %d, owner_type = '%s', owner_id = %d, lpc_acl = %d",
6668 /* Q_DPSV - DELETE_PRINT_SERVER */
6669 "delete_print_server",
6685 /* Q_GALI - GET_ALIAS */
6692 "name, type, trans FROM alias",
6695 "name LIKE '%s' AND type LIKE '%s' AND trans LIKE '%s'",
6697 "type, name, trans",
6702 /* Q_AALI - ADD_ALIAS */
6709 "INTO alias (name, type, trans) VALUES ('%s', '%s', '%s')",
6719 /* Q_DALI - DELETE_ALIAS */
6729 "name = '%s' AND type = '%s' AND trans = '%s'",
6736 /* Q_GVAL - GET_VALUE */
6743 "value FROM numvalues",
6753 /* Q_AVAL - ADD_VALUE */
6760 "INTO numvalues (name, value) VALUES ('%s', %s)",
6770 /* Q_UVAL - UPDATE_VALUE */
6777 "numvalues SET value = %s",
6787 /* Q_DVAL - DELETE_VALUE */
6804 /* Q_GATS - GET_ALL_TABLE_STATS */
6805 "get_all_table_stats",
6811 "table_name, appends, updates, deletes, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS') FROM tblstats",
6821 /* Q__SDL - _SET_DEBUG_LEVEL */
6838 /* Q_GUSL - GET_USER_SIDS_BY_LOGIN, v4 */
6839 "get_user_sids_by_login",
6845 "u.login, us.sid, TO_CHAR(us.created, 'YYYY-MM-DD HH24:MI:SS') FROM users u, usersids us",
6848 "us.users_id = %d AND u.users_id = us.users_id AND SUBSTR(us.sid, 1, LENGTH(us.sid)-8) = '%s'",
6855 /* Q_AUSL - ADD_USER_SID_BY_LOGIN, v4 */
6856 "add_user_sid_by_login",
6862 "INTO usersids (users_id, sid) VALUES (%d, '%s')",
6872 /* Q_GLSN - GET_LIST_SIDS_BY_NAME, v4 */
6873 "get_list_sids_by_name",
6879 "l.name, ls.sid, TO_CHAR(ls.created, 'YYYY-MM-DD HH24:MI:SS') FROM list l, listsids ls",
6882 "ls.list_id = %d AND l.list_id = ls.list_id AND SUBSTR(ls.sid, 1, LENGTH(ls.sid)-8) = '%s'",
6889 /* Q_ALSN - ADD_LIST_SID_BY_NAME, v4 */
6890 "add_list_sid_by_name",
6896 "INTO listsids (list_id, sid) VALUES (%d, '%s')",
6906 /* Q_GDDS - GET_DISTINCT_DOMAIN_SIDS, v4 */
6907 "get_distinct_domain_sids",
6913 "DISTINCT SUBSTR(sid, 1, LENGTH(sid)-8) FROM usersids",
6923 /* Q_GCON - GET_CONTAINER, v7 */
6930 "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",
6933 "name = '%s' AND cnt_id != 0",
6940 /* Q_ACON - ADD_CONTAINER, v7 */ /* uses prefetch_value() for cnt_id */
6947 "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)",
6957 /* Q_UCON - UPDATE_CONTAINER, v7 */
6974 /* Q_DCON - DELETE_CONTAINER, v7 */
6991 /* Q_AMCN - ADD_MACHINE_TO_CONTAINER, v7 */
6992 "add_machine_to_container",
6998 "INTO mcntmap (mach_id, cnt_id) VALUES (%d, %d)",
7008 /* Q_DMCN - DELETE_MACHINE_FROM_CONTAINER, v7 */
7009 "delete_machine_from_container",
7018 "mach_id = %d AND cnt_id = %d",
7025 /* Q_GMNM - GET_MACHINE_TO_CONTAINER_MAP, v7 */
7026 "get_machine_to_container_map",
7032 "m.name, c.name FROM machine m, containers c, mcntmap mcn",
7035 "m.name = UPPER('%s') AND mcn.cnt_id = c.cnt_id AND mcn.mach_id = m.mach_id",
7042 /* Q_GMOC - GET_MACHINES_OF_CONTAINER, v7 */
7043 "get_machines_of_container",
7059 /* Q_GSOC - GET_SUBCONTAINERS_OF_CONTAINER, v7 */
7060 "get_subcontainers_of_container",
7076 /* Q_GTLC - GET_TOPLEVEL_CONTAINERS, v8 */
7077 "get_toplevel_containers",
7083 "name FROM containers",
7086 "name NOT LIKE '%%/%%'",
7094 int QueryCount = (sizeof(Queries) / sizeof(struct query));