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