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