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