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