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", "PALLADIUM"},
34 {"alias", "TYPE", "TYPE"},
35 {"alias", "TYPE", "SERVICE"},
36 {"alias", "TYPE", "TYPEDATA"},
37 {"alias", "TYPE", "VALUE"},
38 {"boolean", "TYPE", "FALSE"},
39 {"boolean", "TYPE", "DONTCARE"},
40 {"boolean", "TYPE", "TRUE"},
41 {"class", "TYPE", "STAFF"},
42 {"class", "TYPE", "1988"},
43 {"class", "TYPE", "1989"},
44 {"class", "TYPE", "1990"},
45 {"class", "TYPE", "1991"},
46 {"class", "TYPE", "1992"},
47 {"class", "TYPE", "FACULTY"},
48 {"class", "TYPE", "G"},
49 {"class", "TYPE", "GUEST"},
50 {"class", "TYPE", "UNKNOWN"},
51 {"filesys", "TYPE", "ERR"},
52 {"filesys", "TYPE", "FSGROUP"},
53 {"filesys", "TYPE", "NFS"},
54 {"filesys", "TYPE", "RVD"},
55 {"gaus", "TYPE", "LIST"},
56 {"gaus", "TYPE", "USER"},
57 {"gaus", "TYPE", "RLIST"},
58 {"gaus", "TYPE", "RUSER"},
59 {"lockertype", "TYPE", "HOMEDIR"},
60 {"lockertype", "TYPE", "OTHER"},
61 {"lockertype", "TYPE", "PROJECT"},
62 {"lockertype", "TYPE", "SYSTEM"},
63 {"lockertype", "TYPE", "UNKNOWN"},
64 {"mac_type", "TYPE", "RT"},
65 {"mac_type", "TYPE", "VAX"},
66 {"member", "TYPE", "KERBEROS"},
67 {"member", "TYPE", "LIST"},
68 {"member", "TYPE", "STRING"},
69 {"member", "TYPE", "USER"},
70 {"pobox", "TYPE", "SMTP"},
71 {"pobox", "TYPE", "NONE"},
72 {"pobox", "TYPE", "POP"},
73 {"rmember", "TYPE", "LIST"},
74 {"rmember", "TYPE", "STRING"},
75 {"rmember", "TYPE", "USER"},
76 {"rmember", "TYPE", "KERBEROS"},
77 {"rmember", "TYPE", "RLIST"},
78 {"rmember", "TYPE", "RSTRING"},
79 {"rmember", "TYPE", "RUSER"},
80 {"rmember", "TYPE", "RKERBEROS"},
81 {"service", "TYPE", "REPLICAT"},
82 {"service", "TYPE", "UNIQUE"},
83 {"KERBEROS", "TYPEDATA", "string"},
84 {"LIST", "TYPEDATA", "list"},
85 {"NONE", "TYPEDATA", "none"},
86 {"POP", "TYPEDATA", "machine"},
87 {"RLIST", "TYPEDATA", "list"},
88 {"RSTRING", "TYPEDATA", "string"},
89 {"RUSER", "TYPEDATA", "user"},
90 {"SMTP", "TYPEDATA", "string"},
91 {"STRING", "TYPEDATA", "string"},
92 {"USER", "TYPEDATA", "user"},
101 ## char *table, *user, *value, *query, *trans, *type, *db;
111 printf("Unable to open the database\n");
115 strcpy(buffer, "root");
118 for (i = 0; table = tables[i]; i++) {
119 ## define permit all on table to user
121 printf("Unable to give %s permission to access table %s\n",
126 printf("Enter the name of another user to be given direct access to\n");
127 printf("the database, or [RETURN] if none: ");
132 for (i = 0; table = tables[i]; i++) {
133 ## repeat append tblstats (#table = @table, modtime = "now")
135 printf("Unable to initialize tblstats for %s\n", table);
140 for (i = 0; value = values[i]; i++) {
141 ## repeat append values (#name = @value, #value = 1)
143 printf("Unable to install initial value of %s\n", value);
148 printf("What is the starting UID to assign: ");
152 ## append values (#name = "uid", #value = i)
154 printf("Unable to install value for uid\n");
158 printf("What is the starting GID to assign: ");
162 ## append values (#name = "gid", #value = i)
164 printf("Unable to install value for gid\n");
168 printf("What is the default NFS quota to assign: ");
172 ## append values (#name = "def_quota", #value = i)
174 printf("Unable to install value for def_quota\n");
178 /* place holder records */
179 ## append users (login = "[nobody]", potype="NONE")
181 printf("Unable to install 0 user\n");
184 ## append machine (name = "[NONE]", #type="NONE")
186 printf("Unable to install 0 machine\n");
189 ## append cluster (name = "[unassigned]")
191 printf("Unable to install 0 cluster\n");
194 ## append list (name = "[none]", acl_type = "NONE")
196 printf("Unable to install 0 list\n");
200 /* magic for ALL_USERS */
201 ## append users (login = "default", users_id = 1, potype="NONE")
203 printf("Unable to install default user\n");
206 ## append list (name = "default", list_id = 1, acl_type = "NONE")
208 printf("Unable to install default list\n");
211 ## append members (list_id = 1, member_type = "USER", member_id = 1)
213 printf("Unable to install default user on default list\n");
217 /* Priveleged users */
218 ## append users (login = "root", users_id = 2, potype="NONE")
220 printf("Unable to install root user\n");
223 ## append list (name = "dbadmin", list_id = 2, acl_type = "LIST", acl_id = 2)
225 printf("Unable to install default dbadmin list\n");
229 printf("What is the name of a priveleged user: ");
233 ## append users (login = user, users_id = 3, potype="NONE")
235 printf("Unable to install user %s\n", buffer);
238 ## append members (list_id = 2, member_type = "USER", member_id = 3)
240 printf("Unable to put user %s on list dbadmin\n", buffer);
244 /* And the capacls */
245 for (i = 0; i < QueryCount2; i++) {
246 query = Queries2[i].name;
247 value = Queries2[i].shortname;
248 ## repeat append capacls (capability = @query, tag = @value, list_id = 2)
250 printf("Unable to install query ACL for %s (%s)\n", query, value);
254 ## append capacls (capability = "trigger_dcm", tag = "tdcm", list_id = 2)
256 /* and the aliases */
257 for (i = 0; aliases[i].name ; i++) {
258 value = aliases[i].name;
259 type = aliases[i].type;
260 trans = aliases[i].trans;
261 ## repeat append alias (#name = @value, #type = @type, #trans = @trans)
271 * ingerr: (supposedly) called when Ingres indicates an error.
272 * I have not yet been able to get this to work to intercept a
273 * database open error.
286 int access_visible_list() {}
287 int access_maillist() {}
289 int access_login() {}
290 int access_filesys() {}
305 int uusr_login_check() {}
307 int set_modtime_by_id() {}
308 int set_user_modtime() {}
309 int set_user_modtime_by_id() {}
310 int set_finger_modtime() {}
311 int set_filesys_modtime() {}
312 int set_mach_modtime() {}
313 int set_mach_modtime_by_id() {}
314 int set_serverhost_modtime() {}
315 int set_zephyr_modtime() {}
316 int followup_amtl() {}
317 int followup_ausr() {}
318 int followup_delete_list() {}
319 int followup_add_pobox() {}
320 int followup_delete_pobox() {}
321 int followup_usha() {}
322 int followup_old_gpob() {}
323 int followup_gsha() {}
324 int followup_anfq() {}
325 int followup_gzcl() {}
326 int followup_fix_acl() {}
327 int followup_fix_modby() {}
328 int translate_ids() {}
329 int expand_list_flags() {}
330 int add_new_quota() {}
331 int count_members_of_list() {}
332 int get_list_is_group() {}
333 int get_list_is_maillist() {}
335 int delete_locker() {}
336 int add_user_group() {}
337 int set_user_pobox() {}
338 int get_members_of_list() {}
339 int get_groups_of_user() {}
340 int get_groups_of_all_users() {}
341 int get_all_poboxes() {}
342 int get_new_poboxes() {}
343 int get_lists_of_administrator() {}
344 int followup_gpob() {}
347 int set_pobox_modtime() {}
349 int set_cluster_modtime_by_id() {}
350 int access_service() {}
351 int followup_glin() {}
352 int qualified_get_server() {}
353 int qualified_get_serverhost() {}
355 int set_nfsphys_modtime() {}
357 int access_member() {}
360 int qualified_get_lists() {}
361 int delete_current_quota() {}
362 int setup_add_group() {}
365 int get_lists_of_member() {}
367 int get_list_info() {}
368 int register_user() {}
369 int access_vis_list_by_name() {}
370 int set_uppercase_modtime() {}
371 int add_member_to_list() {}
372 int delete_member_from_list() {}
374 int followup_gnfq() {}