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