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