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