From 8defc06b8af7d99c7b46eaa73d5e9d7c8f044d52 Mon Sep 17 00:00:00 2001 From: mar Date: Sat, 17 Mar 1990 16:30:34 +0000 Subject: [PATCH] sms -> moira --- clients/blanche/Makefile | 10 +- clients/blanche/blanche.c | 70 ++++++------- clients/mailmaint/Makefile | 10 +- clients/mailmaint/mailmaint.c | 28 ++--- clients/moira/Makefile | 78 +++++++------- clients/moira/attach.c | 80 +++++++-------- clients/moira/cluster.c | 72 ++++++------- clients/moira/dcmmaint.c | 72 ++++++------- clients/moira/delete.c | 86 ++++++++-------- clients/moira/globals.c | 4 +- clients/moira/lists.c | 56 +++++----- clients/moira/main.c | 22 ++-- clients/moira/menus.c | 8 +- clients/moira/misc.c | 22 ++-- clients/moira/nfs.c | 52 +++++----- clients/moira/pobox.c | 34 +++---- clients/moira/printer.c | 42 ++++---- clients/moira/quota.c | 50 ++++----- clients/moira/user.c | 56 +++++----- clients/moira/utils.c | 64 ++++++------ clients/mrtest/Makefile | 6 +- clients/mrtest/mrtest.c | 26 ++--- clients/passwd/Makefile | 22 ++-- clients/passwd/chfn.c | 32 +++--- clients/passwd/chpobox.c | 76 +++++++------- clients/passwd/chsh.c | 34 +++---- clients/userreg/Makefile | 6 +- clients/userreg/reg_stubs.c | 6 +- include/Makefile | 10 +- include/moira.h | 4 +- include/moira_site.h | 10 +- lib/Makefile | 142 +++++++++++++------------- lib/critical.c | 12 +-- lib/hash.c | 2 +- lib/mr_access.c | 43 +++----- lib/mr_auth.c | 46 ++++----- lib/mr_call.c | 36 +++---- lib/mr_connect.c | 78 +++++++------- lib/mr_data.c | 8 +- lib/mr_init.c | 12 +-- lib/mr_ops.c | 107 ++++++++++---------- lib/mr_param.c | 185 ++++++++++++++++------------------ lib/mr_private.h | 26 ++--- lib/mr_query.c | 54 +++++----- lib/nfsparttype.c | 14 +-- lib/sq.c | 2 +- 46 files changed, 943 insertions(+), 972 deletions(-) diff --git a/clients/blanche/Makefile b/clients/blanche/Makefile index 044564d5..5cacf3ee 100644 --- a/clients/blanche/Makefile +++ b/clients/blanche/Makefile @@ -1,4 +1,4 @@ -# Makefile for SMS clients blanche +# Makefile for Moira clients blanche # # MIT Project Athena # @@ -16,7 +16,7 @@ DEFINES = -O CFLAGS = -I../../include ${DEFINES} BINDIR = ${DESTDIR}/bin -SMSLIB = -L../../lib -lsms -lgdb -lcom_err -lkrb -ldes -lhesiod +MOIRALIB = -L../../lib -lmoira -lgdb -lcom_err -lkrb -ldes -lhesiod PROGS= blanche @@ -24,7 +24,7 @@ all: ${PROGS} blanche: blanche.o rm -f blanche - cc -o blanche blanche.o ${SMSLIB} + cc -o blanche blanche.o ${MOIRALIB} lint: lint *.c @@ -42,5 +42,5 @@ depend: # DO NOT DELETE THIS LINE -- mkdep uses it. blanche.o: blanche.c ../../include/mit-copyright.h /usr/include/stdio.h -blanche.o: /usr/include/ctype.h ../../include/sms.h /usr/include/sms_et.h -blanche.o: ../../include/sms_app.h +blanche.o: /usr/include/ctype.h ../../include/moira.h ../../include/mr_et.h +blanche.o: ../../include/moira_site.h diff --git a/clients/blanche/blanche.c b/clients/blanche/blanche.c index b13c9e95..08d44903 100644 --- a/clients/blanche/blanche.c +++ b/clients/blanche/blanche.c @@ -17,8 +17,8 @@ #include #include #include -#include -#include +#include +#include #ifndef LINT static char blanche_rcsid[] = "$Header$"; @@ -167,21 +167,21 @@ char **argv; showusers = showstrings = showlists = showkerberos = 1; /* fire up Moira */ - if (status = sms_connect(server)) { + if (status = mr_connect(server)) { com_err(whoami, status, "unable to connect to the Moira server"); exit(2); } - if ( status = sms_motd(&motd) ) { + if ( status = mr_motd(&motd) ) { com_err(whoami, status, "unable to check server status"); exit(2); } if (motd) { fprintf(stderr, "The Moira server is currently unavailable:\n%s\n", motd); - sms_disconnect(); + mr_disconnect(); exit(2); } - if (!noauth && (status = sms_auth("blanche"))) { + if (!noauth && (status = mr_auth("blanche"))) { com_err(whoami, status, "unable to authenticate to Moira"); com_err(whoami, 0, " Try the -noauth flag if you don't need authentication"); @@ -190,11 +190,11 @@ char **argv; /* display list info if requested to */ if (infoflg) { - status = sms_query("get_list_info", 1, &listname, show_list_info,NULL); + status = mr_query("get_list_info", 1, &listname, show_list_info,NULL); if (status) com_err(whoami, status, "while getting list information"); if (verbose && !memberflg) { - status = sms_query("count_members_of_list", 1, &listname, + status = mr_query("count_members_of_list", 1, &listname, show_list_count, NULL); if (status) com_err(whoami, status, "while getting list count"); @@ -210,7 +210,7 @@ char **argv; * lastly, reset memberlist so we can use it again later */ if (syncflg) { - status = sms_query("get_members_of_list", 1, &listname, + status = mr_query("get_members_of_list", 1, &listname, get_list_members, (char *)memberlist); if (status) com_err(whoami, status, "getting members of list %s", listname); @@ -247,38 +247,38 @@ char **argv; case M_ANY: case M_USER: membervec[1] = "USER"; - status = sms_query("add_member_to_list", 3, membervec, scream, NULL); - if (status == SMS_SUCCESS) + status = mr_query("add_member_to_list", 3, membervec, scream, NULL); + if (status == MR_SUCCESS) break; - else if (status != SMS_USER || memberstruct->type != M_ANY) { + else if (status != MR_USER || memberstruct->type != M_ANY) { com_err(whoami, status, "while adding member %s to %s", memberstruct->name, listname); break; } case M_LIST: membervec[1] = "LIST"; - status = sms_query("add_member_to_list", 3, membervec, + status = mr_query("add_member_to_list", 3, membervec, scream, NULL); - if (status == SMS_SUCCESS) + if (status == MR_SUCCESS) break; - else if (status != SMS_LIST || memberstruct->type != M_ANY) { + else if (status != MR_LIST || memberstruct->type != M_ANY) { com_err(whoami, status, "while adding member %s to %s", memberstruct->name, listname); break; } case M_STRING: membervec[1] = "STRING"; - status = sms_query("add_member_to_list", 3, membervec, + status = mr_query("add_member_to_list", 3, membervec, scream, NULL); - if (status != SMS_SUCCESS) + if (status != MR_SUCCESS) com_err(whoami, status, "while adding member %s to %s", memberstruct->name, listname); break; case M_KERBEROS: membervec[1] = "KERBEROS"; - status = sms_query("add_member_to_list", 3, membervec, + status = mr_query("add_member_to_list", 3, membervec, scream, NULL); - if (status != SMS_SUCCESS) + if (status != MR_SUCCESS) com_err(whoami, status, "while adding member %s to %s", memberstruct->name, listname); } @@ -296,11 +296,11 @@ char **argv; case M_ANY: case M_USER: membervec[1] = "USER"; - status = sms_query("delete_member_from_list", 3, membervec, + status = mr_query("delete_member_from_list", 3, membervec, scream, NULL); - if (status == SMS_SUCCESS) + if (status == MR_SUCCESS) break; - else if ((status != SMS_USER && status != SMS_NO_MATCH) || + else if ((status != MR_USER && status != MR_NO_MATCH) || memberstruct->type != M_ANY) { com_err(whoami, status, "while deleting member %s from %s", memberstruct->name, listname); @@ -308,11 +308,11 @@ char **argv; } case M_LIST: membervec[1] = "LIST"; - status = sms_query("delete_member_from_list", 3, membervec, + status = mr_query("delete_member_from_list", 3, membervec, scream, NULL); - if (status == SMS_SUCCESS) + if (status == MR_SUCCESS) break; - else if ((status != SMS_LIST && status != SMS_NO_MATCH) || + else if ((status != MR_LIST && status != MR_NO_MATCH) || memberstruct->type != M_ANY) { com_err(whoami, status, "while deleting member %s from %s", memberstruct->name, listname); @@ -320,20 +320,20 @@ char **argv; } case M_STRING: membervec[1] = "STRING"; - status = sms_query("delete_member_from_list", 3, membervec, + status = mr_query("delete_member_from_list", 3, membervec, scream, NULL); - if (status == SMS_STRING && memberstruct->type == M_ANY) + if (status == MR_STRING && memberstruct->type == M_ANY) com_err(whoami, 0, " Unable to find member %s to delete from %s", memberstruct->name, listname); - else if (status != SMS_SUCCESS) + else if (status != MR_SUCCESS) com_err(whoami, status, "while deleting member %s from %s", memberstruct->name, listname); break; case M_KERBEROS: membervec[1] = "KERBEROS"; - status = sms_query("delete_member_from_list", 3, membervec, + status = mr_query("delete_member_from_list", 3, membervec, scream, NULL); - if (status != SMS_SUCCESS) + if (status != MR_SUCCESS) com_err(whoami, status, "while deleting member %s from %s", memberstruct->name, listname); } @@ -344,7 +344,7 @@ char **argv; if (recursflg) recursive_display_list_members(); else { - status = sms_query("get_members_of_list", 1, &listname, + status = mr_query("get_members_of_list", 1, &listname, get_list_members, (char *)memberlist); if (status) com_err(whoami, status, "while getting members of list %s", @@ -355,7 +355,7 @@ char **argv; } /* We're done! */ - sms_disconnect(); + mr_disconnect(); exit(0); } @@ -453,7 +453,7 @@ int hint; printf("\n"); printf("Owner: %s %s\n", argv[7], argv[8]); printf("Last modified by %s with %s on %s\n", argv[11], argv[12], argv[10]); - return(SMS_CONT); + return(MR_CONT); } @@ -488,7 +488,7 @@ recursive_display_list_members() memberlist = sq_create(); if (debugflg) fprintf(stderr, "Fetching members of %s\n", m->name); - status = sms_query("get_members_of_list", 1, &(m->name), + status = mr_query("get_members_of_list", 1, &(m->name), get_list_members, (char *)memberlist); if (status) com_err(whoami, status, "while getting members of list %s", m->name); @@ -553,7 +553,7 @@ struct save_queue *q; } m->name = strsave(argv[1]); sq_save_data(q, m); - return(SMS_CONT); + return(MR_CONT); } diff --git a/clients/mailmaint/Makefile b/clients/mailmaint/Makefile index 36f448bb..d17bafd8 100644 --- a/clients/mailmaint/Makefile +++ b/clients/mailmaint/Makefile @@ -6,7 +6,7 @@ # For copying and distribution information, please see the file # . -# Makefile for SMS client mailmaint +# Makefile for Moira client mailmaint # # DESTDIR= @@ -14,7 +14,7 @@ CFLAGS = -I../../include -O CONFDIR = ${DESTDIR}/usr/athena BINDIR = ${DESTDIR}/bin -SMSLIB = -L../../lib -lsms -lgdb -lcom_err +MOIRALIB = -L../../lib -lmoira -lgdb -lcom_err SRCS = mailmaint.c @@ -23,7 +23,7 @@ OBJECTS = mailmaint.o all: mailmaint mailmaint: ${OBJECTS} - cc ${CFLAGS} -o mailmaint ${OBJECTS} ${SMSLIB} \ + cc ${CFLAGS} -o mailmaint ${OBJECTS} ${MOIRALIB} \ -lcurses -ltermcap -lkrb -ldes -lhesiod mailmaint.o: mailmaint.c @@ -50,5 +50,5 @@ mailmaint.o: /usr/include/curses.h /usr/include/sgtty.h mailmaint.o: /usr/include/sys/ioctl.h /usr/include/sys/ttychars.h mailmaint.o: /usr/include/sys/ttydev.h /usr/include/sys/types.h mailmaint.o: /usr/include/varargs.h ../../include/com_err.h -mailmaint.o: /usr/include/ctype.h ../../include/sms.h /usr/include/sms_et.h -mailmaint.o: ../../include/sms_app.h ../../include/mit-copyright.h +mailmaint.o: /usr/include/ctype.h ../../include/moira.h ../../include/mr_et.h +mailmaint.o: ../../include/moira_site.h ../../include/mit-copyright.h diff --git a/clients/mailmaint/mailmaint.c b/clients/mailmaint/mailmaint.c index 3df34072..acf6dbaf 100644 --- a/clients/mailmaint/mailmaint.c +++ b/clients/mailmaint/mailmaint.c @@ -25,8 +25,8 @@ static char rcsid_mailmaint_c[] = "$Header$"; #include #include #include -#include -#include +#include +#include #include @@ -135,24 +135,24 @@ main(argc, argv) printf("Connecting to database for %s...please hold on.\n", uname); - status = sms_connect(NULL); + status = mr_connect(NULL); if (status) { (void) sprintf(buf, "\nConnection to Moira server failed"); goto punt; } - status = sms_motd(&motd); + status = mr_motd(&motd); if (status) { com_err(whoami, status, " unable to check server status"); - sms_disconnect(); + mr_disconnect(); exit(2); } if (motd) { fprintf(stderr, "The Moira server is currently unavailable:\n%s\n", motd); - sms_disconnect(); + mr_disconnect(); exit(2); } - status = sms_auth("mailmaint"); + status = mr_auth("mailmaint"); if (status) { (void) sprintf(buf, "\nAuthorization failed.\n"); goto punt; @@ -393,7 +393,7 @@ add_member() argv[0] = strsave(buf); argv[1] = strsave("user"); argv[2] = strsave(uname); - if (status = sms_query("add_member_to_list", 3, argv, + if (status = mr_query("add_member_to_list", 3, argv, scream, (char *) NULL)) { display_buff("\r\n"); com_err(whoami, status, " found.\n"); @@ -422,7 +422,7 @@ delete_member() argv[0] = strsave(buf); argv[1] = strsave("user"); argv[2] = strsave(uname); - if (status = sms_query("delete_member_from_list", 3, argv, + if (status = mr_query("delete_member_from_list", 3, argv, scream, (char *) NULL)) { display_buff("\r\n"); com_err(whoami, status, " found.\n"); @@ -451,7 +451,7 @@ list_by_member() show_text(DISPROW, STARTCOL, buf); mvcur(0, 0, currow, STARTCOL); refresh(); - if (status = sms_query("get_lists_of_member", 2, nargv + 1, + if (status = mr_query("get_lists_of_member", 2, nargv + 1, print_1, (char *) NULL)) { display_buff("\r\n"); com_err(whoami, status, " in get_lists_of_member"); @@ -529,7 +529,7 @@ list_all_groups() argv[1] = argv[4] = "dontcare"; argv[2] = "false"; first_time = 1; - if (status = sms_query("qualified_get_lists", 5, argv, + if (status = mr_query("qualified_get_lists", 5, argv, print_all, (char *) NULL)) { display_buff("\r\n"); com_err(whoami, status, " in list_all_groups\n"); @@ -555,7 +555,7 @@ list_members() (void) sprintf(buffer, "The members of list '%s' are:", buf); show_text(DISPROW + 1, STARTCOL, buffer); argv[0] = buf; - if (status = sms_query("get_members_of_list", 1, argv, + if (status = mr_query("get_members_of_list", 1, argv, print_2, (char *) NULL)) { display_buff("\r\n"); com_err(whoami, status, " found.\n"); @@ -824,7 +824,7 @@ scream() { com_err(whoami, status, "\nA Moira update returned a value -- programmer \ botch\n"); - sms_disconnect(); + mr_disconnect(); exit(1); return(0); /* to keep compiler happy */ } @@ -839,7 +839,7 @@ fetch_list_info(list, li) char *argv[1]; argv[0] = list; - return sms_query("get_list_info", 1, argv, get_list_info, (char *) NULL); + return mr_query("get_list_info", 1, argv, get_list_info, (char *) NULL); } /* ARGSUSED */ diff --git a/clients/moira/Makefile b/clients/moira/Makefile index a5a7fc61..e4c55043 100644 --- a/clients/moira/Makefile +++ b/clients/moira/Makefile @@ -1,5 +1,5 @@ -# This is the Makefile for allmaint, the SMS client that allows -# a user to maintaint most important parts of the SMS database. +# This is the Makefile for allmaint, the Moira client that allows +# a user to maintaint most important parts of the Moira database. # It Contains: The Makefile # # Created: 5/9/88 @@ -21,8 +21,8 @@ LDFLAGS = -L../../lib CONFDIR = ${DESTDIR}/usr/athena BINDIR = ${DESTDIR}/bin -SMSLIB = -lsms -lgdb -lcom_err -LIBS = ${SMSLIB} -lcurses -ltermcap -lkrb -ldes -lhesiod +MOIRALIB = -lmoira -lgdb -lcom_err +LIBS = ${MOIRALIB} -lcurses -ltermcap -lkrb -ldes -lhesiod SRCS = utils.c attach.c cluster.c delete.c globals.c lists.c main.c \ @@ -59,7 +59,7 @@ clean: # correct libraries when using saber C. saber: ; - /mit/kaufer/saber -I/mit/smsdev/include -DDEBUG ${LDFLAGS} \ + /mit/kaufer/saber -I/mit/moiradev/include -DDEBUG ${LDFLAGS} \ ${SRCS} ${LIBS} depend: @@ -68,25 +68,29 @@ depend: # DO NOT DELETE THIS LINE -- mkdep uses it. utils.o: utils.c /usr/include/stdio.h /usr/include/strings.h -utils.o: ../../include/sms.h /usr/include/sms_et.h ../../include/sms_app.h -utils.o: ../../include/mit-copyright.h menu.h /usr/include/ctype.h defs.h -utils.o: f_defs.h globals.h /usr/include/netdb.h +utils.o: ../../include/moira.h ../../include/mr_et.h +utils.o: ../../include/moira_site.h ../../include/mit-copyright.h menu.h +utils.o: /usr/include/ctype.h defs.h f_defs.h globals.h /usr/include/netdb.h attach.o: attach.c /usr/include/stdio.h /usr/include/strings.h -attach.o: ../../include/sms.h /usr/include/sms_et.h ../../include/sms_app.h -attach.o: ../../include/mit-copyright.h menu.h defs.h f_defs.h globals.h +attach.o: ../../include/moira.h ../../include/mr_et.h +attach.o: ../../include/moira_site.h ../../include/mit-copyright.h menu.h +attach.o: defs.h f_defs.h globals.h cluster.o: cluster.c /usr/include/stdio.h /usr/include/strings.h -cluster.o: ../../include/sms.h /usr/include/sms_et.h ../../include/sms_app.h -cluster.o: ../../include/mit-copyright.h menu.h defs.h f_defs.h globals.h +cluster.o: ../../include/moira.h ../../include/mr_et.h +cluster.o: ../../include/moira_site.h ../../include/mit-copyright.h menu.h +cluster.o: defs.h f_defs.h globals.h delete.o: delete.c /usr/include/stdio.h /usr/include/strings.h -delete.o: ../../include/sms.h /usr/include/sms_et.h ../../include/sms_app.h -delete.o: ../../include/mit-copyright.h menu.h defs.h f_defs.h globals.h +delete.o: ../../include/moira.h ../../include/mr_et.h +delete.o: ../../include/moira_site.h ../../include/mit-copyright.h menu.h +delete.o: defs.h f_defs.h globals.h globals.o: globals.c ../../include/mit-copyright.h defs.h lists.o: lists.c /usr/include/stdio.h /usr/include/strings.h -lists.o: ../../include/sms.h /usr/include/sms_et.h ../../include/sms_app.h -lists.o: ../../include/mit-copyright.h menu.h defs.h f_defs.h globals.h +lists.o: ../../include/moira.h ../../include/mr_et.h +lists.o: ../../include/moira_site.h ../../include/mit-copyright.h menu.h +lists.o: defs.h f_defs.h globals.h main.o: main.c /usr/include/pwd.h /usr/include/signal.h /usr/include/stdio.h -main.o: /usr/include/strings.h /usr/include/sys/types.h ../../include/sms.h -main.o: /usr/include/sms_et.h menu.h ../../include/mit-copyright.h defs.h +main.o: /usr/include/strings.h /usr/include/sys/types.h ../../include/moira.h +main.o: ../../include/mr_et.h menu.h ../../include/mit-copyright.h defs.h main.o: f_defs.h globals.h menu.o: menu.c ../../include/mit-copyright.h /usr/include/sys/types.h menu.o: /usr/include/stdio.h /usr/include/signal.h /usr/include/curses.h @@ -96,30 +100,32 @@ menu.o: /usr/include/ctype.h /usr/include/strings.h /usr/include/varargs.h menu.o: ../../include/com_err.h menu.h menus.o: menus.c /usr/include/stdio.h menu.h ../../include/mit-copyright.h menus.o: defs.h f_defs.h globals.h -nfs.o: nfs.c /usr/include/stdio.h /usr/include/strings.h ../../include/sms.h -nfs.o: /usr/include/sms_et.h ../../include/sms_app.h +nfs.o: nfs.c /usr/include/stdio.h /usr/include/strings.h +nfs.o: ../../include/moira.h ../../include/mr_et.h ../../include/moira_site.h nfs.o: ../../include/mit-copyright.h menu.h defs.h f_defs.h globals.h pobox.o: pobox.c /usr/include/stdio.h /usr/include/strings.h -pobox.o: /usr/include/ctype.h ../../include/sms.h /usr/include/sms_et.h -pobox.o: ../../include/sms_app.h ../../include/mit-copyright.h menu.h defs.h -pobox.o: f_defs.h globals.h +pobox.o: /usr/include/ctype.h ../../include/moira.h ../../include/mr_et.h +pobox.o: ../../include/moira_site.h ../../include/mit-copyright.h menu.h +pobox.o: defs.h f_defs.h globals.h quota.o: quota.c /usr/include/stdio.h /usr/include/strings.h -quota.o: ../../include/sms.h /usr/include/sms_et.h ../../include/sms_app.h -quota.o: ../../include/mit-copyright.h menu.h defs.h f_defs.h globals.h +quota.o: ../../include/moira.h ../../include/mr_et.h +quota.o: ../../include/moira_site.h ../../include/mit-copyright.h menu.h +quota.o: defs.h f_defs.h globals.h user.o: user.c /usr/include/stdio.h /usr/include/strings.h -user.o: ../../include/sms.h /usr/include/sms_et.h ../../include/sms_app.h -user.o: ../../include/mit-copyright.h menu.h /usr/include/ctype.h defs.h -user.o: f_defs.h globals.h +user.o: ../../include/moira.h ../../include/mr_et.h +user.o: ../../include/moira_site.h ../../include/mit-copyright.h menu.h +user.o: /usr/include/ctype.h defs.h f_defs.h globals.h dcmmaint.o: dcmmaint.c /usr/include/stdio.h /usr/include/strings.h -dcmmaint.o: /usr/include/ctype.h ../../include/sms.h /usr/include/sms_et.h -dcmmaint.o: ../../include/sms_app.h ../../include/mit-copyright.h menu.h +dcmmaint.o: /usr/include/ctype.h ../../include/moira.h ../../include/mr_et.h +dcmmaint.o: ../../include/moira_site.h ../../include/mit-copyright.h menu.h dcmmaint.o: defs.h f_defs.h globals.h printer.o: printer.c /usr/include/stdio.h /usr/include/strings.h -printer.o: /usr/include/ctype.h ../../include/sms.h /usr/include/sms_et.h -printer.o: ../../include/sms_app.h ../../include/mit-copyright.h menu.h +printer.o: /usr/include/ctype.h ../../include/moira.h ../../include/mr_et.h +printer.o: ../../include/moira_site.h ../../include/mit-copyright.h menu.h printer.o: defs.h f_defs.h globals.h misc.o: misc.c /usr/include/stdio.h /usr/include/strings.h -misc.o: ../../include/sms.h /usr/include/sms_et.h ../../include/sms_app.h -misc.o: ../../include/mit-copyright.h menu.h /usr/include/sys/types.h -misc.o: /usr/include/netdb.h /usr/include/sys/socket.h -misc.o: /usr/include/netinet/in.h defs.h f_defs.h globals.h +misc.o: ../../include/moira.h ../../include/mr_et.h +misc.o: ../../include/moira_site.h ../../include/mit-copyright.h menu.h +misc.o: /usr/include/sys/types.h /usr/include/netdb.h +misc.o: /usr/include/sys/socket.h /usr/include/netinet/in.h defs.h f_defs.h +misc.o: globals.h diff --git a/clients/moira/attach.c b/clients/moira/attach.c index a345be30..38f4cecc 100644 --- a/clients/moira/attach.c +++ b/clients/moira/attach.c @@ -2,8 +2,8 @@ static char rcsid_module_c[] = "$Header$"; #endif -/* This is the file attach.c for the SMS Client, which allows a nieve - * user to quickly and easily maintain most parts of the SMS database. +/* This is the file attach.c for the MOIRA Client, which allows a nieve + * user to quickly and easily maintain most parts of the MOIRA database. * It Contains: Functions for maintaining data used by Hesiod * to map courses/projects/users to their file systems, * and maintain filesys info. @@ -23,8 +23,8 @@ #include #include -#include -#include +#include +#include #include #include "mit-copyright.h" @@ -101,21 +101,21 @@ char *name; switch (type) { case LABEL: - if ( (stat = do_sms_query("get_filesys_by_label", 1, &name, + if ( (stat = do_mr_query("get_filesys_by_label", 1, &name, StoreInfo, (char *)&elem)) != 0) { com_err(program_name, stat, NULL); return(NULL); } break; case MACHINE: - if ( (stat = do_sms_query("get_filesys_by_machine", 1, &name, + if ( (stat = do_mr_query("get_filesys_by_machine", 1, &name, StoreInfo, (char *)&elem)) != 0) { com_err(program_name, stat, NULL); return(NULL); } break; case GROUP: - if ( (stat = do_sms_query("get_filesys_by_group", 1, &name, + if ( (stat = do_mr_query("get_filesys_by_group", 1, &name, StoreInfo, (char *)&elem)) != 0) { com_err(program_name, stat, NULL); return(NULL); @@ -125,7 +125,7 @@ char *name; args[ALIAS_NAME] = name; args[ALIAS_TYPE] = FS_ALIAS_TYPE; args[ALIAS_TRANS] = "*"; - if ( (stat = do_sms_query("get_alias", 3, args, StoreInfo, + if ( (stat = do_mr_query("get_alias", 3, args, StoreInfo, (char *) &elem)) != 0) { com_err(program_name, stat, " in get_alias."); return(NULL); @@ -194,9 +194,9 @@ char ** info; info[FS_MODWITH]); Put_message(print_buf); Put_message("Containing the filesystems (in order):"); - if ((stat = do_sms_query("get_fsgroup_members", 1, &info[FS_NAME], + if ((stat = do_mr_query("get_fsgroup_members", 1, &info[FS_NAME], StoreInfo, (char *)&elem)) != 0) { - if (stat == SMS_NO_MATCH) + if (stat == MR_NO_MATCH) Put_message(" [no members]"); else com_err(program_name, stat, NULL); @@ -341,7 +341,7 @@ Bool one_item; sprintf(temp_buf, "Are you sure that you want to delete filesystem %s", info[FS_NAME]); if(!one_item || Confirm(temp_buf)) { - if ( (stat = do_sms_query("delete_filesys", 1, + if ( (stat = do_mr_query("delete_filesys", 1, &info[FS_NAME], Scream, NULL)) != 0) com_err(program_name, stat, " filesystem not deleted."); else @@ -388,15 +388,15 @@ Bool junk; char ** args = AskFSInfo(info, TRUE); extern Menu nfsphys_menu; - stat = do_sms_query("update_filesys", CountArgs(args), args, + stat = do_mr_query("update_filesys", CountArgs(args), args, NullFunc, NULL); switch (stat) { - case SMS_NFS: + case MR_NFS: Put_message("That NFS filesystem is not exported."); if (YesNoQuestion("Fix this now (Y/N)")) { Do_menu(&nfsphys_menu, 0, NULL); if (YesNoQuestion("Retry filesystem update now (Y/N)")) { - if (stat = do_sms_query("update_filesys", CountArgs(args), args, + if (stat = do_mr_query("update_filesys", CountArgs(args), args, NullFunc, NULL)) com_err(program_name, stat, " filesystem not updated"); else @@ -404,7 +404,7 @@ Bool junk; } } break; - case SMS_SUCCESS: + case MR_SUCCESS: break; default: com_err(program_name, stat, " in UpdateFS"); @@ -449,25 +449,25 @@ int argc; if ( !ValidName(argv[1]) ) return(DM_NORMAL); - if ( (stat = do_sms_query("get_filesys_by_label", 1, argv + 1, + if ( (stat = do_mr_query("get_filesys_by_label", 1, argv + 1, NullFunc, NULL)) == 0) { Put_message ("A Filesystem by that name already exists."); return(DM_NORMAL); - } else if (stat != SMS_NO_MATCH) { + } else if (stat != MR_NO_MATCH) { com_err(program_name, stat, " in AddFS"); return(DM_NORMAL); } args = AskFSInfo(SetDefaults(info, argv[1]), FALSE ); - stat = do_sms_query("add_filesys", CountArgs(args), args, NullFunc, NULL); + stat = do_mr_query("add_filesys", CountArgs(args), args, NullFunc, NULL); switch (stat) { - case SMS_NFS: + case MR_NFS: Put_message("That NFS filesystem is not exported."); if (YesNoQuestion("Fix this now (Y/N)")) { Do_menu(&nfsphys_menu, 0, NULL); if (YesNoQuestion("Retry filesystem creation now (Y/N)")) { - if (stat = do_sms_query("add_filesys", CountArgs(args), args, + if (stat = do_mr_query("add_filesys", CountArgs(args), args, NullFunc, NULL)) com_err(program_name, stat, " in AddFS"); else @@ -475,22 +475,22 @@ int argc; } } break; - case SMS_SUCCESS: + case MR_SUCCESS: break; default: com_err(program_name, stat, " in AddFS"); } - if (stat == SMS_SUCCESS && !strcasecmp(info[FS_L_TYPE], "HOMEDIR")) { + if (stat == MR_SUCCESS && !strcasecmp(info[FS_L_TYPE], "HOMEDIR")) { static char *val[] = {"def_quota", NULL}; static char *def_quota = NULL; char *argv[3]; struct qelem *top = NULL; if (def_quota == NULL) { - stat = do_sms_query("get_value", CountArgs(val), val, + stat = do_mr_query("get_value", CountArgs(val), val, StoreInfo, (char *) &top); - if (stat != SMS_SUCCESS) { + if (stat != MR_SUCCESS) { com_err(program_name, stat, " getting default quota"); } else { top = QueueTop(top); @@ -504,8 +504,8 @@ int argc; if (YesNoQuestion(buf, 1)) { argv[Q_LOGIN] = argv[Q_FILESYS] = info[FS_NAME]; argv[Q_QUOTA] = def_quota; - if ((stat = do_sms_query("add_nfs_quota", 3, argv, Scream, - (char *) NULL)) != SMS_SUCCESS) { + if ((stat = do_mr_query("add_nfs_quota", 3, argv, Scream, + (char *) NULL)) != MR_SUCCESS) { com_err(program_name, stat, " while adding quota"); } } @@ -585,16 +585,16 @@ int argc; struct qelem *elem = NULL; char buf[BUFSIZ], *args[5], *bufp; - if ((stat = do_sms_query("get_fsgroup_members", 1, argv+1, StoreInfo, + if ((stat = do_mr_query("get_fsgroup_members", 1, argv+1, StoreInfo, (char *)&elem)) != 0) { - if (stat != SMS_NO_MATCH) + if (stat != MR_NO_MATCH) com_err(program_name, stat, " in AddFSToGroup"); } if (elem == NULL) { args[0] = argv[1]; args[1] = argv[2]; args[2] = "M"; - stat = do_sms_query("add_filesys_to_fsgroup", 3, args, Scream, NULL); + stat = do_mr_query("add_filesys_to_fsgroup", 3, args, Scream, NULL); if (stat) com_err(program_name, stat, " in AddFSToGroup"); return(DM_NORMAL); @@ -612,8 +612,8 @@ int argc; FreeQueue(QueueTop(elem)); args[0] = argv[1]; args[1] = argv[2]; - stat = do_sms_query("add_filesys_to_fsgroup", 3, args, Scream, NULL); - if (stat == SMS_EXISTS) { + stat = do_mr_query("add_filesys_to_fsgroup", 3, args, Scream, NULL); + if (stat == MR_EXISTS) { Put_message("That filesystem is already a member of the group."); Put_message("Use the order command if you want to change the sorting order."); } else if (stat) @@ -640,7 +640,7 @@ int argc; sprintf(buf, "Delete filesystem %s from FS group %s", argv[2], argv[1]); if (!Confirm(buf)) return(DM_NORMAL); - if ((stat = do_sms_query("remove_filesys_from_fsgroup", 2, argv+1, + if ((stat = do_mr_query("remove_filesys_from_fsgroup", 2, argv+1, Scream, NULL)) != 0) { com_err(program_name, stat, ", not removed."); } @@ -663,9 +663,9 @@ int argc; struct qelem *elem = NULL, *top; char buf[BUFSIZ], *bufp, *args[3]; - if ((stat = do_sms_query("get_fsgroup_members", 1, argv+1, StoreInfo, + if ((stat = do_mr_query("get_fsgroup_members", 1, argv+1, StoreInfo, (char *)&elem)) != 0) { - if (stat == SMS_NO_MATCH) { + if (stat == MR_NO_MATCH) { sprintf(buf, "Ether %s is not a filesystem group or it has no members", argv[1]); Put_message(buf); } else @@ -706,12 +706,12 @@ int argc; args[2] = SortAfter(top, dst); args[0] = argv[1]; args[1] = ((char **)elem->q_data)[0]; - if ((stat = do_sms_query("remove_filesys_from_fsgroup", 2, args, + if ((stat = do_mr_query("remove_filesys_from_fsgroup", 2, args, Scream, NULL)) != 0) { com_err(program_name, stat, " in ChangeFSGroupOrder"); return(DM_NORMAL); } - if ((stat = do_sms_query("add_filesys_to_fsgroup", 3, args, + if ((stat = do_mr_query("add_filesys_to_fsgroup", 3, args, Scream, NULL)) != 0) { com_err(program_name, stat, " in ChangeFSGroupOrder"); } @@ -776,7 +776,7 @@ char **argv; * print out values, free memory used and then exit. */ - if ( (stat = do_sms_query("get_alias", 3, args, StoreInfo, + if ( (stat = do_mr_query("get_alias", 3, args, StoreInfo, (char *)&elem)) == 0) { top = elem = QueueTop(elem); while (elem != NULL) { @@ -789,7 +789,7 @@ char **argv; FreeQueue(top); return(DM_NORMAL); } - else if ( stat != SMS_NO_MATCH) { + else if ( stat != MR_NO_MATCH) { com_err(program_name, stat, " in CreateFSAlias."); return(DM_NORMAL); } @@ -798,7 +798,7 @@ char **argv; GetValueFromUser("Which filesystem will this alias point to?", &args[ALIAS_TRANS]); - if ( (stat = do_sms_query("add_alias", 3, args, NullFunc, NULL)) != 0) + if ( (stat = do_mr_query("add_alias", 3, args, NullFunc, NULL)) != 0) com_err(program_name, stat, " in CreateFSAlias."); FreeInfo(args); @@ -829,7 +829,7 @@ Bool one_item; "Are you sure that you want to delete the filesystem alias %s", info[ALIAS_NAME]); if(!one_item || Confirm(temp_buf)) { - if ( (stat = do_sms_query("delete_alias", CountArgs(info), + if ( (stat = do_mr_query("delete_alias", CountArgs(info), info, Scream, NULL)) != 0 ) com_err(program_name, stat, " filesystem alias not deleted."); else diff --git a/clients/moira/cluster.c b/clients/moira/cluster.c index e1b9b380..4f8b77cf 100644 --- a/clients/moira/cluster.c +++ b/clients/moira/cluster.c @@ -2,8 +2,8 @@ static char rcsid_module_c[] = "$Header$"; #endif lint -/* This is the file cluster.c for the SMS Client, which allows a nieve - * user to quickly and easily maintain most parts of the SMS database. +/* This is the file cluster.c for the MOIRA Client, which allows a nieve + * user to quickly and easily maintain most parts of the MOIRA database. * It Contains: * * Created: 4/22/88 @@ -23,8 +23,8 @@ #include #include -#include -#include +#include +#include #include #include "mit-copyright.h" @@ -186,14 +186,14 @@ char * name1, *name2; switch (type) { case MACHINE: - if ( (stat = do_sms_query("get_machine", 1, &name1, + if ( (stat = do_mr_query("get_machine", 1, &name1, StoreInfo, (char *)&elem)) != 0) { com_err(program_name, stat, " in get_machine."); return(NULL); } break; case CLUSTER: - if ( (stat = do_sms_query("get_cluster", 1, &name1, + if ( (stat = do_mr_query("get_cluster", 1, &name1, StoreInfo, (char *)&elem)) != 0) { com_err(program_name, stat, " in get_cluster."); return(NULL); @@ -202,7 +202,7 @@ char * name1, *name2; case MAP: args[MAP_MACHINE] = name1; args[MAP_CLUSTER] = name2; - if ( (stat = do_sms_query("get_machine_to_cluster_map", 2, args, + if ( (stat = do_mr_query("get_machine_to_cluster_map", 2, args, StoreInfo, (char *)&elem)) != 0) { com_err(program_name, stat, " in get_machine_to_cluster_map."); return(NULL); @@ -211,7 +211,7 @@ char * name1, *name2; case DATA: args[CD_NAME] = name1; args[CD_LABEL] = name2; - if ( (stat = do_sms_query("get_cluster_data", 2, args, + if ( (stat = do_mr_query("get_cluster_data", 2, args, StoreInfo, (char *)&elem)) != 0) { com_err(program_name, stat, " in get_cluster_data."); return(NULL); @@ -349,12 +349,12 @@ char **argv; */ name = canonicalize_hostname(strsave(argv[1])); - if ( (stat = do_sms_query("get_machine", 1, &name, NullFunc, NULL)) == 0) { + if ( (stat = do_mr_query("get_machine", 1, &name, NullFunc, NULL)) == 0) { Put_message("This machine already exists."); free(name); return(DM_NORMAL); } - else if (stat != SMS_NO_MATCH) { + else if (stat != MR_NO_MATCH) { com_err(program_name, stat, " in AddMachine."); free(name); return(DM_NORMAL); @@ -366,7 +366,7 @@ char **argv; * Actually create the new Machine. */ - if ( (stat = do_sms_query("add_machine", CountArgs(args), + if ( (stat = do_mr_query("add_machine", CountArgs(args), args, Scream, NULL)) != 0) com_err(program_name, stat, " in AddMachine."); @@ -390,7 +390,7 @@ Bool junk; { register int stat; char ** args = AskMCDInfo(info, MACHINE, TRUE); - if ( (stat = do_sms_query("update_machine", CountArgs(args), + if ( (stat = do_mr_query("update_machine", CountArgs(args), args, Scream, NULL)) != 0) com_err(program_name, stat, " in UpdateMachine."); else @@ -426,7 +426,7 @@ char **argv; * and if so then removes it * Arguments: name - name of the machine (already Canonocalized). * ask_user- query the user before removing if from clusters? - * Returns: SMS_ERROR if machine left in a cluster, or sms_error. + * Returns: MR_ERROR if machine left in a cluster, or mr_error. */ int @@ -442,13 +442,13 @@ Bool ask_user; ret_value = SUB_NORMAL; /* initialize ret_value. */ args[0] = name; args[1] = "*"; - stat = do_sms_query("get_machine_to_cluster_map", 2, args, + stat = do_mr_query("get_machine_to_cluster_map", 2, args, StoreInfo, (char *)&elem); - if (stat && stat != SMS_NO_MATCH) { + if (stat && stat != MR_NO_MATCH) { com_err(program_name, stat, " in get_machine_to_cluster_map."); return(DM_NORMAL); } - if (stat == SMS_SUCCESS) { + if (stat == MR_SUCCESS) { elem = top = QueueTop(elem); if (ask_user) { sprintf(temp_buf, "%s is assigned to the following clusters.", @@ -470,7 +470,7 @@ Bool ask_user; if (delete_it) { while (elem != NULL) { char **info = (char **) elem->q_data; - if ( (stat = do_sms_query( "delete_machine_from_cluster", + if ( (stat = do_mr_query( "delete_machine_from_cluster", 2, info, Scream, NULL)) != 0) { ret_value = SUB_ERROR; com_err(program_name, stat, @@ -507,7 +507,7 @@ Bool one_machine; info[M_NAME]); if(!one_machine || Confirm(temp_buf)) { if (CheckAndRemoveFromCluster(info[M_NAME], TRUE) != SUB_ERROR) { - if ( (stat = do_sms_query("delete_machine", 1, + if ( (stat = do_mr_query("delete_machine", 1, &info[M_NAME], Scream, NULL)) != 0) { com_err(program_name, stat, " in DeleteMachine."); sprintf(temp_buf, "%s ** NOT ** deleted.", @@ -603,12 +603,12 @@ char ** argv; if (add_it) { args[0] = minfo[M_NAME]; args[1] = cinfo[C_NAME]; - stat = do_sms_query("add_machine_to_cluster", 2, args, + stat = do_mr_query("add_machine_to_cluster", 2, args, Scream, NULL); switch (stat) { - case SMS_SUCCESS: + case MR_SUCCESS: break; - case SMS_EXISTS: + case MR_EXISTS: sprintf(temp_buf, "%s is already in cluster %s", minfo[M_NAME], cinfo[C_NAME]); Put_message(temp_buf); @@ -648,7 +648,7 @@ Bool one_map; sprintf(temp_buf, "Remove %s from the cluster %s", info[MAP_MACHINE], info[MAP_CLUSTER]); if (!one_map || Confirm(temp_buf)) { - if ( (stat = do_sms_query("delete_machine_from_cluster", 2, + if ( (stat = do_mr_query("delete_machine_from_cluster", 2, info, Scream, NULL)) != 0 ) com_err(program_name, stat, " in delete_machine_from_cluster"); else { @@ -682,16 +682,16 @@ char ** argv; args[MAP_CLUSTER] = argv[2]; args[MAP_END] = NULL; - stat = do_sms_query("get_machine_to_cluster_map", CountArgs(args), args, + stat = do_mr_query("get_machine_to_cluster_map", CountArgs(args), args, StoreInfo, (char *)&elem); - if (stat == SMS_NO_MATCH) { + if (stat == MR_NO_MATCH) { sprintf(buf, "The machine %s is not is the cluster %s.", args[MAP_MACHINE], args[MAP_CLUSTER]); Put_message(buf); free(args[MAP_MACHINE]); return(DM_NORMAL); } - if (stat != SMS_SUCCESS) + if (stat != MR_SUCCESS) com_err(program_name, stat, " in delete_machine_from_cluster"); elem = QueueTop(elem); @@ -745,12 +745,12 @@ char ** argv; if (!ValidName(name)) return(DM_NORMAL); - if ( (stat = do_sms_query("get_cluster", 1, &name, - NullFunc, NULL)) == SMS_SUCCESS) { + if ( (stat = do_mr_query("get_cluster", 1, &name, + NullFunc, NULL)) == MR_SUCCESS) { Put_message("This cluster already exists."); return(DM_NORMAL); } - else if (stat != SMS_NO_MATCH) { + else if (stat != MR_NO_MATCH) { com_err(program_name, stat, " in AddCluster."); return(DM_NORMAL); } @@ -758,7 +758,7 @@ char ** argv; /* * Actually create the new Cluster. */ - if ( (stat = do_sms_query("add_cluster", CountArgs(args), + if ( (stat = do_mr_query("add_cluster", CountArgs(args), args, Scream, NULL)) != 0) com_err(program_name, stat, " in AddCluster."); @@ -781,7 +781,7 @@ Bool junk; { register int stat; char ** args = AskMCDInfo(info, CLUSTER, TRUE); - if ( (stat = do_sms_query("update_cluster", CountArgs(args), + if ( (stat = do_mr_query("update_cluster", CountArgs(args), args, Scream, NULL)) != 0) com_err(program_name, stat, " in UpdateCluster."); else @@ -830,9 +830,9 @@ Bool ask_first; ret_value = SUB_NORMAL; args[MAP_MACHINE] = "*"; args[MAP_CLUSTER] = name; - stat = do_sms_query("get_machine_to_cluster_map", 2, args, + stat = do_mr_query("get_machine_to_cluster_map", 2, args, StoreInfo, (char *)&elem); - if (stat && stat != SMS_NO_MATCH) { + if (stat && stat != MR_NO_MATCH) { com_err(program_name, stat, " in get_machine_to_cluster_map."); return(DM_NORMAL); } @@ -865,7 +865,7 @@ Bool ask_first; elem = top; while (elem != 0) { char **info = (char **) elem->q_data; - if ( (stat = do_sms_query("delete_machine_from_cluster", + if ( (stat = do_mr_query("delete_machine_from_cluster", 2, info, Scream, NULL)) != 0) { ret_value = SUB_ERROR; com_err(program_name, stat, @@ -903,7 +903,7 @@ Bool one_cluster; info[C_NAME]); if (!one_cluster || Confirm(temp_buf)) { if (CheckAndRemoveMachines(info[C_NAME], TRUE) != SUB_ERROR) { - if ( (stat = do_sms_query("delete_cluster", 1, + if ( (stat = do_mr_query("delete_cluster", 1, &info[C_NAME], Scream, NULL)) != 0) { com_err(program_name, stat, " in delete_cluster."); sprintf(temp_buf, "Cluster %s ** NOT ** deleted.", @@ -984,7 +984,7 @@ char ** argv; { int stat; - if( (stat = do_sms_query("add_cluster_data", 3, argv + 1, + if( (stat = do_mr_query("add_cluster_data", 3, argv + 1, Scream, (char *) NULL)) != 0) com_err(program_name, stat, " in AddClusterData."); @@ -1011,7 +1011,7 @@ Bool one_item; temp_ptr = "Are you sure that you want to remove this cluster data (y/n) ?"; PrintClusterData(info); if (!one_item || Confirm(temp_ptr)) { - if( (stat = do_sms_query("delete_cluster_data", 3, info, + if( (stat = do_mr_query("delete_cluster_data", 3, info, Scream, (char *) NULL)) != 0) { com_err(program_name, stat, " in DeleteClusterData."); Put_message("Data not removed."); diff --git a/clients/moira/dcmmaint.c b/clients/moira/dcmmaint.c index fbdb7b78..02fa8068 100644 --- a/clients/moira/dcmmaint.c +++ b/clients/moira/dcmmaint.c @@ -8,8 +8,8 @@ #include #include #include -#include -#include +#include +#include #include #include "mit-copyright.h" @@ -30,7 +30,7 @@ char **argv; char **info; { info[1] = strsave(argv[0]); - return(SMS_CONT); + return(MR_CONT); } EnableDcm(argc, argv) @@ -41,10 +41,10 @@ char **argv; char *info[3]; info[0] = "dcm_enable"; - if (status = do_sms_query("get_value", 1, info, genable, info)) + if (status = do_mr_query("get_value", 1, info, genable, info)) com_err(whoami, status, " while getting value of dcm_enable"); GetValueFromUser("Enable value", &info[1]); - if (status = do_sms_query("update_value", 2, info, Scream, NULL)) + if (status = do_mr_query("update_value", 2, info, Scream, NULL)) com_err(whoami, status, " while updating value of dcm_enable"); FreeAndClear(&info[0], FALSE); FreeAndClear(&info[1], TRUE); @@ -81,7 +81,7 @@ char **argv; atoi(argv[SVC_INPROGRESS]) ? "InProgress" : "Idle", tmp); Put_message(buf); Put_message(""); - return(SMS_CONT); + return(MR_CONT); } @@ -93,7 +93,7 @@ char **argv; int status; qargv[0] = argv[1]; - if (status = do_sms_query("get_server_info", 1, qargv, shserv, NULL)) + if (status = do_mr_query("get_server_info", 1, qargv, shserv, NULL)) com_err(whoami, status, " while getting server info"); return(DM_NORMAL); } @@ -117,7 +117,7 @@ char **argv; initserv(argv[1], info); askserv(info); - if (status = do_sms_query("add_server_info", 8, info, Scream, NULL)) + if (status = do_mr_query("add_server_info", 8, info, Scream, NULL)) com_err(whoami, status, " while updating server info"); FreeInfo(info); return(DM_NORMAL); @@ -151,7 +151,7 @@ char **cargv; cargv[SC_ACE_TYPE] = strsave(argv[SVC_ACE_TYPE]); cargv[SC_ACE_NAME] = strsave(argv[SVC_ACE_NAME]); cargv[SC_END] = NULL; - return(SMS_CONT); + return(MR_CONT); } initserv(name, argv) @@ -164,7 +164,7 @@ char **argv; argv[SC_INTERVAL] = strsave("1440"); sprintf(tmp, "/tmp/%s.out", name); argv[SC_TARGET] = strsave(tmp); - sprintf(tmp, "/u1/sms/bin/%s.sh", name); + sprintf(tmp, "/u1/mr/bin/%s.sh", name); argv[SC_SCRIPT] = strsave(tmp); argv[SC_TYPE] = strsave("UNIQUE"); argv[SC_ENABLE] = strsave("1"); @@ -182,13 +182,13 @@ char **argv; int status; qargv[0] = (char *)argv[1]; - if (status = do_sms_query("get_server_info", 1, + if (status = do_mr_query("get_server_info", 1, qargv, gserv, (char *)qargv)) { com_err(whoami, status, " while getting server info"); return(DM_NORMAL); } askserv(qargv); - if (status = do_sms_query("update_server_info", 8, qargv, Scream, NULL)) + if (status = do_mr_query("update_server_info", 8, qargv, Scream, NULL)) com_err(whoami, status, " while updating server info"); return(DM_NORMAL); } @@ -221,7 +221,7 @@ char **argv; free(ltt); Put_message(buf); Put_message(""); - return(SMS_CONT); + return(MR_CONT); } @@ -234,7 +234,7 @@ char **argv; qargv[SHI_SERVICE] = argv[1]; qargv[SHI_MACHINE] = canonicalize_hostname(argv[2]); - if (status = do_sms_query("get_server_host_info", 2, qargv, shhost, NULL)) + if (status = do_mr_query("get_server_host_info", 2, qargv, shhost, NULL)) com_err(whoami, status, " getting server/host info"); return(DM_NORMAL); } @@ -245,7 +245,7 @@ int argc; char **argv; { int status; - if (status = do_sms_query("reset_server_error", 1, &argv[1], Scream, NULL)) + if (status = do_mr_query("reset_server_error", 1, &argv[1], Scream, NULL)) com_err(whoami, status, " while resetting server error"); return(DM_NORMAL); } @@ -267,7 +267,7 @@ char **argv; qargv[3] = "0"; qargv[4] = "0"; qargv[5] = ""; - if (status = do_sms_query("set_server_internal_flags", 6, qargv, + if (status = do_mr_query("set_server_internal_flags", 6, qargv, Scream, NULL)) com_err(whoami, status, " while resetting server error"); return(DM_NORMAL); @@ -281,7 +281,7 @@ char **argv; int status; argv[2] = canonicalize_hostname(argv[2]); - if (status = do_sms_query("reset_server_host_error", 2, &argv[1], + if (status = do_mr_query("reset_server_host_error", 2, &argv[1], Scream, NULL)) com_err(whoami, status, " while resetting server/host error"); return(DM_NORMAL); @@ -308,7 +308,7 @@ char **argv; qargv[6] = ""; qargv[7] = "0"; qargv[8] = "0"; - if (status = do_sms_query("set_server_host_internal", 9, qargv, + if (status = do_mr_query("set_server_host_internal", 9, qargv, Scream, NULL)) com_err(whoami, status, " while resetting server/host error"); return(DM_NORMAL); @@ -322,7 +322,7 @@ char **argv; int status; argv[2] = canonicalize_hostname(argv[2]); - if (status = do_sms_query("set_server_host_override", 2, &argv[1], + if (status = do_mr_query("set_server_host_override", 2, &argv[1], Scream, NULL)) com_err(whoami, status, " while setting server/host override"); return(DM_NORMAL); @@ -341,7 +341,7 @@ char **cargv; cargv[SHI_VALUE2] = strsave(argv[SH_VALUE2]); cargv[SHI_VALUE3] = strsave(argv[SH_VALUE3]); cargv[SHI_END] = NULL; - return(SMS_CONT); + return(MR_CONT); } @@ -376,13 +376,13 @@ char **argv; info[SHI_SERVICE] = strsave(argv[1]); info[SHI_MACHINE] = strsave(canonicalize_hostname(argv[2])); - if (status = do_sms_query("get_server_host_info", 2, info, ghost, + if (status = do_mr_query("get_server_host_info", 2, info, ghost, (char *)info)) { com_err(whoami, status, " while getting server/host info"); return(DM_NORMAL); } askhost(info); - if (status = do_sms_query("update_server_host_info", SHI_END, info, + if (status = do_mr_query("update_server_host_info", SHI_END, info, Scream, NULL)) com_err(whoami, status, " while updating server/host info"); FreeInfo(info); @@ -401,7 +401,7 @@ char **argv; info[SHI_MACHINE] = strsave(canonicalize_hostname(argv[2])); inithost(info); askhost(info); - if (status = do_sms_query("add_server_host_info", 6, info, Scream, NULL)) + if (status = do_mr_query("add_server_host_info", 6, info, Scream, NULL)) com_err(whoami, status, " while adding server/host info"); FreeInfo(info); return(DM_NORMAL); @@ -414,7 +414,7 @@ char **argv; { int status; - if (status = do_sms_query("delete_server_info", 1, &argv[1], Scream, NULL)) + if (status = do_mr_query("delete_server_info", 1, &argv[1], Scream, NULL)) com_err(whoami, status, " while deleting server info"); return(DM_NORMAL); } @@ -427,7 +427,7 @@ char **argv; int status; argv[2] = canonicalize_hostname(argv[2]); - if (status = do_sms_query("delete_server_host_info", 2, &argv[1], + if (status = do_mr_query("delete_server_host_info", 2, &argv[1], Scream, NULL)) com_err(whoami, status, " while deleting server/host info"); return(DM_NORMAL); @@ -442,7 +442,7 @@ int *count; sprintf(buf, "Service %s", argv[0]); Put_message(buf); (*count)++; - return(SMS_CONT); + return(MR_CONT); } phost(argc, argv, count) @@ -453,7 +453,7 @@ int *count; sprintf(buf, "Host %s:%s", argv[0], argv[1]); Put_message(buf); (*count)++; - return(SMS_CONT); + return(MR_CONT); } @@ -464,16 +464,16 @@ InProgress() argv[0] = argv[2] = "DONTCARE"; argv[1] = "TRUE"; - if ((status = do_sms_query("qualified_get_server", 3, argv, pserv, + if ((status = do_mr_query("qualified_get_server", 3, argv, pserv, (char *)&count)) && - status != SMS_NO_MATCH) + status != MR_NO_MATCH) com_err(whoami, status, " while getting servers"); argv[0] = "*"; argv[1] = argv[2] = argv[3] = argv[5] = "DONTCARE"; argv[4] = "TRUE"; - if ((status = do_sms_query("qualified_get_server_host",6,argv,phost, + if ((status = do_mr_query("qualified_get_server_host",6,argv,phost, (char *)&count)) && - status != SMS_NO_MATCH) + status != MR_NO_MATCH) com_err(whoami, status, " while getting server/hosts"); if (!count) strcpy(buf, "Nothing is in progress at this time"); @@ -491,16 +491,16 @@ DcmFailed() argv[0] = argv[1] = "DONTCARE"; argv[2] = "TRUE"; - if ((status = do_sms_query("qualified_get_server", 3, argv, pserv, + if ((status = do_mr_query("qualified_get_server", 3, argv, pserv, (char *)&count)) && - status != SMS_NO_MATCH) + status != MR_NO_MATCH) com_err(whoami, status, " while getting servers"); argv[0] = "*"; argv[1] = argv[2] = argv[3] = argv[4] = "DONTCARE"; argv[5] = "TRUE"; - if ((status = do_sms_query("qualified_get_server_host",6,argv,phost, + if ((status = do_mr_query("qualified_get_server_host",6,argv,phost, (char *)&count)) && - status != SMS_NO_MATCH) + status != MR_NO_MATCH) com_err(whoami, status, " while getting server/hosts"); if (!count) strcpy(buf, "Nothing has failed at this time"); @@ -515,7 +515,7 @@ DcmFailed() Dcm() { int status; - if (status = sms_do_update()) + if (status = mr_do_update()) com_err(whoami, status, " while triggering update"); return(DM_NORMAL); } diff --git a/clients/moira/delete.c b/clients/moira/delete.c index d95817cd..3ae3a53d 100644 --- a/clients/moira/delete.c +++ b/clients/moira/delete.c @@ -2,8 +2,8 @@ static char rcsid_module_c[] = "$Header$"; #endif lint -/* This is the file delete.c for the SMS Client, which allows a nieve - * user to quickly and easily maintain most parts of the SMS database. +/* This is the file delete.c for the MOIRA Client, which allows a nieve + * user to quickly and easily maintain most parts of the MOIRA database. * It Contains: functions for deleting users and lists. * * Created: 5/18/88 @@ -21,8 +21,8 @@ #include #include -#include -#include +#include +#include #include #include "mit-copyright.h" @@ -47,7 +47,7 @@ Bool verbose; int status; char *args[2], buf[BUFSIZ], **info; - if ( (status = do_sms_query("count_members_of_list", 1, &name, StoreInfo, + if ( (status = do_mr_query("count_members_of_list", 1, &name, StoreInfo, (char *) &elem)) != 0) { com_err(program_name, status, " in DeleteList (count_members_of_list)."); @@ -91,8 +91,8 @@ Bool verbose; args[0] = type; args[1] = name; - status = do_sms_query("get_ace_use", 2, args, NullFunc, (char *) NULL); - if (status != SMS_NO_MATCH) + status = do_mr_query("get_ace_use", 2, args, NullFunc, (char *) NULL); + if (status != MR_NO_MATCH) return; /* If this query fails the ace will not be deleted even if it is empty. */ if (verbose) { @@ -133,11 +133,11 @@ Bool verbose; args[0] = type; args[1] = name; - switch (status = do_sms_query("get_ace_use", 2, args, + switch (status = do_mr_query("get_ace_use", 2, args, StoreInfo, (char *) &elem)) { - case SMS_NO_MATCH: + case MR_NO_MATCH: return(DM_NORMAL); - case SMS_SUCCESS: + case MR_SUCCESS: local = elem = QueueTop(elem); info = (char **) local->q_data; if (QueueCount(elem) == 1 && @@ -202,13 +202,13 @@ int verbose; * Get all list of which this item is a member, and store them in a queue. */ - status = do_sms_query("get_lists_of_member", 2, args, StoreInfo, + status = do_mr_query("get_lists_of_member", 2, args, StoreInfo, (char *) elem); - if (status == SMS_NO_MATCH) + if (status == MR_NO_MATCH) return(SUB_NORMAL); - if (status != SMS_SUCCESS) { + if (status != MR_SUCCESS) { com_err(program_name, status, " in DeleteList (get_lists_of_member)."); return(SUB_ERROR); } @@ -251,7 +251,7 @@ int verbose; while (local != NULL) { char ** info = (char **) local->q_data; args[DM_LIST] = info[GLOM_NAME]; - if ( (status = do_sms_query("delete_member_from_list", + if ( (status = do_mr_query("delete_member_from_list", 3, args, Scream, NULL)) != 0) { com_err(program_name, status, " in delete_member\nAborting\n"); FreeQueue(*elem); @@ -280,9 +280,9 @@ Bool verbose; /* * Get the members of this list. */ - status = do_sms_query("get_members_of_list", 1, &name, StoreInfo, + status = do_mr_query("get_members_of_list", 1, &name, StoreInfo, (char *) &elem); - if (status == SMS_NO_MATCH) + if (status == MR_NO_MATCH) return(SUB_NORMAL); if (status != 0) { @@ -324,7 +324,7 @@ Bool verbose; char ** info = (char **) local->q_data; args[1] = info[0]; args[2] = info[1]; - if ( (status = do_sms_query("delete_member_from_list", + if ( (status = do_mr_query("delete_member_from_list", 3, args, Scream, NULL)) != 0) { com_err(program_name, status, " in delete_member\nAborting\n"); FreeQueue(elem); @@ -341,7 +341,7 @@ Bool verbose; * Arguments: name - the name of the list to delete. * verbose - flag that if TRUE queries the user to * ask if list should be deleted. - * Returns: SMS_ERROR if there is an error. + * Returns: MR_ERROR if there is an error. */ int @@ -352,7 +352,7 @@ Bool verbose; int status, ans; char buf[BUFSIZ], *args[10]; - status = do_sms_query("get_list_info", 1, &name, NullFunc, (char *) NULL); + status = do_mr_query("get_list_info", 1, &name, NullFunc, (char *) NULL); if (status == 0) { if (verbose) { sprintf(buf, "There is also a list named %s, delete it?", name); @@ -371,7 +371,7 @@ Bool verbose; args[1] = name; DeleteList(2, args); } - else if (status != SMS_NO_MATCH) { + else if (status != MR_NO_MATCH) { com_err(program_name, status, " Aborting Delete User."); return(SUB_ERROR); } @@ -393,11 +393,11 @@ Bool verbose; int status; char buf[BUFSIZ]; - switch (status = do_sms_query("get_filesys_by_label", 1, &name, NullFunc, + switch (status = do_mr_query("get_filesys_by_label", 1, &name, NullFunc, (char *) NULL)) { - case SMS_NO_MATCH: + case MR_NO_MATCH: break; - case SMS_SUCCESS: + case MR_SUCCESS: if (verbose) { sprintf(buf, "Delete the filesystem named %s (y/n)?", name); switch (YesNoQuestion(buf, FALSE)) { @@ -411,8 +411,8 @@ Bool verbose; return(SUB_ERROR); } } - if ( (status = do_sms_query("delete_filesys", 1, &name, Scream, - (char *) NULL) ) != SMS_SUCCESS) { + if ( (status = do_mr_query("delete_filesys", 1, &name, Scream, + (char *) NULL) ) != MR_SUCCESS) { com_err(program_name, status, " in delete_filesys."); return(SUB_ERROR); } @@ -439,8 +439,8 @@ char * name; char buf[BUFSIZ]; int status; - if ( (status = do_sms_query("delete_user", 1, &name, Scream, - (char *) NULL)) != SMS_SUCCESS) { + if ( (status = do_mr_query("delete_user", 1, &name, Scream, + (char *) NULL)) != MR_SUCCESS) { com_err(program_name, status, ": user not deleted"); return(SUB_ERROR); } @@ -462,8 +462,8 @@ char * name; char buf[BUFSIZ]; int status; - if ( (status = do_sms_query("delete_list", 1, &name, Scream, - (char *) NULL)) != SMS_SUCCESS) { + if ( (status = do_mr_query("delete_list", 1, &name, Scream, + (char *) NULL)) != MR_SUCCESS) { com_err(program_name, status, ": list not deleted"); return(SUB_ERROR); } @@ -502,13 +502,13 @@ Bool ask_first; * 3) This list is not an ace of another object. */ - switch (status = do_sms_query("delete_list", 1, &name, + switch (status = do_mr_query("delete_list", 1, &name, Scream, (char *) NULL)) { - case SMS_SUCCESS: + case MR_SUCCESS: Put_message("List Sucessfully Deleted."); CheckAce(list_info[L_ACE_TYPE], list_info[L_ACE_NAME], ask_first); break; - case SMS_IN_USE: + case MR_IN_USE: /* * This list is in use. Try to find out why, * and for the cases where we have a good idea of @@ -530,9 +530,9 @@ Bool ask_first; list_info[L_ACE_TYPE] = Strsave("USER"); list_info[L_ACE_NAME] = Strsave(user); SlipInNewName(list_info, Strsave(list_info[L_NAME])); - if ((status = do_sms_query("update_list", CountArgs(list_info)-3, + if ((status = do_mr_query("update_list", CountArgs(list_info)-3, list_info, Scream, (char *) NULL)) - != SMS_SUCCESS) { + != MR_SUCCESS) { com_err(program_name, status, " while updating list owner"); Put_message("List may be only partly deleted."); } @@ -559,7 +559,7 @@ Bool ask_first; /* Function Name: DeleteList * Description: deletes a list - * Arguments: argc, argv - standard SMS argc and argv. + * Arguments: argc, argv - standard MR argc and argv. * Returns: DM Status Code. */ @@ -576,15 +576,15 @@ char *argv[]; list = NULL; - switch(status = do_sms_query("get_list_info", 1, argv + 1, + switch(status = do_mr_query("get_list_info", 1, argv + 1, StoreInfo, (char *) &list)){ - case SMS_SUCCESS: + case MR_SUCCESS: break; -/* case SMS_NO_WILDCARD: +/* case MR_NO_WILDCARD: Put_message("Wildcards are not accepted here."); return(DM_NORMAL); -*/ case SMS_NO_MATCH: - case SMS_LIST: +*/ case MR_NO_MATCH: + case MR_LIST: Put_message("There is no list that matches that name."); return(DM_NORMAL); default: @@ -644,8 +644,8 @@ char ** argv; if (!Confirm("Are you sure that you want to delete this user?")) return(DM_NORMAL); - status = do_sms_query("delete_user", 1, &name, Scream, (char *) NULL); - if (status != SMS_IN_USE && status != 0) { + status = do_mr_query("delete_user", 1, &name, Scream, (char *) NULL); + if (status != MR_IN_USE && status != 0) { com_err(program_name, status, ": user not deleted"); return(DM_NORMAL); } @@ -660,7 +660,7 @@ char ** argv; Put_message("Sorry, registered users cannot be deleted from the database."); Put_message("Deactivate the user now, and the system manager will expunge later."); #ifdef notdef - else if (status == SMS_IN_USE) { + else if (status == MR_IN_USE) { /* * Check: diff --git a/clients/moira/globals.c b/clients/moira/globals.c index f11471e3..25a0d134 100644 --- a/clients/moira/globals.c +++ b/clients/moira/globals.c @@ -2,8 +2,8 @@ static char rcsid_module_c[] = "$Header$"; #endif lint -/* This is the file globals.c for the SMS Client, which allows a nieve - * user to quickly and easily maintain most parts of the SMS database. +/* This is the file globals.c for the Moira Client, which allows a nieve + * user to quickly and easily maintain most parts of the Moira database. * It Contains: globals variable definitions. * * Created: 4/12/88 diff --git a/clients/moira/lists.c b/clients/moira/lists.c index b663333b..3c54ca75 100644 --- a/clients/moira/lists.c +++ b/clients/moira/lists.c @@ -2,8 +2,8 @@ static char rcsid_module_c[] = "$Header$"; #endif lint -/* This is the file lists.c for the SMS Client, which allows a nieve - * user to quickly and easily maintain most parts of the SMS database. +/* This is the file lists.c for the MOIRA Client, which allows a nieve + * user to quickly and easily maintain most parts of the MOIRA database. * It Contains: All list manipulation functions, except delete. * * Created: 4/12/88 @@ -21,8 +21,8 @@ #include #include -#include -#include +#include +#include #include #include "mit-copyright.h" @@ -132,7 +132,7 @@ char * name1, *name2; switch(type) { case LIST: args[0] = name1; - if ( (status = do_sms_query("get_list_info", 1, args, + if ( (status = do_mr_query("get_list_info", 1, args, StoreInfo, (char *) &elem)) != 0) { com_err(program_name, status, " in get_list_info"); return (NULL); @@ -140,7 +140,7 @@ char * name1, *name2; break; case MEMBERS: args[0] = name1; - if ( (status = do_sms_query("get_members_of_list", 1, args, + if ( (status = do_mr_query("get_members_of_list", 1, args, StoreInfo, (char *) &elem)) != 0) { com_err(program_name, status, " in get_members_of_list"); return (NULL); @@ -149,7 +149,7 @@ char * name1, *name2; case GLOM: args[0] = name1; args[1] = name2; - if ( (status = do_sms_query("get_lists_of_member", 2, args, + if ( (status = do_mr_query("get_lists_of_member", 2, args, StoreInfo, (char *) &elem)) != 0) { com_err(program_name, status, " in get_list_of_members"); return (NULL); @@ -158,7 +158,7 @@ char * name1, *name2; case ACE_USE: args[0] = name1; args[1] = name2; - if ( (status = do_sms_query("get_ace_use", 2, args, + if ( (status = do_mr_query("get_ace_use", 2, args, StoreInfo, (char *) &elem)) != 0) { com_err(program_name, status, " in get_ace_use"); return (NULL); @@ -270,8 +270,8 @@ Bool junk; char ** args; args = AskListInfo(info, TRUE); - if ( (stat = do_sms_query("update_list", CountArgs(args), args, - Scream, (char *) NULL)) != SMS_SUCCESS) { + if ( (stat = do_mr_query("update_list", CountArgs(args), args, + Scream, (char *) NULL)) != MR_SUCCESS) { com_err(program_name, stat, " in UpdateList."); Put_message("List ** NOT ** Updated."); } @@ -343,10 +343,10 @@ char **argv; if (!ValidName(argv[1])) return(DM_NORMAL); - status = do_sms_query("get_list_info", 1, argv + 1, NullFunc, + status = do_mr_query("get_list_info", 1, argv + 1, NullFunc, (char *) NULL); - if (status != SMS_NO_MATCH) { - if (status == SMS_SUCCESS) + if (status != MR_NO_MATCH) { + if (status == MR_SUCCESS) Put_message("This list already exists."); else com_err(program_name, status, " in AddList."); @@ -355,8 +355,8 @@ char **argv; add_args = AskListInfo(SetDefaults(info,argv[1]), FALSE); - if ( (status = do_sms_query("add_list", CountArgs(add_args), add_args, - Scream, (char *) NULL)) != SMS_SUCCESS) { + if ( (status = do_mr_query("add_list", CountArgs(add_args), add_args, + Scream, (char *) NULL)) != MR_SUCCESS) { com_err(program_name, status, " in AddList."); Put_message("List Not Created."); ret_code = SUB_ERROR; @@ -426,14 +426,14 @@ char **argv; } else /* All we want to know is if it exists. */ - switch( (stat = do_sms_query("count_members_of_list", 1, argv + 1, + switch( (stat = do_mr_query("count_members_of_list", 1, argv + 1, NullFunc, (char *) NULL))) { - case SMS_SUCCESS: + case MR_SUCCESS: break; - case SMS_LIST: + case MR_LIST: Put_message("This list does not exist."); return(DM_QUIT); - case SMS_PERM: + case MR_PERM: Put_message("You are not allowed to view this list."); break; default: @@ -483,7 +483,7 @@ char * type; args[1] = NULL; found_some = FALSE; - if ( (status = do_sms_query("get_members_of_list", CountArgs(args), args, + if ( (status = do_mr_query("get_members_of_list", CountArgs(args), args, PrintByType, type)) != 0) { com_err(program_name, status, " in ListMembersByType"); return(DM_NORMAL); @@ -596,9 +596,9 @@ AddMember() if ( GetMemberInfo("add", args) == SUB_ERROR ) return(DM_NORMAL); - if ( (status = do_sms_query("add_member_to_list", CountArgs(args), args, - Scream, NULL)) != SMS_SUCCESS) { - if (status == SMS_EXISTS) { + if ( (status = do_mr_query("add_member_to_list", CountArgs(args), args, + Scream, NULL)) != MR_SUCCESS) { + if (status == MR_EXISTS) { sprintf(temp_buf, "The %s %s is already a member of LIST %s.", args[LM_TYPE], args[LM_MEMBER], args[LM_LIST]); Put_message(temp_buf); @@ -627,7 +627,7 @@ DeleteMember() return(DM_NORMAL); if (Confirm("Are you sure you want to delete this member?") ) { - if (status = do_sms_query("delete_member_from_list", CountArgs(args), + if (status = do_mr_query("delete_member_from_list", CountArgs(args), args, Scream, NULL)) com_err(program_name, status, " in DeleteMember"); else @@ -681,7 +681,7 @@ InterRemoveItemFromLists() args[DM_LIST] = info[GLOM_NAME]; args[DM_TYPE] = type; args[DM_MEMBER] = name; - if ( (status = do_sms_query("delete_member_from_list", 3, args, + if ( (status = do_mr_query("delete_member_from_list", 3, args, Scream, (char *) NULL)) != 0) /* should probabally check to delete list. */ com_err(program_name, status, " in delete_member"); @@ -803,7 +803,7 @@ ListAllGroups() if (YesNoQuestion("This query will take a while, Do you wish to continue?", TRUE) == TRUE ) - if (status = do_sms_query("qualified_get_lists", 5, args, + if (status = do_mr_query("qualified_get_lists", 5, args, Print, (char *) NULL) != 0) com_err(program_name, status, " in ListAllGroups"); return (DM_NORMAL); @@ -828,7 +828,7 @@ ListAllMailLists() if (YesNoQuestion("This query will take a while. Do you wish to continue?", TRUE) == TRUE ) - if (status = do_sms_query("qualified_get_lists", 5, args, + if (status = do_mr_query("qualified_get_lists", 5, args, Print, (char *) NULL) != 0) com_err(program_name, status, " in ListAllGroups"); @@ -854,7 +854,7 @@ ListAllPublicMailLists() if (YesNoQuestion("This query will take a while. Do you wish to continue?", TRUE) == TRUE ) - if (status = do_sms_query("qualified_get_lists", 5, args, + if (status = do_mr_query("qualified_get_lists", 5, args, Print, (char *) NULL) != 0) com_err(program_name, status, " in ListAllGroups"); diff --git a/clients/moira/main.c b/clients/moira/main.c index 6dfc6176..539c15c9 100644 --- a/clients/moira/main.c +++ b/clients/moira/main.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include "mit-copyright.h" @@ -35,7 +35,7 @@ char * whoami; /* used by menu.c ugh!!! */ char * moira_server; -extern Menu sms_top_menu, list_menu, user_menu, dcm_menu; +extern Menu moira_top_menu, list_menu, user_menu, dcm_menu; #ifndef DEBUG static void SignalHandler(); @@ -93,19 +93,19 @@ main(argc, argv) } } - if ( status = sms_connect(moira_server) ) + if ( status = mr_connect(moira_server) ) ErrorExit("\nConnection to Moira server failed", status); - if ( status = sms_motd(&motd) ) + if ( status = mr_motd(&motd) ) ErrorExit("\nUnable to check server status", status); if (motd) { fprintf(stderr, "The Moira server is currently unavailable:\n%s\n", motd); - sms_disconnect(); + mr_disconnect(); exit(1); } - if ( status = sms_auth(program_name) ) { - if (status == SMS_USER_AUTH) { + if ( status = mr_auth(program_name) ) { + if (status == MR_USER_AUTH) { char buf[BUFSIZ]; com_err(program_name, status, "\nPress [RETURN] to continue"); gets(buf); @@ -131,7 +131,7 @@ main(argc, argv) else if (!strcmp(program_name, "dcmmaint")) menu = &dcm_menu; else - menu = &sms_top_menu; + menu = &moira_top_menu; if (use_menu) { /* Start menus that execute program */ Start_paging(); @@ -141,7 +141,7 @@ main(argc, argv) else /* Start program without menus. */ Start_no_menu(menu); - sms_disconnect(); + mr_disconnect(); exit(0); } @@ -158,7 +158,7 @@ int status; char * buf; { com_err(program_name, status, buf); - sms_disconnect(); + mr_disconnect(); exit(1); } @@ -188,7 +188,7 @@ SignalHandler() Put_message("Signal caught - exiting"); if (use_menu) Cleanup_menu(); - sms_disconnect(); + mr_disconnect(); exit(1); } #endif DEBUG diff --git a/clients/moira/menus.c b/clients/moira/menus.c index 80dacd40..13d88b90 100644 --- a/clients/moira/menus.c +++ b/clients/moira/menus.c @@ -2,8 +2,8 @@ static char rcsid_module_c[] = "$Header$"; #endif lint -/* This is the file menus.c for the SMS Client, which allows a nieve - * user to quickly and easily maintain most parts of the SMS database. +/* This is the file menus.c for the MOIRA Client, which allows a nieve + * user to quickly and easily maintain most parts of the MOIRA database. * It Contains: All menu definitions. * * Created: 4/11/88 @@ -667,10 +667,10 @@ Menu misc_menu = { /* ------------------------- Root Menu ------------------------- */ /* - * Sms top menu + * Moira top menu */ -Menu sms_top_menu = { +Menu moira_top_menu = { NULLFUNC, NULLFUNC, "Moira Database Manipulation", diff --git a/clients/moira/misc.c b/clients/moira/misc.c index 3c9c4d1f..6494cc18 100644 --- a/clients/moira/misc.c +++ b/clients/moira/misc.c @@ -1,5 +1,5 @@ -/* This is the file misc.c for the SMS Client, which allows a naieve - * user to quickly and easily maintain most parts of the SMS database. +/* This is the file misc.c for the MOIRA Client, which allows a naieve + * user to quickly and easily maintain most parts of the MOIRA database. * It Contains: * TableStats * ShowClients @@ -20,8 +20,8 @@ #include #include -#include -#include +#include +#include #include #include #include @@ -54,7 +54,7 @@ char **info; /* Function Name: TableStats - * Description: display the SMS table statistics + * Description: display the MOIRA table statistics * Arguments: NONE * Returns: DM_NORMAL */ @@ -64,7 +64,7 @@ int TableStats() int status; struct qelem *elem = NULL; - if (status = do_sms_query("get_all_table_stats", 0, NULL, + if (status = do_mr_query("get_all_table_stats", 0, NULL, StoreInfo, (char *)&elem)) { com_err(program_name, status, " in TableStats"); return(DM_NORMAL); @@ -103,7 +103,7 @@ char **info; /* Function Name: ShowClients - * Description: show clients actively using SMS + * Description: show clients actively using MR * Arguments: NONE * Returns: DM_NORMAL */ @@ -113,7 +113,7 @@ int ShowClients() int status; struct qelem *elem = NULL; - if (status = do_sms_query("_list_users", 0, NULL, + if (status = do_mr_query("_list_users", 0, NULL, StoreInfo, (char *) &elem)) { com_err(program_name, status, " in ShowClients"); return(DM_NORMAL); @@ -140,7 +140,7 @@ char **info; /* Function Name: ShowValue - * Description: get a variable value from SMS + * Description: get a variable value from MR * Arguments: variable name * Returns: DM_NORMAL */ @@ -152,7 +152,7 @@ char **argv; int status; struct qelem *elem = NULL; - if (status = do_sms_query("get_value", 1, &argv[1], + if (status = do_mr_query("get_value", 1, &argv[1], StoreInfo, (char *) &elem)) { com_err(program_name, status, " in ShowValue"); return(DM_NORMAL); @@ -196,7 +196,7 @@ char **argv; info[0] = argv[1]; info[1] = argv[2]; info[2] = "*"; - if (status = do_sms_query("get_alias", 3, info, + if (status = do_mr_query("get_alias", 3, info, StoreInfo, (char *) &elem)) { com_err(program_name, status, " in ShowAlias"); return(DM_NORMAL); diff --git a/clients/moira/nfs.c b/clients/moira/nfs.c index be915437..6a814174 100644 --- a/clients/moira/nfs.c +++ b/clients/moira/nfs.c @@ -2,8 +2,8 @@ static char rcsid_module_c[] = "$Header$"; #endif lint -/* This is the file nfs.c for the SMS Client, which allows a nieve - * user to quickly and easily maintain most parts of the SMS database. +/* This is the file nfs.c for the MOIRA Client, which allows a nieve + * user to quickly and easily maintain most parts of the MOIRA database. * It Contains: All functions for manipulating NFS Physical directories. * * Created: 5/6/88 @@ -21,8 +21,8 @@ #include #include -#include -#include +#include +#include #include #include "mit-copyright.h" @@ -73,23 +73,23 @@ char ** info; status_buf[0] = '\0'; /* clear string. */ - if (status & SMS_FS_STUDENT) { + if (status & MR_FS_STUDENT) { strcat(status_buf, "Student"); is_one = TRUE; } - if (status & SMS_FS_FACULTY) { + if (status & MR_FS_FACULTY) { if (is_one) strcat(status_buf, " and "); strcat(status_buf, "Faculty"); is_one = TRUE; } - if (status & SMS_FS_STAFF) { + if (status & MR_FS_STAFF) { if (is_one) strcat(status_buf, " and "); strcat(status_buf, "Staff"); is_one = TRUE; } - if (status & SMS_FS_MISC) { + if (status & MR_FS_MISC) { if (is_one) strcat(status_buf, " and "); strcat(status_buf, "Miscellaneous"); @@ -178,8 +178,8 @@ char **argv; if ( (args[1] = GetDirName()) == NULL) return(DM_NORMAL); - if ( (stat = do_sms_query("get_nfsphys", 2, args, - StoreInfo, (char *) &elem)) != SMS_SUCCESS) + if ( (stat = do_mr_query("get_nfsphys", 2, args, + StoreInfo, (char *) &elem)) != MR_SUCCESS) com_err(program_name, stat, " in ShowNFSServices."); free(args[0]); free(args[1]); /* prevents memory leaks. */ @@ -214,10 +214,10 @@ int argc; if (!ValidName(args[0]) || !ValidName(args[1])) return(DM_NORMAL); - if ( (stat = do_sms_query("get_nfsphys", 2, args, - NullFunc, (char *) NULL)) == SMS_SUCCESS) + if ( (stat = do_mr_query("get_nfsphys", 2, args, + NullFunc, (char *) NULL)) == MR_SUCCESS) Put_message("This service already exists."); - if (stat != SMS_NO_MATCH) + if (stat != MR_NO_MATCH) com_err(program_name, stat, " in get_nfsphys."); info[NFS_NAME] = Strsave(args[0]); @@ -231,7 +231,7 @@ int argc; add_args = AskNFSInfo(info); - if ((stat = do_sms_query("add_nfsphys", CountArgs(add_args), add_args, + if ((stat = do_mr_query("add_nfsphys", CountArgs(add_args), add_args, Scream, (char *) NULL)) != 0) com_err(program_name, stat, " in AdsNFSService"); @@ -257,8 +257,8 @@ Bool junk; register int stat; args = AskNFSInfo(info); - if ((stat = do_sms_query("update_nfsphys", CountArgs(args), args, - Scream, (char *)NULL)) != SMS_SUCCESS) + if ((stat = do_mr_query("update_nfsphys", CountArgs(args), args, + Scream, (char *)NULL)) != MR_SUCCESS) com_err(program_name, stat, (char *) NULL); } @@ -285,8 +285,8 @@ int argc; if ( (args[1] = GetDirName()) == NULL) return(DM_NORMAL); - if ( (stat = do_sms_query("get_nfsphys", 2, args, - StoreInfo, (char *) &elem)) != SMS_SUCCESS) { + if ( (stat = do_mr_query("get_nfsphys", 2, args, + StoreInfo, (char *) &elem)) != MR_SUCCESS) { com_err(program_name, stat, " in UpdateNFSService."); return (DM_NORMAL); } @@ -345,16 +345,16 @@ Bool one_item; args[0] = info[NFS_NAME]; args[1] = info[NFS_DIR]; args[2] = NULL; - switch(stat = do_sms_query("get_filesys_by_nfsphys", CountArgs(args), + switch(stat = do_mr_query("get_filesys_by_nfsphys", CountArgs(args), args, StoreInfo, (char *)&elem)) { - case SMS_NO_MATCH: /* it is unused, delete it. */ - if ( (stat = do_sms_query("delete_nfsphys", 2, info, Scream, - (char *) NULL )) != SMS_SUCCESS) + case MR_NO_MATCH: /* it is unused, delete it. */ + if ( (stat = do_mr_query("delete_nfsphys", 2, info, Scream, + (char *) NULL )) != MR_SUCCESS) com_err(program_name, stat, " in DeleteNFSService"); else Put_message("Physical Filesystem Deleted."); break; - case SMS_SUCCESS: /* it is used, print filesys's that use it. */ + case MR_SUCCESS: /* it is used, print filesys's that use it. */ elem = QueueTop(elem); Put_message("The following fileystems are using this partition,"); Put_message("and must be removed before it can be deleted."); @@ -395,12 +395,12 @@ char **argv; if ( (args[1] = GetDirName()) == NULL) return(DM_NORMAL); - switch(stat = do_sms_query("get_nfsphys", 2, args, + switch(stat = do_mr_query("get_nfsphys", 2, args, StoreInfo, (char *) &elem)) { - case SMS_NO_MATCH: + case MR_NO_MATCH: Put_message("This filsystem does not exist!"); return(DM_NORMAL); - case SMS_SUCCESS: + case MR_SUCCESS: break; default: com_err(program_name, stat, " in DeleteNFSService"); diff --git a/clients/moira/pobox.c b/clients/moira/pobox.c index 3620ccf1..b8c84bcd 100644 --- a/clients/moira/pobox.c +++ b/clients/moira/pobox.c @@ -2,8 +2,8 @@ static char rcsid_module_c[] = "$Header$"; #endif lint -/* This is the file pobox.c for the SMS Client, which allows a nieve - * user to quickly and easily maintain most parts of the SMS database. +/* This is the file pobox.c for the MOIRA Client, which allows a nieve + * user to quickly and easily maintain most parts of the MOIRA database. * It Contains: Functions for handling the poboxes. * * Created: 7/10/88 @@ -22,8 +22,8 @@ #include #include #include -#include -#include +#include +#include #include #include "mit-copyright.h" @@ -37,7 +37,7 @@ /* Function Name: PrintPOBox * Description: Yet another specialized print function. * Arguments: info - all info about this PO_box. - * Returns: SMS_CONT + * Returns: MR_CONT */ static void @@ -77,8 +77,8 @@ PrintPOMachines() static char * args[] = {"pop", NULL}; struct qelem * top = NULL; - if ( (status = do_sms_query("get_server_locations", CountArgs(args), args, - StoreInfo, (char *)&top)) != SMS_SUCCESS) { + if ( (status = do_mr_query("get_server_locations", CountArgs(args), args, + StoreInfo, (char *)&top)) != MR_SUCCESS) { com_err(program_name, status, " in get_server_locations."); return(SUB_ERROR); } @@ -108,12 +108,12 @@ char ** argv; if (!ValidName(argv[1])) return(DM_NORMAL); - switch (status = do_sms_query("get_pobox", 1, argv + 1, StoreInfo, + switch (status = do_mr_query("get_pobox", 1, argv + 1, StoreInfo, (char *)&top)) { - case SMS_NO_MATCH: + case MR_NO_MATCH: Put_message("This user has no P.O. Box."); break; - case SMS_SUCCESS: + case MR_SUCCESS: sprintf(buf,"Current pobox for user %s: \n", argv[1]); Put_message(""); top = QueueTop(top); @@ -180,11 +180,11 @@ char **argv; type = LOCAL_BOX; switch (YesNoQuestion("Use Previous Local Box (y/n)", TRUE)) { case TRUE: - switch (status = do_sms_query("set_pobox_pop", 1, + switch (status = do_mr_query("set_pobox_pop", 1, &local_user, Scream, NULL)) { - case SMS_SUCCESS: + case MR_SUCCESS: return(DM_NORMAL); - case SMS_MACHINE: + case MR_MACHINE: if ( (temp_box = GetNewLocalPOBox(local_user)) != (char *) SUB_ERROR) { strcpy(box, temp_box); @@ -232,8 +232,8 @@ char **argv; args[PO_TYPE] = type; args[PO_BOX] = box; args[PO_END] = NULL; - if ( (status = do_sms_query("set_pobox", CountArgs(args), args, - Scream, NULL)) != SMS_SUCCESS ) + if ( (status = do_mr_query("set_pobox", CountArgs(args), args, + Scream, NULL)) != MR_SUCCESS ) com_err(program_name, status, " in ChangeUserPOBox"); else Put_message("PO Box assigned."); @@ -263,8 +263,8 @@ char ** argv; "Are you sure that you want to remove %s's PO Box (y/n)", argv[1]); if (Confirm(temp_buf)) { - if ( (status = do_sms_query("delete_pobox", 1, argv + 1, - Scream, NULL)) != SMS_SUCCESS) + if ( (status = do_mr_query("delete_pobox", 1, argv + 1, + Scream, NULL)) != MR_SUCCESS) com_err(program_name, status, "in delete_pobox."); else Put_message("PO Box removed."); diff --git a/clients/moira/printer.c b/clients/moira/printer.c index 0454790b..2d06ce43 100644 --- a/clients/moira/printer.c +++ b/clients/moira/printer.c @@ -2,8 +2,8 @@ static char rcsid_module_c[] = "$Header$"; #endif lint -/* This is the file printer.c for the SMS Client, which allows a nieve - * user to quickly and easily maintain most parts of the SMS database. +/* This is the file printer.c for the MOIRA Client, which allows a nieve + * user to quickly and easily maintain most parts of the MOIRA database. * It Contains: Functions for handling the printers. * * Created: 8/16/88 @@ -22,8 +22,8 @@ #include #include #include -#include -#include +#include +#include #include #include "mit-copyright.h" @@ -75,7 +75,7 @@ char *name; int stat; struct qelem *elem = NULL; - if ( (stat = do_sms_query("get_printcap", 1, &name, + if ( (stat = do_mr_query("get_printcap", 1, &name, StoreInfo, (char *)&elem)) != 0) { com_err(program_name, stat, NULL); return(NULL); @@ -183,7 +183,7 @@ Bool one_item; int stat; char temp_buf[BUFSIZ]; - if ( (stat = do_sms_query("delete_printcap", 1, + if ( (stat = do_mr_query("delete_printcap", 1, &info[PCAP_NAME], Scream, NULL)) != 0) com_err(program_name, stat, " printcap entry not deleted."); else @@ -228,18 +228,18 @@ int argc; if ( !ValidName(argv[1]) ) return(DM_NORMAL); - if ( (stat = do_sms_query("get_printcap", 1, argv + 1, + if ( (stat = do_mr_query("get_printcap", 1, argv + 1, NullFunc, NULL)) == 0) { Put_message ("A Printer by that name already exists."); return(DM_NORMAL); - } else if (stat != SMS_NO_MATCH) { + } else if (stat != MR_NO_MATCH) { com_err(program_name, stat, " in AddPcap"); return(DM_NORMAL); } args = AskPcapInfo(SetDefaults(info, argv[1])); - if ( (stat = do_sms_query("add_printcap", CountArgs(args), args, + if ( (stat = do_mr_query("add_printcap", CountArgs(args), args, NullFunc, NULL)) != 0) com_err(program_name, stat, " in AddPcap"); @@ -261,13 +261,13 @@ Bool one_item; { int stat; - if ((stat = do_sms_query("delete_printcap", 1, &info[PCAP_NAME], + if ((stat = do_mr_query("delete_printcap", 1, &info[PCAP_NAME], Scream, NULL)) != 0) { com_err(program_name, stat, " printcap entry not deleted."); return(DM_NORMAL); } AskPcapInfo(info); - if ((stat = do_sms_query("add_printcap", CountArgs(info), info, + if ((stat = do_mr_query("add_printcap", CountArgs(info), info, NullFunc, NULL)) != 0) com_err(program_name, stat, " in ChngPcap"); return(DM_NORMAL); @@ -377,7 +377,7 @@ char *name; int status; struct qelem *elem = NULL; - if ((status = do_sms_query("get_palladium", 1, &name, StoreInfo, &elem)) + if ((status = do_mr_query("get_palladium", 1, &name, StoreInfo, &elem)) != 0) { com_err(program_name, status, NULL); return(NULL); @@ -392,13 +392,13 @@ Bool one_item; { int status; - if ((status = do_sms_query("delete_palladium", 1, &info[PD_NAME], + if ((status = do_mr_query("delete_palladium", 1, &info[PD_NAME], Scream, NULL)) != 0) { com_err(program_name, status, " palladium entry not deleted."); return(DM_NORMAL); } AskPalladiumInfo(info); - if ((status = do_sms_query("add_palladium", CountArgs(info), info, + if ((status = do_mr_query("add_palladium", CountArgs(info), info, NullFunc, NULL)) != 0) com_err(program_name, status, " in ChngPalladium"); return(DM_NORMAL); @@ -421,7 +421,7 @@ Bool one_item; int stat; char temp_buf[BUFSIZ]; - if ( (stat = do_sms_query("delete_palladium", 1, + if ( (stat = do_mr_query("delete_palladium", 1, &info[PD_NAME], Scream, NULL)) != 0) com_err(program_name, stat, " palladium entry not deleted."); else @@ -453,18 +453,18 @@ char **argv; if (!ValidName(argv[1])) return(DM_NORMAL); - if ((status = do_sms_query("get_palladium", 1, &argv[1], NullFunc, NULL)) + if ((status = do_mr_query("get_palladium", 1, &argv[1], NullFunc, NULL)) == 0) { Put_message("A server or supervisor by that name already exists."); return(DM_NORMAL); - } else if (status != SMS_NO_MATCH) { + } else if (status != MR_NO_MATCH) { com_err(program_name, status, " in AddPalladium"); return(DM_NORMAL); } args = AskPalladiumInfo(SetPdDefaults(info, argv[1])); - if ((status = do_sms_query("add_palladium", CountArgs(args), args, + if ((status = do_mr_query("add_palladium", CountArgs(args), args, Scream, NULL)) != 0) com_err(program_name, status, " in AddPalladium"); @@ -505,7 +505,7 @@ char **argv; qargv[0] = argv[1]; qargv[1] = "PALLADIUM"; qargv[2] = argv[2]; - if ((status = do_sms_query("get_alias", 3, qargv, StoreInfo, &elem)) != 0) { + if ((status = do_mr_query("get_alias", 3, qargv, StoreInfo, &elem)) != 0) { com_err(program_name, status, " in ShowPalladiumAlias"); return(DM_NORMAL); } @@ -532,7 +532,7 @@ char **argv; qargv[0] = argv[1]; qargv[1] = "PALLADIUM"; qargv[2] = argv[2]; - if ((status = do_sms_query("add_alias", 3, qargv, Scream, NULL)) != 0) + if ((status = do_mr_query("add_alias", 3, qargv, Scream, NULL)) != 0) com_err(program_name, status, " in AddPalladiumAlias"); return(DM_NORMAL); } @@ -547,7 +547,7 @@ char **argv; qargv[0] = argv[1]; qargv[1] = "PALLADIUM"; qargv[2] = argv[2]; - if ((status = do_sms_query("delete_alias", 3, qargv, Scream, NULL)) != 0) + if ((status = do_mr_query("delete_alias", 3, qargv, Scream, NULL)) != 0) com_err(program_name, status, " in DeletePalladiumAlias"); return(DM_NORMAL); } diff --git a/clients/moira/quota.c b/clients/moira/quota.c index 9cd4fde8..a9623205 100644 --- a/clients/moira/quota.c +++ b/clients/moira/quota.c @@ -2,8 +2,8 @@ static char rcsid_module_c[] = "$Header$"; #endif lint -/* This is the file quota.c for the SMS Client, which allows a nieve - * user to quickly and easily maintain most parts of the SMS database. +/* This is the file quota.c for the MOIRA Client, which allows a nieve + * user to quickly and easily maintain most parts of the MOIRA database. * It Contains: Functions for manipulating the quota information. * * Created: 7/10/88 @@ -21,8 +21,8 @@ #include #include -#include -#include +#include +#include #include #include "mit-copyright.h" @@ -33,14 +33,14 @@ static char * def_quota = NULL; #define DEFAULT_FILESYS DEFAULT_NONE -#define DEFAULT_USER user /* this is the user who started sms. */ +#define DEFAULT_USER user /* this is the user who started moira. */ #define NOBODY "\\[nobody\\]" #define OLDNOBODY "[nobody]" /* Function Name: GetDefaultUserQuota - * Description: gets the user quota from sms, and caches the value. - * Arguments: override - if true, go to sms and override the cache. + * Description: gets the user quota from moira, and caches the value. + * Arguments: override - if true, go to moira and override the cache. * Returns: none. * NOTE: Using a queue here is pretty useless, but StoreInfo expects * one, and it works, so why fuck with it. @@ -56,8 +56,8 @@ Bool override; static char *val[] = {"def_quota", NULL}; if (override || (def_quota == NULL)) { - if ( (status = do_sms_query("get_value", CountArgs(val), val, - StoreInfo, (char *) &top)) != SMS_SUCCESS) { + if ( (status = do_mr_query("get_value", CountArgs(val), val, + StoreInfo, (char *) &top)) != MR_SUCCESS) { com_err(program_name, status, " in ShowDefaultQuota"); if (def_quota == NULL) { Put_message("No default Quota Found, setting default to 0."); @@ -141,9 +141,9 @@ char *name; if (index(name, '*') || index(name, '?') || index(name, '\\')) return(0); argv[0] = name; - status = do_sms_query("get_filesys_by_label", 1, argv, + status = do_mr_query("get_filesys_by_label", 1, argv, afsfilsyshelper, &ret); - if (status == SMS_SUCCESS) + if (status == MR_SUCCESS) return(ret); return(0); @@ -236,8 +236,8 @@ char *argv[]; "change the default quota for all new users"); if(Confirm(temp_buf)) { newval[1] = argv[1]; - if ( (status = do_sms_query("update_value", CountArgs(newval), - newval, Scream, NULL)) == SMS_SUCCESS ) { + if ( (status = do_mr_query("update_value", CountArgs(newval), + newval, Scream, NULL)) == MR_SUCCESS ) { FreeAndClear(&def_quota, TRUE); def_quota = Strsave(argv[1]); } @@ -268,8 +268,8 @@ ShowUserQuota() if ( (args = GetQuotaArgs(FALSE) ) == NULL) return(DM_NORMAL); - if ( (status = do_sms_query("get_nfs_quota", CountArgs(args), args, - StoreInfo, (char *) &top)) != SMS_SUCCESS) + if ( (status = do_mr_query("get_nfs_quota", CountArgs(args), args, + StoreInfo, (char *) &top)) != MR_SUCCESS) com_err(program_name, status, " in get_nfs_quota"); FreeInfo(args); /* done with args free them. */ @@ -297,8 +297,8 @@ AddUserQuota() if ( (args = GetQuotaArgs(TRUE) ) == NULL) return(DM_NORMAL); - if ( (status = do_sms_query("add_nfs_quota", CountArgs(args), args, - Scream, (char *) NULL)) != SMS_SUCCESS) + if ( (status = do_mr_query("add_nfs_quota", CountArgs(args), args, + Scream, (char *) NULL)) != MR_SUCCESS) com_err(program_name, status, " in get_nfs_quota"); FreeInfo(args); @@ -326,8 +326,8 @@ char ** info; info[Q_LOGIN] = strsave(NOBODY); } - if (status = do_sms_query("update_nfs_quota", 3, info, - Scream, (char *) NULL) != SMS_SUCCESS) { + if (status = do_mr_query("update_nfs_quota", 3, info, + Scream, (char *) NULL) != MR_SUCCESS) { com_err(program_name, status, " in update_nfs_quota"); sprintf(temp_buf,"Could not perform quota change on %s", info[Q_FILESYS]); @@ -351,8 +351,8 @@ ChangeUserQuota() if ( (args = GetQuotaArgs(FALSE) ) == NULL) return(DM_NORMAL); - if ( (status = do_sms_query("get_nfs_quota", 2, args, - StoreInfo, (char *) &top)) != SMS_SUCCESS) + if ( (status = do_mr_query("get_nfs_quota", 2, args, + StoreInfo, (char *) &top)) != MR_SUCCESS) com_err(program_name, status, " in get_nfs_quota"); FreeInfo(args); /* done with args, free them. */ @@ -385,8 +385,8 @@ Bool one_item; info[Q_LOGIN], info[Q_FILESYS]); if (!one_item || Confirm(temp_buf)) { - if ( (status = do_sms_query("delete_nfs_quota", 2, info, - Scream, (char *) NULL)) != SMS_SUCCESS) + if ( (status = do_mr_query("delete_nfs_quota", 2, info, + Scream, (char *) NULL)) != MR_SUCCESS) com_err(program_name, status, " in delete_nfs_quota"); else Put_message("Quota sucessfully removed."); @@ -411,8 +411,8 @@ RemoveUserQuota() if ( (args = GetQuotaArgs(FALSE) ) == NULL) return(DM_NORMAL); - if ( (status = do_sms_query("get_nfs_quota", 2, args, - StoreInfo, (char *) &top)) != SMS_SUCCESS) + if ( (status = do_mr_query("get_nfs_quota", 2, args, + StoreInfo, (char *) &top)) != MR_SUCCESS) com_err(program_name, status, " in get_nfs_quota"); FreeInfo(args); diff --git a/clients/moira/user.c b/clients/moira/user.c index df64db9b..3c21191e 100644 --- a/clients/moira/user.c +++ b/clients/moira/user.c @@ -2,8 +2,8 @@ static char rcsid_module_c[] = "$Header$"; #endif lint -/* This is the file user.c for the SMS Client, which allows a nieve - * user to quickly and easily maintain most parts of the SMS database. +/* This is the file user.c for the MOIRA Client, which allows a nieve + * user to quickly and easily maintain most parts of the MOIRA database. * It Contains: Functions for manipulating user information. * * Created: 5/9/88 @@ -21,8 +21,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -162,7 +162,7 @@ Bool name; GetValueFromUser("User's middle name", &info[U_MIDDLE]); argv[0] = info[U_FIRST]; argv[1] = info[U_LAST]; - if (do_sms_query("get_user_by_name", 2, argv, + if (do_mr_query("get_user_by_name", 2, argv, StoreInfo, (char *) &elem) == 0) { Put_message("A user by that name already exists in the database."); Loop(QueueTop(elem), PrintUserInfo); @@ -245,7 +245,7 @@ char *name1, *name2; switch(type) { case LOGIN: args[0] = name1; - if ( (status = do_sms_query("get_user_by_login", 1, args, + if ( (status = do_mr_query("get_user_by_login", 1, args, StoreInfo, (char *) &elem)) != 0) { com_err(program_name, status, " when attempting to get_user_by_login."); @@ -254,7 +254,7 @@ char *name1, *name2; break; case UID: args[0] = name1; - if ( (status = do_sms_query("get_user_by_uid", 1, args, + if ( (status = do_mr_query("get_user_by_uid", 1, args, StoreInfo, (char *) &elem)) != 0) { com_err(program_name, status, " when attempting to get_user_by_uid."); @@ -264,7 +264,7 @@ char *name1, *name2; case BY_NAME: args[0] = name1; args[1] = name2; - if ( (status = do_sms_query("get_user_by_name", 2, args, + if ( (status = do_mr_query("get_user_by_name", 2, args, StoreInfo, (char *) &elem)) != 0) { com_err(program_name, status, " when attempting to get_user_by_name."); @@ -273,7 +273,7 @@ char *name1, *name2; break; case CLASS: args[0] = name1; - if ( (status = do_sms_query("get_user_by_class", 1, args, + if ( (status = do_mr_query("get_user_by_class", 1, args, StoreInfo, (char *) &elem)) != 0) { com_err(program_name, status, " when attempting to get_user_by_class."); @@ -300,8 +300,8 @@ AddNewUser() args = AskUserInfo(SetUserDefaults(info), FALSE); if (args == NULL) return(DM_NORMAL); - if ( (status = do_sms_query("add_user", CountArgs(args), - args, Scream, (char *) NULL)) != SMS_SUCCESS) + if ( (status = do_mr_query("add_user", CountArgs(args), + args, Scream, (char *) NULL)) != MR_SUCCESS) com_err(program_name, status, " in add_user"); else Put_message("New user added to database."); @@ -376,11 +376,11 @@ GetUidNumberFromName() args[0] = first; args[1] = last; - switch (status = do_sms_query("get_user_by_name", 2, args, + switch (status = do_mr_query("get_user_by_name", 2, args, StoreInfo, (char *) &top)) { - case SMS_SUCCESS: + case MR_SUCCESS: break; - case SMS_NO_MATCH: + case MR_NO_MATCH: Put_message("There is no user in the database with that name."); return(NULL); default: @@ -473,14 +473,14 @@ RegisterUser() args[2] = fstype; args[3] = NULL; - switch (status = do_sms_query("register_user", CountArgs(args), + switch (status = do_mr_query("register_user", CountArgs(args), args, Scream, (char *) NULL)) { - case SMS_SUCCESS: + case MR_SUCCESS: sprintf(temp_buf, "User %s successfully registered.", login); Put_message(temp_buf); SetUserPassword(login); break; - case SMS_IN_USE: + case MR_IN_USE: GiveBackLogin(login); sprintf(temp_buf, "The username %s is already in use.", login); Put_message(temp_buf); @@ -510,8 +510,8 @@ Bool junk; char error_buf[BUFSIZ]; char ** args = AskUserInfo(info, TRUE); - if ( (status = do_sms_query("update_user", CountArgs(args), - args, Scream, (char *) NULL)) != SMS_SUCCESS) { + if ( (status = do_mr_query("update_user", CountArgs(args), + args, Scream, (char *) NULL)) != MR_SUCCESS) { com_err(program_name, status, " in ModifyFields"); sprintf(error_buf, "User %s not updated due to errors.", info[NAME]); Put_message(error_buf); @@ -563,8 +563,8 @@ Bool one_item; qargs[0] = info[NAME]; qargs[1] = "3"; - if ((status = do_sms_query("update_user_status", 2, qargs, Scream, - (char *) NULL)) != SMS_SUCCESS) { + if ((status = do_mr_query("update_user_status", 2, qargs, Scream, + (char *) NULL)) != MR_SUCCESS) { com_err(program_name, status, " in update_user_status"); sprintf(txt_buf, "User %s not deactivated due to errors.", info[NAME]); Put_message(txt_buf); @@ -602,7 +602,7 @@ char **argv; * Description: Deletes the user given a uid number. * Arguments: argc, argv - uid if user in argv[1]. * Returns: DM_NORMAL. - * NOTES: This just gets the username from the sms server + * NOTES: This just gets the username from the mr server * and performs a DeleteUser(). */ @@ -618,8 +618,8 @@ char **argv; if(!ValidName(argv[1])) return(DM_NORMAL); - if ( (status = do_sms_query("get_user_by_uid", 1, argv+1, StoreInfo, - (char * ) &elem)) != SMS_SUCCESS) + if ( (status = do_mr_query("get_user_by_uid", 1, argv+1, StoreInfo, + (char * ) &elem)) != MR_SUCCESS) com_err(program_name, status, " in get_user_by_uid"); info = (char **) elem->q_data; @@ -731,7 +731,7 @@ char **argv; struct qelem *elem = NULL, *top; char buf[BUFSIZ]; - if ((stat = do_sms_query("get_kerberos_user_map", 2, &argv[1], + if ((stat = do_mr_query("get_kerberos_user_map", 2, &argv[1], StoreInfo, (char *)&elem)) != 0) { com_err(program_name, stat, " in GetKrbMap."); return(DM_NORMAL); @@ -771,10 +771,10 @@ char **argv; Put_message("Please specify a realm for the kerberos principal."); return(DM_NORMAL); } - if ((stat = do_sms_query("add_kerberos_user_map", 2, &argv[1], + if ((stat = do_mr_query("add_kerberos_user_map", 2, &argv[1], Scream, NULL)) != 0) { com_err(program_name, stat, " in AddKrbMap."); - if (stat == SMS_EXISTS) + if (stat == MR_EXISTS) Put_message("No user or principal may have more than one mapping."); } return(DM_NORMAL); @@ -796,7 +796,7 @@ char **argv; { int stat; - if ((stat = do_sms_query("delete_kerberos_user_map", 2, &argv[1], + if ((stat = do_mr_query("delete_kerberos_user_map", 2, &argv[1], Scream, NULL)) != 0) { com_err(program_name, stat, " in DeleteKrbMap."); } diff --git a/clients/moira/utils.c b/clients/moira/utils.c index 46a0804c..0840f821 100644 --- a/clients/moira/utils.c +++ b/clients/moira/utils.c @@ -2,8 +2,8 @@ static char rcsid_module_c[] = "$Header$"; #endif lint -/* This is the file utils.c for the SMS Client, which allows a nieve - * user to quickly and easily maintain most parts of the SMS database. +/* This is the file utils.c for the MOIRA Client, which allows a nieve + * user to quickly and easily maintain most parts of the MOIRA database. * It Contains: Many useful utility functions. * * Created: 4/25/88 @@ -21,8 +21,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -179,7 +179,7 @@ struct qelem * elem; } /* Function Name: StoreInfo - * Description: Stores information from an sms query into a queue. + * Description: Stores information from an moira query into a queue. * Arguments: argc, argv, - information returned from the query returned * in argv. * data - the previous element on the queue, this data will be @@ -187,7 +187,7 @@ struct qelem * elem; * If NULL then a new queue will be created. This value * is updated to the current element at the end off the * call. - * Returns: SMS_CONT, or SMS_ABORT if it has problems. + * Returns: MR_CONT, or MR_ABORT if it has problems. */ int @@ -205,7 +205,7 @@ char * data; Put_message("Could Not allocate more memory."); FreeQueue(*old_elem); *old_elem = (struct qelem *) NULL; - return(SMS_ABORT); + return(MR_ABORT); } for (count = 0; count < argc; count++) @@ -216,7 +216,7 @@ char * data; AddQueue(new_elem, *old_elem); *old_elem = new_elem; - return(SMS_CONT); + return(MR_CONT); } /* Function Name: CountArgs @@ -252,7 +252,7 @@ Scream() { com_err(program_name, 0, "\nA Moira update returned a value -- programmer botch\n"); - sms_disconnect(); + mr_disconnect(); exit(1); } @@ -417,13 +417,13 @@ ToggleVerboseMode() /* Function Name: NullFunc * Description: dummy callback routine * Arguments: none - * Returns: SMS_CONT + * Returns: MR_CONT */ int NullFunc() { - return(SMS_CONT); + return(MR_CONT); } /* Function Name: SlipInNewName @@ -569,13 +569,13 @@ char ** current; else c_value = atoi(*current); - if (GetFSVal("student", SMS_FS_STUDENT, c_value, &new_val) == FALSE) + if (GetFSVal("student", MR_FS_STUDENT, c_value, &new_val) == FALSE) return(SUB_ERROR); - if (GetFSVal("faculty", SMS_FS_FACULTY, c_value, &new_val) == FALSE) + if (GetFSVal("faculty", MR_FS_FACULTY, c_value, &new_val) == FALSE) return(SUB_ERROR); - if (GetFSVal("staff", SMS_FS_STAFF, c_value, &new_val) == FALSE) + if (GetFSVal("staff", MR_FS_STAFF, c_value, &new_val) == FALSE) return(SUB_ERROR); - if (GetFSVal("miscellaneous", SMS_FS_MISC, c_value, &new_val) == FALSE) + if (GetFSVal("miscellaneous", MR_FS_MISC, c_value, &new_val) == FALSE) return(SUB_ERROR); FreeAndClear(current, TRUE); @@ -604,9 +604,9 @@ char *str; /* Function Name: Print * Description: prints out all the arguments on a single line. - * Arguments: argc, argv - the standard SMS arguments. + * Arguments: argc, argv - the standard MR arguments. * callback - the callback function - NOT USED. - * Returns: SMS_CONT + * Returns: MR_CONT */ /* ARGSUSED */ @@ -624,16 +624,16 @@ char **argv, *callback; (void) sprintf(buf,"%s %s",buf,argv[i]); (void) Put_message(buf); - return (SMS_CONT); + return (MR_CONT); } /* Function Name: PrintByType * Description: This function prints all members of the type specified * by the callback arg, unless the callback is NULL, in which * case it prints all members. - * Arguments: argc, argc - normal arguments for sms_callback function. + * Arguments: argc, argc - normal arguments for mr_callback function. * callback - either a type of member or NULL. - * Returns: SMS_CONT or SMS_QUIT. + * Returns: MR_CONT or MR_QUIT. */ /*ARGSUSED*/ @@ -646,7 +646,7 @@ char **argv, *callback; return( Print(argc, argv, callback) ); if (strcmp(argv[0], callback) == 0) return( Print(argc, argv, callback) ); - return(SMS_CONT); + return(MR_CONT); } /* Function Name: PrintHelp @@ -790,7 +790,7 @@ char *tname; argv[1] = "TYPE"; argv[2] = "*"; elem = NULL; - if (stat = do_sms_query("get_alias", 3, argv, StoreInfo, (char *)&elem)) { + if (stat = do_mr_query("get_alias", 3, argv, StoreInfo, (char *)&elem)) { com_err(program_name, stat, " in GetTypeValues"); return(NULL); } @@ -868,7 +868,7 @@ char **pointer; for (p = argv[2]; *p; p++) if (islower(*p)) *p = toupper(*p); - if (stat = do_sms_query("add_alias", 3, argv, Scream, NULL)) { + if (stat = do_mr_query("add_alias", 3, argv, Scream, NULL)) { com_err(program_name, stat, " in add_alias"); } else { elem = (struct qelem *) malloc(sizeof(struct qelem)); @@ -882,7 +882,7 @@ char **pointer; } -do_sms_query(name, argc, argv, proc, hint) +do_mr_query(name, argc, argv, proc, hint) char *name; int argc; char **argv; @@ -892,23 +892,23 @@ char *hint; int status; extern char *whoami, *moira_server; - status = sms_query(name, argc, argv, proc, hint); - if (status != SMS_ABORTED && status != SMS_NOT_CONNECTED) + status = mr_query(name, argc, argv, proc, hint); + if (status != MR_ABORTED && status != MR_NOT_CONNECTED) return(status); - status = sms_connect(moira_server); + status = mr_connect(moira_server); if (status) { com_err(whoami, status, " while re-connecting to server %s", moira_server); - return(SMS_ABORTED); + return(MR_ABORTED); } - status = sms_auth(whoami); + status = mr_auth(whoami); if (status) { com_err(whoami, status, " while re-authenticating to server %s", moira_server); - sms_disconnect(); - return(SMS_ABORTED); + mr_disconnect(); + return(MR_ABORTED); } - status = sms_query(name, argc, argv, proc, hint); + status = mr_query(name, argc, argv, proc, hint); return(status); } diff --git a/clients/mrtest/Makefile b/clients/mrtest/Makefile index 58f07bfd..d98e9ebb 100644 --- a/clients/mrtest/Makefile +++ b/clients/mrtest/Makefile @@ -7,7 +7,7 @@ # . -LIBS = ../rpc/libsms.a ../gdb/libgdb.a +LIBS = ../rpc/libmoira.a ../gdb/libgdb.a LLIBS= -L../lib -lhesiod -lkrb -ldes -lhesiod -lss -lcom_err -lm -lc SRCS= test.c @@ -41,5 +41,5 @@ depend: # DO NOT DELETE THIS LINE -- mkdep uses it. test.o: test.c ../include/mit-copyright.h /usr/include/stdio.h -test.o: /usr/include/sys/file.h /usr/include/ctype.h ../include/sms.h -test.o: ../include/sms_et.h ../include/ss.h +test.o: /usr/include/sys/file.h /usr/include/ctype.h ../include/moira.h +test.o: ../include/mr_et.h ../include/ss.h diff --git a/clients/mrtest/mrtest.c b/clients/mrtest/mrtest.c index 6ab236c4..31e879dd 100644 --- a/clients/mrtest/mrtest.c +++ b/clients/mrtest/mrtest.c @@ -17,7 +17,7 @@ static char *rcsid_test_c = "$Header$"; #include #include #include -#include +#include #include int ss; @@ -60,18 +60,18 @@ moira() test_noop() { - int status = sms_noop(); + int status = mr_noop(); if (status) ss_perror(ss, status, ""); } test_new() { - sending_version_no = SMS_VERSION_2; + sending_version_no = MR_VERSION_2; } test_old() { - sending_version_no = SMS_VERSION_1; + sending_version_no = MR_VERSION_1; } test_connect(argc, argv) @@ -84,13 +84,13 @@ char *argv[]; if (argc > 1) { server = argv[1]; } - status = sms_connect(server); + status = mr_connect(server); if (status) ss_perror(ss, status, ""); } test_disconnect() { - int status = sms_disconnect(); + int status = mr_disconnect(); if (status) ss_perror(ss, status, ""); } @@ -101,7 +101,7 @@ test_host() bzero(host, sizeof(host)); - if (status = sms_host(host, sizeof(host) - 1)) + if (status = mr_host(host, sizeof(host) - 1)) ss_perror(ss, status, ""); else printf("You are connected to host %s\n", host); @@ -111,7 +111,7 @@ test_auth() { int status; - status = sms_auth("mrtest"); + status = mr_auth("mrtest"); if (status) ss_perror(ss, status, ""); } @@ -230,7 +230,7 @@ print_reply(argc, argv) } printf("\n"); count++; - return(SMS_CONT); + return(MR_CONT); } test_query(argc, argv) @@ -244,7 +244,7 @@ test_query(argc, argv) } count = 0; - status = sms_query(argv[1], argc-2, argv+2, print_reply, (char *)NULL); + status = mr_query(argv[1], argc-2, argv+2, print_reply, (char *)NULL); printf("%d tuple%s\n", count, ((count == 1) ? "" : "s")); if (status) ss_perror(ss, status, ""); } @@ -258,7 +258,7 @@ test_access(argc, argv) ss_perror(ss, 0, "Usage: access handle [ args ... ]"); return; } - status = sms_access(argv[1], argc-2, argv+2); + status = mr_access(argv[1], argc-2, argv+2); if (status) ss_perror(ss, status, ""); } @@ -269,7 +269,7 @@ test_dcm(argc, argv) { int status; - if (status = sms_do_update()) + if (status = mr_do_update()) ss_perror(ss, status, " while triggering dcm"); } @@ -281,7 +281,7 @@ test_motd(argc, argv) int status; char *motd; - if (status = sms_motd(&motd)) + if (status = mr_motd(&motd)) ss_perror(ss, status, " while getting motd"); if (motd) printf("%s\n", motd); diff --git a/clients/passwd/Makefile b/clients/passwd/Makefile index 66b6b870..a24937f5 100644 --- a/clients/passwd/Makefile +++ b/clients/passwd/Makefile @@ -1,4 +1,4 @@ -# Makefile for SMS clients passwd/chfn/chpobox/chsh +# Makefile for MOIRA clients passwd/chfn/chpobox/chsh # # MIT Project Athena # @@ -17,20 +17,20 @@ CFLAGS = -I../../include ${DEFINES} CONFDIR = ${DESTDIR}/usr/athena BINDIR = ${DESTDIR}/bin -SMSLIB = -L../../lib -lsms -lgdb -lcom_err -lkrb -ldes -lhesiod +MOIRALIB = -L../../lib -lmoira -lgdb -lcom_err -lkrb -ldes -lhesiod PROGS= chfn chsh chpobox all: ${PROGS} chfn: chfn.o - cc -o chfn chfn.o ${SMSLIB} + cc -o chfn chfn.o ${MOIRALIB} chpobox: chpobox.o - cc -o chpobox chpobox.o ${SMSLIB} + cc -o chpobox chpobox.o ${MOIRALIB} chsh: chsh.o - cc -o chsh chsh.o ${SMSLIB} + cc -o chsh chsh.o ${MOIRALIB} lint: lint *.c @@ -52,14 +52,14 @@ depend: chfn.o: chfn.c /usr/include/sys/types.h /usr/include/stdio.h chfn.o: /usr/include/strings.h /usr/include/sys/file.h ../../include/krb.h chfn.o: ../../include/mit-copyright.h ../../include/des.h -chfn.o: /usr/include/ctype.h /usr/include/errno.h ../../include/sms.h -chfn.o: /usr/include/sms_et.h ../../include/sms_app.h +chfn.o: /usr/include/ctype.h /usr/include/errno.h ../../include/moira.h +chfn.o: ../../include/mr_et.h ../../include/moira_site.h chpobox.o: chpobox.c /usr/include/sys/types.h /usr/include/stdio.h chpobox.o: /usr/include/pwd.h /usr/include/strings.h /usr/include/ctype.h -chpobox.o: /usr/include/errno.h ../../include/sms.h /usr/include/sms_et.h -chpobox.o: ../../include/sms_app.h ../../include/mit-copyright.h +chpobox.o: /usr/include/errno.h ../../include/moira.h ../../include/mr_et.h +chpobox.o: ../../include/moira_site.h ../../include/mit-copyright.h chsh.o: chsh.c /usr/include/sys/types.h /usr/include/stdio.h chsh.o: /usr/include/strings.h /usr/include/sys/file.h ../../include/krb.h chsh.o: ../../include/mit-copyright.h ../../include/des.h -chsh.o: /usr/include/ctype.h /usr/include/errno.h ../../include/sms.h -chsh.o: /usr/include/sms_et.h ../../include/sms_app.h +chsh.o: /usr/include/ctype.h /usr/include/errno.h ../../include/moira.h +chsh.o: ../../include/mr_et.h ../../include/moira_site.h diff --git a/clients/passwd/chfn.c b/clients/passwd/chfn.c index dcb35c45..7942930f 100644 --- a/clients/passwd/chfn.c +++ b/clients/passwd/chfn.c @@ -13,7 +13,7 @@ static char *rcsid_chfn_c = "$Header$"; #endif not lint /* - * Talk to the SMS database to change a person's GECOS information. + * Talk to the MOIRA database to change a person's GECOS information. * * chfn with no modifiers changes the information of the user who is * running the program. @@ -34,9 +34,9 @@ static char *rcsid_chfn_c = "$Header$"; #include #include -/* SMS includes */ -#include -#include +/* MOIRA includes */ +#include +#include #include "mit-copyright.h" char *whoami; @@ -97,10 +97,10 @@ main(argc, argv) leave(status) int status; - /* This should be called rather than exit once connection to sms server + /* This should be called rather than exit once connection to moira server has been established. */ { - sms_disconnect(); + mr_disconnect(); exit(status); } @@ -114,9 +114,9 @@ chfn(uname) char *uname; { int status; /* general purpose exit status */ - int q_argc; /* argc for sms_query */ - char *q_argv[F_END]; /* argv for sms_query */ - char *motd; /* for SMS server status */ + int q_argc; /* argc for mr_query */ + char *q_argv[F_END]; /* argv for mr_query */ + char *motd; /* for MR server status */ int i; int get_user_info(); @@ -127,13 +127,13 @@ chfn(uname) /* Try each query. If we ever fail, print error message and exit. */ - status = sms_connect(NULL); + status = mr_connect(NULL); if (status) { com_err(whoami, status, " while connecting to Moira"); exit(1); } - status = sms_motd(&motd); + status = mr_motd(&motd); if (status) { com_err(whoami, status, " unable to check server status"); leave(1); @@ -143,7 +143,7 @@ chfn(uname) leave(1); } - status = sms_auth("chfn"); /* Don't use argv[0] - too easy to fake */ + status = mr_auth("chfn"); /* Don't use argv[0] - too easy to fake */ if (status) { com_err(whoami, status, " while authenticating -- run \"kinit\" and try again."); @@ -157,7 +157,7 @@ chfn(uname) q_argv[i] = "junk"; q_argc = F_MODTIME; /* one more than the last updatable field */ - if (status = sms_access("update_finger_by_login", q_argc, q_argv)) { + if (status = mr_access("update_finger_by_login", q_argc, q_argv)) { com_err(whoami, status, "; finger\ninformation not changed."); leave(2); } @@ -168,7 +168,7 @@ chfn(uname) q_argv[NAME] = uname; q_argc = NAME + 1; - if (status = sms_query("get_finger_by_login", q_argc, q_argv, + if (status = mr_query("get_finger_by_login", q_argc, q_argv, get_user_info, (char *) &old_info)) { com_err(whoami, status, " while getting user information."); @@ -194,7 +194,7 @@ chfn(uname) q_argv[F_MIT_AFFIL] = new_info.mit_year; q_argc = F_MODTIME; /* First non-update query argument */ - if (status = sms_query("update_finger_by_login", q_argc, q_argv, + if (status = mr_query("update_finger_by_login", q_argc, q_argv, scream, (char *)NULL)) { com_err(whoami, status, " while updating finger information."); @@ -232,7 +232,7 @@ get_user_info(argc, argv, message) /* Only pay attention to the first match since login names are unique in the database. */ - return(SMS_ABORT); + return(MR_ABORT); } char *ask(question, def_val, phone_num) diff --git a/clients/passwd/chpobox.c b/clients/passwd/chpobox.c index 393be497..ec253b1b 100644 --- a/clients/passwd/chpobox.c +++ b/clients/passwd/chpobox.c @@ -13,7 +13,7 @@ static char *rcsid_chpobox_c = "$Header$"; #endif not lint /* - * Talk to the SMS database to change a person's home mail machine. This may + * Talk to the MOIRA database to change a person's home mail machine. This may * be an Athena machine, or a completely arbitrary address. * * chpobox with no modifiers reports the current mailbox. @@ -35,9 +35,9 @@ static char *rcsid_chpobox_c = "$Header$"; #include #include -/* SMS includes */ -#include -#include +/* MOIRA includes */ +#include +#include #include "mit-copyright.h" char *getlogin(); @@ -55,7 +55,7 @@ main(argc, argv) char *argv[]; { struct passwd *pwd; - char *smsarg[3], buf[BUFSIZ]; + char *mrarg[3], buf[BUFSIZ]; char *potype(), *index(); char *address, *uname, *machine, *motd; uid_t u; @@ -120,30 +120,30 @@ main(argc, argv) (void) strcpy(uname, pwd->pw_name); } } - smsarg[0] = uname; + mrarg[0] = uname; - status = sms_connect(NULL); + status = mr_connect(NULL); if (status) { com_err(whoami, status, " while connecting to Moira"); exit(1); } - status = sms_motd(&motd); + status = mr_motd(&motd); if (status) { - sms_disconnect(); + mr_disconnect(); com_err(whoami, status, " unable to check server status"); exit(1); } if (motd) { fprintf(stderr, "The Moira server is currently unavailable:\n%s\n", motd); - sms_disconnect(); + mr_disconnect(); exit(1); } - status = sms_auth("chpobox"); + status = mr_auth("chpobox"); if (status) { com_err(whoami, status, " while authenticating -- run \"kinit\" and try again."); - sms_disconnect(); + mr_disconnect(); exit(1); } @@ -162,41 +162,41 @@ main(argc, argv) whoami, address); goto show; } - smsarg[2] = canonicalize_hostname(strsave(machine)); - smsarg[1] = potype(smsarg[2]); - if (!strcmp(smsarg[1], "POP")) { + mrarg[2] = canonicalize_hostname(strsave(machine)); + mrarg[1] = potype(mrarg[2]); + if (!strcmp(mrarg[1], "POP")) { if (strcmp(address, uname)) { fprintf(stderr, "%s: the name on the POP box must match the username\n", whoami); goto show; } - } else if (!strcmp(smsarg[1], "LOCAL")) { + } else if (!strcmp(mrarg[1], "LOCAL")) { strcat(address, "@"); - strcat(address, smsarg[2]); - smsarg[2] = address; + strcat(address, mrarg[2]); + mrarg[2] = address; if ((address = index(address, '@')) && (address = index(address, '.'))) *address = 0; - strcat(smsarg[2], ".LOCAL"); - smsarg[1] = "SMTP"; - } else if (smsarg[1]) { - if (*machine != '"' && strcasecmp(smsarg[2], machine)) + strcat(mrarg[2], ".LOCAL"); + mrarg[1] = "SMTP"; + } else if (mrarg[1]) { + if (*machine != '"' && strcasecmp(mrarg[2], machine)) printf("Warning: hostname %s canonicalized to %s\n", - machine, smsarg[2]); + machine, mrarg[2]); strcat(address, "@"); - strcat(address, smsarg[2]); - smsarg[2] = address; + strcat(address, mrarg[2]); + mrarg[2] = address; } else goto show; - status = sms_query("set_pobox", 3, smsarg, scream, NULL); + status = mr_query("set_pobox", 3, mrarg, scream, NULL); if (status) com_err(whoami, status, " while setting pobox for %s to type %s, box %s", - smsarg[0], smsarg[1], smsarg[2]); + mrarg[0], mrarg[1], mrarg[2]); } else if (prevpop) { - status = sms_query("set_pobox_pop", 1, smsarg, scream, NULL); - if (status == SMS_MACHINE) { + status = mr_query("set_pobox_pop", 1, mrarg, scream, NULL); + if (status == MR_MACHINE) { fprintf(stderr, "Moira has no record of a previous POP box for %s\n", uname); } else if (status != 0) @@ -207,12 +207,12 @@ main(argc, argv) * get current box */ show: - status = sms_query("get_pobox", 1, smsarg, get_pobox, NULL); - if (status == SMS_NO_MATCH) + status = mr_query("get_pobox", 1, mrarg, get_pobox, NULL); + if (status == MR_NO_MATCH) printf("User %s has no pobox.\n", uname); else if (status != 0) com_err(whoami, status, " while retrieving current mailbox"); - sms_disconnect(); + mr_disconnect(); exit(0); } @@ -220,7 +220,7 @@ show: scream() { com_err(whoami, 0, "Unexpected return value from Moira -- programmer botch"); - sms_disconnect(); + mr_disconnect(); exit(1); } @@ -245,7 +245,7 @@ get_pobox(argc, argv, callarg) } /* - * given a canonicalized machine name, ask the SMS server if it is of type + * given a canonicalized machine name, ask the MR server if it is of type * pop, or of type local -- if neither, we assume that it's of type foreign. */ char * @@ -257,9 +257,9 @@ potype(machine) match = 0; service[0] = "POP"; - status = sms_query("get_server_locations", 1, service, + status = mr_query("get_server_locations", 1, service, check_match, machine); - if (status && (status != SMS_NO_MATCH)) { + if (status && (status != MR_NO_MATCH)) { com_err(whoami, status, " while reading list of POP servers"); return(NULL); } @@ -267,9 +267,9 @@ potype(machine) return ("POP"); service[0] = "LOCAL"; - status = sms_query("get_server_locations", 1, service, + status = mr_query("get_server_locations", 1, service, check_match, machine); - if (status && (status != SMS_NO_MATCH)) { + if (status && (status != MR_NO_MATCH)) { com_err(whoami, status, " while reading list of LOCAL servers"); return(NULL); } diff --git a/clients/passwd/chsh.c b/clients/passwd/chsh.c index e4d45939..20c3fe2c 100644 --- a/clients/passwd/chsh.c +++ b/clients/passwd/chsh.c @@ -13,7 +13,7 @@ static char *rcsid_chsh_c = "$Header$"; #endif not lint /* - * Talk to the SMS database to change a person's login shell. The chosen + * Talk to the MOIRA database to change a person's login shell. The chosen * shell must exist. A warning will be issued if the shell is not in * /etc/shells. * @@ -33,9 +33,9 @@ static char *rcsid_chsh_c = "$Header$"; #include #include -/* SMS includes */ -#include -#include +/* MOIRA includes */ +#include +#include #include "mit-copyright.h" char *whoami; @@ -86,10 +86,10 @@ main(argc, argv) leave(status) int status; - /* This should be called rather than exit once connection to sms server + /* This should be called rather than exit once connection to moira server has been established. */ { - sms_disconnect(); + mr_disconnect(); exit(status); } @@ -103,9 +103,9 @@ chsh(uname) char *uname; { int status; /* general purpose exit status */ - int q_argc; /* argc for sms_query */ - char *q_argv[U_END]; /* argv for sms_query */ - char *motd; /* determine SMS server status */ + int q_argc; /* argc for mr_query */ + char *q_argv[U_END]; /* argv for mr_query */ + char *motd; /* determine MR server status */ int got_one = 0; /* have we got a new shell yet? */ char shell[BUFSIZ]; /* the new shell */ @@ -114,13 +114,13 @@ chsh(uname) /* Try each query. If we ever fail, print error message and exit. */ - status = sms_connect(NULL); + status = mr_connect(NULL); if (status) { com_err(whoami, status, " while connecting to Moira"); exit(1); } - status = sms_motd(&motd); + status = mr_motd(&motd); if (status) { com_err(whoami, status, " unable to check server status"); leave(1); @@ -130,7 +130,7 @@ chsh(uname) leave(1); } - status = sms_auth("chsh"); /* Don't use argv[0] - too easy to fake */ + status = mr_auth("chsh"); /* Don't use argv[0] - too easy to fake */ if (status) { com_err(whoami, status, " while authenticating -- run \"kinit\" and try again."); @@ -143,7 +143,7 @@ chsh(uname) q_argv[USH_SHELL] = "junk"; q_argc = USH_END; - if (status = sms_access("update_user_shell", q_argc, q_argv)) + if (status = mr_access("update_user_shell", q_argc, q_argv)) { com_err(whoami, status, "; shell not\nchanged."); leave(2); @@ -156,7 +156,7 @@ chsh(uname) q_argv[NAME] = uname; q_argc = NAME + 1; - if ((status = sms_query("get_user_by_login", q_argc, q_argv, + if ((status = mr_query("get_user_by_login", q_argc, q_argv, get_shell, (char *) uname))) { com_err(whoami, status, " while getting user information."); @@ -184,7 +184,7 @@ chsh(uname) q_argv[USH_NAME] = uname; q_argv[USH_SHELL] = shell; q_argc = USH_END; - if (status = sms_query("update_user_shell", q_argc, q_argv, + if (status = mr_query("update_user_shell", q_argc, q_argv, scream, (char *) NULL)) { com_err(whoami, status, " while changing shell."); @@ -192,7 +192,7 @@ chsh(uname) } printf("Shell successfully changed.\n"); - sms_disconnect(); + mr_disconnect(); return(0); } @@ -215,7 +215,7 @@ get_shell(argc, argv, uname) printf("by user %s with %s.\n", argv[U_MODBY], argv[U_MODWITH]); printf("Current shell for %s is %s.\n", uname, argv[U_SHELL]); - return(SMS_ABORT); /* Don't pay attention to other matches. */ + return(MR_ABORT); /* Don't pay attention to other matches. */ } void check_shell(shell) diff --git a/clients/userreg/Makefile b/clients/userreg/Makefile index 8a88e96e..58b30353 100644 --- a/clients/userreg/Makefile +++ b/clients/userreg/Makefile @@ -17,7 +17,7 @@ all: userreg userreg: userreg.o display.o reg_stubs.o disable.o cc ${CFLAGS} -o $@ userreg.o display.o reg_stubs.o disable.o \ - -L../../lib -lcom_err -lkrb -ldes -lsms -lcurses \ + -L../../lib -lcom_err -lkrb -ldes -lmoira -lcurses \ -ltermcap -lhesiod userreg.o display.o: userreg.h files.h @@ -56,8 +56,8 @@ reg_stubs.o: reg_stubs.c ../../include/mit-copyright.h /usr/include/stdio.h reg_stubs.o: /usr/include/sys/types.h /usr/include/sys/time.h reg_stubs.o: /usr/include/sys/time.h /usr/include/sys/socket.h reg_stubs.o: /usr/include/netinet/in.h /usr/include/netdb.h -reg_stubs.o: ../../include/des.h /usr/include/errno.h ../../include/sms.h -reg_stubs.o: ../../include/sms_et.h ../../include/sms_app.h +reg_stubs.o: ../../include/des.h /usr/include/errno.h ../../include/moira.h +reg_stubs.o: ../../include/mr_et.h ../../include/moira_site.h reg_stubs.o: ../../include/ureg_err.h ../../include/ureg_proto.h reg_stubs.o: /usr/include/strings.h disable.o: disable.c ../../include/mit-copyright.h /usr/include/stdio.h diff --git a/clients/userreg/reg_stubs.c b/clients/userreg/reg_stubs.c index 8c0ea174..d20f487f 100644 --- a/clients/userreg/reg_stubs.c +++ b/clients/userreg/reg_stubs.c @@ -21,8 +21,8 @@ static char *rcsid_reg_stubs_c = "$Header$"; #include #include #include -#include -#include +#include +#include #include "ureg_err.h" #include "ureg_proto.h" #include @@ -54,7 +54,7 @@ ureg_init() } #endif HESIOD if (!host || (strlen(host) == 0)) { - host = strsave(SMS_SERVER); + host = strsave(MOIRA_SERVER); s = index(host, ':'); if (s) *s = 0; } diff --git a/include/Makefile b/include/Makefile index 386a6c2a..926e4e36 100644 --- a/include/Makefile +++ b/include/Makefile @@ -4,19 +4,19 @@ # $Header$ # $Author$ # -# (c) Copyright 1988 by the Massachusetts Institute of Technology. +# (c) Copyright 1988, 1990 by the Massachusetts Institute of Technology. # For copying and distribution information, please see the file # . DESTDIR= -FILES= sms.h sms_app.h sms_et.h +FILES= moira.h moira_site.h mr_et.h all: install: ${FILES} - install -c -m 644 sms.h ${DESTDIR}/usr/include/sms.h - install -c -m 644 sms_app.h ${DESTDIR}/usr/include/sms_app.h - install -c -m 644 sms_et.h ${DESTDIR}/usr/include/sms_et.h + install -c -m 644 moira.h ${DESTDIR}/usr/include/moira.h + install -c -m 644 moira_site.h ${DESTDIR}/usr/include/moira_site.h + install -c -m 644 mr_et.h ${DESTDIR}/usr/include/mr_et.h depend: diff --git a/include/moira.h b/include/moira.h index ad6990e2..ba012ef9 100644 --- a/include/moira.h +++ b/include/moira.h @@ -12,13 +12,13 @@ /* return values from queries (and error codes) */ -#include "sms_et.h" +#include "mr_et.h" #define MR_SUCCESS 0 /* Query was successful */ #define MR_VERSION_1 1 /* Version in use from 7/87 to 4/88 */ #define MR_VERSION_2 2 /* After 4/88, new query lib */ -/* return values for sms server calls, used by clients */ +/* return values for Moira server calls, used by clients */ #define MR_CONT 0 /* Everything okay, continue sending values. */ #define MR_ABORT -1 /* Something went wrong don't send anymore diff --git a/include/moira_site.h b/include/moira_site.h index f1b7f035..a1d649a3 100644 --- a/include/moira_site.h +++ b/include/moira_site.h @@ -20,13 +20,13 @@ * see the file mit-copyright.h */ -#ifndef _sms_app_ -#define _sms_app_ +#ifndef _moira_site_ +#define _moira_site_ #include "mit-copyright.h" /* Default Moira server to connect to */ -#define SMS_SERVER "SMS.MIT.EDU:sms_db" +#define MOIRA_SERVER "MOIRA.MIT.EDU:sms_db" /* Compile-time options: */ /* used hesiod looking up Moira server name */ @@ -329,7 +329,7 @@ #define JOURNAL "/u1/sms/journal" #define REGJOURNAL "/u1/sms/journal.reg" #define NODCMFILE "/etc/nodcm" /* flag to inhibit DCM running */ -#define SMS_MOTD_FILE "/etc/smsdown" /* make the server go to sleep */ +#define MOIRA_MOTD_FILE "/etc/smsdown" /* make the server go to sleep */ -#endif _sms_app_ /* Do not add anything after this line. */ +#endif _moira_site_ /* Do not add anything after this line. */ diff --git a/lib/Makefile b/lib/Makefile index bc3e7a21..e28c6c5e 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -2,19 +2,19 @@ # $Author$ # $Header$ # -# Makefile for SMS library. +# Makefile for Moira library. # -LIBSRC=sms_auth.c sms_call.c sms_connect.c sms_data.c sms_init.c \ - sms_query.c sms_param.c sms_access.c sms_ops.c \ +LIBSRC=mr_auth.c mr_call.c mr_connect.c mr_data.c mr_init.c \ + mr_query.c mr_param.c mr_access.c mr_ops.c \ fixname.c strs.c fixhost.c nfsparttype.c sq.c hash.c \ idno.c critical.c CFILES=${LIBSRC} -LIBOBJ=sms_auth.o sms_call.o sms_connect.o sms_data.o sms_init.o \ - sms_query.o sms_param.o sms_access.o sms_ops.o \ +LIBOBJ=mr_auth.o mr_call.o mr_connect.o mr_data.o mr_init.o \ + mr_query.o mr_param.o mr_access.o mr_ops.o \ fixname.o strs.o fixhost.o nfsparttype.o sq.o hash.o \ - idno.o critical.o sms_et.o ureg_err.o krb_et.o + idno.o critical.o mr_et.o ureg_err.o krb_et.o COPTS= -O @@ -23,7 +23,7 @@ INCDIRS=-I../include CFLAGS= ${INCDIRS} ${COPTS} LINTFLAGS= -uhv -ALL=libsms.a llib-lsms.ln # libsms_p.a +ALL=libmoira.a llib-lmoira.ln # libmoira_p.a .c.o: ${CC} -c -pg ${CFLAGS} $*.c @@ -35,19 +35,19 @@ ALL=libsms.a llib-lsms.ln # libsms_p.a all: ${ALL} -libsms.a: ${LIBOBJ} +libmoira.a: ${LIBOBJ} ar cruv $@ `lorder ${LIBOBJ} | tsort` ranlib $@ - (cd profiled; ar cruv ../libsms_p.a ${LIBOBJ}; ranlib ../libsms_p.a) + (cd profiled; ar cruv ../libmoira_p.a ${LIBOBJ}; ranlib ../libmoira_p.a) -smslib.dvi: smslib.tex - latex smslib.tex +mrlib.dvi: mrlib.tex + latex mrlib.tex krb_et.c krb_et.h: krb_et.et ../et/compile_et ../et/compile_et krb_et.et -sms_et.c sms_et.h: sms_et.et ../et/compile_et - ../et/compile_et sms_et.et +mr_et.c mr_et.h: mr_et.et ../et/compile_et + ../et/compile_et mr_et.et ureg_err.c ureg_err.h: ureg_err.et ../et/compile_et ../et/compile_et ureg_err.et @@ -55,75 +55,75 @@ ureg_err.c ureg_err.h: ureg_err.et ../et/compile_et ../et/compile_et: cd ../et; make compile_et -../include/sms_et.h: sms_et.h +../include/mr_et.h: mr_et.h clean: rm -f ${ALL} - rm -f *.o *~ sms_et.h krb_et.h ureg_err.h profiled/*.o \#* - rm -f krb_et.c sms_et.c ureg_err.c + rm -f *.o *~ mr_et.h krb_et.h ureg_err.h profiled/*.o \#* + rm -f krb_et.c mr_et.c ureg_err.c rm -f *.PS *.aux *.dvi *.log rm -f *.bak install: - install -c -m 644 libsms.a ${DESTDIR}/usr/athena/lib/libsms.a - ranlib ${DESTDIR}/usr/athena/lib/libsms.a - install -c -m 644 libsms_p.a ${DESTDIR}/usr/athena/lib/libsms_p.a - ranlib ${DESTDIR}/usr/athena/lib/libsms_p.a - install -c -m 644 llib-lsms.ln ${DESTDIR}/usr/lib/lint/llib-lsms.ln + install -c -m 644 libmoira.a ${DESTDIR}/usr/athena/lib/libmoira.a + ranlib ${DESTDIR}/usr/athena/lib/libmoira.a + install -c -m 644 libmoira_p.a ${DESTDIR}/usr/athena/lib/libmoira_p.a + ranlib ${DESTDIR}/usr/athena/lib/libmoira_p.a + install -c -m 644 llib-lmoira.ln ${DESTDIR}/usr/lib/lint/llib-lmoira.ln TAGS: $(CFILES) -etags $(CFILES) -lint: ${CFILES} llib-lsms.ln - lint ${LINTFLAGS} ${INCDIRS} sms_main.c llib-lsms.ln +lint: ${CFILES} llib-lmoira.ln + lint ${LINTFLAGS} ${INCDIRS} mr_main.c llib-lmoira.ln -llib-lsms.ln: ${LIBSRC} - lint -Csms $(LINTFLAGS) $(INCDIRS) ${LIBSRC} +llib-lmoira.ln: ${LIBSRC} + lint -Cmr $(LINTFLAGS) $(INCDIRS) ${LIBSRC} -depend: $(CFILES) sms_et.h ureg_err.h krb_et.h +depend: $(CFILES) mr_et.h ureg_err.h krb_et.h mkdep ${CFLAGS} ${CFILES} # DO NOT DELETE THIS LINE -- mkdep uses it. -sms_auth.o: sms_auth.c ../include/mit-copyright.h sms_private.h -sms_auth.o: ../include/sms_proto.h /usr/include/stdio.h ../include/gdb.h -sms_auth.o: /usr/include/sys/types.h /usr/include/sys/time.h -sms_auth.o: /usr/include/sys/time.h ../include/sms.h sms_et.h -sms_auth.o: ../include/krb.h ../include/des.h krb_et.h -sms_call.o: sms_call.c ../include/mit-copyright.h sms_private.h -sms_call.o: ../include/sms_proto.h /usr/include/stdio.h ../include/gdb.h -sms_call.o: /usr/include/sys/types.h /usr/include/sys/time.h -sms_call.o: /usr/include/sys/time.h ../include/sms.h sms_et.h -sms_connect.o: sms_connect.c ../include/mit-copyright.h sms_private.h -sms_connect.o: ../include/sms_proto.h /usr/include/stdio.h ../include/gdb.h -sms_connect.o: /usr/include/sys/types.h /usr/include/sys/time.h -sms_connect.o: /usr/include/sys/time.h ../include/sms.h sms_et.h -sms_connect.o: ../include/sms_app.h /usr/include/strings.h -sms_data.o: sms_data.c ../include/mit-copyright.h sms_private.h -sms_data.o: ../include/sms_proto.h /usr/include/stdio.h ../include/gdb.h -sms_data.o: /usr/include/sys/types.h /usr/include/sys/time.h -sms_data.o: /usr/include/sys/time.h ../include/sms.h sms_et.h -sms_init.o: sms_init.c ../include/mit-copyright.h sms_private.h -sms_init.o: ../include/sms_proto.h /usr/include/stdio.h ../include/gdb.h -sms_init.o: /usr/include/sys/types.h /usr/include/sys/time.h -sms_init.o: /usr/include/sys/time.h ../include/sms.h sms_et.h -sms_query.o: sms_query.c ../include/mit-copyright.h sms_private.h -sms_query.o: ../include/sms_proto.h /usr/include/stdio.h ../include/gdb.h -sms_query.o: /usr/include/sys/types.h /usr/include/sys/time.h -sms_query.o: /usr/include/sys/time.h ../include/sms.h sms_et.h -sms_param.o: sms_param.c ../include/mit-copyright.h /usr/include/sys/types.h -sms_param.o: /usr/include/netinet/in.h sms_private.h ../include/sms_proto.h -sms_param.o: /usr/include/stdio.h ../include/gdb.h /usr/include/sys/time.h -sms_param.o: /usr/include/sys/time.h ../include/sms.h sms_et.h -sms_access.o: sms_access.c ../include/mit-copyright.h sms_private.h -sms_access.o: ../include/sms_proto.h /usr/include/stdio.h ../include/gdb.h -sms_access.o: /usr/include/sys/types.h /usr/include/sys/time.h -sms_access.o: /usr/include/sys/time.h ../include/sms.h sms_et.h -sms_ops.o: sms_ops.c ../include/mit-copyright.h sms_private.h -sms_ops.o: ../include/sms_proto.h /usr/include/stdio.h ../include/gdb.h -sms_ops.o: /usr/include/sys/types.h /usr/include/sys/time.h -sms_ops.o: /usr/include/sys/time.h ../include/sms.h sms_et.h +mr_auth.o: mr_auth.c ../include/mit-copyright.h mr_private.h +mr_auth.o: ../include/mr_proto.h /usr/include/stdio.h ../include/gdb.h +mr_auth.o: /usr/include/sys/types.h /usr/include/sys/time.h +mr_auth.o: /usr/include/sys/time.h ../include/moira.h mr_et.h +mr_auth.o: /usr/include/ctype.h ../include/krb.h ../include/des.h krb_et.h +mr_call.o: mr_call.c ../include/mit-copyright.h mr_private.h +mr_call.o: ../include/mr_proto.h /usr/include/stdio.h ../include/gdb.h +mr_call.o: /usr/include/sys/types.h /usr/include/sys/time.h +mr_call.o: /usr/include/sys/time.h ../include/moira.h mr_et.h +mr_connect.o: mr_connect.c ../include/mit-copyright.h mr_private.h +mr_connect.o: ../include/mr_proto.h /usr/include/stdio.h ../include/gdb.h +mr_connect.o: /usr/include/sys/types.h /usr/include/sys/time.h +mr_connect.o: /usr/include/sys/time.h ../include/moira.h mr_et.h +mr_connect.o: ../include/moira_site.h /usr/include/strings.h +mr_data.o: mr_data.c ../include/mit-copyright.h mr_private.h +mr_data.o: ../include/mr_proto.h /usr/include/stdio.h ../include/gdb.h +mr_data.o: /usr/include/sys/types.h /usr/include/sys/time.h +mr_data.o: /usr/include/sys/time.h ../include/moira.h mr_et.h +mr_init.o: mr_init.c ../include/mit-copyright.h mr_private.h +mr_init.o: ../include/mr_proto.h /usr/include/stdio.h ../include/gdb.h +mr_init.o: /usr/include/sys/types.h /usr/include/sys/time.h +mr_init.o: /usr/include/sys/time.h ../include/moira.h mr_et.h +mr_query.o: mr_query.c ../include/mit-copyright.h mr_private.h +mr_query.o: ../include/mr_proto.h /usr/include/stdio.h ../include/gdb.h +mr_query.o: /usr/include/sys/types.h /usr/include/sys/time.h +mr_query.o: /usr/include/sys/time.h ../include/moira.h mr_et.h +mr_param.o: mr_param.c ../include/mit-copyright.h /usr/include/sys/types.h +mr_param.o: /usr/include/netinet/in.h mr_private.h ../include/mr_proto.h +mr_param.o: /usr/include/stdio.h ../include/gdb.h /usr/include/sys/time.h +mr_param.o: /usr/include/sys/time.h ../include/moira.h mr_et.h +mr_access.o: mr_access.c ../include/mit-copyright.h mr_private.h +mr_access.o: ../include/mr_proto.h /usr/include/stdio.h ../include/gdb.h +mr_access.o: /usr/include/sys/types.h /usr/include/sys/time.h +mr_access.o: /usr/include/sys/time.h ../include/moira.h mr_et.h +mr_ops.o: mr_ops.c ../include/mit-copyright.h mr_private.h +mr_ops.o: ../include/mr_proto.h /usr/include/stdio.h ../include/gdb.h +mr_ops.o: /usr/include/sys/types.h /usr/include/sys/time.h +mr_ops.o: /usr/include/sys/time.h ../include/moira.h mr_et.h fixname.o: fixname.c ../include/mit-copyright.h /usr/include/strings.h fixname.o: /usr/include/ctype.h strs.o: strs.c ../include/mit-copyright.h /usr/include/sys/types.h @@ -133,19 +133,19 @@ fixhost.o: /usr/include/sys/socket.h /usr/include/netinet/in.h fixhost.o: /usr/include/arpa/nameser.h /usr/include/arpa/resolv.h fixhost.o: /usr/include/netdb.h /usr/include/stdio.h /usr/include/strings.h fixhost.o: /usr/include/ctype.h -nfsparttype.o: nfsparttype.c ../include/mit-copyright.h ../include/sms.h -nfsparttype.o: sms_et.h /usr/include/stdio.h /usr/include/strings.h +nfsparttype.o: nfsparttype.c ../include/mit-copyright.h ../include/moira.h +nfsparttype.o: mr_et.h /usr/include/stdio.h /usr/include/strings.h nfsparttype.o: /usr/include/ctype.h -sq.o: sq.c ../include/mit-copyright.h ../include/sms.h sms_et.h +sq.o: sq.c ../include/mit-copyright.h ../include/moira.h mr_et.h hash.o: hash.c ../include/mit-copyright.h /usr/include/ctype.h -hash.o: ../include/sms.h sms_et.h +hash.o: ../include/moira.h mr_et.h idno.o: idno.c ../include/mit-copyright.h /usr/include/strings.h idno.o: /usr/include/ctype.h critical.o: critical.c ../include/mit-copyright.h /usr/include/stdio.h -critical.o: /usr/include/sys/file.h /usr/include/zephyr/zephyr.h -critical.o: /usr/include/zephyr/mit-copyright.h +critical.o: /usr/include/sys/file.h ../include/moira_site.h +critical.o: /usr/include/zephyr/zephyr.h /usr/include/zephyr/mit-copyright.h critical.o: /usr/include/zephyr/zephyr_err.h critical.o: /usr/include/zephyr/zephyr_conf.h /usr/include/errno.h critical.o: /usr/include/sys/types.h /usr/include/netinet/in.h critical.o: /usr/include/sys/time.h /usr/include/sys/time.h ../include/krb.h -critical.o: ../include/des.h ../include/sms_app.h +critical.o: ../include/des.h diff --git a/lib/critical.c b/lib/critical.c index f026d64a..9bdfd1e5 100644 --- a/lib/critical.c +++ b/lib/critical.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #ifdef ZEPHYR #include #endif @@ -25,7 +25,7 @@ extern char *whoami; -/* This routine sends a class SMS zephyrgram of specified instance +/* This routine sends a class MOIRA zephyrgram of specified instance * and logs to a special logfile the message passed to it via msg * and args in printf format. *** It expects the global variable * whoami to be defined and contain the name of the calling program. @@ -67,7 +67,7 @@ void critical_alert(instance, msg, arg1, arg2, arg3, arg4, -/* Sends a zephyrgram of class "SMS", instance as a parameter. Ignores +/* Sends a zephyrgram of class "MOIRA", instance as a parameter. Ignores * errors while sending message. */ @@ -80,9 +80,9 @@ char *msg; bzero (&znotice, sizeof (znotice)); znotice.z_kind = UNSAFE; - znotice.z_class = "SMS"; + znotice.z_class = "MOIRA"; znotice.z_class_inst = inst; - znotice.z_default_format = "SMS $instance:\n $message\n"; + znotice.z_default_format = "MOIRA $instance:\n $message\n"; (void) ZInitialize (); znotice.z_message = msg; znotice.z_message_len = strlen(msg) + 1; @@ -93,7 +93,7 @@ char *msg; #ifdef SYSLOG { char buf[512]; - sprintf(buf, "SMS: %s %s", inst, msg); + sprintf(buf, "MOIRA: %s %s", inst, msg); syslog(LOG_ERR, buf); } #endif diff --git a/lib/hash.c b/lib/hash.c index c6cef7ee..2a41cd2e 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -9,7 +9,7 @@ #include #include -#include +#include #define NULL 0 #define hash_func(h, key) (key >= 0 ? (key % h->size) : (-key % h->size)) diff --git a/lib/mr_access.c b/lib/mr_access.c index 7fe0d3b7..a6a24f9b 100644 --- a/lib/mr_access.c +++ b/lib/mr_access.c @@ -3,7 +3,7 @@ * $Author$ * $Header$ * - * Copyright (C) 1987 by the Massachusetts Institute of Technology + * Copyright (C) 1987, 1990 by the Massachusetts Institute of Technology * For copying and distribution information, please see the file * . */ @@ -13,12 +13,12 @@ static char *rcsid_sms_access_c = "$Header$"; #endif lint #include -#include "sms_private.h" +#include "mr_private.h" /* * Check access to a named query. */ -int sms_access(name, argc, argv) +int mr_access(name, argc, argv) char *name; /* Query name */ int argc; /* Arg count */ char **argv; /* Args */ @@ -27,7 +27,7 @@ int sms_access(name, argc, argv) register int status = 0; nargv[0] = name; bcopy((char *)argv, (char *)(nargv+1), sizeof(char *) * argc); - status = sms_access_internal(argc+1, nargv); + status = mr_access_internal(argc+1, nargv); free(nargv); return status; } @@ -35,39 +35,28 @@ int sms_access(name, argc, argv) * Check access to a named query, where the query name is argv[0] * and the arguments are the rest of argv[]. */ -int sms_access_internal(argc, argv) +int mr_access_internal(argc, argv) int argc; /* Arg count */ char **argv; /* Args */ { int status; - sms_params params_st; - register sms_params *params = NULL; - sms_params *reply = NULL; + mr_params params_st; + register mr_params *params = NULL; + mr_params *reply = NULL; CHECK_CONNECTED; params = ¶ms_st; - params->sms_version_no = sending_version_no; - params->sms_procno = SMS_ACCESS; - params->sms_argc = argc; - params->sms_argl = NULL; - params->sms_argv = argv; + params->mr_version_no = sending_version_no; + params->mr_procno = MR_ACCESS; + params->mr_argc = argc; + params->mr_argl = NULL; + params->mr_argv = argv; - if ((status = sms_do_call(params, &reply)) == 0) - status = reply->sms_status; + if ((status = mr_do_call(params, &reply)) == 0) + status = reply->mr_status; - sms_destroy_reply(reply); + mr_destroy_reply(reply); return status; } - -/* - * Local Variables: - * mode: c - * c-indent-level: 4 - * c-continued-statement-offset: 4 - * c-brace-offset: -4 - * c-argdecl-indent: 4 - * c-label-offset: -4 - * End: - */ diff --git a/lib/mr_auth.c b/lib/mr_auth.c index df046e18..53b6349e 100644 --- a/lib/mr_auth.c +++ b/lib/mr_auth.c @@ -3,12 +3,12 @@ * $Author$ * $Header$ * - * Copyright (C) 1987 by the Massachusetts Institute of Technology + * Copyright (C) 1987, 1990 by the Massachusetts Institute of Technology * For copying and distribution information, please see the file * . * * Handles the client side of the sending of authenticators to - * the sms server. + * the mr server. */ #ifndef lint @@ -16,26 +16,26 @@ static char *rcsid_sms_auth_c = "$Header$"; #endif lint #include -#include "sms_private.h" +#include "mr_private.h" #include #include #include -/* Authenticate this client with the SMS server. prog is the name of the +/* Authenticate this client with the MR server. prog is the name of the * client program, and will be recorded in the database. */ -int sms_auth(prog) +int mr_auth(prog) char *prog; { register int status; - sms_params params_st; + mr_params params_st; char *args[2]; int argl[2]; char realm[REALM_SZ], host[BUFSIZ], *p; - register sms_params *params = ¶ms_st; - sms_params *reply = NULL; + register mr_params *params = ¶ms_st; + mr_params *reply = NULL; KTEXT_ST auth; CHECK_CONNECTED; @@ -43,7 +43,7 @@ char *prog; /* Build a Kerberos authenticator. */ bzero(host, sizeof(host)); - if (status = sms_host(host, sizeof(host) - 1)) + if (status = mr_host(host, sizeof(host) - 1)) return status; strcpy(realm, krb_realmofhost(host)); @@ -57,23 +57,23 @@ char *prog; status += ERROR_TABLE_BASE_krb; return status; } - params->sms_version_no = sending_version_no; - params->sms_procno = SMS_AUTH; - params->sms_argc = 2; - params->sms_argv = args; - params->sms_argl = argl; - params->sms_argv[0] = (char *)auth.dat; - params->sms_argl[0] = auth.length; - params->sms_argv[1] = prog; - params->sms_argl[1] = strlen(prog) + 1; + params->mr_version_no = sending_version_no; + params->mr_procno = MR_AUTH; + params->mr_argc = 2; + params->mr_argv = args; + params->mr_argl = argl; + params->mr_argv[0] = (char *)auth.dat; + params->mr_argl[0] = auth.length; + params->mr_argv[1] = prog; + params->mr_argl[1] = strlen(prog) + 1; - if (sending_version_no == SMS_VERSION_1) - params->sms_argc = 1; + if (sending_version_no == MR_VERSION_1) + params->mr_argc = 1; - if ((status = sms_do_call(params, &reply)) == 0) - status = reply->sms_status; + if ((status = mr_do_call(params, &reply)) == 0) + status = reply->mr_status; - sms_destroy_reply(reply); + mr_destroy_reply(reply); return status; } diff --git a/lib/mr_call.c b/lib/mr_call.c index dde886c0..86ca32c9 100644 --- a/lib/mr_call.c +++ b/lib/mr_call.c @@ -13,36 +13,36 @@ static char *rcsid_sms_call_c = "$Header$"; #endif lint #include -#include "sms_private.h" +#include "mr_private.h" -sms_do_call(params, reply) - struct sms_params *params; - struct sms_params **reply; +mr_do_call(params, reply) + struct mr_params *params; + struct mr_params **reply; { CHECK_CONNECTED; - if (!_sms_send_op) - _sms_send_op = create_operation(); + if (!_mr_send_op) + _mr_send_op = create_operation(); - if (!_sms_recv_op) - _sms_recv_op = create_operation(); + if (!_mr_recv_op) + _mr_recv_op = create_operation(); - initialize_operation(_sms_send_op, sms_start_send, (char *)params, + initialize_operation(_mr_send_op, mr_start_send, (char *)params, (int (*)())NULL); - queue_operation(_sms_conn, CON_OUTPUT, _sms_send_op); + queue_operation(_mr_conn, CON_OUTPUT, _mr_send_op); - initialize_operation(_sms_recv_op, sms_start_recv, (char *)reply, + initialize_operation(_mr_recv_op, mr_start_recv, (char *)reply, (int (*)())NULL); - queue_operation(_sms_conn, CON_INPUT, _sms_recv_op); + queue_operation(_mr_conn, CON_INPUT, _mr_recv_op); /* Block until operation done. */ - sms_complete_operation(_sms_send_op); - sms_complete_operation(_sms_recv_op); + mr_complete_operation(_mr_send_op); + mr_complete_operation(_mr_recv_op); /* Look at results */ - if ((OP_STATUS(_sms_send_op) != OP_COMPLETE) || - (OP_STATUS(_sms_recv_op) != OP_COMPLETE)) { - sms_disconnect(); - return SMS_ABORTED; + if ((OP_STATUS(_mr_send_op) != OP_COMPLETE) || + (OP_STATUS(_mr_recv_op) != OP_COMPLETE)) { + mr_disconnect(); + return MR_ABORTED; } return 0; } diff --git a/lib/mr_connect.c b/lib/mr_connect.c index 366166ad..e1d197e7 100644 --- a/lib/mr_connect.c +++ b/lib/mr_connect.c @@ -3,12 +3,12 @@ * $Author$ * $Header$ * - * Copyright (C) 1987 by the Massachusetts Institute of Technology + * Copyright (C) 1987, 1990 by the Massachusetts Institute of Technology * For copying and distribution information, please see the file * . * * This routine is part of the client library. It handles - * creating a connection to the sms server. + * creating a connection to the mr server. */ #ifndef lint @@ -16,27 +16,27 @@ static char *rcsid_sms_connect_c = "$Header$"; #endif lint #include -#include "sms_private.h" -#include +#include "mr_private.h" +#include #include -static char *sms_server_host = 0; +static char *mr_server_host = 0; /* - * Open a connection to the sms server. Looks for the server name + * Open a connection to the mr server. Looks for the server name * 1) passed as an argument, 2) in environment variable, 3) by hesiod * 4) compiled in default (from sms_app.h). */ -int sms_connect(server) +int mr_connect(server) char *server; { extern int errno; char *p, **pp, sbuf[256]; extern char *getenv(), **hes_resolve(); - if (!sms_inited) sms_init(); - if (_sms_conn) return SMS_ALREADY_CONNECTED; + if (!mr_inited) mr_init(); + if (_mr_conn) return MR_ALREADY_CONNECTED; if (!server || (strlen(server) == 0)) { server = getenv("MOIRASERVER"); @@ -50,24 +50,24 @@ char *server; #endif HESIOD if (!server || (strlen(server) == 0)) { - server = SMS_SERVER; + server = MOIRA_SERVER; } if (!index(server, ':')) { - p = index(SMS_SERVER, ':'); + p = index(MOIRA_SERVER, ':'); p++; sprintf(sbuf, "%s:%s", server, p); server = sbuf; } errno = 0; - _sms_conn = start_server_connection(server, ""); - if (_sms_conn == NULL) + _mr_conn = start_server_connection(server, ""); + if (_mr_conn == NULL) return errno; - if (connection_status(_sms_conn) == CON_STOPPED) { - register status = connection_errno(_sms_conn); - if (!status) status = SMS_CANT_CONNECT; - sms_disconnect(); + if (connection_status(_mr_conn) == CON_STOPPED) { + register status = connection_errno(_mr_conn); + if (!status) status = MR_CANT_CONNECT; + mr_disconnect(); return status; } @@ -75,52 +75,52 @@ char *server; * stash hostname for later use */ - sms_server_host = strsave(server); - if (p = index(sms_server_host, ':')) + mr_server_host = strsave(server); + if (p = index(mr_server_host, ':')) *p = 0; - sms_server_host = canonicalize_hostname(sms_server_host); + mr_server_host = canonicalize_hostname(mr_server_host); return 0; } -int sms_disconnect() +int mr_disconnect() { CHECK_CONNECTED; - _sms_conn = sever_connection(_sms_conn); - free(sms_server_host); - sms_server_host = 0; + _mr_conn = sever_connection(_mr_conn); + free(mr_server_host); + mr_server_host = 0; return 0; } -int sms_host(host, size) +int mr_host(host, size) char *host; int size; { CHECK_CONNECTED; - /* If we are connected, sms_server_host points to a valid string. */ - strncpy(host, sms_server_host, size); + /* If we are connected, mr_server_host points to a valid string. */ + strncpy(host, mr_server_host, size); return(0); } -int sms_noop() +int mr_noop() { int status; - sms_params param_st; - struct sms_params *params = NULL; - struct sms_params *reply = NULL; + mr_params param_st; + struct mr_params *params = NULL; + struct mr_params *reply = NULL; CHECK_CONNECTED; params = ¶m_st; - params->sms_version_no = sending_version_no; - params->sms_procno = SMS_NOOP; - params->sms_argc = 0; - params->sms_argl = NULL; - params->sms_argv = NULL; + params->mr_version_no = sending_version_no; + params->mr_procno = MR_NOOP; + params->mr_argc = 0; + params->mr_argl = NULL; + params->mr_argv = NULL; - if ((status = sms_do_call(params, &reply)) == 0) - status = reply->sms_status; + if ((status = mr_do_call(params, &reply)) == 0) + status = reply->mr_status; - sms_destroy_reply(reply); + mr_destroy_reply(reply); return status; } diff --git a/lib/mr_data.c b/lib/mr_data.c index 55ce0b5d..8e7f4ffa 100644 --- a/lib/mr_data.c +++ b/lib/mr_data.c @@ -14,11 +14,11 @@ static char *rcsid_sms_data_c = "$Header$"; #endif lint #include -#include "sms_private.h" +#include "mr_private.h" -CONNECTION _sms_conn; +CONNECTION _mr_conn; -OPERATION _sms_send_op, _sms_recv_op; +OPERATION _mr_send_op, _mr_recv_op; -int sending_version_no = SMS_VERSION_2; +int sending_version_no = MR_VERSION_2; diff --git a/lib/mr_init.c b/lib/mr_init.c index b2310f32..880e88c1 100644 --- a/lib/mr_init.c +++ b/lib/mr_init.c @@ -3,7 +3,7 @@ * $Author$ * $Header$ * - * Copyright (C) 1987 by the Massachusetts Institute of Technology + * Copyright (C) 1987, 1990 by the Massachusetts Institute of Technology * For copying and distribution information, please see the file * . */ @@ -13,21 +13,21 @@ static char *rcsid_sms_init_c = "$Header$"; #endif lint #include -#include "sms_private.h" +#include "mr_private.h" -int sms_inited = 0; +int mr_inited = 0; /* the reference to link_against_the_moira_version_of_gdb is to make * sure that this is built with the proper libraries. */ -sms_init() +mr_init() { extern int link_against_the_moira_version_of_gdb; - if (sms_inited) return; + if (mr_inited) return; gdb_init(); initialize_sms_error_table(); initialize_krb_error_table(); link_against_the_moira_version_of_gdb = 0; - sms_inited=1; + mr_inited=1; } diff --git a/lib/mr_ops.c b/lib/mr_ops.c index f5ef5795..3ee171bb 100644 --- a/lib/mr_ops.c +++ b/lib/mr_ops.c @@ -3,13 +3,14 @@ * $Author$ * $Header$ * - * Copyright (C) 1987, 1989 by the Massachusetts Institute of Technology + * Copyright (C) 1987, 1989, 1990 by the Massachusetts Institute of + * Technology * For copying and distribution information, please see the file * . * * This routine is part of the client library. It handles * the protocol operations: invoking an update and getting the - * SMS message of the day. + * MR message of the day. */ #ifndef lint @@ -17,83 +18,83 @@ static char *rcsid_sms_do_update_c = "$Header$"; #endif lint #include -#include "sms_private.h" +#include "mr_private.h" /* Invoke a DCM update. */ -int sms_do_update() +int mr_do_update() { int status; - sms_params param_st; - struct sms_params *params = NULL; - struct sms_params *reply = NULL; + mr_params param_st; + struct mr_params *params = NULL; + struct mr_params *reply = NULL; CHECK_CONNECTED; params = ¶m_st; - params->sms_version_no = sending_version_no; - params->sms_procno = SMS_DO_UPDATE; - params->sms_argc = 0; - params->sms_argl = NULL; - params->sms_argv = NULL; + params->mr_version_no = sending_version_no; + params->mr_procno = MR_DO_UPDATE; + params->mr_argc = 0; + params->mr_argl = NULL; + params->mr_argv = NULL; - if ((status = sms_do_call(params, &reply)) == 0) - status = reply->sms_status; + if ((status = mr_do_call(params, &reply)) == 0) + status = reply->mr_status; - sms_destroy_reply(reply); + mr_destroy_reply(reply); return status; } -/* Get the SMS motd. This returns an SMS status, and motd will either +/* Get the MR motd. This returns an MR status, and motd will either * point to NULL or the motd in a static buffer. */ -int sms_motd(motd) +int mr_motd(motd) char **motd; { int status; - sms_params param_st; - struct sms_params *params = NULL; - struct sms_params *reply = NULL; + mr_params param_st; + struct mr_params *params = NULL; + struct mr_params *reply = NULL; static char buffer[1024]; *motd = NULL; CHECK_CONNECTED; params = ¶m_st; - params->sms_version_no = sending_version_no; - params->sms_procno = SMS_MOTD; - params->sms_argc = 0; - params->sms_argl = NULL; - params->sms_argv = NULL; + params->mr_version_no = sending_version_no; + params->mr_procno = MR_MOTD; + params->mr_argc = 0; + params->mr_argl = NULL; + params->mr_argv = NULL; - if ((status = sms_do_call(params, &reply))) + if ((status = mr_do_call(params, &reply))) goto punt; - while ((status = reply->sms_status) == SMS_MORE_DATA) { - if (reply->sms_argc > 0) { - strncpy(buffer, reply->sms_argv[0], sizeof(buffer)); + while ((status = reply->mr_status) == MR_MORE_DATA) { + if (reply->mr_argc > 0) { + strncpy(buffer, reply->mr_argv[0], sizeof(buffer)); *motd = buffer; } - sms_destroy_reply(reply); + mr_destroy_reply(reply); reply = NULL; - initialize_operation(_sms_recv_op, sms_start_recv, &reply, + initialize_operation(_mr_recv_op, mr_start_recv, &reply, (int (*)())NULL); - queue_operation(_sms_conn, CON_INPUT, _sms_recv_op); + queue_operation(_mr_conn, CON_INPUT, _mr_recv_op); - sms_complete_operation(_sms_recv_op); - if (OP_STATUS(_sms_recv_op) != OP_COMPLETE) { - sms_disconnect(); - status = SMS_ABORTED; + mr_complete_operation(_mr_recv_op); + if (OP_STATUS(_mr_recv_op) != OP_COMPLETE) { + mr_disconnect(); + status = MR_ABORTED; return(status); } } punt: - sms_destroy_reply(reply); + mr_destroy_reply(reply); /* for backwards compatability */ - if (status == SMS_UNKNOWN_PROC) + if (status == MR_UNKNOWN_PROC) return(0); else return(status); @@ -103,7 +104,7 @@ char **motd; /* Tell the library to take care of another input source while it is * processing a query. For instance, an X toolkit application would * do something like - * sms_set_alternate_input(ConnectionNumber(XtDisplay(widget)), doxinput); + * mr_set_alternate_input(ConnectionNumber(XtDisplay(widget)), doxinput); * where doxinput is defined as: * doxinput() { * extern Widget toplevel; @@ -116,18 +117,18 @@ char **motd; * } */ -static int sms_alternate_input = 0; -static int (*sms_alternate_handler)(); +static int mr_alternate_input = 0; +static int (*mr_alternate_handler)(); -int sms_set_alternate_input(fd, proc) +int mr_set_alternate_input(fd, proc) int fd; int (*proc)(); { - if (sms_alternate_input != 0) - return(SMS_ALREADY_CONNECTED); - sms_alternate_input = fd; - sms_alternate_handler = proc; - return(SMS_SUCCESS); + if (mr_alternate_input != 0) + return(MR_ALREADY_CONNECTED); + mr_alternate_input = fd; + mr_alternate_handler = proc; + return(MR_SUCCESS); } @@ -135,7 +136,7 @@ int (*proc)(); * handles alternate input streams (such as X) as well. */ -sms_complete_operation(op) +mr_complete_operation(op) OPERATION op; { long infd, outfd, exfd; @@ -143,17 +144,17 @@ OPERATION op; gdb_progress(); /* try for an immediate completion */ - if (sms_alternate_input == 0) + if (mr_alternate_input == 0) return(complete_operation(op)); - infd = (1<status != OP_COMPLETE && op->status != OP_CANCELLED) { - rc = con_select(sms_alternate_input, (fd_set *)&infd, (fd_set *)&outfd, + rc = con_select(mr_alternate_input, (fd_set *)&infd, (fd_set *)&outfd, (fd_set *)&exfd, (struct timeval *)NULL); - if (rc > 0 && sms_alternate_handler) { - (*sms_alternate_handler)(); + if (rc > 0 && mr_alternate_handler) { + (*mr_alternate_handler)(); } } return(op->status); diff --git a/lib/mr_param.c b/lib/mr_param.c index b267382f..8f5923b3 100644 --- a/lib/mr_param.c +++ b/lib/mr_param.c @@ -3,7 +3,7 @@ * $Author$ * $Header$ * - * Copyright (C) 1987 by the Massachusetts Institute of Technology + * Copyright (C) 1987, 1990 by the Massachusetts Institute of Technology * For copying and distribution information, please see the file * . * @@ -16,7 +16,7 @@ static char *rcsid_sms_param_c = "$Header$"; #include #include #include -#include "sms_private.h" +#include "mr_private.h" /* * GDB operations to send and recieve RPC requests and replies. @@ -28,25 +28,25 @@ static char *rcsid_sms_param_c = "$Header$"; * write of the next bunch of data. */ -sms_cont_send(op, hcon, arg) +mr_cont_send(op, hcon, arg) OPERATION op; HALF_CONNECTION hcon; - struct sms_params *arg; + struct mr_params *arg; { op->result = OP_SUCCESS; - free(arg->sms_flattened); - arg->sms_flattened = NULL; + free(arg->mr_flattened); + arg->mr_flattened = NULL; return OP_COMPLETE; } -sms_start_send(op, hcon, arg) +mr_start_send(op, hcon, arg) OPERATION op; HALF_CONNECTION hcon; - register struct sms_params *arg; + register struct mr_params *arg; { int i, len; - unsigned int sms_size; + unsigned int mr_size; int *argl; char *buf, *bp; @@ -54,7 +54,7 @@ sms_start_send(op, hcon, arg) * This should probably be split into several routines. * It could also probably be made more efficient (punting most * of the argument marshalling stuff) by doing I/O directly - * from the strings. Anyone for a scatter/gather sms_send_data? + * from the strings. Anyone for a scatter/gather mr_send_data? * * that would look a lot like the uio stuff in the kernel.. hmm. */ @@ -70,29 +70,29 @@ sms_start_send(op, hcon, arg) * to a longword boundary. */ - sms_size = 4 * sizeof(long); + mr_size = 4 * sizeof(long); - argl = (int *)malloc((unsigned)(sizeof(int) * arg->sms_argc)); + argl = (int *)malloc((unsigned)(sizeof(int) * arg->mr_argc)); /* * For each argument, figure out how much space is needed. */ - for (i = 0; i < arg->sms_argc; ++i) { - if (arg->sms_argl) - argl[i] = len = arg->sms_argl[i]; + for (i = 0; i < arg->mr_argc; ++i) { + if (arg->mr_argl) + argl[i] = len = arg->mr_argl[i]; else - argl[i] = len = strlen(arg->sms_argv[i]) + 1; - sms_size += sizeof(long) + len; + argl[i] = len = strlen(arg->mr_argv[i]) + 1; + mr_size += sizeof(long) + len; /* Round up to next longword boundary.. */ - sms_size = sizeof(long) * howmany(sms_size, sizeof(long)); + mr_size = sizeof(long) * howmany(mr_size, sizeof(long)); } - arg->sms_flattened = buf = malloc(sms_size); + arg->mr_flattened = buf = malloc(mr_size); - bzero(arg->sms_flattened, sms_size); + bzero(arg->mr_flattened, mr_size); - arg->sms_size = sms_size; + arg->mr_size = mr_size; /* * This is gross. Any better suggestions, anyone? @@ -100,10 +100,10 @@ sms_start_send(op, hcon, arg) * return a pointer which is aligned correctly for any data. */ - ((long *)buf)[0] = htonl(sms_size); - ((long *)buf)[1] = htonl(arg->sms_version_no); - ((long *)buf)[2] = htonl(arg->sms_procno); - ((long *)buf)[3] = htonl(arg->sms_argc); + ((long *)buf)[0] = htonl(mr_size); + ((long *)buf)[1] = htonl(arg->mr_version_no); + ((long *)buf)[2] = htonl(arg->mr_procno); + ((long *)buf)[3] = htonl(arg->mr_argc); /* * bp is a pointer into the point in the buffer to put @@ -112,39 +112,39 @@ sms_start_send(op, hcon, arg) bp = (char *)(((long *)buf) + 4); - for (i = 0; isms_argc; ++i) { + for (i = 0; imr_argc; ++i) { len = argl[i]; *((long *)bp) = htonl(len); bp += sizeof(long); - bcopy(arg->sms_argv[i], bp, len); + bcopy(arg->mr_argv[i], bp, len); bp += sizeof(long) * howmany(len, sizeof(long)); } - op->fcn.cont = sms_cont_send; - arg->sms_size = sms_size; + op->fcn.cont = mr_cont_send; + arg->mr_size = mr_size; free(argl); - if (gdb_send_data(hcon, arg->sms_flattened, sms_size) == OP_COMPLETE) - return sms_cont_send(op, hcon, arg); + if (gdb_send_data(hcon, arg->mr_flattened, mr_size) == OP_COMPLETE) + return mr_cont_send(op, hcon, arg); else return OP_RUNNING; } -sms_cont_recv(op, hcon, argp) +mr_cont_recv(op, hcon, argp) OPERATION op; HALF_CONNECTION hcon; - sms_params **argp; + mr_params **argp; { int done = FALSE; char *cp; int *ip; int i; - register sms_params *arg = *argp; + register mr_params *arg = *argp; while (!done) { - switch (arg->sms_state) { + switch (arg->mr_state) { case S_RECV_START: - arg->sms_state = S_RECV_DATA; - if (gdb_receive_data(hcon, (caddr_t)&arg->sms_size, + arg->mr_state = S_RECV_DATA; + if (gdb_receive_data(hcon, (caddr_t)&arg->mr_size, sizeof(long)) == OP_COMPLETE) continue; done = TRUE; @@ -152,51 +152,51 @@ sms_cont_recv(op, hcon, argp) case S_RECV_DATA: fflush(stdout); /* Should validate that length is reasonable */ - arg->sms_size = ntohl(arg->sms_size); - if (arg->sms_size > 65536) { + arg->mr_size = ntohl(arg->mr_size); + if (arg->mr_size > 65536) { return OP_CANCELLED; } - arg->sms_flattened = malloc(arg->sms_size); - arg->sms_state = S_DECODE_DATA; - bcopy((caddr_t)&arg->sms_size, arg->sms_flattened, sizeof(long)); + arg->mr_flattened = malloc(arg->mr_size); + arg->mr_state = S_DECODE_DATA; + bcopy((caddr_t)&arg->mr_size, arg->mr_flattened, sizeof(long)); if (gdb_receive_data(hcon, - arg->sms_flattened + sizeof(long), - arg->sms_size - sizeof(long)) + arg->mr_flattened + sizeof(long), + arg->mr_size - sizeof(long)) == OP_COMPLETE) continue; done = TRUE; break; case S_DECODE_DATA: - cp = arg->sms_flattened; + cp = arg->mr_flattened; ip = (int *) cp; /* we already got the overall length.. */ for(i=1; i <4; i++) ip[i] = ntohl(ip[i]); - arg->sms_version_no = ip[1]; - if (arg->sms_version_no != SMS_VERSION_1 && - arg->sms_version_no != SMS_VERSION_2) - arg->sms_status = SMS_VERSION_MISMATCH; - else arg->sms_status = ip[2]; - arg->sms_argc = ip[3]; + arg->mr_version_no = ip[1]; + if (arg->mr_version_no != MR_VERSION_1 && + arg->mr_version_no != MR_VERSION_2) + arg->mr_status = MR_VERSION_MISMATCH; + else arg->mr_status = ip[2]; + arg->mr_argc = ip[3]; cp += 4 * sizeof(int); - arg->sms_argv=(char **)malloc(arg->sms_argc *sizeof(char **)); - arg->sms_argl=(int *)malloc(arg->sms_argc *sizeof(int *)); + arg->mr_argv=(char **)malloc(arg->mr_argc *sizeof(char **)); + arg->mr_argl=(int *)malloc(arg->mr_argc *sizeof(int *)); - for (i = 0; isms_argc; ++i) { + for (i = 0; imr_argc; ++i) { u_short nlen = ntohl(* (int *) cp); cp += sizeof (long); - if (cp + nlen > arg->sms_flattened + arg->sms_size) { - free(arg->sms_flattened); - arg->sms_flattened = NULL; + if (cp + nlen > arg->mr_flattened + arg->mr_size) { + free(arg->mr_flattened); + arg->mr_flattened = NULL; return OP_CANCELLED; } - arg->sms_argv[i] = (char *)malloc(nlen); - bcopy(cp, arg->sms_argv[i], nlen); - arg->sms_argl[i]=nlen; + arg->mr_argv[i] = (char *)malloc(nlen); + bcopy(cp, arg->mr_argv[i], nlen); + arg->mr_argl[i]=nlen; cp += sizeof(long) * howmany(nlen, sizeof(long)); } - free(arg->sms_flattened); - arg->sms_flattened = NULL; + free(arg->mr_flattened); + arg->mr_flattened = NULL; return OP_COMPLETE; } } @@ -204,54 +204,43 @@ sms_cont_recv(op, hcon, argp) } -sms_start_recv(op, hcon, argp) +mr_start_recv(op, hcon, argp) OPERATION op; HALF_CONNECTION hcon; - struct sms_params **argp; + struct mr_params **argp; { - register sms_params *arg = *argp; + register mr_params *arg = *argp; if (!arg) { - *argp = arg = (sms_params *)malloc(sizeof(sms_params)); - arg->sms_argl = NULL; - arg->sms_argv = NULL; - arg->sms_flattened = NULL; + *argp = arg = (mr_params *)malloc(sizeof(mr_params)); + arg->mr_argl = NULL; + arg->mr_argv = NULL; + arg->mr_flattened = NULL; } - arg->sms_state = S_RECV_START; - op->fcn.cont = sms_cont_recv; - return sms_cont_recv(op, hcon, argp); + arg->mr_state = S_RECV_START; + op->fcn.cont = mr_cont_recv; + return mr_cont_recv(op, hcon, argp); } -sms_destroy_reply(reply) - sms_params *reply; +mr_destroy_reply(reply) + mr_params *reply; { int i; if (reply) { - if (reply->sms_argl) - free(reply->sms_argl); - reply->sms_argl = NULL; - if (reply->sms_flattened) - free(reply->sms_flattened); - reply->sms_flattened = NULL; - if (reply->sms_argv) { - for (i=0; isms_argc; i++) { - if (reply->sms_argv[i]) - free (reply->sms_argv[i]); - reply->sms_argv[i] = NULL; + if (reply->mr_argl) + free(reply->mr_argl); + reply->mr_argl = NULL; + if (reply->mr_flattened) + free(reply->mr_flattened); + reply->mr_flattened = NULL; + if (reply->mr_argv) { + for (i=0; imr_argc; i++) { + if (reply->mr_argv[i]) + free (reply->mr_argv[i]); + reply->mr_argv[i] = NULL; } - free(reply->sms_argv); + free(reply->mr_argv); } - reply->sms_argv = NULL; + reply->mr_argv = NULL; free(reply); } } - -/* - * Local Variables: - * mode: c - * c-indent-level: 4 - * c-continued-statement-offset: 4 - * c-brace-offset: -4 - * c-argdecl-indent: 4 - * c-label-offset: -4 - * End: - */ diff --git a/lib/mr_private.h b/lib/mr_private.h index 7bdf2125..19dfeaec 100644 --- a/lib/mr_private.h +++ b/lib/mr_private.h @@ -5,29 +5,15 @@ * * Copyright (C) 1987 by the Massachusetts Institute of Technology * - * Private declarations of the SMS library. - * - * $Log$ - * Revision 1.4 1988-04-19 12:42:49 mar - * declared version number variable - * - * Revision 1.3 87/06/16 17:48:39 wesommer - * Clean up memory allocation, indenting. - * - * Revision 1.2 87/05/31 22:07:06 wesommer - * Private data to the sms server and library. - * - * Revision 1.1 87/05/20 03:12:00 wesommer - * Initial revision - * + * Private declarations of the Moira library. */ -#include "sms_proto.h" +#include "mr_proto.h" -extern CONNECTION _sms_conn; -extern OPERATION _sms_send_op, _sms_recv_op; +extern CONNECTION _mr_conn; +extern OPERATION _mr_send_op, _mr_recv_op; -extern int sms_inited; +extern int mr_inited; extern int sending_version_no; /* @@ -40,7 +26,7 @@ extern int sending_version_no; #define EVER (;;) -#define CHECK_CONNECTED {if (!_sms_conn) return SMS_NOT_CONNECTED;} +#define CHECK_CONNECTED {if (!_mr_conn) return MR_NOT_CONNECTED;} /* * There should be an include file for these.. diff --git a/lib/mr_query.c b/lib/mr_query.c index 4e59282e..d6162b2c 100644 --- a/lib/mr_query.c +++ b/lib/mr_query.c @@ -14,17 +14,17 @@ static char *rcsid_sms_query_c = "$Header$"; #endif lint #include -#include "sms_private.h" +#include "mr_private.h" /* - * This routine is the primary external interface to the sms library. + * This routine is the primary external interface to the mr library. * * It builds a new argument vector with the query handle prepended, - * and calls sms_query_internal. + * and calls mr_query_internal. */ int level = 0; -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 */ @@ -35,12 +35,12 @@ int sms_query(name, argc, argv, callproc, callarg) register int status = 0; nargv[0] = name; bcopy((char *)argv, (char *)(nargv+1), sizeof(char *) * argc); - status = sms_query_internal(argc+1, nargv, callproc, callarg); + status = mr_query_internal(argc+1, nargv, callproc, callarg); free(nargv); return status; } /* - * This routine makes an SMS query. + * This routine makes an MR query. * * argv[0] is the query name. * argv[1..argc-1] are the query arguments. @@ -52,53 +52,53 @@ int sms_query(name, argc, argv, callproc, callarg) * way to send it a quench..) */ -int sms_query_internal(argc, argv, callproc, callarg) +int mr_query_internal(argc, argv, callproc, callarg) int argc; /* Arg count */ char **argv; /* Args */ int (*callproc)(); /* Callback procedure */ char *callarg; /* Callback argument */ { int status; - sms_params params_st; - register sms_params *params = NULL; - sms_params *reply = NULL; + mr_params params_st; + register mr_params *params = NULL; + mr_params *reply = NULL; int stopcallbacks = 0; - if (level) return SMS_QUERY_NOT_REENTRANT; + if (level) return MR_QUERY_NOT_REENTRANT; CHECK_CONNECTED; level++; params = ¶ms_st; - params->sms_version_no = sending_version_no; - params->sms_procno = SMS_QUERY; - params->sms_argc = argc; - params->sms_argl = NULL; - params->sms_argv = argv; + params->mr_version_no = sending_version_no; + params->mr_procno = MR_QUERY; + params->mr_argc = argc; + params->mr_argl = NULL; + params->mr_argv = argv; - if ((status = sms_do_call(params, &reply))) + if ((status = mr_do_call(params, &reply))) goto punt; - while ((status = reply->sms_status) == SMS_MORE_DATA) { + while ((status = reply->mr_status) == MR_MORE_DATA) { if (!stopcallbacks) stopcallbacks = - (*callproc)(reply->sms_argc, reply->sms_argv, callarg); - sms_destroy_reply(reply); + (*callproc)(reply->mr_argc, reply->mr_argv, callarg); + mr_destroy_reply(reply); reply = NULL; - initialize_operation(_sms_recv_op, sms_start_recv, &reply, + initialize_operation(_mr_recv_op, mr_start_recv, &reply, (int (*)())NULL); - queue_operation(_sms_conn, CON_INPUT, _sms_recv_op); + queue_operation(_mr_conn, CON_INPUT, _mr_recv_op); - sms_complete_operation(_sms_recv_op); - if (OP_STATUS(_sms_recv_op) != OP_COMPLETE) { - sms_disconnect(); - status = SMS_ABORTED; + mr_complete_operation(_mr_recv_op); + if (OP_STATUS(_mr_recv_op) != OP_COMPLETE) { + mr_disconnect(); + status = MR_ABORTED; goto punt_1; } } punt: - sms_destroy_reply(reply); + mr_destroy_reply(reply); punt_1: level--; return status; diff --git a/lib/nfsparttype.c b/lib/nfsparttype.c index 0eb63976..9f148f37 100644 --- a/lib/nfsparttype.c +++ b/lib/nfsparttype.c @@ -14,7 +14,7 @@ static char *rcsid_nfsparttype_c = "$Header$"; #endif lint #include -#include +#include #include #include #include @@ -32,12 +32,12 @@ struct pair { */ static struct pair fs_names[] = { - { SMS_FS_STUDENT, "Student" }, - { SMS_FS_FACULTY, "Faculty/Project" }, - { SMS_FS_FACULTY, "Faculty" }, - { SMS_FS_FACULTY, "Project" }, - { SMS_FS_STAFF, "Staff" }, - { SMS_FS_MISC, "Other" }, + { MR_FS_STUDENT, "Student" }, + { MR_FS_FACULTY, "Faculty/Project" }, + { MR_FS_FACULTY, "Faculty" }, + { MR_FS_FACULTY, "Project" }, + { MR_FS_STAFF, "Staff" }, + { MR_FS_MISC, "Other" }, /* Insert new entries before the 0,0 pair */ { 0, 0 }, }; diff --git a/lib/sq.c b/lib/sq.c index 40feaf1b..72fcfbac 100644 --- a/lib/sq.c +++ b/lib/sq.c @@ -8,7 +8,7 @@ */ #include -#include +#include struct save_queue * sq_create() -- 2.45.2