3 * Creates a new sms database
5 * Copyright 1988 by the Massachusetts Institute of Technology.
6 * For copying and distribution information, please see the file
10 #include <mit-copyright.h>
12 #include "../server/query.h"
14 static int ingres_errno = 0;
17 extern char *tables[];
18 extern struct query Queries2[];
19 extern int QueryCount2;
21 char *values[] = { "users_id", "mach_id", "clu_id", "list_id",
22 "nfsphys_id", "filsys_id", "strings_id", "dcm_enable",
25 struct alias { char *name;
29 {"ace_type", "TYPE", "USER"},
30 {"ace_type", "TYPE", "LIST"},
31 {"ace_type", "TYPE", "NONE"},
32 {"alias", "TYPE", "FILESYS"},
33 {"alias", "TYPE", "TYPE"},
34 {"alias", "TYPE", "SERVICE"},
35 {"alias", "TYPE", "TYPEDATA"},
36 {"alias", "TYPE", "VALUE"},
37 {"boolean", "TYPE", "FALSE"},
38 {"boolean", "TYPE", "DONTCARE"},
39 {"boolean", "TYPE", "TRUE"},
40 {"class", "TYPE", "STAFF"},
41 {"class", "TYPE", "1988"},
42 {"class", "TYPE", "1989"},
43 {"class", "TYPE", "1990"},
44 {"class", "TYPE", "1991"},
45 {"class", "TYPE", "1992"},
46 {"class", "TYPE", "FACULTY"},
47 {"class", "TYPE", "G"},
48 {"class", "TYPE", "GUEST"},
49 {"class", "TYPE", "UNKNOWN"},
50 {"filesys", "TYPE", "ERR"},
51 {"filesys", "TYPE", "FSGROUP"},
52 {"filesys", "TYPE", "NFS"},
53 {"filesys", "TYPE", "RVD"},
54 {"gaus", "TYPE", "LIST"},
55 {"gaus", "TYPE", "USER"},
56 {"gaus", "TYPE", "RLIST"},
57 {"gaus", "TYPE", "RUSER"},
58 {"lockertype", "TYPE", "HOMEDIR"},
59 {"lockertype", "TYPE", "OTHER"},
60 {"lockertype", "TYPE", "PROJECT"},
61 {"lockertype", "TYPE", "SYSTEM"},
62 {"lockertype", "TYPE", "UNKNOWN"},
63 {"mac_type", "TYPE", "RT"},
64 {"mac_type", "TYPE", "VAX"},
65 {"member", "TYPE", "KERBEROS"},
66 {"member", "TYPE", "LIST"},
67 {"member", "TYPE", "STRING"},
68 {"member", "TYPE", "USER"},
69 {"pobox", "TYPE", "SMTP"},
70 {"pobox", "TYPE", "NONE"},
71 {"pobox", "TYPE", "POP"},
72 {"rmember", "TYPE", "LIST"},
73 {"rmember", "TYPE", "STRING"},
74 {"rmember", "TYPE", "USER"},
75 {"rmember", "TYPE", "KERBEROS"},
76 {"rmember", "TYPE", "RLIST"},
77 {"rmember", "TYPE", "RSTRING"},
78 {"rmember", "TYPE", "RUSER"},
79 {"rmember", "TYPE", "RKERBEROS"},
80 {"service", "TYPE", "REPLICAT"},
81 {"service", "TYPE", "UNIQUE"},
82 {"KERBEROS", "TYPEDATA", "string"},
83 {"LIST", "TYPEDATA", "list"},
84 {"NONE", "TYPEDATA", "none"},
85 {"POP", "TYPEDATA", "machine"},
86 {"RLIST", "TYPEDATA", "list"},
87 {"RSTRING", "TYPEDATA", "string"},
88 {"RUSER", "TYPEDATA", "user"},
89 {"SMTP", "TYPEDATA", "string"},
90 {"STRING", "TYPEDATA", "string"},
91 {"USER", "TYPEDATA", "user"},
100 ## char *table, *user, *value, *query, *trans, *type, *db;
110 printf("Unable to open the database\n");
114 strcpy(buffer, "root");
117 for (i = 0; table = tables[i]; i++) {
118 ## define permit all on table to user
120 printf("Unable to give %s permission to access table %s\n",
125 printf("Enter the name of another user to be given direct access to\n");
126 printf("the database, or [RETURN] if none: ");
131 for (i = 0; table = tables[i]; i++) {
132 ## repeat append tblstats (#table = @table, modtime = "now")
134 printf("Unable to initialize tblstats for %s\n", table);
139 for (i = 0; value = values[i]; i++) {
140 ## repeat append values (#name = @value, #value = 1)
142 printf("Unable to install initial value of %s\n", value);
147 printf("What is the starting UID to assign: ");
151 ## append values (#name = "uid", #value = i)
153 printf("Unable to install value for uid\n");
157 printf("What is the starting GID to assign: ");
161 ## append values (#name = "gid", #value = i)
163 printf("Unable to install value for gid\n");
167 printf("What is the default NFS quota to assign: ");
171 ## append values (#name = "def_quota", #value = i)
173 printf("Unable to install value for def_quota\n");
177 /* place holder records */
178 ## append users (login = "[nobody]", potype="NONE")
180 printf("Unable to install 0 user\n");
183 ## append machine (name = "[NONE]", #type="NONE")
185 printf("Unable to install 0 machine\n");
188 ## append cluster (name = "[unassigned]")
190 printf("Unable to install 0 cluster\n");
193 ## append list (name = "[none]", acl_type = "NONE")
195 printf("Unable to install 0 list\n");
199 /* magic for ALL_USERS */
200 ## append users (login = "default", users_id = 1, potype="NONE")
202 printf("Unable to install default user\n");
205 ## append list (name = "default", list_id = 1, acl_type = "NONE")
207 printf("Unable to install default list\n");
210 ## append members (list_id = 1, member_type = "USER", member_id = 1)
212 printf("Unable to install default user on default list\n");
216 /* Priveleged users */
217 ## append users (login = "root", users_id = 2, potype="NONE")
219 printf("Unable to install root user\n");
222 ## append list (name = "dbadmin", list_id = 2, acl_type = "LIST", acl_id = 2)
224 printf("Unable to install default dbadmin list\n");
228 printf("What is the name of a priveleged user: ");
232 ## append users (login = user, users_id = 3, potype="NONE")
234 printf("Unable to install user %s\n", buffer);
237 ## append members (list_id = 2, member_type = "USER", member_id = 3)
239 printf("Unable to put user %s on list dbadmin\n", buffer);
243 /* And the capacls */
244 for (i = 0; i < QueryCount2; i++) {
245 query = Queries2[i].name;
246 value = Queries2[i].shortname;
247 ## repeat append capacls (capability = @query, tag = @value, list_id = 2)
249 printf("Unable to install query ACL for %s (%s)\n", query, value);
253 ## append capacls (capability = "trigger_dcm", tag = "tdcm", list_id = 2)
255 /* and the aliases */
256 for (i = 0; aliases[i].name ; i++) {
257 value = aliases[i].name;
258 type = aliases[i].type;
259 trans = aliases[i].trans;
260 ## repeat append alias (#name = @value, #type = @type, #trans = @trans)
270 * ingerr: (supposedly) called when Ingres indicates an error.
271 * I have not yet been able to get this to work to intercept a
272 * database open error.
285 int access_visible_list() {}
286 int access_maillist() {}
288 int access_login() {}
289 int access_filesys() {}
304 int uusr_login_check() {}
306 int set_modtime_by_id() {}
307 int set_user_modtime() {}
308 int set_user_modtime_by_id() {}
309 int set_finger_modtime() {}
310 int set_filesys_modtime() {}
311 int set_mach_modtime() {}
312 int set_mach_modtime_by_id() {}
313 int set_serverhost_modtime() {}
314 int set_zephyr_modtime() {}
315 int followup_amtl() {}
316 int followup_ausr() {}
317 int followup_delete_list() {}
318 int followup_add_pobox() {}
319 int followup_delete_pobox() {}
320 int followup_usha() {}
321 int followup_old_gpob() {}
322 int followup_gsha() {}
323 int followup_anfq() {}
324 int followup_gzcl() {}
325 int followup_fix_acl() {}
326 int followup_fix_modby() {}
327 int translate_ids() {}
328 int expand_list_flags() {}
329 int add_new_quota() {}
330 int count_members_of_list() {}
331 int get_list_is_group() {}
332 int get_list_is_maillist() {}
334 int delete_locker() {}
335 int add_user_group() {}
336 int set_user_pobox() {}
337 int get_members_of_list() {}
338 int get_groups_of_user() {}
339 int get_groups_of_all_users() {}
340 int get_all_poboxes() {}
341 int get_new_poboxes() {}
342 int get_lists_of_administrator() {}
343 int followup_gpob() {}
346 int set_pobox_modtime() {}
348 int set_cluster_modtime_by_id() {}
349 int access_service() {}
350 int followup_glin() {}
351 int qualified_get_server() {}
352 int qualified_get_serverhost() {}
354 int set_nfsphys_modtime() {}
356 int access_member() {}
359 int qualified_get_lists() {}
360 int delete_current_quota() {}
361 int setup_add_group() {}
364 int get_lists_of_member() {}
366 int get_list_info() {}
367 int register_user() {}
368 int access_vis_list_by_name() {}
369 int set_uppercase_modtime() {}
370 int add_member_to_list() {}
371 int delete_member_from_list() {}