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