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