DEFS=@DEFS@
ALL_CFLAGS=$(CPPFLAGS) $(CFLAGS) $(DEFS)
LDFLAGS=@LDFLAGS@
-LIBS=@LIBS@
+LIBS=../lib/libmrclient.a @LIBS@
MR_LIBDEP=@MR_LIBDEP@
INSTALL=@INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@
install: all
$(INSTALL_PROGRAM) -m 755 addusr $(bindir)
-$(TARGET): $(OBJS) $(MR_LIBDEP)
+$(TARGET): $(OBJS) ../lib/libmrclient.a $(MR_LIBDEP)
$(CC) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)
#include <mit-copyright.h>
#include <moira.h>
#include <moira_site.h>
+#include <mrclient.h>
#include <ctype.h>
#include <errno.h>
{
int status, lineno;
char **arg = argv, *qargv[U_END];
- char *motd, *p, *first, *middle, *last, *id, *login, *server;
+ char *p, *first, *middle, *last, *id, *login, *server;
char buf[BUFSIZ], idbuf[32];
FILE *input;
}
/* fire up Moira */
- if ((status = mr_connect(server)))
- {
- com_err(whoami, status, "unable to connect to the Moira server");
- exit(2);
- }
- 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);
- mr_disconnect();
- exit(2);
- }
-
- if ((status = mr_auth("addusr")))
- {
- if (status == MR_USER_AUTH)
- com_err(whoami, status, "");
- else
- {
- com_err(whoami, status, "unable to authenticate to Moira");
- exit(2);
- }
- }
+ if (mrcl_connect(server, "addusr", 1) != MRCL_SUCCESS)
+ exit(2);
qargv[U_NAME] = UNIQUE_LOGIN;
qargv[U_UID] = UNIQUE_UID;
DEFS=@DEFS@
ALL_CFLAGS=$(CPPFLAGS) $(CFLAGS) $(DEFS)
LDFLAGS=@LDFLAGS@
-LIBS=@LIBS@
+LIBS=../lib/libmrclient.a @LIBS@
MR_LIBDEP=@MR_LIBDEP@
INSTALL=@INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@
install: all
$(INSTALL_PROGRAM) blanche $(bindir)
-$(TARGET): $(OBJS) $(MR_LIBDEP)
+$(TARGET): $(OBJS) ../lib/libmrclient.a $(MR_LIBDEP)
$(CC) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)
#include <mit-copyright.h>
#include <moira.h>
#include <moira_site.h>
+#include <mrclient.h>
#include <ctype.h>
#include <errno.h>
{
int status, success;
char **arg = argv;
- char *membervec[3], *motd;
+ char *membervec[3];
struct member *memberstruct;
char *server = NULL, *p;
showusers = showstrings = showlists = showkerberos = 1;
/* fire up Moira */
- if ((status = mr_connect(server)))
+ status = mrcl_connect(server, "blanche", !noauth);
+ if (status == MRCL_AUTH_ERROR)
{
- com_err(whoami, status, "unable to connect to the Moira server");
- exit(2);
- }
- 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);
- mr_disconnect();
- exit(2);
- }
-
- if (!noauth && (status = mr_auth("blanche")))
- {
- if (status == MR_USER_AUTH)
- com_err(whoami, status, "");
- else
- {
- com_err(whoami, status, "unable to authenticate to Moira");
- com_err(whoami, 0,
- " Try the -noauth flag if you don't need authentication");
- exit(2);
- }
+ com_err(whoami, 0, "Try the -noauth flag if you don't "
+ "need authentication.");
}
+ if (status)
+ exit(2);
/* check for username/listname clash */
if (createflag || (setinfo && newname && strcmp(newname, listname)))
DEFS=@DEFS@
ALL_CFLAGS=$(CPPFLAGS) $(CFLAGS) $(DEFS)
LDFLAGS=@LDFLAGS@
-LIBS=@CURSES_LIBS@ @LIBS@
+LIBS=../lib/libmrclient.a @CURSES_LIBS@ @LIBS@
MR_LIBDEP=@MR_LIBDEP@
INSTALL=@INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@
install: all
$(INSTALL_PROGRAM) mailmaint $(bindir)
-$(TARGET): $(OBJS) $(MR_LIBDEP)
+$(TARGET): $(OBJS) ../lib/libmrclient.a $(MR_LIBDEP)
$(CC) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)
#include <mit-copyright.h>
#include <moira.h>
#include <moira_site.h>
+#include <mrclient.h>
#include <ctype.h>
#ifdef HAVE_CURSES
{
void (*old_hook)(const char *, long, const char *, va_list);
int use_menu = 1, k_errno;
- char buf[BUFSIZ], pname[ANAME_SZ], *motd;
+ char buf[BUFSIZ], pname[ANAME_SZ];
if ((whoami = strrchr(argv[0], '/')) == NULL)
whoami = argv[0];
printf("Connecting to database for %s...please hold on.\n", username);
- status = mr_connect(NULL);
- if (status)
- {
- sprintf(buf, "\nConnection to Moira server failed");
- goto punt;
- }
-
- status = mr_motd(&motd);
- if (status)
- {
- com_err(whoami, status, " unable to check server status");
- mr_disconnect();
- exit(2);
- }
- if (motd)
- {
- fprintf(stderr, "The Moira server is currently unavailable:\n%s\n",
- motd);
- mr_disconnect();
- exit(2);
- }
- status = mr_auth("mailmaint");
- if (status)
- {
- sprintf(buf, "\nAuthorization failed.\n");
- goto punt;
- }
+ if (mrcl_connect(NULL, "mailmaint", 1))
+ exit(2);
initscr();
if ((LINES < 24) || (COLS < 60))
DEFS=@DEFS@
ALL_CFLAGS=$(CPPFLAGS) $(CFLAGS) $(DEFS)
LDFLAGS=@LDFLAGS@
-LIBS=@LIBS@
+LIBS=../lib/libmrclient.a @LIBS@
MR_LIBDEP=@MR_LIBDEP@
INSTALL=@INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@
install: all
$(INSTALL_PROGRAM) mrcheck $(bindir)
-$(TARGET): $(OBJS) $(MR_LIBDEP)
+$(TARGET): $(OBJS) ../lib/libmrclient.a $(MR_LIBDEP)
$(CC) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)
#include <mit-copyright.h>
#include <moira.h>
#include <moira_site.h>
+#include <mrclient.h>
#include <sys/time.h>
void disp_sh(char **argv, char *msg);
void usage(void);
+char *whoami;
static int count = 0;
-static char *whoami;
static struct timeval now;
struct service {
int main(int argc, char *argv[])
{
- char *args[2], buf[BUFSIZ], *motd;
+ char *args[2], buf[BUFSIZ];
struct save_queue *sq;
int status;
int auth_required = 1;
else if (argc > 1)
usage();
- status = mr_connect(NULL);
- if (status)
- {
- sprintf(buf, "\nConnection to the Moira server failed.");
- goto punt;
- }
-
- status = mr_motd(&motd);
- if (status)
- {
- 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);
- mr_disconnect();
- exit(2);
- }
+ if (mrcl_connect(NULL, NULL, 0) != MRCL_SUCCESS)
+ exit(2);
status = mr_auth("mrcheck");
if (status && auth_required)
{
DEFS=@DEFS@
ALL_CFLAGS=$(CPPFLAGS) $(CFLAGS) $(DEFS)
LDFLAGS=@LDFLAGS@
-LIBS=@READLINE_LIBS@ @LIBS@
+LIBS=../lib/libmrclient.a @READLINE_LIBS@ @LIBS@
MR_LIBDEP=@MR_LIBDEP@
INSTALL=@INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@
install: all
$(INSTALL_PROGRAM) mrtest $(bindir)
-$(TARGET): $(OBJS) $(MR_LIBDEP)
+$(TARGET): $(OBJS) ../lib/libmrclient.a $(MR_LIBDEP)
$(CC) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)