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