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