]>
Commit | Line | Data |
---|---|---|
d33e787c | 1 | /* This file defines the query dispatch table for version 2 of the protocol |
2 | * | |
3 | * $Header$ | |
4 | * | |
5 | * Copyright 1987, 1988 by the Massachusetts Institute of Technology. | |
6 | */ | |
7 | ||
8 | #include "query.h" | |
9 | #include "sms_et.h" | |
10 | ||
11 | /* Specialized Support Query Routines */ | |
12 | ||
13 | /* Special Access Check Routines */ | |
14 | int access_user(); | |
15 | int access_login(); | |
16 | int access_list(); | |
17 | int access_visible_list(); | |
18 | int access_vis_list_by_name(); | |
19 | int access_member(); | |
20 | int access_qgli(); | |
21 | int access_service(); | |
22 | int access_filesys(); | |
23 | ||
24 | /* Query Setup Routines */ | |
25 | int setup_ausr(); | |
26 | int setup_dusr(); | |
27 | int setup_spop(); | |
28 | int setup_dpob(); | |
29 | int setup_dmac(); | |
30 | int setup_dclu(); | |
31 | int setup_alis(); | |
32 | int setup_dlis(); | |
33 | int setup_dsin(); | |
34 | int setup_dshi(); | |
35 | int setup_afil(); | |
36 | int setup_ufil(); | |
37 | int setup_dfil(); | |
38 | int setup_ssif(); | |
39 | int setup_sshi(); | |
40 | int setup_dnfp(); | |
41 | int setup_dnfq(); | |
42 | ||
43 | /* Query Followup Routines */ | |
44 | int followup_fix_modby(); | |
45 | int followup_ausr(); | |
46 | int followup_gpob(); | |
47 | int followup_glin(); | |
48 | int followup_amtl(); | |
49 | int followup_anfq(); | |
50 | int followup_gzcl(); | |
51 | int followup_gsha(); | |
52 | ||
53 | int set_modtime(); | |
54 | int set_modtime_by_id(); | |
55 | int set_finger_modtime(); | |
56 | int set_pobox_modtime(); | |
57 | int set_mach_modtime(); | |
58 | int set_mach_modtime_by_id(); | |
59 | int set_cluster_modtime_by_id(); | |
60 | int set_serverhost_modtime(); | |
61 | int set_nfsphys_modtime(); | |
62 | int set_filesys_modtime(); | |
63 | int set_zephyr_modtime(); | |
64 | ||
65 | /* Special Queries */ | |
66 | int set_pobox(); | |
67 | int get_list_info(); | |
88343c5e | 68 | int get_ace_use(); |
d33e787c | 69 | int qualified_get_lists(); |
70 | int get_members_of_list(); | |
71 | int qualified_get_server(); | |
72 | int qualified_get_serverhost(); | |
73 | int trigger_dcm(); | |
74 | int count_members_of_list(); | |
75 | int get_lists_of_member(); | |
76 | int register_user(); | |
77 | int add_user_group(); | |
78 | ||
79 | ||
80 | \f | |
81 | /* String compression | |
82 | * These are commonly used strings in the table, defined here so that | |
83 | * they can be shared. | |
84 | */ | |
85 | ||
88343c5e | 86 | static char ACE_NAME[] = "ace_name"; |
87 | static char ACE_TYPE[] = "ace_type"; | |
d33e787c | 88 | static char CLASS[] = "class"; |
89 | static char CLU_ID[] = "clu_id"; | |
90 | static char CLUSTER[] = "cluster"; | |
91 | static char DESC[] = "description"; | |
92 | static char DEVICE[] = "device"; | |
93 | static char DIR[] = "dir"; | |
94 | static char FILESYS[] = "filesys"; | |
95 | static char FILSYS_ID[] = "filsys_id"; | |
96 | static char FIRST[] = "firstname"; | |
97 | static char LABEL[] = "label"; | |
98 | static char LAST[] = "lastname"; | |
99 | static char LIST[] = "list"; | |
100 | static char LIST_ID[] = "list_id"; | |
101 | static char LOCATION[] = "location"; | |
102 | static char LOGIN[] = "login"; | |
103 | static char MACH_ID[] = "mach_id"; | |
104 | static char MACHINE[] = "machine"; | |
105 | static char MIDDLE[] = "middle"; | |
106 | static char MIT_ID[] = "mit_id"; | |
107 | static char MOD1[] = "modtime"; | |
108 | static char MOD2[] = "modby"; | |
109 | static char MOD3[] = "modwith"; | |
110 | static char NAME[] = "name"; | |
111 | static char SERVICE[] = "service"; | |
112 | static char SHELL[] = "shell"; | |
113 | static char STATUS[] = "status"; | |
114 | static char TYPE[] = "type"; | |
115 | static char USERS[] = "users"; | |
116 | static char USERS_ID[] = "users_id"; | |
117 | static char UID[] = "uid"; | |
118 | ||
119 | ||
120 | ||
121 | /* VALOBJS | |
122 | * These are commonly used validation objects, defined here so that they | |
123 | * can be shared. | |
124 | */ | |
125 | ||
126 | static struct valobj VOsort0[] = { | |
127 | {V_SORT, 0, 0, 0, 0, 0}, | |
128 | }; | |
129 | ||
130 | static struct valobj VOdate1[] = { | |
131 | {V_DATE, 1, 0, 0, 0, SMS_DATE}, | |
132 | }; | |
133 | ||
134 | static struct valobj VOuser0[] = { | |
135 | {V_ID, 0, USERS, LOGIN, USERS_ID, SMS_USER}, | |
136 | }; | |
137 | ||
138 | static struct valobj VOmach0[] = { | |
139 | {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE}, | |
140 | }; | |
141 | ||
142 | static struct valobj VOclu0[] = { | |
143 | {V_ID, 0, CLUSTER, NAME, CLU_ID, SMS_CLUSTER}, | |
144 | }; | |
145 | ||
146 | static struct valobj VOlist0[] = { | |
147 | {V_ID, 0, LIST, NAME, LIST_ID, SMS_LIST}, | |
148 | }; | |
149 | ||
150 | static struct valobj VOchar0[] = { | |
151 | {V_CHAR, 0}, | |
152 | }; | |
153 | ||
154 | static struct valobj VOsort01[] = { | |
155 | {V_SORT, 1}, | |
156 | {V_SORT, 0}, | |
157 | }; | |
158 | ||
159 | static struct valobj VOuser0sort[] = { | |
160 | {V_ID, 0, USERS, LOGIN, USERS_ID, SMS_USER}, | |
161 | {V_SORT, 0}, | |
162 | }; | |
163 | ||
164 | static struct valobj VOfilsys0user1[] = { | |
165 | {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS}, | |
166 | {V_ID, 1, USERS, LOGIN, USERS_ID, SMS_USER}, | |
167 | }; | |
168 | ||
169 | ||
170 | /* Validations | |
171 | * Commonly used validation records defined here so that they may | |
172 | * be shared. | |
173 | */ | |
174 | ||
175 | static struct validate VDmach = { VOmach0, 1 }; | |
176 | static struct validate VDsort2= { VOsort01,2 }; | |
177 | static struct validate VDsortf = { | |
178 | VOsort0, | |
179 | 1, | |
180 | 0, | |
181 | 0, | |
182 | 0, | |
183 | 0, | |
184 | 0, | |
185 | 0, | |
186 | followup_fix_modby, | |
187 | }; | |
188 | ||
189 | ||
190 | \f | |
191 | /* Query data */ | |
192 | ||
193 | static char *galo_fields[] = { | |
194 | LOGIN, UID, SHELL, LAST, FIRST, MIDDLE, | |
195 | }; | |
196 | ||
197 | static char *gubl_fields[] = { | |
198 | LOGIN, | |
199 | LOGIN, UID, SHELL, LAST, FIRST, MIDDLE, STATUS, | |
200 | MIT_ID, CLASS, MOD1, MOD2, MOD3 | |
201 | }; | |
202 | ||
203 | static struct validate gubx_validate = /* gubl, gubu */ | |
204 | { | |
205 | VOsort0, | |
206 | 1, | |
207 | 0, | |
208 | 0, | |
209 | 0, | |
210 | 0, | |
211 | access_login, | |
212 | 0, | |
213 | followup_fix_modby, | |
214 | }; | |
215 | ||
216 | static char *gubu_fields[] = { | |
217 | UID, | |
218 | LOGIN, UID, SHELL, LAST, FIRST, MIDDLE, STATUS, | |
219 | MIT_ID, CLASS, MOD1, MOD2, MOD3, | |
220 | }; | |
221 | ||
222 | static char *gubn_fields[] = { | |
223 | FIRST, LAST, | |
224 | LOGIN, UID, SHELL, LAST, FIRST, MIDDLE, STATUS, | |
225 | MIT_ID, CLASS, MOD1, MOD2, MOD3, | |
226 | }; | |
227 | ||
228 | static char *gubc_fields[] = { | |
229 | CLASS, | |
230 | LOGIN, UID, SHELL, LAST, FIRST, MIDDLE, STATUS, | |
231 | MIT_ID, CLASS, MOD1, MOD2, MOD3, | |
232 | }; | |
233 | ||
234 | static char *gubm_fields[] = { | |
235 | MIT_ID, | |
236 | LOGIN, UID, SHELL, LAST, FIRST, MIDDLE, STATUS, | |
237 | MIT_ID, CLASS, MOD1, MOD2, MOD3, | |
238 | }; | |
239 | ||
240 | static char *ausr_fields[] = { | |
241 | LOGIN, UID, SHELL, LAST, FIRST, MIDDLE, STATUS, | |
242 | MIT_ID, CLASS, | |
243 | }; | |
244 | ||
245 | static struct valobj ausr_valobj[] = { | |
246 | {V_CHAR, 0}, | |
247 | {V_CHAR, 3}, | |
248 | {V_CHAR, 4}, | |
249 | {V_CHAR, 5}, | |
250 | {V_CHAR, 7}, | |
251 | {V_TYPE, 8, CLASS, 0, 0, SMS_BAD_CLASS}, | |
252 | }; | |
253 | ||
254 | static struct validate ausr_validate = { | |
255 | ausr_valobj, | |
256 | 6, | |
257 | LOGIN, | |
258 | "u.login = \"%s\"", | |
259 | 1, | |
260 | USERS_ID, | |
261 | 0, | |
262 | setup_ausr, | |
263 | followup_ausr, | |
264 | }; | |
265 | ||
266 | static char *rusr_fields[] = { | |
267 | UID, LOGIN, "fs_type" | |
268 | }; | |
269 | ||
270 | static struct validate rusr_validate = { | |
271 | 0, | |
272 | 0, | |
273 | 0, | |
274 | 0, | |
275 | 0, | |
276 | 0, | |
277 | 0, | |
278 | register_user, | |
279 | 0, | |
280 | }; | |
281 | ||
282 | static char *uusr_fields[] = { | |
283 | LOGIN, | |
284 | "newlogin", UID, SHELL, LAST, FIRST, MIDDLE, STATUS, | |
285 | MIT_ID, CLASS, | |
286 | }; | |
287 | ||
288 | static struct valobj uusr_valobj[] = { | |
289 | {V_ID, 0, USERS, LOGIN, USERS_ID, SMS_USER}, | |
290 | {V_RENAME, 1, USERS, LOGIN, USERS_ID, SMS_NOT_UNIQUE}, | |
291 | {V_CHAR, 4}, | |
292 | {V_CHAR, 5}, | |
293 | {V_CHAR, 6}, | |
294 | {V_CHAR, 8}, | |
295 | {V_TYPE, 9, CLASS, 0, 0, SMS_BAD_CLASS}, | |
296 | }; | |
297 | ||
298 | static struct validate uusr_validate = { | |
299 | uusr_valobj, | |
300 | 7, | |
301 | 0, | |
302 | 0, | |
303 | 0, | |
304 | USERS_ID, | |
305 | 0, | |
306 | 0, | |
307 | set_modtime_by_id, | |
308 | }; | |
309 | ||
310 | static char *uush_fields[] = { | |
311 | LOGIN, | |
312 | SHELL, | |
313 | }; | |
314 | ||
315 | static struct validate uush_validate = { | |
316 | VOuser0, | |
317 | 1, | |
318 | 0, | |
319 | 0, | |
320 | 0, | |
321 | USERS_ID, | |
322 | access_user, | |
323 | 0, | |
324 | set_modtime_by_id, | |
325 | }; | |
326 | ||
327 | static char *uust_fields[] = { | |
328 | LOGIN, | |
329 | STATUS, | |
330 | }; | |
331 | ||
332 | static struct validate uust_validate = { | |
333 | VOuser0, | |
334 | 1, | |
335 | 0, | |
336 | 0, | |
337 | 0, | |
338 | USERS_ID, | |
339 | 0, | |
340 | 0, | |
341 | set_modtime_by_id, | |
342 | }; | |
343 | ||
344 | static char *dusr_fields[] = { | |
345 | LOGIN, | |
346 | }; | |
347 | ||
348 | static struct validate dusr_validate = { | |
349 | VOuser0, | |
350 | 1, | |
351 | 0, | |
352 | 0, | |
353 | 0, | |
354 | 0, | |
355 | 0, | |
356 | setup_dusr, | |
357 | 0, | |
358 | }; | |
359 | ||
360 | static char *dubu_fields[] = { | |
361 | UID, | |
362 | }; | |
363 | ||
364 | static struct valobj dubu_valobj[] = { | |
365 | {V_ID, 0, USERS, UID, USERS_ID, SMS_USER} | |
366 | }; | |
367 | ||
368 | static struct validate dubu_validate = { | |
369 | dubu_valobj, | |
370 | 1, | |
371 | 0, | |
372 | 0, | |
373 | 0, | |
374 | 0, | |
375 | 0, | |
376 | setup_dusr, | |
377 | 0, | |
378 | }; | |
379 | ||
380 | static char *gfbl_fields[] = { | |
381 | LOGIN, | |
382 | LOGIN, "fullname", "nickname", "home_addr", | |
383 | "home_phone", "office_address", "office_phone", "mit_dept", | |
384 | "mit_affil", MOD1, MOD2, MOD3, | |
385 | }; | |
386 | ||
387 | static struct validate gfbl_validate = { | |
388 | VOuser0, | |
389 | 1, | |
390 | 0, | |
391 | 0, | |
392 | 0, | |
393 | 0, | |
394 | access_user, | |
395 | 0, | |
396 | followup_fix_modby, | |
397 | }; | |
398 | ||
399 | static char *ufbl_fields[] = { | |
400 | LOGIN, | |
401 | "fullname", "nickname", "home_addr", | |
402 | "home_phone", "office_address", "office_phone", "mit_dept", | |
403 | "mit_affil", | |
404 | }; | |
405 | ||
406 | static struct validate ufbl_validate = { | |
407 | VOuser0, | |
408 | 1, | |
409 | 0, | |
410 | 0, | |
411 | 0, | |
412 | 0, | |
413 | access_user, | |
414 | 0, | |
415 | set_finger_modtime, | |
416 | }; | |
417 | ||
418 | static char *gpob_fields[] = { | |
419 | LOGIN, | |
420 | LOGIN, TYPE, "box", MOD1, MOD2, MOD3, | |
421 | }; | |
422 | ||
423 | static struct validate gpob_validate = { | |
424 | VOuser0, | |
425 | 1, | |
426 | "potype", | |
427 | "u.potype != \"NONE\" and u.users_id=%d", | |
428 | 1, | |
429 | 0, | |
430 | access_user, | |
431 | 0, | |
432 | followup_gpob, | |
433 | }; | |
434 | ||
435 | static char *gpox_fields[] = { | |
436 | LOGIN, TYPE, "box", | |
437 | }; | |
438 | ||
439 | static struct validate gpox_validate = { | |
440 | 0, | |
441 | 0, | |
442 | 0, | |
443 | 0, | |
444 | 0, | |
445 | 0, | |
446 | 0, | |
447 | 0, | |
448 | followup_gpob, | |
449 | }; | |
450 | ||
451 | static char *spob_fields[] = { | |
452 | LOGIN, TYPE, "box", | |
453 | }; | |
454 | ||
455 | static struct valobj spob_valobj[] = { | |
456 | {V_ID, 0, USERS, LOGIN, USERS_ID, SMS_USER}, | |
457 | {V_TYPE, 1, "pobox", 0, 0, SMS_TYPE}, | |
458 | }; | |
459 | ||
460 | static struct validate spob_validate = /* SET_POBOX */ | |
461 | { | |
462 | spob_valobj, | |
463 | 2, | |
464 | 0, | |
465 | 0, | |
466 | 0, | |
467 | 0, | |
468 | access_user, | |
469 | 0, | |
470 | set_pobox, | |
471 | }; | |
472 | ||
473 | static struct validate spop_validate = /* SET_POBOX_POP */ | |
474 | { | |
475 | VOuser0, | |
476 | 1, | |
477 | 0, | |
478 | 0, | |
479 | 0, | |
480 | 0, | |
481 | access_user, | |
482 | setup_spop, | |
483 | set_pobox_modtime, | |
484 | }; | |
485 | ||
486 | static struct validate dpob_validate = /* DELETE_POBOX */ | |
487 | { | |
488 | VOuser0, | |
489 | 1, | |
490 | 0, | |
491 | 0, | |
492 | 0, | |
493 | 0, | |
494 | access_user, | |
495 | setup_dpob, | |
496 | set_pobox_modtime, | |
497 | }; | |
498 | ||
499 | static char *gmac_fields[] = { | |
500 | NAME, | |
501 | NAME, TYPE, MOD1, MOD2, MOD3, | |
502 | }; | |
503 | ||
504 | static char *amac_fields[] = { | |
505 | NAME, TYPE | |
506 | }; | |
507 | ||
508 | static struct valobj amac_valobj[] = { | |
509 | {V_CHAR, 0}, | |
510 | {V_TYPE, 1, "mac_type", 0, 0, SMS_TYPE}, | |
511 | }; | |
512 | ||
513 | static struct validate amac_validate = { | |
514 | amac_valobj, | |
515 | 2, | |
516 | NAME, | |
517 | "m.name = uppercase(\"%s\")", | |
518 | 1, | |
519 | MACH_ID, | |
520 | 0, | |
521 | 0, | |
522 | set_mach_modtime, | |
523 | }; | |
524 | ||
525 | static char *umac_fields[] = { | |
526 | NAME, | |
527 | "newname", TYPE, | |
528 | }; | |
529 | ||
530 | static struct valobj umac_valobj[] = { | |
531 | {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE}, | |
532 | {V_RENAME, 1, MACHINE, NAME, MACH_ID, SMS_NOT_UNIQUE}, | |
533 | {V_TYPE, 2, "mac_type", 0, 0, SMS_TYPE}, | |
534 | }; | |
535 | ||
536 | static struct validate umac_validate = { | |
537 | umac_valobj, | |
538 | 3, | |
539 | 0, | |
540 | 0, | |
541 | 0, | |
542 | MACH_ID, | |
543 | 0, | |
544 | 0, | |
545 | set_modtime_by_id, | |
546 | }; | |
547 | ||
548 | static char *dmac_fields[] = { | |
549 | NAME, | |
550 | }; | |
551 | ||
552 | static struct validate dmac_validate = { | |
553 | VOmach0, | |
554 | 1, | |
555 | 0, | |
556 | 0, | |
557 | 0, | |
558 | 0, | |
559 | 0, | |
560 | setup_dmac, | |
561 | 0, | |
562 | }; | |
563 | ||
564 | static char *gclu_fields[] = { | |
565 | NAME, | |
566 | NAME, DESC, LOCATION, MOD1, MOD2, MOD3, | |
567 | }; | |
568 | ||
569 | static char *aclu_fields[] = { | |
570 | NAME, DESC, LOCATION, | |
571 | }; | |
572 | ||
573 | static struct validate aclu_validate = /* for aclu */ | |
574 | { | |
575 | VOchar0, | |
576 | 1, | |
577 | NAME, | |
578 | "c.name = \"%s\"", | |
579 | 1, | |
580 | "clu_id", | |
581 | 0, | |
582 | 0, | |
583 | set_modtime, | |
584 | }; | |
585 | ||
586 | static char *uclu_fields[] = { | |
587 | NAME, | |
588 | "newname", DESC, LOCATION, | |
589 | }; | |
590 | ||
591 | static struct valobj uclu_valobj[] = { | |
592 | {V_ID, 0, CLUSTER, NAME, CLU_ID, SMS_CLUSTER}, | |
593 | {V_RENAME, 1, CLUSTER, NAME, CLU_ID, SMS_NOT_UNIQUE}, | |
594 | }; | |
595 | ||
596 | static struct validate uclu_validate = { | |
597 | uclu_valobj, | |
598 | 2, | |
599 | 0, | |
600 | 0, | |
601 | 0, | |
602 | CLU_ID, | |
603 | 0, | |
604 | 0, | |
605 | set_modtime_by_id, | |
606 | }; | |
607 | ||
608 | static char *dclu_fields[] = { | |
609 | NAME, | |
610 | }; | |
611 | ||
612 | static struct validate dclu_validate = { | |
613 | VOclu0, | |
614 | 1, | |
615 | 0, | |
616 | 0, | |
617 | 0, | |
618 | 0, | |
619 | 0, | |
620 | setup_dclu, | |
621 | 0, | |
622 | }; | |
623 | ||
624 | static char *gmcm_fields[] = { | |
625 | MACHINE, CLUSTER, | |
626 | MACHINE, CLUSTER, | |
627 | }; | |
628 | ||
629 | static struct valobj amtc_valobj[] = /* ADD_MACHINE_TO_CLUSTER */ | |
630 | { /* DELETE_MACHINE_FROM_CLUSTER */ | |
631 | {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE}, | |
632 | {V_ID, 1, CLUSTER, NAME, CLU_ID, SMS_CLUSTER}, | |
633 | }; | |
634 | ||
635 | static struct validate amtc_validate = /* for amtc and dmfc */ | |
636 | { | |
637 | amtc_valobj, | |
638 | 2, | |
639 | MACH_ID, | |
640 | "m.mach_id = %d and m.clu_id = %d", | |
641 | 2, | |
642 | 0, | |
643 | 0, | |
644 | 0, | |
645 | set_mach_modtime_by_id, | |
646 | }; | |
647 | ||
648 | static char *gcld_fields[] = { | |
88343c5e | 649 | CLUSTER, "serv_label", |
650 | CLUSTER, "serv_label", "serv_cluster", | |
651 | }; | |
652 | ||
653 | static char *acld_fields[] = { | |
d33e787c | 654 | CLUSTER, "serv_label", "serv_cluster", |
655 | }; | |
656 | ||
657 | static struct valobj acld_valobj[] = | |
658 | { | |
659 | {V_ID, 0, CLUSTER, NAME, CLU_ID, SMS_CLUSTER}, | |
660 | {V_TYPE, 1, "slabel", 0, 0, SMS_TYPE}, | |
661 | {V_CHAR, 2}, | |
662 | }; | |
663 | ||
664 | static struct validate acld_validate = /* ADD_CLUSTER_DATA */ | |
665 | { /* DELETE_CLUSTER_DATA */ | |
666 | acld_valobj, | |
667 | 2, | |
668 | CLU_ID, | |
669 | "s.clu_id = %d and s.serv_label = \"%s\" and s.serv_cluster = \"%s\"", | |
670 | 3, | |
671 | 0, | |
672 | 0, | |
673 | 0, | |
674 | set_cluster_modtime_by_id, | |
675 | }; | |
676 | ||
677 | static char *gsin_fields[] = { | |
678 | SERVICE, | |
679 | SERVICE, "update_int", "target_file", "script", "dfgen", | |
680 | TYPE, "enable", "inprogress", "harderror", "errmsg", | |
88343c5e | 681 | ACE_TYPE, ACE_NAME, MOD1, MOD2, MOD3, |
d33e787c | 682 | }; |
683 | ||
684 | static struct validate gsin_validate = | |
685 | { | |
686 | 0, | |
687 | 0, | |
688 | 0, | |
689 | 0, | |
690 | 0, | |
691 | 0, | |
692 | access_service, | |
693 | 0, | |
694 | followup_glin, | |
695 | }; | |
696 | ||
697 | static char *qgsv_fields[] = { | |
698 | "enable", "inprogress", "harderror", | |
699 | "service", | |
700 | }; | |
701 | ||
702 | static struct valobj qgsv_valobj[] = { | |
703 | {V_TYPE, 0, "boolean", 0, 0, SMS_TYPE}, | |
704 | {V_TYPE, 1, "boolean", 0, 0, SMS_TYPE}, | |
705 | {V_TYPE, 2, "boolean", 0, 0, SMS_TYPE}, | |
706 | }; | |
707 | ||
708 | static struct validate qgsv_validate = { | |
709 | qgsv_valobj, | |
710 | 3, | |
711 | 0, | |
712 | 0, | |
713 | 0, | |
714 | 0, | |
715 | 0, | |
716 | 0, | |
717 | qualified_get_server, | |
718 | }; | |
719 | ||
720 | static char *asin_fields[] = { | |
721 | SERVICE, "update_int", "target_file", "script", TYPE, "enable", | |
88343c5e | 722 | ACE_TYPE, ACE_NAME, |
d33e787c | 723 | }; |
724 | ||
725 | static struct valobj asin_valobj[] = { | |
726 | {V_CHAR, 0}, | |
727 | {V_TYPE, 4, "service", 0, 0, SMS_TYPE}, | |
88343c5e | 728 | {V_TYPE, 6, ACE_TYPE, 0, 0, SMS_ACE}, |
729 | {V_TYPEDATA, 7, 0, 0, 0, SMS_ACE}, | |
d33e787c | 730 | }; |
731 | ||
732 | static struct validate asin_validate = /* for asin, usin */ | |
733 | { | |
734 | asin_valobj, | |
735 | 4, | |
736 | NAME, | |
88343c5e | 737 | "s.name = uppercase(\"%s\")", |
d33e787c | 738 | 1, |
739 | 0, | |
740 | 0, | |
741 | 0, | |
742 | set_modtime, | |
743 | }; | |
744 | ||
745 | static struct validate rsve_validate = { | |
746 | 0, | |
747 | 0, | |
748 | NAME, | |
88343c5e | 749 | "s.name = uppercase(\"%s\")", |
d33e787c | 750 | 1, |
751 | 0, | |
752 | access_service, | |
753 | 0, | |
754 | set_modtime, | |
755 | }; | |
756 | ||
757 | static char *ssif_fields[] = { | |
758 | SERVICE, "dfgen", "inprogress", "harderror", "errmsg", | |
759 | }; | |
760 | ||
761 | static struct validate ssif_validate = { | |
762 | VOdate1, | |
763 | 1, | |
764 | NAME, | |
88343c5e | 765 | "s.name = uppercase(\"%s\")", |
d33e787c | 766 | 1, |
767 | 0, | |
768 | 0, | |
769 | setup_ssif, | |
770 | 0, | |
771 | }; | |
772 | ||
773 | static char *dsin_fields[] = { | |
774 | SERVICE, | |
775 | }; | |
776 | ||
777 | static struct validate dsin_validate = { | |
778 | 0, | |
779 | 0, | |
780 | NAME, | |
88343c5e | 781 | "s.name = uppercase(\"%s\")", |
d33e787c | 782 | 1, |
783 | 0, | |
784 | 0, | |
785 | setup_dsin, | |
786 | 0, | |
787 | }; | |
788 | ||
789 | static char *gshi_fields[] = { | |
790 | SERVICE, MACHINE, | |
791 | SERVICE, MACHINE, "enable", "override", "success", "inprogress", | |
792 | "hosterror", "hosterrormsg", "ltt", "lts", "value1", "value2", | |
793 | "value3", MOD1, MOD2, MOD3, | |
794 | }; | |
795 | ||
796 | static struct validate gshi_validate = { | |
797 | 0, | |
798 | 0, | |
799 | 0, | |
800 | 0, | |
801 | 0, | |
802 | 0, | |
803 | access_service, | |
804 | 0, | |
805 | followup_fix_modby, | |
806 | }; | |
807 | ||
808 | static char *qgsh_fields[] = { | |
809 | "service", "enable", "override", "success", "inprogress", "hosterror", | |
810 | "service", MACHINE, | |
811 | }; | |
812 | ||
813 | static struct valobj qgsh_valobj[] = { | |
814 | {V_TYPE, 1, "boolean", 0, 0, SMS_TYPE}, | |
815 | {V_TYPE, 2, "boolean", 0, 0, SMS_TYPE}, | |
816 | {V_TYPE, 3, "boolean", 0, 0, SMS_TYPE}, | |
817 | {V_TYPE, 4, "boolean", 0, 0, SMS_TYPE}, | |
818 | {V_TYPE, 5, "boolean", 0, 0, SMS_TYPE}, | |
819 | }; | |
820 | ||
821 | static struct validate qgsh_validate = { | |
822 | qgsh_valobj, | |
823 | 5, | |
824 | 0, | |
825 | 0, | |
826 | 0, | |
827 | 0, | |
828 | 0, | |
829 | 0, | |
830 | qualified_get_serverhost, | |
831 | }; | |
832 | ||
833 | static char *ashi_fields[] = { | |
834 | SERVICE, MACHINE, "enable", "value1", "value2", "value3", | |
835 | }; | |
836 | ||
837 | static struct valobj ashi_valobj[] = { | |
838 | {V_NAME, 0, "servers", NAME, 0, SMS_SERVICE}, | |
839 | {V_ID, 1, MACHINE, NAME, MACH_ID, SMS_MACHINE}, | |
840 | }; | |
841 | ||
842 | static struct validate ashi_validate = /* ashi & ushi */ | |
843 | { | |
844 | ashi_valobj, | |
845 | 2, | |
846 | SERVICE, | |
88343c5e | 847 | "sh.service = uppercase(\"%s\") and sh.mach_id = %d", |
d33e787c | 848 | 2, |
849 | 0, | |
850 | access_service, | |
851 | 0, | |
852 | set_serverhost_modtime, | |
853 | }; | |
854 | ||
855 | static struct validate rshe_validate = | |
856 | { | |
857 | ashi_valobj, | |
858 | 2, | |
859 | SERVICE, | |
88343c5e | 860 | "sh.service = uppercase(\"%s\") and sh.mach_id = %d", |
d33e787c | 861 | 2, |
862 | 0, | |
863 | access_service, | |
864 | 0, | |
865 | set_serverhost_modtime, | |
866 | }; | |
867 | ||
868 | static struct validate ssho_validate = | |
869 | { | |
870 | ashi_valobj, | |
871 | 2, | |
872 | SERVICE, | |
88343c5e | 873 | "sh.service = uppercase(\"%s\") and sh.mach_id = %d", |
d33e787c | 874 | 2, |
875 | 0, | |
876 | access_service, | |
877 | 0, | |
878 | trigger_dcm, | |
879 | }; | |
880 | ||
881 | static char *sshi_fields[] = { | |
882 | "service", MACHINE, "override", "success", "inprogress", | |
883 | "hosterror", "errmsg", "ltt", "lts" | |
884 | }; | |
885 | ||
886 | static struct valobj sshi_valobj[] = { | |
887 | {V_NAME, 0, "servers", NAME, 0, SMS_SERVICE}, | |
888 | {V_ID, 1, MACHINE, NAME, MACH_ID, SMS_MACHINE}, | |
889 | {V_DATE, 7, 0, 0, 0, SMS_DATE}, | |
890 | {V_DATE, 8, 0, 0, 0, SMS_DATE}, | |
891 | }; | |
892 | ||
893 | static struct validate sshi_validate = | |
894 | { | |
895 | sshi_valobj, | |
896 | 4, | |
897 | SERVICE, | |
88343c5e | 898 | "sh.service = uppercase(\"%s\") and sh.mach_id = %d", |
d33e787c | 899 | 2, |
900 | 0, | |
901 | 0, | |
902 | setup_sshi, | |
903 | 0, | |
904 | }; | |
905 | ||
906 | static char *dshi_fields[] = { | |
907 | SERVICE, MACHINE, | |
908 | }; | |
909 | ||
910 | static struct validate dshi_validate = | |
911 | { | |
912 | ashi_valobj, | |
913 | 2, | |
914 | SERVICE, | |
88343c5e | 915 | "sh.service = uppercase(\"%s\") and sh.mach_id = %d", |
d33e787c | 916 | 2, |
917 | 0, | |
918 | access_service, | |
919 | setup_dshi, | |
920 | 0, | |
921 | }; | |
922 | ||
923 | static char *gsha_fields[] = { | |
924 | MACHINE, | |
88343c5e | 925 | MACHINE, ACE_TYPE, ACE_NAME, MOD1, MOD2, MOD3, |
d33e787c | 926 | }; |
927 | ||
928 | static struct validate gsha_validate = | |
929 | { | |
930 | 0, | |
931 | 0, | |
932 | 0, | |
933 | 0, | |
934 | 0, | |
935 | 0, | |
936 | 0, | |
937 | 0, | |
938 | followup_gsha, | |
939 | }; | |
940 | ||
941 | static char *asha_fields[] = { | |
88343c5e | 942 | MACHINE, ACE_TYPE, ACE_NAME, |
d33e787c | 943 | }; |
944 | ||
945 | static struct valobj asha_valobj[] = { | |
946 | {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE}, | |
88343c5e | 947 | {V_TYPE, 1, ACE_TYPE, 0, 0, SMS_ACE}, |
948 | {V_TYPEDATA, 2, 0, 0, 0, SMS_ACE}, | |
d33e787c | 949 | }; |
950 | ||
951 | static struct validate asha_validate = | |
952 | { | |
953 | asha_valobj, | |
954 | 3, | |
955 | MACH_ID, | |
956 | "ha.mach_id = %d", | |
957 | 1, | |
958 | MACH_ID, | |
959 | 0, | |
960 | 0, | |
961 | set_modtime_by_id, | |
962 | }; | |
963 | ||
964 | static char *gslo_fields[] = { | |
965 | "server", | |
966 | "server", MACHINE, | |
967 | }; | |
968 | ||
969 | static char *gfsl_fields[] = { | |
970 | LABEL, | |
971 | LABEL, TYPE, MACHINE, NAME, "mount", "access", "comments", "owner", "owners", | |
972 | "create", "lockertype", MOD1, MOD2, MOD3, | |
973 | }; | |
974 | ||
975 | static char *gfsm_fields[] = { | |
976 | MACHINE, | |
977 | LABEL, TYPE, MACHINE, NAME, "mount", "access", "comments", "owner", "owners", | |
978 | "create", "lockertype", MOD1, MOD2, MOD3, | |
979 | }; | |
980 | ||
981 | static struct validate gfsm_validate = { | |
982 | VOmach0, | |
983 | 1, | |
984 | 0, | |
985 | 0, | |
986 | 0, | |
987 | 0, | |
988 | 0, | |
989 | 0, | |
990 | followup_fix_modby, | |
991 | }; | |
992 | ||
88343c5e | 993 | static char *gfsn_fields[] = { |
994 | MACHINE, "parition", | |
995 | LABEL, TYPE, MACHINE, NAME, "mount", "access", "comments", "owner", "owners", | |
996 | "create", "lockertype", MOD1, MOD2, MOD3, | |
997 | }; | |
998 | ||
d33e787c | 999 | static char *gfsg_fields[] = { |
1000 | LIST, | |
1001 | LABEL, TYPE, MACHINE, NAME, "mount", "access", "comments", "owner", "owners", | |
1002 | "create", "lockertype", MOD1, MOD2, MOD3, | |
1003 | }; | |
1004 | ||
1005 | static struct validate gfsg_validate = { | |
1006 | VOlist0, | |
1007 | 1, | |
1008 | 0, | |
1009 | 0, | |
1010 | 0, | |
1011 | 0, | |
1012 | access_list, | |
1013 | 0, | |
1014 | followup_fix_modby, | |
1015 | }; | |
1016 | ||
1017 | static char *afil_fields[] = { | |
1018 | LABEL, TYPE, MACHINE, NAME, "mount", "access", "comments", "owner", "owners", | |
1019 | "create", "lockertype", | |
1020 | }; | |
1021 | ||
1022 | static struct valobj afil_valobj[] = { | |
1023 | {V_CHAR, 0}, | |
88343c5e | 1024 | {V_TYPE, 1, FILESYS, 0, 0, SMS_FSTYPE}, |
d33e787c | 1025 | {V_ID, 2, MACHINE, NAME, MACH_ID, SMS_MACHINE}, |
1026 | {V_CHAR, 3}, | |
1027 | {V_ID, 7, USERS, LOGIN, USERS_ID, SMS_USER}, | |
1028 | {V_ID, 8, LIST, NAME, LIST_ID, SMS_LIST}, | |
1029 | {V_TYPE, 10, "lockertype", 0, 0, SMS_TYPE} | |
1030 | }; | |
1031 | ||
1032 | static struct validate afil_validate = { | |
1033 | afil_valobj, | |
1034 | 7, | |
1035 | LABEL, | |
1036 | "fs.label = \"%s\"", | |
1037 | 1, | |
1038 | FILSYS_ID, | |
1039 | 0, | |
1040 | setup_afil, | |
1041 | set_filesys_modtime, | |
1042 | }; | |
1043 | ||
1044 | static char *ufil_fields[] = { | |
1045 | LABEL, "newlabel", TYPE, MACHINE, NAME, "mount", "access", "comments", | |
1046 | "owner", "owners", "create", "lockertype", | |
1047 | }; | |
1048 | ||
1049 | static struct valobj ufil_valobj[] = { | |
1050 | {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS}, | |
1051 | {V_RENAME, 1, FILESYS, LABEL, FILSYS_ID, SMS_NOT_UNIQUE}, | |
88343c5e | 1052 | {V_TYPE, 2, FILESYS, 0, 0, SMS_FSTYPE}, |
d33e787c | 1053 | {V_ID, 3, MACHINE, NAME, MACH_ID, SMS_MACHINE}, |
1054 | {V_CHAR, 4}, | |
1055 | {V_ID, 8, USERS, LOGIN, USERS_ID, SMS_USER}, | |
1056 | {V_ID, 9, LIST, NAME, LIST_ID, SMS_LIST}, | |
1057 | {V_TYPE, 11, "lockertype", 0, 0, SMS_TYPE} | |
1058 | }; | |
1059 | ||
1060 | static struct validate ufil_validate = { | |
1061 | ufil_valobj, | |
1062 | 8, | |
1063 | LABEL, | |
1064 | "fs.filsys_id = %d", | |
1065 | 1, | |
1066 | FILSYS_ID, | |
1067 | 0, | |
1068 | setup_ufil, | |
1069 | set_filesys_modtime, | |
1070 | }; | |
1071 | ||
1072 | static char *dfil_fields[] = { | |
1073 | LABEL, | |
1074 | }; | |
1075 | ||
1076 | static struct valobj dfil_valobj[] = { | |
1077 | {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS}, | |
1078 | }; | |
1079 | ||
1080 | static struct validate dfil_validate = { | |
1081 | dfil_valobj, | |
1082 | 1, | |
1083 | "label", | |
1084 | "fs.filsys_id = %d", | |
1085 | 1, | |
1086 | 0, | |
1087 | 0, | |
1088 | setup_dfil, | |
1089 | 0, | |
1090 | }; | |
1091 | ||
1092 | static char *ganf_fields[] = { | |
1093 | MACHINE, DIR, DEVICE, STATUS, "allocated", "size", MOD1, MOD2, MOD3, | |
1094 | }; | |
1095 | ||
1096 | static char *gnfp_fields[] = { | |
1097 | MACHINE, DIR, | |
1098 | MACHINE, DIR, DEVICE, STATUS, "allocated", "size", MOD1, MOD2, MOD3, | |
1099 | }; | |
1100 | ||
1101 | static struct validate gnfp_validate = { | |
1102 | VOmach0, | |
1103 | 1, | |
1104 | 0, | |
1105 | 0, | |
1106 | 0, | |
1107 | 0, | |
1108 | 0, | |
1109 | 0, | |
1110 | followup_fix_modby, | |
1111 | }; | |
1112 | ||
1113 | static struct valobj anfp_valobj[] = { | |
1114 | {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE}, | |
1115 | {V_CHAR, 1}, | |
1116 | }; | |
1117 | ||
1118 | static struct validate anfp_validate = { | |
1119 | anfp_valobj, | |
1120 | 2, | |
1121 | DIR, | |
1122 | "np.mach_id = %d and np.dir = \"%s\"", | |
1123 | 2, | |
1124 | "nfsphys_id", | |
1125 | 0, | |
1126 | 0, | |
1127 | set_nfsphys_modtime, | |
1128 | }; | |
1129 | ||
1130 | static char *dnfp_fields[] = { | |
1131 | MACHINE, DIR, | |
1132 | }; | |
1133 | ||
1134 | static struct validate dnfp_validate = { | |
1135 | VOmach0, | |
1136 | 1, | |
1137 | DIR, | |
1138 | "np.mach_id = %d and np.dir = \"%s\"", | |
1139 | 2, | |
1140 | "nfsphys_id", | |
1141 | 0, | |
1142 | setup_dnfp, | |
1143 | set_nfsphys_modtime, | |
1144 | }; | |
1145 | ||
1146 | static char *gnfq_fields[] = { | |
88343c5e | 1147 | FILESYS, LOGIN, |
d33e787c | 1148 | FILESYS, LOGIN, "quota", DIR, MACHINE, MOD1, MOD2, MOD3, |
1149 | }; | |
1150 | ||
88343c5e | 1151 | static struct valobj gnfq_valobj[] = { |
1152 | {V_ID, 1, USERS, LOGIN, USERS_ID, SMS_USER}, | |
1153 | {V_SORT, 0}, | |
1154 | }; | |
1155 | ||
d33e787c | 1156 | static struct validate gnfq_validate = { |
88343c5e | 1157 | gnfq_valobj, |
1158 | 2, | |
d33e787c | 1159 | 0, |
1160 | 0, | |
1161 | 0, | |
1162 | 0, | |
1163 | access_filesys, | |
1164 | 0, | |
1165 | followup_fix_modby, | |
1166 | }; | |
1167 | ||
1168 | static char *gnqp_fields[] = { | |
1169 | MACHINE, DIR, | |
1170 | FILESYS, LOGIN, "quota", DIR, MACHINE, MOD1, MOD2, MOD3, | |
1171 | }; | |
1172 | ||
d33e787c | 1173 | static char *anfq_fields[] = { |
1174 | FILESYS, LOGIN, "quota", | |
1175 | }; | |
1176 | ||
1177 | static struct validate anfq_validate = { | |
1178 | VOfilsys0user1, | |
1179 | 2, | |
1180 | USERS_ID, | |
1181 | "nq.filsys_id = %d and nq.users_id = %d", | |
1182 | 2, | |
1183 | 0, | |
1184 | 0, | |
1185 | 0, | |
1186 | followup_anfq, | |
1187 | }; | |
1188 | ||
1189 | static struct validate unfq_validate = { | |
1190 | VOfilsys0user1, | |
1191 | 2, | |
1192 | USERS_ID, | |
1193 | "nq.filsys_id = %d and nq.users_id = %d", | |
1194 | 2, | |
1195 | 0, | |
1196 | 0, | |
1197 | setup_dnfq, | |
1198 | followup_anfq, | |
1199 | }; | |
1200 | ||
1201 | static struct validate dnfq_validate = { | |
1202 | VOfilsys0user1, | |
1203 | 2, | |
1204 | USERS_ID, | |
1205 | "nq.filsys_id = %d and nq.users_id = %d", | |
1206 | 2, | |
1207 | 0, | |
1208 | 0, | |
1209 | setup_dnfq, | |
1210 | 0, | |
1211 | }; | |
1212 | ||
1213 | static char *glin_fields[] = { | |
1214 | NAME, | |
1215 | NAME, "active", "public", "hidden", "maillist", "group", "gid", | |
88343c5e | 1216 | ACE_TYPE, ACE_NAME, DESC, MOD1, MOD2, MOD3, |
d33e787c | 1217 | }; |
1218 | ||
1219 | static struct validate glin_validate = { | |
1220 | 0, | |
1221 | 0, | |
1222 | 0, | |
1223 | 0, | |
1224 | 0, | |
1225 | 0, | |
1226 | access_vis_list_by_name, | |
1227 | 0, | |
1228 | get_list_info, | |
1229 | }; | |
1230 | ||
1231 | static char *alis_fields[] = { | |
1232 | NAME, "active", "public", "hidden", "maillist", "group", "gid", | |
88343c5e | 1233 | ACE_TYPE, ACE_NAME, DESC, |
d33e787c | 1234 | }; |
1235 | ||
1236 | static struct valobj alis_valobj[] = { | |
1237 | {V_CHAR, 0}, | |
88343c5e | 1238 | {V_TYPE, 7, ACE_TYPE, 0, 0, SMS_ACE}, |
1239 | {V_TYPEDATA, 8, 0, 0, LIST_ID, SMS_ACE}, | |
d33e787c | 1240 | }; |
1241 | ||
1242 | static struct validate alis_validate = { | |
1243 | alis_valobj, | |
1244 | 3, | |
1245 | NAME, | |
1246 | "l.name = \"%s\"", | |
1247 | 1, | |
1248 | LIST_ID, | |
1249 | 0, | |
1250 | setup_alis, | |
1251 | set_modtime, | |
1252 | }; | |
1253 | ||
1254 | static char *ulis_fields[] = { | |
1255 | NAME, | |
1256 | "newname", "active", "public", "hidden", "maillist", "group", "gid", | |
88343c5e | 1257 | ACE_TYPE, ACE_NAME, DESC, |
d33e787c | 1258 | }; |
1259 | ||
1260 | static struct valobj ulis_valobj[] = { | |
1261 | {V_ID, 0, LIST, NAME, LIST_ID, SMS_LIST}, | |
1262 | {V_RENAME, 1, LIST, NAME, LIST_ID, SMS_NOT_UNIQUE}, | |
88343c5e | 1263 | {V_TYPE, 8, ACE_TYPE, 0, 0, SMS_ACE}, |
1264 | {V_TYPEDATA, 9, 0, 0, LIST_ID, SMS_ACE}, | |
d33e787c | 1265 | }; |
1266 | ||
1267 | static struct validate ulis_validate = { | |
1268 | ulis_valobj, | |
1269 | 4, | |
1270 | NAME, | |
1271 | "l.list_id = %d", | |
1272 | 1, | |
1273 | LIST_ID, | |
1274 | access_list, | |
1275 | setup_alis, | |
1276 | set_modtime_by_id, | |
1277 | }; | |
1278 | ||
1279 | static char *dlis_fields[] = { | |
1280 | NAME, | |
1281 | }; | |
1282 | ||
1283 | static struct validate dlis_validate = { | |
1284 | VOlist0, | |
1285 | 1, | |
1286 | NAME, | |
1287 | "l.list_id = %d", | |
1288 | 1, | |
1289 | 0, | |
1290 | access_list, | |
1291 | setup_dlis, | |
1292 | 0, | |
1293 | }; | |
1294 | ||
1295 | static char *amtl_fields[] = { | |
1296 | "list_name", "member_type", "member_name", | |
1297 | }; | |
1298 | ||
1299 | static struct valobj amtl_valobj[] = { | |
1300 | {V_ID, 0, LIST, NAME, LIST_ID, SMS_LIST}, | |
1301 | {V_TYPE, 1, "member", 0, 0, SMS_TYPE}, | |
1302 | {V_TYPEDATA, 2, 0, 0, 0, SMS_NO_MATCH}, | |
1303 | }; | |
1304 | ||
1305 | static struct validate amtl_validate = /* for amtl and dmfl */ | |
1306 | { | |
1307 | amtl_valobj, | |
1308 | 3, | |
1309 | "member_id", | |
1310 | "m.list_id = %d and m.member_type = \"%s\" and m.member_id = %d", | |
1311 | 3, | |
1312 | 0, | |
1313 | access_list, | |
1314 | 0, | |
1315 | followup_amtl, | |
1316 | }; | |
1317 | ||
1318 | static char *gaus_fields[] = { | |
88343c5e | 1319 | ACE_TYPE, ACE_NAME, |
d33e787c | 1320 | "use_type", "use_name", |
1321 | }; | |
1322 | ||
1323 | static struct valobj gaus_valobj[] = { | |
1324 | {V_TYPE, 0, "gaus", 0, 0, SMS_TYPE}, | |
1325 | {V_TYPEDATA, 1, 0, 0, 0, SMS_NO_MATCH}, | |
1326 | }; | |
1327 | ||
1328 | static struct validate gaus_validate = { | |
1329 | gaus_valobj, | |
1330 | 2, | |
1331 | 0, | |
1332 | 0, | |
1333 | 0, | |
1334 | 0, | |
1335 | access_member, | |
1336 | 0, | |
88343c5e | 1337 | get_ace_use, |
d33e787c | 1338 | }; |
1339 | ||
1340 | static char *qgli_fields[] = { | |
1341 | "active", "public", "hidden", "maillist", "group", | |
1342 | "list", | |
1343 | }; | |
1344 | ||
1345 | static struct valobj qgli_valobj[] = { | |
1346 | {V_TYPE, 0, "boolean", 0, 0, SMS_TYPE}, | |
1347 | {V_TYPE, 1, "boolean", 0, 0, SMS_TYPE}, | |
1348 | {V_TYPE, 2, "boolean", 0, 0, SMS_TYPE}, | |
1349 | {V_TYPE, 3, "boolean", 0, 0, SMS_TYPE}, | |
1350 | {V_TYPE, 4, "boolean", 0, 0, SMS_TYPE}, | |
1351 | }; | |
1352 | ||
1353 | static struct validate qgli_validate = { | |
1354 | qgli_valobj, | |
1355 | 5, | |
1356 | 0, | |
1357 | 0, | |
1358 | 0, | |
1359 | 0, | |
1360 | access_qgli, | |
1361 | 0, | |
1362 | qualified_get_lists, | |
1363 | }; | |
1364 | ||
1365 | static char *gmol_fields[] = { | |
1366 | "list_name", | |
1367 | "member_type", "member_name", | |
1368 | }; | |
1369 | ||
1370 | static struct validate gmol_validate = { | |
1371 | VOlist0, | |
1372 | 1, | |
1373 | 0, | |
1374 | 0, | |
1375 | 0, | |
1376 | 0, | |
1377 | access_visible_list, | |
1378 | 0, | |
1379 | get_members_of_list, | |
1380 | }; | |
1381 | ||
1382 | static char *glom_fields[] = { | |
1383 | "member_type", "member_name", | |
1384 | "list_name", "active", "public", "hidden", "maillist", "group", | |
1385 | }; | |
1386 | ||
1387 | static struct valobj glom_valobj[] = { | |
1388 | {V_TYPE, 0, "rmember", 0, 0, SMS_TYPE}, | |
1389 | {V_TYPEDATA, 1, 0, 0, 0, SMS_NO_MATCH}, | |
1390 | {V_SORT, 0}, | |
1391 | }; | |
1392 | ||
1393 | static struct validate glom_validate = { | |
1394 | glom_valobj, | |
1395 | 3, | |
1396 | 0, | |
1397 | 0, | |
1398 | 0, | |
1399 | 0, | |
1400 | access_member, | |
1401 | 0, | |
1402 | get_lists_of_member, | |
1403 | }; | |
1404 | ||
1405 | static char *cmol_fields[] = { | |
1406 | "list_name", | |
1407 | "count", | |
1408 | }; | |
1409 | ||
1410 | static struct validate cmol_validate = { | |
1411 | VOlist0, | |
1412 | 1, | |
1413 | 0, | |
1414 | 0, | |
1415 | 0, | |
1416 | 0, | |
1417 | access_visible_list, | |
1418 | 0, | |
1419 | count_members_of_list, | |
1420 | }; | |
1421 | ||
1422 | static char *augr_fields[] = { | |
1423 | LOGIN, | |
1424 | }; | |
1425 | ||
1426 | static struct validate augr_validate = { | |
1427 | 0, | |
1428 | 0, | |
1429 | 0, | |
1430 | 0, | |
1431 | 0, | |
1432 | 0, | |
1433 | 0, | |
1434 | 0, | |
1435 | add_user_group, | |
1436 | }; | |
1437 | ||
1438 | static char *gzcl_fields[] = { | |
1439 | CLASS, | |
1440 | CLASS, "xmt_type", "xmt_name", "sub_type", "sub_name", | |
1441 | "iws_type", "iws_name", "iui_type", "iui_name", MOD1, MOD2, MOD3, | |
1442 | }; | |
1443 | ||
1444 | static struct validate gzcl_validate = { | |
1445 | VOsort0, | |
1446 | 1, | |
1447 | 0, | |
1448 | 0, | |
1449 | 0, | |
1450 | 0, | |
1451 | 0, | |
1452 | 0, | |
1453 | followup_gzcl, | |
1454 | }; | |
1455 | ||
1456 | static char *azcl_fields[] = { | |
1457 | CLASS, "xmt_type", "xmt_name", "sub_type", "sub_name", | |
1458 | "iws_type", "iws_name", "iui_type", "iui_name", | |
1459 | }; | |
1460 | ||
1461 | static struct valobj azcl_valobj[] = { | |
1462 | {V_CHAR, 0}, | |
88343c5e | 1463 | {V_TYPE, 1, ACE_TYPE, 0, 0, SMS_ACE}, |
1464 | {V_TYPEDATA, 2, 0, 0, LIST_ID, SMS_ACE}, | |
1465 | {V_TYPE, 3, ACE_TYPE, 0, 0, SMS_ACE}, | |
1466 | {V_TYPEDATA, 4, 0, 0, LIST_ID, SMS_ACE}, | |
1467 | {V_TYPE, 5, ACE_TYPE, 0, 0, SMS_ACE}, | |
1468 | {V_TYPEDATA, 6, 0, 0, LIST_ID, SMS_ACE}, | |
1469 | {V_TYPE, 7, ACE_TYPE, 0, 0, SMS_ACE}, | |
1470 | {V_TYPEDATA, 8, 0, 0, LIST_ID, SMS_ACE}, | |
d33e787c | 1471 | }; |
1472 | ||
1473 | static struct validate azcl_validate = { | |
1474 | azcl_valobj, | |
1475 | 8, | |
1476 | CLASS, | |
1477 | "z.class = \"%s\"", | |
1478 | 1, | |
1479 | 0, | |
1480 | 0, | |
1481 | 0, | |
1482 | set_zephyr_modtime, | |
1483 | }; | |
1484 | ||
1485 | static char *uzcl_fields[] = { | |
1486 | CLASS, "newclass", "xmt_type", "xmt_name", "sub_type", "sub_name", | |
1487 | "iws_type", "iws_name", "iui_type", "iui_name", | |
1488 | }; | |
1489 | ||
1490 | static struct valobj uzcl_valobj[] = { | |
1491 | {V_RENAME, 1, "zephyr", CLASS, 0, SMS_NOT_UNIQUE}, | |
88343c5e | 1492 | {V_TYPE, 2, ACE_TYPE, 0, 0, SMS_ACE}, |
1493 | {V_TYPEDATA, 3, 0, 0, LIST_ID, SMS_ACE}, | |
1494 | {V_TYPE, 4, ACE_TYPE, 0, 0, SMS_ACE}, | |
1495 | {V_TYPEDATA, 5, 0, 0, LIST_ID, SMS_ACE}, | |
1496 | {V_TYPE, 6, ACE_TYPE, 0, 0, SMS_ACE}, | |
1497 | {V_TYPEDATA, 7, 0, 0, LIST_ID, SMS_ACE}, | |
1498 | {V_TYPE, 8, ACE_TYPE, 0, 0, SMS_ACE}, | |
1499 | {V_TYPEDATA, 9, 0, 0, LIST_ID, SMS_ACE}, | |
d33e787c | 1500 | }; |
1501 | ||
1502 | static struct validate uzcl_validate = { | |
1503 | uzcl_valobj, | |
1504 | 9, | |
1505 | CLASS, | |
1506 | "z.class = \"%s\"", | |
1507 | 1, | |
1508 | 0, | |
1509 | 0, | |
1510 | 0, | |
1511 | set_zephyr_modtime, | |
1512 | }; | |
1513 | ||
1514 | static struct validate dzcl_validate = { | |
1515 | 0, | |
1516 | 0, | |
1517 | CLASS, | |
1518 | "z.class = \"%s\"", | |
1519 | 1, | |
1520 | 0, | |
1521 | 0, | |
1522 | 0, | |
1523 | 0, | |
1524 | }; | |
1525 | ||
1526 | static char *gasv_fields[] = { | |
1527 | SERVICE, "protocol", "port", DESC, | |
1528 | }; | |
1529 | ||
1530 | static char *gpcp_fields[] = { | |
1531 | "printer", | |
1532 | "printer", "printcap", MOD1, MOD2, MOD3, | |
1533 | }; | |
1534 | ||
1535 | static char *apcp_fields[] = { | |
1536 | "printer", "printcap", MOD1, MOD2, MOD3, | |
1537 | }; | |
1538 | ||
1539 | static struct validate apcp_validate = { | |
1540 | VOchar0, | |
1541 | 1, | |
1542 | NAME, | |
1543 | "p.name = \"%s\"", | |
1544 | 1, | |
1545 | 0, | |
1546 | 0, | |
1547 | 0, | |
1548 | set_modtime, | |
1549 | }; | |
1550 | ||
1551 | static char *gali_fields[] = { | |
1552 | NAME, TYPE, "trans", | |
1553 | NAME, TYPE, "trans", | |
1554 | }; | |
1555 | ||
1556 | static char *aali_fields[] = { | |
1557 | NAME, TYPE, "trans", | |
1558 | }; | |
1559 | ||
1560 | static struct valobj aali_valobj[] = { | |
1561 | {V_CHAR, 0}, | |
1562 | {V_TYPE, 1, "alias", 0, 0, SMS_TYPE}, | |
1563 | {V_CHAR, 2}, | |
1564 | }; | |
1565 | ||
1566 | static struct validate aali_validate = { | |
1567 | aali_valobj, | |
1568 | 3, | |
1569 | "trans", | |
1570 | "a.name = \"%s\" and a.type = \"%s\" and a.trans = \"%s\"", | |
1571 | 3, | |
1572 | 0, | |
1573 | 0, | |
1574 | 0, | |
1575 | 0, | |
1576 | }; | |
1577 | ||
1578 | static struct validate dali_validate = /* DELETE_ALIAS */ | |
1579 | { | |
1580 | 0, | |
1581 | 0, | |
1582 | "trans", | |
1583 | "a.name = \"%s\" and a.type = \"%s\" and a.trans = \"%s\"", | |
1584 | 3, | |
1585 | 0, | |
1586 | 0, | |
1587 | 0, | |
1588 | 0, | |
1589 | }; | |
1590 | ||
1591 | static char *gval_fields[] = { | |
1592 | NAME, "value", | |
1593 | }; | |
1594 | ||
1595 | static struct valobj gval_valobj[] = { | |
1596 | {V_NAME, 0, "values", NAME, 0, SMS_NO_MATCH}, | |
1597 | }; | |
1598 | ||
1599 | static struct validate gval_validate = { | |
1600 | gval_valobj, | |
1601 | 1, | |
1602 | 0, | |
1603 | 0, | |
1604 | 0, | |
1605 | 0, | |
1606 | 0, | |
1607 | 0, | |
1608 | 0, | |
1609 | }; | |
1610 | ||
1611 | static char *aval_fields[] = { | |
1612 | NAME, "value", | |
1613 | }; | |
1614 | ||
1615 | static struct validate aval_validate = /* for aval, uval, and dval */ | |
1616 | { | |
1617 | VOchar0, | |
1618 | 1, | |
1619 | NAME, | |
1620 | "v.name = \"%s\"", | |
1621 | 1, | |
1622 | 0, | |
1623 | 0, | |
1624 | 0, | |
1625 | 0, | |
1626 | }; | |
1627 | ||
1628 | static char *dval_fields[] = { | |
1629 | NAME, | |
1630 | }; | |
1631 | ||
1632 | static char *gats_fields[] = { | |
1633 | "table", "retrieves", "appends", "updates", "deletes", MOD1, MOD2, MOD3, | |
1634 | }; | |
1635 | ||
1636 | ||
1637 | \f | |
1638 | /* Generalized Query Definitions */ | |
1639 | ||
1640 | struct query Queries2[] = { | |
1641 | { | |
1642 | /* Q_GALO - GET_ALL_LOGINS */ | |
1643 | "get_all_logins", | |
1644 | "galo", | |
1645 | RETRIEVE, | |
1646 | "u", | |
1647 | USERS, | |
1648 | "%c = u.login, %c = text(u.uid), %c = u.shell, %c = u.last, %c = u.first, %c = u.middle", | |
1649 | galo_fields, | |
1650 | 6, | |
1651 | "u.users_id != 0", | |
1652 | 0, | |
1653 | 0, | |
1654 | }, | |
1655 | ||
1656 | { | |
1657 | /* Q_GAAL - GET_ALL_ACTIVE_LOGINS */ | |
1658 | "get_all_active_logins", | |
1659 | "gaal", | |
1660 | RETRIEVE, | |
1661 | "u", | |
1662 | USERS, | |
1663 | "%c = u.login, %c = text(u.uid), %c = u.shell, %c = u.last, %c = u.first, %c = u.middle", | |
1664 | galo_fields, | |
1665 | 6, | |
1666 | "u.status != 0", | |
1667 | 0, | |
1668 | 0, | |
1669 | }, | |
1670 | ||
1671 | { | |
1672 | /* Q_GUBL - GET_USER_BY_LOGIN */ | |
1673 | "get_user_by_login", | |
1674 | "gubl", | |
1675 | RETRIEVE, | |
1676 | "u", | |
1677 | USERS, | |
1678 | "%c = u.login, %c = text(u.uid), %c = u.shell, %c = u.last, %c = u.first, %c = u.middle, %c = text(u.status), %c = u.mit_id, %c = u.mit_year, %c = u.modtime, %c = text(u.modby), %c = u.modwith", | |
1679 | gubl_fields, | |
1680 | 12, | |
1681 | "u.login = \"%s\" and u.users_id != 0", | |
1682 | 1, | |
1683 | &gubx_validate, | |
1684 | }, | |
1685 | ||
1686 | { | |
1687 | /* Q_GUBU - GET_USER_BY_UID */ | |
1688 | "get_user_by_uid", | |
1689 | "gubu", | |
1690 | RETRIEVE, | |
1691 | "u", | |
1692 | USERS, | |
1693 | "%c = u.login, %c = text(u.uid), %c = u.shell, %c = u.last, %c = u.first, %c = u.middle, %c = text(u.status), %c = u.mit_id, %c = u.mit_year, %c = u.modtime, %c = text(u.modby), %c = u.modwith", | |
1694 | gubu_fields, | |
1695 | 12, | |
1696 | "u.uid = %s and u.users_id != 0", | |
1697 | 1, | |
1698 | &gubx_validate, | |
1699 | }, | |
1700 | ||
1701 | { | |
1702 | /* Q_GUBN - GET_USER_BY_NAME */ | |
1703 | "get_user_by_name", | |
1704 | "gubn", | |
1705 | RETRIEVE, | |
1706 | "u", | |
1707 | USERS, | |
1708 | "%c = u.login, %c = text(u.uid), %c = u.shell, %c = u.last, %c = u.first, %c = u.middle, %c = text(u.status), %c = u.mit_id, %c = u.mit_year, %c = u.modtime, %c = text(u.modby), %c = u.modwith", | |
1709 | gubn_fields, | |
1710 | 12, | |
1711 | "u.first = \"%s\" and u.last = \"%s\" and u.users_id != 0", | |
1712 | 2, | |
1713 | &VDsortf, | |
1714 | }, | |
1715 | ||
1716 | { | |
1717 | /* Q_GUBC - GET_USER_BY_CLASS */ | |
1718 | "get_user_by_class", | |
1719 | "gubc", | |
1720 | RETRIEVE, | |
1721 | "u", | |
1722 | USERS, | |
1723 | "%c = u.login, %c = text(u.uid), %c = u.shell, %c = u.last, %c = u.first, %c = u.middle, %c = text(u.status), %c = u.mit_id, %c = u.mit_year, %c = u.modtime, %c = text(u.modby), %c = u.modwith", | |
1724 | gubc_fields, | |
1725 | 12, | |
1726 | "u.mit_year = uppercase(\"%s\") and u.users_id != 0", | |
1727 | 1, | |
1728 | &VDsortf, | |
1729 | }, | |
1730 | ||
1731 | { | |
1732 | /* Q_GUBM - GET_USER_BY_MITID */ | |
1733 | "get_user_by_mitid", | |
1734 | "gubm", | |
1735 | RETRIEVE, | |
1736 | "u", | |
1737 | USERS, | |
1738 | "%c = u.login, %c = text(u.uid), %c = u.shell, %c = u.last, %c = u.first, %c = u.middle, %c = text(u.status), %c = u.mit_id, %c = u.mit_year, %c = u.modtime, %c = text(u.modby), %c = u.modwith", | |
1739 | gubm_fields, | |
1740 | 12, | |
1741 | "u.mit_id = \"%s\" and u.users_id != 0", | |
1742 | 1, | |
1743 | &VDsortf, | |
1744 | }, | |
1745 | ||
1746 | { | |
1747 | /* Q_AUSR - ADD_USER */ | |
1748 | "add_user", | |
1749 | "ausr", | |
1750 | APPEND, | |
1751 | "u", | |
1752 | USERS, | |
1753 | "login = %c, users_id = values.value, uid = int4(%c), shell = %c, last = %c, first = %c, middle = %c, status = int4(%c), mit_id = %c, mit_year = %c", | |
1754 | ausr_fields, | |
1755 | 9, | |
1756 | "values.name = \"users_id\"", | |
1757 | 0, | |
1758 | &ausr_validate, | |
1759 | }, | |
1760 | ||
1761 | { | |
1762 | /* Q_RUSR - REGISTER_USER */ | |
1763 | "register_user", | |
1764 | "rusr", | |
1765 | APPEND, | |
1766 | 0, | |
1767 | 0, | |
1768 | 0, | |
1769 | rusr_fields, | |
1770 | 3, | |
1771 | 0, | |
1772 | 0, | |
1773 | &rusr_validate, | |
1774 | }, | |
1775 | ||
1776 | { | |
1777 | /* Q_UUSR - UPDATE_USER */ | |
1778 | "update_user", | |
1779 | "uusr", | |
1780 | UPDATE, | |
1781 | "u", | |
1782 | USERS, | |
1783 | "login = %c, uid = int4(%c), shell = %c, last = %c, first = %c, middle = %c, status = int4(%c), mit_id = %c, mit_year = %c", | |
1784 | uusr_fields, | |
1785 | 9, | |
1786 | "u.users_id = %d", | |
1787 | 1, | |
1788 | &uusr_validate, | |
1789 | }, | |
1790 | ||
1791 | { | |
1792 | /* Q_UUSH - UPDATE_USER_SHELL */ | |
1793 | "update_user_shell", | |
1794 | "uush", | |
1795 | UPDATE, | |
1796 | "u", | |
1797 | USERS, | |
1798 | "shell = %c", | |
1799 | uush_fields, | |
1800 | 1, | |
1801 | "u.users_id = %d", | |
1802 | 1, | |
1803 | &uush_validate, | |
1804 | }, | |
1805 | ||
1806 | { | |
1807 | /* Q_UUST - UPDATE_USER_STATUS */ | |
1808 | "update_user_status", | |
1809 | "uust", | |
1810 | UPDATE, | |
1811 | "u", | |
1812 | USERS, | |
1813 | "status = int4(%c)", | |
1814 | uust_fields, | |
1815 | 1, | |
1816 | "u.users_id = %d", | |
1817 | 1, | |
1818 | &uust_validate, | |
1819 | }, | |
1820 | ||
1821 | { | |
1822 | /* Q_DUSR - DELETE_USER */ | |
1823 | "delete_user", | |
1824 | "dusr", | |
1825 | DELETE, | |
1826 | "u", | |
1827 | USERS, | |
1828 | (char *)0, | |
1829 | dusr_fields, | |
1830 | 0, | |
1831 | "u.users_id = %d", | |
1832 | 1, | |
1833 | &dusr_validate, | |
1834 | }, | |
1835 | ||
1836 | { | |
1837 | /* Q_DUBU - DELETE_USER_BY_UID */ | |
1838 | "delete_user_by_uid", | |
1839 | "dubu", | |
1840 | DELETE, | |
1841 | "u", | |
1842 | USERS, | |
1843 | (char *)0, | |
1844 | dubu_fields, | |
1845 | 0, | |
1846 | "u.users_id = %d", | |
1847 | 1, | |
1848 | &dubu_validate, | |
1849 | }, | |
1850 | ||
1851 | { | |
1852 | /* Q_GFBL - GET_FINGER_BY_LOGIN */ | |
1853 | "get_finger_by_login", | |
1854 | "gfbl", | |
1855 | RETRIEVE, | |
1856 | "u", | |
1857 | USERS, | |
1858 | "%c = u.login,%c=u.fullname,%c=u.nickname,%c=u.home_addr,%c=u.home_phone,%c=u.office_addr,%c=u.office_phone,%c=u.mit_dept,%c=u.mit_affil,%c=u.fmodtime,%c=text(u.fmodby),%c=u.fmodwith", | |
1859 | gfbl_fields, | |
1860 | 12, | |
1861 | "u.users_id = %d", | |
1862 | 1, | |
1863 | &gfbl_validate, | |
1864 | }, | |
1865 | ||
1866 | { | |
1867 | /* Q_UFBL - UPDATE_FINGER_BY_LOGIN */ | |
1868 | "update_finger_by_login", | |
1869 | "ufbl", | |
1870 | UPDATE, | |
1871 | "u", | |
1872 | USERS, | |
1873 | "fullname=%c,nickname=%c,home_addr=%c,home_phone=%c,office_addr=%c,office_phone=%c,mit_dept=%c,mit_affil=%c", | |
1874 | ufbl_fields, | |
1875 | 8, | |
1876 | "u.users_id = %d", | |
1877 | 1, | |
1878 | &ufbl_validate, | |
1879 | }, | |
1880 | ||
1881 | { | |
1882 | /* Q_GPOB - GET_POBOX */ | |
1883 | "get_pobox", | |
1884 | "gpob", | |
1885 | RETRIEVE, | |
1886 | "u", | |
1887 | USERS, | |
1888 | "%c = u.login, %c = u.potype, %c = text(u.pop_id) + \":\" + text(u.box_id), %c = u.pmodtime, %c = text(u.pmodby), %c = u.pmodwith", | |
1889 | gpob_fields, | |
1890 | 6, | |
1891 | "u.users_id = %d", | |
1892 | 1, | |
1893 | &gpob_validate, | |
1894 | }, | |
1895 | ||
1896 | { | |
1897 | /* Q_GAPO - GET_ALL_POBOXES */ | |
1898 | "get_all_poboxes", | |
1899 | "gapo", | |
1900 | RETRIEVE, | |
1901 | "u", | |
1902 | USERS, | |
1903 | "%c = u.login, %c = u.potype, %c = text(u.pop_id) + \":\" + text(u.box_id)", | |
1904 | gpox_fields, | |
1905 | 3, | |
1906 | "u.potype != \"NONE\"", | |
1907 | 0, | |
1908 | &gpox_validate, | |
1909 | }, | |
1910 | ||
1911 | { | |
1912 | /* Q_GPOP - GET_POBOXES_POP */ | |
1913 | "get_poboxes_pop", | |
1914 | "gpop", | |
1915 | RETRIEVE, | |
1916 | "u", | |
1917 | USERS, | |
1918 | "%c = u.login, %c = u.potype, %c = text(u.pop_id) + \":\" + text(u.box_id)", | |
1919 | gpox_fields, | |
1920 | 3, | |
1921 | "u.potype = \"POP\"", | |
1922 | 0, | |
1923 | &gpox_validate | |
1924 | }, | |
1925 | ||
1926 | { | |
1927 | /* Q_GPOF - GET_POBOXES_SMTP */ | |
1928 | "get_poboxes_smtp", | |
1929 | "gpos", | |
1930 | RETRIEVE, | |
1931 | "u", | |
1932 | USERS, | |
1933 | "%c = u.login, %c = u.potype, %c = text(u.pop_id) + \":\" + text(u.box_id)", | |
1934 | gpox_fields, | |
1935 | 3, | |
1936 | "u.potype = \"SMTP\"", | |
1937 | 0, | |
1938 | &gpox_validate | |
1939 | }, | |
1940 | ||
1941 | { | |
1942 | /* Q_SPOB - SET_POBOX */ | |
1943 | "set_pobox", | |
1944 | "spob", | |
1945 | UPDATE, | |
1946 | 0, | |
1947 | USERS, | |
1948 | 0, | |
1949 | spob_fields, | |
1950 | 3, | |
1951 | (char *)0, | |
1952 | 0, | |
1953 | &spob_validate, | |
1954 | }, | |
1955 | ||
1956 | { | |
1957 | /* Q_SPOP - SET_POBOX_POP */ | |
1958 | "set_pobox_pop", | |
1959 | "spop", | |
1960 | UPDATE, | |
1961 | "u", | |
1962 | USERS, | |
1963 | "potype = \"POP\"", | |
1964 | spob_fields, | |
1965 | 0, | |
1966 | "u.users_id = %d", | |
1967 | 1, | |
1968 | &spop_validate, | |
1969 | }, | |
1970 | ||
1971 | { | |
1972 | /* Q_DPOB - DELETE_POBOX */ | |
1973 | "delete_pobox", | |
1974 | "dpob", | |
1975 | UPDATE, | |
1976 | "u", | |
1977 | USERS, | |
1978 | "potype = \"NONE\"", | |
1979 | spob_fields, | |
1980 | 0, | |
1981 | "u.users_id = %d", | |
1982 | 1, | |
1983 | &dpob_validate, | |
1984 | }, | |
1985 | ||
1986 | { | |
1987 | /* Q_GMAC - GET_MACHINE */ | |
1988 | "get_machine", | |
1989 | "gmac", | |
1990 | RETRIEVE, | |
1991 | "m", | |
1992 | MACHINE, | |
1993 | "%c = m.name, %c = m.type, %c = m.modtime, %c = text(m.modby), %c =m.modwith", | |
1994 | gmac_fields, | |
1995 | 5, | |
1996 | "m.name = uppercase(\"%s\") and m.mach_id != 0", | |
1997 | 1, | |
1998 | &VDsortf, | |
1999 | }, | |
2000 | ||
2001 | { | |
2002 | /* Q_AMAC - ADD_MACHINE */ | |
2003 | "add_machine", | |
2004 | "amac", | |
2005 | APPEND, | |
2006 | "m", | |
2007 | MACHINE, | |
2008 | "name = uppercase(%c), mach_id = values.value, type = %c", | |
2009 | amac_fields, | |
2010 | 2, | |
2011 | "values.name = \"mach_id\"", | |
2012 | 0, | |
2013 | &amac_validate, | |
2014 | }, | |
2015 | ||
2016 | { | |
2017 | /* Q_UMAC - UPDATE_MACHINE */ | |
2018 | "update_machine", | |
2019 | "umac", | |
2020 | UPDATE, | |
2021 | "m", | |
2022 | MACHINE, | |
2023 | "name = uppercase(%c), type = %c", | |
2024 | umac_fields, | |
2025 | 2, | |
2026 | "m.mach_id = %d", | |
2027 | 1, | |
2028 | &umac_validate, | |
2029 | }, | |
2030 | ||
2031 | { | |
2032 | /* Q_DMAC - DELETE_MACHINE */ | |
2033 | "delete_machine", | |
2034 | "dmac", | |
2035 | DELETE, | |
2036 | "m", | |
2037 | MACHINE, | |
2038 | (char *)0, | |
2039 | dmac_fields, | |
2040 | 0, | |
2041 | "m.mach_id = %d", | |
2042 | 1, | |
2043 | &dmac_validate, | |
2044 | }, | |
2045 | ||
2046 | { | |
2047 | /* Q_GCLU - GET_CLUSTER */ | |
2048 | "get_cluster", | |
2049 | "gclu", | |
2050 | RETRIEVE, | |
2051 | "c", | |
2052 | CLUSTER, | |
2053 | "%c = c.name, %c = c.desc, %c = c.location, %c = c.modtime, %c = text(c.modby), %c = c.modwith", | |
2054 | gclu_fields, | |
2055 | 6, | |
2056 | "c.name = \"%s\" and c.clu_id != 0", | |
2057 | 1, | |
2058 | &VDsortf, | |
2059 | }, | |
2060 | ||
2061 | { | |
2062 | /* Q_ACLU - ADD_CLUSTER */ | |
2063 | "add_cluster", | |
2064 | "aclu", | |
2065 | APPEND, | |
2066 | "c", | |
2067 | CLUSTER, | |
2068 | "name = %c, clu_id = values.value, desc = %c, location = %c", | |
2069 | aclu_fields, | |
2070 | 3, | |
2071 | "values.name = \"clu_id\"", | |
2072 | 0, | |
2073 | &aclu_validate, | |
2074 | }, | |
2075 | ||
2076 | { | |
2077 | /* Q_UCLU - UPDATE_CLUSTER */ | |
2078 | "update_cluster", | |
2079 | "uclu", | |
2080 | UPDATE, | |
2081 | "c", | |
2082 | CLUSTER, | |
2083 | "name = %c, desc = %c, location = %c", | |
2084 | uclu_fields, | |
2085 | 3, | |
2086 | "c.clu_id = %d", | |
2087 | 1, | |
2088 | &uclu_validate, | |
2089 | }, | |
2090 | ||
2091 | { | |
2092 | /* Q_DCLU - DELETE_CLUSTER */ | |
2093 | "delete_cluster", | |
2094 | "dclu", | |
2095 | DELETE, | |
2096 | "c", | |
2097 | CLUSTER, | |
2098 | (char *)0, | |
2099 | dclu_fields, | |
2100 | 0, | |
2101 | "c.clu_id = %d", | |
2102 | 1, | |
2103 | &dclu_validate, | |
2104 | }, | |
2105 | ||
2106 | { | |
2107 | /* Q_GMCM - GET_MACHINE_TO_CLUSTER_MAP */ | |
2108 | "get_machine_to_cluster_map", | |
2109 | "gmcm", | |
2110 | RETRIEVE, | |
2111 | "m", | |
2112 | "mcmap", | |
2113 | "%c = machine.name, %c = cluster.name", | |
2114 | gmcm_fields, | |
2115 | 2, | |
2116 | "machine.name = uppercase(\"%s\") and cluster.name = \"%s\" and m.clu_id = cluster.clu_id and m.mach_id = machine.mach_id", | |
2117 | 2, | |
2118 | &VDsort2, | |
2119 | }, | |
2120 | ||
2121 | { | |
2122 | /* Q_AMTC - ADD_MACHINE_TO_CLUSTER */ | |
2123 | "add_machine_to_cluster", | |
2124 | "amtc", | |
2125 | APPEND, | |
2126 | "m", | |
2127 | "mcmap", | |
2128 | "mach_id = %i4, clu_id = %i4", | |
2129 | gmcm_fields, | |
2130 | 2, | |
2131 | 0, | |
2132 | 0, | |
2133 | &amtc_validate, | |
2134 | }, | |
2135 | ||
2136 | { | |
2137 | /* Q_DMFC - DELETE_MACHINE_FROM_CLUSTER */ | |
2138 | "delete_machine_from_cluster", | |
2139 | "dmfc", | |
2140 | DELETE, | |
2141 | "m", | |
2142 | "mcmap", | |
2143 | 0, | |
2144 | gmcm_fields, | |
2145 | 0, | |
2146 | "m.mach_id = %d and m.clu_id = %d", | |
2147 | 2, | |
2148 | &amtc_validate, | |
2149 | }, | |
2150 | ||
2151 | { | |
2152 | /* Q_GCLD - GET_CLUSTER_DATA */ | |
2153 | "get_cluster_data", | |
2154 | "gcld", | |
2155 | RETRIEVE, | |
2156 | "s", | |
2157 | "svc", | |
2158 | "%c = cluster.name, %c = s.serv_label, %c = s.serv_cluster", | |
2159 | gcld_fields, | |
2160 | 3, | |
2161 | "cluster.clu_id = s.clu_id and cluster.name = \"%s\" and s.serv_label = \"%s\"", | |
2162 | 2, | |
2163 | &VDsort2, | |
2164 | }, | |
2165 | ||
2166 | { | |
2167 | /* Q_ACLD - ADD_CLUSTER_DATA */ | |
2168 | "add_cluster_data", | |
2169 | "acld", | |
2170 | APPEND, | |
2171 | "s", | |
2172 | "svc", | |
2173 | "clu_id = %i4, serv_label = %c, serv_cluster = %c", | |
88343c5e | 2174 | acld_fields, |
d33e787c | 2175 | 3, |
2176 | (char *)0, | |
2177 | 0, | |
2178 | &acld_validate, | |
2179 | }, | |
2180 | ||
2181 | { | |
2182 | /* Q_DCLD - DELETE_CLUSTER_DATA */ | |
2183 | "delete_cluster_data", | |
2184 | "dcld", | |
2185 | DELETE, | |
2186 | "s", | |
2187 | "svc", | |
2188 | (char *)0, | |
88343c5e | 2189 | acld_fields, |
d33e787c | 2190 | 0, |
2191 | "s.clu_id = %d and s.serv_label = \"%s\" and s.serv_cluster = \"%s\"", | |
2192 | 3, | |
2193 | &acld_validate, | |
2194 | }, | |
2195 | ||
2196 | { | |
2197 | /* Q_GSIN - GET_SERVER_INFO */ | |
2198 | "get_server_info", | |
2199 | "gsin", | |
2200 | RETRIEVE, | |
2201 | "s", | |
2202 | "servers", | |
2203 | "%c = s.name, %c = text(s.update_int), %c = s.target_file, %c = s.script, %c = s.dfgen, %c = s.type, %c = text(s.enable), %c = text(s.inprogress), %c = text(s.harderror), %c = s.errmsg, %c = s.acl_type, %c = text(s.acl_id), %c = s.modtime, %c = text(s.modby), %c = s.modwith", | |
2204 | gsin_fields, | |
2205 | 15, | |
88343c5e | 2206 | "s.name = uppercase(\"%s\")", |
d33e787c | 2207 | 1, |
2208 | &gsin_validate, | |
2209 | }, | |
2210 | ||
2211 | { | |
2212 | /* Q_QGSV - QUALIFIED_GET_SERVER */ | |
2213 | "qualified_get_server", | |
2214 | "qgsv", | |
2215 | RETRIEVE, | |
2216 | 0, | |
2217 | "servers", | |
2218 | 0, | |
2219 | qgsv_fields, | |
2220 | 1, | |
2221 | 0, | |
2222 | 3, | |
2223 | &qgsv_validate, | |
2224 | }, | |
2225 | ||
2226 | { | |
2227 | /* Q_ASIN - ADD_SERVER_INFO */ | |
2228 | "add_server_info", | |
2229 | "asin", | |
2230 | APPEND, | |
2231 | "s", | |
2232 | "servers", | |
88343c5e | 2233 | "name = uppercase(%c), update_int = int4(%c), target_file = %c, script = %c, type = %c, enable = int1(%c), acl_type = %c, acl_id = %i4", |
d33e787c | 2234 | asin_fields, |
2235 | 8, | |
2236 | (char *)0, | |
2237 | 0, | |
2238 | &asin_validate, | |
2239 | }, | |
2240 | ||
2241 | { | |
2242 | /* Q_USIN - UPDATE_SERVER_INFO */ | |
2243 | "update_server_info", | |
2244 | "usin", | |
2245 | UPDATE, | |
2246 | "s", | |
2247 | "servers", | |
2248 | "update_int = int4(%c), target_file = %c, script = %c, type = %c, enable = int1(%c), acl_type = %c, acl_id = %i4", | |
2249 | asin_fields, | |
2250 | 7, | |
88343c5e | 2251 | "s.name = uppercase(\"%s\")", |
d33e787c | 2252 | 1, |
2253 | &asin_validate, | |
2254 | }, | |
2255 | ||
2256 | { | |
2257 | /* Q_RSVE - RESET_SERVER_ERROR */ | |
2258 | "reset_server_error", | |
2259 | "rsve", | |
2260 | UPDATE, | |
2261 | "s", | |
2262 | "servers", | |
2263 | "harderror = 0", | |
2264 | dsin_fields, | |
2265 | 0, | |
88343c5e | 2266 | "s.name = uppercase(\"%s\")", |
d33e787c | 2267 | 1, |
2268 | &rsve_validate, | |
2269 | }, | |
2270 | ||
2271 | { | |
2272 | /* Q_SSIF - SET_SERVER_INTERNAL_FLAGS */ | |
2273 | "set_server_internal_flags", | |
2274 | "ssif", | |
2275 | UPDATE, | |
2276 | "s", | |
2277 | "servers", | |
2278 | "dfgen = %c, inprogress = int1(%c), harderror = int1(%c), errmsg = %c", | |
2279 | ssif_fields, | |
2280 | 4, | |
88343c5e | 2281 | "s.name = uppercase(\"%s\")", |
d33e787c | 2282 | 1, |
2283 | &ssif_validate, | |
2284 | }, | |
2285 | ||
2286 | { | |
2287 | /* Q_DSIN - DELETE_SERVER_INFO */ | |
2288 | "delete_server_info", | |
2289 | "dsin", | |
2290 | DELETE, | |
2291 | "s", | |
2292 | "servers", | |
2293 | (char *)0, | |
2294 | dsin_fields, | |
2295 | 0, | |
88343c5e | 2296 | "s.name = uppercase(\"%s\")", |
d33e787c | 2297 | 1, |
2298 | &dsin_validate, | |
2299 | }, | |
2300 | ||
2301 | { | |
2302 | /* Q_GSHI - GET_SERVER_HOST_INFO */ | |
2303 | "get_server_host_info", | |
2304 | "gshi", | |
2305 | RETRIEVE, | |
2306 | "sh", | |
2307 | "serverhosts", | |
2308 | "%c = sh.service, %c = machine.name, %c = text(sh.enable), %c = text(sh.override), %c = text(sh.success), %c = text(sh.inprogress), %c = text(sh.hosterror), %c = sh.hosterrmsg, %c = sh.ltt, %c = sh.lts, %c = text(sh.value1), %c = text(sh.value2), %c = sh.value3, %c = sh.modtime, %c = text(sh.modby), %c = sh.modwith", | |
2309 | gshi_fields, | |
2310 | 16, | |
88343c5e | 2311 | "sh.service = uppercase(\"%s\") and machine.name = uppercase(\"%s\") and machine.mach_id = sh.mach_id", |
d33e787c | 2312 | 2, |
2313 | &gshi_validate, | |
2314 | }, | |
2315 | ||
2316 | { | |
2317 | /* Q_QGSV - QUALIFIED_GET_SERVER_HOST */ | |
2318 | "qualified_get_server_host", | |
2319 | "qgsh", | |
2320 | RETRIEVE, | |
2321 | 0, | |
2322 | "serverhosts", | |
2323 | 0, | |
2324 | qgsh_fields, | |
2325 | 2, | |
2326 | 0, | |
2327 | 6, | |
2328 | &qgsh_validate, | |
2329 | }, | |
2330 | ||
2331 | { | |
2332 | /* Q_ASHI - ADD_SERVER_HOST_INFO */ | |
2333 | "add_server_host_info", | |
2334 | "ashi", | |
2335 | APPEND, | |
2336 | "sh", | |
2337 | "serverhosts", | |
88343c5e | 2338 | "service = uppercase(%c), mach_id = %i4, enable = int1(%c), value1 = int4(%c), value2 = int4(%c), value3 = %c", |
d33e787c | 2339 | ashi_fields, |
2340 | 6, | |
2341 | (char *)0, | |
2342 | 0, | |
2343 | &ashi_validate, | |
2344 | }, | |
2345 | ||
2346 | { | |
2347 | /* Q_USHI - UPDATE_SERVER_HOST_INFO */ | |
2348 | "update_server_host_info", | |
2349 | "ushi", | |
2350 | UPDATE, | |
2351 | "sh", | |
2352 | "serverhosts", | |
2353 | "enable = int1(%c), value1 = int4(%c), value2 = int4(%c), value3 = %c", | |
2354 | ashi_fields, | |
2355 | 4, | |
88343c5e | 2356 | "sh.service = uppercase(\"%s\") and sh.mach_id = %d", |
d33e787c | 2357 | 2, |
2358 | &ashi_validate, | |
2359 | }, | |
2360 | ||
2361 | { | |
2362 | /* Q_RSHE - RESET_SERVER_HOST_ERROR */ | |
2363 | "reset_server_host_error", | |
2364 | "rshe", | |
2365 | UPDATE, | |
2366 | "sh", | |
2367 | "serverhosts", | |
2368 | "hosterror = 0", | |
2369 | dshi_fields, | |
2370 | 0, | |
88343c5e | 2371 | "sh.service = uppercase(\"%s\") and sh.mach_id = %d", |
d33e787c | 2372 | 2, |
2373 | &rshe_validate, | |
2374 | }, | |
2375 | ||
2376 | { | |
2377 | /* Q_SSHO - SET_SERVER_HOST_OVERRIDE */ | |
2378 | "set_server_host_override", | |
2379 | "ssho", | |
2380 | UPDATE, | |
2381 | "sh", | |
2382 | "serverhosts", | |
2383 | "override = 1", | |
2384 | dshi_fields, | |
2385 | 0, | |
88343c5e | 2386 | "sh.service = uppercase(\"%s\") and sh.mach_id = %d", |
d33e787c | 2387 | 2, |
2388 | &ssho_validate, | |
2389 | }, | |
2390 | ||
2391 | { | |
2392 | /* Q_SSHI - SET_SERVER_HOST_INTERNAL */ | |
2393 | "set_server_host_internal", | |
2394 | "sshi", | |
2395 | UPDATE, | |
2396 | "sh", | |
2397 | "serverhosts", | |
2398 | "override = int1(%c), success = int1(%c), inprogress = int1(%c), hosterror = int1(%c), hosterrmsg = %c, ltt = %c, lts = %c", | |
2399 | sshi_fields, | |
2400 | 7, | |
88343c5e | 2401 | "sh.service = uppercase(\"%s\") and sh.mach_id = %d", |
d33e787c | 2402 | 2, |
2403 | &sshi_validate, | |
2404 | }, | |
2405 | ||
2406 | { | |
2407 | /* Q_DSHI - DELETE_SERVER_HOST_INFO */ | |
2408 | "delete_server_host_info", | |
2409 | "dshi", | |
2410 | DELETE, | |
2411 | "sh", | |
2412 | "serverhosts", | |
2413 | (char *)0, | |
2414 | dshi_fields, | |
2415 | 0, | |
88343c5e | 2416 | "sh.service = uppercase(\"%s\") and sh.mach_id = %d", |
d33e787c | 2417 | 2, |
2418 | &dshi_validate, | |
2419 | }, | |
2420 | ||
2421 | { | |
2422 | /* Q_GSHA - GET_SERVER_HOST_ACCESS */ | |
2423 | "get_server_host_access", | |
2424 | "gsha", | |
2425 | RETRIEVE, | |
2426 | "ha", | |
2427 | "hostaccess", | |
2428 | "%c = machine.name, %c = ha.acl_type, %c = text(ha.acl_id), %c = ha.modtime, %c = text(ha.modby), %c = ha.modwith", | |
2429 | gsha_fields, | |
2430 | 6, | |
2431 | "machine.name = uppercase(\"%s\") and ha.mach_id = machine.mach_id", | |
2432 | 1, | |
2433 | &gsha_validate, | |
2434 | }, | |
2435 | ||
2436 | { | |
2437 | /* Q_ASHA - ADD_SERVER_HOST_ACCESS */ | |
2438 | "add_server_host_access", | |
2439 | "asha", | |
2440 | APPEND, | |
2441 | "ha", | |
2442 | "hostaccess", | |
2443 | "mach_id = %i4, acl_type = %c, acl_id = %i4", | |
2444 | asha_fields, | |
2445 | 3, | |
2446 | 0, | |
2447 | 0, | |
2448 | &asha_validate, | |
2449 | }, | |
2450 | ||
2451 | { | |
2452 | /* Q_USHA - UPDATE_SERVER_HOST_ACCESS */ | |
2453 | "update_server_host_access", | |
2454 | "usha", | |
2455 | UPDATE, | |
2456 | "ha", | |
2457 | "hostaccess", | |
2458 | "acl_type = %c, acl_id = %i4", | |
2459 | asha_fields, | |
2460 | 2, | |
2461 | "ha.mach_id = %d", | |
2462 | 1, | |
2463 | &asha_validate, | |
2464 | }, | |
2465 | ||
2466 | { | |
2467 | /* Q_DSHA - DELETE_SERVER_HOST_ACCESS */ | |
2468 | "delete_server_host_access", | |
2469 | "dsha", | |
2470 | DELETE, | |
2471 | "ha", | |
2472 | "hostaccess", | |
2473 | 0, | |
2474 | asha_fields, | |
2475 | 0, | |
2476 | "ha.mach_id = %d", | |
2477 | 1, | |
2478 | &VDmach, | |
2479 | }, | |
2480 | ||
2481 | { | |
2482 | /* Q_GSLO - GET_SERVER_LOCATIONS */ | |
2483 | "get_server_locations", | |
2484 | "gslo", | |
2485 | RETRIEVE, | |
2486 | "sh", | |
2487 | "serverhosts", | |
2488 | "%c = sh.service, %c = machine.name", | |
2489 | gslo_fields, | |
2490 | 2, | |
88343c5e | 2491 | "sh.service = uppercase(\"%s\") and sh.mach_id = machine.mach_id", |
d33e787c | 2492 | 1, |
2493 | 0, | |
2494 | }, | |
2495 | ||
2496 | { | |
2497 | /* Q_GFSL - GET_FILESYS_BY_LABEL */ | |
2498 | "get_filesys_by_label", | |
2499 | "gfsl", | |
2500 | RETRIEVE, | |
2501 | "fs", | |
2502 | FILESYS, | |
2503 | "%c = fs.label, %c = fs.type, %c = machine.name, %c = fs.name, %c = fs.mount, %c = fs.access, %c = fs.comments, %c = users.login, %c = list.name, %c = text(fs.createflg), %c = fs.lockertype, %c = fs.modtime, %c = text(fs.modby), %c = fs.modwith", | |
2504 | gfsl_fields, | |
2505 | 14, | |
2506 | "fs.label = \"%s\" and fs.mach_id = machine.mach_id and fs.owner = users.users_id and fs.owners = list.list_id", | |
2507 | 1, | |
2508 | &VDsortf, | |
2509 | }, | |
2510 | ||
2511 | { | |
2512 | /* Q_GFSM - GET_FILESYS_BY_MACHINE */ | |
2513 | "get_filesys_by_machine", | |
2514 | "gfsm", | |
2515 | RETRIEVE, | |
2516 | "fs", | |
2517 | FILESYS, | |
2518 | "%c = fs.label, %c = fs.type, %c = machine.name, %c = fs.name, %c = fs.mount, %c = fs.access, %c = fs.comments, %c = users.login, %c = list.name, %c = text(fs.createflg), %c = fs.lockertype, %c = fs.modtime, %c = text(fs.modby), %c = fs.modwith", | |
2519 | gfsm_fields, | |
2520 | 14, | |
2521 | "fs.mach_id = %d and machine.mach_id = fs.mach_id and fs.owner = users.users_id and fs.owners = list.list_id", | |
2522 | 1, | |
2523 | &gfsm_validate, | |
2524 | }, | |
2525 | ||
88343c5e | 2526 | { |
2527 | /* Q_GFSN - GET_FILESYS_BY_NFSPHYS */ | |
2528 | "get_filesys_by_nfsphys", | |
2529 | "gfsn", | |
2530 | RETRIEVE, | |
2531 | "fs", | |
2532 | FILESYS, | |
2533 | "%c = fs.label, %c = fs.type, %c = machine.name, %c = fs.name, %c = fs.mount, %c = fs.access, %c = fs.comments, %c = users.login, %c = list.name, %c = text(fs.createflg), %c = fs.lockertype, %c = fs.modtime, %c = text(fs.modby), %c = fs.modwith", | |
2534 | gfsn_fields, | |
2535 | 14, | |
2536 | "fs.mach_id = %d and machine.mach_id = fs.mach_id and fs.owner = users.users_id and fs.owners = list.list_id and nfsphys.nfsphys_id = fs.phys_id and nfsphys.dir = \"%s\" and fs.type = \"NFS\"", | |
2537 | 2, | |
2538 | &gfsm_validate, | |
2539 | }, | |
2540 | ||
d33e787c | 2541 | { |
2542 | /* Q_GFSG - GET_FILESYS_BY_GROUP */ | |
2543 | "get_filesys_by_group", | |
2544 | "gfsg", | |
2545 | RETRIEVE, | |
2546 | "fs", | |
2547 | FILESYS, | |
2548 | "%c = fs.label, %c = fs.type, %c = machine.name, %c = fs.name, %c = fs.mount, %c = fs.access, %c = fs.comments, %c = users.login, %c = list.name, %c = text(fs.createflg), %c = fs.lockertype, %c = fs.modtime, %c = text(fs.modby), %c = fs.modwith", | |
2549 | gfsg_fields, | |
2550 | 14, | |
2551 | "fs.owners = %d and machine.mach_id = fs.mach_id and fs.owner = users.users_id and fs.owners = list.list_id", | |
2552 | 1, | |
2553 | &gfsg_validate, | |
2554 | }, | |
2555 | ||
2556 | { | |
2557 | /* Q_AFIL - ADD_FILESYS */ | |
2558 | "add_filesys", | |
2559 | "afil", | |
2560 | APPEND, | |
2561 | "fs", | |
2562 | FILESYS, | |
2563 | "filsys_id = values.value, label = %c, type = %c, mach_id = %i4, name = %c, mount = %c, access = %c, comments = %c, owner = %i4, owners = %i4, createflg = int1(%c), lockertype = %c", | |
2564 | afil_fields, | |
2565 | 11, | |
2566 | "values.name = \"filsys_id\"", | |
2567 | 0, | |
2568 | &afil_validate, | |
2569 | }, | |
2570 | ||
2571 | { | |
2572 | /* Q_UFIL - UPDATE_FILESYS */ | |
2573 | "update_filesys", | |
2574 | "ufil", | |
2575 | UPDATE, | |
2576 | "fs", | |
2577 | FILESYS, | |
2578 | "label = %c, type = %c, mach_id = %i4, name = %c, mount = %c, access = %c, comments = %c, owner = %i4, owners = %i4, createflg = int1(%c), lockertype = %c", | |
2579 | ufil_fields, | |
2580 | 11, | |
2581 | "fs.filsys_id = %d", | |
2582 | 1, | |
2583 | &ufil_validate, | |
2584 | }, | |
2585 | ||
2586 | { | |
2587 | /* Q_DFIL - DELETE_FILESYS */ | |
2588 | "delete_filesys", | |
2589 | "dfil", | |
2590 | DELETE, | |
2591 | "fs", | |
2592 | FILESYS, | |
2593 | (char *)0, | |
2594 | dfil_fields, | |
2595 | 0, | |
2596 | "fs.filsys_id = %d", | |
2597 | 1, | |
2598 | &dfil_validate, | |
2599 | }, | |
2600 | ||
2601 | { | |
2602 | /* Q_GANF - GET_ALL_NFSPHYS */ | |
2603 | "get_all_nfsphys", | |
2604 | "ganf", | |
2605 | RETRIEVE, | |
2606 | "np", | |
2607 | "nfsphys", | |
2608 | "%c = machine.name, %c = np.dir, %c = np.device, %c = text(np.status), %c = text(np.allocated), %c = text(np.size), %c = np.modtime, %c = text(np.modby), %c = np.modwith", | |
2609 | ganf_fields, | |
2610 | 9, | |
2611 | "machine.mach_id = np.mach_id", | |
2612 | 0, | |
2613 | &VDsortf, | |
2614 | }, | |
2615 | ||
2616 | { | |
2617 | /* Q_GNFP - GET_NFSPHYS */ | |
2618 | "get_nfsphys", | |
2619 | "gnfp", | |
2620 | RETRIEVE, | |
2621 | "np", | |
2622 | "nfsphys", | |
2623 | "%c = machine.name, %c = np.dir, %c = np.device, %c = text(np.status), %c = text(np.allocated), %c = text(np.size), %c = np.modtime, %c = text(np.modby), %c = np.modwith", | |
2624 | gnfp_fields, | |
2625 | 9, | |
2626 | "np.mach_id = %d and np.dir = \"%s\" and machine.mach_id = np.mach_id", | |
2627 | 2, | |
2628 | &gnfp_validate, | |
2629 | }, | |
2630 | ||
2631 | { | |
2632 | /* Q_ANFP - ADD_NFSPHYS */ | |
2633 | "add_nfsphys", | |
2634 | "anfp", | |
2635 | APPEND, | |
2636 | "np", | |
2637 | "nfsphys", | |
2638 | "nfsphys_id = values.value, mach_id = %i4, dir = %c, device = %c, status = int4(%c), allocated = int4(%c), size = int4(%c)", | |
2639 | ganf_fields, | |
2640 | 6, | |
2641 | "values.name = \"nfsphys_id\"", | |
2642 | 0, | |
2643 | &anfp_validate, | |
2644 | }, | |
2645 | ||
2646 | { | |
2647 | /* Q_UNFP - UPDATE_NFSPHYS */ | |
2648 | "update_nfsphys", | |
2649 | "unfp", | |
2650 | UPDATE, | |
2651 | "np", | |
2652 | "nfsphys", | |
2653 | "device = %c, status = int4(%c), allocated = int4(%c), size = int4(%c)", | |
2654 | gnfp_fields, | |
2655 | 4, | |
2656 | "np.mach_id = %d and np.dir = \"%s\"", | |
2657 | 2, | |
2658 | &anfp_validate, | |
2659 | }, | |
2660 | ||
2661 | { | |
2662 | /* Q_AJNF - ADJUST_NFSPHYS_ALLOCATION */ | |
2663 | "adjust_nfsphys_allocation", | |
2664 | "ajnf", | |
2665 | UPDATE, | |
2666 | "np", | |
2667 | "nfsphys", | |
2668 | "allocated = np.allocated + int4(%c)", | |
2669 | dnfp_fields, | |
2670 | 1, | |
2671 | "np.mach_id = %d and np.dir = \"%s\"", | |
2672 | 2, | |
2673 | &anfp_validate, | |
2674 | }, | |
2675 | ||
2676 | { | |
2677 | /* Q_DNFP - DELETE_NFSPHYS */ | |
2678 | "delete_nfsphys", | |
2679 | "dnfp", | |
2680 | DELETE, | |
2681 | "np", | |
2682 | "nfsphys", | |
2683 | (char *)0, | |
2684 | dnfp_fields, | |
2685 | 0, | |
2686 | "np.mach_id = %d and np.dir = \"%s\"", | |
2687 | 2, | |
2688 | &dnfp_validate, | |
2689 | }, | |
2690 | ||
2691 | { | |
2692 | /* Q_GNFQ - GET_NFS_QUOTAS */ | |
88343c5e | 2693 | "get_nfs_quota", |
d33e787c | 2694 | "gnfq", |
2695 | RETRIEVE, | |
2696 | "nq", | |
2697 | "nfsquota", | |
2698 | "%c = filesys.label, %c = users.login, %c = text(nq.quota), %c = nfsphys.dir, %c = machine.name, %c = nq.modtime, %c = text(nq.modby), %c = nq.modwith", | |
2699 | gnfq_fields, | |
2700 | 8, | |
88343c5e | 2701 | "filesys.label = \"%s\" and users.users_id = %d and filesys.phys_id = nfsphys.nfsphys_id and machine.mach_id = filesys.mach_id and users.users_id = nq.users_id and filesys.filsys_id = nq.filsys_id", |
2702 | 2, | |
d33e787c | 2703 | &gnfq_validate, |
2704 | }, | |
2705 | ||
2706 | { | |
2707 | /* Q_GNQP - GET_NFS_QUOTAS_BY_PARTITION */ | |
2708 | "get_nfs_quotas_by_partition", | |
2709 | "gnqp", | |
2710 | RETRIEVE, | |
2711 | "nq", | |
2712 | "nfsquota", | |
2713 | "%c = filesys.label, %c = users.login, %c = text(nq.quota), %c = nfsphys.dir, %c = machine.name", | |
2714 | gnqp_fields, | |
2715 | 5, | |
2716 | "filesys.mach_id = %d and nfsphys.dir = \"%s\" and nq.filsys_id = filesys.filsys_id and nfsphys.nfsphys_id = filesys.phys_id and users.users_id = nq.users_id and machine.mach_id = filesys.mach_id", | |
2717 | 2, | |
2718 | &VDmach, | |
2719 | }, | |
2720 | ||
d33e787c | 2721 | { |
2722 | /* Q_ANFQ - ADD_NFS_QUOTA */ | |
2723 | "add_nfs_quota", | |
2724 | "anfq", | |
2725 | APPEND, | |
2726 | "nq", | |
2727 | "nfsquota", | |
2728 | "filsys_id = %i4, users_id = %i4, quota = int4(%c)", | |
2729 | anfq_fields, | |
2730 | 3, | |
2731 | (char *)0, | |
2732 | 0, | |
2733 | &anfq_validate, | |
2734 | }, | |
2735 | ||
2736 | { | |
2737 | /* Q_UNFQ - UPDATE_NFS_QUOTA */ | |
2738 | "update_nfs_quota", | |
2739 | "unfq", | |
2740 | UPDATE, | |
2741 | "nq", | |
2742 | "nfsquota", | |
2743 | "quota = int4(%c)", | |
2744 | anfq_fields, | |
2745 | 1, | |
2746 | "nq.filsys_id = %d and nq.users_id = %d", | |
2747 | 2, | |
2748 | &unfq_validate, | |
2749 | }, | |
2750 | ||
2751 | { | |
2752 | /* Q_DNFQ - DELETE_NFS_QUOTA */ | |
2753 | "delete_nfs_quota", | |
2754 | "dnfq", | |
2755 | DELETE, | |
2756 | "nq", | |
2757 | "nfsquota", | |
2758 | (char *)0, | |
2759 | anfq_fields, | |
2760 | 0, | |
2761 | "nq.filsys_id = %d and nq.users_id = %d", | |
2762 | 2, | |
2763 | &dnfq_validate, | |
2764 | }, | |
2765 | ||
2766 | { | |
2767 | /* Q_GLIN - GET_LIST_INFO */ | |
2768 | "get_list_info", | |
2769 | "glin", | |
2770 | RETRIEVE, | |
2771 | 0, | |
2772 | LIST, | |
2773 | 0, | |
2774 | glin_fields, | |
2775 | 13, | |
2776 | 0, | |
2777 | 1, | |
2778 | &glin_validate, | |
2779 | }, | |
2780 | ||
2781 | { | |
2782 | /* Q_EXLN - EXPAND_LIST_NAMES */ | |
2783 | "expand_list_names", | |
2784 | "exln", | |
2785 | RETRIEVE, | |
2786 | "l", | |
2787 | LIST, | |
2788 | "%c = l.name", | |
2789 | glin_fields, | |
2790 | 1, | |
2791 | "l.name = \"%s\" and l.list_id != 0", | |
2792 | 1, | |
2793 | 0 | |
2794 | }, | |
2795 | ||
2796 | { | |
2797 | /* Q_ALIS - ADD_LIST */ | |
2798 | "add_list", | |
2799 | "alis", | |
2800 | APPEND, | |
2801 | "l", | |
2802 | LIST, | |
2803 | "list_id=values.value, name=%c, active=int1(%c), public=int1(%c), hidden=int1(%c), maillist=int1(%c), group=int1(%c), gid=int2(%c), acl_type=%c, acl_id=%i4, desc=%c", | |
2804 | alis_fields, | |
2805 | 10, | |
2806 | "values.name = \"list_id\"", | |
2807 | 0, | |
2808 | &alis_validate, | |
2809 | }, | |
2810 | ||
2811 | { | |
2812 | /* Q_ULIS - UPDATE_LIST */ | |
2813 | "update_list", | |
2814 | "ulis", | |
2815 | UPDATE, | |
2816 | "l", | |
2817 | LIST, | |
2818 | "name=%c, active=int1(%c), public=int1(%c), hidden=int1(%c), maillist=int1(%c), group=int1(%c), gid=int2(%c), acl_type=%c, acl_id=%i4, desc=%c", | |
2819 | ulis_fields, | |
2820 | 10, | |
2821 | "l.list_id = %d", | |
2822 | 1, | |
2823 | &ulis_validate, | |
2824 | }, | |
2825 | ||
2826 | { | |
2827 | /* Q_DLIS - DELETE_LIST */ | |
2828 | "delete_list", | |
2829 | "dlis", | |
2830 | DELETE, | |
2831 | "l", | |
2832 | LIST, | |
2833 | (char *)0, | |
2834 | dlis_fields, | |
2835 | 0, | |
2836 | "l.list_id = %d", | |
2837 | 1, | |
2838 | &dlis_validate, | |
2839 | }, | |
2840 | ||
2841 | { | |
2842 | /* Q_AMTL - ADD_MEMBER_TO_LIST */ | |
2843 | "add_member_to_list", | |
2844 | "amtl", | |
2845 | APPEND, | |
2846 | "m", | |
2847 | "members", | |
2848 | "list_id=%i4, member_type=%c, member_id=%i4", | |
2849 | amtl_fields, | |
2850 | 3, | |
2851 | (char *)0, | |
2852 | 0, | |
2853 | &amtl_validate, | |
2854 | }, | |
2855 | ||
2856 | { | |
2857 | /* Q_DMFL - DELETE_MEMBER_FROM_LIST */ | |
2858 | "delete_member_from_list", | |
2859 | "dmfl", | |
2860 | DELETE, | |
2861 | "m", | |
2862 | "members", | |
2863 | (char *)0, | |
2864 | amtl_fields, | |
2865 | 0, | |
2866 | "m.list_id = %d and m.member_type = \"%s\" and m.member_id = %d", | |
2867 | 3, | |
2868 | &amtl_validate, | |
2869 | }, | |
2870 | ||
2871 | { | |
88343c5e | 2872 | /* Q_GAUS - GET_ACE_USE */ |
2873 | "get_ace_use", | |
d33e787c | 2874 | "gaus", |
2875 | RETRIEVE, | |
2876 | 0, | |
2877 | 0, | |
2878 | 0, | |
2879 | gaus_fields, | |
2880 | 2, | |
2881 | 0, | |
2882 | 2, | |
2883 | &gaus_validate, | |
2884 | }, | |
2885 | ||
2886 | { | |
2887 | /* Q_QGLI - QUALIFIED_GET_LISTS */ | |
2888 | "qualified_get_lists", | |
2889 | "qgli", | |
2890 | RETRIEVE, | |
2891 | 0, | |
2892 | LIST, | |
2893 | 0, | |
2894 | qgli_fields, | |
2895 | 1, | |
2896 | 0, | |
2897 | 5, | |
2898 | &qgli_validate, | |
2899 | }, | |
2900 | ||
2901 | { | |
2902 | /* Q_GMOL - GET_MEMBERS_OF_LIST */ | |
2903 | "get_members_of_list", | |
2904 | "gmol", | |
2905 | RETRIEVE, | |
2906 | (char *)0, | |
2907 | "members", | |
2908 | (char *)0, | |
2909 | gmol_fields, | |
2910 | 0, | |
2911 | (char *)0, | |
2912 | 1, | |
2913 | &gmol_validate, | |
2914 | }, | |
2915 | ||
2916 | { | |
2917 | /* Q_GLOM - GET_LISTS_OF_MEMBER */ | |
2918 | "get_lists_of_member", | |
2919 | "glom", | |
2920 | RETRIEVE, | |
2921 | 0, | |
2922 | "members", | |
2923 | 0, | |
2924 | glom_fields, | |
2925 | 6, | |
2926 | 0, | |
2927 | 2, | |
2928 | &glom_validate, | |
2929 | }, | |
2930 | ||
2931 | { | |
2932 | /* Q_CMOL - COUNT_MEMBERS_OF_LIST */ | |
2933 | "count_members_of_list", | |
2934 | "cmol", | |
2935 | RETRIEVE, | |
2936 | 0, | |
2937 | "members", | |
2938 | 0, | |
2939 | cmol_fields, | |
2940 | 1, | |
2941 | 0, | |
2942 | 1, | |
2943 | &cmol_validate, | |
2944 | }, | |
2945 | ||
2946 | { | |
2947 | /* Q_AUGR - ADD_USER_GROUP */ | |
2948 | "add_user_group", | |
2949 | "augr", | |
2950 | APPEND, | |
2951 | (char *)0, | |
2952 | (char *)0, | |
2953 | (char *)0, | |
2954 | augr_fields, | |
2955 | 1, | |
2956 | (char *)0, | |
2957 | 0, | |
2958 | &augr_validate, | |
2959 | }, | |
2960 | ||
2961 | { | |
2962 | /* Q_GZCL - GET_ZEPHYR_CLASS */ | |
2963 | "get_zephyr_class", | |
2964 | "gzcl", | |
2965 | RETRIEVE, | |
2966 | "z", | |
2967 | "zephyr", | |
2968 | "%c = z.class, %c = z.xmt_type, %c = text(z.xmt_id),%c = z.sub_type, %c = text(z.sub_id),%c = z.iws_type, %c = text(z.iws_id),%c = z.iui_type, %c = text(z.iui_id), %c=z.modtime, %c = text(z.modby), %c = z.modwith", | |
2969 | gzcl_fields, | |
2970 | 12, | |
2971 | "z.class = \"%s\"", | |
2972 | 1, | |
2973 | &gzcl_validate, | |
2974 | }, | |
2975 | ||
2976 | { | |
2977 | /* Q_AZCL - ADD_ZEPHYR_CLASS */ | |
2978 | "add_zephyr_class", | |
2979 | "azcl", | |
2980 | APPEND, | |
2981 | "z", | |
2982 | "zephyr", | |
2983 | "class = %c, xmt_type = %c, xmt_id = %i4, sub_type = %c, sub_id = %i4, iws_type = %c, iws_id = %i4, iui_type = %c, iui_id = %i4", | |
2984 | azcl_fields, | |
2985 | 9, | |
2986 | 0, | |
2987 | 0, | |
2988 | &azcl_validate, | |
2989 | }, | |
2990 | ||
2991 | { | |
2992 | /* Q_UZCL - UPDATE_ZEPHYR_CLASS */ | |
2993 | "update_zephyr_class", | |
2994 | "uzcl", | |
2995 | UPDATE, | |
2996 | "z", | |
2997 | "zephyr", | |
2998 | "class = %c, xmt_type = %c, xmt_id = %i4, sub_type = %c, sub_id = %i4, iws_type = %c, iws_id = %i4, iui_type = %c, iui_id = %i4", | |
2999 | uzcl_fields, | |
3000 | 9, | |
3001 | "z.class = \"%s\"", | |
3002 | 1, | |
3003 | &uzcl_validate, | |
3004 | }, | |
3005 | ||
3006 | { | |
3007 | /* Q_DZCL - DELETE_ZEPHYR_CLASS */ | |
3008 | "delete_zephyr_class", | |
3009 | "dzcl", | |
3010 | DELETE, | |
3011 | "z", | |
3012 | "zephyr", | |
3013 | 0, | |
3014 | uzcl_fields, | |
3015 | 0, | |
3016 | "z.class = \"%s\"", | |
3017 | 1, | |
3018 | &dzcl_validate, | |
3019 | }, | |
3020 | #ifdef notdef | |
3021 | { | |
3022 | /* Q_GSVC - GET_SERVICE */ | |
3023 | "get_service", | |
3024 | "gsvc", | |
3025 | RETRIEVE, | |
3026 | "s", | |
3027 | "services", | |
3028 | "%c = s.name, %c = s.protocol, %c = text(s.port), %c = s.desc, %c = s.modtime, %c = text(s.modby), %c = s.modwith", | |
3029 | gasv_fields, | |
3030 | 7, | |
3031 | (char *)0, | |
3032 | 0, | |
3033 | &gsvc_validate, | |
3034 | }, | |
3035 | ||
3036 | { | |
3037 | /* Q_ASVC - ADD_SERVICE */ | |
3038 | "add_service", | |
3039 | "asvc", | |
3040 | APPEND, | |
3041 | "s", | |
3042 | "services", | |
3043 | "name = %c, protocol = %c, port = int2(%c), desc = %c", | |
3044 | gasv_fields, | |
3045 | 4, | |
3046 | (char *)0, | |
3047 | 0, | |
3048 | &asvc_validate, | |
3049 | }, | |
3050 | ||
3051 | { | |
3052 | /* Q_DSVC - DELETE_SERVICE */ | |
3053 | "delete_service", | |
3054 | "dsvc", | |
3055 | DELETE, | |
3056 | "s", | |
3057 | "services", | |
3058 | 0, | |
3059 | gasv_fields, | |
3060 | 0, | |
3061 | "s.name = \"%s\"", | |
3062 | 1, | |
3063 | &dsvc_validate, | |
3064 | }, | |
3065 | #endif | |
3066 | { | |
3067 | /* Q_GPCP - GET_PRINTCAP */ | |
3068 | "get_printcap", | |
3069 | "gpcp", | |
3070 | RETRIEVE, | |
3071 | "p", | |
3072 | "printcap", | |
3073 | "%c = p.name, %c = p.pcap, %c = p.modtime, %c = text(p.modby), %c = p.modwith", | |
3074 | gpcp_fields, | |
3075 | 5, | |
3076 | "p.name = \"%s\"", | |
3077 | 1, | |
3078 | &VDsortf, | |
3079 | }, | |
3080 | ||
3081 | { | |
3082 | /* Q_APCP - ADD_PRINTCAP */ | |
3083 | "add_printcap", | |
3084 | "apcp", | |
3085 | APPEND, | |
3086 | "p", | |
3087 | "printcap", | |
3088 | "name = %c, pcap = %c", | |
3089 | apcp_fields, | |
3090 | 2, | |
3091 | 0, | |
3092 | 0, | |
3093 | &apcp_validate, | |
3094 | }, | |
3095 | ||
3096 | { | |
3097 | /* Q_DPCP - DELETE_PRINTCAP */ | |
3098 | "delete_printcap", | |
3099 | "dpcp", | |
3100 | DELETE, | |
3101 | "p", | |
3102 | "printcap", | |
3103 | 0, | |
3104 | apcp_fields, | |
3105 | 0, | |
3106 | "p.name = \"%s\"", | |
3107 | 1, | |
3108 | &apcp_validate, | |
3109 | }, | |
3110 | ||
3111 | { | |
3112 | /* Q_GALI - GET_ALIAS */ | |
3113 | "get_alias", | |
3114 | "gali", | |
3115 | RETRIEVE, | |
3116 | "a", | |
3117 | "alias", | |
3118 | "%c = a.name, %c = a.type, %c = a.trans", | |
3119 | gali_fields, | |
3120 | 3, | |
3121 | "a.name = \"%s\" and a.type = \"%s\" and a.trans = \"%s\"", | |
3122 | 3, | |
3123 | 0, | |
3124 | }, | |
3125 | ||
3126 | { | |
3127 | /* Q_AALI - ADD_ALIAS */ | |
3128 | "add_alias", | |
3129 | "aali", | |
3130 | APPEND, | |
3131 | "a", | |
3132 | "alias", | |
3133 | "name = %c, type = %c, trans = %c", | |
3134 | aali_fields, | |
3135 | 3, | |
3136 | (char *)0, | |
3137 | 0, | |
3138 | &aali_validate, | |
3139 | }, | |
3140 | ||
3141 | { | |
3142 | /* Q_DALI - DELETE_ALIAS */ | |
3143 | "delete_alias", | |
3144 | "dali", | |
3145 | DELETE, | |
3146 | "a", | |
3147 | "alias", | |
3148 | (char *)0, | |
3149 | aali_fields, | |
3150 | 0, | |
3151 | "a.name = \"%s\" and a.type = \"%s\" and a.trans = \"%s\"", | |
3152 | 3, | |
3153 | &dali_validate, | |
3154 | }, | |
3155 | ||
3156 | { | |
3157 | /* Q_GVAL - GET_VALUE */ | |
3158 | "get_value", | |
3159 | "gval", | |
3160 | RETRIEVE, | |
3161 | "v", | |
3162 | "values", | |
3163 | "%c = text(v.value)", | |
3164 | gval_fields, | |
3165 | 1, | |
3166 | "v.name = \"%s\"", | |
3167 | 1, | |
3168 | &gval_validate, | |
3169 | }, | |
3170 | ||
3171 | { | |
3172 | /* Q_AVAL - ADD_VALUE */ | |
3173 | "add_value", | |
3174 | "aval", | |
3175 | APPEND, | |
3176 | "v", | |
3177 | "values", | |
3178 | "name = %c, value = int4(%c)", | |
3179 | aval_fields, | |
3180 | 2, | |
3181 | (char *)0, | |
3182 | 0, | |
3183 | &aval_validate, | |
3184 | }, | |
3185 | ||
3186 | { | |
3187 | /* Q_UVAL - UPDATE_VALUE */ | |
3188 | "update_value", | |
3189 | "uval", | |
3190 | UPDATE, | |
3191 | "v", | |
3192 | "values", | |
3193 | "value = int4(%c)", | |
3194 | aval_fields, | |
3195 | 1, | |
3196 | "v.name = \"%s\"", | |
3197 | 1, | |
3198 | &aval_validate, | |
3199 | }, | |
3200 | ||
3201 | { | |
3202 | /* Q_DVAL - DELETE_VALUE */ | |
3203 | "delete_value", | |
3204 | "dval", | |
3205 | DELETE, | |
3206 | "v", | |
3207 | "values", | |
3208 | (char *)0, | |
3209 | dval_fields, | |
3210 | 0, | |
3211 | "v.name = \"%s\"", | |
3212 | 1, | |
3213 | &aval_validate, | |
3214 | }, | |
3215 | ||
3216 | { | |
3217 | /* Q_GATS - GET_ALL_TABLE_STATS */ | |
3218 | "get_all_table_stats", | |
3219 | "gats", | |
3220 | RETRIEVE, | |
3221 | "tbs", | |
3222 | "tblstats", | |
3223 | "%c = tbs.table, %c = text(tbs.retrieves), %c = text(tbs.appends), %c = text(tbs.updates), %c = text(tbs.deletes), %c = tbs.modtime", | |
3224 | gats_fields, | |
3225 | 6, | |
3226 | (char *)0, | |
3227 | 0, | |
3228 | 0, | |
3229 | }, | |
3230 | ||
3231 | }; | |
3232 | ||
3233 | int QueryCount2 = (sizeof Queries2 / sizeof (struct query)); |