From d548a4e78f42896b6f13f382f0ba32c4c05a0e45 Mon Sep 17 00:00:00 2001 From: mar Date: Mon, 19 Mar 1990 15:41:25 +0000 Subject: [PATCH] sms -> moira --- server/cache.qc | 38 +-- server/increment.qc | 4 +- server/mr_glue.c | 48 ++-- server/mr_main.c | 54 ++-- server/mr_sauth.c | 16 +- server/mr_scall.c | 118 ++++----- server/mr_server.h | 12 +- server/mr_shutdown.c | 4 +- server/mr_srvdata.c | 8 +- server/mr_util.c | 10 +- server/qrtn.qc | 168 ++++++------- server/qsubs.c | 6 +- server/qsupport.qc | 580 +++++++++++++++++++++---------------------- server/queries2.c | 254 +++++++++---------- 14 files changed, 660 insertions(+), 660 deletions(-) diff --git a/server/cache.qc b/server/cache.qc index 2a2df3ef..2c5635ce 100644 --- a/server/cache.qc +++ b/server/cache.qc @@ -15,11 +15,11 @@ static char *rcsid_qsupport_qc = "$Header$"; #include #include "query.h" -#include "sms_server.h" +#include "mr_server.h" extern char *whoami, *strsave(); -extern int ingres_errno, sms_errcode; +extern int ingres_errno, mr_errcode; /*** NOTE ************************************************************** @@ -126,7 +126,7 @@ int *id; i->prev = &cachehead; cachehead.next->prev = i; cachehead.next = i; - return(SMS_SUCCESS); + return(MR_SUCCESS); } cachemisses++; @@ -158,17 +158,17 @@ int *id; ## repeat retrieve (j = strings.string_id) where strings.#string=@iname break; default: - return(SMS_INTERNAL); + return(MR_INTERNAL); } ## inquire_equel(rowcount = "rowcount") - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); if (rowcount == 0) - return(SMS_NO_MATCH); + return(MR_NO_MATCH); if (rowcount > 1) - return(SMS_NOT_UNIQUE); + return(MR_NOT_UNIQUE); *id = j; if (name[0] == '#' && !strcasecmp(type, "USER")) - return(SMS_SUCCESS); + return(MR_SUCCESS); if (cachesize < CACHESIZE) { i = (struct item *) malloc(sizeof(struct item)); cachesize++; @@ -185,7 +185,7 @@ int *id; i->prev = &cachehead; cachehead.next->prev = i; cachehead.next = i; - return(SMS_SUCCESS); + return(MR_SUCCESS); ##} @@ -215,7 +215,7 @@ char **name; i->prev = &cachehead; cachehead.next->prev = i; cachehead.next = i; - return(SMS_SUCCESS); + return(MR_SUCCESS); } cachemisses++; @@ -247,22 +247,22 @@ char **name; ## repeat retrieve (iname = strings.string) where strings.string_id=@j break; default: - return(SMS_INTERNAL); + return(MR_INTERNAL); } ## inquire_equel(rowcount = "rowcount") - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); if (rowcount == 0) { free(*name); sprintf(iname, "#%d", j); *name = strsave(iname); - return(SMS_NO_MATCH); + return(MR_NO_MATCH); } if (rowcount != 1) - return(SMS_INTERNAL); + return(MR_INTERNAL); free(*name); *name = strsave(strtrim(iname)); if (**name == '#' && !strcasecmp(type, "USER")) - return(SMS_SUCCESS); + return(MR_SUCCESS); if (cachesize < CACHESIZE) { i = (struct item *) malloc(sizeof(struct item)); cachesize++; @@ -279,7 +279,7 @@ char **name; i->prev = &cachehead; cachehead.next->prev = i; cachehead.next = i; - return(SMS_SUCCESS); + return(MR_SUCCESS); ##} @@ -296,7 +296,7 @@ int id; for (i = cachehead.next; i != &cachehead; i = i->next) if (i->id == id && !strcmp(i->type, type)) - return(SMS_SUCCESS); + return(MR_SUCCESS); if (cachesize < CACHESIZE) { i = (struct item *) malloc(sizeof(struct item)); cachesize++; @@ -313,7 +313,7 @@ int id; i->prev = &cachehead; cachehead.next->prev = i; cachehead.next = i; - return(SMS_SUCCESS); + return(MR_SUCCESS); } @@ -334,7 +334,7 @@ char *type; i->next->prev = i->prev; i->prev->next = i->next; free(i); - return(SMS_SUCCESS); + return(MR_SUCCESS); } } } diff --git a/server/increment.qc b/server/increment.qc index 55733c84..6074ee41 100644 --- a/server/increment.qc +++ b/server/increment.qc @@ -14,9 +14,9 @@ static char *rcsid_qrtn_qc = "$Header$"; #endif lint #include -#include +#include #include "query.h" -#include "sms_server.h" +#include "mr_server.h" extern char *whoami; char *malloc(); diff --git a/server/mr_glue.c b/server/mr_glue.c index 24c46fe4..a7b4d80a 100644 --- a/server/mr_glue.c +++ b/server/mr_glue.c @@ -12,11 +12,11 @@ */ #ifndef lint -static char *rcsid_sms_glue_c = "$Header$"; +static char *rcsid_mr_glue_c = "$Header$"; #endif lint #include -#include "sms_server.h" +#include "mr_server.h" #include #include #include @@ -26,7 +26,7 @@ static char *rcsid_sms_glue_c = "$Header$"; static int already_connected = 0; -#define CHECK_CONNECTED { if (!already_connected) return SMS_NOT_CONNECTED; } +#define CHECK_CONNECTED { if (!already_connected) return MR_NOT_CONNECTED; } static client pseudo_client; extern int errno; @@ -34,35 +34,35 @@ extern char *malloc(), *whoami; extern time_t now; void reapchild(); -sms_connect(server) +mr_connect(server) char *server; { register int status; extern int query_timeout; - if (already_connected) return SMS_ALREADY_CONNECTED; + if (already_connected) return MR_ALREADY_CONNECTED; initialize_sms_error_table(); initialize_krb_error_table(); bzero((char *)&pseudo_client, sizeof(pseudo_client)); /* XXX */ query_timeout = 0; - status = sms_open_database(); + status = mr_open_database(); if (!status) already_connected = 1; signal(SIGCHLD, reapchild); return status; } -sms_disconnect() +mr_disconnect() { CHECK_CONNECTED; - sms_close_database(); + mr_close_database(); already_connected = 0; return 0; } -sms_noop() +mr_noop() { CHECK_CONNECTED; return 0; @@ -70,7 +70,7 @@ sms_noop() /* * This routine is rather bogus, as it only fills in who you claim to be. */ -sms_auth(prog) +mr_auth(prog) char *prog; { struct passwd *pw; @@ -95,8 +95,8 @@ char *prog; name_to_id(pseudo_client.kname.name, "USER", &pseudo_client.users_id); pseudo_client.client_id = pseudo_client.users_id; strcpy(pseudo_client.entity, prog); - pseudo_client.args = (sms_params *) malloc(sizeof(sms_params)); - pseudo_client.args->sms_version_no = SMS_VERSION_2; + pseudo_client.args = (mr_params *) malloc(sizeof(mr_params)); + pseudo_client.args->mr_version_no = MR_VERSION_2; return 0; } @@ -110,14 +110,14 @@ int argc; char **argv; struct hint *arg; { - if (sms_trim_args(argc, argv) == SMS_NO_MEM) { - com_err(whoami, SMS_NO_MEM, "while trimmming args"); + if (mr_trim_args(argc, argv) == MR_NO_MEM) { + com_err(whoami, MR_NO_MEM, "while trimmming args"); } (*arg->proc)(argc, argv, arg->hint); } -int sms_query(name, argc, argv, callproc, callarg) +int mr_query(name, argc, argv, callproc, callarg) char *name; /* Query name */ int argc; /* Arg count */ char **argv; /* Args */ @@ -129,20 +129,20 @@ int sms_query(name, argc, argv, callproc, callarg) time(&now); hints.proc = callproc; hints.hint = callarg; - return sms_process_query(&pseudo_client, name, argc, argv, + return mr_process_query(&pseudo_client, name, argc, argv, callback, &hints); } -int sms_access(name, argc, argv) +int mr_access(name, argc, argv) char *name; /* Query name */ int argc; /* Arg count */ char **argv; /* Args */ { time(&now); - return sms_check_access(&pseudo_client, name, argc, argv); + return mr_check_access(&pseudo_client, name, argc, argv); } -int sms_query_internal(argc, argv, callproc, callarg) +int mr_query_internal(argc, argv, callproc, callarg) int argc; char **argv; int (*callproc)(); @@ -153,19 +153,19 @@ int sms_query_internal(argc, argv, callproc, callarg) time(&now); hints.proc = callproc; hints.hint = callarg; - return sms_process_query(&pseudo_client, argv[0], argc-1, argv+1, + return mr_process_query(&pseudo_client, argv[0], argc-1, argv+1, callback, &hints); } -int sms_access_internal(argc, argv) +int mr_access_internal(argc, argv) int argc; char **argv; { time(&now); - return sms_check_access(&pseudo_client, argv[0], argc-1, argv+1); + return mr_check_access(&pseudo_client, argv[0], argc-1, argv+1); } -sms_shutdown(why) +mr_shutdown(why) char *why; { fprintf(stderr, "Sorry, not implemented\n"); @@ -202,7 +202,7 @@ trigger_dcm(dummy0, dummy1, cl) return(errno); default: - return(SMS_SUCCESS); + return(MR_SUCCESS); } } diff --git a/server/mr_main.c b/server/mr_main.c index ec6a13ca..0b950667 100644 --- a/server/mr_main.c +++ b/server/mr_main.c @@ -7,7 +7,7 @@ * For copying and distribution information, please see the file * . * - * SMS server process. + * MOIRA server process. * * Most of this is stolen from ../gdb/tsr.c * @@ -16,7 +16,7 @@ * */ -static char *rcsid_sms_main_c = "$Header$"; +static char *rcsid_mr_main_c = "$Header$"; #include #include @@ -25,7 +25,7 @@ static char *rcsid_sms_main_c = "$Header$"; #include #include #include -#include "sms_server.h" +#include "mr_server.h" #include extern CONNECTION newconn, listencon; @@ -49,7 +49,7 @@ extern FILE *journal; extern char *malloc(); extern int free(); extern char *inet_ntoa(); -extern void sms_com_err(); +extern void mr_com_err(); extern void do_client(); extern int sigshut(); @@ -60,7 +60,7 @@ void reapchild(), godormant(), gowakeup(); extern time_t now; /* - * Main SMS server loop. + * Main MOIRA server loop. * * Initialize the world, then start accepting connections and * making progress on current connections. @@ -82,11 +82,11 @@ main(argc, argv) */ initialize_sms_error_table(); initialize_krb_error_table(); - set_com_err_hook(sms_com_err); + set_com_err_hook(mr_com_err); setlinebuf(stderr); if (argc != 1) { - com_err(whoami, 0, "Usage: smsd"); + com_err(whoami, 0, "Usage: moirad"); exit(1); } @@ -112,8 +112,8 @@ main(argc, argv) * Database initialization. Only init if database should be open. */ - if (stat(SMS_MOTD_FILE, &stbuf) != 0) { - if ((status = sms_open_database()) != 0) { + if (stat(MOIRA_MOTD_FILE, &stbuf) != 0) { + if ((status = mr_open_database()) != 0) { com_err(whoami, status, " when trying to open database."); exit(1); } @@ -131,7 +131,7 @@ main(argc, argv) nclients = 0; clients = (client **) malloc(0); - sms_setup_signals(); + mr_setup_signals(); journal = fopen(JOURNAL, "a"); if (journal == NULL) { @@ -151,11 +151,11 @@ main(argc, argv) op_list = create_list_of_operations(1, listenop); com_err(whoami, 0, "started (pid %d)", getpid()); - com_err(whoami, 0, rcsid_sms_main_c); + com_err(whoami, 0, rcsid_mr_main_c); if (dormant != ASLEEP) - send_zgram("SMS", "server started"); + send_zgram("MOIRA", "server started"); else - send_zgram("SMS", "server started, but database closed"); + send_zgram("MOIRA", "server started, but database closed"); /* * Run until shut down. @@ -169,16 +169,16 @@ main(argc, argv) com_err(whoami, 0, "tick"); #endif notdef if (dormant == SLEEPY) { - sms_close_database(); + mr_close_database(); com_err(whoami, 0, "database closed"); - sms_setup_signals(); - send_zgram("SMS", "database closed"); + mr_setup_signals(); + send_zgram("MOIRA", "database closed"); dormant = ASLEEP; } else if (dormant == GROGGY) { - sms_open_database(); + mr_open_database(); com_err(whoami, 0, "database open"); - sms_setup_signals(); - send_zgram("SMS", "database open again"); + mr_setup_signals(); + send_zgram("MOIRA", "database open again"); dormant = AWAKE; } @@ -229,7 +229,7 @@ main(argc, argv) * down now. */ if ((dormant == AWAKE) && (nclients == 1) && - (stat(SMS_MOTD_FILE, &stbuf) == 0)) { + (stat(MOIRA_MOTD_FILE, &stbuf) == 0)) { com_err(whoami, 0, "motd file exists, slumbertime"); dormant = SLEEPY; } @@ -237,7 +237,7 @@ main(argc, argv) * to be down, then wake up. */ if ((dormant == ASLEEP) && - (stat(SMS_MOTD_FILE, &stbuf) == -1) && + (stat(MOIRA_MOTD_FILE, &stbuf) == -1) && (errno == ENOENT)) { com_err(whoami, 0, "motd file no longer exists, waking up"); dormant = GROGGY; @@ -263,8 +263,8 @@ main(argc, argv) } } com_err(whoami, 0, "%s", takedown); - sms_close_database(); - send_zgram("SMS", takedown); + mr_close_database(); + send_zgram("MOIRA", takedown); return 0; } @@ -275,7 +275,7 @@ main(argc, argv) int do_listen() { - char *service = index(SMS_SERVER, ':') + 1; + char *service = index(MOIRA_SERVER, ':') + 1; listencon = create_listening_connection(service); @@ -319,7 +319,7 @@ new_connection() } if (newconn == NULL) { - return SMS_NOT_CONNECTED; + return MR_NOT_CONNECTED; } /* @@ -332,7 +332,7 @@ new_connection() cp->id = counter++; cp->args = NULL; cp->clname[0] = NULL; - cp->reply.sms_argv = NULL; + cp->reply.mr_argv = NULL; cp->first = NULL; cp->last = NULL; cp->last_time_used = now; @@ -524,7 +524,7 @@ void gowakeup() } -sms_setup_signals() +mr_setup_signals() { /* There should probably be a few more of these. */ diff --git a/server/mr_sauth.c b/server/mr_sauth.c index fb413317..45b34a18 100644 --- a/server/mr_sauth.c +++ b/server/mr_sauth.c @@ -15,7 +15,7 @@ static char *rcsid_sms_sauth_c = "$Header$"; #include #include -#include "sms_server.h" +#include "mr_server.h" #include #include @@ -26,7 +26,7 @@ extern char *malloc(); char *kname_unparse(); /* - * Handle a SMS_AUTH RPC request. + * Handle a MOIRA_AUTH RPC request. * * argv[0] is a kerberos authenticator. Decompose it, and if * successful, store the name the user authenticated to in @@ -43,8 +43,8 @@ do_auth(cl) char buf[REALM_SZ+INST_SZ+ANAME_SZ], hostbuf[BUFSIZ], *host, *p; extern int errno; - auth.length = cl->args->sms_argl[0]; - bcopy(cl->args->sms_argv[0], (char *)auth.dat, auth.length); + auth.length = cl->args->mr_argl[0]; + bcopy(cl->args->mr_argv[0], (char *)auth.dat, auth.length); auth.mbz = 0; if (gethostname(hostbuf, sizeof(hostbuf)) < 0) com_err(whoami, errno, "Unable to get local hostname"); @@ -60,7 +60,7 @@ do_auth(cl) (status = krb_rd_req (&auth, "sms", "sms", cl->haddr.sin_addr, &ad, "")) != 0) { status += ERROR_TABLE_BASE_krb; - cl->reply.sms_status = status; + cl->reply.mr_status = status; if (log_flags & LOG_RES) com_err(whoami, status, "(authentication failed)"); return; @@ -80,8 +80,8 @@ do_auth(cl) set_krb_mapping(cl->clname, ad.pname, ok, &cl->client_id, &cl->users_id); - if (cl->args->sms_version_no == SMS_VERSION_2) { - bcopy(cl->args->sms_argv[1], cl->entity, 8); + if (cl->args->mr_version_no == MR_VERSION_2) { + bcopy(cl->args->mr_argv[1], cl->entity, 8); cl->entity[8] = 0; } else { strcpy(cl->entity, "???"); @@ -92,7 +92,7 @@ do_auth(cl) com_err(whoami, 0, "Auth to %s using %s, uid %d cid %d", cl->clname, cl->entity, cl->users_id, cl->client_id); if (cl->users_id == 0) - cl->reply.sms_status = SMS_USER_AUTH; + cl->reply.mr_status = MR_USER_AUTH; } diff --git a/server/mr_scall.c b/server/mr_scall.c index 155e6b2d..a42f6df5 100644 --- a/server/mr_scall.c +++ b/server/mr_scall.c @@ -20,7 +20,7 @@ static char *rcsid_sms_scall_c = "$Header$"; #include #include #include "query.h" -#include "sms_server.h" +#include "mr_server.h" extern char buf1[]; extern int nclients; extern char *whoami; @@ -51,7 +51,7 @@ do_client(cp) * go down, then go down now. */ if ((dormant == AWAKE) && (nclients == 0) && - (stat(SMS_MOTD_FILE, &stbuf) == 0)) { + (stat(MOIRA_MOTD_FILE, &stbuf) == 0)) { com_err(whoami, 0, "motd file exists, slumbertime"); dormant = SLEEPY; } @@ -61,7 +61,7 @@ do_client(cp) case CL_ACCEPT: case CL_SEND: /* Start recieving next request */ - initialize_operation(cp->pending_op, sms_start_recv, + initialize_operation(cp->pending_op, mr_start_recv, (char *)&cp->args, (int (*)())NULL); queue_operation(cp->con, CON_INPUT, cp->pending_op); cp->action = CL_RECEIVE; @@ -69,9 +69,9 @@ do_client(cp) case CL_RECEIVE: /* Data is here. Process it & start it heading back */ do_call(cp); /* This may block for a while. */ - sms_destroy_reply(cp->args); + mr_destroy_reply(cp->args); cp->args = NULL; - initialize_operation(cp->pending_op, sms_start_send, + initialize_operation(cp->pending_op, mr_start_send, (char *)&cp->reply, (int (*)())NULL); queue_operation(cp->con, CON_OUTPUT, cp->pending_op); cp->action = CL_SEND; @@ -95,55 +95,55 @@ do_call(cl) client *cl; { int pn; - cl->reply.sms_argc = 0; - cl->reply.sms_status = 0; - cl->reply.sms_version_no = cl->args->sms_version_no; - if (((pn = cl->args->sms_procno) < 0) || - (pn > SMS_MAX_PROC)) { + cl->reply.mr_argc = 0; + cl->reply.mr_status = 0; + cl->reply.mr_version_no = cl->args->mr_version_no; + if (((pn = cl->args->mr_procno) < 0) || + (pn > MR_MAX_PROC)) { com_err(whoami, 0, "procno out of range"); - cl->reply.sms_status = SMS_UNKNOWN_PROC; + cl->reply.mr_status = MR_UNKNOWN_PROC; return; } if (log_flags & LOG_ARGS) - log_args(procnames[pn], cl->args->sms_version_no, - cl->args->sms_argc, cl->args->sms_argv); + log_args(procnames[pn], cl->args->mr_version_no, + cl->args->mr_argc, cl->args->mr_argv); else if (log_flags & LOG_REQUESTS) com_err(whoami, 0, "%s", procnames[pn]); if ((dormant == ASLEEP || dormant == GROGGY) && - pn != SMS_NOOP && pn != SMS_MOTD) { - cl->reply.sms_status = SMS_DOWN; + pn != MR_NOOP && pn != MR_MOTD) { + cl->reply.mr_status = MR_DOWN; if (log_flags & LOG_RES) - com_err(whoami, SMS_DOWN, "(query refused)"); + com_err(whoami, MR_DOWN, "(query refused)"); return; } switch(pn) { - case SMS_NOOP: - cl->reply.sms_status = 0; + case MR_NOOP: + cl->reply.mr_status = 0; return; - case SMS_AUTH: + case MR_AUTH: do_auth(cl); return; - case SMS_QUERY: + case MR_QUERY: do_retr(cl); return; - case SMS_ACCESS: + case MR_ACCESS: do_access(cl); return; - case SMS_SHUTDOWN: + case MR_SHUTDOWN: do_shutdown(cl); return; - case SMS_DO_UPDATE: + case MR_DO_UPDATE: trigger_dcm(0, 0, cl); return; - case SMS_MOTD: + case MR_MOTD: get_motd(cl); return; } @@ -158,7 +158,7 @@ free_rtn_tuples(cp) temp = t1->next; if (t1 == cp->last) cp->last = NULL; - sms_destroy_reply(t1->retval); + mr_destroy_reply(t1->retval); delete_operation(t1->op); free(t1); } @@ -175,7 +175,7 @@ retr_callback(argc, argv, p_cp) * This takes too much advantage of the fact that * serialization of the data happens during the queue operation. */ - sms_params *arg_tmp = (sms_params *)db_alloc(sizeof(sms_params)); + mr_params *arg_tmp = (mr_params *)db_alloc(sizeof(mr_params)); returned_tuples *tp = (returned_tuples *) db_alloc(sizeof(returned_tuples)); register char **nargv = (char **)malloc(argc * sizeof(char *)); @@ -183,27 +183,27 @@ retr_callback(argc, argv, p_cp) OPERATION op_tmp = create_operation(); - if (sms_trim_args(argc, argv) == SMS_NO_MEM) { - com_err(whoami, SMS_NO_MEM, "while trimming args"); + if (mr_trim_args(argc, argv) == MR_NO_MEM) { + com_err(whoami, MR_NO_MEM, "while trimming args"); } if (log_flags & LOG_RESP) - log_args("return: ", cp->args->sms_version_no, argc, argv); + log_args("return: ", cp->args->mr_version_no, argc, argv); tp->op = op_tmp; tp->retval = arg_tmp; tp->next = NULL; - arg_tmp->sms_status = SMS_MORE_DATA; - arg_tmp->sms_version_no = cp->args->sms_version_no; - arg_tmp->sms_argc = argc; - arg_tmp->sms_argv = nargv; + arg_tmp->mr_status = MR_MORE_DATA; + arg_tmp->mr_version_no = cp->args->mr_version_no; + arg_tmp->mr_argc = argc; + arg_tmp->mr_argv = nargv; for (i = 0; i < argc; i++) { register int len = strlen(argv[i]) + 1; nargv[i] = malloc(len); bcopy(argv[i], nargv[i], len); } - arg_tmp->sms_flattened = (char *)NULL; - arg_tmp->sms_argl = (int *)NULL; + arg_tmp->mr_flattened = (char *)NULL; + arg_tmp->mr_argl = (int *)NULL; if (cp->last) { cp->last->next = tp; @@ -213,7 +213,7 @@ retr_callback(argc, argv, p_cp) } reset_operation(op_tmp); - initialize_operation(op_tmp, sms_start_send, (char *)arg_tmp, + initialize_operation(op_tmp, mr_start_send, (char *)arg_tmp, (int (*)())NULL); queue_operation(cp->con, CON_OUTPUT, op_tmp); } @@ -256,24 +256,24 @@ do_retr(cl) { register char *queryname; - cl->reply.sms_argc = 0; - cl->reply.sms_status = 0; + cl->reply.mr_argc = 0; + cl->reply.mr_status = 0; - queryname = cl->args->sms_argv[0]; + queryname = cl->args->mr_argv[0]; - if (cl->args->sms_version_no == SMS_VERSION_2) + if (cl->args->mr_version_no == MR_VERSION_2) newqueries++; else oldqueries++; if (strcmp(queryname, "_list_users") == 0) - cl->reply.sms_status = list_users(retr_callback, (char *)cl); + cl->reply.mr_status = list_users(retr_callback, (char *)cl); else { - cl->reply.sms_status = - sms_process_query(cl, - cl->args->sms_argv[0], - cl->args->sms_argc-1, - cl->args->sms_argv+1, + cl->reply.mr_status = + mr_process_query(cl, + cl->args->mr_argv[0], + cl->args->mr_argc-1, + cl->args->mr_argv+1, retr_callback, (char *)cl); } @@ -284,13 +284,13 @@ do_retr(cl) do_access(cl) client *cl; { - cl->reply.sms_argc = 0; + cl->reply.mr_argc = 0; - cl->reply.sms_status = - sms_check_access(cl, - cl->args->sms_argv[0], - cl->args->sms_argc-1, - cl->args->sms_argv+1); + cl->reply.mr_status = + mr_check_access(cl, + cl->args->mr_argv[0], + cl->args->mr_argc-1, + cl->args->mr_argv+1); com_err(whoami, 0, "Access check complete."); } @@ -312,10 +312,10 @@ trigger_dcm(dummy0, dummy1, cl) register int pid; char prog[128]; - cl->reply.sms_argc = 0; + cl->reply.mr_argc = 0; - if (cl->reply.sms_status = check_query_access(&pseudo_query, 0, cl) ) - return(cl->reply.sms_status); + if (cl->reply.mr_status = check_query_access(&pseudo_query, 0, cl) ) + return(cl->reply.mr_status); sprintf(prog, "%s/startdcm", BIN_DIR); pid = vfork(); @@ -327,7 +327,7 @@ trigger_dcm(dummy0, dummy1, cl) exit(1); case -1: - cl->reply.sms_status = errno; + cl->reply.mr_status = errno; return(0); default: @@ -344,12 +344,12 @@ client *cl; char *arg[1]; arg[0] = buffer; - cl->reply.sms_status = 0; - motd = open(SMS_MOTD_FILE, 0, O_RDONLY); + cl->reply.mr_status = 0; + motd = open(MOIRA_MOTD_FILE, 0, O_RDONLY); if (motd < 0) return; len = read(motd, buffer, sizeof(buffer) - 1); close(motd); buffer[len] = 0; retr_callback(1, arg, cl); - cl->reply.sms_status = 0; + cl->reply.mr_status = 0; } diff --git a/server/mr_server.h b/server/mr_server.h index 08813a17..610ba44e 100644 --- a/server/mr_server.h +++ b/server/mr_server.h @@ -11,14 +11,14 @@ #include #include #include -#include "sms_proto.h" -#include +#include "mr_proto.h" +#include #include typedef struct returned_tuples { struct returned_tuples *next; OPERATION op; - sms_params *retval; + mr_params *retval; } returned_tuples; /* @@ -40,13 +40,13 @@ typedef struct _client { OPERATION pending_op; /* Primary pending operation */ CONNECTION con; /* Connection to the client */ int action; /* what action is pending? */ - sms_params *args, reply; + mr_params *args, reply; int id; /* Unique id of client */ struct sockaddr_in haddr; /* IP address of client */ char clname[MAX_K_NAME_SZ];/* Name client authenticated to */ struct krbname kname; /* Parsed version of the above */ - int users_id; /* SMS internal ID of authenticated user */ - int client_id; /* SMS internal ID of client for modby field */ + int users_id; /* MR internal ID of authenticated user */ + int client_id; /* MR internal ID of client for modby field */ returned_tuples *first, *last; time_t last_time_used; /* Last time connection used */ char entity[9]; /* entity on other end of the connection */ diff --git a/server/mr_shutdown.c b/server/mr_shutdown.c index b492b9f3..a3e99c75 100644 --- a/server/mr_shutdown.c +++ b/server/mr_shutdown.c @@ -16,7 +16,7 @@ static char *rcsid_sms_shutdown_c = "$Header$"; #include #include #include -#include "sms_server.h" +#include "mr_server.h" extern char *takedown; extern char *whoami; @@ -36,6 +36,6 @@ do_shutdown(cl) */ com_err(whoami, 0, "Shutdown request by %s rejected", cl->clname); - cl->reply.sms_status = EACCES; + cl->reply.mr_status = EACCES; } diff --git a/server/mr_srvdata.c b/server/mr_srvdata.c index 12e97b72..0118d46a 100644 --- a/server/mr_srvdata.c +++ b/server/mr_srvdata.c @@ -11,11 +11,11 @@ */ #ifndef lint -static char *rcsid_sms_srvdata_c = "$Header$"; +static char *rcsid_mr_srvdata_c = "$Header$"; #endif lint #include -#include "sms_server.h" +#include "mr_server.h" /* * Connections & clients: @@ -45,7 +45,7 @@ struct sockaddr_in client_addr; int client_addrlen; /* * Additional data sent at connect time by the client - * (provided by GDB; ignored by SMS) + * (provided by GDB; ignored by Moira) */ TUPLE client_tuple; @@ -59,7 +59,7 @@ char *whoami; char buf1[BUFSIZ]; /* - * If non-null, reason for shutdown. (SMS will be going down shortly + * If non-null, reason for shutdown. (Moira will be going down shortly * if this is non-null) */ char *takedown=NULL; diff --git a/server/mr_util.c b/server/mr_util.c index c008e568..a8190ca8 100644 --- a/server/mr_util.c +++ b/server/mr_util.c @@ -9,11 +9,11 @@ */ #ifndef lint -static char *rcsid_sms_util_c = "$Header$"; +static char *rcsid_mr_util_c = "$Header$"; #endif lint #include -#include "sms_server.h" +#include "mr_server.h" #include #include @@ -74,7 +74,7 @@ log_args(tag, version, argc, argv) com_err(whoami, 0, "%s", buf); } -void sms_com_err(whoami, code, fmt, pvar) +void mr_com_err(whoami, code, fmt, pvar) char *whoami; int code; char *fmt; @@ -98,11 +98,11 @@ void sms_com_err(whoami, code, fmt, pvar) } -/* sms_trim_args: passed an argument vector, it will trim any trailing +/* mr_trim_args: passed an argument vector, it will trim any trailing * spaces on the args by writing a null into the string. */ -int sms_trim_args(argc, argv) +int mr_trim_args(argc, argv) int argc; char **argv; { diff --git a/server/qrtn.qc b/server/qrtn.qc index dafe643d..b0c99e0f 100644 --- a/server/qrtn.qc +++ b/server/qrtn.qc @@ -15,12 +15,12 @@ static char *rcsid_qrtn_qc = "$Header$"; #include #include "query.h" -#include "sms_server.h" +#include "mr_server.h" char *Argv[16]; int ingres_errno = 0; -int sms_errcode = 0; +int mr_errcode = 0; ## int query_timeout = 30; extern char *whoami; extern FILE *journal; @@ -43,29 +43,29 @@ static int ingerr(num) switch (*num) { case INGRES_BAD_INT: - sms_errcode = SMS_INTEGER; + mr_errcode = MR_INTEGER; break; case INGRES_BAD_DATE: - sms_errcode = SMS_DATE; + mr_errcode = MR_DATE; break; case INGRES_DEADLOCK: - sms_errcode = SMS_DEADLOCK; + mr_errcode = MR_DEADLOCK; com_err(whoami, 0, "INGRES deadlock detected"); break; case INGRES_TIMEOUT: - sms_errcode = SMS_BUSY; + mr_errcode = MR_BUSY; com_err(whoami, 0, "timed out getting lock"); break; default: - sms_errcode = SMS_INGRES_ERR; - com_err(whoami, SMS_INGRES_ERR, " code %d\n", *num); - critical_alert("SMS", "SMS server encountered INGRES ERROR %d", *num); + mr_errcode = MR_INGRES_ERR; + com_err(whoami, MR_INGRES_ERR, " code %d\n", *num); + critical_alert("MOIRA", "Moira server encountered INGRES ERROR %d", *num); return (*num); } return (0); } -int sms_open_database() +int mr_open_database() { register int i; char *malloc(); @@ -84,7 +84,7 @@ int sms_open_database() } ingres_errno = 0; - sms_errcode = 0; + mr_errcode = 0; /* open the database */ ## ingres sms @@ -94,13 +94,13 @@ int sms_open_database() return ingres_errno; } -int sms_close_database() +int mr_close_database() { flush_cache(); ## exit } -sms_check_access(cl, name, argc, argv_ro) +mr_check_access(cl, name, argc, argv_ro) client *cl; char *name; int argc; @@ -110,16 +110,16 @@ sms_check_access(cl, name, argc, argv_ro) struct query *get_query_by_name(); ingres_errno = 0; - sms_errcode = 0; + mr_errcode = 0; - q = get_query_by_name(name, cl->args->sms_version_no); + q = get_query_by_name(name, cl->args->mr_version_no); if (q == (struct query *)0) - return(SMS_NO_HANDLE); + return(MR_NO_HANDLE); - return(sms_verify_query(cl, q, argc, argv_ro)); + return(mr_verify_query(cl, q, argc, argv_ro)); } -sms_process_query(cl, name, argc, argv_ro, action, actarg) +mr_process_query(cl, name, argc, argv_ro, action, actarg) client *cl; char *name; int argc; @@ -142,27 +142,27 @@ sms_process_query(cl, name, argc, argv_ro, action, actarg) char *build_sort(); ingres_errno = 0; - sms_errcode = 0; + mr_errcode = 0; /* list queries command */ if (!strcmp(name, "_list_queries")) { - list_queries(cl->args->sms_version_no, action, actarg); - return(SMS_SUCCESS); + list_queries(cl->args->mr_version_no, action, actarg); + return(MR_SUCCESS); } /* help query command */ if (!strcmp(name, "_help")) { if (argc < 1) - return(SMS_ARGS); - q = get_query_by_name(argv_ro[0], cl->args->sms_version_no); - if (q == (struct query *)0) return(SMS_NO_HANDLE); + return(MR_ARGS); + q = get_query_by_name(argv_ro[0], cl->args->mr_version_no); + if (q == (struct query *)0) return(MR_NO_HANDLE); help_query(q, action, actarg); - return(SMS_SUCCESS); + return(MR_SUCCESS); } /* get query structure, return error if named query does not exist */ - q = get_query_by_name(name, cl->args->sms_version_no); - if (q == (struct query *)0) return(SMS_NO_HANDLE); + q = get_query_by_name(name, cl->args->mr_version_no); + if (q == (struct query *)0) return(MR_NO_HANDLE); v = q->validate; if (q->type != RETRIEVE) { @@ -170,13 +170,13 @@ sms_process_query(cl, name, argc, argv_ro, action, actarg) } /* setup argument vector, verify access and arguments */ - if ((status = sms_verify_query(cl, q, argc, argv_ro)) != SMS_SUCCESS) + if ((status = mr_verify_query(cl, q, argc, argv_ro)) != MR_SUCCESS) goto out; /* perform any special query pre-processing */ if (v && v->pre_rtn) { status = (*v->pre_rtn)(q, Argv, cl, 0); - if (status != SMS_SUCCESS) + if (status != MR_SUCCESS) goto out; } @@ -186,7 +186,7 @@ sms_process_query(cl, name, argc, argv_ro, action, actarg) uniquely exists */ if (v && v->field) { status = validate_row(q, Argv, v); - if (status != SMS_EXISTS) break; + if (status != MR_EXISTS) break; } /* build "where" clause if needed */ @@ -211,7 +211,7 @@ sms_process_query(cl, name, argc, argv_ro, action, actarg) if (v && v->post_rtn) { sq = sq_create(); status = do_retrieve(q, pqual, psort, sq_save_args, sq); - if (status != SMS_SUCCESS) { + if (status != MR_SUCCESS) { sq_destroy(sq); break; } @@ -220,7 +220,7 @@ sms_process_query(cl, name, argc, argv_ro, action, actarg) /* normal retrieve */ status = do_retrieve(q, pqual, psort, action, actarg); } - if (status != SMS_SUCCESS) break; + if (status != MR_SUCCESS) break; } else { status = (*v->post_rtn)(q, Argv, cl, action, actarg); } @@ -231,7 +231,7 @@ sms_process_query(cl, name, argc, argv_ro, action, actarg) /* see if row already exists */ if (v->field) { status = validate_row(q, Argv, v); - if (status != SMS_EXISTS) break; + if (status != MR_EXISTS) break; } /* build "where" clause and perform update */ @@ -241,7 +241,7 @@ sms_process_query(cl, name, argc, argv_ro, action, actarg) incremental_before(q->rtable, qual, argv_ro); status = do_update(q, &Argv[q->argc], qual, action, actarg); incremental_after(q->rtable, qual, argv_ro); - if (status != SMS_SUCCESS) break; + if (status != MR_SUCCESS) break; flush_name(argv_ro[0], q->rtable); table = q->rtable; if (strcmp(q->shortname, "sshi") && strcmp(q->shortname, "ssif")) { @@ -260,13 +260,13 @@ sms_process_query(cl, name, argc, argv_ro, action, actarg) /* see if row already exists */ if (v->field) { status = validate_row(q, Argv, v); - if (status != SMS_NO_MATCH) break; + if (status != MR_NO_MATCH) break; } /* increment id number if necessary */ if (v->object_id) { status = set_next_object_id(v->object_id, q->rtable); - if (status != SMS_SUCCESS) break; + if (status != MR_SUCCESS) break; } /* build "where" clause if needed */ @@ -282,7 +282,7 @@ sms_process_query(cl, name, argc, argv_ro, action, actarg) if (q->rvar) { incremental_clear_before(); status = do_append(q, &Argv[q->argc], pqual, action, actarg); - if (status != SMS_SUCCESS) break; + if (status != MR_SUCCESS) break; if (v && v->object_id) { sprintf(qual, "%s.%s = values.value and values.name = \"%s\"", q->rvar, v->object_id, v->object_id); @@ -304,7 +304,7 @@ sms_process_query(cl, name, argc, argv_ro, action, actarg) /* see if row already exists */ if (v->field) { status = validate_row(q, Argv, v); - if (status != SMS_EXISTS) break; + if (status != MR_EXISTS) break; } /* build "where" clause and perform delete */ @@ -317,7 +317,7 @@ sms_process_query(cl, name, argc, argv_ro, action, actarg) incremental_before(q->rtable, qual, argv_ro); status = do_delete(q, qual, action, actarg); incremental_clear_after(); - if (status != SMS_SUCCESS) break; + if (status != MR_SUCCESS) break; flush_name(argv_ro[0], q->rtable); ## repeat replace tblstats (deletes = tblstats.deletes + 1, ## modtime = "now") @@ -331,14 +331,14 @@ sms_process_query(cl, name, argc, argv_ro, action, actarg) } out: - if (status == SMS_SUCCESS && ingres_errno != 0) { - com_err(whoami, SMS_INTERNAL, "Server didn't notice INGRES ERROR %d", + if (status == MR_SUCCESS && ingres_errno != 0) { + com_err(whoami, MR_INTERNAL, "Server didn't notice INGRES ERROR %d", ingres_errno); - status = sms_errcode; + status = mr_errcode; } if (q->type != RETRIEVE) { - if (status == SMS_SUCCESS) { + if (status == MR_SUCCESS) { ## end transaction /* commit to this */ if (journal) { char buf[1024], *bp; @@ -347,7 +347,7 @@ out: fprintf(journal, "%% %s %s %s", cl->clname, cl->entity, ctime(&now)); - fprintf(journal, "%s[%d] ", q->name, cl->args->sms_version_no); + fprintf(journal, "%s[%d] ", q->name, cl->args->mr_version_no); for (i = 0; i < argc; i++) { if (i != 0) { putc(' ', journal); @@ -368,7 +368,7 @@ out: ## set lockmode session where readlock = system } - if (status != SMS_SUCCESS && log_flags & LOG_RES) + if (status != MR_SUCCESS && log_flags & LOG_RES) com_err(whoami, status, " (Query failed)"); return(status); } @@ -387,13 +387,13 @@ build_qual(fmt, argc, argv, qual) c = fmt; for (i = 0; i < argc; i++) { c = index(c, '%'); - if (c++ == (char *)0) return(SMS_ARGS); + if (c++ == (char *)0) return(MR_ARGS); if (*c == 's') args[i] = argv[i]; else if (*c == 'd') *(int *)&args[i] = *(int *)argv[i]; /* sigh */ else - return(SMS_INGRES_ERR); + return(MR_INGRES_ERR); } switch (argc) { @@ -417,7 +417,7 @@ build_qual(fmt, argc, argv, qual) sprintf(qual, fmt, args[0], args[1], args[2], args[3]); break; } - return(SMS_SUCCESS); + return(MR_SUCCESS); } char * @@ -448,7 +448,7 @@ build_sort(v, sort) /* Build arguement vector, verify query and arguments */ -sms_verify_query(cl, q, argc, argv_ro) +mr_verify_query(cl, q, argc, argv_ro) client *cl; struct query *q; int argc; @@ -463,44 +463,44 @@ sms_verify_query(cl, q, argc, argv_ro) /* copy the arguments into a local argv that we can modify */ if (argc >= QMAXARGS) - return(SMS_ARGS); + return(MR_ARGS); for (i = 0; i < argc; i++) { if ((len = strlen(argv_ro[i])) < ARGLEN) strcpy(Argv[i], argv_ro[i]); else - return(SMS_ARG_TOO_LONG); + return(MR_ARG_TOO_LONG); if (Argv[i][len-1] == '\\') - return(SMS_BAD_CHAR); + return(MR_BAD_CHAR); } /* check initial query access */ status = check_query_access(q, Argv, cl); - if (status != SMS_SUCCESS && status != SMS_PERM) + if (status != MR_SUCCESS && status != MR_PERM) return(status); - if (status == SMS_SUCCESS) + if (status == MR_SUCCESS) privileged++; /* check argument count */ argreq = q->argc; if (q->type == UPDATE || q->type == APPEND) argreq += q->vcnt; - if (argc != argreq) return(SMS_ARGS); + if (argc != argreq) return(MR_ARGS); /* validate arguments */ if (v && v->valobj) { status = validate_fields(q, Argv, v->valobj, v->objcnt); - if (status != SMS_SUCCESS) return(status); + if (status != MR_SUCCESS) return(status); } /* perform special query access check */ if (!privileged && v && v->acs_rtn) { status = (*v->acs_rtn)(q, Argv, cl); - if (status != SMS_SUCCESS && status != SMS_PERM) + if (status != MR_SUCCESS && status != MR_PERM) return(status); - if (status == SMS_SUCCESS) + if (status == MR_SUCCESS) privileged++; } - return(privileged ? SMS_SUCCESS : SMS_PERM); + return(privileged ? MR_SUCCESS : MR_PERM); } @@ -535,8 +535,8 @@ check_query_access(q, argv, cl) name = q->shortname; ## retrieve (acl_id = capacls.list_id) where capacls.tag = name ## inquire_equel (rowcount = "rowcount", errorno = "errorno") - if (errorno != 0) return(SMS_INGRES_ERR); - if (rowcount == 0) return(SMS_PERM); + if (errorno != 0) return(MR_INGRES_ERR); + if (rowcount == 0) return(MR_PERM); q->acl = acl_id; /* check for default access */ @@ -548,14 +548,14 @@ check_query_access(q, argv, cl) } if (q->everybody) - return(SMS_SUCCESS); + return(MR_SUCCESS); - if (get_client(cl, &client_type, &client_id) != SMS_SUCCESS) - return(SMS_PERM); + if (get_client(cl, &client_type, &client_id) != MR_SUCCESS) + return(MR_PERM); if (find_member("LIST", acl_id, client_type, client_id, 0)) - return(SMS_SUCCESS); + return(MR_SUCCESS); else - return(SMS_PERM); + return(MR_PERM); ##} @@ -567,16 +567,16 @@ get_client(cl, client_type, client_id) if (cl->users_id > 0) { *client_id = cl->users_id; *client_type = "USER"; - return(SMS_SUCCESS); + return(MR_SUCCESS); } if (cl->client_id < 0) { *client_id = -cl->users_id; *client_type = "KERBEROS"; - return(SMS_SUCCESS); + return(MR_SUCCESS); } - return(SMS_PERM); + return(MR_PERM); } ##find_member(list_type, list_id, member_type, member_id) @@ -623,12 +623,12 @@ do_retrieve(q, pqual, psort, action, actarg) register int i; if ((vaddrs = (char **)malloc(sizeof(char *) * QMAXARGS)) == NULL) { - com_err(whoami, SMS_NO_MEM, "setting up static argv"); + com_err(whoami, MR_NO_MEM, "setting up static argv"); exit(1); } for (i = 0; i < QMAXARGS; i++) { if ((vaddrs[i] = malloc(QMAXARGSIZE)) == NULL) { - com_err(whoami, SMS_NO_MEM, "setting up static argv"); + com_err(whoami, MR_NO_MEM, "setting up static argv"); exit(1); } } @@ -672,9 +672,9 @@ do_retrieve(q, pqual, psort, action, actarg) } } - if (sms_errcode) return(sms_errcode); + if (mr_errcode) return(mr_errcode); ## inquire_equel (rowcount = "rowcount") - return ((rowcount == 0) ? SMS_NO_MATCH : SMS_SUCCESS); + return ((rowcount == 0) ? MR_NO_MATCH : MR_SUCCESS); ##} do_update(q, argv, qual, action, actarg) @@ -697,8 +697,8 @@ do_update(q, argv, qual, action, actarg) ## replace rvar (param (q->tlist, argv)) ## where cqual - if (sms_errcode) return(sms_errcode); - return(SMS_SUCCESS); + if (mr_errcode) return(mr_errcode); + return(MR_SUCCESS); ##} do_append(q, argv, pqual, action, actarg) @@ -724,8 +724,8 @@ do_append(q, argv, pqual, action, actarg) ## append to rtable (param (q->tlist, argv)) } - if (sms_errcode) return(sms_errcode); - return(SMS_SUCCESS); + if (mr_errcode) return(mr_errcode); + return(MR_SUCCESS); ##} do_delete(q, qual, action, actarg) @@ -746,8 +746,8 @@ do_delete(q, qual, action, actarg) cqual = qual; ## delete rvar where cqual - if (sms_errcode) return(sms_errcode); - return(SMS_SUCCESS); + if (mr_errcode) return(mr_errcode); + return(MR_SUCCESS); ##} @@ -774,12 +774,12 @@ set_next_object_id(object, table) ## repeat retrieve (value = values.#value) where values.#name = @name ## inquire_equel(rowcount = "rowcount") if (rowcount != 1) - return(SMS_NO_ID); + return(MR_NO_ID); ## retrieve (exists = any(tbl.name where tbl.name = value)) ## inquire_equel(rowcount = "rowcount") if (rowcount != 1) - return(SMS_NO_ID); + return(MR_NO_ID); while (exists) { value++; if (value > MAX_ID_VALUE) @@ -790,7 +790,7 @@ set_next_object_id(object, table) if (LOG_RES) com_err(whoami, 0, "setting ID %s to %d", name, value); ## repeat replace values (#value = @value) where values.#name = @name - return(SMS_SUCCESS); + return(MR_SUCCESS); ##} @@ -822,7 +822,7 @@ int *uid; return; } - if (name_to_id(name, "STRINGS", &k_id) == SMS_SUCCESS) + if (name_to_id(name, "STRINGS", &k_id) == MR_SUCCESS) *kid = -k_id; if (!ok) { @@ -830,7 +830,7 @@ int *uid; return; } - if (name_to_id(login, "USERS", uid) != SMS_SUCCESS) + if (name_to_id(login, "USERS", uid) != MR_SUCCESS) *uid = 0; if (*kid == 0) diff --git a/server/qsubs.c b/server/qsubs.c index d1a0c0e3..8325ee65 100644 --- a/server/qsubs.c +++ b/server/qsubs.c @@ -14,7 +14,7 @@ static char *rcsid_qsubs_c = "$Header$"; #endif lint #include -#include +#include #include "query.h" #ifdef MULTIPROTOCOLS @@ -34,7 +34,7 @@ get_query_by_name(name, version) register int i; #ifdef MULTIPROTOCOLS - if (version == SMS_VERSION_1) { + if (version == MR_VERSION_1) { q = Queries1; i = QueryCount1; } else { @@ -78,7 +78,7 @@ list_queries(version, action, actarg) int qcmp(); #ifdef MULTIPROTOCOLS - if (version == SMS_VERSION_1) { + if (version == MR_VERSION_1) { count = QueryCount1; if (squeries1 == (struct query **)0) { sq = (struct query **)malloc(count * sizeof (struct query *)); diff --git a/server/qsupport.qc b/server/qsupport.qc index 294ef879..899bc6a6 100644 --- a/server/qsupport.qc +++ b/server/qsupport.qc @@ -15,12 +15,12 @@ static char *rcsid_qsupport_qc = "$Header$"; #include #include "query.h" -#include "sms_server.h" +#include "mr_server.h" #include extern char *whoami, *strsave(); -extern int ingres_errno, sms_errcode; +extern int ingres_errno, mr_errcode; /* Specialized Access Routines */ @@ -37,9 +37,9 @@ access_user(q, argv, cl) client *cl; { if (cl->users_id != *(int *)argv[0]) - return(SMS_PERM); + return(MR_PERM); else - return(SMS_SUCCESS); + return(MR_SUCCESS); } @@ -62,9 +62,9 @@ access_login(q, argv, cl) ## retrieve (id = u.users_id) where qual ## inquire_equel(rowcount = "rowcount") if (rowcount != 1 || id != cl->users_id) - return(SMS_PERM); + return(MR_PERM); else - return(SMS_SUCCESS); + return(MR_SUCCESS); ##} @@ -98,29 +98,29 @@ access_list(q, argv, cl) ## where list.#list_id = @list_id ## inquire_equel(rowcount = "rowcount") if (rowcount != 1) - return(SMS_INTERNAL); + return(MR_INTERNAL); /* parse client structure */ - if ((status = get_client(cl, &client_type, &client_id)) != SMS_SUCCESS) + if ((status = get_client(cl, &client_type, &client_id)) != MR_SUCCESS) return(status); /* if amtl or dmfl and list is public allow client to add or delete self */ if (((!strcmp("amtl", q->shortname) && flags) || (!strcmp("dmfl", q->shortname))) && (!strcmp("USER", argv[1]))) { - if (*(int *)argv[2] == client_id) return(SMS_SUCCESS); + if (*(int *)argv[2] == client_id) return(MR_SUCCESS); /* if update_list, don't allow them to change the GID */ } else if (!strcmp("ulis", q->shortname)) { if ((!strcmp(argv[7], UNIQUE_GID) && (gid != -1)) || (strcmp(argv[7], UNIQUE_GID) && (gid != atoi(argv[7])))) - return(SMS_PERM); + return(MR_PERM); } /* check for client in access control list */ status = find_member(acl_type, acl_id, client_type, client_id, 0); - if (!status) return(SMS_PERM); + if (!status) return(MR_PERM); - return(SMS_SUCCESS); + return(MR_SUCCESS); ##} @@ -146,21 +146,21 @@ access_visible_list(q, argv, cl) ## acl_type = list.#acl_type) where list.#list_id = @list_id ## inquire_equel(rowcount = "rowcount") if (rowcount != 1) - return(SMS_INTERNAL); + return(MR_INTERNAL); if (!flags) - return(SMS_SUCCESS); + return(MR_SUCCESS); /* parse client structure */ - if ((status = get_client(cl, &client_type, &client_id)) != SMS_SUCCESS) + if ((status = get_client(cl, &client_type, &client_id)) != MR_SUCCESS) return(status); /* check for client in access control list */ status = find_member(acl_type, acl_id, client_type, client_id, 0); if (!status) - return(SMS_PERM); + return(MR_PERM); - return(SMS_SUCCESS); + return(MR_SUCCESS); ##} @@ -186,22 +186,22 @@ access_vis_list_by_name(q, argv, cl) ## acl_type = list.#acl_type) where list.#name = @listname ## inquire_equel(rowcount = "rowcount"); if (rowcount > 1) - return(SMS_WILDCARD); + return(MR_WILDCARD); if (rowcount == 0) - return(SMS_NO_MATCH); + return(MR_NO_MATCH); if (!flags) - return(SMS_SUCCESS); + return(MR_SUCCESS); /* parse client structure */ - if ((status = get_client(cl, &client_type, &client_id)) != SMS_SUCCESS) + if ((status = get_client(cl, &client_type, &client_id)) != MR_SUCCESS) return(status); /* check for client in access control list */ status = find_member(acl_type, acl_id, client_type, client_id, 0); if (!status) - return(SMS_PERM); + return(MR_PERM); - return(SMS_SUCCESS); + return(MR_SUCCESS); ##} @@ -220,10 +220,10 @@ access_member(q, argv, cl) if (!strcmp(argv[0], "USER") || !strcmp(argv[0], "RUSER")) { if (cl->users_id == *(int *)argv[1]) - return(SMS_SUCCESS); + return(MR_SUCCESS); } - return(SMS_PERM); + return(MR_PERM); } @@ -237,8 +237,8 @@ access_qgli(q, argv, cl) client *cl; { if (!strcmp(argv[0], "TRUE") && !strcmp(argv[2], "FALSE")) - return(SMS_SUCCESS); - return(SMS_PERM); + return(MR_SUCCESS); + return(MR_PERM); } @@ -261,17 +261,17 @@ access_service(q, argv, cl) ## where servers.#name = uppercase(@name) ## inquire_equel(rowcount = "rowcount") if (rowcount > 1) - return(SMS_PERM); + return(MR_PERM); /* parse client structure */ - if ((status = get_client(cl, &client_type, &client_id)) != SMS_SUCCESS) + if ((status = get_client(cl, &client_type, &client_id)) != MR_SUCCESS) return(status); /* check for client in access control list */ status = find_member(acl_type, acl_id, client_type, client_id, 0); - if (!status) return(SMS_PERM); + if (!status) return(MR_PERM); - return(SMS_SUCCESS); + return(MR_SUCCESS); ##} @@ -296,16 +296,16 @@ access_filesys(q, argv, cl) ## inquire_equel(rowcount = "rowcount") if (rowcount != 1) - return(SMS_PERM); + return(MR_PERM); if (users_id == cl->users_id) - return(SMS_SUCCESS); - if ((status = get_client(cl, &client_type, &client_id)) != SMS_SUCCESS) + return(MR_SUCCESS); + if ((status = get_client(cl, &client_type, &client_id)) != MR_SUCCESS) return(status); status = find_member("LIST", list_id, client_type, client_id, 0); if (status) - return(SMS_SUCCESS); + return(MR_SUCCESS); else - return(SMS_PERM); + return(MR_PERM); ##} @@ -332,11 +332,11 @@ setup_ausr(q, argv, cl) if (!strcmp(argv[1], UNIQUE_UID) || atoi(argv[1]) == -1) { if (set_next_object_id("uid", "users")) - return(SMS_INGRES_ERR); + return(MR_INGRES_ERR); ## repeat retrieve (nuid = values.value) where values.name = "uid" ## inquire_equel(rowcount = "rowcount") if (rowcount != 1) - return(SMS_INTERNAL); + return(MR_INTERNAL); sprintf(argv[1], "%d", nuid); } @@ -344,7 +344,7 @@ setup_ausr(q, argv, cl) sprintf(argv[0], "#%s", argv[1]); } - return(SMS_SUCCESS); + return(MR_SUCCESS); ##} @@ -363,32 +363,32 @@ int setup_dusr(q, argv) /* For now, only allow users to be deleted if their status is 0 */ ## repeat retrieve (flag = u.status) where u.users_id = @id if (flag != 0 && flag != 4) - return(SMS_IN_USE); + return(MR_IN_USE); ## repeat delete nfsquota where nfsquota.users_id = @id ## repeat delete krbmap where krbmap.users_id = @id ## repeat retrieve (flag = any(imembers.member_id where imembers.member_id=@id ## and imembers.member_type = "USER")) if (flag) - return(SMS_IN_USE); + return(MR_IN_USE); ## repeat retrieve (flag = any(filesys.label where filesys.owner=@id)) if (flag) - return(SMS_IN_USE); + return(MR_IN_USE); ## repeat retrieve (flag = any(list.name where list.acl_id=@id and ## list.acl_type = "USER")) if (flag) - return(SMS_IN_USE); + return(MR_IN_USE); ## repeat retrieve (flag = any(servers.name where servers.acl_id=@id and ## servers.acl_type = "USER")) if (flag) - return(SMS_IN_USE); + return(MR_IN_USE); ## repeat retrieve (flag=any(hostaccess.acl_id where hostaccess.acl_id=@id and ## hostaccess.acl_type = "USER")) if (flag) - return(SMS_IN_USE); + return(MR_IN_USE); if (ingres_errno) - return(sms_errcode); - return(SMS_SUCCESS); + return(mr_errcode); + return(MR_SUCCESS); ##} @@ -408,10 +408,10 @@ char **argv; ## and u.pop_id != 0 and u.users_id = @id)) ## where u.users_id = @id if (!flag) - return(SMS_MACHINE); + return(MR_MACHINE); if (strcmp(strtrim(type), "POP")) set_pop_usage(mid, 1); - return(SMS_SUCCESS); + return(MR_SUCCESS); ##} @@ -427,11 +427,11 @@ char **argv; user = *(int *)argv[0]; ## repeat retrieve (type = u.potype, id = u.pop_id) ## where u.users_id = @user - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); if (!strcmp(strtrim(type), "POP")) set_pop_usage(id, -1); - return(SMS_SUCCESS); + return(MR_SUCCESS); ##} @@ -449,27 +449,27 @@ int setup_dmac(q, argv) ## repeat retrieve (flag = any(users.login where users.potype = "POP" ## and users.pop_id=@id)) if (flag) - return(SMS_IN_USE); + return(MR_IN_USE); ## repeat retrieve (flag = any(serverhosts.mach_id ## where serverhosts.mach_id=@id)) if (flag) - return(SMS_IN_USE); + return(MR_IN_USE); ## repeat retrieve (flag = any(nfsphys.mach_id where nfsphys.mach_id=@id)) if (flag) - return(SMS_IN_USE); + return(MR_IN_USE); ## repeat retrieve (flag = any(hostaccess.mach_id where hostaccess.mach_id=@id)) if (flag) - return(SMS_IN_USE); + return(MR_IN_USE); ## repeat retrieve (flag = any(printcap.mach_id where printcap.mach_id=@id)) if (flag) - return(SMS_IN_USE); + return(MR_IN_USE); ## repeat retrieve (flag = any(palladium.mach_id where palladium.mach_id=@id)) if (flag) - return(SMS_IN_USE); + return(MR_IN_USE); ## repeat delete mcmap where mcmap.mach_id = @id - if (ingres_errno) return(sms_errcode); - return(SMS_SUCCESS); + if (ingres_errno) return(mr_errcode); + return(MR_SUCCESS); ##} @@ -486,13 +486,13 @@ int setup_dclu(q, argv) id = *(int *)argv[0]; ## repeat retrieve (flag = any(mcmap.mach_id where mcmap.clu_id=@id)) if (flag) - return(SMS_IN_USE); + return(MR_IN_USE); ## repeat retrieve (flag = any(svc.clu_id where svc.clu_id=@id)) if (flag) - return(SMS_IN_USE); + return(MR_IN_USE); if (ingres_errno) - return(sms_errcode); - return(SMS_SUCCESS); + return(mr_errcode); + return(MR_SUCCESS); ##} @@ -519,16 +519,16 @@ char **argv; if (!strcmp(argv[idx], UNIQUE_GID) || atoi(argv[idx]) == -1) { if (atoi(argv[idx - 1])) { if (set_next_object_id("gid", "list")) - return(SMS_INGRES_ERR); + return(MR_INGRES_ERR); ## repeat retrieve (ngid = values.value) where values.name = "gid" - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); sprintf(argv[idx], "%d", ngid); } else { strcpy(argv[idx], "-1"); } } - return(SMS_SUCCESS); + return(MR_SUCCESS); ##} @@ -546,38 +546,38 @@ int setup_dlis(q, argv) ## repeat retrieve (flag = any(imembers.member_id where imembers.member_id=@id ## and imembers.member_type = "LIST")) if (flag) - return(SMS_IN_USE); + return(MR_IN_USE); ## repeat retrieve (flag = any(imembers.member_id where imembers.list_id=@id)) if (flag) - return(SMS_IN_USE); + return(MR_IN_USE); ## repeat retrieve (flag = any(filesys.label where filesys.owners=@id)) if (flag) - return(SMS_IN_USE); + return(MR_IN_USE); ## repeat retrieve (flag = any(capacls.tag where capacls.list_id=@id)) if (flag) - return(SMS_IN_USE); + return(MR_IN_USE); ## repeat retrieve (flag = any(list.name where list.acl_id=@id and ## list.acl_type = "LIST" and list.list_id != @id)) if (flag) - return(SMS_IN_USE); + return(MR_IN_USE); ## repeat retrieve (flag = any(servers.name where servers.acl_id=@id and ## servers.acl_type = "LIST")) if (flag) - return(SMS_IN_USE); + return(MR_IN_USE); ## repeat retrieve (flag=any(hostaccess.acl_id where hostaccess.acl_id=@id and ## hostaccess.acl_type = "LIST")) if (flag) - return(SMS_IN_USE); + return(MR_IN_USE); ## repeat retrieve (flag = any(zephyr.class ## where zephyr.xmt_type = "LIST" and zephyr.xmt_id = @id or ## zephyr.sub_type = "LIST" and zephyr.sub_id = @id or ## zephyr.iws_type = "LIST" and zephyr.iws_id = @id or ## zephyr.iui_type = "LIST" and zephyr.iui_id = @id)) if (flag) - return(SMS_IN_USE); + return(MR_IN_USE); if (ingres_errno) - return(sms_errcode); - return(SMS_SUCCESS); + return(mr_errcode); + return(MR_SUCCESS); ##} @@ -596,13 +596,13 @@ int setup_dsin(q, argv) ## repeat retrieve (flag = any(serverhosts.service ## where serverhosts.service=uppercase(@name))) if (flag) - return(SMS_IN_USE); + return(MR_IN_USE); ## repeat retrieve (flag = servers.inprogress) where servers.#name = @name if (flag) - return(SMS_IN_USE); + return(MR_IN_USE); if (ingres_errno) - return(sms_errcode); - return(SMS_SUCCESS); + return(mr_errcode); + return(MR_SUCCESS); ##} @@ -622,10 +622,10 @@ int setup_dshi(q, argv) ## repeat retrieve (flag=serverhosts.inprogress) ## where serverhosts.service=uppercase(@name) and serverhosts.mach_id=@id if (flag) - return(SMS_IN_USE); + return(MR_IN_USE); if (ingres_errno) - return(sms_errcode); - return(SMS_SUCCESS); + return(mr_errcode); + return(MR_SUCCESS); ##} @@ -650,8 +650,8 @@ int setup_dshi(q, argv) ** filesystem (nfsphys_id for NFS, 0 for RVD) ** ** Errors: - ** SMS_NFS - specified directory not exported - ** SMS_FILESYS_ACCESS - invalid filesys access + ** MR_NFS - specified directory not exported + ** MR_FILESYS_ACCESS - invalid filesys access ** **/ @@ -675,7 +675,7 @@ setup_afil(q, argv) if (!strcmp(type, "NFS")) return (check_nfs(mach_id, name, access)); else - return(SMS_SUCCESS); + return(MR_SUCCESS); } @@ -702,24 +702,24 @@ setup_ufil(q, argv) if (!strcmp(type, "NFS")) { status = check_nfs(mach_id, name, access); ## replace nfsquota (phys_id = var_phys_id) where nfsquota.filsys_id = fid - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); return(status); } else if (!strcmp(type, "AFS")) { total = 0; ## retrieve (total = sum(nfsquota.quota where nfsquota.filsys_id = fid)) - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); if (total != 0) { ## delete nfsquota where nfsquota.filsys_id = fid - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); ## append nfsquota (quota = total, filsys_id = fid, ## phys_id = 0, users_id = 0) - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); } } else { ## replace nfsquota (phys_id = 0) where nfsquota.filsys_id = fid - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); } - return(SMS_SUCCESS); + return(MR_SUCCESS); ##} @@ -742,9 +742,9 @@ setup_ufil(q, argv) caccess = (isupper(*access)) ? tolower(*access) : *access; if (caccess != 'r' && caccess != 'w' && caccess != 'n') - return(SMS_FILESYS_ACCESS); + return(MR_FILESYS_ACCESS); - status = SMS_NFS; + status = MR_NFS; ## range of np is nfsphys ## repeat retrieve (var_phys_id = np.#nfsphys_id, dir = trim(np.#dir)) ## where np.#mach_id = @mach_id sort by #dir:d { @@ -755,12 +755,12 @@ setup_ufil(q, argv) cp2++; } if (*cp2 == 0) { - status = SMS_SUCCESS; + status = MR_SUCCESS; ## endretrieve } ## } if (ingres_errno) - return(sms_errcode); + return(mr_errcode); return(status); ##} @@ -785,8 +785,8 @@ setup_dfil(q, argv, cl) ## repeat delete q where q.filsys_id = @id ## repeat delete fsgroup where fsgroup.filsys_id = @id ## repeat delete fsgroup where fsgroup.group_id = @id - if (ingres_errno) return(sms_errcode); - return(SMS_SUCCESS); + if (ingres_errno) return(mr_errcode); + return(MR_SUCCESS); ##} @@ -804,10 +804,10 @@ setup_dnfp(q, argv, cl) id = *(int *)argv[0]; ## repeat retrieve (exists = any(filesys.label where filesys.phys_id = @id)) if (exists) - return(SMS_IN_USE); + return(MR_IN_USE); if (ingres_errno) - return(sms_errcode); - return(SMS_SUCCESS); + return(mr_errcode); + return(MR_SUCCESS); ##} @@ -831,8 +831,8 @@ setup_dnfq(q, argv, cl) ## q.filsys_id = @fs ## repeat replace nfsphys (allocated = nfsphys.allocated - @quota) ## where nfsphys.nfsphys_id = filesys.#phys_id and filesys.filsys_id = @fs - if (ingres_errno) return(sms_errcode); - return(SMS_SUCCESS); + if (ingres_errno) return(mr_errcode); + return(MR_SUCCESS); ##} @@ -862,8 +862,8 @@ client *cl; ## char *name; name = argv[1]; - if (name_to_id(name, "STRING", &id) != SMS_SUCCESS) { - if (q->type != APPEND) return(SMS_STRING); + if (name_to_id(name, "STRING", &id) != MR_SUCCESS) { + if (q->type != APPEND) return(MR_STRING); ## range of v is values ## retrieve (id = v.value) where v.#name = "strings_id" id++; @@ -871,9 +871,9 @@ client *cl; ## append to strings (string_id = id, string = name) cache_entry(name, "STRING", id); } - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); *(int *)argv[1] = id; - return(SMS_SUCCESS); + return(MR_SUCCESS); ##} @@ -900,7 +900,7 @@ set_modtime(q, argv, cl) ## replace table (modtime = "now", modby = who, modwith = entity) ## where table.#name = name - return(SMS_SUCCESS); + return(MR_SUCCESS); ##} /* generic set_modtime_by_id routine. This takes the table name from @@ -925,7 +925,7 @@ set_modtime_by_id(q, argv, cl) id = *(int *)argv[0]; ## replace table (modtime = "now", modby = who, modwith = entity) ## where table.id_name = id - return(SMS_SUCCESS); + return(MR_SUCCESS); ##} @@ -946,7 +946,7 @@ set_finger_modtime(q, argv, cl) ## repeat replace u (fmodtime = "now", fmodby = @who, fmodwith = @entity) ## where u.#users_id = @users_id - return(SMS_SUCCESS); + return(MR_SUCCESS); ##} @@ -967,7 +967,7 @@ set_pobox_modtime(q, argv, cl) ## repeat replace users (pmodtime = "now", pmodby = @who, pmodwith = @entity) ## where users.#users_id = @users_id - return(SMS_SUCCESS); + return(MR_SUCCESS); ##} @@ -989,7 +989,7 @@ set_uppercase_modtime(q, argv, cl) ## replace table (modtime = "now", modby = who, modwith = entity) ## where table.#name = uppercase(name) - return(SMS_SUCCESS); + return(MR_SUCCESS); ##} @@ -1012,7 +1012,7 @@ set_mach_modtime_by_id(q, argv, cl) id = *(int *)argv[0]; ## repeat replace machine (modtime = "now", modby = @who, modwith = @entity) ## where machine.mach_id = @id - return(SMS_SUCCESS); + return(MR_SUCCESS); ##} @@ -1035,7 +1035,7 @@ set_cluster_modtime_by_id(q, argv, cl) id = *(int *)argv[0]; ## repeat replace cluster (modtime = "now", modby = @who, modwith = @entity) ## where cluster.clu_id = @id - return(SMS_SUCCESS); + return(MR_SUCCESS); ##} @@ -1058,7 +1058,7 @@ set_serverhost_modtime(q, argv, cl) id = *(int *)argv[1]; ## repeat replace sh (modtime = "now", modby = @who, modwith = @entity) ## where sh.service = uppercase(@serv) and sh.mach_id = @id - return(SMS_SUCCESS); + return(MR_SUCCESS); ##} @@ -1081,7 +1081,7 @@ set_nfsphys_modtime(q, argv, cl) dir = argv[1]; ## repeat replace np (modtime = "now", modby = @who, modwith = @entity) ## where np.#dir = @dir and np.mach_id = @id - return(SMS_SUCCESS); + return(MR_SUCCESS); ##} @@ -1106,7 +1106,7 @@ set_filesys_modtime(q, argv, cl) ## repeat replace fs (modtime = "now", modby = @who, modwith = @entity, ## #phys_id = @var_phys_id) where fs.#label = @label - return(SMS_SUCCESS); + return(MR_SUCCESS); ##} @@ -1129,7 +1129,7 @@ set_zephyr_modtime(q, argv, cl) ## repeat replace z (modtime = "now", modby = @who, modwith = @entity) ## where z.#class = @class - return(SMS_SUCCESS); + return(MR_SUCCESS); ##} @@ -1157,7 +1157,7 @@ followup_fix_modby(q, sq, v, action, actarg, cl) status = id_to_name(id, "USER", &argv[i]); else status = id_to_name(-id, "STRING", &argv[i]); - if (status && status != SMS_NO_MATCH) + if (status && status != MR_NO_MATCH) return(status); (*action)(q->vcnt, argv, actarg); for (j = 0; j < q->vcnt; j++) @@ -1165,7 +1165,7 @@ followup_fix_modby(q, sq, v, action, actarg, cl) free(argv); } sq_destroy(sq); - return(SMS_SUCCESS); + return(MR_SUCCESS); } @@ -1208,7 +1208,7 @@ followup_ausr(q, argv, cl) ## potype="NONE", pmodtime="now", pmodby=@who, pmodwith=@entity) ## where u.#login = @login - return(SMS_SUCCESS); + return(MR_SUCCESS); ##} @@ -1235,7 +1235,7 @@ followup_gpob(q, sq, v, action, actarg, cl) /* for each row */ while (sq_get_data(sq, &argv)) { - sms_trim_args(2, argv); + mr_trim_args(2, argv); ptype = argv[1]; p = index(argv[2], ':'); *p++ = 0; @@ -1244,12 +1244,12 @@ followup_gpob(q, sq, v, action, actarg, cl) if (!strcmp(ptype, "POP")) { status = id_to_name(mid, "MACHINE", &argv[2]); - if (status == SMS_NO_MATCH) - return(SMS_MACHINE); + if (status == MR_NO_MATCH) + return(MR_MACHINE); } else if (!strcmp(ptype, "SMTP")) { status = id_to_name(sid, "STRING", &argv[2]); - if (status == SMS_NO_MATCH) - return(SMS_STRING); + if (status == MR_NO_MATCH) + return(MR_STRING); } else /* ptype == "NONE" */ { goto skip; } @@ -1262,7 +1262,7 @@ followup_gpob(q, sq, v, action, actarg, cl) else status = id_to_name(-sid, "STRING", &argv[4]); } - if (status && status != SMS_NO_MATCH) return(status); + if (status && status != MR_NO_MATCH) return(status); (*action)(q->vcnt, argv, actarg); skip: @@ -1274,7 +1274,7 @@ followup_gpob(q, sq, v, action, actarg, cl) } sq_destroy(sq); - return (SMS_SUCCESS); + return (MR_SUCCESS); } @@ -1300,14 +1300,14 @@ followup_glin(q, sq, v, action, actarg, cl) idx = 12; while (sq_get_data(sq, &argv)) { - sms_trim_args(q->vcnt, argv); + mr_trim_args(q->vcnt, argv); id = atoi(argv[i = q->vcnt - 2]); if (id > 0) status = id_to_name(id, "USER", &argv[i]); else status = id_to_name(-id, "STRING", &argv[i]); - if (status && status != SMS_NO_MATCH) + if (status && status != MR_NO_MATCH) return(status); id = atoi(argv[idx]); @@ -1328,7 +1328,7 @@ followup_glin(q, sq, v, action, actarg, cl) free(argv[idx]); argv[idx] = strsave("???"); } - if (status && status != SMS_NO_MATCH) + if (status && status != MR_NO_MATCH) return(status); if (!strcmp(q->shortname, "glin") && atoi(argv[6]) == -1) { @@ -1346,7 +1346,7 @@ followup_glin(q, sq, v, action, actarg, cl) } sq_destroy(sq); - return (SMS_SUCCESS); + return (MR_SUCCESS); } @@ -1390,7 +1390,7 @@ followup_gnfq(q, sq, v, action, actarg, cl) status = id_to_name(id, "USER", &argv[6]); else status = id_to_name(-id, "STRING", &argv[6]); - if (status && status != SMS_NO_MATCH) + if (status && status != MR_NO_MATCH) return(status); (*action)(q->vcnt, argv, actarg); for (j = 0; j < q->vcnt; j++) @@ -1398,7 +1398,7 @@ followup_gnfq(q, sq, v, action, actarg, cl) free(argv); } sq_destroy(sq); - return(SMS_SUCCESS); + return(MR_SUCCESS); ##} @@ -1425,8 +1425,8 @@ followup_anfq(q, argv, cl) ## where nq.filsys_id = @fs and nq.users_id = @user ## repeat replace nfsphys (allocated = nfsphys.allocated + @quota) ## where nfsphys.nfsphys_id = filesys.#phys_id and filesys.filsys_id = @fs - if (ingres_errno) return(sms_errcode); - return(SMS_SUCCESS); + if (ingres_errno) return(mr_errcode); + return(MR_SUCCESS); ##} @@ -1445,14 +1445,14 @@ followup_gzcl(q, sq, v, action, actarg, cl) char **argv; while (sq_get_data(sq, &argv)) { - sms_trim_args(q->vcnt, argv); + mr_trim_args(q->vcnt, argv); id = atoi(argv[i = q->vcnt - 2]); if (id > 0) status = id_to_name(id, "USER", &argv[i]); else status = id_to_name(-id, "STRING", &argv[i]); - if (status && status != SMS_NO_MATCH) + if (status && status != MR_NO_MATCH) return(status); for (i = 1; i < 8; i+=2) { @@ -1472,7 +1472,7 @@ followup_gzcl(q, sq, v, action, actarg, cl) free(argv[i+1]); argv[i+1] = strsave("???"); } - if (status && status != SMS_NO_MATCH) + if (status && status != MR_NO_MATCH) return(status); } @@ -1485,7 +1485,7 @@ followup_gzcl(q, sq, v, action, actarg, cl) free(argv); } sq_destroy(sq); - return(SMS_SUCCESS); + return(MR_SUCCESS); } @@ -1504,14 +1504,14 @@ followup_gsha(q, sq, v, action, actarg, cl) int i, id, status; while (sq_get_data(sq, &argv)) { - sms_trim_args(q->vcnt, argv); + mr_trim_args(q->vcnt, argv); id = atoi(argv[4]); if (id > 0) status = id_to_name(id, "USER", &argv[4]); else status = id_to_name(-id, "STRING", &argv[4]); - if (status && status != SMS_NO_MATCH) + if (status && status != MR_NO_MATCH) return(status); id = atoi(argv[2]); @@ -1530,7 +1530,7 @@ followup_gsha(q, sq, v, action, actarg, cl) free(argv[2]); argv[2] = strsave("???"); } - if (status && status != SMS_NO_MATCH) + if (status && status != MR_NO_MATCH) return(status); /* send the data */ @@ -1542,7 +1542,7 @@ followup_gsha(q, sq, v, action, actarg, cl) free(argv); } sq_destroy(sq); - return(SMS_SUCCESS); + return(MR_SUCCESS); } @@ -1570,14 +1570,14 @@ int set_pobox(q, argv, cl) ## repeat retrieve (id = users.pop_id, potype = users.#potype) ## where users.users_id = @user - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); if (!strcmp(strtrim(potype), "POP")) set_pop_usage(id, -1); if (!strcmp(argv[1], "POP")) { status = name_to_id(box, "MACHINE", &id); - if (status == SMS_NO_MATCH) - return(SMS_MACHINE); + if (status == MR_NO_MATCH) + return(MR_MACHINE); else if (status) return(status); ## repeat replace users (#potype = "POP", pop_id = @id) @@ -1585,9 +1585,9 @@ int set_pobox(q, argv, cl) set_pop_usage(id, 1); } else if (!strcmp(argv[1], "SMTP")) { if (index(box, '/') || index(box, '|')) - return(SMS_BAD_CHAR); + return(MR_BAD_CHAR); status = name_to_id(box, "STRING", &id); - if (status == SMS_NO_MATCH) { + if (status == MR_NO_MATCH) { ## repeat retrieve (id = values.value) where values.name = "strings_id" id++; ## repeat replace values (value = @id) where values.name = "strings_id" @@ -1603,8 +1603,8 @@ int set_pobox(q, argv, cl) set_pobox_modtime(q, argv, cl); ## repeat replace tblstats (updates = tblstats.updates + 1, modtime = "now") ## where tblstats.#table = "users" - if (ingres_errno) return(sms_errcode); - return(SMS_SUCCESS); + if (ingres_errno) return(mr_errcode); + return(MR_SUCCESS); ##} @@ -1637,9 +1637,9 @@ get_list_info(q, aargv, cl, action, actarg) sq_save_data(sq, id); rowcount++; ## } - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); if (rowcount == 0) - return(SMS_NO_MATCH); + return(MR_NO_MATCH); argv[0] = listname; argv[1] = active; argv[2] = public; argv[3] = hidden; argv[4] = maillist; argv[5] = group; argv[6] = gid; argv[7] = acl_type; @@ -1657,7 +1657,7 @@ get_list_info(q, aargv, cl, action, actarg) ## desc = l.#desc, modtime = l.#modtime, modby_id = l.#modby, ## modwith =l.#modwith) ## where l.list_id = @id - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); if (atoi(gid) == -1) argv[6] = UNIQUE_GID; @@ -1678,16 +1678,16 @@ get_list_info(q, aargv, cl, action, actarg) free(argv[8]); argv[8] = strsave("???"); } - if (status && status != SMS_NO_MATCH) return(status); + if (status && status != MR_NO_MATCH) return(status); argv[11] = malloc(0); if (modby_id > 0) status = id_to_name(modby_id, "USER", &argv[11]); else status = id_to_name(-modby_id, "STRING", &argv[11]); - if (status && status != SMS_NO_MATCH) return(status); + if (status && status != MR_NO_MATCH) return(status); - sms_trim_args(q->vcnt, argv); + mr_trim_args(q->vcnt, argv); returned++; (*action)(q->vcnt, argv, actarg); free(argv[8]); @@ -1695,8 +1695,8 @@ get_list_info(q, aargv, cl, action, actarg) } sq_destroy(sq); - if (ingres_errno) return(sms_errcode); - return (SMS_SUCCESS); + if (ingres_errno) return(mr_errcode); + return (MR_SUCCESS); ##} @@ -1728,14 +1728,14 @@ int add_member_to_list(q, argv, cl) ## m.member_id = @mid and m.member_type = @mtype ## and m.direct = 1)) if (exists) - return(SMS_EXISTS); + return(MR_EXISTS); if (!strcasecmp(mtype, "STRING")) { buf = malloc(0); status = id_to_name(mid, "STRING", &buf); if (status) return(status); if (index(buf, '/') || index(buf, '|')) { free(buf); - return(SMS_BAD_CHAR); + return(MR_BAD_CHAR); } free(buf); } @@ -1751,9 +1751,9 @@ int add_member_to_list(q, argv, cl) ## endretrieve } ## } - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); if (acount >= MAXLISTDEPTH) { - return(SMS_INTERNAL); + return(MR_INTERNAL); } descendants[0] = mid; dtypes[0] = mtype; @@ -1788,9 +1788,9 @@ int add_member_to_list(q, argv, cl) ## endretrieve } ## } - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); if (error) - return(SMS_INTERNAL); + return(MR_INTERNAL); } for (a = 0; a < acount; a++) { lid = ancestors[a]; @@ -1798,7 +1798,7 @@ int add_member_to_list(q, argv, cl) mid = descendants[d]; mtype = dtypes[d]; if (mid == lid && !strcmp(mtype, "LIST")) { - return(SMS_LISTLOOP); + return(MR_LISTLOOP); } ## repeat retrieve (exists = any(m.ref_count where m.list_id = @lid ## and m.member_id = @mid @@ -1833,8 +1833,8 @@ int add_member_to_list(q, argv, cl) who = cl->client_id; ## repeat replace list (modtime = "now", modby = @who, modwith = @entity) ## where list.#list_id = @lid - if (ingres_errno) return(sms_errcode); - return(SMS_SUCCESS); + if (ingres_errno) return(mr_errcode); + return(MR_SUCCESS); ##} @@ -1861,9 +1861,9 @@ int delete_member_from_list(q, argv, cl) ## repeat retrieve (exists = any(m.list_id where m.list_id=@lid and ## m.member_id = @mid and m.member_type = @mtype ## and m.direct = 1)) - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); if (!exists) - return(SMS_NO_MATCH); + return(MR_NO_MATCH); ancestors[0] = lid; aref[0] = 1; acount = 1; @@ -1874,9 +1874,9 @@ int delete_member_from_list(q, argv, cl) if (acount >= MAXLISTDEPTH) ## endretrieve ## } - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); if (acount >= MAXLISTDEPTH) - return(SMS_INTERNAL); + return(MR_INTERNAL); descendants[0] = mid; dtypes[0] = mtype; dref[0] = 1; @@ -1908,9 +1908,9 @@ int delete_member_from_list(q, argv, cl) if (dcount >= MAXLISTDEPTH) ## endretrieve ## } - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); if (error) - return(SMS_INTERNAL); + return(MR_INTERNAL); } for (a = 0; a < acount; a++) { lid = ancestors[a]; @@ -1918,7 +1918,7 @@ int delete_member_from_list(q, argv, cl) mid = descendants[d]; mtype = dtypes[d]; if (mid == lid && !strcmp(mtype, "LIST")) { - return(SMS_LISTLOOP); + return(MR_LISTLOOP); } ## repeat retrieve (cnt = m.ref_count) ## where m.list_id = @lid and m.member_id = @mid @@ -1948,8 +1948,8 @@ int delete_member_from_list(q, argv, cl) who = cl->client_id; ## repeat replace list (modtime = "now", modby = @who, modwith = @entity) ## where list.#list_id = @lid - if (ingres_errno) return(sms_errcode); - return(SMS_SUCCESS); + if (ingres_errno) return(mr_errcode); + return(MR_SUCCESS); ##} @@ -1991,7 +1991,7 @@ int get_ace_use(q, argv, cl, action, actarg) ## } /* now process each one */ while (sq_get_data(sq, &id)) { - if (get_ace_internal("LIST", id, action, actarg) == SMS_SUCCESS) + if (get_ace_internal("LIST", id, action, actarg) == MR_SUCCESS) found++; } } @@ -2003,10 +2003,10 @@ int get_ace_use(q, argv, cl, action, actarg) ## } /* now process each one */ while (sq_get_data(sq, &id)) { - if (get_ace_internal("LIST", id, action, actarg) == SMS_SUCCESS) + if (get_ace_internal("LIST", id, action, actarg) == MR_SUCCESS) found++; } - if (get_ace_internal("USER", aid, action, actarg) == SMS_SUCCESS) + if (get_ace_internal("USER", aid, action, actarg) == MR_SUCCESS) found++; } @@ -2017,17 +2017,17 @@ int get_ace_use(q, argv, cl, action, actarg) ## } /* now process each one */ while (sq_get_data(sq, &id)) { - if (get_ace_internal("LIST", id, action, actarg) == SMS_SUCCESS) + if (get_ace_internal("LIST", id, action, actarg) == MR_SUCCESS) found++; } - if (get_ace_internal("KERBEROS", aid, action, actarg) == SMS_SUCCESS) + if (get_ace_internal("KERBEROS", aid, action, actarg) == MR_SUCCESS) found++; } sq_destroy(sq); - if (ingres_errno) return(sms_errcode); - if (!found) return(SMS_NO_MATCH); - return(SMS_SUCCESS); + if (ingres_errno) return(mr_errcode); + if (!found) return(MR_NO_MATCH); + return(MR_SUCCESS); ##} @@ -2101,8 +2101,8 @@ int get_ace_use(q, argv, cl, action, actarg) found++; ## } - if (!found) return(SMS_NO_MATCH); - return(SMS_SUCCESS); + if (!found) return(MR_NO_MATCH); + return(MR_SUCCESS); ##} @@ -2173,9 +2173,9 @@ int get_lists_of_member(q, argv, cl, action, actarg) ## } } - if (ingres_errno) return(sms_errcode); - if (!found) return(SMS_NO_MATCH); - return(SMS_SUCCESS); + if (ingres_errno) return(mr_errcode); + if (!found) return(MR_NO_MATCH); + return(MR_SUCCESS); ##} @@ -2258,12 +2258,12 @@ get_members_of_list(q, argv, cl, action, actarg) break; default: sq_destroy(sq); - return(SMS_INTERNAL); + return(MR_INTERNAL); } } free(targv[1]); sq_destroy(sq); - return(SMS_SUCCESS); + return(MR_SUCCESS); } sq_destroy(sq); @@ -2277,7 +2277,7 @@ get_members_of_list(q, argv, cl, action, actarg) ## { (*action)(2, targv, actarg); ## } - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); targv[0] = "LIST"; ## repeat retrieve (member_name = list.name) @@ -2287,7 +2287,7 @@ get_members_of_list(q, argv, cl, action, actarg) ## { (*action)(2, targv, actarg); ## } - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); targv[0] = "STRING"; ## repeat retrieve (member_name = strings.string) @@ -2297,7 +2297,7 @@ get_members_of_list(q, argv, cl, action, actarg) ## { (*action)(2, targv, actarg); ## } - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); targv[0] = "KERBEROS"; ## repeat retrieve (member_name = strings.string) @@ -2307,9 +2307,9 @@ get_members_of_list(q, argv, cl, action, actarg) ## { (*action)(2, targv, actarg); ## } - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); - return(SMS_SUCCESS); + return(MR_SUCCESS); ##} @@ -2332,10 +2332,10 @@ int count_members_of_list(q, argv, cl, action, actarg) ## repeat retrieve (ct = count(imembers.list_id ## where imembers.list_id = @list and ## imembers.direct = 1)) - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); sprintf(countbuf, "%d", ct); (*action)(1, rargv, actarg); - return(SMS_SUCCESS); + return(MR_SUCCESS); ##} @@ -2401,11 +2401,11 @@ int qualified_get(q, argv, action, actarg, start, range, field, flags) ## retrieve (name = rvar.rfield) where qual { (*action)(1, rargv, actarg); ## } - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); ## inquire_equel(rowcount = "rowcount") if (rowcount == 0) - return(SMS_NO_MATCH); - return(SMS_SUCCESS); + return(MR_NO_MATCH); + return(MR_SUCCESS); ##} @@ -2447,19 +2447,19 @@ int qualified_get_serverhost(q, argv, cl, action, actarg) ## retrieve (sname = sh.service, mname = machine.name) where qual { (*action)(2, rargv, actarg); ## } - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); ## inquire_equel(rowcount = "rowcount") if (rowcount == 0) - return(SMS_NO_MATCH); - return(SMS_SUCCESS); + return(MR_NO_MATCH); + return(MR_SUCCESS); ##} /* register_user - change user's login name and allocate a pobox, group, * filesystem, and quota for them. The user's status must start out as 0, * and is left as 2. Arguments are: user's UID, new login name, and user's - * type for filesystem allocation (SMS_FS_STUDENT, SMS_FS_FACULTY, - * SMS_FS_STAFF, SMS_FS_MISC). + * type for filesystem allocation (MR_FS_STUDENT, MR_FS_FACULTY, + * MR_FS_STAFF, MR_FS_MISC). */ register_user(q, argv, cl) @@ -2491,31 +2491,31 @@ register_user(q, argv, cl) ## where u.#uid = @uid and (u.status = 0 or u.status = 5) ## inquire_equel(rowcount = "rowcount"); if (rowcount == 0) - return(SMS_NO_MATCH); + return(MR_NO_MATCH); if (rowcount > 1) - return(SMS_NOT_UNIQUE); + return(MR_NOT_UNIQUE); /* check new login name */ ## repeat retrieve (flag = any(u.#login where u.#login = @login and ## u.#users_id != users_id)) - if (ingres_errno) return(sms_errcode); - if (flag) return(SMS_IN_USE); + if (ingres_errno) return(mr_errcode); + if (flag) return(MR_IN_USE); ## repeat retrieve (flag = any(l.#name where l.#name = @login)) - if (ingres_errno) return(sms_errcode); - if (flag) return(SMS_IN_USE); + if (ingres_errno) return(mr_errcode); + if (flag) return(MR_IN_USE); ## repeat retrieve (flag = any(filesys.#label where filesys.#label = @login)) - if (ingres_errno) return(sms_errcode); - if (flag) return(SMS_IN_USE); + if (ingres_errno) return(mr_errcode); + if (flag) return(MR_IN_USE); com_err(whoami, 0, "new login name OK"); /* choose place for pobox, put in mid */ ## repeat retrieve (mid = sh.mach_id, machname = m.name) ## where sh.service = "POP" and m.mach_id = sh.mach_id and ## sh.value2 - sh.value1 = max(sh.value2-sh.value1 where sh.service="POP") - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); ## inquire_equel(rowcount = "rowcount"); if (rowcount == 0) - return(SMS_NO_POBOX); + return(MR_NO_POBOX); /* change login name, set pobox */ sprintf(buffer, "u.users_id = %d", users_id); @@ -2526,9 +2526,9 @@ register_user(q, argv, cl) ## pmodwith=@entity) ## where u.#users_id = @users_id ## inquire_equel(rowcount = "rowcount"); - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); if (rowcount != 1) - return(SMS_INTERNAL); + return(MR_INTERNAL); set_pop_usage(mid, 1); com_err(whoami, 0, "set login name to %s and pobox to %s", login, strtrim(machname)); @@ -2536,14 +2536,14 @@ register_user(q, argv, cl) /* create group list */ if (set_next_object_id("gid", "list")) - return(SMS_NO_ID); + return(MR_NO_ID); if (set_next_object_id("list_id", "list")) - return(SMS_NO_ID); + return(MR_NO_ID); ## repeat retrieve (list_id = values.value) where values.name = "list_id" - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); ## inquire_equel(rowcount = "rowcount"); if (rowcount != 1) - return(SMS_INTERNAL); + return(MR_INTERNAL); incremental_clear_before(); ## repeat append list (name = @login, #list_id = @list_id, active = 1, ## public = 0, hidden = 0, maillist = 0, group = 1, @@ -2551,10 +2551,10 @@ register_user(q, argv, cl) ## acl_type = "USER", acl_id = @users_id, modtime = "now", ## modby = @who, modwith = @entity) ## where values.name = "gid" - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); ## inquire_equel(rowcount = "rowcount"); if (rowcount != 1) - return(SMS_INTERNAL); + return(MR_INTERNAL); sprintf(buffer, "l.list_id = %d", list_id); incremental_after("list", buffer, 0); aargv[0] = (char *) list_id; @@ -2563,10 +2563,10 @@ register_user(q, argv, cl) incremental_clear_before(); ## repeat append imembers (#list_id = @list_id, member_type = "USER", ## member_id = @users_id, ref_count = 1, direct = 1) - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); ## inquire_equel(rowcount = "rowcount"); if (rowcount != 1) - return(SMS_INTERNAL); + return(MR_INTERNAL); incremental_after("members", 0, aargv); com_err(whoami, 0, "group list created"); @@ -2584,13 +2584,13 @@ register_user(q, argv, cl) m_id = mid; } ## } - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); if (maxsize == 0) - return(SMS_NO_FILESYS); + return(MR_NO_FILESYS); /* create filesystem */ if (set_next_object_id("filsys_id", "filesys")) - return(SMS_NO_ID); + return(MR_NO_ID); incremental_clear_before(); ## repeat append filesys (filsys_id = values.value, phys_id = @pid, ## label = @login, type = "NFS", mach_id = @m_id, @@ -2601,10 +2601,10 @@ register_user(q, argv, cl) ## lockertype = "HOMEDIR", modtime = "now", ## modby = @who, modwith = @entity) ## where values.name = "filsys_id" - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); ## inquire_equel(rowcount = "rowcount"); if (rowcount != 1) - return(SMS_INTERNAL); + return(MR_INTERNAL); incremental_after("filesys", "fs.filsys_id = values.value and values.name = \"filsys_id\"", 0); @@ -2613,32 +2613,32 @@ register_user(q, argv, cl) /* set quota */ ## repeat retrieve (quota = values.value) where values.name = "def_quota" - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); ## inquire_equel(rowcount = "rowcount"); if (rowcount != 1) - return(SMS_NO_QUOTA); + return(MR_NO_QUOTA); incremental_clear_before(); ## repeat append nfsquota (#users_id = @users_id, filsys_id = values.value, ## #quota = @quota, phys_id = @pid, modtime = "now", ## modby = @who, modwith = @entity) ## where values.name = "filsys_id" - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); ## inquire_equel(rowcount = "rowcount"); if (rowcount != 1) - return(SMS_INTERNAL); + return(MR_INTERNAL); ## repeat replace nfsphys (allocated = nfsphys.allocated + @quota) ## where nfsphys.nfsphys_id = filesys.#phys_id and ## filesys.filsys_id = values.value and values.name = "filsys_id" - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); ## inquire_equel(rowcount = "rowcount"); if (rowcount != 1) - return(SMS_INTERNAL); + return(MR_INTERNAL); aargv[0] = login; aargv[1] = login; sprintf(buffer, "nq.users_id = %d and nq.filsys_id = values.value and values.name = \"filsys_id\"", users_id); incremental_after("nfsquota", buffer, aargv); com_err(whoami, 0, "quota of %d assigned", quota); - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); cache_entry(login, "USER", users_id); @@ -2647,8 +2647,8 @@ register_user(q, argv, cl) ## repeat replace tblstats (appends = tblstats.appends + 1, modtime = "now") ## where tblstats.table = "list" or tblstats.table = "filesys" or ## tblstats.table = "nfsquota" - if (ingres_errno) return(sms_errcode); - return(SMS_SUCCESS); + if (ingres_errno) return(mr_errcode); + return(MR_SUCCESS); ##} @@ -2674,8 +2674,8 @@ int count; ## repeat replace serverhosts (value1 = serverhosts.value1 + @n) ## where serverhosts.service = "POP" and serverhosts.#mach_id = @mach_id - if (ingres_errno) return(sms_errcode); - return(SMS_SUCCESS); + if (ingres_errno) return(mr_errcode); + return(MR_SUCCESS); ##} @@ -2708,10 +2708,10 @@ validate_row(q, argv, v) /* look for the record */ ## range of rvar is table ## retrieve (rowcount = count(rvar.name where qual)) - if (ingres_errno) return(sms_errcode); - if (rowcount == 0) return(SMS_NO_MATCH); - if (rowcount > 1) return(SMS_NOT_UNIQUE); - return(SMS_EXISTS); + if (ingres_errno) return(mr_errcode); + if (rowcount == 0) return(MR_NO_MATCH); + if (rowcount > 1) return(MR_NOT_UNIQUE); + return(MR_EXISTS); ##} validate_fields(q, argv, vo, n) @@ -2772,7 +2772,7 @@ validate_fields(q, argv, vo, n) break; case V_SORT: - status = SMS_EXISTS; + status = MR_EXISTS; break; case V_LOCK: @@ -2780,12 +2780,12 @@ validate_fields(q, argv, vo, n) break; } - if (status != SMS_EXISTS) return(status); + if (status != MR_EXISTS) return(status); vo++; } - if (ingres_errno) return(sms_errcode); - return(SMS_SUCCESS); + if (ingres_errno) return(mr_errcode); + return(MR_SUCCESS); } @@ -2817,8 +2817,8 @@ register char *s; { while (*s) if (illegalchars[*s++]) - return(SMS_BAD_CHAR); - return(SMS_EXISTS); + return(MR_BAD_CHAR); + return(MR_EXISTS); } @@ -2851,8 +2851,8 @@ validate_id(argv, vo) status = name_to_id(name, table, &id); if (status == 0) { *(int *)argv[vo->index] = id; - return(SMS_EXISTS); - } else if (status == SMS_NO_MATCH || status == SMS_NOT_UNIQUE) + return(MR_EXISTS); + } else if (status == MR_NO_MATCH || status == MR_NOT_UNIQUE) return(vo->error); else return(status); @@ -2860,16 +2860,16 @@ validate_id(argv, vo) if (!strcmp(namefield, "uid")) { ## retrieve (id = table.idfield) where table.namefield = int4(name) - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); ## inquire_equel (rowcount = "rowcount") } else { ## retrieve (id = table.idfield) where table.namefield = name - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); ## inquire_equel (rowcount = "rowcount") } if (rowcount != 1) return(vo->error); *(int *)argv[vo->index] = id; - return(SMS_EXISTS); + return(MR_EXISTS); ##} validate_name(argv, vo) @@ -2892,8 +2892,8 @@ validate_name(argv, vo) } ## retrieve (rowcount = countu(table.namefield ## where table.namefield = name)) - if (ingres_errno) return(sms_errcode); - return ((rowcount == 1) ? SMS_EXISTS : vo->error); + if (ingres_errno) return(mr_errcode); + return ((rowcount == 1) ? MR_EXISTS : vo->error); ##} validate_date(argv, vo) @@ -2908,8 +2908,8 @@ validate_date(argv, vo) ## retrieve (dd = interval("years", date(idate) - date("today"))) ## inquire_equel (errorno = "errorno") - if (errorno != 0 || dd > 5.0) return(SMS_DATE); - return(SMS_EXISTS); + if (errorno != 0 || dd > 5.0) return(MR_DATE); + return(MR_EXISTS); ##} @@ -2925,7 +2925,7 @@ struct valobj *vo; c = name = argv[vo->index]; while (*c) if (illegalchars[*c++]) - return(SMS_BAD_CHAR); + return(MR_BAD_CHAR); table = vo->table; /* minor kludge to upcasify machine names */ if (!strcmp(table, "machine")) @@ -2935,17 +2935,17 @@ struct valobj *vo; id = -1; if (idfield == 0) { if (!strcmp(argv[vo->index], argv[vo->index - 1])) - return(SMS_EXISTS); + return(MR_EXISTS); ## retrieve (id = any(table.namefield where table.namefield = name)) - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); if (id) return(vo->error); else - return(SMS_EXISTS); + return(MR_EXISTS); } status = name_to_id(name, table, &id); - if (status == SMS_NO_MATCH || id == *(int *)argv[vo->index - 1]) - return(SMS_EXISTS); + if (status == MR_NO_MATCH || id == *(int *)argv[vo->index - 1]) + return(MR_EXISTS); else return(vo->error); ##} @@ -2964,15 +2964,15 @@ validate_type(argv, vo) c = value = argv[vo->index]; while (*c) if (illegalchars[*c++]) - return(SMS_BAD_CHAR); + return(MR_BAD_CHAR); /* uppercase type fields */ for (c = value; *c; c++) if (islower(*c)) *c = toupper(*c); ## repeat retrieve (exists = any(alias.trans where alias.name = @typename and ## alias.type = "TYPE" and alias.trans = @value)) - if (ingres_errno) return(sms_errcode); - return (exists ? SMS_EXISTS : vo->error); + if (ingres_errno) return(mr_errcode); + return (exists ? MR_EXISTS : vo->error); ##} /* validate member or type-specific data field */ @@ -2999,9 +2999,9 @@ validate_typedata(q, argv, vo) /* get corresponding data type associated with field type name */ ## repeat retrieve (data_type = alias.trans) ## where alias.#name = @field_type and alias.type = "TYPEDATA" - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); ## inquire_equel (rowcount = "rowcount") - if (rowcount != 1) return(SMS_TYPE); + if (rowcount != 1) return(MR_TYPE); /* now retrieve the record id corresponding to the named object */ if (index(data_type, ' ')) @@ -3009,15 +3009,15 @@ validate_typedata(q, argv, vo) if (!strcmp(data_type, "user")) { /* USER */ status = name_to_id(name, data_type, &id); - if (status && (status == SMS_NO_MATCH || status == SMS_NOT_UNIQUE)) - return(SMS_USER); + if (status && (status == MR_NO_MATCH || status == MR_NOT_UNIQUE)) + return(MR_USER); if (status) return(status); } else if (!strcmp(data_type, "list")) { /* LIST */ status = name_to_id(name, data_type, &id); - if (status && status == SMS_NOT_UNIQUE) - return(SMS_LIST); - if (status == SMS_NO_MATCH) { + if (status && status == MR_NOT_UNIQUE) + return(MR_LIST); + if (status == MR_NO_MATCH) { /* if idfield is non-zero, then if argv[0] matches the string * that we're trying to resolve, we should get the value of * values.[idfield] for the id. @@ -3027,24 +3027,24 @@ validate_typedata(q, argv, vo) name = vo->idfield; ## repeat retrieve (id = values.value) where values.#name = @name ## inquire_equel(rowcount = "rowcount") - if (rowcount != 1) return(SMS_LIST); + if (rowcount != 1) return(MR_LIST); } else - return(SMS_LIST); + return(MR_LIST); } else if (status) return(status); } else if (!strcmp(data_type, "machine")) { /* MACHINE */ for (c = name; *c; c++) if (islower(*c)) *c = toupper(*c); status = name_to_id(name, data_type, &id); - if (status && (status == SMS_NO_MATCH || status == SMS_NOT_UNIQUE)) - return(SMS_MACHINE); + if (status && (status == MR_NO_MATCH || status == MR_NOT_UNIQUE)) + return(MR_MACHINE); if (status) return(status); } else if (!strcmp(data_type, "string")) { /* STRING */ status = name_to_id(name, data_type, &id); - if (status && status == SMS_NOT_UNIQUE) - return(SMS_STRING); - if (status == SMS_NO_MATCH) { - if (q->type != APPEND && q->type != UPDATE) return(SMS_STRING); + if (status && status == MR_NOT_UNIQUE) + return(MR_STRING); + if (status == MR_NO_MATCH) { + if (q->type != APPEND && q->type != UPDATE) return(MR_STRING); ## retrieve (id = values.value) where values.#name = "strings_id" id++; ## replace values (value = id) where values.#name = "strings_id" @@ -3053,13 +3053,13 @@ validate_typedata(q, argv, vo) } else if (!strcmp(data_type, "none")) { id = 0; } else { - return(SMS_TYPE); + return(MR_TYPE); } /* now set value in argv */ *(int *)argv[vo->index] = id; - return (SMS_EXISTS); + return (MR_EXISTS); ##} @@ -3074,12 +3074,12 @@ struct valobj *vo; table = vo->table; idfield = vo->idfield; ## replace table (modtime = "now") where table.idfield = 0 - if (ingres_errno) return(sms_errcode); + if (ingres_errno) return(mr_errcode); ## inquire_equel (rowcount = "rowcount") if (rowcount != 1) return(vo->error); else - return(SMS_EXISTS); + return(MR_EXISTS); ##} diff --git a/server/queries2.c b/server/queries2.c index f1fd341f..b65aef24 100644 --- a/server/queries2.c +++ b/server/queries2.c @@ -9,7 +9,7 @@ #include #include "query.h" -#include "sms_et.h" +#include "mr_et.h" /* Specialized Support Query Routines */ @@ -132,32 +132,32 @@ static struct valobj VOsort0[] = { }; static struct valobj VOdate1[] = { - {V_DATE, 1, 0, 0, 0, SMS_DATE}, + {V_DATE, 1, 0, 0, 0, MR_DATE}, }; static struct valobj VOuser0[] = { - {V_ID, 0, USERS, LOGIN, USERS_ID, SMS_USER}, + {V_ID, 0, USERS, LOGIN, USERS_ID, MR_USER}, }; static struct valobj VOuser0lock[] = { - {V_LOCK, 0, USERS, 0, USERS_ID, SMS_DEADLOCK}, - {V_ID, 0, USERS, LOGIN, USERS_ID, SMS_USER}, + {V_LOCK, 0, USERS, 0, USERS_ID, MR_DEADLOCK}, + {V_ID, 0, USERS, LOGIN, USERS_ID, MR_USER}, }; static struct valobj VOmach0[] = { - {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE}, + {V_ID, 0, MACHINE, NAME, MACH_ID, MR_MACHINE}, }; static struct valobj VOclu0[] = { - {V_ID, 0, CLUSTER, NAME, CLU_ID, SMS_CLUSTER}, + {V_ID, 0, CLUSTER, NAME, CLU_ID, MR_CLUSTER}, }; static struct valobj VOlist0[] = { - {V_ID, 0, LIST, NAME, LIST_ID, SMS_LIST}, + {V_ID, 0, LIST, NAME, LIST_ID, MR_LIST}, }; static struct valobj VOfilsys0[] = { - {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS}, + {V_ID, 0, FILESYS, LABEL, FILSYS_ID, MR_FILESYS}, }; static struct valobj VOchar0[] = { @@ -170,14 +170,14 @@ static struct valobj VOsort01[] = { }; static struct valobj VOuser0sort[] = { - {V_ID, 0, USERS, LOGIN, USERS_ID, SMS_USER}, + {V_ID, 0, USERS, LOGIN, USERS_ID, MR_USER}, {V_SORT, 0}, }; static struct valobj VOfilsys0user1[] = { - {V_LOCK, 0, FILESYS, 0, FILSYS_ID, SMS_DEADLOCK}, - {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS}, - {V_ID, 1, USERS, LOGIN, USERS_ID, SMS_USER}, + {V_LOCK, 0, FILESYS, 0, FILSYS_ID, MR_DEADLOCK}, + {V_ID, 0, FILESYS, LABEL, FILSYS_ID, MR_FILESYS}, + {V_ID, 1, USERS, LOGIN, USERS_ID, MR_USER}, }; @@ -257,13 +257,13 @@ static char *ausr_fields[] = { }; static struct valobj ausr_valobj[] = { - {V_LOCK, 0, USERS, 0, USERS_ID, SMS_DEADLOCK}, + {V_LOCK, 0, USERS, 0, USERS_ID, MR_DEADLOCK}, {V_CHAR, 0}, {V_CHAR, 3}, {V_CHAR, 4}, {V_CHAR, 5}, {V_CHAR, 7}, - {V_TYPE, 8, CLASS, 0, 0, SMS_BAD_CLASS}, + {V_TYPE, 8, CLASS, 0, 0, MR_BAD_CLASS}, }; static struct validate ausr_validate = { @@ -283,10 +283,10 @@ static char *rusr_fields[] = { }; static struct valobj rusr_valobj[] = { - {V_LOCK, 0, USERS, 0, USERS_ID, SMS_DEADLOCK}, - {V_LOCK, 0, LIST, 0, LIST_ID, SMS_DEADLOCK}, - {V_LOCK, 0, FILESYS, 0, FILSYS_ID, SMS_DEADLOCK}, - {V_LOCK, 0, "nfsphys", 0, "nfsphys_id", SMS_DEADLOCK}, + {V_LOCK, 0, USERS, 0, USERS_ID, MR_DEADLOCK}, + {V_LOCK, 0, LIST, 0, LIST_ID, MR_DEADLOCK}, + {V_LOCK, 0, FILESYS, 0, FILSYS_ID, MR_DEADLOCK}, + {V_LOCK, 0, "nfsphys", 0, "nfsphys_id", MR_DEADLOCK}, }; static struct validate rusr_validate = { @@ -308,14 +308,14 @@ static char *uusr_fields[] = { }; static struct valobj uusr_valobj[] = { - {V_LOCK, 0, USERS, 0, USERS_ID, SMS_DEADLOCK}, - {V_ID, 0, USERS, LOGIN, USERS_ID, SMS_USER}, - {V_RENAME, 1, USERS, LOGIN, USERS_ID, SMS_NOT_UNIQUE}, + {V_LOCK, 0, USERS, 0, USERS_ID, MR_DEADLOCK}, + {V_ID, 0, USERS, LOGIN, USERS_ID, MR_USER}, + {V_RENAME, 1, USERS, LOGIN, USERS_ID, MR_NOT_UNIQUE}, {V_CHAR, 4}, {V_CHAR, 5}, {V_CHAR, 6}, {V_CHAR, 8}, - {V_TYPE, 9, CLASS, 0, 0, SMS_BAD_CLASS}, + {V_TYPE, 9, CLASS, 0, 0, MR_BAD_CLASS}, }; static struct validate uusr_validate = { @@ -385,8 +385,8 @@ static char *dubu_fields[] = { }; static struct valobj dubu_valobj[] = { - {V_LOCK, 0, USERS, 0, USERS_ID, SMS_DEADLOCK}, - {V_ID, 0, USERS, UID, USERS_ID, SMS_USER} + {V_LOCK, 0, USERS, 0, USERS_ID, MR_DEADLOCK}, + {V_ID, 0, USERS, UID, USERS_ID, MR_USER} }; static struct validate dubu_validate = { @@ -408,8 +408,8 @@ static char *akum_fields[] = { LOGIN, "kerberos" }; static struct valobj akum_valobj[] = { - {V_ID, 0, USERS, LOGIN, USERS_ID, SMS_USER}, - {V_ID, 1, "strings", "string", "string_id", SMS_NO_MATCH}, + {V_ID, 0, USERS, LOGIN, USERS_ID, MR_USER}, + {V_ID, 1, "strings", "string", "string_id", MR_NO_MATCH}, }; static struct validate akum_validate = @@ -514,9 +514,9 @@ static char *spob_fields[] = { }; static struct valobj spob_valobj[] = { - {V_LOCK, 0, USERS, 0, USERS_ID, SMS_DEADLOCK}, - {V_ID, 0, USERS, LOGIN, USERS_ID, SMS_USER}, - {V_TYPE, 1, "pobox", 0, 0, SMS_TYPE}, + {V_LOCK, 0, USERS, 0, USERS_ID, MR_DEADLOCK}, + {V_ID, 0, USERS, LOGIN, USERS_ID, MR_USER}, + {V_TYPE, 1, "pobox", 0, 0, MR_TYPE}, }; static struct validate spob_validate = /* SET_POBOX */ @@ -569,8 +569,8 @@ static char *amac_fields[] = { static struct valobj amac_valobj[] = { {V_CHAR, 0}, - {V_LOCK, 0, MACHINE, 0, MACH_ID, SMS_DEADLOCK}, - {V_TYPE, 1, "mac_type", 0, 0, SMS_TYPE}, + {V_LOCK, 0, MACHINE, 0, MACH_ID, MR_DEADLOCK}, + {V_TYPE, 1, "mac_type", 0, 0, MR_TYPE}, }; static struct validate amac_validate = { @@ -591,10 +591,10 @@ static char *umac_fields[] = { }; static struct valobj umac_valobj[] = { - {V_LOCK, 0, MACHINE, 0, MACH_ID, SMS_DEADLOCK}, - {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE}, - {V_RENAME, 1, MACHINE, NAME, MACH_ID, SMS_NOT_UNIQUE}, - {V_TYPE, 2, "mac_type", 0, 0, SMS_TYPE}, + {V_LOCK, 0, MACHINE, 0, MACH_ID, MR_DEADLOCK}, + {V_ID, 0, MACHINE, NAME, MACH_ID, MR_MACHINE}, + {V_RENAME, 1, MACHINE, NAME, MACH_ID, MR_NOT_UNIQUE}, + {V_TYPE, 2, "mac_type", 0, 0, MR_TYPE}, }; static struct validate umac_validate = { @@ -614,8 +614,8 @@ static char *dmac_fields[] = { }; static struct valobj dmac_valobj[] = { - {V_LOCK, 0, MACHINE, 0, MACH_ID, SMS_DEADLOCK}, - {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE}, + {V_LOCK, 0, MACHINE, 0, MACH_ID, MR_DEADLOCK}, + {V_ID, 0, MACHINE, NAME, MACH_ID, MR_MACHINE}, }; static struct validate dmac_validate = { @@ -640,7 +640,7 @@ static char *aclu_fields[] = { }; static struct valobj aclu_valobj[] = { - {V_LOCK, 0, CLUSTER, 0, CLU_ID, SMS_DEADLOCK}, + {V_LOCK, 0, CLUSTER, 0, CLU_ID, MR_DEADLOCK}, {V_CHAR, 0} }; @@ -663,9 +663,9 @@ static char *uclu_fields[] = { }; static struct valobj uclu_valobj[] = { - {V_LOCK, 0, CLUSTER, 0, CLU_ID, SMS_DEADLOCK}, - {V_ID, 0, CLUSTER, NAME, CLU_ID, SMS_CLUSTER}, - {V_RENAME, 1, CLUSTER, NAME, CLU_ID, SMS_NOT_UNIQUE}, + {V_LOCK, 0, CLUSTER, 0, CLU_ID, MR_DEADLOCK}, + {V_ID, 0, CLUSTER, NAME, CLU_ID, MR_CLUSTER}, + {V_RENAME, 1, CLUSTER, NAME, CLU_ID, MR_NOT_UNIQUE}, }; static struct validate uclu_validate = { @@ -703,8 +703,8 @@ static char *gmcm_fields[] = { static struct valobj amtc_valobj[] = /* ADD_MACHINE_TO_CLUSTER */ { /* DELETE_MACHINE_FROM_CLUSTER */ - {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE}, - {V_ID, 1, CLUSTER, NAME, CLU_ID, SMS_CLUSTER}, + {V_ID, 0, MACHINE, NAME, MACH_ID, MR_MACHINE}, + {V_ID, 1, CLUSTER, NAME, CLU_ID, MR_CLUSTER}, }; static struct validate amtc_validate = /* for amtc and dmfc */ @@ -731,7 +731,7 @@ static char *acld_fields[] = { static struct valobj acld_valobj[] = { - {V_ID, 0, CLUSTER, NAME, CLU_ID, SMS_CLUSTER}, + {V_ID, 0, CLUSTER, NAME, CLU_ID, MR_CLUSTER}, {V_CHAR, 2}, }; @@ -774,9 +774,9 @@ static char *qgsv_fields[] = { }; static struct valobj qgsv_valobj[] = { - {V_TYPE, 0, "boolean", 0, 0, SMS_TYPE}, - {V_TYPE, 1, "boolean", 0, 0, SMS_TYPE}, - {V_TYPE, 2, "boolean", 0, 0, SMS_TYPE}, + {V_TYPE, 0, "boolean", 0, 0, MR_TYPE}, + {V_TYPE, 1, "boolean", 0, 0, MR_TYPE}, + {V_TYPE, 2, "boolean", 0, 0, MR_TYPE}, }; static struct validate qgsv_validate = { @@ -797,11 +797,11 @@ static char *asin_fields[] = { }; static struct valobj asin_valobj[] = { - {V_LOCK, 0, MACHINE, 0, MACH_ID, SMS_DEADLOCK}, + {V_LOCK, 0, MACHINE, 0, MACH_ID, MR_DEADLOCK}, {V_CHAR, 0}, - {V_TYPE, 4, "service", 0, 0, SMS_TYPE}, - {V_TYPE, 6, ACE_TYPE, 0, 0, SMS_ACE}, - {V_TYPEDATA, 7, 0, 0, 0, SMS_ACE}, + {V_TYPE, 4, "service", 0, 0, MR_TYPE}, + {V_TYPE, 6, ACE_TYPE, 0, 0, MR_ACE}, + {V_TYPEDATA, 7, 0, 0, 0, MR_ACE}, }; static struct validate asin_validate = /* for asin, usin */ @@ -886,11 +886,11 @@ static char *qgsh_fields[] = { }; static struct valobj qgsh_valobj[] = { - {V_TYPE, 1, "boolean", 0, 0, SMS_TYPE}, - {V_TYPE, 2, "boolean", 0, 0, SMS_TYPE}, - {V_TYPE, 3, "boolean", 0, 0, SMS_TYPE}, - {V_TYPE, 4, "boolean", 0, 0, SMS_TYPE}, - {V_TYPE, 5, "boolean", 0, 0, SMS_TYPE}, + {V_TYPE, 1, "boolean", 0, 0, MR_TYPE}, + {V_TYPE, 2, "boolean", 0, 0, MR_TYPE}, + {V_TYPE, 3, "boolean", 0, 0, MR_TYPE}, + {V_TYPE, 4, "boolean", 0, 0, MR_TYPE}, + {V_TYPE, 5, "boolean", 0, 0, MR_TYPE}, }; static struct validate qgsh_validate = { @@ -910,9 +910,9 @@ static char *ashi_fields[] = { }; static struct valobj ashi_valobj[] = { - {V_LOCK, 0, MACHINE, 0, MACH_ID, SMS_DEADLOCK}, - {V_NAME, 0, "servers", NAME, 0, SMS_SERVICE}, - {V_ID, 1, MACHINE, NAME, MACH_ID, SMS_MACHINE}, + {V_LOCK, 0, MACHINE, 0, MACH_ID, MR_DEADLOCK}, + {V_NAME, 0, "servers", NAME, 0, MR_SERVICE}, + {V_ID, 1, MACHINE, NAME, MACH_ID, MR_MACHINE}, }; static struct validate ashi_validate = /* ashi & ushi */ @@ -960,7 +960,7 @@ static char *sshi_fields[] = { }; static struct valobj sshi_valobj[] = { - {V_NAME, 0, "servers", NAME, 0, SMS_SERVICE}, + {V_NAME, 0, "servers", NAME, 0, MR_SERVICE}, }; static struct validate sshi_validate = @@ -1016,9 +1016,9 @@ static char *asha_fields[] = { }; static struct valobj asha_valobj[] = { - {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE}, - {V_TYPE, 1, ACE_TYPE, 0, 0, SMS_ACE}, - {V_TYPEDATA, 2, 0, 0, 0, SMS_ACE}, + {V_ID, 0, MACHINE, NAME, MACH_ID, MR_MACHINE}, + {V_TYPE, 1, ACE_TYPE, 0, 0, MR_ACE}, + {V_TYPEDATA, 2, 0, 0, 0, MR_ACE}, }; static struct validate asha_validate = @@ -1094,13 +1094,13 @@ static char *afil_fields[] = { static struct valobj afil_valobj[] = { {V_CHAR, 0}, - {V_LOCK, 0, FILESYS, 0, FILSYS_ID, SMS_DEADLOCK}, - {V_TYPE, 1, FILESYS, 0, 0, SMS_FSTYPE}, - {V_ID, 2, MACHINE, NAME, MACH_ID, SMS_MACHINE}, + {V_LOCK, 0, FILESYS, 0, FILSYS_ID, MR_DEADLOCK}, + {V_TYPE, 1, FILESYS, 0, 0, MR_FSTYPE}, + {V_ID, 2, MACHINE, NAME, MACH_ID, MR_MACHINE}, {V_CHAR, 3}, - {V_ID, 7, USERS, LOGIN, USERS_ID, SMS_USER}, - {V_ID, 8, LIST, NAME, LIST_ID, SMS_LIST}, - {V_TYPE, 10, "lockertype", 0, 0, SMS_TYPE} + {V_ID, 7, USERS, LOGIN, USERS_ID, MR_USER}, + {V_ID, 8, LIST, NAME, LIST_ID, MR_LIST}, + {V_TYPE, 10, "lockertype", 0, 0, MR_TYPE} }; static struct validate afil_validate = { @@ -1121,15 +1121,15 @@ static char *ufil_fields[] = { }; static struct valobj ufil_valobj[] = { - {V_LOCK, 0, FILESYS, 0, FILSYS_ID, SMS_DEADLOCK}, - {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS}, - {V_RENAME, 1, FILESYS, LABEL, FILSYS_ID, SMS_NOT_UNIQUE}, - {V_TYPE, 2, FILESYS, 0, 0, SMS_FSTYPE}, - {V_ID, 3, MACHINE, NAME, MACH_ID, SMS_MACHINE}, + {V_LOCK, 0, FILESYS, 0, FILSYS_ID, MR_DEADLOCK}, + {V_ID, 0, FILESYS, LABEL, FILSYS_ID, MR_FILESYS}, + {V_RENAME, 1, FILESYS, LABEL, FILSYS_ID, MR_NOT_UNIQUE}, + {V_TYPE, 2, FILESYS, 0, 0, MR_FSTYPE}, + {V_ID, 3, MACHINE, NAME, MACH_ID, MR_MACHINE}, {V_CHAR, 4}, - {V_ID, 8, USERS, LOGIN, USERS_ID, SMS_USER}, - {V_ID, 9, LIST, NAME, LIST_ID, SMS_LIST}, - {V_TYPE, 11, "lockertype", 0, 0, SMS_TYPE} + {V_ID, 8, USERS, LOGIN, USERS_ID, MR_USER}, + {V_ID, 9, LIST, NAME, LIST_ID, MR_LIST}, + {V_TYPE, 11, "lockertype", 0, 0, MR_TYPE} }; static struct validate ufil_validate = { @@ -1149,8 +1149,8 @@ static char *dfil_fields[] = { }; static struct valobj dfil_valobj[] = { - {V_LOCK, 0, FILESYS, 0, FILSYS_ID, SMS_DEADLOCK}, - {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS}, + {V_LOCK, 0, FILESYS, 0, FILSYS_ID, MR_DEADLOCK}, + {V_ID, 0, FILESYS, LABEL, FILSYS_ID, MR_FILESYS}, }; static struct validate dfil_validate = { @@ -1170,7 +1170,7 @@ static char *gfgm_fields[] = { }; static struct valobj gfgm_valobj[] = { - {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS}, + {V_ID, 0, FILESYS, LABEL, FILSYS_ID, MR_FILESYS}, {V_SORT, 1}, {V_SORT, 0}, }; @@ -1188,9 +1188,9 @@ static struct validate gfgm_validate = { }; static struct valobj aftg_valobj[] = { - {V_LOCK, 0, FILESYS, 0, FILSYS_ID, SMS_DEADLOCK}, - {V_ID, 0, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS}, - {V_ID, 1, FILESYS, LABEL, FILSYS_ID, SMS_FILESYS}, + {V_LOCK, 0, FILESYS, 0, FILSYS_ID, MR_DEADLOCK}, + {V_ID, 0, FILESYS, LABEL, FILSYS_ID, MR_FILESYS}, + {V_ID, 1, FILESYS, LABEL, FILSYS_ID, MR_FILESYS}, }; static struct validate aftg_validate = { @@ -1227,7 +1227,7 @@ static struct validate gnfp_validate = { }; static struct valobj anfp_valobj[] = { - {V_ID, 0, MACHINE, NAME, MACH_ID, SMS_MACHINE}, + {V_ID, 0, MACHINE, NAME, MACH_ID, MR_MACHINE}, {V_CHAR, 1}, }; @@ -1345,10 +1345,10 @@ static char *alis_fields[] = { }; static struct valobj alis_valobj[] = { - {V_LOCK, 0, LIST, 0, LIST_ID, SMS_DEADLOCK}, + {V_LOCK, 0, LIST, 0, LIST_ID, MR_DEADLOCK}, {V_CHAR, 0}, - {V_TYPE, 7, ACE_TYPE, 0, 0, SMS_ACE}, - {V_TYPEDATA, 8, 0, 0, LIST_ID, SMS_ACE}, + {V_TYPE, 7, ACE_TYPE, 0, 0, MR_ACE}, + {V_TYPEDATA, 8, 0, 0, LIST_ID, MR_ACE}, }; static struct validate alis_validate = { @@ -1370,11 +1370,11 @@ static char *ulis_fields[] = { }; static struct valobj ulis_valobj[] = { - {V_LOCK, 0, LIST, 0, LIST_ID, SMS_DEADLOCK}, - {V_ID, 0, LIST, NAME, LIST_ID, SMS_LIST}, - {V_RENAME, 1, LIST, NAME, LIST_ID, SMS_NOT_UNIQUE}, - {V_TYPE, 8, ACE_TYPE, 0, 0, SMS_ACE}, - {V_TYPEDATA, 9, 0, 0, LIST_ID, SMS_ACE}, + {V_LOCK, 0, LIST, 0, LIST_ID, MR_DEADLOCK}, + {V_ID, 0, LIST, NAME, LIST_ID, MR_LIST}, + {V_RENAME, 1, LIST, NAME, LIST_ID, MR_NOT_UNIQUE}, + {V_TYPE, 8, ACE_TYPE, 0, 0, MR_ACE}, + {V_TYPEDATA, 9, 0, 0, LIST_ID, MR_ACE}, }; static struct validate ulis_validate = { @@ -1410,10 +1410,10 @@ static char *amtl_fields[] = { }; static struct valobj amtl_valobj[] = { - {V_LOCK, 0, LIST, 0, LIST_ID, SMS_DEADLOCK}, - {V_ID, 0, LIST, NAME, LIST_ID, SMS_LIST}, - {V_TYPE, 1, "member", 0, 0, SMS_TYPE}, - {V_TYPEDATA, 2, 0, 0, 0, SMS_NO_MATCH}, + {V_LOCK, 0, LIST, 0, LIST_ID, MR_DEADLOCK}, + {V_ID, 0, LIST, NAME, LIST_ID, MR_LIST}, + {V_TYPE, 1, "member", 0, 0, MR_TYPE}, + {V_TYPEDATA, 2, 0, 0, 0, MR_NO_MATCH}, }; static struct validate amtl_validate = @@ -1448,8 +1448,8 @@ static char *gaus_fields[] = { }; static struct valobj gaus_valobj[] = { - {V_TYPE, 0, "gaus", 0, 0, SMS_TYPE}, - {V_TYPEDATA, 1, 0, 0, 0, SMS_NO_MATCH}, + {V_TYPE, 0, "gaus", 0, 0, MR_TYPE}, + {V_TYPEDATA, 1, 0, 0, 0, MR_NO_MATCH}, }; static struct validate gaus_validate = { @@ -1470,11 +1470,11 @@ static char *qgli_fields[] = { }; static struct valobj qgli_valobj[] = { - {V_TYPE, 0, "boolean", 0, 0, SMS_TYPE}, - {V_TYPE, 1, "boolean", 0, 0, SMS_TYPE}, - {V_TYPE, 2, "boolean", 0, 0, SMS_TYPE}, - {V_TYPE, 3, "boolean", 0, 0, SMS_TYPE}, - {V_TYPE, 4, "boolean", 0, 0, SMS_TYPE}, + {V_TYPE, 0, "boolean", 0, 0, MR_TYPE}, + {V_TYPE, 1, "boolean", 0, 0, MR_TYPE}, + {V_TYPE, 2, "boolean", 0, 0, MR_TYPE}, + {V_TYPE, 3, "boolean", 0, 0, MR_TYPE}, + {V_TYPE, 4, "boolean", 0, 0, MR_TYPE}, }; static struct validate qgli_validate = { @@ -1512,8 +1512,8 @@ static char *glom_fields[] = { }; static struct valobj glom_valobj[] = { - {V_TYPE, 0, "rmember", 0, 0, SMS_TYPE}, - {V_TYPEDATA, 1, 0, 0, 0, SMS_NO_MATCH}, + {V_TYPE, 0, "rmember", 0, 0, MR_TYPE}, + {V_TYPEDATA, 1, 0, 0, 0, MR_NO_MATCH}, {V_SORT, 0}, }; @@ -1571,14 +1571,14 @@ static char *azcl_fields[] = { static struct valobj azcl_valobj[] = { {V_CHAR, 0}, - {V_TYPE, 1, ACE_TYPE, 0, 0, SMS_ACE}, - {V_TYPEDATA, 2, 0, 0, LIST_ID, SMS_ACE}, - {V_TYPE, 3, ACE_TYPE, 0, 0, SMS_ACE}, - {V_TYPEDATA, 4, 0, 0, LIST_ID, SMS_ACE}, - {V_TYPE, 5, ACE_TYPE, 0, 0, SMS_ACE}, - {V_TYPEDATA, 6, 0, 0, LIST_ID, SMS_ACE}, - {V_TYPE, 7, ACE_TYPE, 0, 0, SMS_ACE}, - {V_TYPEDATA, 8, 0, 0, LIST_ID, SMS_ACE}, + {V_TYPE, 1, ACE_TYPE, 0, 0, MR_ACE}, + {V_TYPEDATA, 2, 0, 0, LIST_ID, MR_ACE}, + {V_TYPE, 3, ACE_TYPE, 0, 0, MR_ACE}, + {V_TYPEDATA, 4, 0, 0, LIST_ID, MR_ACE}, + {V_TYPE, 5, ACE_TYPE, 0, 0, MR_ACE}, + {V_TYPEDATA, 6, 0, 0, LIST_ID, MR_ACE}, + {V_TYPE, 7, ACE_TYPE, 0, 0, MR_ACE}, + {V_TYPEDATA, 8, 0, 0, LIST_ID, MR_ACE}, }; static struct validate azcl_validate = { @@ -1599,15 +1599,15 @@ static char *uzcl_fields[] = { }; static struct valobj uzcl_valobj[] = { - {V_RENAME, 1, "zephyr", CLASS, 0, SMS_NOT_UNIQUE}, - {V_TYPE, 2, ACE_TYPE, 0, 0, SMS_ACE}, - {V_TYPEDATA, 3, 0, 0, LIST_ID, SMS_ACE}, - {V_TYPE, 4, ACE_TYPE, 0, 0, SMS_ACE}, - {V_TYPEDATA, 5, 0, 0, LIST_ID, SMS_ACE}, - {V_TYPE, 6, ACE_TYPE, 0, 0, SMS_ACE}, - {V_TYPEDATA, 7, 0, 0, LIST_ID, SMS_ACE}, - {V_TYPE, 8, ACE_TYPE, 0, 0, SMS_ACE}, - {V_TYPEDATA, 9, 0, 0, LIST_ID, SMS_ACE}, + {V_RENAME, 1, "zephyr", CLASS, 0, MR_NOT_UNIQUE}, + {V_TYPE, 2, ACE_TYPE, 0, 0, MR_ACE}, + {V_TYPEDATA, 3, 0, 0, LIST_ID, MR_ACE}, + {V_TYPE, 4, ACE_TYPE, 0, 0, MR_ACE}, + {V_TYPEDATA, 5, 0, 0, LIST_ID, MR_ACE}, + {V_TYPE, 6, ACE_TYPE, 0, 0, MR_ACE}, + {V_TYPEDATA, 7, 0, 0, LIST_ID, MR_ACE}, + {V_TYPE, 8, ACE_TYPE, 0, 0, MR_ACE}, + {V_TYPEDATA, 9, 0, 0, LIST_ID, MR_ACE}, }; static struct validate uzcl_validate = { @@ -1651,7 +1651,7 @@ static char *apcp_fields[] = { static struct valobj apcp_valobj[] = { {V_CHAR, 0}, - {V_ID, 1, MACHINE, NAME, MACH_ID, SMS_MACHINE}, + {V_ID, 1, MACHINE, NAME, MACH_ID, MR_MACHINE}, }; static struct validate apcp_validate = { @@ -1689,7 +1689,7 @@ static char *apdm_fields[] = { static struct valobj apdm_valobj[] = { {V_CHAR, 0}, - {V_ID, 2, MACHINE, NAME, MACH_ID, SMS_MACHINE}, + {V_ID, 2, MACHINE, NAME, MACH_ID, MR_MACHINE}, }; static struct validate apdm_validate = { @@ -1727,7 +1727,7 @@ static char *aali_fields[] = { static struct valobj aali_valobj[] = { {V_CHAR, 0}, - {V_TYPE, 1, "alias", 0, 0, SMS_TYPE}, + {V_TYPE, 1, "alias", 0, 0, MR_TYPE}, {V_CHAR, 2}, }; @@ -1761,7 +1761,7 @@ static char *gval_fields[] = { }; static struct valobj gval_valobj[] = { - {V_NAME, 0, "values", NAME, 0, SMS_NO_MATCH}, + {V_NAME, 0, "values", NAME, 0, MR_NO_MATCH}, }; static struct validate gval_validate = { -- 2.45.2