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