#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.
#include <sys/types.h>
#include <stdio.h>
-#include <strings.h>
+#include <string.h>
#include <sys/file.h>
#include <krb.h>
#include <ctype.h>
#include <errno.h>
-/* SMS includes */
-#include <sms.h>
-#include <sms_app.h>
+/* MOIRA includes */
+#include <moira.h>
+#include <moira_site.h>
#include "mit-copyright.h"
char *whoami;
int k_errno;
char *whoami;
- if ((whoami = rindex(argv[0], '/')) == NULL)
+ if ((whoami = strrchr(argv[0], '/')) == NULL)
whoami = argv[0];
else
whoami++;
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);
}
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();
/* Try each query. If we ever fail, print error message and exit. */
- status = sms_connect(SMS_SERVER);
+ status = mr_connect(NULL);
if (status) {
- com_err(whoami, status, " while connecting to Moira");
+ 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");
+ com_err(whoami, status, "unable to check server status");
leave(1);
}
if (motd) {
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.");
+ "while authenticating -- run \"kinit\" and try again.");
leave(1);
}
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);
}
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.");
+ com_err(whoami, status, "while getting user information.");
leave(2);
}
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.");
+ com_err(whoami, status, "while updating finger information.");
leave(1);
}
/* 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)
GETINFO("Office address (Exs: E40-342 or 2-108)",
office_address, FALSE);
GETINFO("Office phone (Ex: 3-1300)", office_phone, TRUE);
- GETINFO("MIT department (Exs: 9, Biology, Information Services",
+ GETINFO("MIT department (Exs: 9, Biology, Information Services)",
mit_department, FALSE);
GETINFO("MIT year (Exs: 1989, '91, Faculty, Grad)", mit_year, FALSE);
}