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 Queries1[], Queries2[];
19 extern int QueryCount1, 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", "NFS"},
52 {"filesys", "TYPE", "RVD"},
53 {"gaus", "TYPE", "LIST"},
54 {"gaus", "TYPE", "USER"},
55 {"gaus", "TYPE", "RLIST"},
56 {"gaus", "TYPE", "RUSER"},
57 {"lockertype", "TYPE", "HOMEDIR"},
58 {"lockertype", "TYPE", "OTHER"},
59 {"lockertype", "TYPE", "PROJECT"},
60 {"lockertype", "TYPE", "SYSTEM"},
61 {"lockertype", "TYPE", "UNKNOWN"},
62 {"mac_type", "TYPE", "RT"},
63 {"mac_type", "TYPE", "VAX"},
64 {"member", "TYPE", "LIST"},
65 {"member", "TYPE", "STRING"},
66 {"member", "TYPE", "USER"},
67 {"pobox", "TYPE", "SMTP"},
68 {"pobox", "TYPE", "NONE"},
69 {"pobox", "TYPE", "POP"},
70 {"rmember", "TYPE", "LIST"},
71 {"rmember", "TYPE", "STRING"},
72 {"rmember", "TYPE", "USER"},
73 {"rmember", "TYPE", "RLIST"},
74 {"rmember", "TYPE", "RSTRING"},
75 {"rmember", "TYPE", "RUSER"},
76 {"service", "TYPE", "REPLICAT"},
77 {"service", "TYPE", "UNIQUE"},
78 {"LIST", "TYPEDATA", "list"},
79 {"NONE", "TYPEDATA", "none"},
80 {"POP", "TYPEDATA", "machine"},
81 {"RLIST", "TYPEDATA", "list"},
82 {"RSTRING", "TYPEDATA", "string"},
83 {"RUSER", "TYPEDATA", "user"},
84 {"SMTP", "TYPEDATA", "string"},
85 {"STRING", "TYPEDATA", "string"},
86 {"USER", "TYPEDATA", "user"},
95 ## char *table, *user, *value, *query, *trans, *type, *db;
105 printf("Unable to open the database\n");
109 strcpy(buffer, "root");
112 for (i = 0; table = tables[i]; i++) {
113 ## define permit all on table to user
115 printf("Unable to give %s permission to access table %s\n",
120 printf("Enter the name of another user to be given direct access to\n");
121 printf("the database, or [RETURN] if none: ");
126 for (i = 0; table = tables[i]; i++) {
127 ## repeat append tblstats (#table = @table, modtime = "now")
129 printf("Unable to initialize tblstats for %s\n", table);
134 for (i = 0; value = values[i]; i++) {
135 ## repeat append values (#name = @value, #value = 1)
137 printf("Unable to install initial value of %s\n", value);
142 printf("What is the starting UID to assign: ");
146 ## append values (#name = "uid", #value = i)
148 printf("Unable to install value for uid\n");
152 printf("What is the starting GID to assign: ");
156 ## append values (#name = "gid", #value = i)
158 printf("Unable to install value for gid\n");
162 printf("What is the default NFS quota to assign: ");
166 ## append values (#name = "def_quota", #value = i)
168 printf("Unable to install value for def_quota\n");
172 /* place holder records */
173 ## append users (login = "[nobody]", potype="NONE")
175 printf("Unable to install 0 user\n");
178 ## append machine (name = "[none]", #type="NONE")
180 printf("Unable to install 0 machine\n");
183 ## append cluster (name = "[unassigned]")
185 printf("Unable to install 0 cluster\n");
188 ## append list (name = "[none]", acl_type = "NONE")
190 printf("Unable to install 0 list\n");
194 /* magic for ALL_USERS */
195 ## append users (login = "default", users_id = 1, potype="NONE")
197 printf("Unable to install default user\n");
200 ## append list (name = "default", list_id = 1, acl_type = "NONE")
202 printf("Unable to install default list\n");
205 ## append members (list_id = 1, member_type = "USER", member_id = 1)
207 printf("Unable to install default user on default list\n");
211 /* Priveleged users */
212 ## append users (login = "root", users_id = 2, potype="NONE")
214 printf("Unable to install root user\n");
217 ## append list (name = "dbadmin", list_id = 2, acl_type = "LIST", acl_id = 2)
219 printf("Unable to install default dbadmin list\n");
223 printf("What is the name of a priveleged user: ");
227 ## append users (login = user, users_id = 3, potype="NONE")
229 printf("Unable to install user %s\n", buffer);
232 ## append members (list_id = 2, member_type = "USER", member_id = 3)
234 printf("Unable to put user %s on list dbadmin\n", buffer);
238 /* And the capacls */
239 for (i = 0; i < QueryCount1; i++) {
240 query = Queries1[i].name;
241 value = Queries1[i].shortname;
242 ## repeat append capacls (capability = @query, tag = @value, list_id = 2)
244 printf("Unable to install query ACL for %s (%s)\n", query, value);
248 for (i = 0; i < QueryCount2; i++) {
249 query = Queries2[i].name;
250 value = Queries2[i].shortname;
251 ## repeat retrieve (flag = any(capacls.tag where capacls.tag = @value))
253 ## repeat append capacls (capability = @query, tag = @value, list_id = 2)
255 printf("Unable to install query ACL for %s (%s)\n", query, value);
260 ## append capacls (capability = "trigger_dcm", tag = "tdcm", list_id = 2)
262 /* and the aliases */
263 for (i = 0; aliases[i].name ; i++) {
264 value = aliases[i].name;
265 type = aliases[i].type;
266 trans = aliases[i].trans;
267 ## repeat append alias (#name = @value, #type = @type, #trans = @trans)
277 * ingerr: (supposedly) called when Ingres indicates an error.
278 * I have not yet been able to get this to work to intercept a
279 * database open error.
292 int access_visible_list() {}
293 int access_maillist() {}
295 int access_login() {}
296 int access_filesys() {}
311 int uusr_login_check() {}
313 int set_modtime_by_id() {}
314 int set_user_modtime() {}
315 int set_user_modtime_by_id() {}
316 int set_finger_modtime() {}
317 int set_filesys_modtime() {}
318 int set_mach_modtime() {}
319 int set_mach_modtime_by_id() {}
320 int set_serverhost_modtime() {}
321 int set_zephyr_modtime() {}
322 int followup_amtl() {}
323 int followup_ausr() {}
324 int followup_delete_list() {}
325 int followup_add_pobox() {}
326 int followup_delete_pobox() {}
327 int followup_usha() {}
328 int followup_old_gpob() {}
329 int followup_gsha() {}
330 int followup_anfq() {}
331 int followup_gzcl() {}
332 int followup_fix_acl() {}
333 int followup_fix_modby() {}
334 int translate_ids() {}
335 int expand_list_flags() {}
336 int add_new_quota() {}
337 int count_members_of_list() {}
338 int get_list_is_group() {}
339 int get_list_is_maillist() {}
341 int delete_locker() {}
342 int add_user_group() {}
343 int set_user_pobox() {}
344 int get_members_of_list() {}
345 int get_groups_of_user() {}
346 int get_groups_of_all_users() {}
347 int get_all_poboxes() {}
348 int get_new_poboxes() {}
349 int get_lists_of_administrator() {}
350 int followup_gpob() {}
353 int set_pobox_modtime() {}
355 int set_cluster_modtime_by_id() {}
356 int access_service() {}
357 int followup_glin() {}
358 int qualified_get_server() {}
359 int qualified_get_serverhost() {}
361 int set_nfsphys_modtime() {}
363 int access_member() {}
366 int qualified_get_lists() {}
367 int delete_current_quota() {}
368 int setup_add_group() {}
371 int get_lists_of_member() {}
373 int get_list_info() {}
374 int register_user() {}
375 int access_vis_list_by_name() {}