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