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