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", "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", "LIST"},
66 {"member", "TYPE", "STRING"},
67 {"member", "TYPE", "USER"},
68 {"pobox", "TYPE", "SMTP"},
69 {"pobox", "TYPE", "NONE"},
70 {"pobox", "TYPE", "POP"},
71 {"rmember", "TYPE", "LIST"},
72 {"rmember", "TYPE", "STRING"},
73 {"rmember", "TYPE", "USER"},
74 {"rmember", "TYPE", "RLIST"},
75 {"rmember", "TYPE", "RSTRING"},
76 {"rmember", "TYPE", "RUSER"},
77 {"service", "TYPE", "REPLICAT"},
78 {"service", "TYPE", "UNIQUE"},
79 {"LIST", "TYPEDATA", "list"},
80 {"NONE", "TYPEDATA", "none"},
81 {"POP", "TYPEDATA", "machine"},
82 {"RLIST", "TYPEDATA", "list"},
83 {"RSTRING", "TYPEDATA", "string"},
84 {"RUSER", "TYPEDATA", "user"},
85 {"SMTP", "TYPEDATA", "string"},
86 {"STRING", "TYPEDATA", "string"},
87 {"USER", "TYPEDATA", "user"},
96 ## char *table, *user, *value, *query, *trans, *type, *db;
106 printf("Unable to open the database\n");
110 strcpy(buffer, "root");
113 for (i = 0; table = tables[i]; i++) {
114 ## define permit all on table to user
116 printf("Unable to give %s permission to access table %s\n",
121 printf("Enter the name of another user to be given direct access to\n");
122 printf("the database, or [RETURN] if none: ");
127 for (i = 0; table = tables[i]; i++) {
128 ## repeat append tblstats (#table = @table, modtime = "now")
130 printf("Unable to initialize tblstats for %s\n", table);
135 for (i = 0; value = values[i]; i++) {
136 ## repeat append values (#name = @value, #value = 1)
138 printf("Unable to install initial value of %s\n", value);
143 printf("What is the starting UID to assign: ");
147 ## append values (#name = "uid", #value = i)
149 printf("Unable to install value for uid\n");
153 printf("What is the starting GID to assign: ");
157 ## append values (#name = "gid", #value = i)
159 printf("Unable to install value for gid\n");
163 printf("What is the default NFS quota to assign: ");
167 ## append values (#name = "def_quota", #value = i)
169 printf("Unable to install value for def_quota\n");
173 /* place holder records */
174 ## append users (login = "[nobody]", potype="NONE")
176 printf("Unable to install 0 user\n");
179 ## append machine (name = "[none]", #type="NONE")
181 printf("Unable to install 0 machine\n");
184 ## append cluster (name = "[unassigned]")
186 printf("Unable to install 0 cluster\n");
189 ## append list (name = "[none]", acl_type = "NONE")
191 printf("Unable to install 0 list\n");
195 /* magic for ALL_USERS */
196 ## append users (login = "default", users_id = 1, potype="NONE")
198 printf("Unable to install default user\n");
201 ## append list (name = "default", list_id = 1, acl_type = "NONE")
203 printf("Unable to install default list\n");
206 ## append members (list_id = 1, member_type = "USER", member_id = 1)
208 printf("Unable to install default user on default list\n");
212 /* Priveleged users */
213 ## append users (login = "root", users_id = 2, potype="NONE")
215 printf("Unable to install root user\n");
218 ## append list (name = "dbadmin", list_id = 2, acl_type = "LIST", acl_id = 2)
220 printf("Unable to install default dbadmin list\n");
224 printf("What is the name of a priveleged user: ");
228 ## append users (login = user, users_id = 3, potype="NONE")
230 printf("Unable to install user %s\n", buffer);
233 ## append members (list_id = 2, member_type = "USER", member_id = 3)
235 printf("Unable to put user %s on list dbadmin\n", buffer);
239 /* And the capacls */
240 for (i = 0; i < QueryCount1; i++) {
241 query = Queries1[i].name;
242 value = Queries1[i].shortname;
243 ## repeat append capacls (capability = @query, tag = @value, list_id = 2)
245 printf("Unable to install query ACL for %s (%s)\n", query, value);
249 for (i = 0; i < QueryCount2; i++) {
250 query = Queries2[i].name;
251 value = Queries2[i].shortname;
252 ## repeat retrieve (flag = any(capacls.tag where capacls.tag = @value))
254 ## repeat append capacls (capability = @query, tag = @value, list_id = 2)
256 printf("Unable to install query ACL for %s (%s)\n", query, value);
261 ## append capacls (capability = "trigger_dcm", tag = "tdcm", list_id = 2)
263 /* and the aliases */
264 for (i = 0; aliases[i].name ; i++) {
265 value = aliases[i].name;
266 type = aliases[i].type;
267 trans = aliases[i].trans;
268 ## repeat append alias (#name = @value, #type = @type, #trans = @trans)
278 * ingerr: (supposedly) called when Ingres indicates an error.
279 * I have not yet been able to get this to work to intercept a
280 * database open error.
293 int access_visible_list() {}
294 int access_maillist() {}
296 int access_login() {}
297 int access_filesys() {}
312 int uusr_login_check() {}
314 int set_modtime_by_id() {}
315 int set_user_modtime() {}
316 int set_user_modtime_by_id() {}
317 int set_finger_modtime() {}
318 int set_filesys_modtime() {}
319 int set_mach_modtime() {}
320 int set_mach_modtime_by_id() {}
321 int set_serverhost_modtime() {}
322 int set_zephyr_modtime() {}
323 int followup_amtl() {}
324 int followup_ausr() {}
325 int followup_delete_list() {}
326 int followup_add_pobox() {}
327 int followup_delete_pobox() {}
328 int followup_usha() {}
329 int followup_old_gpob() {}
330 int followup_gsha() {}
331 int followup_anfq() {}
332 int followup_gzcl() {}
333 int followup_fix_acl() {}
334 int followup_fix_modby() {}
335 int translate_ids() {}
336 int expand_list_flags() {}
337 int add_new_quota() {}
338 int count_members_of_list() {}
339 int get_list_is_group() {}
340 int get_list_is_maillist() {}
342 int delete_locker() {}
343 int add_user_group() {}
344 int set_user_pobox() {}
345 int get_members_of_list() {}
346 int get_groups_of_user() {}
347 int get_groups_of_all_users() {}
348 int get_all_poboxes() {}
349 int get_new_poboxes() {}
350 int get_lists_of_administrator() {}
351 int followup_gpob() {}
354 int set_pobox_modtime() {}
356 int set_cluster_modtime_by_id() {}
357 int access_service() {}
358 int followup_glin() {}
359 int qualified_get_server() {}
360 int qualified_get_serverhost() {}
362 int set_nfsphys_modtime() {}
364 int access_member() {}
367 int qualified_get_lists() {}
368 int delete_current_quota() {}
369 int setup_add_group() {}
372 int get_lists_of_member() {}
374 int get_list_info() {}
375 int register_user() {}
376 int access_vis_list_by_name() {}
377 int set_uppercase_modtime() {}