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