]>
Commit | Line | Data |
---|---|---|
7ac48069 | 1 | /* $Id$ |
d33e787c | 2 | * |
c44ddfa7 | 3 | * This file defines the query dispatch table |
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 | ||
d33e787c | 21 | static struct valobj VOuser0[] = { |
e2b8245f | 22 | {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER}, |
d33e787c | 23 | }; |
24 | ||
25 | static struct valobj VOmach0[] = { | |
e2b8245f | 26 | {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE}, |
d33e787c | 27 | }; |
28 | ||
29 | static struct valobj VOclu0[] = { | |
e2b8245f | 30 | {V_ID, 0, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER}, |
d33e787c | 31 | }; |
32 | ||
d1b3a4bf | 33 | static struct valobj VOsnet0[] = { |
34 | {V_ID, 0, SUBNET_TABLE, "name", "snet_id", MR_SUBNET}, | |
35 | }; | |
36 | ||
d33e787c | 37 | static struct valobj VOlist0[] = { |
e2b8245f | 38 | {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST}, |
d33e787c | 39 | }; |
40 | ||
d1b3a4bf | 41 | static struct valobj VOfilesys0[] = { |
42 | {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS}, | |
43 | }; | |
44 | ||
2fb668b0 | 45 | static struct valobj VOcon0[] = { |
46 | {V_ID, 0, CONTAINERS_TABLE, "name", "cnt_id", MR_CONTAINER}, | |
47 | }; | |
48 | ||
f802fd0d | 49 | static struct valobj VOnum0[] = { |
50 | {V_NUM, 0}, | |
d33e787c | 51 | }; |
52 | ||
d33e787c | 53 | /* Validations |
54 | * Commonly used validation records defined here so that they may | |
55 | * be shared. | |
56 | */ | |
57 | ||
58 | static struct validate VDmach = { VOmach0, 1 }; | |
263a36d4 | 59 | |
29028043 | 60 | static struct validate VDfix_modby = { |
61 | 0, | |
62 | 0, | |
0c345c78 | 63 | 0, |
64 | 0, | |
65 | 0, | |
66 | 0, | |
67 | 0, | |
68 | 0, | |
69 | followup_fix_modby, | |
d33e787c | 70 | }; |
71 | ||
d33e787c | 72 | /* Query data */ |
73 | ||
186dd63b | 74 | static char *galo2_fields[] = { |
e2b8245f | 75 | "login", "unix_uid", "shell", "last", "first", "middle", |
d33e787c | 76 | }; |
77 | ||
186dd63b | 78 | static char *galo_fields[] = { |
79 | "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", | |
80 | }; | |
81 | ||
82 | static char *gual2_fields[] = { | |
e2b8245f | 83 | "login", |
84 | "login", "unix_uid", "shell", "last", "first", "middle", "status", | |
8db06f75 | 85 | "clearid", "class", "comments", "signature", "secure", |
86 | "modtime", "modby", "modwith", | |
4ffa124a | 87 | }; |
0c345c78 | 88 | |
186dd63b | 89 | static char *gual_fields[] = { |
90 | "login", | |
91 | "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", | |
92 | "status", "clearid", "class", "comments", "signature", "secure", | |
3b634eb3 | 93 | "modtime", "modby", "modwith", "created", "creator", |
186dd63b | 94 | }; |
95 | ||
96 | static char *gubl2_fields[] = { | |
e2b8245f | 97 | "login", |
98 | "login", "unix_uid", "shell", "last", "first", "middle", "status", | |
8db06f75 | 99 | "clearid", "class", "modtime", "modby", "modwith", |
d33e787c | 100 | }; |
101 | ||
186dd63b | 102 | static char *gubl_fields[] = { |
103 | "login", | |
104 | "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", | |
3b634eb3 | 105 | "status", "clearid", "class", "modtime", "modby", "modwith", "created", |
106 | "creator", | |
186dd63b | 107 | }; |
108 | ||
9db6a21e | 109 | static struct validate gubl2_validate = |
110 | { | |
111 | 0, | |
112 | 0, | |
113 | 0, | |
114 | 0, | |
115 | 0, | |
116 | 0, | |
117 | access_login, | |
118 | 0, | |
119 | followup_fix_modby, | |
120 | }; | |
121 | ||
5eaef520 | 122 | static struct validate gubl_validate = |
d33e787c | 123 | { |
263a36d4 | 124 | 0, |
125 | 0, | |
d33e787c | 126 | 0, |
127 | 0, | |
128 | 0, | |
129 | 0, | |
130 | access_login, | |
131 | 0, | |
3b634eb3 | 132 | followup_get_user, |
d33e787c | 133 | }; |
134 | ||
186dd63b | 135 | static char *guau2_fields[] = { |
e2b8245f | 136 | "unix_uid", |
137 | "login", "unix_uid", "shell", "last", "first", "middle", "status", | |
8db06f75 | 138 | "clearid", "class", "comments", "signature", "secure", |
139 | "modtime", "modby", "modwith", | |
4ffa124a | 140 | }; |
0c345c78 | 141 | |
186dd63b | 142 | static char *guau_fields[] = { |
143 | "unix_uid", | |
144 | "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", | |
145 | "status", "clearid", "class", "comments", "signature", "secure", | |
3b634eb3 | 146 | "modtime", "modby", "modwith", "created", "creator", |
186dd63b | 147 | }; |
148 | ||
149 | static char *guan2_fields[] = { | |
e2b8245f | 150 | "first", "last", |
151 | "login", "unix_uid", "shell", "last", "first", "middle", "status", | |
8db06f75 | 152 | "clearid", "class", "comments", "signature", "secure", |
153 | "modtime", "modby", "modwith", | |
4ffa124a | 154 | }; |
0c345c78 | 155 | |
186dd63b | 156 | static char *guan_fields[] = { |
157 | "first", "last", | |
158 | "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", | |
159 | "status", "clearid", "class", "comments", "signature", "secure", | |
3b634eb3 | 160 | "modtime", "modby", "modwith", "created", "creator", |
186dd63b | 161 | }; |
162 | ||
9db6a21e | 163 | static struct validate guan2_validate = |
164 | { | |
165 | 0, | |
166 | 0, | |
167 | 0, | |
168 | 0, | |
169 | 0, | |
170 | 0, | |
171 | 0, | |
172 | 0, | |
173 | followup_fix_modby, | |
174 | }; | |
175 | ||
5eaef520 | 176 | static struct validate guan_validate = |
60452f41 | 177 | { |
263a36d4 | 178 | 0, |
179 | 0, | |
60452f41 | 180 | 0, |
181 | 0, | |
182 | 0, | |
183 | 0, | |
184 | 0, | |
185 | 0, | |
3b634eb3 | 186 | followup_get_user, |
60452f41 | 187 | }; |
188 | ||
186dd63b | 189 | static char *guac2_fields[] = { |
e2b8245f | 190 | "class", |
191 | "login", "unix_uid", "shell", "last", "first", "middle", "status", | |
8db06f75 | 192 | "clearid", "class", "comments", "signature", "secure", |
193 | "modtime", "modby", "modwith", | |
4ffa124a | 194 | }; |
0c345c78 | 195 | |
186dd63b | 196 | static char *guac_fields[] = { |
197 | "class", | |
198 | "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", | |
199 | "status", "clearid", "class", "comments", "signature", "secure", | |
3b634eb3 | 200 | "modtime", "modby", "modwith", "created", "creator", |
186dd63b | 201 | }; |
202 | ||
203 | static char *guam2_fields[] = { | |
e2b8245f | 204 | "clearid", |
205 | "login", "unix_uid", "shell", "last", "first", "middle", "status", | |
8db06f75 | 206 | "clearid", "class", "comments", "signature", "secure", |
207 | "modtime", "modby", "modwith", | |
4ffa124a | 208 | }; |
0c345c78 | 209 | |
186dd63b | 210 | static char *guam_fields[] = { |
211 | "clearid", | |
212 | "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", | |
213 | "status", "clearid", "class", "comments", "signature", "secure", | |
3b634eb3 | 214 | "modtime", "modby", "modwith", "created", "creator", |
186dd63b | 215 | }; |
216 | ||
217 | static char *gubu2_fields[] = { | |
e2b8245f | 218 | "unix_uid", |
219 | "login", "unix_uid", "shell", "last", "first", "middle", "status", | |
8db06f75 | 220 | "clearid", "class", "modtime", "modby", "modwith", |
d33e787c | 221 | }; |
222 | ||
186dd63b | 223 | static char *gubu_fields[] = { |
224 | "unix_uid", | |
225 | "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", | |
3b634eb3 | 226 | "status", "clearid", "class", "modtime", "modby", "modwith", "created", |
227 | "creator", | |
186dd63b | 228 | }; |
229 | ||
9db6a21e | 230 | static struct validate gubu2_validate = |
231 | { | |
232 | VOnum0, | |
233 | 1, | |
234 | 0, | |
235 | 0, | |
236 | 0, | |
237 | 0, | |
238 | access_login, | |
239 | 0, | |
240 | followup_fix_modby, | |
241 | }; | |
242 | ||
5eaef520 | 243 | static struct validate gubu_validate = |
f9f5c199 | 244 | { |
f802fd0d | 245 | VOnum0, |
246 | 1, | |
f9f5c199 | 247 | 0, |
248 | 0, | |
249 | 0, | |
250 | 0, | |
251 | access_login, | |
252 | 0, | |
3b634eb3 | 253 | followup_get_user, |
f9f5c199 | 254 | }; |
255 | ||
186dd63b | 256 | static char *gubn2_fields[] = { |
e2b8245f | 257 | "first", "last", |
258 | "login", "unix_uid", "shell", "last", "first", "middle", "status", | |
8db06f75 | 259 | "clearid", "class", "modtime", "modby", "modwith", |
d33e787c | 260 | }; |
261 | ||
186dd63b | 262 | static char *gubn_fields[] = { |
263 | "first", "last", | |
264 | "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", | |
3b634eb3 | 265 | "status", "clearid", "class", "modtime", "modby", "modwith", "created", |
266 | "creator", | |
186dd63b | 267 | }; |
268 | ||
9db6a21e | 269 | static struct validate gubn2_validate = |
270 | { | |
271 | 0, | |
272 | 0, | |
273 | 0, | |
274 | 0, | |
275 | 0, | |
276 | 0, | |
277 | 0, | |
278 | 0, | |
279 | followup_fix_modby, | |
280 | }; | |
281 | ||
99e09b48 | 282 | static struct validate gubn_validate = |
283 | { | |
263a36d4 | 284 | 0, |
285 | 0, | |
0c345c78 | 286 | 0, |
287 | 0, | |
288 | 0, | |
289 | 0, | |
290 | 0, | |
291 | 0, | |
3b634eb3 | 292 | followup_get_user, |
99e09b48 | 293 | }; |
294 | ||
186dd63b | 295 | static char *gubc2_fields[] = { |
e2b8245f | 296 | "class", |
297 | "login", "unix_uid", "shell", "last", "first", "middle", "status", | |
8db06f75 | 298 | "clearid", "class", "modtime", "modby", "modwith", |
d33e787c | 299 | }; |
300 | ||
186dd63b | 301 | static char *gubc_fields[] = { |
302 | "class", | |
303 | "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", | |
304 | "status", "clearid", "class", "modtime", "modby", "modwith", | |
3b634eb3 | 305 | "created", "creator", |
186dd63b | 306 | }; |
307 | ||
308 | static char *gubm2_fields[] = { | |
e2b8245f | 309 | "clearid", |
310 | "login", "unix_uid", "shell", "last", "first", "middle", "status", | |
8db06f75 | 311 | "clearid", "class", "modtime", "modby", "modwith", |
d33e787c | 312 | }; |
313 | ||
186dd63b | 314 | static char *gubm_fields[] = { |
315 | "clearid", | |
316 | "login", "unix_uid", "shell", "winconsoleshell", "last", "first", | |
317 | "middle", "status", "clearid", "class", "modtime", "modby", "modwith", | |
3b634eb3 | 318 | "created", "creator", |
186dd63b | 319 | }; |
320 | ||
321 | static char *auac2_fields[] = { | |
e2b8245f | 322 | "login", "unix_uid", "shell", "last", "first", "middle", "status", |
323 | "clearid", "class", "comments", "signature", "secure", | |
d33e787c | 324 | }; |
325 | ||
186dd63b | 326 | static char *auac_fields[] = { |
327 | "login", "unix_uid", "shell", "winconsoleshell", "last", "first", | |
328 | "middle", "status", "clearid", "class", "comments", "signature", "secure", | |
329 | }; | |
330 | ||
331 | static struct valobj auac2_valobj[] = { | |
e2b8245f | 332 | {V_CHAR, 0, USERS_TABLE, "login"}, |
f802fd0d | 333 | {V_NUM, 1}, |
e2b8245f | 334 | {V_CHAR, 2, USERS_TABLE, "shell"}, |
335 | {V_CHAR, 3, USERS_TABLE, "last"}, | |
336 | {V_CHAR, 4, USERS_TABLE, "first"}, | |
337 | {V_CHAR, 5, USERS_TABLE, "middle"}, | |
f802fd0d | 338 | {V_NUM, 6}, |
e2b8245f | 339 | {V_CHAR, 7, USERS_TABLE, "clearid"}, |
340 | {V_TYPE, 8, 0, "class", 0, MR_BAD_CLASS}, | |
03c05291 | 341 | {V_ID, 9, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH}, |
9c45837e | 342 | {V_NUM, 11}, |
d33e787c | 343 | }; |
344 | ||
186dd63b | 345 | static struct valobj auac_valobj[] = { |
346 | {V_CHAR, 0, USERS_TABLE, "login"}, | |
347 | {V_NUM, 1}, | |
348 | {V_CHAR, 2, USERS_TABLE, "shell"}, | |
349 | {V_CHAR, 3, USERS_TABLE, "winconsoleshell"}, | |
350 | {V_CHAR, 4, USERS_TABLE, "last"}, | |
351 | {V_CHAR, 5, USERS_TABLE, "first"}, | |
352 | {V_CHAR, 6, USERS_TABLE, "middle"}, | |
353 | {V_NUM, 7}, | |
354 | {V_CHAR, 8, USERS_TABLE, "clearid"}, | |
355 | {V_TYPE, 9, 0, "class", 0, MR_BAD_CLASS}, | |
356 | {V_ID, 10, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH}, | |
357 | {V_NUM, 12}, | |
358 | }; | |
359 | ||
360 | static struct validate auac2_validate = { | |
361 | auac2_valobj, | |
362 | 11, | |
363 | "login", | |
364 | "login = '%s'", | |
365 | 1, | |
366 | "users_id", | |
367 | 0, | |
368 | setup_ausr, | |
369 | followup_ausr, | |
370 | }; | |
371 | ||
4ffa124a | 372 | static struct validate auac_validate = { |
373 | auac_valobj, | |
186dd63b | 374 | 12, |
375 | "login", | |
376 | "login = '%s'", | |
377 | 1, | |
378 | "users_id", | |
379 | 0, | |
380 | setup_ausr, | |
381 | followup_ausr, | |
382 | }; | |
383 | ||
384 | static struct validate ausr2_validate = { | |
385 | auac2_valobj, | |
386 | 9, | |
e2b8245f | 387 | "login", |
03c05291 | 388 | "login = '%s'", |
4ffa124a | 389 | 1, |
e2b8245f | 390 | "users_id", |
4ffa124a | 391 | 0, |
392 | setup_ausr, | |
393 | followup_ausr, | |
394 | }; | |
0c345c78 | 395 | |
d33e787c | 396 | static struct validate ausr_validate = { |
4ffa124a | 397 | auac_valobj, |
186dd63b | 398 | 10, |
e2b8245f | 399 | "login", |
03c05291 | 400 | "login = '%s'", |
d33e787c | 401 | 1, |
e2b8245f | 402 | "users_id", |
d33e787c | 403 | 0, |
404 | setup_ausr, | |
405 | followup_ausr, | |
406 | }; | |
407 | ||
408 | static char *rusr_fields[] = { | |
b4bfb4d1 | 409 | "unix_uid", "login", "pobox_type" |
03c05291 | 410 | }; |
d33e787c | 411 | |
ba408d23 | 412 | static struct valobj rusr_valobj[] = { |
f802fd0d | 413 | {V_NUM, 0}, |
8bf97744 | 414 | {V_CHAR, 1, USERS_TABLE, "login"}, |
ba408d23 | 415 | }; |
416 | ||
d33e787c | 417 | static struct validate rusr_validate = { |
ba408d23 | 418 | rusr_valobj, |
b4bfb4d1 | 419 | 2, |
d33e787c | 420 | 0, |
421 | 0, | |
422 | 0, | |
423 | 0, | |
424 | 0, | |
425 | register_user, | |
426 | 0, | |
427 | }; | |
428 | ||
186dd63b | 429 | static char *uuac2_fields[] = { |
e2b8245f | 430 | "login", |
431 | "newlogin", "unix_uid", "shell", "last", "first", "middle", "status", | |
432 | "clearid", "class", "comments", "signature", "secure", | |
d33e787c | 433 | }; |
434 | ||
186dd63b | 435 | static char *uuac_fields[] = { |
436 | "login", | |
437 | "newlogin", "unix_uid", "shell", "winconsoleshell", "last", "first", | |
438 | "middle", "status", "clearid", "class", "comments", "signature", "secure", | |
439 | }; | |
440 | ||
441 | static struct valobj uuac2_valobj[] = { | |
e2b8245f | 442 | {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER}, |
443 | {V_RENAME, 1, USERS_TABLE, "login", "users_id", MR_NOT_UNIQUE}, | |
f802fd0d | 444 | {V_NUM, 2}, |
e2b8245f | 445 | {V_CHAR, 3, USERS_TABLE, "shell"}, |
446 | {V_CHAR, 4, USERS_TABLE, "first"}, | |
447 | {V_CHAR, 5, USERS_TABLE, "last"}, | |
448 | {V_CHAR, 6, USERS_TABLE, "middle"}, | |
f802fd0d | 449 | {V_NUM, 7}, |
e2b8245f | 450 | {V_CHAR, 8, USERS_TABLE, "clearid"}, |
451 | {V_TYPE, 9, 0, "class", 0, MR_BAD_CLASS}, | |
03c05291 | 452 | {V_ID, 10, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH}, |
f802fd0d | 453 | {V_NUM, 12}, |
d33e787c | 454 | }; |
186dd63b | 455 | |
456 | static struct valobj uuac_valobj[] = { | |
457 | {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER}, | |
458 | {V_RENAME, 1, USERS_TABLE, "login", "users_id", MR_NOT_UNIQUE}, | |
459 | {V_NUM, 2}, | |
460 | {V_CHAR, 3, USERS_TABLE, "shell"}, | |
461 | {V_CHAR, 4, USERS_TABLE, "winconsoleshell"}, | |
462 | {V_CHAR, 5, USERS_TABLE, "first"}, | |
463 | {V_CHAR, 6, USERS_TABLE, "last"}, | |
464 | {V_CHAR, 7, USERS_TABLE, "middle"}, | |
465 | {V_NUM, 8}, | |
466 | {V_CHAR, 9, USERS_TABLE, "clearid"}, | |
467 | {V_TYPE, 10, 0, "class", 0, MR_BAD_CLASS}, | |
468 | {V_ID, 11, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH}, | |
469 | {V_NUM, 13}, | |
470 | }; | |
471 | ||
472 | static struct validate uuac2_validate = { | |
473 | uuac2_valobj, | |
474 | 12, | |
475 | 0, | |
476 | 0, | |
477 | 0, | |
478 | "users_id", | |
479 | 0, | |
480 | setup_ausr, | |
481 | set_modtime_by_id, | |
482 | }; | |
d33e787c | 483 | |
4ffa124a | 484 | static struct validate uuac_validate = { |
0c345c78 | 485 | uuac_valobj, |
186dd63b | 486 | 13, |
487 | 0, | |
488 | 0, | |
489 | 0, | |
490 | "users_id", | |
491 | 0, | |
492 | setup_ausr, | |
493 | set_modtime_by_id, | |
494 | }; | |
495 | ||
496 | static struct validate uusr2_validate = { | |
497 | uuac2_valobj, | |
498 | 10, | |
0c345c78 | 499 | 0, |
500 | 0, | |
501 | 0, | |
e2b8245f | 502 | "users_id", |
0c345c78 | 503 | 0, |
504 | setup_ausr, | |
d55429b2 | 505 | set_modtime_by_id, |
4ffa124a | 506 | }; |
0c345c78 | 507 | |
d33e787c | 508 | static struct validate uusr_validate = { |
4ffa124a | 509 | uuac_valobj, |
d1b3a4bf | 510 | 11, |
d33e787c | 511 | 0, |
512 | 0, | |
513 | 0, | |
e2b8245f | 514 | "users_id", |
d33e787c | 515 | 0, |
4ffa124a | 516 | setup_ausr, |
d33e787c | 517 | set_modtime_by_id, |
518 | }; | |
519 | ||
520 | static char *uush_fields[] = { | |
e2b8245f | 521 | "login", |
522 | "shell", | |
d33e787c | 523 | }; |
524 | ||
03c05291 | 525 | static struct valobj uush_valobj[] = { |
e2b8245f | 526 | {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER}, |
527 | {V_CHAR, 1, USERS_TABLE, "shell"}, | |
03c05291 | 528 | }; |
529 | ||
d33e787c | 530 | static struct validate uush_validate = { |
03c05291 | 531 | uush_valobj, |
d1b3a4bf | 532 | 2, |
d33e787c | 533 | 0, |
534 | 0, | |
535 | 0, | |
e2b8245f | 536 | "users_id", |
d33e787c | 537 | access_user, |
538 | 0, | |
a39342a9 | 539 | set_finger_modtime, |
d33e787c | 540 | }; |
541 | ||
29dbfca4 | 542 | static char *uuws_fields[] = { |
543 | "login", | |
544 | "winconsoleshell", | |
545 | }; | |
546 | ||
547 | static struct valobj uuws_valobj[] = { | |
548 | {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER}, | |
549 | {V_CHAR, 1, USERS_TABLE, "winconsoleshell"}, | |
550 | }; | |
551 | ||
552 | static struct validate uuws_validate = { | |
553 | uuws_valobj, | |
554 | 2, | |
555 | 0, | |
556 | 0, | |
557 | 0, | |
558 | "users_id", | |
559 | access_user, | |
560 | 0, | |
561 | set_finger_modtime, | |
562 | }; | |
563 | ||
d33e787c | 564 | static char *uust_fields[] = { |
e2b8245f | 565 | "login", |
566 | "status", | |
d33e787c | 567 | }; |
568 | ||
4ffa124a | 569 | static char *uuss_fields[] = { |
e2b8245f | 570 | "login", |
571 | "secure", | |
4ffa124a | 572 | }; |
0c345c78 | 573 | |
f802fd0d | 574 | static struct valobj uust_valobj[] = { |
f802fd0d | 575 | {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER}, |
576 | {V_NUM, 1}, | |
577 | {V_NUM, 2}, | |
578 | }; | |
579 | ||
d33e787c | 580 | static struct validate uust_validate = { |
f802fd0d | 581 | uust_valobj, |
d1b3a4bf | 582 | 2, |
d33e787c | 583 | 0, |
584 | 0, | |
585 | 0, | |
e2b8245f | 586 | "users_id", |
d33e787c | 587 | 0, |
588 | 0, | |
589 | set_modtime_by_id, | |
590 | }; | |
591 | ||
592 | static char *dusr_fields[] = { | |
e2b8245f | 593 | "login", |
d33e787c | 594 | }; |
595 | ||
596 | static struct validate dusr_validate = { | |
d1b3a4bf | 597 | VOuser0, |
598 | 1, | |
d33e787c | 599 | 0, |
600 | 0, | |
601 | 0, | |
602 | 0, | |
603 | 0, | |
604 | setup_dusr, | |
605 | 0, | |
606 | }; | |
607 | ||
77eb4bdf | 608 | static char *aurv_fields[] = { |
609 | "login", "reservation", | |
610 | }; | |
611 | ||
612 | static struct validate aurv_validate = { | |
613 | VOuser0, | |
614 | 1, | |
615 | 0, | |
616 | 0, | |
617 | 0, | |
618 | "users_id", | |
619 | 0, | |
620 | 0, | |
621 | do_user_reservation, | |
622 | }; | |
623 | ||
624 | static char *gurv_fields[] = { | |
625 | "login", | |
626 | "reservation", | |
627 | }; | |
628 | ||
629 | static struct validate gurv_validate = { | |
630 | VOuser0, | |
631 | 1, | |
632 | 0, | |
633 | 0, | |
634 | 0, | |
635 | 0, | |
636 | 0, | |
637 | 0, | |
638 | get_user_reservations, | |
639 | }; | |
640 | ||
641 | static char *gubr_fields[] = { | |
642 | "reservation", | |
643 | "login", | |
644 | }; | |
645 | ||
646 | static struct validate gubr_validate = { | |
647 | 0, | |
648 | 0, | |
649 | 0, | |
650 | 0, | |
651 | 0, | |
652 | 0, | |
653 | 0, | |
654 | 0, | |
655 | get_user_by_reservation, | |
656 | }; | |
657 | ||
e2b8245f | 658 | static char *gkum_fields[] = { "login", "kerberos", |
659 | "login", "kerberos" }; | |
012fc215 | 660 | |
e2b8245f | 661 | static char *akum_fields[] = { "login", "kerberos" }; |
012fc215 | 662 | |
663 | static struct valobj akum_valobj[] = | |
664 | { | |
e2b8245f | 665 | {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER}, |
03c05291 | 666 | {V_ID, 1, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH}, |
012fc215 | 667 | }; |
668 | ||
669 | static struct validate akum_validate = | |
670 | { | |
0c345c78 | 671 | akum_valobj, |
d1b3a4bf | 672 | 2, |
e2b8245f | 673 | "users_id", |
3e8c655c | 674 | "users_id = %d or string_id = %d", |
0c345c78 | 675 | 2, |
e2b8245f | 676 | "users_id", |
0c345c78 | 677 | access_user, |
996ffd1d | 678 | 0, |
135dcb80 | 679 | 0, |
680 | }; | |
012fc215 | 681 | |
682 | static struct validate dkum_validate = | |
683 | { | |
0c345c78 | 684 | akum_valobj, |
d1b3a4bf | 685 | 2, |
e2b8245f | 686 | "users_id", |
3e8c655c | 687 | "users_id = %d and string_id = %d", |
0c345c78 | 688 | 2, |
e2b8245f | 689 | "users_id", |
0c345c78 | 690 | access_user, |
691 | 0, | |
135dcb80 | 692 | 0, |
693 | }; | |
012fc215 | 694 | |
d33e787c | 695 | static char *gfbl_fields[] = { |
e2b8245f | 696 | "login", |
697 | "login", "fullname", "nickname", "home_addr", | |
5eaef520 | 698 | "home_phone", "office_addr", "office_phone", "department", |
8db06f75 | 699 | "affiliation", "modtime", "modby", "modwith", |
d33e787c | 700 | }; |
701 | ||
702 | static struct validate gfbl_validate = { | |
703 | VOuser0, | |
704 | 1, | |
705 | 0, | |
706 | 0, | |
707 | 0, | |
708 | 0, | |
709 | access_user, | |
710 | 0, | |
711 | followup_fix_modby, | |
712 | }; | |
713 | ||
714 | static char *ufbl_fields[] = { | |
e2b8245f | 715 | "login", |
d33e787c | 716 | "fullname", "nickname", "home_addr", |
5eaef520 | 717 | "home_phone", "office_addr", "office_phone", "department", |
4e5ec77f | 718 | "affiliation", |
d33e787c | 719 | }; |
720 | ||
03c05291 | 721 | static struct valobj ufbl_valobj[] = { |
e2b8245f | 722 | {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER}, |
03c05291 | 723 | {V_LEN, 1, USERS_TABLE, "fullname"}, |
724 | {V_LEN, 2, USERS_TABLE, "nickname"}, | |
725 | {V_LEN, 3, USERS_TABLE, "home_addr"}, | |
726 | {V_LEN, 4, USERS_TABLE, "home_phone"}, | |
727 | {V_LEN, 5, USERS_TABLE, "office_addr"}, | |
728 | {V_LEN, 6, USERS_TABLE, "office_phone"}, | |
729 | {V_LEN, 7, USERS_TABLE, "department"}, | |
730 | {V_LEN, 8, USERS_TABLE, "affiliation"}, | |
731 | }; | |
732 | ||
d33e787c | 733 | static struct validate ufbl_validate = { |
03c05291 | 734 | ufbl_valobj, |
d1b3a4bf | 735 | 9, |
d33e787c | 736 | 0, |
737 | 0, | |
738 | 0, | |
739 | 0, | |
740 | access_user, | |
741 | 0, | |
742 | set_finger_modtime, | |
743 | }; | |
744 | ||
745 | static char *gpob_fields[] = { | |
e2b8245f | 746 | "login", |
d6d830a1 | 747 | "login", "type", "box", "address", "modtime", "modby", "modwith", |
d33e787c | 748 | }; |
749 | ||
750 | static struct validate gpob_validate = { | |
751 | VOuser0, | |
752 | 1, | |
753 | "potype", | |
5eaef520 | 754 | "potype != 'NONE' and users_id = %d", |
d33e787c | 755 | 1, |
756 | 0, | |
757 | access_user, | |
758 | 0, | |
759 | followup_gpob, | |
760 | }; | |
761 | ||
762 | static char *gpox_fields[] = { | |
e2b8245f | 763 | "login", "type", "box", |
d33e787c | 764 | }; |
765 | ||
766 | static struct validate gpox_validate = { | |
d1b3a4bf | 767 | 0, |
768 | 0, | |
d33e787c | 769 | 0, |
770 | 0, | |
771 | 0, | |
772 | 0, | |
773 | 0, | |
774 | 0, | |
775 | followup_gpob, | |
776 | }; | |
777 | ||
778 | static char *spob_fields[] = { | |
e2b8245f | 779 | "login", "type", "box", |
d33e787c | 780 | }; |
781 | ||
782 | static struct valobj spob_valobj[] = { | |
e2b8245f | 783 | {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER}, |
03c05291 | 784 | {V_TYPE, 1, 0, "pobox", 0, MR_TYPE}, |
d33e787c | 785 | }; |
786 | ||
787 | static struct validate spob_validate = /* SET_POBOX */ | |
788 | { | |
789 | spob_valobj, | |
d1b3a4bf | 790 | 2, |
d33e787c | 791 | 0, |
792 | 0, | |
793 | 0, | |
794 | 0, | |
f659afb2 | 795 | access_spob, |
d33e787c | 796 | 0, |
797 | set_pobox, | |
798 | }; | |
799 | ||
800 | static struct validate spop_validate = /* SET_POBOX_POP */ | |
801 | { | |
d1b3a4bf | 802 | VOuser0, |
803 | 1, | |
d33e787c | 804 | 0, |
805 | 0, | |
806 | 0, | |
807 | 0, | |
808 | access_user, | |
17cb3de8 | 809 | 0, |
810 | set_pobox_pop, | |
d33e787c | 811 | }; |
812 | ||
813 | static struct validate dpob_validate = /* DELETE_POBOX */ | |
814 | { | |
d1b3a4bf | 815 | VOuser0, |
816 | 1, | |
d33e787c | 817 | 0, |
818 | 0, | |
819 | 0, | |
820 | 0, | |
821 | access_user, | |
822 | setup_dpob, | |
823 | set_pobox_modtime, | |
824 | }; | |
825 | ||
826 | static char *gmac_fields[] = { | |
e2b8245f | 827 | "name", |
8db06f75 | 828 | "name", "type", "modtime", "modby", "modwith", |
d33e787c | 829 | }; |
830 | ||
e4ae0190 | 831 | static char *ghst2_fields[] = { |
e2b8245f | 832 | "name", "address", "location", "network", |
8db06f75 | 833 | "name", "vendor", "model", "os", "location", "contact", "use", |
834 | "status", "status_change", "network", "address", "ace_type", | |
835 | "ace_name", "admin_comment", "ops_comment", "created", "creator", | |
836 | "inuse", "modtime", "modby", "modwith", | |
d33e787c | 837 | }; |
838 | ||
e4ae0190 | 839 | static char *ghbh2_fields[] = { |
012e079f | 840 | "hwaddr", |
841 | "name", "vendor", "model", "os", "location", "contact", "use", | |
842 | "status", "status_change", "network", "address", "ace_type", | |
843 | "ace_name", "admin_comment", "ops_comment", "created", "creator", | |
844 | "inuse", "modtime", "modby", "modwith", | |
845 | }; | |
846 | ||
4f6b1a05 | 847 | static char *ghst6_fields[] = { |
e4ae0190 | 848 | "name", "address", "location", "network", |
849 | "name", "vendor", "model", "os", "location", "contact", "billing_contact", | |
850 | "use", "status", "status_change", "network", "address", "ace_type", | |
851 | "ace_name", "admin_comment", "ops_comment", "created", "creator", | |
852 | "inuse", "modtime", "modby", "modwith", | |
853 | }; | |
854 | ||
4f6b1a05 | 855 | static char *ghbh6_fields[] = { |
e4ae0190 | 856 | "hwaddr", |
857 | "name", "vendor", "model", "os", "location", "contact", "billing_contact", | |
858 | "use", "status", "status_change", "network", "address", "ace_type", | |
859 | "ace_name", "admin_comment", "ops_comment", "created", "creator", | |
860 | "inuse", "modtime", "modby", "modwith", | |
861 | }; | |
862 | ||
4f6b1a05 | 863 | static char *ghst_fields[] = { |
864 | "name", "address", "location", "network", | |
865 | "name", "vendor", "model", "os", "location", "contact", "billing_contact", | |
866 | "account_number", "use", "status", "status_change", "network", "address", | |
867 | "ace_type", "ace_name", "admin_comment", "ops_comment", "created", "creator", | |
868 | "inuse", "modtime", "modby", "modwith", | |
869 | }; | |
870 | ||
871 | static char *ghbh_fields[] = { | |
872 | "hwaddr", | |
873 | "name", "vendor", "model", "os", "location", "contact", "billing_contact", | |
874 | "account_number", "use", "status", "status_change", "network", "address", | |
875 | "ace_type", "ace_name", "admin_comment", "ops_comment", "created", "creator", | |
876 | "inuse", "modtime", "modby", "modwith", | |
877 | }; | |
878 | ||
879 | static char *ghba_fields[] = { | |
880 | "account_number", | |
881 | "name", "vendor", "model", "os", "location", "contact", "billing_contact", | |
882 | "account_number", "use", "status", "status_change", "network", "address", | |
883 | "ace_type", "ace_name", "admin_comment", "ops_comment", "created", "creator", | |
884 | "inuse", "modtime", "modby", "modwith", | |
885 | }; | |
886 | ||
5eaef520 | 887 | static struct validate ghst_validate = { |
263a36d4 | 888 | 0, |
889 | 0, | |
a66a2204 | 890 | 0, |
891 | 0, | |
892 | 0, | |
893 | 0, | |
894 | access_host, | |
895 | 0, | |
896 | followup_ghst, | |
897 | }; | |
898 | ||
2884200f | 899 | static char *ghha_fields[] = { |
900 | "name", | |
901 | "hwaddr", | |
902 | }; | |
903 | ||
e4ae0190 | 904 | static char *ahst2_fields[] = { |
8db06f75 | 905 | "name", "vendor", "model", "os", "location", "contact", "use", |
906 | "status", "subnet", "address", "ace_type", "ace_name", | |
907 | "admin_comment", "ops_comment", | |
a66a2204 | 908 | }; |
909 | ||
e4ae0190 | 910 | static struct valobj ahst2_valobj[] = { |
e2b8245f | 911 | {V_CHAR, 0, MACHINE_TABLE, "name"}, |
03c05291 | 912 | {V_CHAR, 1, MACHINE_TABLE, "vendor"}, |
913 | {V_CHAR, 2, MACHINE_TABLE, "model"}, | |
914 | {V_CHAR, 3, MACHINE_TABLE, "os"}, | |
915 | {V_CHAR, 4, MACHINE_TABLE, "location"}, | |
916 | {V_CHAR, 5, MACHINE_TABLE, "contact"}, | |
f802fd0d | 917 | {V_NUM, 6}, |
918 | {V_NUM, 7}, | |
e2b8245f | 919 | {V_ID, 8, SUBNET_TABLE, "name", "snet_id", MR_SUBNET}, |
920 | {V_TYPE, 10, 0, "ace_type", 0, MR_ACE}, | |
a66a2204 | 921 | {V_TYPEDATA, 11, 0, 0, 0, MR_ACE}, |
03c05291 | 922 | {V_ID, 12, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH}, |
923 | {V_ID, 13, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH}, | |
d33e787c | 924 | }; |
925 | ||
e4ae0190 | 926 | static struct validate ahst2_validate = { |
927 | ahst2_valobj, | |
928 | 13, | |
929 | "name", | |
930 | "name = UPPER('%s')", | |
931 | 1, | |
932 | "mach_id", | |
933 | access_host, | |
934 | setup_ahst, | |
935 | set_uppercase_modtime, | |
936 | }; | |
937 | ||
4f6b1a05 | 938 | static char *ahst6_fields[] = { |
e4ae0190 | 939 | "name", "vendor", "model", "os", "location", "contact", "billing_contact", |
940 | "use", "status", "subnet", "address", "ace_type", "ace_name", | |
941 | "admin_comment", "ops_comment", | |
942 | }; | |
943 | ||
4f6b1a05 | 944 | static struct valobj ahst6_valobj[] = { |
e4ae0190 | 945 | {V_CHAR, 0, MACHINE_TABLE, "name"}, |
946 | {V_CHAR, 1, MACHINE_TABLE, "vendor"}, | |
947 | {V_CHAR, 2, MACHINE_TABLE, "model"}, | |
948 | {V_CHAR, 3, MACHINE_TABLE, "os"}, | |
949 | {V_CHAR, 4, MACHINE_TABLE, "location"}, | |
950 | {V_CHAR, 5, MACHINE_TABLE, "contact"}, | |
951 | {V_CHAR, 6, MACHINE_TABLE, "billing_contact"}, | |
952 | {V_NUM, 7}, | |
953 | {V_NUM, 8}, | |
954 | {V_ID, 9, SUBNET_TABLE, "name", "snet_id", MR_SUBNET}, | |
955 | {V_TYPE, 11, 0, "ace_type", 0, MR_ACE}, | |
956 | {V_TYPEDATA, 12, 0, 0, 0, MR_ACE}, | |
957 | {V_ID, 13, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH}, | |
958 | {V_ID, 14, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH}, | |
959 | }; | |
960 | ||
4f6b1a05 | 961 | static struct validate ahst6_validate = { |
962 | ahst6_valobj, | |
963 | 14, | |
964 | "name", | |
965 | "name = UPPER('%s')", | |
966 | 1, | |
967 | "mach_id", | |
968 | access_host, | |
969 | setup_ahst, | |
970 | set_uppercase_modtime, | |
971 | }; | |
972 | ||
973 | static char *ahst_fields[] = { | |
974 | "name", "vendor", "model", "os", "location", "contact", "billing_contact", | |
975 | "account_number", "use", "status", "subnet", "address", "ace_type", | |
976 | "ace_name", "admin_comment", "ops_comment", | |
977 | }; | |
978 | ||
979 | static struct valobj ahst_valobj[] = { | |
980 | {V_CHAR, 0, MACHINE_TABLE, "name"}, | |
981 | {V_CHAR, 1, MACHINE_TABLE, "vendor"}, | |
982 | {V_CHAR, 2, MACHINE_TABLE, "model"}, | |
983 | {V_CHAR, 3, MACHINE_TABLE, "os"}, | |
984 | {V_CHAR, 4, MACHINE_TABLE, "location"}, | |
985 | {V_CHAR, 5, MACHINE_TABLE, "contact"}, | |
986 | {V_CHAR, 6, MACHINE_TABLE, "billing_contact"}, | |
987 | {V_CHAR, 7, MACHINE_TABLE, "account_number"}, | |
988 | {V_NUM, 8}, | |
989 | {V_NUM, 9}, | |
990 | {V_ID, 10, SUBNET_TABLE, "name", "snet_id", MR_SUBNET}, | |
991 | {V_TYPE, 12, 0, "ace_type", 0, MR_ACE}, | |
992 | {V_TYPEDATA, 13, 0, 0, 0, MR_ACE}, | |
993 | {V_ID, 14, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH}, | |
994 | {V_ID, 15, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH}, | |
995 | }; | |
996 | ||
a66a2204 | 997 | static struct validate ahst_validate = { |
998 | ahst_valobj, | |
4f6b1a05 | 999 | 15, |
e2b8245f | 1000 | "name", |
03c05291 | 1001 | "name = UPPER('%s')", |
d33e787c | 1002 | 1, |
e2b8245f | 1003 | "mach_id", |
a66a2204 | 1004 | access_host, |
1005 | setup_ahst, | |
0ec43029 | 1006 | set_uppercase_modtime, |
d33e787c | 1007 | }; |
1008 | ||
e4ae0190 | 1009 | static char *uhst2_fields[] = { |
e2b8245f | 1010 | "name", |
8db06f75 | 1011 | "newname", "vendor", "model", "os", "location", "contact", "use", |
1012 | "status", "subnet", "address", "ace_type", "ace_name", | |
1013 | "admin_comment", "ops_comment", | |
d33e787c | 1014 | }; |
1015 | ||
e4ae0190 | 1016 | static struct valobj uhst2_valobj[] = { |
03c05291 | 1017 | {V_CHAR, 0, MACHINE_TABLE, "name"}, |
e2b8245f | 1018 | {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE}, |
1019 | {V_RENAME, 1, MACHINE_TABLE, "name", "mach_id", MR_NOT_UNIQUE}, | |
03c05291 | 1020 | {V_CHAR, 2, MACHINE_TABLE, "vendor"}, |
1021 | {V_CHAR, 3, MACHINE_TABLE, "model"}, | |
1022 | {V_CHAR, 4, MACHINE_TABLE, "os"}, | |
1023 | {V_CHAR, 5, MACHINE_TABLE, "location"}, | |
f802fd0d | 1024 | {V_CHAR, 6, MACHINE_TABLE, "contact"}, |
1025 | {V_NUM, 7}, | |
1026 | {V_NUM, 8}, | |
e2b8245f | 1027 | {V_ID, 9, SUBNET_TABLE, "name", "snet_id", MR_SUBNET}, |
1028 | {V_TYPE, 11, 0, "ace_type", 0, MR_ACE}, | |
a66a2204 | 1029 | {V_TYPEDATA, 12, 0, 0, 0, MR_ACE}, |
03c05291 | 1030 | {V_ID, 13, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH}, |
1031 | {V_ID, 14, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH}, | |
d33e787c | 1032 | }; |
1033 | ||
e4ae0190 | 1034 | static struct validate uhst2_validate = { |
1035 | uhst2_valobj, | |
1036 | 15, | |
1037 | 0, | |
1038 | 0, | |
1039 | 0, | |
1040 | "mach_id", | |
1041 | access_host, | |
1042 | setup_ahst, | |
1043 | set_modtime_by_id, | |
1044 | }; | |
1045 | ||
4f6b1a05 | 1046 | static char *uhst6_fields[] = { |
e4ae0190 | 1047 | "name", |
1048 | "newname", "vendor", "model", "os", "location", "contact", "billing_contact", | |
1049 | "use", "status", "subnet", "address", "ace_type", "ace_name", | |
1050 | "admin_comment", "ops_comment", | |
1051 | }; | |
1052 | ||
4f6b1a05 | 1053 | static struct valobj uhst6_valobj[] = { |
e4ae0190 | 1054 | {V_CHAR, 0, MACHINE_TABLE, "name"}, |
1055 | {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE}, | |
1056 | {V_RENAME, 1, MACHINE_TABLE, "name", "mach_id", MR_NOT_UNIQUE}, | |
1057 | {V_CHAR, 2, MACHINE_TABLE, "vendor"}, | |
1058 | {V_CHAR, 3, MACHINE_TABLE, "model"}, | |
1059 | {V_CHAR, 4, MACHINE_TABLE, "os"}, | |
1060 | {V_CHAR, 5, MACHINE_TABLE, "location"}, | |
1061 | {V_CHAR, 6, MACHINE_TABLE, "contact"}, | |
1062 | {V_CHAR, 7, MACHINE_TABLE, "billing_contact"}, | |
1063 | {V_NUM, 8}, | |
1064 | {V_NUM, 9}, | |
1065 | {V_ID, 10, SUBNET_TABLE, "name", "snet_id", MR_SUBNET}, | |
1066 | {V_TYPE, 12, 0, "ace_type", 0, MR_ACE}, | |
1067 | {V_TYPEDATA, 13, 0, 0, 0, MR_ACE}, | |
1068 | {V_ID, 14, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH}, | |
1069 | {V_ID, 15, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH}, | |
1070 | }; | |
1071 | ||
4f6b1a05 | 1072 | static struct validate uhst6_validate = { |
1073 | uhst6_valobj, | |
1074 | 16, | |
1075 | 0, | |
1076 | 0, | |
1077 | 0, | |
1078 | "mach_id", | |
1079 | access_host, | |
1080 | setup_ahst, | |
1081 | set_modtime_by_id, | |
1082 | }; | |
1083 | ||
1084 | static char *uhst_fields[] = { | |
1085 | "name", | |
1086 | "newname", "vendor", "model", "os", "location", "contact", "billing_contact", | |
1087 | "account_number", "use", "status", "subnet", "address", "ace_type", | |
1088 | "ace_name", "admin_comment", "ops_comment", | |
1089 | }; | |
1090 | ||
1091 | static struct valobj uhst_valobj[] = { | |
1092 | {V_CHAR, 0, MACHINE_TABLE, "name"}, | |
1093 | {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE}, | |
1094 | {V_RENAME, 1, MACHINE_TABLE, "name", "mach_id", MR_NOT_UNIQUE}, | |
1095 | {V_CHAR, 2, MACHINE_TABLE, "vendor"}, | |
1096 | {V_CHAR, 3, MACHINE_TABLE, "model"}, | |
1097 | {V_CHAR, 4, MACHINE_TABLE, "os"}, | |
1098 | {V_CHAR, 5, MACHINE_TABLE, "location"}, | |
1099 | {V_CHAR, 6, MACHINE_TABLE, "contact"}, | |
1100 | {V_CHAR, 7, MACHINE_TABLE, "billing_contact"}, | |
1101 | {V_CHAR, 8, MACHINE_TABLE, "account_number"}, | |
1102 | {V_NUM, 9}, | |
1103 | {V_NUM, 10}, | |
1104 | {V_ID, 11, SUBNET_TABLE, "name", "snet_id", MR_SUBNET}, | |
1105 | {V_TYPE, 13, 0, "ace_type", 0, MR_ACE}, | |
1106 | {V_TYPEDATA, 14, 0, 0, 0, MR_ACE}, | |
1107 | {V_ID, 15, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH}, | |
1108 | {V_ID, 16, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH}, | |
1109 | }; | |
1110 | ||
a66a2204 | 1111 | static struct validate uhst_validate = { |
1112 | uhst_valobj, | |
4f6b1a05 | 1113 | 17, |
d33e787c | 1114 | 0, |
1115 | 0, | |
1116 | 0, | |
e2b8245f | 1117 | "mach_id", |
a66a2204 | 1118 | access_host, |
1119 | setup_ahst, | |
d33e787c | 1120 | set_modtime_by_id, |
1121 | }; | |
1122 | ||
2884200f | 1123 | static char *uhha_fields[] = { |
1124 | "name", | |
1125 | "hwaddr" | |
1126 | }; | |
1127 | ||
1128 | static struct valobj uhha_valobj[] = { | |
1129 | {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE}, | |
1130 | {V_CHAR, 1, MACHINE_TABLE, "hwaddr"}, | |
1131 | }; | |
1132 | ||
1133 | static struct validate uhha_validate = { | |
1134 | uhha_valobj, | |
1135 | 2, | |
1136 | 0, | |
1137 | 0, | |
1138 | 0, | |
1139 | "mach_id", | |
1140 | 0, | |
1141 | setup_uhha, | |
1142 | set_modtime_by_id, | |
1143 | }; | |
1144 | ||
a66a2204 | 1145 | static char *dhst_fields[] = { |
e2b8245f | 1146 | "name", |
d33e787c | 1147 | }; |
1148 | ||
a66a2204 | 1149 | static struct validate dhst_validate = { |
d1b3a4bf | 1150 | VOmach0, |
1151 | 1, | |
d33e787c | 1152 | 0, |
1153 | 0, | |
1154 | 0, | |
1155 | 0, | |
1156 | 0, | |
1157 | setup_dmac, | |
1158 | 0, | |
1159 | }; | |
1160 | ||
a66a2204 | 1161 | static char *ghal_fields[] = { |
e2b8245f | 1162 | "alias", "canonical_hostname", |
1163 | "alias", "canonical_hostname" | |
a66a2204 | 1164 | }; |
1165 | ||
a66a2204 | 1166 | static struct validate ghal_validate = { |
263a36d4 | 1167 | 0, |
1168 | 0, | |
a66a2204 | 1169 | 0, |
1170 | 0, | |
1171 | 0, | |
1172 | 0, | |
65adfb53 | 1173 | access_ahal, |
a66a2204 | 1174 | 0, |
03c05291 | 1175 | 0, |
a66a2204 | 1176 | }; |
1177 | ||
1178 | static struct valobj ahal_valobj[] = { | |
e2b8245f | 1179 | {V_CHAR, 0, HOSTALIAS_TABLE, "name"}, |
e2b8245f | 1180 | {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE}, |
a66a2204 | 1181 | }; |
1182 | ||
1183 | static struct validate ahal_validate = { | |
1184 | ahal_valobj, | |
263a36d4 | 1185 | 2, |
e2b8245f | 1186 | "name", |
996ffd1d | 1187 | "name = UPPER('%s')", |
a66a2204 | 1188 | 1, |
e2b8245f | 1189 | "mach_id", |
a66a2204 | 1190 | access_ahal, |
1191 | setup_ahal, | |
1192 | 0, | |
1193 | }; | |
1194 | ||
1195 | static struct valobj dhal_valobj[] = { | |
e2b8245f | 1196 | {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE}, |
a66a2204 | 1197 | }; |
1198 | ||
1199 | static struct validate dhal_validate = { | |
1200 | dhal_valobj, | |
263a36d4 | 1201 | 1, |
e2b8245f | 1202 | "name", |
996ffd1d | 1203 | "name = UPPER('%s') AND mach_id = %d", |
a66a2204 | 1204 | 2, |
e2b8245f | 1205 | "mach_id", |
a66a2204 | 1206 | access_ahal, |
1207 | 0, | |
1208 | 0, | |
1209 | }; | |
1210 | ||
4f6b1a05 | 1211 | static char *gsnt2_fields[] = { |
e2b8245f | 1212 | "name", |
8db06f75 | 1213 | "name", "description", "address", "mask", "low", "high", "prefix", |
1214 | "ace_type", "ace_name", "modtime", "modby", "modwith" | |
3c1d412c | 1215 | }; |
1216 | ||
4f6b1a05 | 1217 | static char *gsnt_fields[] = { |
1218 | "name", | |
1219 | "name", "description", "status", "contact", "account_number", "address", | |
1220 | "mask", "low", "high", "prefix", "ace_type", "ace_name", "modtime", | |
1221 | "modby", "modwith" | |
1222 | }; | |
1223 | ||
3c1d412c | 1224 | static struct validate gsnt_validate = { |
263a36d4 | 1225 | 0, |
1226 | 0, | |
3c1d412c | 1227 | 0, |
1228 | 0, | |
1229 | 0, | |
1230 | 0, | |
a70337e7 | 1231 | access_snt, |
3c1d412c | 1232 | 0, |
1233 | followup_gsnt, | |
1234 | }; | |
1235 | ||
4f6b1a05 | 1236 | static char *asnt2_fields[] = { |
8db06f75 | 1237 | "name", "description", "address", "mask", "low", "high", "prefix", |
1238 | "ace_type", "ace_name", | |
3c1d412c | 1239 | }; |
1240 | ||
4f6b1a05 | 1241 | static struct valobj asnt2_valobj[] = { |
e2b8245f | 1242 | {V_CHAR, 0, SUBNET_TABLE, "name"}, |
1243 | {V_LEN, 1, SUBNET_TABLE, "description"}, | |
f802fd0d | 1244 | {V_NUM, 2}, |
1245 | {V_NUM, 3}, | |
1246 | {V_NUM, 4}, | |
1247 | {V_NUM, 5}, | |
03c05291 | 1248 | {V_LEN, 6, SUBNET_TABLE, "prefix"}, |
e2b8245f | 1249 | {V_TYPE, 7, 0, "ace_type", 0, MR_ACE}, |
bd8c26ff | 1250 | {V_TYPEDATA, 8, 0, 0, 0, MR_ACE}, |
3c1d412c | 1251 | }; |
1252 | ||
4f6b1a05 | 1253 | static struct validate asnt2_validate = |
3c1d412c | 1254 | { |
4f6b1a05 | 1255 | asnt2_valobj, |
d1b3a4bf | 1256 | 9, |
e2b8245f | 1257 | "name", |
5eaef520 | 1258 | "name = UPPER('%s')", |
1259 | 1, | |
e2b8245f | 1260 | "snet_id", |
5eaef520 | 1261 | 0, |
1262 | prefetch_value, | |
1263 | set_uppercase_modtime, | |
3c1d412c | 1264 | }; |
1265 | ||
4f6b1a05 | 1266 | static char *asnt_fields[] = { |
1267 | "name", "description", "status", "contact", "account_number", "address", | |
1268 | "mask", "low", "high", "prefix", "ace_type", "ace_name", | |
1269 | }; | |
1270 | ||
1271 | static struct valobj asnt_valobj[] = { | |
1272 | {V_CHAR, 0, SUBNET_TABLE, "name"}, | |
1273 | {V_LEN, 1, SUBNET_TABLE, "description"}, | |
1274 | {V_NUM, 2}, | |
1275 | {V_CHAR, 3, SUBNET_TABLE, "contact"}, | |
1276 | {V_CHAR, 4, SUBNET_TABLE, "account_number"}, | |
1277 | {V_NUM, 5}, | |
1278 | {V_NUM, 6}, | |
1279 | {V_NUM, 7}, | |
1280 | {V_NUM, 8}, | |
1281 | {V_LEN, 9, SUBNET_TABLE, "prefix"}, | |
1282 | {V_TYPE, 10, 0, "ace_type", 0, MR_ACE}, | |
1283 | {V_TYPEDATA, 11, 0, 0, 0, MR_ACE}, | |
1284 | }; | |
1285 | ||
1286 | static struct validate asnt_validate = | |
1287 | { | |
1288 | asnt_valobj, | |
1289 | 12, | |
1290 | "name", | |
1291 | "name = UPPER('%s')", | |
1292 | 1, | |
1293 | "snet_id", | |
1294 | 0, | |
1295 | setup_asnt, | |
1296 | set_uppercase_modtime, | |
1297 | }; | |
1298 | ||
1299 | static char *usnt2_fields[] = { | |
e2b8245f | 1300 | "name", |
8db06f75 | 1301 | "newname", "description", "address", "mask", "low", "high", "prefix", |
1302 | "ace_type", "ace_name", | |
3c1d412c | 1303 | }; |
1304 | ||
4f6b1a05 | 1305 | static struct valobj usnt2_valobj[] = { |
e2b8245f | 1306 | {V_ID, 0, SUBNET_TABLE, "name", "snet_id", MR_NO_MATCH}, |
1307 | {V_RENAME, 1, SUBNET_TABLE, "name", "snet_id", MR_NOT_UNIQUE}, | |
1308 | {V_LEN, 2, SUBNET_TABLE, "description"}, | |
f802fd0d | 1309 | {V_NUM, 3}, |
1310 | {V_NUM, 4}, | |
1311 | {V_NUM, 5}, | |
1312 | {V_NUM, 6}, | |
03c05291 | 1313 | {V_LEN, 7, SUBNET_TABLE, "prefix"}, |
e2b8245f | 1314 | {V_TYPE, 8, 0, "ace_type", 0, MR_ACE}, |
bd8c26ff | 1315 | {V_TYPEDATA, 9, 0, 0, 0, MR_ACE}, |
3c1d412c | 1316 | }; |
1317 | ||
4f6b1a05 | 1318 | static struct validate usnt2_validate = |
3c1d412c | 1319 | { |
4f6b1a05 | 1320 | usnt2_valobj, |
d1b3a4bf | 1321 | 10, |
e2b8245f | 1322 | "name", |
5eaef520 | 1323 | "snet_id = %d", |
1324 | 1, | |
e2b8245f | 1325 | "snet_id", |
5eaef520 | 1326 | 0, |
1327 | 0, | |
1328 | set_modtime_by_id, | |
3c1d412c | 1329 | }; |
1330 | ||
4f6b1a05 | 1331 | static char *usnt_fields[] = { |
1332 | "name", | |
1333 | "newname", "description", "status", "contact", "account_number", "address", | |
1334 | "mask", "low", "high", "prefix", "ace_type", "ace_name", | |
1335 | }; | |
1336 | ||
1337 | static struct valobj usnt_valobj[] = { | |
1338 | {V_ID, 0, SUBNET_TABLE, "name", "snet_id", MR_NO_MATCH}, | |
1339 | {V_RENAME, 1, SUBNET_TABLE, "name", "snet_id", MR_NOT_UNIQUE}, | |
1340 | {V_LEN, 2, SUBNET_TABLE, "description"}, | |
1341 | {V_NUM, 3}, | |
1342 | {V_CHAR, 4, SUBNET_TABLE, "contact"}, | |
1343 | {V_CHAR, 5, SUBNET_TABLE, "account_number"}, | |
1344 | {V_NUM, 6}, | |
1345 | {V_NUM, 7}, | |
1346 | {V_NUM, 8}, | |
1347 | {V_NUM, 9}, | |
1348 | {V_LEN, 10, SUBNET_TABLE, "prefix"}, | |
1349 | {V_TYPE, 11, 0, "ace_type", 0, MR_ACE}, | |
1350 | {V_TYPEDATA, 12, 0, 0, 0, MR_ACE}, | |
1351 | }; | |
1352 | ||
1353 | static struct validate usnt_validate = | |
1354 | { | |
1355 | usnt_valobj, | |
1356 | 13, | |
1357 | "name", | |
1358 | "snet_id = %d", | |
1359 | 1, | |
1360 | "snet_id", | |
1361 | 0, | |
1362 | setup_asnt, | |
1363 | set_modtime_by_id, | |
1364 | }; | |
1365 | ||
3c1d412c | 1366 | static char *dsnt_fields[] = { |
e2b8245f | 1367 | "name", |
3c1d412c | 1368 | }; |
1369 | ||
3c1d412c | 1370 | static struct validate dsnt_validate = { |
d1b3a4bf | 1371 | VOsnet0, |
1372 | 1, | |
3c1d412c | 1373 | 0, |
1374 | 0, | |
1375 | 0, | |
1376 | 0, | |
1377 | 0, | |
1378 | setup_dsnt, | |
1379 | 0, | |
1380 | }; | |
1381 | ||
d33e787c | 1382 | static char *gclu_fields[] = { |
e2b8245f | 1383 | "name", |
8db06f75 | 1384 | "name", "description", "location", "modtime", "modby", "modwith", |
d33e787c | 1385 | }; |
1386 | ||
1387 | static char *aclu_fields[] = { | |
e2b8245f | 1388 | "name", "description", "location", |
d33e787c | 1389 | }; |
0c345c78 | 1390 | |
339a00a3 | 1391 | static struct valobj aclu_valobj[] = { |
e2b8245f | 1392 | {V_CHAR, 0, CLUSTERS_TABLE, "name"}, |
1393 | {V_LEN, 1, CLUSTERS_TABLE, "description"}, | |
1394 | {V_LEN, 2, CLUSTERS_TABLE, "location"}, | |
339a00a3 | 1395 | }; |
1396 | ||
5eaef520 | 1397 | static struct validate aclu_validate = |
d33e787c | 1398 | { |
339a00a3 | 1399 | aclu_valobj, |
d1b3a4bf | 1400 | 3, |
e2b8245f | 1401 | "name", |
03c05291 | 1402 | "name = '%s'", |
d33e787c | 1403 | 1, |
e2b8245f | 1404 | "clu_id", |
d33e787c | 1405 | 0, |
45bf7573 | 1406 | prefetch_value, |
d33e787c | 1407 | set_modtime, |
1408 | }; | |
1409 | ||
1410 | static char *uclu_fields[] = { | |
e2b8245f | 1411 | "name", |
1412 | "newname", "description", "location", | |
d33e787c | 1413 | }; |
1414 | ||
1415 | static struct valobj uclu_valobj[] = { | |
e2b8245f | 1416 | {V_ID, 0, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER}, |
1417 | {V_RENAME, 1, CLUSTERS_TABLE, "name", "clu_id", MR_NOT_UNIQUE}, | |
1418 | {V_LEN, 2, CLUSTERS_TABLE, "description"}, | |
1419 | {V_LEN, 3, CLUSTERS_TABLE, "location"}, | |
d33e787c | 1420 | }; |
1421 | ||
1422 | static struct validate uclu_validate = { | |
1423 | uclu_valobj, | |
d1b3a4bf | 1424 | 4, |
d33e787c | 1425 | 0, |
1426 | 0, | |
1427 | 0, | |
e2b8245f | 1428 | "clu_id", |
d33e787c | 1429 | 0, |
1430 | 0, | |
1431 | set_modtime_by_id, | |
1432 | }; | |
1433 | ||
1434 | static char *dclu_fields[] = { | |
e2b8245f | 1435 | "name", |
d33e787c | 1436 | }; |
1437 | ||
1438 | static struct validate dclu_validate = { | |
0c345c78 | 1439 | VOclu0, |
1440 | 1, | |
1441 | 0, | |
1442 | 0, | |
1443 | 0, | |
1444 | 0, | |
1445 | 0, | |
1446 | setup_dclu, | |
1447 | 0, | |
d33e787c | 1448 | }; |
1449 | ||
1450 | static char *gmcm_fields[] = { | |
e2b8245f | 1451 | "machine", "cluster", |
1452 | "machine", "cluster", | |
d33e787c | 1453 | }; |
1454 | ||
1455 | static struct valobj amtc_valobj[] = /* ADD_MACHINE_TO_CLUSTER */ | |
1456 | { /* DELETE_MACHINE_FROM_CLUSTER */ | |
e2b8245f | 1457 | {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE}, |
1458 | {V_ID, 1, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER}, | |
d33e787c | 1459 | }; |
1460 | ||
1461 | static struct validate amtc_validate = /* for amtc and dmfc */ | |
1462 | { | |
1463 | amtc_valobj, | |
1464 | 2, | |
e2b8245f | 1465 | "mach_id", |
3e8c655c | 1466 | "mach_id = %d and clu_id = %d", |
d33e787c | 1467 | 2, |
1468 | 0, | |
1469 | 0, | |
1470 | 0, | |
1471 | set_mach_modtime_by_id, | |
1472 | }; | |
1473 | ||
1474 | static char *gcld_fields[] = { | |
e2b8245f | 1475 | "cluster", "serv_label", |
1476 | "cluster", "serv_label", "serv_cluster", | |
88343c5e | 1477 | }; |
1478 | ||
1479 | static char *acld_fields[] = { | |
e2b8245f | 1480 | "cluster", "serv_label", "serv_cluster", |
d33e787c | 1481 | }; |
1482 | ||
1483 | static struct valobj acld_valobj[] = | |
1484 | { | |
e2b8245f | 1485 | {V_ID, 0, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER}, |
03c05291 | 1486 | {V_CHAR, 1, SVC_TABLE, "serv_label"}, |
1487 | {V_CHAR, 2, SVC_TABLE, "serv_cluster"} | |
d33e787c | 1488 | }; |
1489 | ||
5eaef520 | 1490 | static struct validate acld_validate = |
1491 | { | |
d33e787c | 1492 | acld_valobj, |
99e09b48 | 1493 | 3, |
e2b8245f | 1494 | "clu_id", |
03c05291 | 1495 | "clu_id = %d AND serv_label = '%s' AND serv_cluster = '%s'", |
99e09b48 | 1496 | 3, |
1497 | 0, | |
1498 | 0, | |
1499 | 0, | |
1500 | set_cluster_modtime_by_id, | |
1501 | }; | |
1502 | ||
5eaef520 | 1503 | static struct validate dcld_validate = |
1504 | { | |
d1b3a4bf | 1505 | VOclu0, |
03c05291 | 1506 | 1, |
e2b8245f | 1507 | "clu_id", |
3e8c655c | 1508 | "clu_id = %d AND serv_label = '%s' AND serv_cluster = '%s'", |
d33e787c | 1509 | 3, |
1510 | 0, | |
1511 | 0, | |
1512 | 0, | |
1513 | set_cluster_modtime_by_id, | |
1514 | }; | |
1515 | ||
44da57b2 | 1516 | static char *glin2_fields[] = { |
e2b8245f | 1517 | "name", |
1518 | "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid", | |
8db06f75 | 1519 | "ace_type", "ace_name", "description", "modtime", "modby", "modwith", |
99e09b48 | 1520 | }; |
1521 | ||
59c3208b | 1522 | static char *glin3_fields[] = { |
44da57b2 | 1523 | "name", |
1524 | "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid", | |
1525 | "nfsgroup", "ace_type", "ace_name", "description", "modtime", "modby", | |
1526 | "modwith", | |
1527 | }; | |
1528 | ||
59c3208b | 1529 | static char *glin_fields[] = { |
1530 | "name", | |
1531 | "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid", | |
4529bc5f | 1532 | "nfsgroup", "ace_type", "ace_name", "memace_type", "memace_name", |
59c3208b | 1533 | "description", "modtime", "modby", "modwith", |
1534 | }; | |
1535 | ||
03c05291 | 1536 | static struct validate glin_validate = { |
0c345c78 | 1537 | 0, |
0c345c78 | 1538 | 0, |
1539 | 0, | |
1540 | 0, | |
1541 | 0, | |
1542 | 0, | |
03c05291 | 1543 | access_vis_list_by_name, |
0c345c78 | 1544 | 0, |
263a36d4 | 1545 | followup_glin, |
d33e787c | 1546 | }; |
1547 | ||
44da57b2 | 1548 | static char *alis2_fields[] = { |
e2b8245f | 1549 | "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid", |
1550 | "ace_type", "ace_name", "description", | |
d33e787c | 1551 | }; |
1552 | ||
44da57b2 | 1553 | static struct valobj alis2_valobj[] = { |
e2b8245f | 1554 | {V_CHAR, 0, LIST_TABLE, "name"}, |
f802fd0d | 1555 | {V_NUM, 1}, |
1556 | {V_NUM, 2}, | |
1557 | {V_NUM, 3}, | |
1558 | {V_NUM, 4}, | |
1559 | {V_NUM, 5}, | |
1560 | {V_NUM, 6}, | |
e2b8245f | 1561 | {V_TYPE, 7, 0, "ace_type", 0, MR_ACE}, |
1562 | {V_TYPEDATA, 8, 0, 0, "list_id", MR_ACE}, | |
1563 | {V_LEN, 9, LIST_TABLE, "description"}, | |
d33e787c | 1564 | }; |
1565 | ||
44da57b2 | 1566 | static struct validate alis2_validate = { |
1567 | alis2_valobj, | |
1568 | 10, | |
1569 | "name", | |
1570 | "name = '%s'", | |
1571 | 1, | |
1572 | "list_id", | |
1573 | 0, | |
1574 | setup_alis, | |
1575 | set_modtime, | |
1576 | }; | |
1577 | ||
59c3208b | 1578 | static char *alis3_fields[] = { |
44da57b2 | 1579 | "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid", |
1580 | "nfsgroup", "ace_type", "ace_name", "description", | |
1581 | }; | |
1582 | ||
59c3208b | 1583 | static struct valobj alis3_valobj[] = { |
44da57b2 | 1584 | {V_CHAR, 0, LIST_TABLE, "name"}, |
1585 | {V_NUM, 1}, | |
1586 | {V_NUM, 2}, | |
1587 | {V_NUM, 3}, | |
1588 | {V_NUM, 4}, | |
1589 | {V_NUM, 5}, | |
1590 | {V_NUM, 6}, | |
1591 | {V_NUM, 7}, | |
1592 | {V_TYPE, 8, 0, "ace_type", 0, MR_ACE}, | |
1593 | {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE}, | |
1594 | {V_LEN, 10, LIST_TABLE, "description"}, | |
1595 | }; | |
1596 | ||
59c3208b | 1597 | static struct validate alis3_validate = { |
1598 | alis3_valobj, | |
1599 | 11, | |
1600 | "name", | |
1601 | "name = '%s'", | |
1602 | 1, | |
1603 | "list_id", | |
1604 | 0, | |
1605 | setup_alis, | |
1606 | set_modtime, | |
1607 | }; | |
1608 | ||
1609 | static char *alis_fields[] = { | |
1610 | "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid", | |
1611 | "nfsgroup", "ace_type", "ace_name", "memace_type", "memace_name", | |
1612 | "description", | |
1613 | }; | |
1614 | ||
1615 | static struct valobj alis_valobj[] = { | |
1616 | {V_CHAR, 0, LIST_TABLE, "name"}, | |
1617 | {V_NUM, 1}, | |
1618 | {V_NUM, 2}, | |
1619 | {V_NUM, 3}, | |
1620 | {V_NUM, 4}, | |
1621 | {V_NUM, 5}, | |
1622 | {V_NUM, 6}, | |
1623 | {V_NUM, 7}, | |
1624 | {V_TYPE, 8, 0, "ace_type", 0, MR_ACE}, | |
1625 | {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE}, | |
1626 | {V_TYPE, 10, 0, "ace_type", 0, MR_ACE}, | |
1627 | {V_TYPEDATA, 11, 0, 0, "list_id", MR_ACE}, | |
1628 | {V_LEN, 12, LIST_TABLE, "description"}, | |
1629 | }; | |
1630 | ||
03c05291 | 1631 | static struct validate alis_validate = { |
1632 | alis_valobj, | |
59c3208b | 1633 | 13, |
e2b8245f | 1634 | "name", |
03c05291 | 1635 | "name = '%s'", |
d33e787c | 1636 | 1, |
e2b8245f | 1637 | "list_id", |
d33e787c | 1638 | 0, |
03c05291 | 1639 | setup_alis, |
1640 | set_modtime, | |
d33e787c | 1641 | }; |
1642 | ||
44da57b2 | 1643 | static char *ulis2_fields[] = { |
e2b8245f | 1644 | "name", |
03c05291 | 1645 | "newname", "active", "publicflg", "hidden", "maillist", "grouplist", "gid", |
e2b8245f | 1646 | "ace_type", "ace_name", "description", |
d33e787c | 1647 | }; |
1648 | ||
44da57b2 | 1649 | static struct valobj ulis2_valobj[] = { |
e2b8245f | 1650 | {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST}, |
1651 | {V_RENAME, 1, LIST_TABLE, "name", "list_id", MR_NOT_UNIQUE}, | |
f802fd0d | 1652 | {V_NUM, 2}, |
1653 | {V_NUM, 3}, | |
1654 | {V_NUM, 4}, | |
1655 | {V_NUM, 5}, | |
1656 | {V_NUM, 6}, | |
1657 | {V_NUM, 7}, | |
1658 | {V_TYPE, 8, 0, "ace_type", 0, MR_ACE}, | |
e2b8245f | 1659 | {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE}, |
e2b8245f | 1660 | {V_LEN, 10, LIST_TABLE, "description"}, |
d33e787c | 1661 | }; |
1662 | ||
44da57b2 | 1663 | static struct validate ulis2_validate = { |
1664 | ulis2_valobj, | |
d1b3a4bf | 1665 | 11, |
e2b8245f | 1666 | "name", |
03c05291 | 1667 | "list_id = %d", |
d33e787c | 1668 | 1, |
e2b8245f | 1669 | "list_id", |
03c05291 | 1670 | access_list, |
1671 | setup_alis, | |
1672 | set_modtime_by_id, | |
d33e787c | 1673 | }; |
1674 | ||
59c3208b | 1675 | static char *ulis3_fields[] = { |
44da57b2 | 1676 | "name", |
1677 | "newname", "active", "publicflg", "hidden", "maillist", "grouplist", "gid", | |
1678 | "nfsgroup", "ace_type", "ace_name", "description", | |
1679 | }; | |
1680 | ||
59c3208b | 1681 | static struct valobj ulis3_valobj[] = { |
44da57b2 | 1682 | {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST}, |
1683 | {V_RENAME, 1, LIST_TABLE, "name", "list_id", MR_NOT_UNIQUE}, | |
1684 | {V_NUM, 2}, | |
1685 | {V_NUM, 3}, | |
1686 | {V_NUM, 4}, | |
1687 | {V_NUM, 5}, | |
1688 | {V_NUM, 6}, | |
1689 | {V_NUM, 7}, | |
1690 | {V_NUM, 8}, | |
1691 | {V_TYPE, 9, 0, "ace_type", 0, MR_ACE}, | |
1692 | {V_TYPEDATA, 10, 0, 0, "list_id", MR_ACE}, | |
1693 | {V_LEN, 11, LIST_TABLE, "description"}, | |
1694 | }; | |
1695 | ||
59c3208b | 1696 | static struct validate ulis3_validate = { |
1697 | ulis3_valobj, | |
44da57b2 | 1698 | 12, |
1699 | "name", | |
1700 | "list_id = %d", | |
1701 | 1, | |
1702 | "list_id", | |
1703 | access_list, | |
1704 | setup_alis, | |
1705 | set_modtime_by_id, | |
1706 | }; | |
1707 | ||
59c3208b | 1708 | static char *ulis_fields[] = { |
1709 | "name", | |
1710 | "newname", "active", "publicflg", "hidden", "maillist", "grouplist", "gid", | |
1711 | "nfsgroup", "ace_type", "ace_name", "memace_type", "memace_name", | |
1712 | "description", | |
1713 | }; | |
1714 | ||
1715 | static struct valobj ulis_valobj[] = { | |
1716 | {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST}, | |
1717 | {V_RENAME, 1, LIST_TABLE, "name", "list_id", MR_NOT_UNIQUE}, | |
1718 | {V_NUM, 2}, | |
1719 | {V_NUM, 3}, | |
1720 | {V_NUM, 4}, | |
1721 | {V_NUM, 5}, | |
1722 | {V_NUM, 6}, | |
1723 | {V_NUM, 7}, | |
1724 | {V_NUM, 8}, | |
1725 | {V_TYPE, 9, 0, "ace_type", 0, MR_ACE}, | |
1726 | {V_TYPEDATA, 10, 0, 0, "list_id", MR_ACE}, | |
1727 | {V_TYPE, 11, 0, "ace_type", 0, MR_ACE}, | |
1728 | {V_TYPEDATA, 12, 0, 0, "list_id", MR_ACE}, | |
1729 | {V_LEN, 13, LIST_TABLE, "description"}, | |
1730 | }; | |
1731 | ||
1732 | static struct validate ulis_validate = { | |
1733 | ulis_valobj, | |
1734 | 14, | |
1735 | "name", | |
1736 | "list_id = %d", | |
1737 | 1, | |
1738 | "list_id", | |
1739 | access_list, | |
1740 | setup_alis, | |
1741 | set_modtime_by_id, | |
1742 | }; | |
1743 | ||
03c05291 | 1744 | static char *dlis_fields[] = { |
e2b8245f | 1745 | "name", |
d33e787c | 1746 | }; |
1747 | ||
03c05291 | 1748 | static struct validate dlis_validate = { |
d1b3a4bf | 1749 | VOlist0, |
1750 | 1, | |
e2b8245f | 1751 | "name", |
03c05291 | 1752 | "list_id = %d", |
d33e787c | 1753 | 1, |
1754 | 0, | |
03c05291 | 1755 | access_list, |
1756 | setup_dlis, | |
d33e787c | 1757 | 0, |
1758 | }; | |
1759 | ||
03c05291 | 1760 | static char *amtl_fields[] = { |
1761 | "list_name", "member_type", "member_name", | |
d33e787c | 1762 | }; |
1763 | ||
46b6f1f6 | 1764 | static char *atml_fields[] = { |
1765 | "list_name", "member_type", "member_name", "tag", | |
1766 | }; | |
1767 | ||
03c05291 | 1768 | static struct valobj amtl_valobj[] = { |
e2b8245f | 1769 | {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST}, |
03c05291 | 1770 | {V_TYPE, 1, 0, "member", 0, MR_TYPE}, |
1771 | {V_TYPEDATA, 2, 0, 0, 0, MR_NO_MATCH}, | |
46b6f1f6 | 1772 | {V_ID, 3, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH}, |
99e09b48 | 1773 | }; |
1774 | ||
03c05291 | 1775 | static struct validate amtl_validate = |
1776 | { | |
1777 | amtl_valobj, | |
d1b3a4bf | 1778 | 3, |
d33e787c | 1779 | 0, |
1780 | 0, | |
1781 | 0, | |
1782 | 0, | |
03c05291 | 1783 | access_list, |
d33e787c | 1784 | 0, |
03c05291 | 1785 | add_member_to_list, |
d33e787c | 1786 | }; |
1787 | ||
46b6f1f6 | 1788 | static struct validate atml_validate = |
1789 | { | |
1790 | amtl_valobj, | |
1791 | 4, | |
1792 | 0, | |
1793 | 0, | |
1794 | 0, | |
1795 | 0, | |
1796 | access_list, | |
1797 | 0, | |
1798 | add_member_to_list, | |
1799 | }; | |
1800 | ||
1801 | static struct validate tmol_validate = | |
1802 | { | |
1803 | amtl_valobj, | |
1804 | 4, | |
46b6f1f6 | 1805 | 0, |
46b6f1f6 | 1806 | 0, |
1807 | 0, | |
20541c25 | 1808 | 0, |
1809 | access_list, | |
1810 | 0, | |
1811 | tag_member_of_list, | |
46b6f1f6 | 1812 | }; |
1813 | ||
03c05291 | 1814 | static struct validate dmfl_validate = |
1815 | { | |
1816 | amtl_valobj, | |
d1b3a4bf | 1817 | 3, |
0c345c78 | 1818 | 0, |
1819 | 0, | |
1820 | 0, | |
1821 | 0, | |
03c05291 | 1822 | access_list, |
0c345c78 | 1823 | 0, |
03c05291 | 1824 | delete_member_from_list, |
d33e787c | 1825 | }; |
1826 | ||
03c05291 | 1827 | static char *gaus_fields[] = { |
e2b8245f | 1828 | "ace_type", "ace_name", |
03c05291 | 1829 | "use_type", "use_name", |
d33e787c | 1830 | }; |
1831 | ||
03c05291 | 1832 | static struct valobj gaus_valobj[] = { |
03c05291 | 1833 | {V_TYPE, 0, 0, "gaus", 0, MR_TYPE}, |
1834 | {V_TYPEDATA, 1, 0, 0, 0, MR_NO_MATCH}, | |
d33e787c | 1835 | }; |
1836 | ||
03c05291 | 1837 | static struct validate gaus_validate = { |
1838 | gaus_valobj, | |
d1b3a4bf | 1839 | 2, |
d33e787c | 1840 | 0, |
d33e787c | 1841 | 0, |
d33e787c | 1842 | 0, |
d33e787c | 1843 | 0, |
03c05291 | 1844 | access_member, |
d33e787c | 1845 | 0, |
03c05291 | 1846 | get_ace_use, |
d33e787c | 1847 | }; |
1848 | ||
d3051625 | 1849 | static char *ghbo_fields[] = { |
1850 | "ace_type", "ace_name", | |
1851 | "name", | |
1852 | }; | |
1853 | ||
1854 | static struct valobj ghbo_valobj[] = { | |
1855 | {V_TYPE, 0, 0, "gaus", 0, MR_TYPE}, | |
1856 | {V_TYPEDATA, 1, 0, 0, 0, MR_NO_MATCH}, | |
1857 | }; | |
1858 | ||
1859 | static struct validate ghbo_validate = { | |
1860 | ghbo_valobj, | |
1861 | 2, | |
1862 | 0, | |
1863 | 0, | |
1864 | 0, | |
1865 | 0, | |
1866 | access_member, | |
1867 | 0, | |
1868 | get_host_by_owner, | |
1869 | }; | |
1870 | ||
03c05291 | 1871 | static char *qgli_fields[] = { |
1872 | "active", "publicflg", "hidden", "maillist", "grouplist", | |
1873 | "list", | |
3e8c655c | 1874 | }; |
d33e787c | 1875 | |
03c05291 | 1876 | static struct valobj qgli_valobj[] = { |
1877 | {V_TYPE, 0, 0, "boolean", 0, MR_TYPE}, | |
1878 | {V_TYPE, 1, 0, "boolean", 0, MR_TYPE}, | |
1879 | {V_TYPE, 2, 0, "boolean", 0, MR_TYPE}, | |
1880 | {V_TYPE, 3, 0, "boolean", 0, MR_TYPE}, | |
1881 | {V_TYPE, 4, 0, "boolean", 0, MR_TYPE}, | |
d33e787c | 1882 | }; |
1883 | ||
03c05291 | 1884 | static struct validate qgli_validate = { |
1885 | qgli_valobj, | |
1886 | 5, | |
647daf33 | 1887 | 0, |
d33e787c | 1888 | 0, |
1889 | 0, | |
87167924 | 1890 | 0, |
03c05291 | 1891 | access_qgli, |
d33e787c | 1892 | 0, |
03c05291 | 1893 | qualified_get_lists, |
d33e787c | 1894 | }; |
1895 | ||
03c05291 | 1896 | static char *gmol_fields[] = { |
1897 | "list_name", | |
1898 | "member_type", "member_name", | |
d33e787c | 1899 | }; |
1900 | ||
46b6f1f6 | 1901 | static char *gtml_fields[] = { |
1902 | "list_name", | |
1903 | "member_type", "member_name", "tag", | |
d33e787c | 1904 | }; |
1905 | ||
46b6f1f6 | 1906 | static struct validate gmol_validate = { |
d1b3a4bf | 1907 | VOlist0, |
1908 | 1, | |
d33e787c | 1909 | 0, |
1910 | 0, | |
1911 | 0, | |
1912 | 0, | |
03c05291 | 1913 | access_visible_list, |
d33e787c | 1914 | 0, |
46b6f1f6 | 1915 | get_members_of_list, |
d33e787c | 1916 | }; |
1917 | ||
03c05291 | 1918 | static char *glom_fields[] = { |
1919 | "member_type", "member_name", | |
1920 | "list_name", "active", "publicflg", "hidden", "maillist", "grouplist", | |
d33e787c | 1921 | }; |
1922 | ||
03c05291 | 1923 | static struct valobj glom_valobj[] = { |
5eaef520 | 1924 | {V_TYPE, 0, 0, "rmember", 0, MR_TYPE}, |
1925 | {V_TYPEDATA, 1, 0, 0, 0, MR_NO_MATCH}, | |
d33e787c | 1926 | }; |
1927 | ||
03c05291 | 1928 | static struct validate glom_validate = { |
1929 | glom_valobj, | |
d1b3a4bf | 1930 | 2, |
d33e787c | 1931 | 0, |
1932 | 0, | |
03c05291 | 1933 | 0, |
1934 | 0, | |
1935 | access_member, | |
1936 | 0, | |
1937 | get_lists_of_member, | |
d33e787c | 1938 | }; |
1939 | ||
03c05291 | 1940 | static char *cmol_fields[] = { |
1941 | "list_name", | |
1942 | "count", | |
d33e787c | 1943 | }; |
1944 | ||
03c05291 | 1945 | static struct validate cmol_validate = { |
1946 | VOlist0, | |
d33e787c | 1947 | 1, |
1948 | 0, | |
1949 | 0, | |
1950 | 0, | |
1951 | 0, | |
03c05291 | 1952 | access_visible_list, |
d33e787c | 1953 | 0, |
03c05291 | 1954 | count_members_of_list, |
d33e787c | 1955 | }; |
1956 | ||
03c05291 | 1957 | static char *gsin_fields[] = { |
e2b8245f | 1958 | "service", |
1959 | "service", "update_int", "target_file", "script", "dfgen", "dfcheck", | |
1960 | "type", "enable", "inprogress", "harderror", "errmsg", | |
8db06f75 | 1961 | "ace_type", "ace_name", "modtime", "modby", "modwith", |
88343c5e | 1962 | }; |
1963 | ||
5eaef520 | 1964 | static struct validate gsin_validate = |
03c05291 | 1965 | { |
263a36d4 | 1966 | 0, |
1967 | 0, | |
99e09b48 | 1968 | 0, |
1969 | 0, | |
1970 | 0, | |
1971 | 0, | |
03c05291 | 1972 | access_service, |
99e09b48 | 1973 | 0, |
59c3208b | 1974 | followup_gsin, |
99e09b48 | 1975 | }; |
1976 | ||
03c05291 | 1977 | static char *qgsv_fields[] = { |
1978 | "enable", "inprogress", "harderror", | |
1979 | "service", | |
4ffa124a | 1980 | }; |
0c345c78 | 1981 | |
03c05291 | 1982 | static struct valobj qgsv_valobj[] = { |
1983 | {V_TYPE, 0, 0, "boolean", 0, MR_TYPE}, | |
1984 | {V_TYPE, 1, 0, "boolean", 0, MR_TYPE}, | |
1985 | {V_TYPE, 2, 0, "boolean", 0, MR_TYPE}, | |
d33e787c | 1986 | }; |
1987 | ||
03c05291 | 1988 | static struct validate qgsv_validate = { |
1989 | qgsv_valobj, | |
1990 | 3, | |
d33e787c | 1991 | 0, |
1992 | 0, | |
1993 | 0, | |
1994 | 0, | |
d33e787c | 1995 | 0, |
03c05291 | 1996 | 0, |
1997 | qualified_get_server, | |
d33e787c | 1998 | }; |
1999 | ||
03c05291 | 2000 | static char *asin_fields[] = { |
e2b8245f | 2001 | "service", "update_int", "target_file", "script", "type", "enable", |
2002 | "ace_type", "ace_name", | |
d33e787c | 2003 | }; |
2004 | ||
03c05291 | 2005 | static struct valobj asin_valobj[] = { |
e2b8245f | 2006 | {V_CHAR, 0, SERVERS_TABLE, "name"}, |
f802fd0d | 2007 | {V_NUM, 1}, |
03c05291 | 2008 | {V_LEN, 2, SERVERS_TABLE, "target_file"}, |
2009 | {V_LEN, 3, SERVERS_TABLE, "script"}, | |
2010 | {V_TYPE, 4, 0, "service", 0, MR_TYPE}, | |
f802fd0d | 2011 | {V_NUM, 5}, |
e2b8245f | 2012 | {V_TYPE, 6, 0, "ace_type", 0, MR_ACE}, |
03c05291 | 2013 | {V_TYPEDATA, 7, 0, 0, 0, MR_ACE}, |
d33e787c | 2014 | }; |
2015 | ||
03c05291 | 2016 | static struct validate asin_validate = /* for asin, usin */ |
2017 | { | |
2018 | asin_valobj, | |
d1b3a4bf | 2019 | 8, |
e2b8245f | 2020 | "name", |
03c05291 | 2021 | "name = UPPER('%s')", |
d33e787c | 2022 | 1, |
d33e787c | 2023 | 0, |
03c05291 | 2024 | 0, |
2025 | 0, | |
2026 | set_uppercase_modtime, | |
d33e787c | 2027 | }; |
2028 | ||
03c05291 | 2029 | static struct validate rsve_validate = { |
2030 | asin_valobj, | |
d1b3a4bf | 2031 | 1, |
e2b8245f | 2032 | "name", |
03c05291 | 2033 | "name = UPPER('%s')", |
d33e787c | 2034 | 1, |
d33e787c | 2035 | 0, |
03c05291 | 2036 | access_service, |
2037 | 0, | |
2038 | set_uppercase_modtime, | |
d33e787c | 2039 | }; |
2040 | ||
03c05291 | 2041 | static char *ssif_fields[] = { |
e2b8245f | 2042 | "service", "dfgen", "dfcheck", "inprogress", "harderror", "errmsg", |
d33e787c | 2043 | }; |
2044 | ||
03c05291 | 2045 | static struct valobj ssif_valobj[] = { |
d1b3a4bf | 2046 | {V_NAME, 0, SERVERS_TABLE, "name", 0, MR_SERVICE}, |
f802fd0d | 2047 | {V_NUM, 1}, |
2048 | {V_NUM, 2}, | |
2049 | {V_NUM, 3}, | |
2050 | {V_NUM, 4}, | |
03c05291 | 2051 | {V_LEN, 5, SERVERS_TABLE, "errmsg"}, |
d33e787c | 2052 | }; |
2053 | ||
03c05291 | 2054 | static struct validate ssif_validate = { |
2055 | ssif_valobj, | |
d1b3a4bf | 2056 | 6, |
e2b8245f | 2057 | "name", |
03c05291 | 2058 | "name = UPPER('%s')", |
d33e787c | 2059 | 1, |
2060 | 0, | |
2061 | 0, | |
03c05291 | 2062 | 0, |
d33e787c | 2063 | 0, |
2064 | }; | |
2065 | ||
03c05291 | 2066 | static char *dsin_fields[] = { |
e2b8245f | 2067 | "service", |
95127ba8 | 2068 | }; |
2069 | ||
03c05291 | 2070 | static struct validate dsin_validate = { |
2071 | asin_valobj, | |
d1b3a4bf | 2072 | 1, |
e2b8245f | 2073 | "name", |
03c05291 | 2074 | "name = UPPER('%s')", |
2075 | 1, | |
0c345c78 | 2076 | 0, |
2077 | 0, | |
03c05291 | 2078 | setup_dsin, |
0c345c78 | 2079 | 0, |
95127ba8 | 2080 | }; |
2081 | ||
03c05291 | 2082 | static char *gshi_fields[] = { |
e2b8245f | 2083 | "service", "machine", |
2084 | "service", "machine", "enable", "override", "success", "inprogress", | |
03c05291 | 2085 | "hosterror", "hosterrormsg", "ltt", "lts", "value1", "value2", |
8db06f75 | 2086 | "value3", "modtime", "modby", "modwith", |
95127ba8 | 2087 | }; |
2088 | ||
03c05291 | 2089 | static struct validate gshi_validate = { |
263a36d4 | 2090 | 0, |
2091 | 0, | |
0c345c78 | 2092 | 0, |
2093 | 0, | |
2094 | 0, | |
2095 | 0, | |
03c05291 | 2096 | access_service, |
2097 | 0, | |
2098 | followup_fix_modby, | |
95127ba8 | 2099 | }; |
2100 | ||
03c05291 | 2101 | static char *qgsh_fields[] = { |
2102 | "service", "enable", "override", "success", "inprogress", "hosterror", | |
e2b8245f | 2103 | "service", "machine", |
d33e787c | 2104 | }; |
2105 | ||
03c05291 | 2106 | static struct valobj qgsh_valobj[] = { |
2107 | {V_TYPE, 1, 0, "boolean", 0, MR_TYPE}, | |
2108 | {V_TYPE, 2, 0, "boolean", 0, MR_TYPE}, | |
2109 | {V_TYPE, 3, 0, "boolean", 0, MR_TYPE}, | |
2110 | {V_TYPE, 4, 0, "boolean", 0, MR_TYPE}, | |
2111 | {V_TYPE, 5, 0, "boolean", 0, MR_TYPE}, | |
99e09b48 | 2112 | }; |
2113 | ||
03c05291 | 2114 | static struct validate qgsh_validate = { |
2115 | qgsh_valobj, | |
2116 | 5, | |
d33e787c | 2117 | 0, |
2118 | 0, | |
2119 | 0, | |
2120 | 0, | |
2121 | 0, | |
2122 | 0, | |
03c05291 | 2123 | qualified_get_serverhost, |
d33e787c | 2124 | }; |
2125 | ||
03c05291 | 2126 | static char *ashi_fields[] = { |
e2b8245f | 2127 | "service", "machine", "enable", "value1", "value2", "value3", |
d33e787c | 2128 | }; |
2129 | ||
03c05291 | 2130 | static struct valobj ashi_valobj[] = { |
e2b8245f | 2131 | {V_NAME, 0, SERVERS_TABLE, "name", 0, MR_SERVICE}, |
e2b8245f | 2132 | {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE}, |
f802fd0d | 2133 | {V_NUM, 2}, |
2134 | {V_NUM, 3}, | |
2135 | {V_NUM, 4}, | |
03c05291 | 2136 | {V_LEN, 5, SERVERHOSTS_TABLE, "value3"}, |
45bf7573 | 2137 | }; |
2138 | ||
03c05291 | 2139 | static struct validate ashi_validate = /* ashi & ushi */ |
2140 | { | |
2141 | ashi_valobj, | |
d1b3a4bf | 2142 | 6, |
e2b8245f | 2143 | "service", |
03c05291 | 2144 | "service = UPPER('%s') AND mach_id = %d", |
d33e787c | 2145 | 2, |
d33e787c | 2146 | 0, |
03c05291 | 2147 | access_service, |
d33e787c | 2148 | 0, |
03c05291 | 2149 | set_serverhost_modtime, |
99e09b48 | 2150 | }; |
2151 | ||
5eaef520 | 2152 | static struct validate rshe_validate = |
03c05291 | 2153 | { |
2154 | ashi_valobj, | |
d1b3a4bf | 2155 | 2, |
e2b8245f | 2156 | "service", |
03c05291 | 2157 | "service = UPPER('%s') AND mach_id = %d", |
2158 | 2, | |
2159 | 0, | |
2160 | access_service, | |
2161 | 0, | |
2162 | set_serverhost_modtime, | |
d33e787c | 2163 | }; |
2164 | ||
5eaef520 | 2165 | static struct validate ssho_validate = |
03c05291 | 2166 | { |
2167 | ashi_valobj, | |
d1b3a4bf | 2168 | 2, |
e2b8245f | 2169 | "service", |
03c05291 | 2170 | "service = UPPER('%s') AND mach_id = %d", |
d33e787c | 2171 | 2, |
d33e787c | 2172 | 0, |
03c05291 | 2173 | access_service, |
2174 | 0, | |
2175 | trigger_dcm, | |
d33e787c | 2176 | }; |
2177 | ||
03c05291 | 2178 | static char *sshi_fields[] = { |
e2b8245f | 2179 | "service", "machine", "override", "success", "inprogress", |
03c05291 | 2180 | "hosterror", "errmsg", "ltt", "lts", |
368be132 | 2181 | }; |
2182 | ||
03c05291 | 2183 | static struct valobj sshi_valobj[] = { |
e2b8245f | 2184 | {V_NAME, 0, SERVERS_TABLE, "name", 0, MR_SERVICE}, |
f802fd0d | 2185 | {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE}, |
2186 | {V_NUM, 2}, | |
2187 | {V_NUM, 3}, | |
2188 | {V_NUM, 4}, | |
2189 | {V_NUM, 5}, | |
2190 | {V_LEN, 6, SERVERHOSTS_TABLE, "hosterrmsg"}, | |
2191 | {V_NUM, 7}, | |
2192 | {V_NUM, 8}, | |
368be132 | 2193 | }; |
2194 | ||
5eaef520 | 2195 | static struct validate sshi_validate = |
03c05291 | 2196 | { |
2197 | sshi_valobj, | |
d1b3a4bf | 2198 | 9, |
368be132 | 2199 | 0, |
2200 | 0, | |
2201 | 0, | |
2202 | 0, | |
2203 | 0, | |
2204 | 0, | |
03c05291 | 2205 | 0, |
368be132 | 2206 | }; |
2207 | ||
03c05291 | 2208 | static char *dshi_fields[] = { |
e2b8245f | 2209 | "service", "machine", |
368be132 | 2210 | }; |
2211 | ||
5eaef520 | 2212 | static struct validate dshi_validate = |
03c05291 | 2213 | { |
2214 | ashi_valobj, | |
d1b3a4bf | 2215 | 2, |
e2b8245f | 2216 | "service", |
03c05291 | 2217 | "service = UPPER('%s') AND mach_id = %d", |
135dcb80 | 2218 | 2, |
368be132 | 2219 | 0, |
03c05291 | 2220 | access_service, |
2221 | setup_dshi, | |
368be132 | 2222 | 0, |
03c05291 | 2223 | }; |
2224 | ||
2225 | static char *gslo_fields[] = { | |
2226 | "server", | |
e2b8245f | 2227 | "server", "machine", |
03c05291 | 2228 | }; |
2229 | ||
2230 | static char *gfsl_fields[] = { | |
e2b8245f | 2231 | "label", |
8db06f75 | 2232 | "label", "type", "machine", "name", "mount", "access", "comments", |
2233 | "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith", | |
03c05291 | 2234 | }; |
2235 | ||
5a8887d8 | 2236 | static struct validate gfsl_validate = { |
2237 | 0, | |
2238 | 0, | |
2239 | 0, | |
2240 | 0, | |
2241 | 0, | |
2242 | 0, | |
2243 | access_filesys, | |
2244 | 0, | |
2245 | followup_fix_modby, | |
2246 | }; | |
2247 | ||
03c05291 | 2248 | static char *gfsm_fields[] = { |
e2b8245f | 2249 | "machine", |
8db06f75 | 2250 | "label", "type", "machine", "name", "mount", "access", "comments", |
2251 | "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith", | |
03c05291 | 2252 | }; |
2253 | ||
03c05291 | 2254 | static struct validate gfsm_validate = { |
d1b3a4bf | 2255 | VOmach0, |
2256 | 1, | |
368be132 | 2257 | 0, |
2258 | 0, | |
368be132 | 2259 | 0, |
03c05291 | 2260 | 0, |
2261 | 0, | |
2262 | 0, | |
2263 | followup_fix_modby, | |
368be132 | 2264 | }; |
2265 | ||
03c05291 | 2266 | static char *gfsn_fields[] = { |
cc1bca5c | 2267 | "machine", "partition", |
8db06f75 | 2268 | "label", "type", "machine", "name", "mount", "access", "comments", |
2269 | "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith", | |
368be132 | 2270 | }; |
2271 | ||
03c05291 | 2272 | static struct validate gfsn_validate = { |
263a36d4 | 2273 | VOmach0, |
2274 | 1, | |
368be132 | 2275 | 0, |
2276 | 0, | |
368be132 | 2277 | 0, |
2278 | 0, | |
368be132 | 2279 | 0, |
2280 | 0, | |
03c05291 | 2281 | followup_fix_modby, |
368be132 | 2282 | }; |
2283 | ||
03c05291 | 2284 | static char *gfsp_fields[] = { |
2285 | "path", | |
8db06f75 | 2286 | "label", "type", "machine", "name", "mount", "access", "comments", |
2287 | "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith", | |
d33e787c | 2288 | }; |
2289 | ||
03c05291 | 2290 | static char *gfsg_fields[] = { |
e2b8245f | 2291 | "list", |
8db06f75 | 2292 | "label", "type", "machine", "name", "mount", "access", "comments", |
2293 | "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith", | |
03c05291 | 2294 | }; |
2295 | ||
03c05291 | 2296 | static struct validate gfsg_validate = { |
d1b3a4bf | 2297 | VOlist0, |
2298 | 1, | |
d33e787c | 2299 | 0, |
2300 | 0, | |
2301 | 0, | |
2302 | 0, | |
03c05291 | 2303 | access_list, |
d33e787c | 2304 | 0, |
03c05291 | 2305 | followup_fix_modby, |
d33e787c | 2306 | }; |
2307 | ||
03c05291 | 2308 | static char *afil_fields[] = { |
8db06f75 | 2309 | "label", "type", "machine", "name", "mount", "access", "comments", |
2310 | "owner", "owners", "create", "lockertype", | |
d33e787c | 2311 | }; |
2312 | ||
03c05291 | 2313 | static struct valobj afil_valobj[] = { |
e2b8245f | 2314 | {V_CHAR, 0, FILESYS_TABLE, "label"}, |
03c05291 | 2315 | {V_TYPE, 1, 0, "filesys", 0, MR_FSTYPE}, |
e2b8245f | 2316 | {V_ID, 2, MACHINE_TABLE, "name", "mach_id", MR_MACHINE}, |
2317 | {V_CHAR, 3, FILESYS_TABLE, "name"}, | |
03c05291 | 2318 | {V_LEN, 4, FILESYS_TABLE, "mount"}, |
f802fd0d | 2319 | {V_LEN, 5, FILESYS_TABLE, "rwaccess"}, |
e2b8245f | 2320 | {V_LEN, 6, FILESYS_TABLE, "comments"}, |
2321 | {V_ID, 7, USERS_TABLE, "login", "users_id", MR_USER}, | |
2322 | {V_ID, 8, LIST_TABLE, "name", "list_id", MR_LIST}, | |
f802fd0d | 2323 | {V_NUM, 9}, |
03c05291 | 2324 | {V_TYPE, 10, 0, "lockertype", 0, MR_TYPE}, |
99e09b48 | 2325 | }; |
2326 | ||
03c05291 | 2327 | static struct validate afil_validate = { |
2328 | afil_valobj, | |
d1b3a4bf | 2329 | 11, |
e2b8245f | 2330 | "label", |
03c05291 | 2331 | "label = '%s'", |
2332 | 1, | |
e2b8245f | 2333 | "filsys_id", |
03c05291 | 2334 | 0, |
2335 | setup_afil, | |
2336 | set_filesys_modtime, | |
2337 | }; | |
99e09b48 | 2338 | |
03c05291 | 2339 | static char *ufil_fields[] = { |
8db06f75 | 2340 | "label", "newlabel", "type", "machine", "name", "mount", "access", |
2341 | "comments", "owner", "owners", "create", "lockertype", | |
d33e787c | 2342 | }; |
2343 | ||
03c05291 | 2344 | static struct valobj ufil_valobj[] = { |
e2b8245f | 2345 | {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS}, |
2346 | {V_RENAME, 1, FILESYS_TABLE, "label", "filsys_id", MR_NOT_UNIQUE}, | |
03c05291 | 2347 | {V_TYPE, 2, 0, "filesys", 0, MR_FSTYPE}, |
e2b8245f | 2348 | {V_ID, 3, MACHINE_TABLE, "name", "mach_id", MR_MACHINE}, |
2349 | {V_CHAR, 4, FILESYS_TABLE, "name"}, | |
03c05291 | 2350 | {V_LEN, 5, FILESYS_TABLE, "mount"}, |
f802fd0d | 2351 | {V_LEN, 6, FILESYS_TABLE, "rwaccess"}, |
e2b8245f | 2352 | {V_LEN, 7, FILESYS_TABLE, "comments"}, |
2353 | {V_ID, 8, USERS_TABLE, "login", "users_id", MR_USER}, | |
2354 | {V_ID, 9, LIST_TABLE, "name", "list_id", MR_LIST}, | |
f802fd0d | 2355 | {V_NUM, 10}, |
03c05291 | 2356 | {V_TYPE, 11, 0, "lockertype", 0, MR_TYPE}, |
d33e787c | 2357 | }; |
2358 | ||
03c05291 | 2359 | static struct validate ufil_validate = { |
2360 | ufil_valobj, | |
d1b3a4bf | 2361 | 12, |
e2b8245f | 2362 | "label", |
03c05291 | 2363 | "filsys_id = %d", |
2364 | 1, | |
e2b8245f | 2365 | "filsys_id", |
d33e787c | 2366 | 0, |
03c05291 | 2367 | setup_ufil, |
2368 | set_filesys_modtime, | |
d33e787c | 2369 | }; |
2370 | ||
03c05291 | 2371 | static char *dfil_fields[] = { |
e2b8245f | 2372 | "label", |
03c05291 | 2373 | }; |
2374 | ||
03c05291 | 2375 | static struct validate dfil_validate = { |
d1b3a4bf | 2376 | VOfilesys0, |
2377 | 1, | |
03c05291 | 2378 | "label", |
2379 | "filsys_id = %d", | |
2380 | 1, | |
d33e787c | 2381 | 0, |
2382 | 0, | |
03c05291 | 2383 | setup_dfil, |
2384 | 0, | |
d33e787c | 2385 | }; |
2386 | ||
03c05291 | 2387 | static char *gfgm_fields[] = { |
e2b8245f | 2388 | "fsgroup", "filesys", "sortkey" |
5eaef520 | 2389 | }; |
03c05291 | 2390 | |
03c05291 | 2391 | static struct validate gfgm_validate = { |
d1b3a4bf | 2392 | VOfilesys0, |
29028043 | 2393 | 1, |
d33e787c | 2394 | 0, |
2395 | 0, | |
2396 | 0, | |
2397 | 0, | |
2398 | 0, | |
2399 | 0, | |
d33e787c | 2400 | 0, |
d33e787c | 2401 | }; |
2402 | ||
03c05291 | 2403 | static struct valobj aftg_valobj[] = { |
e2b8245f | 2404 | {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS}, |
2405 | {V_ID, 1, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS}, | |
d33e787c | 2406 | }; |
2407 | ||
03c05291 | 2408 | static struct validate aftg_validate = { |
2409 | aftg_valobj, | |
d1b3a4bf | 2410 | 2, |
03c05291 | 2411 | "group_id", |
2412 | "group_id = %d and filsys_id = %d", | |
2413 | 2, | |
2414 | 0, | |
2415 | 0, | |
2416 | 0, | |
d33e787c | 2417 | 0, |
d33e787c | 2418 | }; |
2419 | ||
03c05291 | 2420 | static char *ganf_fields[] = { |
8db06f75 | 2421 | "machine", "dir", "device", "status", "allocated", "size", |
2422 | "modtime", "modby", "modwith", | |
d33e787c | 2423 | }; |
2424 | ||
03c05291 | 2425 | static char *gnfp_fields[] = { |
e2b8245f | 2426 | "machine", "dir", |
8db06f75 | 2427 | "machine", "dir", "device", "status", "allocated", "size", |
2428 | "modtime", "modby", "modwith", | |
d33e787c | 2429 | }; |
2430 | ||
03c05291 | 2431 | static struct validate gnfp_validate = { |
263a36d4 | 2432 | VOmach0, |
2433 | 1, | |
03c05291 | 2434 | 0, |
2435 | 0, | |
2436 | 0, | |
2437 | 0, | |
2438 | 0, | |
2439 | 0, | |
2440 | followup_fix_modby, | |
d33e787c | 2441 | }; |
2442 | ||
03c05291 | 2443 | static struct valobj anfp_valobj[] = { |
e2b8245f | 2444 | {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE}, |
03c05291 | 2445 | {V_CHAR, 1, NFSPHYS_TABLE, "dir"}, |
2446 | {V_LEN, 2, NFSPHYS_TABLE, "device"}, | |
f802fd0d | 2447 | {V_NUM, 3}, |
2448 | {V_NUM, 4}, | |
2449 | {V_NUM, 5}, | |
03c05291 | 2450 | }; |
2451 | ||
2452 | static struct validate anfp_validate = { | |
2453 | anfp_valobj, | |
d1b3a4bf | 2454 | 6, |
e2b8245f | 2455 | "dir", |
03c05291 | 2456 | "mach_id = %d and dir = '%s'", |
2457 | 2, | |
2458 | "nfsphys_id", | |
d33e787c | 2459 | 0, |
03c05291 | 2460 | prefetch_value, |
2461 | set_nfsphys_modtime, | |
2462 | }; | |
2463 | ||
2464 | static struct validate unfp_validate = { | |
2465 | anfp_valobj, | |
d1b3a4bf | 2466 | 6, |
e2b8245f | 2467 | "dir", |
03c05291 | 2468 | "mach_id = %d and dir = '%s'", |
2469 | 2, | |
2470 | "nfsphys_id", | |
d33e787c | 2471 | 0, |
03c05291 | 2472 | 0, |
2473 | set_nfsphys_modtime, | |
d33e787c | 2474 | }; |
2475 | ||
03c05291 | 2476 | static char *ajnf_fields[] = { |
e2b8245f | 2477 | "machine", "dir", "adjustment", |
d33e787c | 2478 | }; |
2479 | ||
f802fd0d | 2480 | static struct valobj ajnf_valobj[] = { |
f802fd0d | 2481 | {V_ID, 0, MACHINE_TABLE, NAME, "mach_id", MR_MACHINE}, |
2482 | {V_CHAR, 1, NFSPHYS_TABLE, "dir"}, | |
2483 | {V_NUM, 2}, | |
2484 | }; | |
2485 | ||
2486 | static struct validate ajnf_validate = { | |
2487 | ajnf_valobj, | |
d1b3a4bf | 2488 | 3, |
f802fd0d | 2489 | "dir", |
2490 | "mach_id = %d and dir = '%s'", | |
2491 | 2, | |
2492 | "nfsphys_id", | |
2493 | 0, | |
2494 | 0, | |
2495 | set_nfsphys_modtime, | |
2496 | }; | |
2497 | ||
03c05291 | 2498 | static char *dnfp_fields[] = { |
e2b8245f | 2499 | "machine", "dir", |
d33e787c | 2500 | }; |
2501 | ||
03c05291 | 2502 | static struct validate dnfp_validate = { |
d1b3a4bf | 2503 | anfp_valobj, |
2504 | 2, | |
e2b8245f | 2505 | "dir", |
03c05291 | 2506 | "mach_id = %d and dir = '%s'", |
2507 | 2, | |
2508 | "nfsphys_id", | |
66f4a35b | 2509 | 0, |
03c05291 | 2510 | setup_dnfp, |
2511 | set_nfsphys_modtime, | |
2512 | }; | |
2513 | ||
2514 | static char *gqot_fields[] = { | |
e2b8245f | 2515 | "filesys", "type", "name", |
8db06f75 | 2516 | "filesys", "type", "name", "quota", "dir", "machine", |
2517 | "modtime", "modby", "modwith", | |
66f4a35b | 2518 | }; |
2519 | ||
03c05291 | 2520 | static struct valobj gqot_valobj[] = { |
e2b8245f | 2521 | {V_TYPE, 1, 0, "quota_type", 0, MR_TYPE}, |
03c05291 | 2522 | {V_TYPEDATA, 2, 0, 0, 0, MR_ACE}, |
03c05291 | 2523 | }; |
2524 | ||
2525 | static struct validate gqot_validate = { | |
2526 | gqot_valobj, | |
263a36d4 | 2527 | 2, |
66f4a35b | 2528 | 0, |
2529 | 0, | |
2530 | 0, | |
d33e787c | 2531 | 0, |
d33e787c | 2532 | 0, |
03c05291 | 2533 | 0, |
2534 | followup_gqot, | |
d33e787c | 2535 | }; |
2536 | ||
03c05291 | 2537 | static char *gqbf_fields[] = { |
e2b8245f | 2538 | "filesys", |
8db06f75 | 2539 | "filesys", "type", "name", "quota", "dir", "machine", |
2540 | "modtime", "modby", "modwith", | |
d33e787c | 2541 | }; |
2542 | ||
03c05291 | 2543 | static struct validate gqbf_validate = { |
263a36d4 | 2544 | 0, |
2545 | 0, | |
0c345c78 | 2546 | 0, |
2547 | 0, | |
2548 | 0, | |
2549 | 0, | |
03c05291 | 2550 | access_filesys, |
0c345c78 | 2551 | 0, |
03c05291 | 2552 | followup_gqot, |
d33e787c | 2553 | }; |
2554 | ||
03c05291 | 2555 | static char *aqot_fields[] = { |
e2b8245f | 2556 | "filesys", "type", "name", "quota", |
d33e787c | 2557 | }; |
2558 | ||
03c05291 | 2559 | static struct valobj aqot_valobj[] = { |
e2b8245f | 2560 | {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS}, |
2561 | {V_TYPE, 1, 0, "quota_type", 0, MR_TYPE}, | |
03c05291 | 2562 | {V_TYPEDATA, 2, 0, 0, 0, MR_ACE}, |
f802fd0d | 2563 | {V_NUM, 3}, |
d33e787c | 2564 | }; |
2565 | ||
03c05291 | 2566 | static struct validate aqot_validate = { |
2567 | aqot_valobj, | |
d1b3a4bf | 2568 | 4, |
e2b8245f | 2569 | "filsys_id", |
03c05291 | 2570 | "filsys_id = %d and type = '%s' and entity_id = %d", |
2571 | 3, | |
0c345c78 | 2572 | 0, |
2573 | 0, | |
03c05291 | 2574 | prefetch_filesys, |
2575 | followup_aqot, | |
2576 | }; | |
2577 | ||
2578 | static struct validate uqot_validate = { | |
2579 | aqot_valobj, | |
d1b3a4bf | 2580 | 4, |
e2b8245f | 2581 | "filsys_id", |
03c05291 | 2582 | "filsys_id = %d AND type = '%s' AND entity_id = %d", |
2583 | 3, | |
2584 | 0, | |
0c345c78 | 2585 | 0, |
03c05291 | 2586 | setup_dqot, |
2587 | followup_aqot, | |
2588 | }; | |
2589 | ||
2590 | static struct validate dqot_validate = { | |
2591 | aqot_valobj, | |
d1b3a4bf | 2592 | 3, |
e2b8245f | 2593 | "filsys_id", |
03c05291 | 2594 | "filsys_id = %d AND type = '%s' AND entity_id = %d", |
2595 | 3, | |
0c345c78 | 2596 | 0, |
0c345c78 | 2597 | 0, |
03c05291 | 2598 | setup_dqot, |
2599 | followup_dqot, | |
d33e787c | 2600 | }; |
2601 | ||
03c05291 | 2602 | static char *gnfq_fields[] = { |
e2b8245f | 2603 | "filesys", "login", |
8db06f75 | 2604 | "filesys", "login", "quota", "dir", "machine", |
2605 | "modtime", "modby", "modwith", | |
d33e787c | 2606 | }; |
2607 | ||
03c05291 | 2608 | static struct validate gnfq_validate = { |
263a36d4 | 2609 | 0, |
2610 | 0, | |
d33e787c | 2611 | 0, |
2612 | 0, | |
2613 | 0, | |
2614 | 0, | |
03c05291 | 2615 | access_filesys, |
d33e787c | 2616 | 0, |
03c05291 | 2617 | followup_gqot, |
d33e787c | 2618 | }; |
2619 | ||
03c05291 | 2620 | static char *gnqp_fields[] = { |
e2b8245f | 2621 | "machine", "dir", |
8db06f75 | 2622 | "filesys", "login", "quota", "dir", "machine", |
2623 | "modtime", "modby", "modwith", | |
4ffa124a | 2624 | }; |
0c345c78 | 2625 | |
03c05291 | 2626 | static char *anfq_fields[] = { |
e2b8245f | 2627 | "filesys", "login", "quota", |
d33e787c | 2628 | }; |
2629 | ||
f802fd0d | 2630 | static struct valobj anfq_valobj[] = { |
f802fd0d | 2631 | {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS}, |
2632 | {V_ID, 1, USERS_TABLE, "login", "users_id", MR_USER}, | |
2633 | {V_NUM, 2}, | |
2634 | }; | |
2635 | ||
03c05291 | 2636 | static struct validate anfq_validate = { |
f802fd0d | 2637 | anfq_valobj, |
d1b3a4bf | 2638 | 3, |
e2b8245f | 2639 | "filsys_id", |
03c05291 | 2640 | "filsys_id = %d AND type = 'USER' AND entity_id = %d", |
2641 | 2, | |
2642 | 0, /* object ? */ | |
d33e787c | 2643 | 0, |
03c05291 | 2644 | prefetch_filesys, |
2645 | followup_aqot, | |
d33e787c | 2646 | }; |
2647 | ||
03c05291 | 2648 | static struct validate unfq_validate = { |
f802fd0d | 2649 | anfq_valobj, |
d1b3a4bf | 2650 | 3, |
e2b8245f | 2651 | "filsys_id", |
03c05291 | 2652 | "filsys_id = %d AND type = 'USER' AND entity_id = %d", |
2653 | 2, | |
d33e787c | 2654 | 0, |
2655 | 0, | |
03c05291 | 2656 | setup_dqot, |
2657 | followup_aqot, | |
2658 | }; | |
2659 | ||
2660 | static struct validate dnfq_validate = { | |
f802fd0d | 2661 | anfq_valobj, |
d1b3a4bf | 2662 | 3, |
e2b8245f | 2663 | "filsys_id", |
03c05291 | 2664 | "filsys_id = %d AND entity_id = %d", |
2665 | 2, | |
d33e787c | 2666 | 0, |
d33e787c | 2667 | 0, |
03c05291 | 2668 | setup_dqot, |
2669 | followup_dqot, | |
d33e787c | 2670 | }; |
2671 | ||
d7ddc011 | 2672 | static char *gzcl2_fields[] = { |
e2b8245f | 2673 | "class", |
2674 | "class", "xmt_type", "xmt_name", "sub_type", "sub_name", | |
8db06f75 | 2675 | "iws_type", "iws_name", "iui_type", "iui_name", |
2676 | "modtime", "modby", "modwith", | |
d33e787c | 2677 | }; |
2678 | ||
d7ddc011 | 2679 | static char *gzcl_fields[] = { |
2680 | "class", | |
2681 | "class", "xmt_type", "xmt_name", "sub_type", "sub_name", | |
2682 | "iws_type", "iws_name", "iui_type", "iui_name", "owner_type", | |
2683 | "owner_id", "modtime", "modby", "modwith", | |
2684 | }; | |
2685 | ||
d33e787c | 2686 | static struct validate gzcl_validate = { |
263a36d4 | 2687 | 0, |
2688 | 0, | |
d33e787c | 2689 | 0, |
2690 | 0, | |
2691 | 0, | |
2692 | 0, | |
d7ddc011 | 2693 | access_zephyr, |
d33e787c | 2694 | 0, |
2695 | followup_gzcl, | |
2696 | }; | |
2697 | ||
d7ddc011 | 2698 | static char *azcl2_fields[] = { |
e2b8245f | 2699 | "class", "xmt_type", "xmt_name", "sub_type", "sub_name", |
0c345c78 | 2700 | "iws_type", "iws_name", "iui_type", "iui_name", |
d7ddc011 | 2701 | }; |
2702 | ||
2703 | static struct valobj azcl2_valobj[] = { | |
2704 | {V_CHAR, 0, ZEPHYR_TABLE, "class"}, | |
2705 | {V_TYPE, 1, 0, "zace_type", 0, MR_ACE}, | |
2706 | {V_TYPEDATA, 2, 0, 0, "list_id", MR_ACE}, | |
2707 | {V_TYPE, 3, 0, "zace_type", 0, MR_ACE}, | |
2708 | {V_TYPEDATA, 4, 0, 0, "list_id", MR_ACE}, | |
2709 | {V_TYPE, 5, 0, "zace_type", 0, MR_ACE}, | |
2710 | {V_TYPEDATA, 6, 0, 0, "list_id", MR_ACE}, | |
2711 | {V_TYPE, 7, 0, "zace_type", 0, MR_ACE}, | |
2712 | {V_TYPEDATA, 8, 0, 0, "list_id", MR_ACE}, | |
2713 | }; | |
2714 | ||
2715 | static struct validate azcl2_validate = { | |
2716 | azcl2_valobj, | |
2717 | 9, | |
2718 | "class", | |
2719 | "class = '%s'", | |
2720 | 1, | |
2721 | 0, | |
2722 | 0, | |
2723 | 0, | |
2724 | set_zephyr_modtime, | |
2725 | }; | |
2726 | ||
2727 | static char *azcl_fields[] = { | |
2728 | "class", "xmt_type", "xmt_name", "sub_type", "sub_name", | |
2729 | "iws_type", "iws_name", "iui_type", "iui_name", "owner_type", | |
2730 | "owner_id", | |
d33e787c | 2731 | }; |
2732 | ||
2733 | static struct valobj azcl_valobj[] = { | |
e2b8245f | 2734 | {V_CHAR, 0, ZEPHYR_TABLE, "class"}, |
46b6f1f6 | 2735 | {V_TYPE, 1, 0, "zace_type", 0, MR_ACE}, |
e2b8245f | 2736 | {V_TYPEDATA, 2, 0, 0, "list_id", MR_ACE}, |
46b6f1f6 | 2737 | {V_TYPE, 3, 0, "zace_type", 0, MR_ACE}, |
e2b8245f | 2738 | {V_TYPEDATA, 4, 0, 0, "list_id", MR_ACE}, |
46b6f1f6 | 2739 | {V_TYPE, 5, 0, "zace_type", 0, MR_ACE}, |
e2b8245f | 2740 | {V_TYPEDATA, 6, 0, 0, "list_id", MR_ACE}, |
46b6f1f6 | 2741 | {V_TYPE, 7, 0, "zace_type", 0, MR_ACE}, |
e2b8245f | 2742 | {V_TYPEDATA, 8, 0, 0, "list_id", MR_ACE}, |
d7ddc011 | 2743 | {V_TYPE, 9, 0, "ace_type", 0, MR_ACE}, |
2744 | {V_TYPEDATA, 10, 0, 0, "list_id", MR_ACE}, | |
d33e787c | 2745 | }; |
2746 | ||
2747 | static struct validate azcl_validate = { | |
2748 | azcl_valobj, | |
d7ddc011 | 2749 | 11, |
e2b8245f | 2750 | "class", |
03c05291 | 2751 | "class = '%s'", |
d33e787c | 2752 | 1, |
2753 | 0, | |
2754 | 0, | |
2755 | 0, | |
2756 | set_zephyr_modtime, | |
2757 | }; | |
2758 | ||
d7ddc011 | 2759 | static char *uzcl2_fields[] = { |
e2b8245f | 2760 | "class", "newclass", "xmt_type", "xmt_name", "sub_type", "sub_name", |
0c345c78 | 2761 | "iws_type", "iws_name", "iui_type", "iui_name", |
d33e787c | 2762 | }; |
2763 | ||
d7ddc011 | 2764 | static struct valobj uzcl2_valobj[] = { |
2765 | {V_NAME, 0, ZEPHYR_TABLE, "class", 0, MR_BAD_CLASS}, | |
2766 | {V_RENAME, 1, ZEPHYR_TABLE, "class", 0, MR_NOT_UNIQUE}, | |
2767 | {V_TYPE, 2, 0, "zace_type", 0, MR_ACE}, | |
2768 | {V_TYPEDATA, 3, 0, 0, "list_id", MR_ACE}, | |
2769 | {V_TYPE, 4, 0, "zace_type", 0, MR_ACE}, | |
2770 | {V_TYPEDATA, 5, 0, 0, "list_id", MR_ACE}, | |
2771 | {V_TYPE, 6, 0, "zace_type", 0, MR_ACE}, | |
2772 | {V_TYPEDATA, 7, 0, 0, "list_id", MR_ACE}, | |
2773 | {V_TYPE, 8, 0, "zace_type", 0, MR_ACE}, | |
2774 | {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE}, | |
2775 | }; | |
2776 | ||
2777 | static struct validate uzcl2_validate = { | |
2778 | uzcl2_valobj, | |
2779 | 10, | |
2780 | "class", | |
2781 | "class = '%s'", | |
2782 | 1, | |
2783 | 0, | |
2784 | access_zephyr, | |
2785 | 0, | |
2786 | set_zephyr_modtime, | |
2787 | }; | |
2788 | ||
2789 | static char *uzcl_fields[] = { | |
2790 | "class", "newclass", "xmt_type", "xmt_name", "sub_type", "sub_name", | |
2791 | "iws_type", "iws_name", "iui_type", "iui_name", "owner_type", "owner_id", | |
2792 | }; | |
2793 | ||
d33e787c | 2794 | static struct valobj uzcl_valobj[] = { |
d1b3a4bf | 2795 | {V_NAME, 0, ZEPHYR_TABLE, "class", 0, MR_BAD_CLASS}, |
e2b8245f | 2796 | {V_RENAME, 1, ZEPHYR_TABLE, "class", 0, MR_NOT_UNIQUE}, |
46b6f1f6 | 2797 | {V_TYPE, 2, 0, "zace_type", 0, MR_ACE}, |
e2b8245f | 2798 | {V_TYPEDATA, 3, 0, 0, "list_id", MR_ACE}, |
46b6f1f6 | 2799 | {V_TYPE, 4, 0, "zace_type", 0, MR_ACE}, |
e2b8245f | 2800 | {V_TYPEDATA, 5, 0, 0, "list_id", MR_ACE}, |
46b6f1f6 | 2801 | {V_TYPE, 6, 0, "zace_type", 0, MR_ACE}, |
e2b8245f | 2802 | {V_TYPEDATA, 7, 0, 0, "list_id", MR_ACE}, |
46b6f1f6 | 2803 | {V_TYPE, 8, 0, "zace_type", 0, MR_ACE}, |
e2b8245f | 2804 | {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE}, |
d7ddc011 | 2805 | {V_TYPE, 10, 0, "ace_type", 0, MR_ACE}, |
2806 | {V_TYPEDATA, 11, 0, 0, "list_id", MR_ACE}, | |
d33e787c | 2807 | }; |
2808 | ||
2809 | static struct validate uzcl_validate = { | |
2810 | uzcl_valobj, | |
d7ddc011 | 2811 | 12, |
e2b8245f | 2812 | "class", |
3e8c655c | 2813 | "class = '%s'", |
d33e787c | 2814 | 1, |
2815 | 0, | |
d7ddc011 | 2816 | access_zephyr, |
d33e787c | 2817 | 0, |
2818 | set_zephyr_modtime, | |
2819 | }; | |
2820 | ||
2821 | static struct validate dzcl_validate = { | |
2822 | 0, | |
2823 | 0, | |
e2b8245f | 2824 | "class", |
73043086 | 2825 | "class = '%s'", |
d33e787c | 2826 | 1, |
2827 | 0, | |
2828 | 0, | |
2829 | 0, | |
2830 | 0, | |
2831 | }; | |
2832 | ||
03c05291 | 2833 | static char *gsha_fields[] = { |
e2b8245f | 2834 | "machine", |
8db06f75 | 2835 | "machine", "ace_type", "ace_name", "modtime", "modby", "modwith", |
03c05291 | 2836 | }; |
2837 | ||
5eaef520 | 2838 | static struct validate gsha_validate = |
03c05291 | 2839 | { |
263a36d4 | 2840 | 0, |
2841 | 0, | |
03c05291 | 2842 | 0, |
2843 | 0, | |
2844 | 0, | |
2845 | 0, | |
2846 | 0, | |
2847 | 0, | |
2848 | followup_gsha, | |
2849 | }; | |
2850 | ||
2851 | static char *asha_fields[] = { | |
e2b8245f | 2852 | "machine", "ace_type", "ace_name", |
03c05291 | 2853 | }; |
2854 | ||
2855 | static struct valobj asha_valobj[] = { | |
e2b8245f | 2856 | {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE}, |
e2b8245f | 2857 | {V_TYPE, 1, 0, "ace_type", 0, MR_ACE}, |
03c05291 | 2858 | {V_TYPEDATA, 2, 0, 0, 0, MR_ACE}, |
2859 | }; | |
2860 | ||
5eaef520 | 2861 | static struct validate asha_validate = |
03c05291 | 2862 | { |
2863 | asha_valobj, | |
d1b3a4bf | 2864 | 3, |
e2b8245f | 2865 | "mach_id", |
03c05291 | 2866 | "mach_id = %d", |
2867 | 1, | |
e2b8245f | 2868 | "mach_id", |
03c05291 | 2869 | 0, |
2870 | 0, | |
2871 | set_modtime_by_id, | |
2872 | }; | |
2873 | ||
46b6f1f6 | 2874 | static char *gacl_fields[] = { |
2875 | "machine", "target", | |
2876 | "machine", "target", "kind", "list", | |
2877 | }; | |
2878 | ||
2879 | static char *aacl_fields[] = { | |
2880 | "machine", "target", "kind", "list", | |
2881 | }; | |
2882 | ||
2883 | static char *dacl_fields[] = { | |
2884 | "machine", "target", | |
2885 | }; | |
2886 | ||
2887 | static struct valobj aacl_valobj[] = { | |
2888 | {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE}, | |
2889 | {V_CHAR, 1, ACL_TABLE, "target"}, | |
2890 | {V_TYPE, 2, 0, "acl_kind", 0, MR_TYPE}, | |
2891 | {V_ID, 3, LIST_TABLE, "name", "list_id", MR_LIST}, | |
2892 | }; | |
2893 | ||
2894 | static struct validate gacl_validate = | |
2895 | { | |
2896 | aacl_valobj, | |
2897 | 1, | |
2898 | NULL, | |
2899 | NULL, | |
2900 | 0, | |
2901 | "mach_id", | |
2902 | /* access_acl */ 0, | |
2903 | 0, | |
2904 | 0, | |
2905 | }; | |
2906 | ||
2907 | static struct validate aacl_validate = | |
2908 | { | |
2909 | aacl_valobj, | |
2910 | 4, | |
2911 | "mach_id", | |
2912 | "mach_id = %d AND target = '%s'", | |
2913 | 2, | |
2914 | "mach_id", | |
2915 | /* access_acl */ 0, | |
2916 | 0, | |
2917 | 0, | |
2918 | }; | |
2919 | ||
fd5b2340 | 2920 | static char *gsvc_fields[] = { |
69eb9470 | 2921 | "service", "protocol", |
8db06f75 | 2922 | "service", "protocol", "port", "description", "modtime", "modby", "modwith", |
d33e787c | 2923 | }; |
2924 | ||
fd5b2340 | 2925 | static char *asvc_fields[] = { |
e2b8245f | 2926 | "service", "protocol", "port", "description", |
fd5b2340 | 2927 | }; |
2928 | ||
69eb9470 | 2929 | static char *dsvc_fields[] = { |
2930 | "service", "protocol", | |
2931 | }; | |
2932 | ||
03c05291 | 2933 | static struct valobj asvc_valobj[] = { |
e2b8245f | 2934 | {V_CHAR, 0, SERVICES_TABLE, "name"}, |
03c05291 | 2935 | {V_CHAR, 1, SERVICES_TABLE, "protocol"}, |
f802fd0d | 2936 | {V_NUM, 2}, |
e2b8245f | 2937 | {V_CHAR, 3, SERVICES_TABLE, "description"}, |
03c05291 | 2938 | }; |
2939 | ||
fd5b2340 | 2940 | static struct validate asvc_validate = { |
03c05291 | 2941 | asvc_valobj, |
f802fd0d | 2942 | 4, |
e2b8245f | 2943 | "name", |
69eb9470 | 2944 | "name = '%s' AND protocol = '%s'", |
2945 | 2, | |
2946 | 0, | |
2947 | 0, | |
2948 | 0, | |
2949 | set_service_modtime, | |
2950 | }; | |
2951 | ||
2952 | static struct validate dsvc_validate = { | |
2953 | asvc_valobj, | |
2954 | 2, | |
2955 | "name", | |
2956 | "name = '%s' AND protocol = '%s'", | |
2957 | 2, | |
2958 | 0, | |
fd5b2340 | 2959 | 0, |
2960 | 0, | |
2961 | 0, | |
fd5b2340 | 2962 | }; |
2963 | ||
2884200f | 2964 | static char *gprn_fields[] = { |
2965 | "name", | |
2966 | "name", "type", "hwtype", "duplexname", "hostname", | |
2967 | "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl", | |
e5a63571 | 2968 | "banner", "location", "contact", "modtime", "modby", "modwith" |
d33e787c | 2969 | }; |
2970 | ||
2884200f | 2971 | static char *gpbd_fields[] = { |
2972 | "duplexname", | |
2973 | "name", "type", "hwtype", "duplexname", "hostname", | |
2974 | "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl", | |
e5a63571 | 2975 | "banner", "location", "contact", "modtime", "modby", "modwith" |
d4462d4f | 2976 | }; |
2977 | ||
2884200f | 2978 | static char *gpbe_fields[] = { |
2979 | "hwaddr", | |
2980 | "name", "type", "hwtype", "duplexname", "hostname", | |
2981 | "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl", | |
e5a63571 | 2982 | "banner", "location", "contact", "modtime", "modby", "modwith" |
fad88070 | 2983 | }; |
2984 | ||
2884200f | 2985 | static char *gpbh_fields[] = { |
2986 | "hostname", | |
2987 | "name", "type", "hwtype", "duplexname", "hostname", | |
2988 | "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl", | |
e5a63571 | 2989 | "banner", "location", "contact", "modtime", "modby", "modwith" |
d33e787c | 2990 | }; |
2991 | ||
2884200f | 2992 | static char *gpbr_fields[] = { |
2993 | "rm", | |
2994 | "name", "type", "hwtype", "duplexname", "hostname", | |
2995 | "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl", | |
e5a63571 | 2996 | "banner", "location", "contact", "modtime", "modby", "modwith" |
d33e787c | 2997 | }; |
2998 | ||
2884200f | 2999 | static char *gpbl_fields[] = { |
3000 | "location", | |
3001 | "name", "type", "hwtype", "duplexname", "hostname", | |
3002 | "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl", | |
e5a63571 | 3003 | "banner", "location", "contact", "modtime", "modby", "modwith" |
fd5b2340 | 3004 | }; |
3005 | ||
2884200f | 3006 | static char *gpbc_fields[] = { |
3007 | "contact", | |
3008 | "name", "type", "hwtype", "duplexname", "hostname", | |
3009 | "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl", | |
e5a63571 | 3010 | "banner", "location", "contact", "modtime", "modby", "modwith" |
012fc215 | 3011 | }; |
3012 | ||
2884200f | 3013 | static char *aprn_fields[] = { |
3014 | "printer", "type", "hwtype", "duplexname", "hostname", | |
3015 | "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl", | |
e5a63571 | 3016 | "banner", "location", "contact", |
03c05291 | 3017 | }; |
012fc215 | 3018 | |
2884200f | 3019 | static struct valobj aprn_valobj[] = { |
3020 | {V_CHAR, 0, PRINTERS_TABLE, "name"}, | |
3021 | {V_TYPE, 1, 0, "printertype", 0, MR_TYPE}, | |
3022 | {V_TYPE, 2, 0, "printerhwtype", 0, MR_TYPE}, | |
3023 | {V_CHAR, 3, PRINTERS_TABLE, "duplexname"}, | |
3024 | {V_ID, 4, MACHINE_TABLE, "name", "mach_id", MR_MACHINE}, | |
3025 | {V_ID, 5, MACHINE_TABLE, "name", "mach_id", MR_MACHINE}, | |
3026 | {V_ID, 6, MACHINE_TABLE, "name", "mach_id", MR_MACHINE}, | |
3027 | {V_CHAR, 7, PRINTERS_TABLE, "rp"}, | |
3028 | {V_ID, 8, MACHINE_TABLE, "name", "mach_id", MR_MACHINE}, | |
3029 | {V_NUM, 9}, | |
3030 | {V_NUM, 10}, | |
3031 | {V_ID, 11, LIST_TABLE, "name", "list_id", MR_LIST}, | |
3032 | {V_ID, 12, LIST_TABLE, "name", "list_id", MR_LIST}, | |
e5a63571 | 3033 | {V_NUM, 13}, |
3034 | {V_CHAR, 14, PRINTERS_TABLE, "location"}, | |
3035 | {V_CHAR, 15, PRINTERS_TABLE, "contact"}, | |
012fc215 | 3036 | }; |
3037 | ||
2884200f | 3038 | static struct validate aprn_validate = { |
3039 | aprn_valobj, | |
e5a63571 | 3040 | 16, |
e2b8245f | 3041 | "name", |
03c05291 | 3042 | "name = '%s'", |
012fc215 | 3043 | 1, |
3044 | 0, | |
1a9a0a59 | 3045 | access_printer, |
3046 | setup_aprn, | |
3047 | set_modtime, | |
3048 | }; | |
3049 | ||
3050 | static char *uprn_fields[] = { | |
3051 | "printer", | |
3052 | "printer", "type", "hwtype", "duplexname", "hostname", | |
3053 | "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl", | |
3054 | "banner", "location", "contact", | |
3055 | }; | |
3056 | ||
3057 | static struct valobj uprn_valobj[] = { | |
3058 | {V_CHAR, 0, PRINTERS_TABLE, "name"}, | |
3059 | {V_CHAR, 1, PRINTERS_TABLE, "name"}, | |
3060 | {V_TYPE, 2, 0, "printertype", 0, MR_TYPE}, | |
3061 | {V_TYPE, 3, 0, "printerhwtype", 0, MR_TYPE}, | |
3062 | {V_CHAR, 4, PRINTERS_TABLE, "duplexname"}, | |
3063 | {V_ID, 5, MACHINE_TABLE, "name", "mach_id", MR_MACHINE}, | |
3064 | {V_ID, 6, MACHINE_TABLE, "name", "mach_id", MR_MACHINE}, | |
3065 | {V_ID, 7, MACHINE_TABLE, "name", "mach_id", MR_MACHINE}, | |
3066 | {V_CHAR, 8, PRINTERS_TABLE, "rp"}, | |
3067 | {V_ID, 9, MACHINE_TABLE, "name", "mach_id", MR_MACHINE}, | |
3068 | {V_NUM, 10}, | |
3069 | {V_NUM, 11}, | |
3070 | {V_ID, 12, LIST_TABLE, "name", "list_id", MR_LIST}, | |
3071 | {V_ID, 13, LIST_TABLE, "name", "list_id", MR_LIST}, | |
3072 | {V_NUM, 14}, | |
3073 | {V_CHAR, 15, PRINTERS_TABLE, "location"}, | |
3074 | {V_CHAR, 16, PRINTERS_TABLE, "contact"}, | |
3075 | }; | |
3076 | ||
3077 | static struct validate uprn_validate = { | |
3078 | uprn_valobj, | |
3079 | 16, | |
3080 | "name", | |
3081 | "name = '%s'", | |
3082 | 1, | |
012fc215 | 3083 | 0, |
1a9a0a59 | 3084 | access_printer, |
2884200f | 3085 | setup_aprn, |
1a9a0a59 | 3086 | set_modtime, |
012fc215 | 3087 | }; |
3088 | ||
2884200f | 3089 | static struct validate dprn_validate = { |
012fc215 | 3090 | 0, |
3091 | 0, | |
e2b8245f | 3092 | "name", |
3e8c655c | 3093 | "name = '%s'", |
012fc215 | 3094 | 1, |
3095 | 0, | |
1a9a0a59 | 3096 | access_printer, |
3097 | 0, | |
3098 | 0, | |
3099 | }; | |
3100 | ||
3101 | static char *gpsv_fields[] = { | |
3102 | "host", | |
3103 | "host", "kind", "printer_types", "owner_type", "owner_name", | |
3104 | "lpc_acl", "modtime", "modby", "modwith" | |
3105 | }; | |
3106 | ||
3107 | static struct valobj gpsv_valobj[] = { | |
3108 | {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE}, | |
3109 | }; | |
3110 | ||
3111 | static struct validate gpsv_validate = { | |
3112 | gpsv_valobj, | |
3113 | 1, | |
3114 | 0, | |
3115 | 0, | |
3116 | 0, | |
3117 | 0, | |
3118 | 0, | |
3119 | 0, | |
3120 | followup_gpsv, | |
3121 | }; | |
3122 | ||
3123 | static char *apsv_fields[] = { | |
3124 | "host", "kind", "printer_types", "owner_type", "owner_name", "lpc_acl" | |
3125 | }; | |
3126 | ||
3127 | static struct valobj apsv_valobj[] = { | |
3128 | {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE}, | |
3129 | {V_TYPE, 1, 0, "lpd_kind", 0, MR_TYPE}, | |
3130 | {V_ID, 2, STRINGS_TABLE, "string", "string_id", MR_STRING}, | |
3131 | {V_TYPE, 3, 0, "ace_type", 0, MR_ACE}, | |
3132 | {V_TYPEDATA, 4, 0, 0, 0, MR_ACE}, | |
3133 | {V_ID, 5, LIST_TABLE, "name", "list_id", MR_LIST}, | |
3134 | }; | |
3135 | ||
3136 | static struct validate apsv_validate = { | |
3137 | apsv_valobj, | |
3138 | 6, | |
3139 | "mach_id", | |
3140 | "mach_id = %d", | |
3141 | 1, | |
3142 | "mach_id", | |
012fc215 | 3143 | 0, |
3144 | 0, | |
1a9a0a59 | 3145 | set_modtime_by_id, |
012fc215 | 3146 | }; |
3147 | ||
1a9a0a59 | 3148 | static char *dpsv_fields[] = { |
3149 | "host", | |
3150 | }; | |
3151 | ||
3152 | static struct validate dpsv_validate = { | |
3153 | gpsv_valobj, | |
3154 | 1, | |
3155 | "mach_id", | |
3156 | "mach_id = %d", | |
3157 | 1, | |
3158 | 0, | |
3159 | 0, | |
3160 | setup_dpsv, | |
3161 | 0, | |
3162 | }; | |
3163 | ||
d33e787c | 3164 | static char *gali_fields[] = { |
e2b8245f | 3165 | "name", "type", "trans", |
3166 | "name", "type", "trans", | |
d33e787c | 3167 | }; |
3168 | ||
3169 | static char *aali_fields[] = { | |
e2b8245f | 3170 | "name", "type", "trans", |
d33e787c | 3171 | }; |
3172 | ||
3173 | static struct valobj aali_valobj[] = { | |
e2b8245f | 3174 | {V_CHAR, 0, ALIAS_TABLE, "name"}, |
3175 | {V_TYPE, 1, 0, "alias", 0, MR_TYPE}, | |
03c05291 | 3176 | {V_CHAR, 2, ALIAS_TABLE, "trans"}, |
d33e787c | 3177 | }; |
3178 | ||
3179 | static struct validate aali_validate = { | |
3180 | aali_valobj, | |
3181 | 3, | |
3182 | "trans", | |
03c05291 | 3183 | "name = '%s' and type = '%s' and trans = '%s'", |
d33e787c | 3184 | 3, |
3185 | 0, | |
3186 | 0, | |
3187 | 0, | |
3188 | 0, | |
3189 | }; | |
3190 | ||
3191 | static struct validate dali_validate = /* DELETE_ALIAS */ | |
3192 | { | |
3193 | 0, | |
3194 | 0, | |
3195 | "trans", | |
73043086 | 3196 | "name = '%s' and type = '%s' and trans = '%s'", |
d33e787c | 3197 | 3, |
3198 | 0, | |
3199 | 0, | |
3200 | 0, | |
3201 | 0, | |
3202 | }; | |
3203 | ||
3204 | static char *gval_fields[] = { | |
e2b8245f | 3205 | "name", "value", |
d33e787c | 3206 | }; |
3207 | ||
3208 | static struct valobj gval_valobj[] = { | |
e2b8245f | 3209 | {V_NAME, 0, NUMVALUES_TABLE, "name", 0, MR_NO_MATCH}, |
d33e787c | 3210 | }; |
3211 | ||
3212 | static struct validate gval_validate = { | |
3213 | gval_valobj, | |
3214 | 1, | |
3215 | 0, | |
3216 | 0, | |
3217 | 0, | |
3218 | 0, | |
3219 | 0, | |
3220 | 0, | |
3221 | 0, | |
3222 | }; | |
3223 | ||
3224 | static char *aval_fields[] = { | |
e2b8245f | 3225 | "name", "value", |
d33e787c | 3226 | }; |
3227 | ||
03c05291 | 3228 | static struct valobj aval_valobj[] = { |
e2b8245f | 3229 | {V_CHAR, 0, NUMVALUES_TABLE, "name"}, |
f802fd0d | 3230 | {V_NUM, 1}, |
03c05291 | 3231 | }; |
3232 | ||
d33e787c | 3233 | static struct validate aval_validate = /* for aval, uval, and dval */ |
3234 | { | |
03c05291 | 3235 | aval_valobj, |
f802fd0d | 3236 | 2, |
e2b8245f | 3237 | "name", |
03c05291 | 3238 | "name = '%s'", |
d33e787c | 3239 | 1, |
3240 | 0, | |
3241 | 0, | |
3242 | 0, | |
3243 | 0, | |
3244 | }; | |
3245 | ||
3246 | static char *dval_fields[] = { | |
e2b8245f | 3247 | "name", |
d33e787c | 3248 | }; |
3249 | ||
3250 | static char *gats_fields[] = { | |
8db06f75 | 3251 | "table_name", "appends", "updates", "deletes", |
3252 | "modtime", "modby", "modwith", | |
d33e787c | 3253 | }; |
3254 | ||
2962e9ec | 3255 | static char *_sdl_fields[] = { |
5eaef520 | 3256 | "level", |
2962e9ec | 3257 | }; |
3258 | ||
5eaef520 | 3259 | static struct validate _sdl_validate = |
2962e9ec | 3260 | { |
f802fd0d | 3261 | VOnum0, |
3262 | 1, | |
7ac48069 | 3263 | NULL, |
3264 | NULL, | |
5eaef520 | 3265 | 0, |
3266 | 0, | |
3267 | 0, | |
3268 | 0, | |
3269 | _sdl_followup, | |
2962e9ec | 3270 | }; |
3271 | ||
ca3ca9c9 | 3272 | static char *gusl_fields[] = { |
77bf4a4d | 3273 | "login", "domain_sid", |
ca3ca9c9 | 3274 | "login", "sid", "created", |
3275 | }; | |
3276 | ||
3277 | static struct validate gusl_validate = | |
3278 | { | |
3279 | VOuser0, | |
3280 | 1, | |
3281 | NULL, | |
3282 | NULL, | |
3283 | 0, | |
3284 | 0, | |
3285 | 0, | |
3286 | 0, | |
3287 | 0, | |
3288 | }; | |
3289 | ||
3290 | static char *glsn_fields[] = { | |
77bf4a4d | 3291 | "name", "domain_sid", |
ca3ca9c9 | 3292 | "name", "sid", "created", |
3293 | }; | |
3294 | ||
3295 | static struct validate glsn_validate = | |
3296 | { | |
3297 | VOlist0, | |
3298 | 1, | |
3299 | NULL, | |
3300 | NULL, | |
3301 | 0, | |
3302 | 0, | |
3303 | 0, | |
3304 | 0, | |
3305 | 0, | |
3306 | }; | |
3307 | ||
3308 | static char *ausl_fields[] = { | |
3309 | "login", "sid", | |
3310 | }; | |
3311 | ||
3312 | static struct validate ausl_validate = | |
3313 | { | |
3314 | VOuser0, | |
3315 | 1, | |
3316 | "sid", | |
d08dccbf | 3317 | "users_id = %d AND sid = '%s'", |
3318 | 2, | |
ca3ca9c9 | 3319 | 0, |
3320 | 0, | |
3321 | 0, | |
3322 | 0, | |
3323 | }; | |
3324 | ||
3325 | static char *alsn_fields[] = { | |
3326 | "name", "sid", | |
3327 | }; | |
3328 | ||
3329 | static struct validate alsn_validate = | |
3330 | { | |
3331 | VOlist0, | |
3332 | 1, | |
3333 | "sid", | |
d08dccbf | 3334 | "list_id = %d AND sid = '%s'", |
3335 | 2, | |
ca3ca9c9 | 3336 | 0, |
3337 | 0, | |
3338 | 0, | |
3339 | 0, | |
3340 | }; | |
d33e787c | 3341 | |
77bf4a4d | 3342 | static char *gdds_fields[] = { |
3343 | "sid", | |
3344 | }; | |
3345 | ||
2fb668b0 | 3346 | static char *gcon_fields[] = { |
3347 | "name", | |
3348 | "name", "description", "location", "contact", | |
3349 | "ace_type", "ace_name", "memace_type", "memace_name", "modtime", "modby", "modwith", | |
3350 | }; | |
3351 | ||
3352 | static struct validate gcon_validate = { | |
3353 | 0, | |
3354 | 0, | |
3355 | 0, | |
3356 | 0, | |
3357 | 0, | |
3358 | 0, | |
3359 | 0, | |
3360 | 0, | |
3361 | followup_gcon, | |
3362 | }; | |
3363 | ||
3364 | static char *acon_fields[] = { | |
3365 | "name", "description", "location", "contact", | |
3366 | "ace_type", "ace_name", "memace_type", "memace_name", | |
3367 | }; | |
3368 | ||
3369 | static struct valobj acon_valobj[] = { | |
3370 | {V_CHAR, 0, CONTAINERS_TABLE, "name"}, | |
3371 | {V_LEN, 1, CONTAINERS_TABLE, "description"}, | |
3372 | {V_CHAR, 2, CONTAINERS_TABLE, "location"}, | |
3373 | {V_CHAR, 3, CONTAINERS_TABLE, "contact"}, | |
3374 | {V_TYPE, 4, 0, "ace_type", 0, MR_ACE}, | |
3375 | {V_TYPEDATA, 5, 0, 0, 0, MR_ACE}, | |
3376 | {V_TYPE, 6, 0, "ace_type", 0, MR_ACE}, | |
3377 | {V_TYPEDATA, 7, 0, 0, 0, MR_ACE}, | |
3378 | }; | |
3379 | ||
3380 | static struct validate acon_validate = | |
3381 | { | |
3382 | acon_valobj, | |
3383 | 8, | |
3384 | "name", | |
3385 | "name = '%s'", | |
3386 | 1, | |
3387 | "cnt_id", | |
3388 | 0, | |
3389 | prefetch_value, | |
3390 | set_modtime, | |
3391 | }; | |
3392 | ||
3393 | static char *ucon_fields[] = { | |
3394 | "name", | |
3395 | "newname", "description", "location", "contact", | |
3396 | "ace_type", "ace_name", "memace_type", "memace_name", | |
3397 | }; | |
3398 | ||
3399 | static struct valobj ucon_valobj[] = { | |
3400 | {V_ID, 0, CONTAINERS_TABLE, "name", "cnt_id", MR_CONTAINER}, | |
3401 | {V_RENAME, 1, CONTAINERS_TABLE, "name", "cnt_id", MR_NOT_UNIQUE}, | |
3402 | {V_LEN, 2, CONTAINERS_TABLE, "description"}, | |
3403 | {V_CHAR, 3, CONTAINERS_TABLE, "location"}, | |
3404 | {V_CHAR, 4, CONTAINERS_TABLE, "contact"}, | |
3405 | {V_TYPE, 5, 0, "ace_type", 0, MR_ACE}, | |
3406 | {V_TYPEDATA, 6, 0, 0, 0, MR_ACE}, | |
3407 | {V_TYPE, 7, 0, "ace_type", 0, MR_ACE}, | |
3408 | {V_TYPEDATA, 8, 0, 0, 0, MR_ACE}, | |
3409 | }; | |
3410 | ||
3411 | static struct validate ucon_validate = | |
3412 | { | |
3413 | ucon_valobj, | |
3414 | 9, | |
3415 | 0, | |
3416 | 0, | |
3417 | 0, | |
3418 | 0, | |
3419 | access_container, | |
3420 | 0, | |
3421 | update_container, | |
3422 | }; | |
3423 | ||
3424 | static char *dcon_fields[] = { | |
3425 | "name", | |
3426 | }; | |
3427 | ||
3428 | static struct validate dcon_validate = | |
3429 | { | |
3430 | VOcon0, | |
3431 | 1, | |
3432 | 0, | |
3433 | 0, | |
3434 | 0, | |
3435 | 0, | |
3436 | 0, | |
3437 | setup_dcon, | |
3438 | 0, | |
3439 | }; | |
3440 | ||
3441 | static char *amcn_fields[] = { | |
3442 | "machine", "container", | |
3443 | }; | |
3444 | ||
3445 | static struct valobj amcn_valobj[] = /* ADD_MACHINE_TO_CONTAINER */ | |
3446 | { /* DELETE_MACHINE_FROM_CONTAINER */ | |
3447 | {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE}, | |
3448 | {V_ID, 1, CONTAINERS_TABLE, "name", "cnt_id", MR_CONTAINER}, | |
3449 | }; | |
3450 | ||
3451 | static struct validate amcn_validate = /* for amtn and dmfn */ | |
d16a0628 | 3452 | { |
3453 | amcn_valobj, | |
3454 | 2, | |
3455 | "mach_id", | |
3456 | "mach_id = %d", | |
3457 | 1, | |
3458 | 0, | |
3459 | access_container, | |
3460 | 0, | |
3461 | set_mach_modtime_by_id, | |
3462 | }; | |
3463 | ||
3464 | static struct validate dmcn_validate = /* for amtn and dmfn */ | |
2fb668b0 | 3465 | { |
3466 | amcn_valobj, | |
3467 | 2, | |
3468 | "mach_id", | |
3469 | "mach_id = %d and cnt_id = %d", | |
3470 | 2, | |
3471 | 0, | |
3472 | access_container, | |
3473 | 0, | |
3474 | set_mach_modtime_by_id, | |
3475 | }; | |
3476 | ||
7807f2e6 | 3477 | static char *gmnm_fields[] = { |
3478 | "machine", | |
3479 | "machine", "container", | |
3480 | }; | |
3481 | ||
2fb668b0 | 3482 | static char *gmoc_fields[] = { |
3483 | "container", | |
3484 | "isrecursive", | |
3485 | "machine", | |
3486 | "container", | |
3487 | }; | |
3488 | ||
3489 | static struct validate gmoc_validate = | |
3490 | { | |
3491 | VOcon0, | |
3492 | 1, | |
3493 | 0, | |
3494 | 0, | |
3495 | 0, | |
3496 | 0, | |
3497 | 0, | |
3498 | 0, | |
3499 | get_machines_of_container, | |
3500 | }; | |
3501 | ||
3502 | static char *gsoc_fields[] = { | |
3503 | "container", | |
3504 | "isrecursive", | |
3505 | "subcontainer", | |
3506 | }; | |
3507 | ||
3508 | static struct validate gsoc_validate = | |
3509 | { | |
3510 | VOcon0, | |
3511 | 1, | |
3512 | 0, | |
3513 | 0, | |
3514 | 0, | |
3515 | 0, | |
3516 | 0, | |
3517 | 0, | |
3518 | get_subcontainers_of_container, | |
3519 | }; | |
3520 | ||
0ef13dc2 | 3521 | static char *gtlc_fields[] = { |
3522 | "name", | |
3523 | }; | |
3524 | ||
3525 | ||
d33e787c | 3526 | /* Generalized Query Definitions */ |
3527 | ||
c44ddfa7 | 3528 | /* Multiple versions of the same query MUST be listed in ascending |
3529 | * order. | |
3530 | */ | |
3531 | ||
e41960ac | 3532 | /* Note: For any query which uses prefetch_value, the vcnt should be |
3533 | * one less than the number of %-format specifiers in the tlist. | |
3534 | */ | |
3535 | ||
c44ddfa7 | 3536 | struct query Queries[] = { |
d33e787c | 3537 | { |
186dd63b | 3538 | /* Q_GALO - GET_ALL_LOGINS, v2 */ |
d33e787c | 3539 | "get_all_logins", |
3540 | "galo", | |
c44ddfa7 | 3541 | 2, |
d33e787c | 3542 | RETRIEVE, |
3543 | "u", | |
03c05291 | 3544 | USERS_TABLE, |
3545 | "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle FROM users u", | |
186dd63b | 3546 | galo2_fields, |
d33e787c | 3547 | 6, |
0c345c78 | 3548 | "u.users_id != 0", |
d33e787c | 3549 | 0, |
29028043 | 3550 | "u.login", |
3551 | 0, | |
d33e787c | 3552 | }, |
5eaef520 | 3553 | |
d33e787c | 3554 | { |
186dd63b | 3555 | /* Q_GALO - GET_ALL_LOGINS, v3 */ |
3556 | "get_all_logins", | |
3557 | "galo", | |
3558 | 3, | |
3559 | RETRIEVE, | |
3560 | "u", | |
3561 | USERS_TABLE, | |
3562 | "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle FROM users u", | |
3563 | galo_fields, | |
3564 | 7, | |
3565 | "u.users_id != 0", | |
3566 | 0, | |
3567 | "u.login", | |
3568 | 0, | |
3569 | }, | |
3570 | ||
3571 | { | |
3572 | /* Q_GAAL - GET_ALL_ACTIVE_LOGINS, v2 */ | |
d33e787c | 3573 | "get_all_active_logins", |
3574 | "gaal", | |
c44ddfa7 | 3575 | 2, |
d33e787c | 3576 | RETRIEVE, |
3577 | "u", | |
03c05291 | 3578 | USERS_TABLE, |
3579 | "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle FROM users u", | |
186dd63b | 3580 | galo2_fields, |
d33e787c | 3581 | 6, |
0c345c78 | 3582 | "u.status = 1", |
d33e787c | 3583 | 0, |
29028043 | 3584 | "u.login", |
3585 | 0, | |
d33e787c | 3586 | }, |
5eaef520 | 3587 | |
4ffa124a | 3588 | { |
186dd63b | 3589 | /* Q_GAAL - GET_ALL_ACTIVE_LOGINS, v3 */ |
3590 | "get_all_active_logins", | |
3591 | "gaal", | |
3592 | 3, | |
3593 | RETRIEVE, | |
3594 | "u", | |
3595 | USERS_TABLE, | |
3596 | "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle FROM users u", | |
3597 | galo_fields, | |
3598 | 7, | |
3599 | "u.status = 1", | |
3600 | 0, | |
3601 | "u.login", | |
3602 | 0, | |
3603 | }, | |
3604 | ||
3605 | { | |
3606 | /* Q_GUAL - GET_USER_ACCOUNT_BY_LOGIN, v2 */ | |
0c345c78 | 3607 | "get_user_account_by_login", |
3608 | "gual", | |
c44ddfa7 | 3609 | 2, |
0c345c78 | 3610 | RETRIEVE, |
3611 | "u", | |
03c05291 | 3612 | USERS_TABLE, |
d55429b2 | 3613 | "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str", |
186dd63b | 3614 | gual2_fields, |
0c345c78 | 3615 | 15, |
263a36d4 | 3616 | "u.login LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id", |
0c345c78 | 3617 | 1, |
29028043 | 3618 | "u.login", |
9db6a21e | 3619 | &gubl2_validate, |
4ffa124a | 3620 | }, |
5eaef520 | 3621 | |
4ffa124a | 3622 | { |
186dd63b | 3623 | /* Q_GUAL - GET_USER_ACCOUNT_BY_LOGIN, v3 */ |
3624 | "get_user_account_by_login", | |
3625 | "gual", | |
3626 | 3, | |
3627 | RETRIEVE, | |
3628 | "u", | |
3629 | USERS_TABLE, | |
3b634eb3 | 3630 | "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str", |
186dd63b | 3631 | gual_fields, |
3b634eb3 | 3632 | 18, |
186dd63b | 3633 | "u.login LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id", |
3634 | 1, | |
3635 | "u.login", | |
3636 | &gubl_validate, | |
3637 | }, | |
3638 | ||
3639 | { | |
3640 | /* Q_GUAU - GET_USER_ACCOUNT_BY_UID, v2 */ | |
0c345c78 | 3641 | "get_user_account_by_uid", |
3642 | "guau", | |
c44ddfa7 | 3643 | 2, |
0c345c78 | 3644 | RETRIEVE, |
3645 | "u", | |
03c05291 | 3646 | USERS_TABLE, |
d55429b2 | 3647 | "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str", |
186dd63b | 3648 | guau2_fields, |
0c345c78 | 3649 | 15, |
03c05291 | 3650 | "u.unix_uid = %s AND u.users_id != 0 AND u.comments = str.string_id", |
0c345c78 | 3651 | 1, |
29028043 | 3652 | "u.login", |
9db6a21e | 3653 | &gubu2_validate, |
4ffa124a | 3654 | }, |
5eaef520 | 3655 | |
4ffa124a | 3656 | { |
186dd63b | 3657 | /* Q_GUAU - GET_USER_ACCOUNT_BY_UID, v3 */ |
3658 | "get_user_account_by_uid", | |
3659 | "guau", | |
3660 | 3, | |
3661 | RETRIEVE, | |
3662 | "u", | |
3663 | USERS_TABLE, | |
3b634eb3 | 3664 | "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str", |
186dd63b | 3665 | guau_fields, |
3b634eb3 | 3666 | 18, |
186dd63b | 3667 | "u.unix_uid = %s AND u.users_id != 0 AND u.comments = str.string_id", |
3668 | 1, | |
3669 | "u.login", | |
3670 | &gubu_validate, | |
3671 | }, | |
3672 | ||
3673 | { | |
3674 | /* Q_GUAN - GET_USER_ACCOUNT_BY_NAME, v2 */ | |
0c345c78 | 3675 | "get_user_account_by_name", |
3676 | "guan", | |
c44ddfa7 | 3677 | 2, |
0c345c78 | 3678 | RETRIEVE, |
3679 | "u", | |
03c05291 | 3680 | USERS_TABLE, |
d55429b2 | 3681 | "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str", |
186dd63b | 3682 | guan2_fields, |
0c345c78 | 3683 | 15, |
263a36d4 | 3684 | "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0 and u.comments = str.string_id", |
0c345c78 | 3685 | 2, |
29028043 | 3686 | "u.login", |
9db6a21e | 3687 | &guan2_validate, |
4ffa124a | 3688 | }, |
5eaef520 | 3689 | |
4ffa124a | 3690 | { |
186dd63b | 3691 | /* Q_GUAN - GET_USER_ACCOUNT_BY_NAME, v3 */ |
3692 | "get_user_account_by_name", | |
3693 | "guan", | |
3694 | 3, | |
3695 | RETRIEVE, | |
3696 | "u", | |
3697 | USERS_TABLE, | |
3b634eb3 | 3698 | "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str", |
186dd63b | 3699 | guan_fields, |
3b634eb3 | 3700 | 18, |
186dd63b | 3701 | "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0 and u.comments = str.string_id", |
3702 | 2, | |
3703 | "u.login", | |
3704 | &guan_validate, | |
3705 | }, | |
3706 | ||
3707 | { | |
3708 | /* Q_GUAC - GET_USER_ACCOUNT_BY_CLASS, v2 */ | |
0c345c78 | 3709 | "get_user_account_by_class", |
3710 | "guac", | |
c44ddfa7 | 3711 | 2, |
0c345c78 | 3712 | RETRIEVE, |
3713 | "u", | |
03c05291 | 3714 | USERS_TABLE, |
d55429b2 | 3715 | "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str", |
186dd63b | 3716 | guac2_fields, |
0c345c78 | 3717 | 15, |
03c05291 | 3718 | "u.type = UPPER('%s') AND u.users_id != 0 AND u.comments = str.string_id", |
0c345c78 | 3719 | 1, |
29028043 | 3720 | "u.login", |
3721 | &VDfix_modby, | |
4ffa124a | 3722 | }, |
5eaef520 | 3723 | |
4ffa124a | 3724 | { |
186dd63b | 3725 | /* Q_GUAC - GET_USER_ACCOUNT_BY_CLASS, v3 */ |
3726 | "get_user_account_by_class", | |
3727 | "guac", | |
3728 | 3, | |
3729 | RETRIEVE, | |
3730 | "u", | |
3731 | USERS_TABLE, | |
3b634eb3 | 3732 | "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str", |
186dd63b | 3733 | guac_fields, |
3b634eb3 | 3734 | 18, |
186dd63b | 3735 | "u.type = UPPER('%s') AND u.users_id != 0 AND u.comments = str.string_id", |
3736 | 1, | |
3737 | "u.login", | |
9db6a21e | 3738 | &guan_validate, |
186dd63b | 3739 | }, |
3740 | ||
3741 | { | |
3742 | /* Q_GUAM - GET_USER_ACCOUNT_BY_MITID, v2 */ | |
0c345c78 | 3743 | "get_user_account_by_id", |
3744 | "guai", | |
c44ddfa7 | 3745 | 2, |
0c345c78 | 3746 | RETRIEVE, |
3747 | "u", | |
03c05291 | 3748 | USERS_TABLE, |
d55429b2 | 3749 | "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str", |
186dd63b | 3750 | guam2_fields, |
0c345c78 | 3751 | 15, |
263a36d4 | 3752 | "u.clearid LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id", |
0c345c78 | 3753 | 1, |
29028043 | 3754 | "u.login", |
263a36d4 | 3755 | &VDfix_modby, |
4ffa124a | 3756 | }, |
5eaef520 | 3757 | |
d33e787c | 3758 | { |
186dd63b | 3759 | /* Q_GUAM - GET_USER_ACCOUNT_BY_MITID, v3 */ |
3760 | "get_user_account_by_id", | |
3761 | "guai", | |
3762 | 3, | |
3763 | RETRIEVE, | |
3764 | "u", | |
3765 | USERS_TABLE, | |
3b634eb3 | 3766 | "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str", |
186dd63b | 3767 | guam_fields, |
3b634eb3 | 3768 | 18, |
186dd63b | 3769 | "u.clearid LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id", |
3770 | 1, | |
3771 | "u.login", | |
9db6a21e | 3772 | &guan_validate, |
186dd63b | 3773 | }, |
3774 | ||
3775 | { | |
3776 | /* Q_GUBL - GET_USER_BY_LOGIN, v2 */ | |
d33e787c | 3777 | "get_user_by_login", |
3778 | "gubl", | |
c44ddfa7 | 3779 | 2, |
d33e787c | 3780 | RETRIEVE, |
3781 | "u", | |
5eaef520 | 3782 | USERS_TABLE, |
03c05291 | 3783 | "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", |
186dd63b | 3784 | gubl2_fields, |
d33e787c | 3785 | 12, |
263a36d4 | 3786 | "u.login LIKE '%s' AND u.users_id != 0", |
d33e787c | 3787 | 1, |
29028043 | 3788 | "u.login", |
9db6a21e | 3789 | &gubl2_validate, |
d33e787c | 3790 | }, |
5eaef520 | 3791 | |
d33e787c | 3792 | { |
186dd63b | 3793 | /* Q_GUBL - GET_USER_BY_LOGIN, v3 */ |
3794 | "get_user_by_login", | |
3795 | "gubl", | |
3796 | 3, | |
3797 | RETRIEVE, | |
3798 | "u", | |
3799 | USERS_TABLE, | |
3b634eb3 | 3800 | "u.login, u.unix_uid, u.shell, u.winconsoleshell, 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, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u", |
186dd63b | 3801 | gubl_fields, |
3b634eb3 | 3802 | 15, |
186dd63b | 3803 | "u.login LIKE '%s' AND u.users_id != 0", |
3804 | 1, | |
3805 | "u.login", | |
3806 | &gubl_validate, | |
3807 | }, | |
3808 | ||
3809 | { | |
3810 | /* Q_GUBU - GET_USER_BY_UID, v2 */ | |
d33e787c | 3811 | "get_user_by_uid", |
3812 | "gubu", | |
c44ddfa7 | 3813 | 2, |
d33e787c | 3814 | RETRIEVE, |
3815 | "u", | |
03c05291 | 3816 | USERS_TABLE, |
3817 | "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", | |
186dd63b | 3818 | gubu2_fields, |
d33e787c | 3819 | 12, |
03c05291 | 3820 | "u.unix_uid = %s AND u.users_id != 0", |
d33e787c | 3821 | 1, |
29028043 | 3822 | "u.login", |
9db6a21e | 3823 | &gubu2_validate, |
d33e787c | 3824 | }, |
5eaef520 | 3825 | |
d33e787c | 3826 | { |
186dd63b | 3827 | /* Q_GUBU - GET_USER_BY_UID, v3 */ |
3828 | "get_user_by_uid", | |
3829 | "gubu", | |
3830 | 3, | |
3831 | RETRIEVE, | |
3832 | "u", | |
3833 | USERS_TABLE, | |
3b634eb3 | 3834 | "u.login, u.unix_uid, u.shell, u.winconsoleshell, 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, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u", |
186dd63b | 3835 | gubu_fields, |
3b634eb3 | 3836 | 15, |
186dd63b | 3837 | "u.unix_uid = %s AND u.users_id != 0", |
3838 | 1, | |
3839 | "u.login", | |
3840 | &gubu_validate, | |
3841 | }, | |
3842 | ||
3843 | { | |
3844 | /* Q_GUBN - GET_USER_BY_NAME, v2 */ | |
d33e787c | 3845 | "get_user_by_name", |
3846 | "gubn", | |
c44ddfa7 | 3847 | 2, |
d33e787c | 3848 | RETRIEVE, |
3849 | "u", | |
03c05291 | 3850 | USERS_TABLE, |
3851 | "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", | |
186dd63b | 3852 | gubn2_fields, |
d33e787c | 3853 | 12, |
263a36d4 | 3854 | "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0", |
d33e787c | 3855 | 2, |
29028043 | 3856 | "u.login", |
9db6a21e | 3857 | &gubn2_validate, |
d33e787c | 3858 | }, |
5eaef520 | 3859 | |
d33e787c | 3860 | { |
186dd63b | 3861 | /* Q_GUBN - GET_USER_BY_NAME, v3 */ |
3862 | "get_user_by_name", | |
3863 | "gubn", | |
3864 | 3, | |
3865 | RETRIEVE, | |
3866 | "u", | |
3867 | USERS_TABLE, | |
3b634eb3 | 3868 | "u.login, u.unix_uid, u.shell, u.winconsoleshell, 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, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u", |
186dd63b | 3869 | gubn_fields, |
3b634eb3 | 3870 | 15, |
186dd63b | 3871 | "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0", |
3872 | 2, | |
3873 | "u.login", | |
3874 | &gubn_validate, | |
3875 | }, | |
3876 | ||
3877 | { | |
3878 | /* Q_GUBC - GET_USER_BY_CLASS, v2 */ | |
d33e787c | 3879 | "get_user_by_class", |
3880 | "gubc", | |
c44ddfa7 | 3881 | 2, |
d33e787c | 3882 | RETRIEVE, |
3883 | "u", | |
03c05291 | 3884 | USERS_TABLE, |
3885 | "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", | |
186dd63b | 3886 | gubc2_fields, |
d33e787c | 3887 | 12, |
03c05291 | 3888 | "u.type = UPPER('%s') AND u.users_id != 0", |
d33e787c | 3889 | 1, |
29028043 | 3890 | "u.login", |
3891 | &VDfix_modby, | |
d33e787c | 3892 | }, |
5eaef520 | 3893 | |
d33e787c | 3894 | { |
186dd63b | 3895 | /* Q_GUBC - GET_USER_BY_CLASS, v3 */ |
3896 | "get_user_by_class", | |
3897 | "gubc", | |
3898 | 3, | |
3899 | RETRIEVE, | |
3900 | "u", | |
3901 | USERS_TABLE, | |
3b634eb3 | 3902 | "u.login, u.unix_uid, u.shell, u.winconsoleshell, 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, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS') FROM users u", |
186dd63b | 3903 | gubc_fields, |
3b634eb3 | 3904 | 15, |
186dd63b | 3905 | "u.type = UPPER('%s') AND u.users_id != 0", |
3906 | 1, | |
3907 | "u.login", | |
9db6a21e | 3908 | &guan_validate, |
186dd63b | 3909 | }, |
3910 | ||
3911 | { | |
3912 | /* Q_GUBM - GET_USER_BY_MITID, v2 */ | |
d33e787c | 3913 | "get_user_by_mitid", |
3914 | "gubm", | |
c44ddfa7 | 3915 | 2, |
d33e787c | 3916 | RETRIEVE, |
3917 | "u", | |
03c05291 | 3918 | USERS_TABLE, |
3919 | "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", | |
186dd63b | 3920 | gubm2_fields, |
d33e787c | 3921 | 12, |
263a36d4 | 3922 | "u.clearid LIKE '%s' AND u.users_id != 0", |
d33e787c | 3923 | 1, |
29028043 | 3924 | "u.login", |
263a36d4 | 3925 | &VDfix_modby, |
d33e787c | 3926 | }, |
5eaef520 | 3927 | |
4ffa124a | 3928 | { |
186dd63b | 3929 | /* Q_GUBM - GET_USER_BY_MITID, v3 */ |
3930 | "get_user_by_mitid", | |
3931 | "gubm", | |
3932 | 3, | |
3933 | RETRIEVE, | |
3934 | "u", | |
3935 | USERS_TABLE, | |
3b634eb3 | 3936 | "u.login, u.unix_uid, u.shell, u.winconsoleshell, 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, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u", |
186dd63b | 3937 | gubm_fields, |
3b634eb3 | 3938 | 15, |
186dd63b | 3939 | "u.clearid LIKE '%s' AND u.users_id != 0", |
3940 | 1, | |
3941 | "u.login", | |
9db6a21e | 3942 | &guan_validate, |
186dd63b | 3943 | }, |
3944 | ||
3945 | { | |
3946 | /* Q_AUAC - ADD_USER_ACCOUNT, v2 */ /* uses prefetch_value() for users_id */ | |
4ffa124a | 3947 | "add_user_account", |
3948 | "auac", | |
c44ddfa7 | 3949 | 2, |
4ffa124a | 3950 | APPEND, |
3951 | "u", | |
03c05291 | 3952 | USERS_TABLE, |
d55429b2 | 3953 | /* We set signature to "NVL(CHR(0), '%s')", which is to say, "CHR(0)", |
3954 | * but using up one argv element. | |
3955 | */ | |
3956 | "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, NVL(CHR(0), '%s'), %s, %s)", | |
186dd63b | 3957 | auac2_fields, |
4ffa124a | 3958 | 12, |
7ac48069 | 3959 | NULL, |
4ffa124a | 3960 | 0, |
29028043 | 3961 | NULL, |
186dd63b | 3962 | &auac2_validate, |
3963 | }, | |
3964 | ||
3965 | { | |
3966 | /* Q_AUAC - ADD_USER_ACCOUNT, v3 */ /* uses prefetch_value() for users_id */ | |
3967 | "add_user_account", | |
3968 | "auac", | |
3969 | 3, | |
3970 | APPEND, | |
3971 | "u", | |
3972 | USERS_TABLE, | |
3973 | /* We set signature to "NVL(CHR(0), '%s')", which is to say, "CHR(0)", | |
3974 | * but using up one argv element. | |
3975 | */ | |
3b634eb3 | 3976 | "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, users_id, created, creator) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', %d, NVL(CHR(0), '%s'), %s, %s, SYSDATE, %s)", |
186dd63b | 3977 | auac_fields, |
3978 | 13, | |
3979 | NULL, | |
3980 | 0, | |
3981 | NULL, | |
4ffa124a | 3982 | &auac_validate, |
3983 | }, | |
5eaef520 | 3984 | |
d33e787c | 3985 | { |
186dd63b | 3986 | /* Q_AUSR - ADD_USER, v2 */ /* uses prefetch_value() for users_id */ |
d33e787c | 3987 | "add_user", |
3988 | "ausr", | |
c44ddfa7 | 3989 | 2, |
d33e787c | 3990 | APPEND, |
3991 | "u", | |
03c05291 | 3992 | USERS_TABLE, |
5eaef520 | 3993 | "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)", |
186dd63b | 3994 | auac2_fields, |
d33e787c | 3995 | 9, |
45bf7573 | 3996 | 0, |
d33e787c | 3997 | 0, |
29028043 | 3998 | NULL, |
186dd63b | 3999 | &ausr2_validate, |
4000 | }, | |
4001 | ||
4002 | { | |
4003 | /* Q_AUSR - ADD_USER, v3 */ /* uses prefetch_value() for users_id */ | |
4004 | "add_user", | |
4005 | "ausr", | |
4006 | 3, | |
4007 | APPEND, | |
4008 | "u", | |
4009 | USERS_TABLE, | |
3b634eb3 | 4010 | "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, users_id, created, creator) 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, SYSDATE, %s)", |
186dd63b | 4011 | auac_fields, |
4012 | 10, | |
4013 | 0, | |
4014 | 0, | |
4015 | NULL, | |
d33e787c | 4016 | &ausr_validate, |
4017 | }, | |
5eaef520 | 4018 | |
d33e787c | 4019 | { |
4020 | /* Q_RUSR - REGISTER_USER */ | |
4021 | "register_user", | |
4022 | "rusr", | |
c44ddfa7 | 4023 | 2, |
d33e787c | 4024 | APPEND, |
4025 | 0, | |
4026 | 0, | |
4027 | 0, | |
4028 | rusr_fields, | |
4029 | 3, | |
4030 | 0, | |
4031 | 0, | |
29028043 | 4032 | NULL, |
d33e787c | 4033 | &rusr_validate, |
4034 | }, | |
5eaef520 | 4035 | |
4ffa124a | 4036 | { |
186dd63b | 4037 | /* Q_UUAC - UPDATE_USER_ACCOUNT, v2 */ |
4ffa124a | 4038 | "update_user_account", |
4039 | "uuac", | |
c44ddfa7 | 4040 | 2, |
4ffa124a | 4041 | UPDATE, |
4042 | "u", | |
03c05291 | 4043 | USERS_TABLE, |
d55429b2 | 4044 | /* See comment in auac about signature. */ |
4045 | "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 = NVL(CHR(0), '%s'), secure = %s", | |
186dd63b | 4046 | uuac2_fields, |
4ffa124a | 4047 | 12, |
4048 | "users_id = %d", | |
4049 | 1, | |
29028043 | 4050 | NULL, |
186dd63b | 4051 | &uuac2_validate, |
4052 | }, | |
4053 | ||
4054 | { | |
4055 | /* Q_UUAC - UPDATE_USER_ACCOUNT, v3 */ | |
4056 | "update_user_account", | |
4057 | "uuac", | |
4058 | 3, | |
4059 | UPDATE, | |
4060 | "u", | |
4061 | USERS_TABLE, | |
4062 | /* See comment in auac about signature. */ | |
4063 | "users SET login = '%s', unix_uid = %s, shell = '%s', winconsoleshell = '%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 = NVL(CHR(0), '%s'), secure = %s", | |
4064 | uuac_fields, | |
4065 | 13, | |
4066 | "users_id = %d", | |
4067 | 1, | |
4068 | NULL, | |
4ffa124a | 4069 | &uuac_validate, |
4070 | }, | |
5eaef520 | 4071 | |
d33e787c | 4072 | { |
186dd63b | 4073 | /* Q_UUSR - UPDATE_USER, v2 */ |
d33e787c | 4074 | "update_user", |
4075 | "uusr", | |
c44ddfa7 | 4076 | 2, |
d33e787c | 4077 | UPDATE, |
4078 | "u", | |
03c05291 | 4079 | USERS_TABLE, |
5eaef520 | 4080 | "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'", |
186dd63b | 4081 | uuac2_fields, |
d33e787c | 4082 | 9, |
4e5ec77f | 4083 | "users_id = %d", |
d33e787c | 4084 | 1, |
29028043 | 4085 | NULL, |
186dd63b | 4086 | &uusr2_validate, |
4087 | }, | |
4088 | ||
4089 | { | |
4090 | /* Q_UUSR - UPDATE_USER, v3 */ | |
4091 | "update_user", | |
4092 | "uusr", | |
4093 | 3, | |
4094 | UPDATE, | |
4095 | "u", | |
4096 | USERS_TABLE, | |
4097 | "users SET login = '%s', unix_uid = %s, shell = '%s', winconsoleshell = '%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'", | |
4098 | uuac_fields, | |
4099 | 10, | |
4100 | "users_id = %d", | |
4101 | 1, | |
4102 | NULL, | |
d33e787c | 4103 | &uusr_validate, |
4104 | }, | |
4105 | ||
4106 | { | |
4107 | /* Q_UUSH - UPDATE_USER_SHELL */ | |
4108 | "update_user_shell", | |
4109 | "uush", | |
c44ddfa7 | 4110 | 2, |
d33e787c | 4111 | UPDATE, |
4112 | "u", | |
03c05291 | 4113 | USERS_TABLE, |
5eaef520 | 4114 | "users SET shell = '%s'", |
d33e787c | 4115 | uush_fields, |
4116 | 1, | |
4e5ec77f | 4117 | "users_id = %d", |
d33e787c | 4118 | 1, |
29028043 | 4119 | NULL, |
d33e787c | 4120 | &uush_validate, |
4121 | }, | |
4122 | ||
29dbfca4 | 4123 | { |
4124 | /* Q_UUWS - UPDATE_USER_WINDOWS_SHELL */ | |
4125 | "update_user_windows_shell", | |
4126 | "uuws", | |
4127 | 2, | |
4128 | UPDATE, | |
4129 | "u", | |
4130 | USERS_TABLE, | |
4131 | "users SET winconsoleshell = '%s'", | |
4132 | uuws_fields, | |
4133 | 1, | |
4134 | "users_id = %d", | |
4135 | 1, | |
4136 | NULL, | |
4137 | &uuws_validate, | |
4138 | }, | |
4139 | ||
d33e787c | 4140 | { |
4141 | /* Q_UUST - UPDATE_USER_STATUS */ | |
4142 | "update_user_status", | |
4143 | "uust", | |
c44ddfa7 | 4144 | 2, |
d33e787c | 4145 | UPDATE, |
4146 | "u", | |
03c05291 | 4147 | USERS_TABLE, |
4e5ec77f | 4148 | "users SET status = %s", |
d33e787c | 4149 | uust_fields, |
4150 | 1, | |
4e5ec77f | 4151 | "users_id = %d", |
d33e787c | 4152 | 1, |
29028043 | 4153 | NULL, |
d33e787c | 4154 | &uust_validate, |
4155 | }, | |
4156 | ||
4ffa124a | 4157 | { |
4158 | /* Q_UUSS - UPDATE_USER_SECURITY_STATUS */ | |
4159 | "update_user_security_status", | |
4160 | "uuss", | |
c44ddfa7 | 4161 | 2, |
4ffa124a | 4162 | UPDATE, |
4163 | "u", | |
03c05291 | 4164 | USERS_TABLE, |
135dcb80 | 4165 | "users SET secure = %s", |
4ffa124a | 4166 | uuss_fields, |
4167 | 1, | |
4168 | "users_id = %d", | |
4169 | 1, | |
29028043 | 4170 | NULL, |
4ffa124a | 4171 | &uust_validate, |
4172 | }, | |
5eaef520 | 4173 | |
d33e787c | 4174 | { |
5eaef520 | 4175 | /* Q_DUSR - DELETE_USER */ |
d33e787c | 4176 | "delete_user", |
4177 | "dusr", | |
c44ddfa7 | 4178 | 2, |
d33e787c | 4179 | DELETE, |
4180 | "u", | |
03c05291 | 4181 | USERS_TABLE, |
7ac48069 | 4182 | NULL, |
d33e787c | 4183 | dusr_fields, |
4184 | 0, | |
4e5ec77f | 4185 | "users_id = %d", |
d33e787c | 4186 | 1, |
29028043 | 4187 | NULL, |
d33e787c | 4188 | &dusr_validate, |
4189 | }, | |
4190 | ||
77eb4bdf | 4191 | { |
4192 | /* Q_AURV - ADD_USER_RESERVATION */ | |
4193 | "add_user_reservation", | |
4194 | "aurv", | |
4195 | 2, | |
4196 | UPDATE, | |
4197 | 0, | |
4198 | USERS_TABLE, | |
4199 | 0, | |
4200 | aurv_fields, | |
4201 | 2, | |
4202 | 0, | |
4203 | 0, | |
4204 | NULL, | |
4205 | &aurv_validate, | |
4206 | }, | |
4207 | ||
4208 | { | |
4209 | /* Q_GURV - GET_USER_RESERVATIONS */ | |
4210 | "get_user_reservations", | |
4211 | "gurv", | |
4212 | 2, | |
4213 | RETRIEVE, | |
4214 | 0, | |
4215 | USERS_TABLE, | |
4216 | 0, | |
4217 | gurv_fields, | |
4218 | 2, | |
4219 | 0, | |
4220 | 1, | |
4221 | NULL, | |
4222 | &gurv_validate, | |
4223 | }, | |
4224 | ||
4225 | { | |
4226 | /* Q_GUBR - GET_USER_BY_RESERVATION */ | |
4227 | "get_user_by_reservation", | |
4228 | "gubr", | |
4229 | 2, | |
4230 | RETRIEVE, | |
4231 | 0, | |
4232 | USERS_TABLE, | |
4233 | 0, | |
4234 | gubr_fields, | |
4235 | 1, | |
4236 | 0, | |
4237 | 1, | |
4238 | NULL, | |
4239 | &gubr_validate, | |
4240 | }, | |
4241 | ||
4242 | { | |
4243 | /* Q_DURV - DELETE_USER_RESERVATION */ | |
4244 | "delete_user_reservation", | |
4245 | "durv", | |
4246 | 2, | |
4247 | UPDATE, | |
4248 | 0, | |
4249 | USERS_TABLE, | |
4250 | 0, | |
4251 | aurv_fields, | |
4252 | 2, | |
4253 | 0, | |
4254 | 0, | |
4255 | NULL, | |
4256 | &aurv_validate, | |
4257 | }, | |
4258 | ||
012fc215 | 4259 | { |
5eaef520 | 4260 | /* Q_GKUM - GET_KERBEROS_USER_MAP */ |
012fc215 | 4261 | "get_kerberos_user_map", |
4262 | "gkum", | |
c44ddfa7 | 4263 | 2, |
012fc215 | 4264 | RETRIEVE, |
4265 | "k", | |
03c05291 | 4266 | KRBMAP_TABLE, |
4267 | "u.login, str.string FROM krbmap km, users u, strings str", | |
012fc215 | 4268 | gkum_fields, |
4269 | 2, | |
263a36d4 | 4270 | "u.login LIKE '%s' AND str.string LIKE '%s' AND km.users_id = u.users_id AND km.string_id = str.string_id", |
012fc215 | 4271 | 2, |
29028043 | 4272 | "u.login, str.string", |
263a36d4 | 4273 | NULL, |
012fc215 | 4274 | }, |
4275 | ||
4276 | { | |
4277 | /* Q_AKUM - ADD_KERBEROS_USER_MAP */ | |
4278 | "add_kerberos_user_map", | |
4279 | "akum", | |
c44ddfa7 | 4280 | 2, |
012fc215 | 4281 | APPEND, |
4282 | "k", | |
03c05291 | 4283 | KRBMAP_TABLE, |
99e09b48 | 4284 | "INTO krbmap (users_id, string_id) VALUES (%d, %d)", |
012fc215 | 4285 | akum_fields, |
4286 | 2, | |
4287 | 0, | |
4288 | 0, | |
29028043 | 4289 | NULL, |
012fc215 | 4290 | &akum_validate, |
4291 | }, | |
4292 | ||
4293 | { | |
4294 | /* Q_DKUM - DELETE_KERBEROS_USER_MAP */ | |
4295 | "delete_kerberos_user_map", | |
4296 | "dkum", | |
c44ddfa7 | 4297 | 2, |
012fc215 | 4298 | DELETE, |
4299 | "k", | |
03c05291 | 4300 | KRBMAP_TABLE, |
012fc215 | 4301 | 0, |
4302 | akum_fields, | |
4303 | 0, | |
99e09b48 | 4304 | "users_id = %d AND string_id = %d", |
012fc215 | 4305 | 2, |
29028043 | 4306 | NULL, |
012fc215 | 4307 | &dkum_validate, |
4308 | }, | |
4309 | ||
d33e787c | 4310 | { |
4311 | /* Q_GFBL - GET_FINGER_BY_LOGIN */ | |
4312 | "get_finger_by_login", | |
4313 | "gfbl", | |
c44ddfa7 | 4314 | 2, |
d33e787c | 4315 | RETRIEVE, |
4316 | "u", | |
03c05291 | 4317 | USERS_TABLE, |
4318 | "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 | 4319 | gfbl_fields, |
4320 | 12, | |
03c05291 | 4321 | "users_id = %d", |
d33e787c | 4322 | 1, |
29028043 | 4323 | "login", |
d33e787c | 4324 | &gfbl_validate, |
4325 | }, | |
4326 | ||
4327 | { | |
4328 | /* Q_UFBL - UPDATE_FINGER_BY_LOGIN */ | |
4329 | "update_finger_by_login", | |
4330 | "ufbl", | |
c44ddfa7 | 4331 | 2, |
d33e787c | 4332 | UPDATE, |
4333 | "u", | |
03c05291 | 4334 | USERS_TABLE, |
5eaef520 | 4335 | "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 | 4336 | ufbl_fields, |
4337 | 8, | |
4e5ec77f | 4338 | "users_id = %d", |
d33e787c | 4339 | 1, |
29028043 | 4340 | NULL, |
d33e787c | 4341 | &ufbl_validate, |
4342 | }, | |
4343 | ||
4344 | { | |
4345 | /* Q_GPOB - GET_POBOX */ | |
4346 | "get_pobox", | |
4347 | "gpob", | |
c44ddfa7 | 4348 | 2, |
d33e787c | 4349 | RETRIEVE, |
4350 | "u", | |
03c05291 | 4351 | USERS_TABLE, |
d6d830a1 | 4352 | "login, potype, users_id, CHR(0), TO_CHAR(pmodtime, 'DD-mon-YYYY HH24:MI:SS'), pmodby, pmodwith FROM users", |
d33e787c | 4353 | gpob_fields, |
d6d830a1 | 4354 | 7, |
03c05291 | 4355 | "users_id = %d", |
d33e787c | 4356 | 1, |
29028043 | 4357 | "login", |
d33e787c | 4358 | &gpob_validate, |
4359 | }, | |
4360 | ||
4361 | { | |
4362 | /* Q_GAPO - GET_ALL_POBOXES */ | |
4363 | "get_all_poboxes", | |
4364 | "gapo", | |
c44ddfa7 | 4365 | 2, |
d33e787c | 4366 | RETRIEVE, |
4367 | "u", | |
03c05291 | 4368 | USERS_TABLE, |
4369 | "login, potype, pop_id || ':' || box_id FROM users", | |
d33e787c | 4370 | gpox_fields, |
4371 | 3, | |
03c05291 | 4372 | "potype != 'NONE'", |
d33e787c | 4373 | 0, |
29028043 | 4374 | "login", |
d33e787c | 4375 | &gpox_validate, |
4376 | }, | |
5eaef520 | 4377 | |
d33e787c | 4378 | { |
4379 | /* Q_GPOP - GET_POBOXES_POP */ | |
4380 | "get_poboxes_pop", | |
4381 | "gpop", | |
c44ddfa7 | 4382 | 2, |
d33e787c | 4383 | RETRIEVE, |
4384 | "u", | |
03c05291 | 4385 | USERS_TABLE, |
17cb3de8 | 4386 | "login, potype, users_id FROM users", |
d33e787c | 4387 | gpox_fields, |
4388 | 3, | |
03c05291 | 4389 | "potype = 'POP'", |
d33e787c | 4390 | 0, |
29028043 | 4391 | "login", |
d33e787c | 4392 | &gpox_validate |
4393 | }, | |
4394 | ||
4395 | { | |
4396 | /* Q_GPOF - GET_POBOXES_SMTP */ | |
4397 | "get_poboxes_smtp", | |
4398 | "gpos", | |
c44ddfa7 | 4399 | 2, |
d33e787c | 4400 | RETRIEVE, |
4401 | "u", | |
03c05291 | 4402 | USERS_TABLE, |
17cb3de8 | 4403 | "login, potype, users_id FROM users", |
d33e787c | 4404 | gpox_fields, |
4405 | 3, | |
03c05291 | 4406 | "potype = 'SMTP'", |
d33e787c | 4407 | 0, |
29028043 | 4408 | "login", |
d33e787c | 4409 | &gpox_validate |
4410 | }, | |
4411 | ||
4412 | { | |
4413 | /* Q_SPOB - SET_POBOX */ | |
4414 | "set_pobox", | |
4415 | "spob", | |
c44ddfa7 | 4416 | 2, |
d33e787c | 4417 | UPDATE, |
4418 | 0, | |
03c05291 | 4419 | USERS_TABLE, |
d33e787c | 4420 | 0, |
4421 | spob_fields, | |
4422 | 3, | |
7ac48069 | 4423 | NULL, |
d33e787c | 4424 | 0, |
29028043 | 4425 | NULL, |
d33e787c | 4426 | &spob_validate, |
4427 | }, | |
4428 | ||
4429 | { | |
4430 | /* Q_SPOP - SET_POBOX_POP */ | |
4431 | "set_pobox_pop", | |
4432 | "spop", | |
c44ddfa7 | 4433 | 2, |
d33e787c | 4434 | UPDATE, |
8b0fdf05 | 4435 | 0, |
03c05291 | 4436 | USERS_TABLE, |
17cb3de8 | 4437 | 0, |
d33e787c | 4438 | spob_fields, |
8b0fdf05 | 4439 | 1, |
17cb3de8 | 4440 | NULL, |
4441 | 0, | |
29028043 | 4442 | NULL, |
d33e787c | 4443 | &spop_validate, |
4444 | }, | |
4445 | ||
4446 | { | |
4447 | /* Q_DPOB - DELETE_POBOX */ | |
4448 | "delete_pobox", | |
4449 | "dpob", | |
c44ddfa7 | 4450 | 2, |
d33e787c | 4451 | UPDATE, |
4452 | "u", | |
03c05291 | 4453 | USERS_TABLE, |
4454 | "users SET potype = 'NONE'", | |
4455 | spob_fields, | |
4456 | 0, | |
4457 | "users_id = %d", | |
d33e787c | 4458 | 1, |
29028043 | 4459 | NULL, |
03c05291 | 4460 | &dpob_validate, |
d33e787c | 4461 | }, |
4462 | ||
4463 | { | |
e4ae0190 | 4464 | /* Q_GHST - GET_HOST, v2 */ |
a66a2204 | 4465 | "get_host", |
4466 | "ghst", | |
c44ddfa7 | 4467 | 2, |
a66a2204 | 4468 | RETRIEVE, |
4469 | "m", | |
03c05291 | 4470 | MACHINE_TABLE, |
4471 | "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", | |
e4ae0190 | 4472 | ghst2_fields, |
a66a2204 | 4473 | 21, |
1fa08fc4 | 4474 | "m.name LIKE UPPER('%s') AND m.address LIKE '%s' AND m.location LIKE UPPER('%s') AND s.name LIKE UPPER('%s') AND m.mach_id != 0 AND s.snet_id = m.snet_id", |
a66a2204 | 4475 | 4, |
29028043 | 4476 | "m.name", |
a66a2204 | 4477 | &ghst_validate, |
4478 | }, | |
4479 | ||
9333756a | 4480 | { |
e4ae0190 | 4481 | /* Q_GHST - GET_HOST, v6 */ |
4482 | "get_host", | |
4483 | "ghst", | |
4484 | 6, | |
4485 | RETRIEVE, | |
4486 | "m", | |
4487 | MACHINE_TABLE, | |
4488 | "m.name, m.vendor, m.model, m.os, m.location, m.contact, m.billing_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", | |
4f6b1a05 | 4489 | ghst6_fields, |
e4ae0190 | 4490 | 22, |
4491 | "m.name LIKE UPPER('%s') AND m.address LIKE '%s' AND m.location LIKE UPPER('%s') AND s.name LIKE UPPER('%s') AND m.mach_id != 0 AND s.snet_id = m.snet_id", | |
4492 | 4, | |
4493 | "m.name", | |
4494 | &ghst_validate, | |
4495 | }, | |
4496 | ||
4f6b1a05 | 4497 | { |
4498 | /* Q_GHST - GET_HOST, v8 */ | |
4499 | "get_host", | |
4500 | "ghst", | |
4501 | 8, | |
4502 | RETRIEVE, | |
4503 | "m", | |
4504 | MACHINE_TABLE, | |
4505 | "m.name, m.vendor, m.model, m.os, m.location, m.contact, m.billing_contact, m.account_number, 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", | |
4506 | ghst_fields, | |
4507 | 23, | |
4508 | "m.name LIKE UPPER('%s') AND m.address LIKE '%s' AND m.location LIKE UPPER('%s') AND s.name LIKE UPPER('%s') AND m.mach_id != 0 AND s.snet_id = m.snet_id", | |
4509 | 4, | |
4510 | "m.name", | |
4511 | &ghst_validate, | |
4512 | }, | |
4513 | ||
e4ae0190 | 4514 | { |
4515 | /* Q_GHBH - GET_HOST_BY_HWADDR, v2 */ | |
9333756a | 4516 | "get_host_by_hwaddr", |
4517 | "ghbh", | |
c44ddfa7 | 4518 | 2, |
9333756a | 4519 | RETRIEVE, |
4520 | "m", | |
4521 | MACHINE_TABLE, | |
4522 | "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", | |
e4ae0190 | 4523 | ghbh2_fields, |
9333756a | 4524 | 21, |
4525 | "m.hwaddr LIKE LOWER('%s') AND m.mach_id != 0 AND s.snet_id = m.snet_id", | |
4526 | 1, | |
4527 | "m.name", | |
012e079f | 4528 | &ghst_validate, |
9333756a | 4529 | }, |
4530 | ||
e4ae0190 | 4531 | { |
4532 | /* Q_GHBH - GET_HOST_BY_HWADDR, v6 */ | |
4533 | "get_host_by_hwaddr", | |
4534 | "ghbh", | |
4535 | 6, | |
4536 | RETRIEVE, | |
4537 | "m", | |
4538 | MACHINE_TABLE, | |
4539 | "m.name, m.vendor, m.model, m.os, m.location, m.contact, m.billing_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", | |
4f6b1a05 | 4540 | ghbh6_fields, |
e4ae0190 | 4541 | 22, |
4542 | "m.hwaddr LIKE LOWER('%s') AND m.mach_id != 0 AND s.snet_id = m.snet_id", | |
4543 | 1, | |
4544 | "m.name", | |
4545 | &ghst_validate, | |
4546 | }, | |
4547 | ||
4f6b1a05 | 4548 | { |
4549 | /* Q_GHBH - GET_HOST_BY_HWADDR, v8 */ | |
4550 | "get_host_by_hwaddr", | |
4551 | "ghbh", | |
4552 | 8, | |
4553 | RETRIEVE, | |
4554 | "m", | |
4555 | MACHINE_TABLE, | |
4556 | "m.name, m.vendor, m.model, m.os, m.location, m.contact, m.billing_contact, m.account_number, 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", | |
4557 | ghbh_fields, | |
4558 | 23, | |
4559 | "m.hwaddr LIKE LOWER('%s') AND m.mach_id != 0 AND s.snet_id = m.snet_id", | |
4560 | 1, | |
4561 | "m.name", | |
4562 | &ghst_validate, | |
4563 | }, | |
4564 | ||
4565 | { | |
4566 | /* Q_GHBA - GET_HOST_BY_ACCOUNT_NUMBER, v8 */ | |
4567 | "get_host_by_account_number", | |
4568 | "ghba", | |
4569 | 8, | |
4570 | RETRIEVE, | |
4571 | "m", | |
4572 | MACHINE_TABLE, | |
4573 | "m.name, m.vendor, m.model, m.os, m.location, m.contact, m.billing_contact, m.account_number, 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", | |
4574 | ghba_fields, | |
4575 | 23, | |
4576 | "m.account_number LIKE '%s' AND m.mach_id != 0 and s.snet_id = m.snet_id", | |
4577 | 1, | |
4578 | "m.name", | |
4579 | &ghst_validate, | |
4580 | }, | |
4581 | ||
2884200f | 4582 | { |
4583 | /* Q_GHHA - GET_HOST_HWADDR */ | |
4584 | "get_host_hwaddr", | |
4585 | "ghha", | |
c44ddfa7 | 4586 | 2, |
2884200f | 4587 | RETRIEVE, |
4588 | "m", | |
4589 | MACHINE_TABLE, | |
4590 | "m.hwaddr FROM machine m", | |
4591 | ghha_fields, | |
4592 | 1, | |
4593 | "m.name LIKE UPPER('%s')", | |
4594 | 1, | |
4595 | NULL, | |
4596 | NULL, | |
4597 | }, | |
4598 | ||
a66a2204 | 4599 | { |
e4ae0190 | 4600 | /* Q_AHST - ADD_HOST, v2 */ /* uses prefetch_value() for mach_id */ |
a66a2204 | 4601 | "add_host", |
4602 | "ahst", | |
c44ddfa7 | 4603 | 2, |
d33e787c | 4604 | APPEND, |
4605 | "m", | |
03c05291 | 4606 | MACHINE_TABLE, |
5eaef520 | 4607 | "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)", |
e4ae0190 | 4608 | ahst2_fields, |
a66a2204 | 4609 | 14, |
45bf7573 | 4610 | 0, |
d33e787c | 4611 | 0, |
29028043 | 4612 | NULL, |
e4ae0190 | 4613 | &ahst2_validate, |
4614 | }, | |
4615 | ||
4616 | { | |
4617 | /* Q_AHST - ADD_HOST, v6 */ /* uses prefetch_value() for mach_id */ | |
4618 | "add_host", | |
4619 | "ahst", | |
4620 | 6, | |
4621 | APPEND, | |
4622 | "m", | |
4623 | MACHINE_TABLE, | |
4624 | "INTO machine (name, vendor, model, os, location, contact, billing_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)), NVL('%s', CHR(0)), %s, %s, SYSDATE, %d, '%s', '%s', %d, %d, %d, SYSDATE, SYSDATE, %s, %s)", | |
4f6b1a05 | 4625 | ahst6_fields, |
2c593a9e | 4626 | 15, |
751f43da | 4627 | 0, |
4628 | 0, | |
4629 | NULL, | |
4f6b1a05 | 4630 | &ahst6_validate, |
4631 | }, | |
4632 | ||
4633 | { | |
4634 | /* Q_AHST - ADD_HOST, v8 */ /* Uses prefetch_value() for mach_id */ | |
4635 | "add_host", | |
4636 | "ahst", | |
4637 | 8, | |
4638 | APPEND, | |
4639 | "m", | |
4640 | MACHINE_TABLE, | |
4641 | "INTO machine (name, vendor, model, os, location, contact, billing_contact, account_number, 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)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, %s, SYSDATE, %d, '%s', '%s', %d, %d, %d, SYSDATE, SYSDATE, %s, %s)", | |
4642 | ahst_fields, | |
4643 | 16, | |
4644 | 0, | |
4645 | 0, | |
4646 | NULL, | |
a66a2204 | 4647 | &ahst_validate, |
d33e787c | 4648 | }, |
4649 | ||
4650 | { | |
e4ae0190 | 4651 | /* Q_UHST - UPDATE_HOST, v2 */ |
a66a2204 | 4652 | "update_host", |
4653 | "uhst", | |
c44ddfa7 | 4654 | 2, |
d33e787c | 4655 | UPDATE, |
4656 | "m", | |
03c05291 | 4657 | MACHINE_TABLE, |
5eaef520 | 4658 | "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", |
e4ae0190 | 4659 | uhst2_fields, |
a66a2204 | 4660 | 14, |
4e5ec77f | 4661 | "mach_id = %d", |
d33e787c | 4662 | 1, |
29028043 | 4663 | NULL, |
e4ae0190 | 4664 | &uhst2_validate, |
4665 | }, | |
4666 | ||
4667 | { | |
4668 | /* Q_UHST - UPDATE_HOST, v6 */ | |
4669 | "update_host", | |
4670 | "uhst", | |
4671 | 6, | |
4672 | UPDATE, | |
4673 | "m", | |
4674 | MACHINE_TABLE, | |
4675 | "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)), billing_contact = NVL('%s', CHR(0)), use = %s, status = %s, snet_id = %d, address = '%s', owner_type = '%s', owner_id = %d, acomment = %d, ocomment = %d", | |
4f6b1a05 | 4676 | uhst6_fields, |
2c593a9e | 4677 | 15, |
751f43da | 4678 | "mach_id = %d", |
4679 | 1, | |
4680 | NULL, | |
4f6b1a05 | 4681 | &uhst6_validate, |
4682 | }, | |
4683 | ||
4684 | { | |
4685 | /* Q_UHST - UPDATE_HOST, v8 */ | |
4686 | "update_host", | |
4687 | "uhst", | |
4688 | 8, | |
4689 | UPDATE, | |
4690 | "m", | |
4691 | MACHINE_TABLE, | |
4692 | "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)), billing_contact = NVL('%s', CHR(0)), account_number = NVL('%s', CHR(0)), use = %s, status = %s, snet_id = %d, address = '%s', owner_type = '%s', owner_id = %d, acomment = %d, ocomment = %d", | |
4693 | uhst_fields, | |
4694 | 16, | |
4695 | "mach_id = %d", | |
4696 | 1, | |
4697 | NULL, | |
a66a2204 | 4698 | &uhst_validate, |
d33e787c | 4699 | }, |
4700 | ||
2884200f | 4701 | { |
4702 | /* Q_UHHA - UPDATE_HOST_HWADDR */ | |
4703 | "update_host_hwaddr", | |
4704 | "uhha", | |
c44ddfa7 | 4705 | 2, |
2884200f | 4706 | UPDATE, |
4707 | "m", | |
4708 | MACHINE_TABLE, | |
1fdf882a | 4709 | "machine SET hwaddr = NVL('%s', CHR(0))", |
2884200f | 4710 | uhha_fields, |
4711 | 1, | |
4712 | "mach_id = %d", | |
4713 | 1, | |
4714 | NULL, | |
4715 | &uhha_validate, | |
4716 | }, | |
4717 | ||
d33e787c | 4718 | { |
a66a2204 | 4719 | /* Q_DHST - DELETE_HOST */ |
4720 | "delete_host", | |
4721 | "dhst", | |
c44ddfa7 | 4722 | 2, |
d33e787c | 4723 | DELETE, |
4724 | "m", | |
03c05291 | 4725 | MACHINE_TABLE, |
7ac48069 | 4726 | NULL, |
a66a2204 | 4727 | dhst_fields, |
d33e787c | 4728 | 0, |
4e5ec77f | 4729 | "mach_id = %d", |
d33e787c | 4730 | 1, |
29028043 | 4731 | NULL, |
a66a2204 | 4732 | &dhst_validate, |
4733 | }, | |
4734 | ||
03c05291 | 4735 | { |
4736 | /* Q_GMAC - GET_MACHINE */ | |
4737 | "get_machine", | |
4738 | "gmac", | |
c44ddfa7 | 4739 | 2, |
03c05291 | 4740 | RETRIEVE, |
4741 | "m", | |
4742 | MACHINE_TABLE, | |
4743 | "name, vendor, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM machine", | |
4744 | gmac_fields, | |
4745 | 5, | |
263a36d4 | 4746 | "name LIKE UPPER('%s') AND mach_id != 0", |
03c05291 | 4747 | 1, |
29028043 | 4748 | "name", |
263a36d4 | 4749 | &VDfix_modby, |
03c05291 | 4750 | }, |
4751 | ||
a66a2204 | 4752 | { |
4753 | /* Q_GHAL - GET_HOSTALIAS */ | |
4754 | "get_hostalias", | |
4755 | "ghal", | |
c44ddfa7 | 4756 | 2, |
a66a2204 | 4757 | RETRIEVE, |
03c05291 | 4758 | "a", |
4759 | HOSTALIAS_TABLE, | |
4760 | "a.name, m.name FROM hostalias a, machine m", | |
a66a2204 | 4761 | ghal_fields, |
4762 | 2, | |
263a36d4 | 4763 | "m.mach_id = a.mach_id and a.name LIKE UPPER('%s') AND m.name LIKE UPPER('%s')", |
a66a2204 | 4764 | 2, |
29028043 | 4765 | "a.name", |
a66a2204 | 4766 | &ghal_validate, |
4767 | }, | |
4768 | ||
4769 | { | |
4770 | /* Q_AHAL - ADD_HOSTALIAS */ | |
4771 | "add_hostalias", | |
4772 | "ahal", | |
c44ddfa7 | 4773 | 2, |
a66a2204 | 4774 | APPEND, |
4775 | "a", | |
03c05291 | 4776 | HOSTALIAS_TABLE, |
5eaef520 | 4777 | "INTO hostalias (name, mach_id) VALUES (UPPER('%s'), %d)", |
a66a2204 | 4778 | ghal_fields, |
4779 | 2, | |
4780 | 0, | |
4781 | 0, | |
29028043 | 4782 | NULL, |
a66a2204 | 4783 | &ahal_validate, |
4784 | }, | |
4785 | ||
4786 | { | |
4787 | /* Q_DHAL - DELETE_HOSTALIAS */ | |
4788 | "delete_hostalias", | |
4789 | "dhal", | |
c44ddfa7 | 4790 | 2, |
a66a2204 | 4791 | DELETE, |
4792 | "a", | |
03c05291 | 4793 | HOSTALIAS_TABLE, |
7ac48069 | 4794 | NULL, |
a66a2204 | 4795 | ghal_fields, |
4796 | 0, | |
03c05291 | 4797 | "name = UPPER('%s') AND mach_id = %d", |
a66a2204 | 4798 | 2, |
29028043 | 4799 | NULL, |
a66a2204 | 4800 | &dhal_validate, |
d33e787c | 4801 | }, |
4802 | ||
3c1d412c | 4803 | { |
4f6b1a05 | 4804 | /* Q_GSNT - GET_SUBNET, v2 */ |
3c1d412c | 4805 | "get_subnet", |
4806 | "gsnt", | |
c44ddfa7 | 4807 | 2, |
3c1d412c | 4808 | RETRIEVE, |
4809 | "s", | |
03c05291 | 4810 | SUBNET_TABLE, |
4811 | "name, description, saddr, mask, low, high, prefix, owner_type, owner_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM subnet", | |
4f6b1a05 | 4812 | gsnt2_fields, |
bd8c26ff | 4813 | 12, |
5e8fdad1 | 4814 | "name LIKE UPPER('%s')", |
3c1d412c | 4815 | 1, |
29028043 | 4816 | "name", |
3c1d412c | 4817 | &gsnt_validate, |
4818 | }, | |
4819 | ||
4820 | { | |
4f6b1a05 | 4821 | /* Q_GSNT - GET_SUBNET, v8 */ |
4822 | "get_subnet", | |
4823 | "gsnt", | |
4824 | 8, | |
4825 | RETRIEVE, | |
4826 | "s", | |
4827 | SUBNET_TABLE, | |
4828 | "name, description, status, contact, account_number, saddr, mask, low, high, prefix, owner_type, owner_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM subnet", | |
4829 | gsnt_fields, | |
4830 | 15, | |
4831 | "name LIKE UPPER('%s')", | |
4832 | 1, | |
4833 | "name", | |
4834 | &gsnt_validate, | |
4835 | }, | |
4836 | ||
4837 | { | |
4838 | /* Q_ASNT - ADD_SUBNET, v2 */ | |
3c1d412c | 4839 | "add_subnet", |
4840 | "asnt", | |
c44ddfa7 | 4841 | 2, |
3c1d412c | 4842 | APPEND, |
4843 | "s", | |
03c05291 | 4844 | SUBNET_TABLE, |
5eaef520 | 4845 | "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)", |
4f6b1a05 | 4846 | asnt2_fields, |
bd8c26ff | 4847 | 9, |
3c1d412c | 4848 | 0, |
4849 | 0, | |
29028043 | 4850 | NULL, |
4f6b1a05 | 4851 | &asnt2_validate, |
4852 | }, | |
4853 | ||
4854 | { | |
4855 | /* Q_ASNT - ADD_SUBNET, v8 */ | |
4856 | "add_subnet", | |
4857 | "asnt", | |
4858 | 8, | |
4859 | APPEND, | |
4860 | "s", | |
4861 | SUBNET_TABLE, | |
8dc7d749 | 4862 | "INTO subnet (name, description, status, contact, account_number, saddr, mask, low, high, prefix, owner_type, owner_id, snet_id) VALUES (UPPER('%s'), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, %s, %s, %s, NVL('%s', CHR(0)), '%s', %d, %s)", |
4f6b1a05 | 4863 | asnt_fields, |
4864 | 12, | |
4865 | 0, | |
4866 | 0, | |
4867 | NULL, | |
3c1d412c | 4868 | &asnt_validate, |
4869 | }, | |
4870 | ||
4871 | { | |
4f6b1a05 | 4872 | /* Q_USNT - UPDATE_SUBNET, v2 */ |
3c1d412c | 4873 | "update_subnet", |
4874 | "usnt", | |
c44ddfa7 | 4875 | 2, |
3c1d412c | 4876 | UPDATE, |
4877 | "s", | |
03c05291 | 4878 | SUBNET_TABLE, |
5eaef520 | 4879 | "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", |
4f6b1a05 | 4880 | usnt2_fields, |
bd8c26ff | 4881 | 9, |
3c1d412c | 4882 | "snet_id = %d", |
4883 | 1, | |
29028043 | 4884 | NULL, |
4f6b1a05 | 4885 | &usnt2_validate, |
4886 | }, | |
4887 | ||
4888 | { | |
4889 | /* Q_USNT - UPDATE_SUBNET, v8 */ | |
4890 | "update_subnet", | |
4891 | "usnt", | |
4892 | 8, | |
4893 | UPDATE, | |
4894 | "s", | |
4895 | SUBNET_TABLE, | |
4896 | "subnet SET name = UPPER('%s'), description = NVL('%s', CHR(0)), status = %s, contact = NVL('%s', CHR(0)), account_number = NVL('%s', CHR(0)), saddr = %s, mask = %s, low = %s, high = %s, prefix = NVL('%s', CHR(0)), owner_type = '%s', owner_id = %d", | |
4897 | usnt_fields, | |
4898 | 12, | |
4899 | "snet_id = %d", | |
4900 | 1, | |
4901 | NULL, | |
3c1d412c | 4902 | &usnt_validate, |
4903 | }, | |
4904 | ||
4905 | { | |
4906 | /* Q_DSNT - DELETE_SUBNET */ | |
4907 | "delete_subnet", | |
4908 | "dsnt", | |
c44ddfa7 | 4909 | 2, |
3c1d412c | 4910 | DELETE, |
4911 | "s", | |
03c05291 | 4912 | SUBNET_TABLE, |
7ac48069 | 4913 | NULL, |
3c1d412c | 4914 | dsnt_fields, |
4915 | 0, | |
4916 | "snet_id = %d", | |
4917 | 1, | |
29028043 | 4918 | NULL, |
3c1d412c | 4919 | &dsnt_validate, |
4920 | }, | |
4921 | ||
d33e787c | 4922 | { |
4923 | /* Q_GCLU - GET_CLUSTER */ | |
4924 | "get_cluster", | |
4925 | "gclu", | |
c44ddfa7 | 4926 | 2, |
d33e787c | 4927 | RETRIEVE, |
4928 | "c", | |
e688520a | 4929 | CLUSTERS_TABLE, |
03c05291 | 4930 | "name, description, location, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM clusters", |
d33e787c | 4931 | gclu_fields, |
4932 | 6, | |
263a36d4 | 4933 | "name LIKE '%s' AND clu_id != 0", |
d33e787c | 4934 | 1, |
29028043 | 4935 | "name", |
263a36d4 | 4936 | &VDfix_modby, |
d33e787c | 4937 | }, |
4938 | ||
4939 | { | |
45bf7573 | 4940 | /* Q_ACLU - ADD_CLUSTER */ /* uses prefetch_value() for clu_id */ |
d33e787c | 4941 | "add_cluster", |
4942 | "aclu", | |
c44ddfa7 | 4943 | 2, |
d33e787c | 4944 | APPEND, |
4945 | "c", | |
e688520a | 4946 | CLUSTERS_TABLE, |
5eaef520 | 4947 | "INTO clusters (name, description, location, clu_id) VALUES ('%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s)", |
d33e787c | 4948 | aclu_fields, |
4949 | 3, | |
45bf7573 | 4950 | 0, |
d33e787c | 4951 | 0, |
29028043 | 4952 | NULL, |
d33e787c | 4953 | &aclu_validate, |
4954 | }, | |
4955 | ||
4956 | { | |
4957 | /* Q_UCLU - UPDATE_CLUSTER */ | |
4958 | "update_cluster", | |
4959 | "uclu", | |
c44ddfa7 | 4960 | 2, |
d33e787c | 4961 | UPDATE, |
4962 | "c", | |
e688520a | 4963 | CLUSTERS_TABLE, |
5eaef520 | 4964 | "clusters SET name = '%s', description = NVL('%s', CHR(0)), location = NVL('%s', CHR(0))", |
d33e787c | 4965 | uclu_fields, |
4966 | 3, | |
4e5ec77f | 4967 | "clu_id = %d", |
d33e787c | 4968 | 1, |
29028043 | 4969 | NULL, |
d33e787c | 4970 | &uclu_validate, |
4971 | }, | |
4972 | ||
4973 | { | |
4974 | /* Q_DCLU - DELETE_CLUSTER */ | |
4975 | "delete_cluster", | |
4976 | "dclu", | |
c44ddfa7 | 4977 | 2, |
d33e787c | 4978 | DELETE, |
4979 | "c", | |
e688520a | 4980 | CLUSTERS_TABLE, |
7ac48069 | 4981 | NULL, |
d33e787c | 4982 | dclu_fields, |
4983 | 0, | |
4e5ec77f | 4984 | "clu_id = %d", |
d33e787c | 4985 | 1, |
29028043 | 4986 | NULL, |
d33e787c | 4987 | &dclu_validate, |
4988 | }, | |
4989 | ||
4990 | { | |
5eaef520 | 4991 | /* Q_GMCM - GET_MACHINE_TO_CLUSTER_MAP */ |
d33e787c | 4992 | "get_machine_to_cluster_map", |
4993 | "gmcm", | |
c44ddfa7 | 4994 | 2, |
d33e787c | 4995 | RETRIEVE, |
0c345c78 | 4996 | "mcm", |
03c05291 | 4997 | MCMAP_TABLE, |
4998 | "m.name, c.name FROM machine m, clusters c, mcmap mcm", | |
d33e787c | 4999 | gmcm_fields, |
5000 | 2, | |
263a36d4 | 5001 | "m.name LIKE UPPER('%s') AND c.name LIKE '%s' AND mcm.clu_id = c.clu_id AND mcm.mach_id = m.mach_id", |
d33e787c | 5002 | 2, |
29028043 | 5003 | "m.name", |
263a36d4 | 5004 | NULL, |
d33e787c | 5005 | }, |
5eaef520 | 5006 | |
d33e787c | 5007 | { |
5008 | /* Q_AMTC - ADD_MACHINE_TO_CLUSTER */ | |
5009 | "add_machine_to_cluster", | |
5010 | "amtc", | |
c44ddfa7 | 5011 | 2, |
d33e787c | 5012 | APPEND, |
0c345c78 | 5013 | "mcm", |
03c05291 | 5014 | MCMAP_TABLE, |
4e5ec77f | 5015 | "INTO mcmap (mach_id, clu_id) VALUES (%d, %d)", |
d33e787c | 5016 | gmcm_fields, |
5017 | 2, | |
5018 | 0, | |
5019 | 0, | |
29028043 | 5020 | NULL, |
d33e787c | 5021 | &amtc_validate, |
5022 | }, | |
5023 | ||
5024 | { | |
5025 | /* Q_DMFC - DELETE_MACHINE_FROM_CLUSTER */ | |
5026 | "delete_machine_from_cluster", | |
5027 | "dmfc", | |
c44ddfa7 | 5028 | 2, |
d33e787c | 5029 | DELETE, |
0c345c78 | 5030 | "mcm", |
03c05291 | 5031 | MCMAP_TABLE, |
d33e787c | 5032 | 0, |
5033 | gmcm_fields, | |
5034 | 0, | |
4e5ec77f | 5035 | "mach_id = %d AND clu_id = %d", |
d33e787c | 5036 | 2, |
29028043 | 5037 | NULL, |
d33e787c | 5038 | &amtc_validate, |
5039 | }, | |
5040 | ||
5041 | { | |
68dd808d | 5042 | /* Q_GCLD - GET_CLUSTER_DATA */ |
d33e787c | 5043 | "get_cluster_data", |
5044 | "gcld", | |
c44ddfa7 | 5045 | 2, |
d33e787c | 5046 | RETRIEVE, |
d33e787c | 5047 | "svc", |
03c05291 | 5048 | SVC_TABLE, |
5049 | "c.name, svc.serv_label, svc.serv_cluster FROM svc svc, clusters c", | |
d33e787c | 5050 | gcld_fields, |
5051 | 3, | |
263a36d4 | 5052 | "c.clu_id = svc.clu_id AND c.name LIKE '%s' AND svc.serv_label LIKE '%s'", |
d33e787c | 5053 | 2, |
29028043 | 5054 | "c.name, svc.serv_label", |
263a36d4 | 5055 | NULL, |
d33e787c | 5056 | }, |
5057 | ||
5058 | { | |
5059 | /* Q_ACLD - ADD_CLUSTER_DATA */ | |
5060 | "add_cluster_data", | |
5061 | "acld", | |
c44ddfa7 | 5062 | 2, |
d33e787c | 5063 | APPEND, |
0c345c78 | 5064 | "svc", |
03c05291 | 5065 | SVC_TABLE, |
5eaef520 | 5066 | "INTO svc (clu_id, serv_label, serv_cluster) VALUES (%d, '%s', '%s')", |
88343c5e | 5067 | acld_fields, |
d33e787c | 5068 | 3, |
7ac48069 | 5069 | NULL, |
d33e787c | 5070 | 0, |
29028043 | 5071 | NULL, |
d33e787c | 5072 | &acld_validate, |
5073 | }, | |
5074 | ||
5075 | { | |
5076 | /* Q_DCLD - DELETE_CLUSTER_DATA */ | |
5077 | "delete_cluster_data", | |
5078 | "dcld", | |
c44ddfa7 | 5079 | 2, |
d33e787c | 5080 | DELETE, |
0c345c78 | 5081 | "svc", |
03c05291 | 5082 | SVC_TABLE, |
7ac48069 | 5083 | NULL, |
88343c5e | 5084 | acld_fields, |
d33e787c | 5085 | 0, |
5eaef520 | 5086 | "clu_id = %d AND serv_label = '%s' AND serv_cluster = '%s'", |
d33e787c | 5087 | 3, |
29028043 | 5088 | NULL, |
99e09b48 | 5089 | &dcld_validate, |
d33e787c | 5090 | }, |
5091 | ||
03c05291 | 5092 | { |
44da57b2 | 5093 | /* Q_GLIN - GET_LIST_INFO, v2 */ |
03c05291 | 5094 | "get_list_info", |
5095 | "glin", | |
c44ddfa7 | 5096 | 2, |
03c05291 | 5097 | RETRIEVE, |
263a36d4 | 5098 | "l", |
03c05291 | 5099 | LIST_TABLE, |
ccdbc974 | 5100 | "name, active, publicflg, hidden, maillist, grouplist, gid, acl_type, acl_id, description, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM list", |
44da57b2 | 5101 | glin2_fields, |
03c05291 | 5102 | 13, |
263a36d4 | 5103 | "name LIKE '%s'", |
5eaef520 | 5104 | 1, |
263a36d4 | 5105 | "name", |
5eaef520 | 5106 | &glin_validate, |
03c05291 | 5107 | }, |
5eaef520 | 5108 | |
44da57b2 | 5109 | { |
5110 | /* Q_GLIN - GET_LIST_INFO, v3 */ | |
5111 | "get_list_info", | |
5112 | "glin", | |
5113 | 3, | |
5114 | RETRIEVE, | |
5115 | "l", | |
5116 | LIST_TABLE, | |
5117 | "name, active, publicflg, hidden, maillist, grouplist, gid, nfsgroup, acl_type, acl_id, description, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM list", | |
59c3208b | 5118 | glin3_fields, |
44da57b2 | 5119 | 14, |
5120 | "name LIKE '%s'", | |
5121 | 1, | |
5122 | "name", | |
5123 | &glin_validate, | |
5124 | }, | |
5125 | ||
59c3208b | 5126 | { |
5127 | /* Q_GLIN - GET_LIST_INFO, v4 */ | |
5128 | "get_list_info", | |
5129 | "glin", | |
5130 | 4, | |
5131 | RETRIEVE, | |
5132 | "l", | |
5133 | LIST_TABLE, | |
5134 | "name, active, publicflg, hidden, maillist, grouplist, gid, nfsgroup, acl_type, acl_id, memacl_type, memacl_id, description, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM list", | |
5135 | glin_fields, | |
5136 | 16, | |
5137 | "name LIKE '%s'", | |
5138 | 1, | |
5139 | "name", | |
5140 | &glin_validate, | |
5141 | }, | |
5142 | ||
03c05291 | 5143 | { |
5144 | /* Q_EXLN - EXPAND_LIST_NAMES */ | |
5145 | "expand_list_names", | |
5146 | "exln", | |
c44ddfa7 | 5147 | 2, |
03c05291 | 5148 | RETRIEVE, |
5149 | "l", | |
5150 | LIST_TABLE, | |
5151 | "name FROM list", | |
5152 | glin_fields, | |
5153 | 1, | |
263a36d4 | 5154 | "name LIKE '%s' AND list_id != 0", |
03c05291 | 5155 | 1, |
29028043 | 5156 | "name", |
263a36d4 | 5157 | NULL, |
03c05291 | 5158 | }, |
5eaef520 | 5159 | |
03c05291 | 5160 | { |
44da57b2 | 5161 | /* Q_ALIS - ADD_LIST, v2 */ /* uses prefetch_value() for list_id */ |
03c05291 | 5162 | "add_list", |
5163 | "alis", | |
c44ddfa7 | 5164 | 2, |
03c05291 | 5165 | APPEND, |
5166 | "l", | |
5eaef520 | 5167 | LIST_TABLE, |
5168 | "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)", | |
44da57b2 | 5169 | alis2_fields, |
03c05291 | 5170 | 10, |
5171 | 0, | |
5172 | 0, | |
29028043 | 5173 | NULL, |
44da57b2 | 5174 | &alis2_validate, |
5175 | }, | |
5176 | ||
5177 | { | |
5178 | /* Q_ALIS - ADD_LIST, v3 */ /* uses prefetch_value() for list_id */ | |
5179 | "add_list", | |
5180 | "alis", | |
5181 | 3, | |
5182 | APPEND, | |
5183 | "l", | |
5184 | LIST_TABLE, | |
5185 | "INTO list (name, active, publicflg, hidden, maillist, grouplist, gid, nfsgroup, acl_type, acl_id, description, list_id) VALUES ('%s', %s, %s, %s, %s, %s, %s, %s, '%s', %d, NVL('%s', CHR(0)), %s)", | |
59c3208b | 5186 | alis3_fields, |
44da57b2 | 5187 | 11, |
5188 | 0, | |
5189 | 0, | |
5190 | NULL, | |
59c3208b | 5191 | &alis3_validate, |
5192 | }, | |
5193 | ||
5194 | { | |
5195 | /* Q_ALIS - ADD_LIST, v4 */ /* uses prefetch_value() for list_id */ | |
5196 | "add_list", | |
5197 | "alis", | |
5198 | 4, | |
5199 | APPEND, | |
5200 | "l", | |
5201 | LIST_TABLE, | |
5202 | "INTO list (name, active, publicflg, hidden, maillist, grouplist, gid, nfsgroup, acl_type, acl_id, memacl_type, memacl_id, description, list_id) VALUES ('%s', %s, %s, %s, %s, %s, %s, %s, '%s', %d, '%s', %d, NVL('%s', CHR(0)), %s)", | |
5203 | alis_fields, | |
5204 | 13, | |
5205 | 0, | |
5206 | 0, | |
5207 | NULL, | |
03c05291 | 5208 | &alis_validate, |
5209 | }, | |
5210 | ||
5211 | { | |
44da57b2 | 5212 | /* Q_ULIS - UPDATE_LIST, v2 */ |
03c05291 | 5213 | "update_list", |
5214 | "ulis", | |
c44ddfa7 | 5215 | 2, |
03c05291 | 5216 | UPDATE, |
5217 | "l", | |
5218 | LIST_TABLE, | |
5eaef520 | 5219 | "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))", |
44da57b2 | 5220 | ulis2_fields, |
03c05291 | 5221 | 10, |
5222 | "list_id = %d", | |
5223 | 1, | |
29028043 | 5224 | NULL, |
44da57b2 | 5225 | &ulis2_validate, |
5226 | }, | |
5227 | ||
5228 | { | |
5229 | /* Q_ULIS - UPDATE_LIST, v3 */ | |
5230 | "update_list", | |
5231 | "ulis", | |
5232 | 3, | |
5233 | UPDATE, | |
5234 | "l", | |
5235 | LIST_TABLE, | |
5236 | "list SET name = '%s', active = %s, publicflg = %s, hidden = %s, maillist = %s, grouplist = %s, gid = %s, nfsgroup = %s, acl_type = '%s', acl_id = %d, description = NVL('%s', CHR(0))", | |
59c3208b | 5237 | ulis3_fields, |
44da57b2 | 5238 | 11, |
5239 | "list_id = %d", | |
5240 | 1, | |
5241 | NULL, | |
59c3208b | 5242 | &ulis3_validate, |
5243 | }, | |
5244 | ||
5245 | { | |
5246 | /* Q_ULIS, UPDATE_LIST, v4 */ | |
5247 | "update_list", | |
5248 | "ulis", | |
5249 | 4, | |
5250 | UPDATE, | |
5251 | "l", | |
5252 | LIST_TABLE, | |
5253 | "list SET name = '%s', active = %s, publicflg = %s, hidden = %s, maillist = %s, grouplist = %s, gid = %s, nfsgroup = %s, acl_type = '%s', acl_id = %d, memacl_type = '%s', memacl_id = %d, description = NVL('%s', CHR(0))", | |
5254 | ulis_fields, | |
5255 | 13, | |
5256 | "list_id = %d", | |
5257 | 1, | |
5258 | NULL, | |
03c05291 | 5259 | &ulis_validate, |
5260 | }, | |
5261 | ||
5262 | { | |
5263 | /* Q_DLIS - DELETE_LIST */ | |
5264 | "delete_list", | |
5265 | "dlis", | |
c44ddfa7 | 5266 | 2, |
03c05291 | 5267 | DELETE, |
5268 | "l", | |
5269 | LIST_TABLE, | |
7ac48069 | 5270 | NULL, |
03c05291 | 5271 | dlis_fields, |
5272 | 0, | |
5273 | "list_id = %d", | |
5274 | 1, | |
29028043 | 5275 | NULL, |
03c05291 | 5276 | &dlis_validate, |
5277 | }, | |
5278 | ||
5279 | { | |
5280 | /* Q_AMTL - ADD_MEMBER_TO_LIST */ | |
5281 | "add_member_to_list", | |
5282 | "amtl", | |
c44ddfa7 | 5283 | 2, |
03c05291 | 5284 | APPEND, |
5285 | 0, | |
5286 | IMEMBERS_TABLE, | |
5287 | 0, | |
5288 | amtl_fields, | |
5289 | 3, | |
7ac48069 | 5290 | NULL, |
03c05291 | 5291 | 0, |
29028043 | 5292 | NULL, |
03c05291 | 5293 | &amtl_validate, |
5294 | }, | |
5295 | ||
46b6f1f6 | 5296 | { |
5297 | /* Q_ATML - ADD_TAGGED_MEMBER_TO_LIST */ | |
5298 | "add_tagged_member_to_list", | |
5299 | "atml", | |
c44ddfa7 | 5300 | 2, |
46b6f1f6 | 5301 | APPEND, |
5302 | 0, | |
5303 | IMEMBERS_TABLE, | |
5304 | 0, | |
5305 | atml_fields, | |
5306 | 4, | |
5307 | NULL, | |
5308 | 0, | |
5309 | NULL, | |
5310 | &atml_validate, | |
5311 | }, | |
5312 | ||
5313 | { | |
5314 | /* Q_TMOL - TAG_MEMBER_OF_LIST */ | |
5315 | "tag_member_of_list", | |
5316 | "tmol", | |
c44ddfa7 | 5317 | 2, |
46b6f1f6 | 5318 | UPDATE, |
20541c25 | 5319 | 0, |
46b6f1f6 | 5320 | IMEMBERS_TABLE, |
20541c25 | 5321 | 0, |
46b6f1f6 | 5322 | atml_fields, |
5323 | 1, | |
20541c25 | 5324 | 0, |
46b6f1f6 | 5325 | 3, |
5326 | NULL, | |
5327 | &tmol_validate, | |
5328 | }, | |
5329 | ||
03c05291 | 5330 | { |
5331 | /* Q_DMFL - DELETE_MEMBER_FROM_LIST */ | |
5332 | "delete_member_from_list", | |
5333 | "dmfl", | |
c44ddfa7 | 5334 | 2, |
03c05291 | 5335 | DELETE, |
5336 | 0, | |
5337 | IMEMBERS_TABLE, | |
7ac48069 | 5338 | NULL, |
03c05291 | 5339 | amtl_fields, |
5340 | 0, | |
5341 | 0, | |
5342 | 3, | |
29028043 | 5343 | NULL, |
03c05291 | 5344 | &dmfl_validate, |
5345 | }, | |
5346 | ||
5347 | { | |
5348 | /* Q_GAUS - GET_ACE_USE */ | |
5349 | "get_ace_use", | |
5350 | "gaus", | |
c44ddfa7 | 5351 | 2, |
03c05291 | 5352 | RETRIEVE, |
5353 | 0, | |
5354 | 0, | |
5355 | 0, | |
5356 | gaus_fields, | |
5357 | 2, | |
5358 | 0, | |
5359 | 2, | |
29028043 | 5360 | NULL, |
03c05291 | 5361 | &gaus_validate, |
5362 | }, | |
5363 | ||
d3051625 | 5364 | { |
5365 | /* Q_GHBO - GET_HOST_BY_OWNER */ | |
5366 | "get_host_by_owner", | |
5367 | "ghbo", | |
5368 | 2, | |
5369 | RETRIEVE, | |
5370 | 0, | |
5371 | 0, | |
5372 | 0, | |
5373 | ghbo_fields, | |
5374 | 1, | |
5375 | 0, | |
5376 | 2, | |
5377 | NULL, | |
5378 | &ghbo_validate, | |
5379 | }, | |
5380 | ||
03c05291 | 5381 | { |
5382 | /* Q_QGLI - QUALIFIED_GET_LISTS */ | |
5383 | "qualified_get_lists", | |
5384 | "qgli", | |
c44ddfa7 | 5385 | 2, |
03c05291 | 5386 | RETRIEVE, |
5387 | 0, | |
5388 | LIST_TABLE, | |
5389 | 0, | |
5390 | qgli_fields, | |
5391 | 1, | |
5392 | 0, | |
5393 | 5, | |
29028043 | 5394 | NULL, |
03c05291 | 5395 | &qgli_validate, |
5396 | }, | |
5397 | ||
5398 | { | |
5399 | /* Q_GMOL - GET_MEMBERS_OF_LIST */ | |
5400 | "get_members_of_list", | |
5401 | "gmol", | |
c44ddfa7 | 5402 | 2, |
03c05291 | 5403 | RETRIEVE, |
7ac48069 | 5404 | NULL, |
03c05291 | 5405 | IMEMBERS_TABLE, |
7ac48069 | 5406 | NULL, |
03c05291 | 5407 | gmol_fields, |
5408 | 2, | |
7ac48069 | 5409 | NULL, |
03c05291 | 5410 | 1, |
29028043 | 5411 | NULL, |
03c05291 | 5412 | &gmol_validate, |
5413 | }, | |
5414 | ||
5415 | { | |
5416 | /* Q_GEML - GET_END_MEMBERS_OF_LIST */ | |
5417 | "get_end_members_of_list", | |
5418 | "geml", | |
c44ddfa7 | 5419 | 2, |
03c05291 | 5420 | RETRIEVE, |
7ac48069 | 5421 | NULL, |
03c05291 | 5422 | IMEMBERS_TABLE, |
7ac48069 | 5423 | NULL, |
03c05291 | 5424 | gmol_fields, |
fd8d2149 | 5425 | 2, |
7ac48069 | 5426 | NULL, |
03c05291 | 5427 | 1, |
29028043 | 5428 | NULL, |
46b6f1f6 | 5429 | &gmol_validate, |
5430 | }, | |
5431 | ||
5432 | { | |
5433 | /* Q_GTML - GET_TAGGED_MEMBERS_OF_LIST */ | |
5434 | "get_tagged_members_of_list", | |
5435 | "gtml", | |
c44ddfa7 | 5436 | 2, |
46b6f1f6 | 5437 | RETRIEVE, |
5438 | NULL, | |
5439 | IMEMBERS_TABLE, | |
5440 | NULL, | |
5441 | gtml_fields, | |
5442 | 3, | |
5443 | NULL, | |
5444 | 1, | |
5445 | NULL, | |
5446 | &gmol_validate, | |
03c05291 | 5447 | }, |
5eaef520 | 5448 | |
03c05291 | 5449 | { |
5450 | /* Q_GLOM - GET_LISTS_OF_MEMBER */ | |
5451 | "get_lists_of_member", | |
5452 | "glom", | |
c44ddfa7 | 5453 | 2, |
03c05291 | 5454 | RETRIEVE, |
5455 | 0, | |
5456 | IMEMBERS_TABLE, | |
5457 | 0, | |
5458 | glom_fields, | |
5459 | 6, | |
5460 | 0, | |
5461 | 2, | |
29028043 | 5462 | NULL, |
03c05291 | 5463 | &glom_validate, |
5464 | }, | |
5465 | ||
5466 | { | |
5467 | /* Q_CMOL - COUNT_MEMBERS_OF_LIST */ | |
5468 | "count_members_of_list", | |
5469 | "cmol", | |
c44ddfa7 | 5470 | 2, |
03c05291 | 5471 | RETRIEVE, |
5472 | 0, | |
5473 | IMEMBERS_TABLE, | |
5474 | 0, | |
5475 | cmol_fields, | |
5476 | 1, | |
5477 | 0, | |
5478 | 1, | |
29028043 | 5479 | NULL, |
03c05291 | 5480 | &cmol_validate, |
5481 | }, | |
5482 | ||
d33e787c | 5483 | { |
5484 | /* Q_GSIN - GET_SERVER_INFO */ | |
5485 | "get_server_info", | |
5486 | "gsin", | |
c44ddfa7 | 5487 | 2, |
d33e787c | 5488 | RETRIEVE, |
5489 | "s", | |
03c05291 | 5490 | SERVERS_TABLE, |
5491 | "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 | 5492 | gsin_fields, |
7ac4c1b1 | 5493 | 16, |
263a36d4 | 5494 | "name LIKE UPPER('%s')", |
d33e787c | 5495 | 1, |
29028043 | 5496 | "name", |
d33e787c | 5497 | &gsin_validate, |
5498 | }, | |
5499 | ||
5500 | { | |
5501 | /* Q_QGSV - QUALIFIED_GET_SERVER */ | |
5502 | "qualified_get_server", | |
5503 | "qgsv", | |
c44ddfa7 | 5504 | 2, |
d33e787c | 5505 | RETRIEVE, |
5506 | 0, | |
03c05291 | 5507 | SERVERS_TABLE, |
d33e787c | 5508 | 0, |
5509 | qgsv_fields, | |
5510 | 1, | |
5511 | 0, | |
5512 | 3, | |
29028043 | 5513 | NULL, |
d33e787c | 5514 | &qgsv_validate, |
5515 | }, | |
5516 | ||
5517 | { | |
5518 | /* Q_ASIN - ADD_SERVER_INFO */ | |
5519 | "add_server_info", | |
5520 | "asin", | |
c44ddfa7 | 5521 | 2, |
d33e787c | 5522 | APPEND, |
5523 | "s", | |
03c05291 | 5524 | SERVERS_TABLE, |
5eaef520 | 5525 | "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 | 5526 | asin_fields, |
5527 | 8, | |
7ac48069 | 5528 | NULL, |
d33e787c | 5529 | 0, |
29028043 | 5530 | NULL, |
d33e787c | 5531 | &asin_validate, |
5532 | }, | |
5533 | ||
5534 | { | |
5535 | /* Q_USIN - UPDATE_SERVER_INFO */ | |
5536 | "update_server_info", | |
5537 | "usin", | |
c44ddfa7 | 5538 | 2, |
d33e787c | 5539 | UPDATE, |
5540 | "s", | |
03c05291 | 5541 | SERVERS_TABLE, |
4e5ec77f | 5542 | "servers SET update_int = %s, target_file = '%s', script = '%s', type = '%s', enable = %s, acl_type = '%s', acl_id = %d", |
d33e787c | 5543 | asin_fields, |
5544 | 7, | |
03c05291 | 5545 | "name = UPPER('%s')", |
d33e787c | 5546 | 1, |
29028043 | 5547 | NULL, |
d33e787c | 5548 | &asin_validate, |
5549 | }, | |
5550 | ||
5551 | { | |
5552 | /* Q_RSVE - RESET_SERVER_ERROR */ | |
5553 | "reset_server_error", | |
5554 | "rsve", | |
c44ddfa7 | 5555 | 2, |
d33e787c | 5556 | UPDATE, |
5557 | "s", | |
03c05291 | 5558 | SERVERS_TABLE, |
4e5ec77f | 5559 | "servers SET harderror = 0, dfcheck = dfgen", |
d33e787c | 5560 | dsin_fields, |
5561 | 0, | |
03c05291 | 5562 | "name = UPPER('%s')", |
d33e787c | 5563 | 1, |
29028043 | 5564 | NULL, |
d33e787c | 5565 | &rsve_validate, |
5566 | }, | |
5567 | ||
5568 | { | |
5569 | /* Q_SSIF - SET_SERVER_INTERNAL_FLAGS */ | |
5570 | "set_server_internal_flags", | |
5571 | "ssif", | |
c44ddfa7 | 5572 | 2, |
d33e787c | 5573 | UPDATE, |
5574 | "s", | |
03c05291 | 5575 | SERVERS_TABLE, |
5eaef520 | 5576 | "servers SET dfgen = %s, dfcheck = %s, inprogress = %s, harderror = %s, errmsg = NVL('%s', CHR(0))", |
d33e787c | 5577 | ssif_fields, |
7ac4c1b1 | 5578 | 5, |
03c05291 | 5579 | "name = UPPER('%s')", |
d33e787c | 5580 | 1, |
29028043 | 5581 | NULL, |
d33e787c | 5582 | &ssif_validate, |
5583 | }, | |
5584 | ||
5585 | { | |
5586 | /* Q_DSIN - DELETE_SERVER_INFO */ | |
5587 | "delete_server_info", | |
5588 | "dsin", | |
c44ddfa7 | 5589 | 2, |
d33e787c | 5590 | DELETE, |
5591 | "s", | |
03c05291 | 5592 | SERVERS_TABLE, |
7ac48069 | 5593 | NULL, |
d33e787c | 5594 | dsin_fields, |
5595 | 0, | |
03c05291 | 5596 | "name = UPPER('%s')", |
d33e787c | 5597 | 1, |
29028043 | 5598 | NULL, |
d33e787c | 5599 | &dsin_validate, |
5600 | }, | |
5601 | ||
5602 | { | |
5eaef520 | 5603 | /* Q_GSHI - GET_SERVER_HOST_INFO */ |
d33e787c | 5604 | "get_server_host_info", |
5605 | "gshi", | |
c44ddfa7 | 5606 | 2, |
d33e787c | 5607 | RETRIEVE, |
5608 | "sh", | |
03c05291 | 5609 | SERVERHOSTS_TABLE, |
5610 | "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 | 5611 | gshi_fields, |
5612 | 16, | |
263a36d4 | 5613 | "sh.service LIKE UPPER('%s') AND m.name LIKE UPPER('%s') AND m.mach_id = sh.mach_id", |
d33e787c | 5614 | 2, |
29028043 | 5615 | "sh.service, m.name", |
d33e787c | 5616 | &gshi_validate, |
5617 | }, | |
5618 | ||
5619 | { | |
135dcb80 | 5620 | /* Q_QGSH - QUALIFIED_GET_SERVER_HOST */ |
d33e787c | 5621 | "qualified_get_server_host", |
5622 | "qgsh", | |
c44ddfa7 | 5623 | 2, |
d33e787c | 5624 | RETRIEVE, |
135dcb80 | 5625 | 0, |
03c05291 | 5626 | SERVERHOSTS_TABLE, |
d33e787c | 5627 | 0, |
5628 | qgsh_fields, | |
5629 | 2, | |
5630 | 0, | |
5631 | 6, | |
29028043 | 5632 | NULL, |
d33e787c | 5633 | &qgsh_validate, |
5634 | }, | |
5635 | ||
5636 | { | |
5637 | /* Q_ASHI - ADD_SERVER_HOST_INFO */ | |
5638 | "add_server_host_info", | |
5639 | "ashi", | |
c44ddfa7 | 5640 | 2, |
d33e787c | 5641 | APPEND, |
5642 | "sh", | |
03c05291 | 5643 | SERVERHOSTS_TABLE, |
5eaef520 | 5644 | "INTO serverhosts (service, mach_id, enable, value1, value2, value3) VALUES (UPPER('%s'), %d, %s, %s, %s, NVL('%s', CHR(0)))", |
d33e787c | 5645 | ashi_fields, |
5646 | 6, | |
7ac48069 | 5647 | NULL, |
d33e787c | 5648 | 0, |
29028043 | 5649 | NULL, |
d33e787c | 5650 | &ashi_validate, |
5651 | }, | |
5652 | ||
5653 | { | |
5654 | /* Q_USHI - UPDATE_SERVER_HOST_INFO */ | |
5655 | "update_server_host_info", | |
5656 | "ushi", | |
c44ddfa7 | 5657 | 2, |
d33e787c | 5658 | UPDATE, |
5659 | "sh", | |
03c05291 | 5660 | SERVERHOSTS_TABLE, |
5eaef520 | 5661 | "serverhosts SET enable = %s, value1 = %s, value2 = %s, value3 = NVL('%s', CHR(0))", |
d33e787c | 5662 | ashi_fields, |
5663 | 4, | |
03c05291 | 5664 | "service = UPPER('%s') AND mach_id = %d", |
d33e787c | 5665 | 2, |
29028043 | 5666 | NULL, |
d33e787c | 5667 | &ashi_validate, |
5668 | }, | |
5669 | ||
5670 | { | |
5671 | /* Q_RSHE - RESET_SERVER_HOST_ERROR */ | |
5672 | "reset_server_host_error", | |
5673 | "rshe", | |
c44ddfa7 | 5674 | 2, |
d33e787c | 5675 | UPDATE, |
5676 | "sh", | |
03c05291 | 5677 | SERVERHOSTS_TABLE, |
4e5ec77f | 5678 | "serverhosts SET hosterror = 0", |
d33e787c | 5679 | dshi_fields, |
5680 | 0, | |
03c05291 | 5681 | "service = UPPER('%s') AND mach_id = %d", |
d33e787c | 5682 | 2, |
29028043 | 5683 | NULL, |
d33e787c | 5684 | &rshe_validate, |
5685 | }, | |
5686 | ||
5687 | { | |
5688 | /* Q_SSHO - SET_SERVER_HOST_OVERRIDE */ | |
5689 | "set_server_host_override", | |
5690 | "ssho", | |
c44ddfa7 | 5691 | 2, |
d33e787c | 5692 | UPDATE, |
5693 | "sh", | |
03c05291 | 5694 | SERVERHOSTS_TABLE, |
4e5ec77f | 5695 | "serverhosts SET override = 1", |
d33e787c | 5696 | dshi_fields, |
5697 | 0, | |
03c05291 | 5698 | "service = UPPER('%s') AND mach_id = %d", |
d33e787c | 5699 | 2, |
29028043 | 5700 | NULL, |
d33e787c | 5701 | &ssho_validate, |
5702 | }, | |
5703 | ||
5704 | { | |
e41960ac | 5705 | /* Q_SSHI - SET_SERVER_HOST_INTERNAL */ |
d33e787c | 5706 | "set_server_host_internal", |
5707 | "sshi", | |
c44ddfa7 | 5708 | 2, |
d33e787c | 5709 | UPDATE, |
7ac4c1b1 | 5710 | "s", |
03c05291 | 5711 | SERVERHOSTS_TABLE, |
5eaef520 | 5712 | "serverhosts SET override = %s, success = %s, inprogress = %s, hosterror = %s, hosterrmsg = NVL('%s', CHR(0)), ltt = %s, lts = %s", |
d33e787c | 5713 | sshi_fields, |
5714 | 7, | |
5eaef520 | 5715 | "service = UPPER('%s') AND mach_id = %d", |
d33e787c | 5716 | 2, |
29028043 | 5717 | NULL, |
d33e787c | 5718 | &sshi_validate, |
5719 | }, | |
5720 | ||
5721 | { | |
03c05291 | 5722 | /* Q_DSHI - DELETE_SERVER_HOST_INFO */ |
5723 | "delete_server_host_info", | |
5724 | "dshi", | |
c44ddfa7 | 5725 | 2, |
d33e787c | 5726 | DELETE, |
03c05291 | 5727 | "sh", |
5728 | SERVERHOSTS_TABLE, | |
7ac48069 | 5729 | NULL, |
03c05291 | 5730 | dshi_fields, |
d33e787c | 5731 | 0, |
03c05291 | 5732 | "service = UPPER('%s') AND mach_id = %d", |
5733 | 2, | |
29028043 | 5734 | NULL, |
03c05291 | 5735 | &dshi_validate, |
d33e787c | 5736 | }, |
5737 | ||
5738 | { | |
5eaef520 | 5739 | /* Q_GSLO - GET_SERVER_LOCATIONS */ |
d33e787c | 5740 | "get_server_locations", |
5741 | "gslo", | |
c44ddfa7 | 5742 | 2, |
d33e787c | 5743 | RETRIEVE, |
5744 | "sh", | |
03c05291 | 5745 | SERVERHOSTS_TABLE, |
5746 | "sh.service, m.name FROM serverhosts sh, machine m", | |
d33e787c | 5747 | gslo_fields, |
5748 | 2, | |
263a36d4 | 5749 | "sh.service LIKE UPPER('%s') AND sh.mach_id = m.mach_id", |
d33e787c | 5750 | 1, |
29028043 | 5751 | "sh.service, m.name", |
263a36d4 | 5752 | NULL, |
d33e787c | 5753 | }, |
5754 | ||
5755 | { | |
5eaef520 | 5756 | /* Q_GFSL - GET_FILESYS_BY_LABEL */ |
d33e787c | 5757 | "get_filesys_by_label", |
5758 | "gfsl", | |
c44ddfa7 | 5759 | 2, |
d33e787c | 5760 | RETRIEVE, |
5761 | "fs", | |
03c05291 | 5762 | FILESYS_TABLE, |
5763 | "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 | 5764 | gfsl_fields, |
5765 | 14, | |
263a36d4 | 5766 | "fs.label LIKE '%s' AND fs.mach_id = m.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id", |
d33e787c | 5767 | 1, |
29028043 | 5768 | "fs.label", |
5a8887d8 | 5769 | &gfsl_validate, |
d33e787c | 5770 | }, |
5771 | ||
5772 | { | |
5eaef520 | 5773 | /* Q_GFSM - GET_FILESYS_BY_MACHINE */ |
d33e787c | 5774 | "get_filesys_by_machine", |
5775 | "gfsm", | |
c44ddfa7 | 5776 | 2, |
d33e787c | 5777 | RETRIEVE, |
5778 | "fs", | |
03c05291 | 5779 | FILESYS_TABLE, |
5780 | "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 | 5781 | gfsm_fields, |
5782 | 14, | |
4e5ec77f | 5783 | "fs.mach_id = %d AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id", |
d33e787c | 5784 | 1, |
29028043 | 5785 | "fs.label", |
d33e787c | 5786 | &gfsm_validate, |
5787 | }, | |
5788 | ||
88343c5e | 5789 | { |
5eaef520 | 5790 | /* Q_GFSN - GET_FILESYS_BY_NFSPHYS */ |
88343c5e | 5791 | "get_filesys_by_nfsphys", |
5792 | "gfsn", | |
c44ddfa7 | 5793 | 2, |
88343c5e | 5794 | RETRIEVE, |
5795 | "fs", | |
03c05291 | 5796 | FILESYS_TABLE, |
5797 | "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 | 5798 | gfsn_fields, |
5799 | 14, | |
cc1bca5c | 5800 | "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'", |
88343c5e | 5801 | 2, |
29028043 | 5802 | "fs.label", |
99e09b48 | 5803 | &gfsn_validate, |
88343c5e | 5804 | }, |
5805 | ||
d33e787c | 5806 | { |
5eaef520 | 5807 | /* Q_GFSG - GET_FILESYS_BY_GROUP */ |
d33e787c | 5808 | "get_filesys_by_group", |
5809 | "gfsg", | |
c44ddfa7 | 5810 | 2, |
d33e787c | 5811 | RETRIEVE, |
5812 | "fs", | |
03c05291 | 5813 | FILESYS_TABLE, |
5814 | "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 | 5815 | gfsg_fields, |
5816 | 14, | |
4e5ec77f | 5817 | "fs.owners = %d AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id", |
d33e787c | 5818 | 1, |
29028043 | 5819 | "fs.label", |
d33e787c | 5820 | &gfsg_validate, |
5821 | }, | |
5822 | ||
4ffa124a | 5823 | { |
76f86976 | 5824 | /* Q_GFSP - GET_FILESYS_BY_PATH */ |
4ffa124a | 5825 | "get_filesys_by_path", |
5826 | "gfsp", | |
c44ddfa7 | 5827 | 2, |
4ffa124a | 5828 | RETRIEVE, |
5829 | "fs", | |
03c05291 | 5830 | FILESYS_TABLE, |
5831 | "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 | 5832 | gfsp_fields, |
5833 | 14, | |
263a36d4 | 5834 | "fs.name LIKE '%s' AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = list_id", |
4ffa124a | 5835 | 1, |
29028043 | 5836 | "fs.label", |
263a36d4 | 5837 | &VDfix_modby, |
4ffa124a | 5838 | }, |
5eaef520 | 5839 | |
d33e787c | 5840 | { |
45bf7573 | 5841 | /* Q_AFIL - ADD_FILESYS */ /* uses prefetch_value() for filsys_id */ |
d33e787c | 5842 | "add_filesys", |
5843 | "afil", | |
c44ddfa7 | 5844 | 2, |
d33e787c | 5845 | APPEND, |
5846 | "fs", | |
03c05291 | 5847 | FILESYS_TABLE, |
d4296047 | 5848 | "INTO filesys (label, type, mach_id, name, mount, rwaccess, comments, owner, owners, createflg, lockertype, filsys_id) VALUES ('%s', '%s', %d, NVL('%s', CHR(0)), NVL('%s', CHR(0)), '%s', NVL('%s', CHR(0)), %d, %d, %s, '%s', %s)", |
d33e787c | 5849 | afil_fields, |
5850 | 11, | |
45bf7573 | 5851 | 0, |
d33e787c | 5852 | 0, |
29028043 | 5853 | NULL, |
d33e787c | 5854 | &afil_validate, |
5855 | }, | |
5856 | ||
5857 | { | |
5858 | /* Q_UFIL - UPDATE_FILESYS */ | |
5859 | "update_filesys", | |
5860 | "ufil", | |
c44ddfa7 | 5861 | 2, |
d33e787c | 5862 | UPDATE, |
5863 | "fs", | |
03c05291 | 5864 | FILESYS_TABLE, |
d4296047 | 5865 | "filesys SET label = '%s', type = '%s', mach_id = %d, name = NVL('%s', CHR(0)), mount = NVL('%s', CHR(0)), rwaccess = '%s', comments = NVL('%s', CHR(0)), owner = %d, owners = %d, createflg = %s, lockertype = '%s'", |
d33e787c | 5866 | ufil_fields, |
5867 | 11, | |
4e5ec77f | 5868 | "filsys_id = %d", |
d33e787c | 5869 | 1, |
29028043 | 5870 | NULL, |
5eaef520 | 5871 | &ufil_validate, |
d33e787c | 5872 | }, |
5873 | ||
5874 | { | |
5875 | /* Q_DFIL - DELETE_FILESYS */ | |
5876 | "delete_filesys", | |
5877 | "dfil", | |
c44ddfa7 | 5878 | 2, |
d33e787c | 5879 | DELETE, |
5880 | "fs", | |
03c05291 | 5881 | FILESYS_TABLE, |
7ac48069 | 5882 | NULL, |
d33e787c | 5883 | dfil_fields, |
5884 | 0, | |
4e5ec77f | 5885 | "filsys_id = %d", |
d33e787c | 5886 | 1, |
29028043 | 5887 | NULL, |
d33e787c | 5888 | &dfil_validate, |
5889 | }, | |
5890 | ||
95127ba8 | 5891 | { |
5eaef520 | 5892 | /* Q_GFGM - GET_FSGROUP_MEMBERS */ |
95127ba8 | 5893 | "get_fsgroup_members", |
5894 | "gfgm", | |
c44ddfa7 | 5895 | 2, |
95127ba8 | 5896 | RETRIEVE, |
5897 | "fg", | |
03c05291 | 5898 | FSGROUP_TABLE, |
5899 | "fs.label, fg.key FROM fsgroup fg, filesys fs", | |
95127ba8 | 5900 | gfgm_fields, |
5901 | 2, | |
4e5ec77f | 5902 | "fg.group_id = %d AND fs.filsys_id = fg.filsys_id", |
95127ba8 | 5903 | 1, |
29028043 | 5904 | "fs.label, fg.key", |
95127ba8 | 5905 | &gfgm_validate, |
5906 | }, | |
5907 | ||
5908 | { | |
76f86976 | 5909 | /* Q_AFTG - ADD_FILESYS_TO_FSGROUP */ |
95127ba8 | 5910 | "add_filesys_to_fsgroup", |
5911 | "aftg", | |
c44ddfa7 | 5912 | 2, |
95127ba8 | 5913 | APPEND, |
5914 | "fg", | |
03c05291 | 5915 | FSGROUP_TABLE, |
5eaef520 | 5916 | "INTO fsgroup (group_id, filsys_id, key) VALUES (%d, %d, '%s')", |
95127ba8 | 5917 | gfgm_fields, |
76f86976 | 5918 | 3, |
7ac48069 | 5919 | NULL, |
76f86976 | 5920 | 0, |
29028043 | 5921 | NULL, |
95127ba8 | 5922 | &aftg_validate, |
5923 | }, | |
5924 | ||
5925 | { | |
5926 | /* Q_RFFG - REMOVE_FILESYS_FROM_FSGROUP */ | |
5927 | "remove_filesys_from_fsgroup", | |
5928 | "rffg", | |
c44ddfa7 | 5929 | 2, |
95127ba8 | 5930 | DELETE, |
5931 | "fg", | |
03c05291 | 5932 | FSGROUP_TABLE, |
7ac48069 | 5933 | NULL, |
95127ba8 | 5934 | gfgm_fields, |
5935 | 0, | |
4e5ec77f | 5936 | "group_id = %d AND filsys_id = %d", |
95127ba8 | 5937 | 2, |
29028043 | 5938 | NULL, |
95127ba8 | 5939 | &aftg_validate, |
5940 | }, | |
5941 | ||
d33e787c | 5942 | { |
5eaef520 | 5943 | /* Q_GANF - GET_ALL_NFSPHYS */ |
d33e787c | 5944 | "get_all_nfsphys", |
5945 | "ganf", | |
c44ddfa7 | 5946 | 2, |
d33e787c | 5947 | RETRIEVE, |
5948 | "np", | |
03c05291 | 5949 | NFSPHYS_TABLE, |
5950 | "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 | 5951 | ganf_fields, |
5952 | 9, | |
4e5ec77f | 5953 | "m.mach_id = np.mach_id", |
d33e787c | 5954 | 0, |
29028043 | 5955 | "m.name, np.dir", |
5956 | &VDfix_modby, | |
d33e787c | 5957 | }, |
5958 | ||
5959 | { | |
5eaef520 | 5960 | /* Q_GNFP - GET_NFSPHYS */ |
d33e787c | 5961 | "get_nfsphys", |
5962 | "gnfp", | |
c44ddfa7 | 5963 | 2, |
d33e787c | 5964 | RETRIEVE, |
5965 | "np", | |
03c05291 | 5966 | NFSPHYS_TABLE, |
5967 | "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 | 5968 | gnfp_fields, |
5969 | 9, | |
263a36d4 | 5970 | "np.mach_id = %d AND np.dir LIKE '%s' AND m.mach_id = np.mach_id", |
d33e787c | 5971 | 2, |
29028043 | 5972 | "m.name, np.dir", |
d33e787c | 5973 | &gnfp_validate, |
5974 | }, | |
5975 | ||
5976 | { | |
45bf7573 | 5977 | /* Q_ANFP - ADD_NFSPHYS */ /* uses prefetch_value() for nfsphys_id */ |
d33e787c | 5978 | "add_nfsphys", |
5979 | "anfp", | |
c44ddfa7 | 5980 | 2, |
d33e787c | 5981 | APPEND, |
5982 | "np", | |
03c05291 | 5983 | NFSPHYS_TABLE, |
5eaef520 | 5984 | "INTO nfsphys (mach_id, dir, device, status, allocated, partsize, nfsphys_id) VALUES (%d, '%s', NVL('%s', CHR(0)), %s, %s, %s, %s)", |
d33e787c | 5985 | ganf_fields, |
5986 | 6, | |
45bf7573 | 5987 | 0, |
d33e787c | 5988 | 0, |
29028043 | 5989 | NULL, |
d33e787c | 5990 | &anfp_validate, |
5991 | }, | |
5992 | ||
5993 | { | |
5994 | /* Q_UNFP - UPDATE_NFSPHYS */ | |
5995 | "update_nfsphys", | |
5996 | "unfp", | |
c44ddfa7 | 5997 | 2, |
d33e787c | 5998 | UPDATE, |
5999 | "np", | |
03c05291 | 6000 | NFSPHYS_TABLE, |
5eaef520 | 6001 | "nfsphys SET device = NVL('%s', CHR(0)), status = %s, allocated = %s, partsize = %s", |
135dcb80 | 6002 | ganf_fields, |
d33e787c | 6003 | 4, |
5eaef520 | 6004 | "mach_id = %d AND dir = '%s'", |
d33e787c | 6005 | 2, |
29028043 | 6006 | NULL, |
45bf7573 | 6007 | &unfp_validate, |
d33e787c | 6008 | }, |
6009 | ||
6010 | { | |
6011 | /* Q_AJNF - ADJUST_NFSPHYS_ALLOCATION */ | |
6012 | "adjust_nfsphys_allocation", | |
6013 | "ajnf", | |
c44ddfa7 | 6014 | 2, |
d33e787c | 6015 | UPDATE, |
6016 | "np", | |
03c05291 | 6017 | NFSPHYS_TABLE, |
4e5ec77f | 6018 | "nfsphys SET allocated = allocated + %s", |
99e09b48 | 6019 | ajnf_fields, |
d33e787c | 6020 | 1, |
4e5ec77f | 6021 | "mach_id = %d AND dir = '%s'", |
d33e787c | 6022 | 2, |
29028043 | 6023 | NULL, |
f802fd0d | 6024 | &ajnf_validate, |
d33e787c | 6025 | }, |
6026 | ||
6027 | { | |
6028 | /* Q_DNFP - DELETE_NFSPHYS */ | |
6029 | "delete_nfsphys", | |
6030 | "dnfp", | |
c44ddfa7 | 6031 | 2, |
d33e787c | 6032 | DELETE, |
6033 | "np", | |
03c05291 | 6034 | NFSPHYS_TABLE, |
7ac48069 | 6035 | NULL, |
d33e787c | 6036 | dnfp_fields, |
6037 | 0, | |
4e5ec77f | 6038 | "mach_id = %d AND dir = '%s'", |
d33e787c | 6039 | 2, |
29028043 | 6040 | NULL, |
d33e787c | 6041 | &dnfp_validate, |
6042 | }, | |
6043 | ||
368be132 | 6044 | { |
5eaef520 | 6045 | /* Q_GQOT - GET_QUOTA */ |
368be132 | 6046 | "get_quota", |
6047 | "gqot", | |
c44ddfa7 | 6048 | 2, |
368be132 | 6049 | RETRIEVE, |
6050 | "q", | |
03c05291 | 6051 | QUOTA_TABLE, |
6052 | "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 | 6053 | gqot_fields, |
6054 | 9, | |
263a36d4 | 6055 | "fs.label LIKE '%s' AND q.type = '%s' AND q.entity_id = %d AND fs.filsys_id = q.filsys_id AND m.mach_id = fs.mach_id", |
368be132 | 6056 | 3, |
29028043 | 6057 | NULL, |
368be132 | 6058 | &gqot_validate, |
6059 | }, | |
6060 | ||
6061 | { | |
5eaef520 | 6062 | /* Q_GQBF - GET_QUOTA_BY_FILESYS */ |
368be132 | 6063 | "get_quota_by_filesys", |
6064 | "gqbf", | |
c44ddfa7 | 6065 | 2, |
368be132 | 6066 | RETRIEVE, |
6067 | "q", | |
03c05291 | 6068 | QUOTA_TABLE, |
6069 | "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 | 6070 | gqbf_fields, |
6071 | 9, | |
263a36d4 | 6072 | "fs.label LIKE '%s' AND fs.filsys_id = q.filsys_id AND m.mach_id = fs.mach_id", |
368be132 | 6073 | 1, |
29028043 | 6074 | "fs.label, q.type", |
368be132 | 6075 | &gqbf_validate, |
6076 | }, | |
6077 | ||
6078 | { | |
135dcb80 | 6079 | /* Q_AQOT - ADD_QUOTA */ /* prefetch_filsys() gets last 1 value */ |
368be132 | 6080 | "add_quota", |
6081 | "aqot", | |
c44ddfa7 | 6082 | 2, |
368be132 | 6083 | APPEND, |
135dcb80 | 6084 | 0, |
03c05291 | 6085 | QUOTA_TABLE, |
135dcb80 | 6086 | "INTO quota (filsys_id, type, entity_id, quota, phys_id) VALUES ('%s', %d, %d, %s, %s)", |
368be132 | 6087 | aqot_fields, |
135dcb80 | 6088 | 4, |
7ac48069 | 6089 | NULL, |
76f86976 | 6090 | 0, |
29028043 | 6091 | NULL, |
368be132 | 6092 | &aqot_validate, |
6093 | }, | |
6094 | ||
6095 | { | |
6096 | /* Q_UQOT - UPDATE_QUOTA */ | |
6097 | "update_quota", | |
6098 | "uqot", | |
c44ddfa7 | 6099 | 2, |
368be132 | 6100 | UPDATE, |
135dcb80 | 6101 | 0, |
03c05291 | 6102 | QUOTA_TABLE, |
4e5ec77f | 6103 | "quota SET quota = %s", |
368be132 | 6104 | aqot_fields, |
6105 | 1, | |
135dcb80 | 6106 | 0, |
368be132 | 6107 | 3, |
29028043 | 6108 | NULL, |
368be132 | 6109 | &uqot_validate, |
6110 | }, | |
6111 | ||
6112 | { | |
6113 | /* Q_DQOT - DELETE_QUOTA */ | |
6114 | "delete_quota", | |
6115 | "dqot", | |
c44ddfa7 | 6116 | 2, |
368be132 | 6117 | DELETE, |
135dcb80 | 6118 | 0, |
03c05291 | 6119 | QUOTA_TABLE, |
7ac48069 | 6120 | NULL, |
368be132 | 6121 | aqot_fields, |
6122 | 0, | |
135dcb80 | 6123 | 0, |
368be132 | 6124 | 3, |
29028043 | 6125 | NULL, |
368be132 | 6126 | &dqot_validate, |
6127 | }, | |
6128 | ||
d33e787c | 6129 | { |
5eaef520 | 6130 | /* Q_GNFQ - GET_NFS_QUOTAS */ |
88343c5e | 6131 | "get_nfs_quota", |
d33e787c | 6132 | "gnfq", |
c44ddfa7 | 6133 | 2, |
d33e787c | 6134 | RETRIEVE, |
368be132 | 6135 | "q", |
03c05291 | 6136 | QUOTA_TABLE, |
6137 | "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 | 6138 | gnfq_fields, |
6139 | 8, | |
263a36d4 | 6140 | "fs.label LIKE '%s' 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 | 6141 | 2, |
29028043 | 6142 | "fs.label, u.login", |
d33e787c | 6143 | &gnfq_validate, |
6144 | }, | |
6145 | ||
6146 | { | |
5eaef520 | 6147 | /* Q_GNQP - GET_NFS_QUOTAS_BY_PARTITION */ |
d33e787c | 6148 | "get_nfs_quotas_by_partition", |
6149 | "gnqp", | |
c44ddfa7 | 6150 | 2, |
d33e787c | 6151 | RETRIEVE, |
368be132 | 6152 | "q", |
03c05291 | 6153 | QUOTA_TABLE, |
6154 | "fs.label, u.login, q.quota, np.dir, m.name FROM quota q, filesys fs, users u, nfsphys np, machine m", | |
d33e787c | 6155 | gnqp_fields, |
6156 | 5, | |
263a36d4 | 6157 | "np.mach_id = %d AND np.dir LIKE '%s' 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 | 6158 | 2, |
29028043 | 6159 | "fs.label", |
263a36d4 | 6160 | NULL, |
d33e787c | 6161 | }, |
6162 | ||
d33e787c | 6163 | { |
135dcb80 | 6164 | /* Q_ANFQ - ADD_NFS_QUOTA */ /* prefetch_filsys() gets last 1 value */ |
d33e787c | 6165 | "add_nfs_quota", |
6166 | "anfq", | |
c44ddfa7 | 6167 | 2, |
d33e787c | 6168 | APPEND, |
135dcb80 | 6169 | 0, |
03c05291 | 6170 | QUOTA_TABLE, |
135dcb80 | 6171 | "INTO quota (type, filsys_id, entity_id, quota, phys_id ) VALUES ('USER', %d, %d, %s, %s)", |
d33e787c | 6172 | anfq_fields, |
135dcb80 | 6173 | 3, |
7ac48069 | 6174 | NULL, |
76f86976 | 6175 | 0, |
29028043 | 6176 | NULL, |
d33e787c | 6177 | &anfq_validate, |
6178 | }, | |
6179 | ||
6180 | { | |
5eaef520 | 6181 | /* Q_UNFQ - UPDATE_NFS_QUOTA */ |
d33e787c | 6182 | "update_nfs_quota", |
6183 | "unfq", | |
c44ddfa7 | 6184 | 2, |
d33e787c | 6185 | UPDATE, |
135dcb80 | 6186 | 0, |
03c05291 | 6187 | QUOTA_TABLE, |
4e5ec77f | 6188 | "quota SET quota = %s", |
d33e787c | 6189 | anfq_fields, |
6190 | 1, | |
135dcb80 | 6191 | 0, |
d33e787c | 6192 | 2, |
29028043 | 6193 | NULL, |
d33e787c | 6194 | &unfq_validate, |
6195 | }, | |
6196 | ||
6197 | { | |
6198 | /* Q_DNFQ - DELETE_NFS_QUOTA */ | |
6199 | "delete_nfs_quota", | |
6200 | "dnfq", | |
c44ddfa7 | 6201 | 2, |
d33e787c | 6202 | DELETE, |
135dcb80 | 6203 | 0, |
03c05291 | 6204 | QUOTA_TABLE, |
7ac48069 | 6205 | NULL, |
d33e787c | 6206 | anfq_fields, |
6207 | 0, | |
135dcb80 | 6208 | 0, |
d33e787c | 6209 | 2, |
29028043 | 6210 | NULL, |
d33e787c | 6211 | &dnfq_validate, |
6212 | }, | |
6213 | ||
d33e787c | 6214 | { |
d7ddc011 | 6215 | /* Q_GZCL - GET_ZEPHYR_CLASS, v2 */ |
d33e787c | 6216 | "get_zephyr_class", |
6217 | "gzcl", | |
c44ddfa7 | 6218 | 2, |
d33e787c | 6219 | RETRIEVE, |
6220 | "z", | |
03c05291 | 6221 | ZEPHYR_TABLE, |
6222 | "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", | |
d7ddc011 | 6223 | gzcl2_fields, |
d33e787c | 6224 | 12, |
263a36d4 | 6225 | "class LIKE '%s'", |
d33e787c | 6226 | 1, |
29028043 | 6227 | "class", |
d33e787c | 6228 | &gzcl_validate, |
03c05291 | 6229 | }, |
d33e787c | 6230 | |
6231 | { | |
d7ddc011 | 6232 | /* Q_GZCL - GET_ZEPHYR_CLASS, v5 */ |
6233 | "get_zephyr_class", | |
6234 | "gzcl", | |
6235 | 5, | |
6236 | RETRIEVE, | |
6237 | "z", | |
6238 | ZEPHYR_TABLE, | |
6239 | "class, xmt_type, xmt_id, sub_type, sub_id, iws_type, iws_id, iui_type, iui_id, owner_type, owner_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM zephyr", | |
6240 | gzcl_fields, | |
6241 | 14, | |
6242 | "class LIKE '%s'", | |
6243 | 1, | |
6244 | "class", | |
6245 | &gzcl_validate, | |
6246 | }, | |
6247 | ||
6248 | { | |
6249 | /* Q_AZCL - ADD_ZEPHYR_CLASS, v2 */ | |
d33e787c | 6250 | "add_zephyr_class", |
6251 | "azcl", | |
c44ddfa7 | 6252 | 2, |
d33e787c | 6253 | APPEND, |
6254 | "z", | |
03c05291 | 6255 | ZEPHYR_TABLE, |
5eaef520 | 6256 | "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)", |
d7ddc011 | 6257 | azcl2_fields, |
d33e787c | 6258 | 9, |
6259 | 0, | |
6260 | 0, | |
29028043 | 6261 | NULL, |
d7ddc011 | 6262 | &azcl2_validate, |
6263 | }, | |
6264 | ||
6265 | { | |
6266 | /* Q_AZCL - ADD_ZEPHYR_CLASS, v5 */ | |
6267 | "add_zephyr_class", | |
6268 | "azcl", | |
6269 | 5, | |
6270 | APPEND, | |
6271 | "z", | |
6272 | ZEPHYR_TABLE, | |
6273 | "INTO zephyr (class, xmt_type, xmt_id, sub_type, sub_id, iws_type, iws_id, iui_type, iui_id, owner_type, owner_id) VALUES ('%s', '%s', %d, '%s', %d, '%s', %d, '%s', %d, '%s', %d)", | |
6274 | azcl_fields, | |
6275 | 11, | |
6276 | 0, | |
6277 | 0, | |
6278 | NULL, | |
d33e787c | 6279 | &azcl_validate, |
5eaef520 | 6280 | }, |
d33e787c | 6281 | |
6282 | { | |
d7ddc011 | 6283 | /* Q_UZCL - UPDATE_ZEPHYR_CLASS, v2 */ |
d33e787c | 6284 | "update_zephyr_class", |
6285 | "uzcl", | |
c44ddfa7 | 6286 | 2, |
d33e787c | 6287 | UPDATE, |
6288 | "z", | |
03c05291 | 6289 | ZEPHYR_TABLE, |
135dcb80 | 6290 | "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", |
d7ddc011 | 6291 | uzcl2_fields, |
d33e787c | 6292 | 9, |
99e09b48 | 6293 | "class = '%s'", |
d33e787c | 6294 | 1, |
29028043 | 6295 | NULL, |
d7ddc011 | 6296 | &uzcl2_validate, |
6297 | }, | |
6298 | ||
6299 | { | |
6300 | /* Q_UZCL - UPDATE_ZEPHYR_CLASS, v5 */ | |
6301 | "update_zephyr_class", | |
6302 | "uzcl", | |
6303 | 5, | |
6304 | UPDATE, | |
6305 | "z", | |
6306 | ZEPHYR_TABLE, | |
6307 | "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, owner_type = '%s', owner_id = %d", | |
6308 | uzcl_fields, | |
6309 | 11, | |
6310 | "class = '%s'", | |
6311 | 1, | |
6312 | NULL, | |
d33e787c | 6313 | &uzcl_validate, |
5eaef520 | 6314 | }, |
d33e787c | 6315 | |
6316 | { | |
6317 | /* Q_DZCL - DELETE_ZEPHYR_CLASS */ | |
6318 | "delete_zephyr_class", | |
6319 | "dzcl", | |
c44ddfa7 | 6320 | 2, |
d33e787c | 6321 | DELETE, |
6322 | "z", | |
03c05291 | 6323 | ZEPHYR_TABLE, |
d33e787c | 6324 | 0, |
6325 | uzcl_fields, | |
6326 | 0, | |
99e09b48 | 6327 | "class = '%s'", |
d33e787c | 6328 | 1, |
29028043 | 6329 | NULL, |
d33e787c | 6330 | &dzcl_validate, |
5eaef520 | 6331 | }, |
fd5b2340 | 6332 | |
03c05291 | 6333 | { |
5eaef520 | 6334 | /* Q_GSHA - GET_SERVER_HOST_ACCESS */ |
03c05291 | 6335 | "get_server_host_access", |
6336 | "gsha", | |
c44ddfa7 | 6337 | 2, |
03c05291 | 6338 | RETRIEVE, |
6339 | "ha", | |
6340 | HOSTACCESS_TABLE, | |
6341 | "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", | |
6342 | gsha_fields, | |
6343 | 6, | |
263a36d4 | 6344 | "m.name LIKE UPPER('%s') AND ha.mach_id = m.mach_id", |
03c05291 | 6345 | 1, |
29028043 | 6346 | "m.name", |
03c05291 | 6347 | &gsha_validate, |
6348 | }, | |
6349 | ||
6350 | { | |
6351 | /* Q_ASHA - ADD_SERVER_HOST_ACCESS */ | |
6352 | "add_server_host_access", | |
6353 | "asha", | |
c44ddfa7 | 6354 | 2, |
03c05291 | 6355 | APPEND, |
6356 | "ha", | |
6357 | HOSTACCESS_TABLE, | |
5eaef520 | 6358 | "INTO hostaccess (mach_id, acl_type, acl_id) VALUES (%d, '%s', %d)", |
03c05291 | 6359 | asha_fields, |
6360 | 3, | |
6361 | 0, | |
6362 | 0, | |
29028043 | 6363 | NULL, |
03c05291 | 6364 | &asha_validate, |
6365 | }, | |
6366 | ||
6367 | { | |
6368 | /* Q_USHA - UPDATE_SERVER_HOST_ACCESS */ | |
6369 | "update_server_host_access", | |
6370 | "usha", | |
c44ddfa7 | 6371 | 2, |
03c05291 | 6372 | UPDATE, |
6373 | "ha", | |
6374 | HOSTACCESS_TABLE, | |
6375 | "hostaccess SET acl_type = '%s', acl_id = %d", | |
6376 | asha_fields, | |
6377 | 2, | |
6378 | "mach_id = %d", | |
6379 | 1, | |
29028043 | 6380 | NULL, |
03c05291 | 6381 | &asha_validate, |
6382 | }, | |
6383 | ||
6384 | { | |
6385 | /* Q_DSHA - DELETE_SERVER_HOST_ACCESS */ | |
6386 | "delete_server_host_access", | |
6387 | "dsha", | |
c44ddfa7 | 6388 | 2, |
03c05291 | 6389 | DELETE, |
6390 | "ha", | |
6391 | HOSTACCESS_TABLE, | |
6392 | 0, | |
6393 | asha_fields, | |
6394 | 0, | |
6395 | "mach_id = %d", | |
6396 | 1, | |
29028043 | 6397 | NULL, |
03c05291 | 6398 | &VDmach, |
6399 | }, | |
6400 | ||
46b6f1f6 | 6401 | { |
6402 | /* Q_GACL - GET_ACL */ | |
6403 | "get_acl", | |
6404 | "gacl", | |
c44ddfa7 | 6405 | 2, |
46b6f1f6 | 6406 | RETRIEVE, |
6407 | "ac", | |
6408 | ACL_TABLE, | |
6409 | "m.name, ac.target, ac.kind, l.name FROM acl ac, machine m, list l", | |
6410 | gacl_fields, | |
6411 | 4, | |
6412 | "m.mach_id = %d AND m.mach_id = ac.mach_id AND ac.target LIKE '%s' AND l.list_id = ac.list_id", | |
6413 | 2, | |
6414 | "m.name, ac.target, ac.kind", | |
6415 | &gacl_validate, | |
6416 | }, | |
6417 | ||
6418 | { | |
6419 | /* Q_AACL - ADD_ACL */ | |
6420 | "add_acl", | |
6421 | "aacl", | |
c44ddfa7 | 6422 | 2, |
46b6f1f6 | 6423 | APPEND, |
6424 | "ac", | |
6425 | ACL_TABLE, | |
6426 | "INTO acl (mach_id, target, kind, list_id) VALUES (%d, '%s', '%s', %d)", | |
6427 | aacl_fields, | |
6428 | 4, | |
6429 | 0, | |
6430 | 0, | |
6431 | NULL, | |
6432 | &aacl_validate, | |
6433 | }, | |
6434 | ||
6435 | { | |
6436 | /* Q_DACL - DELETE_ACL */ | |
6437 | "delete_acl", | |
6438 | "dacl", | |
c44ddfa7 | 6439 | 2, |
46b6f1f6 | 6440 | DELETE, |
6441 | "ac", | |
6442 | ACL_TABLE, | |
6443 | 0, | |
6444 | dacl_fields, | |
6445 | 0, | |
6446 | "mach_id = %d AND target = '%s'", | |
6447 | 2, | |
6448 | NULL, | |
6449 | &gacl_validate, | |
6450 | }, | |
6451 | ||
d33e787c | 6452 | { |
6453 | /* Q_GSVC - GET_SERVICE */ | |
6454 | "get_service", | |
6455 | "gsvc", | |
c44ddfa7 | 6456 | 2, |
d33e787c | 6457 | RETRIEVE, |
0c345c78 | 6458 | "ss", |
03c05291 | 6459 | SERVICES_TABLE, |
6460 | "name, protocol, port, description, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM services", | |
fd5b2340 | 6461 | gsvc_fields, |
d33e787c | 6462 | 7, |
69eb9470 | 6463 | "name LIKE '%s' AND protocol LIKE '%s'", |
6464 | 2, | |
29028043 | 6465 | "name", |
263a36d4 | 6466 | &VDfix_modby, |
d33e787c | 6467 | }, |
6468 | ||
6469 | { | |
6470 | /* Q_ASVC - ADD_SERVICE */ | |
6471 | "add_service", | |
6472 | "asvc", | |
c44ddfa7 | 6473 | 2, |
d33e787c | 6474 | APPEND, |
0c345c78 | 6475 | "ss", |
03c05291 | 6476 | SERVICES_TABLE, |
5eaef520 | 6477 | "INTO services (name, protocol, port, description) VALUES ('%s', '%s', %s, NVL('%s', CHR(0)))", |
fd5b2340 | 6478 | asvc_fields, |
d33e787c | 6479 | 4, |
7ac48069 | 6480 | NULL, |
d33e787c | 6481 | 0, |
29028043 | 6482 | NULL, |
d33e787c | 6483 | &asvc_validate, |
6484 | }, | |
6485 | ||
6486 | { | |
6487 | /* Q_DSVC - DELETE_SERVICE */ | |
6488 | "delete_service", | |
6489 | "dsvc", | |
c44ddfa7 | 6490 | 2, |
d33e787c | 6491 | DELETE, |
0c345c78 | 6492 | "ss", |
03c05291 | 6493 | SERVICES_TABLE, |
d33e787c | 6494 | 0, |
69eb9470 | 6495 | dsvc_fields, |
d33e787c | 6496 | 0, |
69eb9470 | 6497 | "name = '%s' AND protocol = '%s'", |
6498 | 2, | |
29028043 | 6499 | NULL, |
69eb9470 | 6500 | &dsvc_validate, |
d33e787c | 6501 | }, |
fd5b2340 | 6502 | |
d33e787c | 6503 | { |
2884200f | 6504 | /* Q_GPRN - GET_PRINTER */ |
6505 | "get_printer", | |
6506 | "gprn", | |
c44ddfa7 | 6507 | 2, |
d33e787c | 6508 | RETRIEVE, |
2884200f | 6509 | "pr", |
6510 | PRINTERS_TABLE, | |
e5a63571 | 6511 | "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2", |
2884200f | 6512 | gprn_fields, |
e5a63571 | 6513 | 19, |
2884200f | 6514 | "pr.name LIKE '%s' AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl", |
d33e787c | 6515 | 1, |
2884200f | 6516 | "pr.name", |
6517 | &VDfix_modby, | |
d33e787c | 6518 | }, |
6519 | ||
6520 | { | |
2884200f | 6521 | /* Q_GPBD - GET_PRINTER_BY_DUPLEXNAME */ |
6522 | "get_printer_by_duplexname", | |
6523 | "gpbd", | |
c44ddfa7 | 6524 | 2, |
2884200f | 6525 | RETRIEVE, |
6526 | "pr", | |
6527 | PRINTERS_TABLE, | |
e5a63571 | 6528 | "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2", |
2884200f | 6529 | gpbd_fields, |
e5a63571 | 6530 | 19, |
2884200f | 6531 | "pr.duplexname LIKE '%s' AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl", |
6532 | 1, | |
6533 | "pr.name", | |
6534 | &VDfix_modby, | |
fd5b2340 | 6535 | }, |
6536 | ||
6537 | { | |
2884200f | 6538 | /* Q_GPBE - GET_PRINTER_BY_ETHERNET */ |
6539 | "get_printer_by_ethernet", | |
6540 | "gpbe", | |
c44ddfa7 | 6541 | 2, |
2884200f | 6542 | RETRIEVE, |
6543 | "pr", | |
6544 | PRINTERS_TABLE, | |
e5a63571 | 6545 | "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2", |
2884200f | 6546 | gpbd_fields, |
e5a63571 | 6547 | 19, |
59841cdb | 6548 | "m1.hwaddr LIKE LOWER('%s') AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl", |
fd5b2340 | 6549 | 1, |
2884200f | 6550 | "pr.name", |
6551 | &VDfix_modby, | |
fd5b2340 | 6552 | }, |
6553 | ||
6554 | { | |
2884200f | 6555 | /* Q_GPBH - GET_PRINTER_BY_HOSTNAME */ |
6556 | "get_printer_by_hostname", | |
6557 | "gpbh", | |
c44ddfa7 | 6558 | 2, |
fd5b2340 | 6559 | RETRIEVE, |
2884200f | 6560 | "pr", |
6561 | PRINTERS_TABLE, | |
e5a63571 | 6562 | "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2", |
2884200f | 6563 | gpbh_fields, |
e5a63571 | 6564 | 19, |
2884200f | 6565 | "m1.name LIKE UPPER('%s') AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl", |
fd5b2340 | 6566 | 1, |
2884200f | 6567 | "pr.name", |
263a36d4 | 6568 | &VDfix_modby, |
d33e787c | 6569 | }, |
6570 | ||
6571 | { | |
2884200f | 6572 | /* Q_GPBR - GET_PRINTER_BY_RM */ |
6573 | "get_printer_by_rm", | |
6574 | "gpbr", | |
c44ddfa7 | 6575 | 2, |
2884200f | 6576 | RETRIEVE, |
6577 | "pr", | |
6578 | PRINTERS_TABLE, | |
e5a63571 | 6579 | "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2", |
2884200f | 6580 | gpbr_fields, |
e5a63571 | 6581 | 19, |
2884200f | 6582 | "m3.name LIKE UPPER('%s') AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl", |
d33e787c | 6583 | 1, |
2884200f | 6584 | "pr.name", |
6585 | &VDfix_modby, | |
d33e787c | 6586 | }, |
6587 | ||
012fc215 | 6588 | { |
2884200f | 6589 | /* Q_GPBL - GET_PRINTER_BY_LOCATION */ |
6590 | "get_printer_by_location", | |
6591 | "gpbl", | |
c44ddfa7 | 6592 | 2, |
012fc215 | 6593 | RETRIEVE, |
2884200f | 6594 | "pr", |
6595 | PRINTERS_TABLE, | |
e5a63571 | 6596 | "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2", |
2884200f | 6597 | gpbl_fields, |
e5a63571 | 6598 | 19, |
2884200f | 6599 | "UPPER(pr.location) LIKE UPPER('%s') AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl", |
6600 | 1, | |
6601 | "pr.name", | |
6602 | &VDfix_modby, | |
6603 | }, | |
6604 | ||
6605 | { | |
6606 | /* Q_GPBC - GET_PRINTER_BY_CONTACT */ | |
6607 | "get_printer_by_contact", | |
6608 | "gpbc", | |
c44ddfa7 | 6609 | 2, |
2884200f | 6610 | RETRIEVE, |
6611 | "pr", | |
6612 | PRINTERS_TABLE, | |
e5a63571 | 6613 | "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2", |
2884200f | 6614 | gpbc_fields, |
e5a63571 | 6615 | 19, |
2884200f | 6616 | "UPPER(pr.contact) LIKE UPPER('%s') AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl", |
012fc215 | 6617 | 1, |
2884200f | 6618 | "pr.name", |
263a36d4 | 6619 | &VDfix_modby, |
012fc215 | 6620 | }, |
6621 | ||
6622 | { | |
2884200f | 6623 | /* Q_APRN - ADD_PRINTER */ |
6624 | "add_printer", | |
6625 | "aprn", | |
c44ddfa7 | 6626 | 2, |
012fc215 | 6627 | APPEND, |
2884200f | 6628 | "pr", |
6629 | PRINTERS_TABLE, | |
e5a63571 | 6630 | "INTO printers (name, type, hwtype, duplexname, mach_id, loghost, rm, rp, rq, ka, pc, ac, lpc_acl, banner, location, contact) VALUES ('%s', '%s', '%s', NVL('%s', CHR(0)), %d, %d, %d, NVL('%s', CHR(0)), %d, %s, %s, %d, %d, %s, NVL('%s', CHR(0)), NVL('%s', CHR(0)))", |
2884200f | 6631 | aprn_fields, |
e5a63571 | 6632 | 16, |
012fc215 | 6633 | 0, |
6634 | 0, | |
29028043 | 6635 | NULL, |
2884200f | 6636 | &aprn_validate, |
012fc215 | 6637 | }, |
6638 | ||
1a9a0a59 | 6639 | { |
6640 | /* Q_UPRN - UPDATE_PRINTER */ | |
6641 | "update_printer", | |
6642 | "uprn", | |
c44ddfa7 | 6643 | 2, |
1a9a0a59 | 6644 | UPDATE, |
6645 | "pr", | |
6646 | PRINTERS_TABLE, | |
6647 | "printers SET name = '%s', type = '%s', hwtype = '%s', duplexname = NVL('%s', CHR(0)), mach_id = %d, loghost = %d, rm = %d, rp = NVL('%s', CHR(0)), rq = %d, ka = %d, pc = %d, ac = %d, lpc_acl = %d, banner = %d, location = NVL('%s', CHR(0)), contact = NVL('%s', CHR(0))", | |
6648 | uprn_fields, | |
6649 | 16, | |
6650 | 0, | |
6651 | 0, | |
6652 | NULL, | |
6653 | &uprn_validate, | |
6654 | }, | |
6655 | ||
012fc215 | 6656 | { |
2884200f | 6657 | /* Q_DPRN - DELETE_PRINTER */ |
6658 | "delete_printer", | |
6659 | "dprn", | |
c44ddfa7 | 6660 | 2, |
012fc215 | 6661 | DELETE, |
2884200f | 6662 | "pr", |
6663 | PRINTERS_TABLE, | |
012fc215 | 6664 | 0, |
2884200f | 6665 | aprn_fields, |
012fc215 | 6666 | 0, |
99e09b48 | 6667 | "name = '%s'", |
012fc215 | 6668 | 1, |
29028043 | 6669 | NULL, |
2884200f | 6670 | &dprn_validate, |
012fc215 | 6671 | }, |
6672 | ||
1a9a0a59 | 6673 | { |
6674 | /* Q_GPSV - GET_PRINT_SERVER */ | |
6675 | "get_print_server", | |
6676 | "gpsv", | |
c44ddfa7 | 6677 | 2, |
1a9a0a59 | 6678 | RETRIEVE, |
6679 | "ps", | |
6680 | PRINTSERVERS_TABLE, | |
6681 | "m.name, ps.kind, s.string, ps.owner_type, ps.owner_id, l.name, TO_CHAR(ps.modtime, 'DD-mon-YYYY HH24:MI:SS'), ps.modby, ps.modwith FROM printservers ps, machine m, strings s, list l", | |
6682 | gpsv_fields, | |
6683 | 9, | |
6684 | "ps.mach_id = %d AND m.mach_id = ps.mach_id AND s.string_id = ps.printer_types AND l.list_id = ps.lpc_acl", | |
6685 | 1, | |
6686 | NULL, | |
6687 | &gpsv_validate, | |
6688 | }, | |
6689 | ||
6690 | { | |
6691 | /* Q_APSV - ADD_PRINT_SERVER */ | |
6692 | "add_print_server", | |
6693 | "apsv", | |
c44ddfa7 | 6694 | 2, |
1a9a0a59 | 6695 | APPEND, |
6696 | "ps", | |
6697 | PRINTSERVERS_TABLE, | |
6698 | "INTO printservers (mach_id, kind, printer_types, owner_type, owner_id, lpc_acl) VALUES (%d, '%s', %d, '%s', %d, %d)", | |
6699 | apsv_fields, | |
6700 | 6, | |
6701 | 0, | |
6702 | 0, | |
6703 | NULL, | |
6704 | &apsv_validate, | |
6705 | }, | |
6706 | ||
6707 | { | |
6708 | /* Q_UPSV - UPDATE_PRINT_SERVER */ | |
6709 | "update_print_server", | |
6710 | "upsv", | |
c44ddfa7 | 6711 | 2, |
1a9a0a59 | 6712 | UPDATE, |
6713 | "ps", | |
6714 | PRINTSERVERS_TABLE, | |
6715 | "printservers SET kind = '%s', printer_types = %d, owner_type = '%s', owner_id = %d, lpc_acl = %d", | |
6716 | apsv_fields, | |
6717 | 5, | |
6718 | "mach_id = %d", | |
6719 | 1, | |
6720 | NULL, | |
6721 | &apsv_validate, | |
6722 | }, | |
6723 | ||
6724 | { | |
6725 | /* Q_DPSV - DELETE_PRINT_SERVER */ | |
6726 | "delete_print_server", | |
6727 | "dpsv", | |
c44ddfa7 | 6728 | 2, |
1a9a0a59 | 6729 | DELETE, |
6730 | "ps", | |
6731 | PRINTSERVERS_TABLE, | |
6732 | 0, | |
6733 | dpsv_fields, | |
6734 | 0, | |
6735 | "mach_id = %d", | |
6736 | 1, | |
6737 | NULL, | |
6738 | &dpsv_validate, | |
6739 | }, | |
6740 | ||
d33e787c | 6741 | { |
6742 | /* Q_GALI - GET_ALIAS */ | |
6743 | "get_alias", | |
6744 | "gali", | |
c44ddfa7 | 6745 | 2, |
d33e787c | 6746 | RETRIEVE, |
6747 | "a", | |
03c05291 | 6748 | ALIAS_TABLE, |
6749 | "name, type, trans FROM alias", | |
d33e787c | 6750 | gali_fields, |
6751 | 3, | |
263a36d4 | 6752 | "name LIKE '%s' AND type LIKE '%s' AND trans LIKE '%s'", |
d33e787c | 6753 | 3, |
29028043 | 6754 | "type, name, trans", |
263a36d4 | 6755 | NULL, |
d33e787c | 6756 | }, |
6757 | ||
6758 | { | |
6759 | /* Q_AALI - ADD_ALIAS */ | |
6760 | "add_alias", | |
6761 | "aali", | |
c44ddfa7 | 6762 | 2, |
d33e787c | 6763 | APPEND, |
6764 | "a", | |
03c05291 | 6765 | ALIAS_TABLE, |
4e5ec77f | 6766 | "INTO alias (name, type, trans) VALUES ('%s', '%s', '%s')", |
d33e787c | 6767 | aali_fields, |
6768 | 3, | |
7ac48069 | 6769 | NULL, |
d33e787c | 6770 | 0, |
29028043 | 6771 | NULL, |
d33e787c | 6772 | &aali_validate, |
6773 | }, | |
6774 | ||
6775 | { | |
6776 | /* Q_DALI - DELETE_ALIAS */ | |
6777 | "delete_alias", | |
6778 | "dali", | |
c44ddfa7 | 6779 | 2, |
d33e787c | 6780 | DELETE, |
6781 | "a", | |
03c05291 | 6782 | ALIAS_TABLE, |
7ac48069 | 6783 | NULL, |
d33e787c | 6784 | aali_fields, |
6785 | 0, | |
5eaef520 | 6786 | "name = '%s' AND type = '%s' AND trans = '%s'", |
d33e787c | 6787 | 3, |
29028043 | 6788 | NULL, |
d33e787c | 6789 | &dali_validate, |
6790 | }, | |
6791 | ||
6792 | { | |
6793 | /* Q_GVAL - GET_VALUE */ | |
6794 | "get_value", | |
6795 | "gval", | |
c44ddfa7 | 6796 | 2, |
d33e787c | 6797 | RETRIEVE, |
0c345c78 | 6798 | "val", |
03c05291 | 6799 | NUMVALUES_TABLE, |
6800 | "value FROM numvalues", | |
d33e787c | 6801 | gval_fields, |
6802 | 1, | |
03c05291 | 6803 | "name = '%s'", |
d33e787c | 6804 | 1, |
29028043 | 6805 | NULL, |
d33e787c | 6806 | &gval_validate, |
6807 | }, | |
6808 | ||
6809 | { | |
6810 | /* Q_AVAL - ADD_VALUE */ | |
6811 | "add_value", | |
6812 | "aval", | |
c44ddfa7 | 6813 | 2, |
d33e787c | 6814 | APPEND, |
0c345c78 | 6815 | "val", |
03c05291 | 6816 | NUMVALUES_TABLE, |
4e5ec77f | 6817 | "INTO numvalues (name, value) VALUES ('%s', %s)", |
d33e787c | 6818 | aval_fields, |
6819 | 2, | |
7ac48069 | 6820 | NULL, |
d33e787c | 6821 | 0, |
29028043 | 6822 | NULL, |
d33e787c | 6823 | &aval_validate, |
6824 | }, | |
6825 | ||
6826 | { | |
6827 | /* Q_UVAL - UPDATE_VALUE */ | |
6828 | "update_value", | |
6829 | "uval", | |
c44ddfa7 | 6830 | 2, |
d33e787c | 6831 | UPDATE, |
0c345c78 | 6832 | "val", |
03c05291 | 6833 | NUMVALUES_TABLE, |
4e5ec77f | 6834 | "numvalues SET value = %s", |
d33e787c | 6835 | aval_fields, |
6836 | 1, | |
99e09b48 | 6837 | "name = '%s'", |
d33e787c | 6838 | 1, |
29028043 | 6839 | NULL, |
d33e787c | 6840 | &aval_validate, |
6841 | }, | |
6842 | ||
6843 | { | |
6844 | /* Q_DVAL - DELETE_VALUE */ | |
6845 | "delete_value", | |
6846 | "dval", | |
c44ddfa7 | 6847 | 2, |
d33e787c | 6848 | DELETE, |
0c345c78 | 6849 | "val", |
03c05291 | 6850 | NUMVALUES_TABLE, |
7ac48069 | 6851 | NULL, |
d33e787c | 6852 | dval_fields, |
6853 | 0, | |
99e09b48 | 6854 | "name = '%s'", |
d33e787c | 6855 | 1, |
29028043 | 6856 | NULL, |
d33e787c | 6857 | &aval_validate, |
6858 | }, | |
6859 | ||
6860 | { | |
6861 | /* Q_GATS - GET_ALL_TABLE_STATS */ | |
6862 | "get_all_table_stats", | |
6863 | "gats", | |
c44ddfa7 | 6864 | 2, |
d33e787c | 6865 | RETRIEVE, |
6866 | "tbs", | |
03c05291 | 6867 | TBLSTATS_TABLE, |
6868 | "table_name, appends, updates, deletes, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS') FROM tblstats", | |
d33e787c | 6869 | gats_fields, |
45bf7573 | 6870 | 5, |
7ac48069 | 6871 | NULL, |
d33e787c | 6872 | 0, |
29028043 | 6873 | "table_name", |
d33e787c | 6874 | 0, |
6875 | }, | |
6876 | ||
2962e9ec | 6877 | { |
6878 | /* Q__SDL - _SET_DEBUG_LEVEL */ | |
6879 | "_set_debug_level", | |
6880 | "_sdl", | |
c44ddfa7 | 6881 | 2, |
2962e9ec | 6882 | UPDATE, |
7ac48069 | 6883 | NULL, |
03c05291 | 6884 | 0, |
7ac48069 | 6885 | NULL, |
2962e9ec | 6886 | _sdl_fields, |
6887 | 1, | |
7ac48069 | 6888 | NULL, |
2962e9ec | 6889 | 0, |
29028043 | 6890 | NULL, |
2962e9ec | 6891 | &_sdl_validate, |
6892 | }, | |
6893 | ||
ca3ca9c9 | 6894 | { |
6895 | /* Q_GUSL - GET_USER_SIDS_BY_LOGIN, v4 */ | |
6896 | "get_user_sids_by_login", | |
6897 | "gusl", | |
6898 | 4, | |
6899 | RETRIEVE, | |
6900 | "s", | |
6901 | USERSIDS_TABLE, | |
6902 | "u.login, us.sid, TO_CHAR(us.created, 'YYYY-MM-DD HH24:MI:SS') FROM users u, usersids us", | |
6903 | gusl_fields, | |
6904 | 3, | |
77bf4a4d | 6905 | "us.users_id = %d AND u.users_id = us.users_id AND SUBSTR(us.sid, 1, LENGTH(us.sid)-8) = '%s'", |
6906 | 2, | |
6907 | NULL, | |
ca3ca9c9 | 6908 | &gusl_validate, |
6909 | }, | |
6910 | ||
6911 | { | |
6912 | /* Q_AUSL - ADD_USER_SID_BY_LOGIN, v4 */ | |
6913 | "add_user_sid_by_login", | |
6914 | "ausl", | |
6915 | 4, | |
6916 | APPEND, | |
6917 | "s", | |
6918 | USERSIDS_TABLE, | |
6919 | "INTO usersids (users_id, sid) VALUES (%d, '%s')", | |
6920 | ausl_fields, | |
6921 | 2, | |
6922 | NULL, | |
6923 | 0, | |
6924 | NULL, | |
6925 | &ausl_validate, | |
6926 | }, | |
6927 | ||
6928 | { | |
6929 | /* Q_GLSN - GET_LIST_SIDS_BY_NAME, v4 */ | |
6930 | "get_list_sids_by_name", | |
6931 | "glsn", | |
6932 | 4, | |
6933 | RETRIEVE, | |
6934 | "s", | |
6935 | LISTSIDS_TABLE, | |
6936 | "l.name, ls.sid, TO_CHAR(ls.created, 'YYYY-MM-DD HH24:MI:SS') FROM list l, listsids ls", | |
6937 | glsn_fields, | |
6938 | 3, | |
77bf4a4d | 6939 | "ls.list_id = %d AND l.list_id = ls.list_id AND SUBSTR(ls.sid, 1, LENGTH(ls.sid)-8) = '%s'", |
6940 | 2, | |
6941 | NULL, | |
ca3ca9c9 | 6942 | &glsn_validate, |
6943 | }, | |
6944 | ||
6945 | { | |
6946 | /* Q_ALSN - ADD_LIST_SID_BY_NAME, v4 */ | |
6947 | "add_list_sid_by_name", | |
6948 | "alsn", | |
6949 | 4, | |
6950 | APPEND, | |
6951 | "s", | |
6952 | LISTSIDS_TABLE, | |
6953 | "INTO listsids (list_id, sid) VALUES (%d, '%s')", | |
6954 | alsn_fields, | |
6955 | 2, | |
6956 | NULL, | |
6957 | 0, | |
6958 | NULL, | |
6959 | &alsn_validate, | |
6960 | }, | |
6961 | ||
77bf4a4d | 6962 | { |
6963 | /* Q_GDDS - GET_DISTINCT_DOMAIN_SIDS, v4 */ | |
6964 | "get_distinct_domain_sids", | |
6965 | "gdds", | |
6966 | 4, | |
6967 | RETRIEVE, | |
6968 | "s", | |
6969 | USERSIDS_TABLE, | |
6970 | "DISTINCT SUBSTR(sid, 1, LENGTH(sid)-8) FROM usersids", | |
6971 | gdds_fields, | |
6972 | 1, | |
6973 | NULL, | |
6974 | 0, | |
6975 | NULL, | |
6976 | NULL, | |
6977 | }, | |
6978 | ||
2fb668b0 | 6979 | { |
6980 | /* Q_GCON - GET_CONTAINER, v7 */ | |
6981 | "get_container", | |
6982 | "gcon", | |
6983 | 7, | |
6984 | RETRIEVE, | |
6985 | "c", | |
6986 | CONTAINERS_TABLE, | |
6987 | "name, description, location, contact, acl_type, acl_id, memacl_type, memacl_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM containers", | |
6988 | gcon_fields, | |
6989 | 11, | |
6990 | "name = '%s' AND cnt_id != 0", | |
6991 | 1, | |
6992 | NULL, | |
6993 | &gcon_validate, | |
6994 | }, | |
6995 | ||
6996 | { | |
6997 | /* Q_ACON - ADD_CONTAINER, v7 */ /* uses prefetch_value() for cnt_id */ | |
6998 | "add_container", | |
6999 | "acon", | |
7000 | 7, | |
7001 | APPEND, | |
7002 | "c", | |
7003 | CONTAINERS_TABLE, | |
7004 | "INTO containers (name, description, location, contact, acl_type, acl_id, memacl_type, memacl_id, cnt_id) VALUES ('%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), '%s', %d, '%s', %d, %s)", | |
7005 | acon_fields, | |
7006 | 8, | |
7007 | 0, | |
7008 | 0, | |
7009 | NULL, | |
7010 | &acon_validate, | |
7011 | }, | |
7012 | ||
7013 | { | |
7014 | /* Q_UCON - UPDATE_CONTAINER, v7 */ | |
7015 | "update_container", | |
7016 | "ucon", | |
7017 | 7, | |
7018 | UPDATE, | |
7019 | 0, | |
7020 | CONTAINERS_TABLE, | |
7021 | 0, | |
7022 | ucon_fields, | |
7023 | 8, | |
7024 | 0, | |
7025 | 1, | |
7026 | NULL, | |
7027 | &ucon_validate, | |
7028 | }, | |
7029 | ||
7030 | { | |
7031 | /* Q_DCON - DELETE_CONTAINER, v7 */ | |
7032 | "delete_container", | |
7033 | "dcon", | |
7034 | 7, | |
7035 | DELETE, | |
7036 | "c", | |
7037 | CONTAINERS_TABLE, | |
7038 | NULL, | |
7039 | dcon_fields, | |
7040 | 0, | |
7041 | "cnt_id = %d", | |
7042 | 1, | |
7043 | NULL, | |
7044 | &dcon_validate, | |
7045 | }, | |
7046 | ||
7047 | { | |
7048 | /* Q_AMCN - ADD_MACHINE_TO_CONTAINER, v7 */ | |
7049 | "add_machine_to_container", | |
7050 | "amcn", | |
7051 | 7, | |
7052 | APPEND, | |
7053 | "mcn", | |
7054 | MCNTMAP_TABLE, | |
7055 | "INTO mcntmap (mach_id, cnt_id) VALUES (%d, %d)", | |
7056 | amcn_fields, | |
7057 | 2, | |
7058 | 0, | |
7059 | 0, | |
7060 | NULL, | |
7061 | &amcn_validate, | |
7062 | }, | |
7063 | ||
7064 | { | |
7065 | /* Q_DMCN - DELETE_MACHINE_FROM_CONTAINER, v7 */ | |
7066 | "delete_machine_from_container", | |
7067 | "dmcn", | |
7068 | 7, | |
7069 | DELETE, | |
7070 | "mcn", | |
7071 | MCNTMAP_TABLE, | |
7072 | 0, | |
7073 | amcn_fields, | |
7074 | 0, | |
7075 | "mach_id = %d AND cnt_id = %d", | |
7076 | 2, | |
7077 | NULL, | |
d16a0628 | 7078 | &dmcn_validate, |
2fb668b0 | 7079 | }, |
7080 | ||
7081 | { | |
7082 | /* Q_GMNM - GET_MACHINE_TO_CONTAINER_MAP, v7 */ | |
7083 | "get_machine_to_container_map", | |
7084 | "gmnm", | |
7085 | 7, | |
7086 | RETRIEVE, | |
7087 | "mcn", | |
7088 | MCNTMAP_TABLE, | |
7807f2e6 | 7089 | "m.name, c.name FROM machine m, containers c, mcntmap mcn", |
7090 | gmnm_fields, | |
7091 | 2, | |
2fb668b0 | 7092 | "m.name = UPPER('%s') AND mcn.cnt_id = c.cnt_id AND mcn.mach_id = m.mach_id", |
7093 | 1, | |
7094 | NULL, | |
7095 | NULL, | |
7096 | }, | |
7097 | ||
7098 | { | |
7099 | /* Q_GMOC - GET_MACHINES_OF_CONTAINER, v7 */ | |
7100 | "get_machines_of_container", | |
7101 | "gmoc", | |
7102 | 7, | |
7103 | RETRIEVE, | |
7104 | NULL, | |
7105 | MCNTMAP_TABLE, | |
7106 | NULL, | |
7107 | gmoc_fields, | |
7108 | 2, | |
7109 | NULL, | |
7110 | 2, | |
7111 | NULL, | |
7112 | &gmoc_validate, | |
7113 | }, | |
7114 | ||
7115 | { | |
7116 | /* Q_GSOC - GET_SUBCONTAINERS_OF_CONTAINER, v7 */ | |
7117 | "get_subcontainers_of_container", | |
7118 | "gsoc", | |
7119 | 7, | |
7120 | RETRIEVE, | |
7121 | NULL, | |
7122 | CONTAINERS_TABLE, | |
7123 | NULL, | |
7124 | gsoc_fields, | |
7125 | 1, | |
7126 | NULL, | |
7127 | 2, | |
7128 | NULL, | |
7129 | &gsoc_validate, | |
7130 | }, | |
7131 | ||
0ef13dc2 | 7132 | { |
52581841 | 7133 | /* Q_GTLC - GET_TOPLEVEL_CONTAINERS, v7 */ |
0ef13dc2 | 7134 | "get_toplevel_containers", |
7135 | "gtlc", | |
52581841 | 7136 | 7, |
0ef13dc2 | 7137 | RETRIEVE, |
7138 | "c", | |
7139 | CONTAINERS_TABLE, | |
7140 | "name FROM containers", | |
7141 | gtlc_fields, | |
7142 | 1, | |
7143 | "name NOT LIKE '%%/%%'", | |
7144 | 0, | |
7145 | "name", | |
7146 | NULL, | |
7147 | }, | |
7148 | ||
d33e787c | 7149 | }; |
7150 | ||
c44ddfa7 | 7151 | int QueryCount = (sizeof(Queries) / sizeof(struct query)); |