char *atot(itime)
char *itime;
{
- int time;
+ time_t time;
char *ct, *ctime();
- time = atoi(itime);
+ time = (time_t)atoi(itime);
ct = ctime(&time);
ct[24] = 0;
return(&ct[4]);
{
int peer; /* socket for talking to
peer */
- int on = 1; /* flag for ioctl */
+ char on = 1; /* flag for ioctl */
struct sockaddr_in target; /* build the peer address */
/* here */
struct hostent *peer_host; /* host where peer is */
/** Return the # of days in the Year **/
/*****************************************/
-static int NumdaysY(Year)
+int NumdaysY(Year)
int Year;
{
return (365 + Leapyear(Year));
/** Return the # of days in the Month **/
/*****************************************/
-static int NumdaysM(Month, Year)
+int NumdaysM(Month, Year)
int Month, Year;
{
if ((Month > 2) && (Leapyear (Year)))
/** Return 1 if a leapyear, else 0 **/
/*****************************************/
-static int Leapyear (Year)
+int Leapyear (Year)
int Year;
{
if ((Year % 4) && (!(Year % 100) || (Year % 1000)))
/** Return 0 if success, 1 if failure **/
/************************************************/
-static int ParseDateString (DS, Day, Month, Year, Hour, Minute, Sec)
+int ParseDateString (DS, Day, Month, Year, Hour, Minute, Sec)
char *DS;
int *Day, *Month, *Year, *Hour, *Minute, *Sec;
{
/** Return the Month number of a Month number or string **/
/***********************************************************/
-static int MonthNo (M)
+int MonthNo (M)
char *M;
{
int Count;
{
int out = 1 /* stdout */;
char *outf = NULL, outft[64];
- char *control_fn[80], cmd[256];
+ char control_fn[80], cmd[256];
FILE *f;
struct stat sb;
int flag1;
/* Check whether the member being added is an active user */
code = moira_connect();
if (!code) code = mr_query("get_user_by_login", 1, &member,
- check_user, &ustate);
+ check_user, (char *)&ustate);
if (code) {
critical_alert("incremental",
"Error contacting Moira server to lookup user %s: %s",
#ifdef NEED_STRCASECMP
DEFINES= -DNEED_STRCASECMP
#endif
+#ifdef USE_CRYPT_H
+DEFINES= -DUSE_CRYPT_H
+#endif
all:: mr_et.h krb_et.h ureg_err.h gdss_et.h
-mkdir ${DESTDIR}${INCLDIR}
for i in mr_et.h; do \
${INSTALLFILE} $$i ${DESTDIR}${INCLDIR}/$$i; done
+
#include <kadm_err.h>
#include <krb_err.h>
#include <errno.h>
+#include <com_err.h>
#include "moira.h"
#include "moira_site.h"
#include "reg_svr.h"
/* If the information sent over in the packet did not point to a
valid user, the mit_id field in the formatted packet structure
will be empty. */
- if (message->db.mit_id[0] == NULL)
+ if (message->db.mit_id[0] == '\0')
status = UREG_USER_NOT_FOUND;
/* If the user was found but the registration has already started,
use this as the status */
q_argv[0] = message->db.uid;
status = mr_query("get_user_account_by_uid", 1, q_argv,
- getuserinfo, q_argv);
+ getuserinfo, (char *)q_argv);
if (status != SUCCESS) {
com_err(whoami, status, " while getting user info");
return(status);
com_err(whoami, 0, "checking status of secure password for %s",
message->first);
argv[0] = message->first;
- status = mr_query("get_user_account_by_login", 1, argv, getuserinfo, argv);
+ status = mr_query("get_user_account_by_login", 1, argv, getuserinfo,
+ (char *)argv);
if (status != SUCCESS) {
com_err(whoami, status, " while getting user info");
return(status);
struct timeval now;
static int inited = 0;
static char *host;
+ extern char *krb_get_phost(char *);
if (!inited) {
inited++;
com_err(whoami, 0, "setting secure passwd for %s", message->first);
argv[0] = message->first;
- status = mr_query("get_user_account_by_login", 1, argv, getuserinfo, argv);
+ status = mr_query("get_user_account_by_login", 1, argv, getuserinfo,
+ (char *)argv);
if (status != SUCCESS) {
com_err(whoami, status, " while getting user info");
return(status);
argv[1] = buf;
gettimeofday(&now, NULL);
sprintf(buf, "%d", now.tv_sec);
- status = mr_query("update_user_security_status", 2, argv, getuserinfo, argv);
+ status = mr_query("update_user_security_status", 2, argv, getuserinfo,
+ (char *)argv);
if (status != SUCCESS) {
com_err(whoami, status, " while updating user status");
return(status);
sin.sin_addr.s_addr = INADDR_ANY;
/* Bind a name to the socket */
- if (bind(s, &sin, sizeof(sin)) < 0)
+ if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) < 0)
{
com_err(whoami,errno," bind");
exit(1);
#endif
status = TRUE;
(void) sendto(s, requests[i].out_pkt, requests[i].out_pktlen,
- 0, &sin, addrlen);
+ 0, (struct sockaddr *)&sin, addrlen);
break;
}
}
if (format_pkt(CUR_REQ.out_pkt, &(CUR_REQ.out_pktlen),
CUR_REQ.seqno, status, text))
com_err(whoami,0,"Client error message was truncated.");
- (void) sendto(s, CUR_REQ.out_pkt, CUR_REQ.out_pktlen, 0, &sin, addrlen);
+ (void) sendto(s, CUR_REQ.out_pkt, CUR_REQ.out_pktlen, 0,
+ (struct sockaddr *)&sin, addrlen);
cur_request_index = NEXT_INDEX(cur_request_index);
}
com_err(whoami, 0, "*** Ready for next request ***");
addrlen = sizeof(sin);
/* Receive a packet */
- if ((pktlen = recvfrom(s,packet,sizeof(packet),0,&sin,&addrlen)) < 0)
+ if ((pktlen = recvfrom(s,packet,sizeof(packet),0,
+ (struct sockaddr *)&sin,&addrlen)) < 0)
{
com_err(whoami, errno, " recvfrom");
/* Don't worry if error is interrupted system call. */
SRCS= students.c employee.c sign.c verify.c vote.c rafnu.c
CODE= students.pc employee.pc sign.pc verify.pc vote.pc rafnu.c
SRCDIR = $(SRCTOP)/regtape
+#ifdef USE_CRYPT_H
+DEFINES = $(GDSSINC) -DUSE_CRYPT_H
+#else
DEFINES = $(GDSSINC)
+#endif
sqlrule()
program(students, students.o rafnu.o,,$(CLIBS) $(SQL_LIB), $(PROGDIR))
char *address;
char *phone;
char *phone2;
- char *email;
};
FILE *in;
{
static struct entry e;
- static char buf[BUFSIZ], mid[16], eid[16], email[256];
+ static char buf[BUFSIZ], mid[16], eid[16];
static char name[LEN_NAME+1], sname[LEN_NAME+1], id[LEN_ID+1];
static char office[LEN_OFFICE+1], phone[LEN_PHONE+1], phone2[LEN_PHONE2+1];
static char dept[LEN_DEPT+1], title[LEN_TITLE+1], username[LEN_USERNAME+1];
if (substr(e.title, "PROF") || substr(e.title, "LECTURE"))
e.class = "FACULTY";
- strcpy(email, strtrim(username));
- if (host[0] == '@')
- strncat(email, strtrim(host));
- e.email = email;
-
return(&e);
}
#include <stdio.h>
#include <ctype.h>
+#ifdef USE_CRYPT_H
+#include <crypt.h>
+#else
+#include <unistd.h>
+#endif
#define LAST_LEN 15
#define FIRST_LEN 15
int ends_iv = 0; /* 1 if name ends in "IV" */
char salt[2];
register char *p;
- char *strcat();
- char *strcpy();
- char *strncpy();
- char *crypt();
for (;;) { /* ... well, at least until we get a good
* input line */
#include <sys/file.h>
#include <fcntl.h>
#include <string.h>
+#include <netinet/in.h>
#include <arpa/inet.h>
#include <krb.h>
#include <errno.h>
#include <krb.h>
#include <com_err.h>
#include <stdlib.h>
+#include <stdarg.h>
typedef struct returned_tuples {
struct returned_tuples *next;
/* prototypes from mr_util.c */
char *requote(char *buf, char *cp, int len);
void log_args(char *tag, int version, int argc, char **argv);
-void mr_com_err(char *whoami, int code, char *fmt, caddr_t pvar);
+void mr_com_err(const char *whoami, long code, const char *fmt, va_list pvar);
int mr_trim_args(int argc, char **argv);
char **mr_copy_args(char **argv, int argc);
}
void mr_com_err(whoami, code, fmt, pvar)
- char *whoami;
- int code;
- char *fmt;
- caddr_t pvar;
+ const char *whoami;
+ long code;
+ const char *fmt;
+ va_list pvar;
{
extern client *cur_client;
code = connection_errno(conn);
goto auth_failed;
}
- des_key_sched(&ad.session, &sched);
+ des_key_sched(ad.session, sched);
des_ecb_encrypt(STRING_DATA(data), nonce2, sched, 0);
if (memcmp(nonce, nonce2, sizeof(nonce)))
goto auth_failed;
if (code) {
return(connection_errno(conn));
}
- des_key_sched(&session, &sched);
+ des_key_sched(session, sched);
des_ecb_encrypt(STRING_DATA(data), enonce, sched, 1);
STRING_DATA(data) = enonce;
code = send_object(conn, (char *)&data, STRING_T);
#define sqlrule() @@\
.SUFFIXES: .pc @@\
.pc.c: @@\
- /usr/oracle/bin/proc INAME=$*.pc INCLUDE=$(BUILDTOP)/include INCLUDE=$(BUILDTOP)/lib INCLUDE=$(INCLDIR) $(ORADEFS)
+ /usr/oracle/bin/proc INAME=$*.pc INCLUDE=$(BUILDTOP)/include INCLUDE=$(BUILDTOP)/lib INCLUDE=$(INCLDIR) $(ORADEFS) $(ORAINCLUDES)
#define sqlfile(file) @@\
concat(file,.c): concat(file,.pc) @@\
clean:: @@\
#endif
#ifdef sgi
-OSDEFS= -DPOSIX -DUSE_CRYPT_H -DSYSV
+OSDEFS= -DPOSIX -DSYSV
#endif
#if defined(SOLARIS)
MOTIFLIB= /mit/motif/`machtype`lib
#endif
-/* where crypt is, if not libc */
+/* where crypt is, if not libc and unistd.h */
#ifdef __NetBSD__
CRYPT= -lcrypt
#endif
+#if defined(sgi) || defined(SOLARIS)
+#define USE_CRYPT_H
+#endif
+
/*
* The name of a command which builds an object library.