]> andersk Git - moira.git/commitdiff
Fixes to build with `gcc' instead of `gcc -traditional' on suns. (Needed
authordanw <danw>
Fri, 5 Sep 1997 19:14:43 +0000 (19:14 +0000)
committerdanw <danw>
Fri, 5 Sep 1997 19:14:43 +0000 (19:14 +0000)
on 2.5.1 because of ANSIfied headers in /usr/include)

18 files changed:
clients/moira/utils.c
gdb/gdb_conn.c
gen/moddiff.pc
gen/warehouse.pc
incremental/afs.c
lib/Imakefile
reg_svr/reg_svr.c
reg_svr/requests.c
regtape/Imakefile
regtape/employee.pc
regtape/rafnu.c
server/mr_scall.c
server/mr_server.h
server/mr_util.c
update/auth_002.c
update/client.c
util/imake.includes/Imake.rules
util/imake.includes/config.Imakefile

index f3a9c6f0ce68a32ba1e0c546d45831c6ac1c98e8..b658cbb22fbbe02f3281d1b7b10c07990af0fe44 100644 (file)
@@ -642,10 +642,10 @@ char *str;
 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]);
index 8befa4b90b152bc10f983296a2823fb2e0046056..ba5b5c7a9d0f2d8696484b1e74f14e587b0b1e6e 100644 (file)
@@ -275,7 +275,7 @@ char *id;
 {
        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 */
index f96122a467626631f8c1e5effee270fa09ddc4cd..aa3ba0b778711044ed50167357d1b63c03785b47 100644 (file)
@@ -133,7 +133,7 @@ time_t *UTime;
 /**  Return the # of days in the Year   **/
 /*****************************************/
 
-static int NumdaysY(Year)
+int NumdaysY(Year)
 int Year;
 {
     return (365 + Leapyear(Year));
@@ -144,7 +144,7 @@ int 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)))
@@ -158,7 +158,7 @@ int Month, Year;
 /**  Return 1 if a leapyear, else 0     **/
 /*****************************************/
 
-static int Leapyear (Year)
+int Leapyear (Year)
 int Year;
 {
     if ((Year % 4) && (!(Year % 100) || (Year % 1000)))
@@ -173,7 +173,7 @@ int Year;
 /**  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;
 {
@@ -246,7 +246,7 @@ 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;
index b408cf7566a2381437db2a3372ca8b9fade675f2..fca498587b8cc91f5b86370210bbf1602511e6ef 100644 (file)
@@ -40,7 +40,7 @@ char **argv;
 {
     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;
index 1dee3b86179852c5e500509d37f7d1b72503b02e..05cf9beec645ff746e1708a8039f49cd5485f2c8 100644 (file)
@@ -587,7 +587,7 @@ edit_group(op, group, type, member)
            /* 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",
index a14df5584e66dba3d9e0218b554021a0e4ccfb94..db3ee265a0a1beee25064307a5f322844d66d718 100644 (file)
@@ -25,6 +25,9 @@ CODE=$(SRCS) Imakefile mr_et.et krb_et.et ureg_err.et gdss_et.et mr_private.h
 #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
 
@@ -42,3 +45,4 @@ install::
        -mkdir ${DESTDIR}${INCLDIR}
        for i in mr_et.h; do \
                ${INSTALLFILE} $$i ${DESTDIR}${INCLDIR}/$$i; done
+
index e4d3d782ce28824105089dcf613e6c1725eece88..67a3b167809ccea17fd7a76ee985b6e36f07d9f8 100644 (file)
@@ -32,6 +32,7 @@ static char *rcsid_reg_svr_c = "$Header$";
 #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"
@@ -394,7 +395,7 @@ int verify_user(message,retval)
        /* 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 */
@@ -846,7 +847,7 @@ char *retval;
 
        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);
@@ -929,7 +930,8 @@ char *retval;
     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);
@@ -957,6 +959,7 @@ char *retval;
     struct timeval now;
     static int inited = 0;
     static char *host;
+    extern char *krb_get_phost(char *);
 
     if (!inited) {
        inited++;
@@ -967,7 +970,8 @@ char *retval;
 
     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);
@@ -1058,7 +1062,8 @@ char *retval;
     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);
index e535804eb448430774a79a4398f83749ead509ae..5e81ba3f7c05741746eba522ce7f69f8a7f75b3c 100644 (file)
@@ -94,7 +94,7 @@ void req_initialize()
     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);
@@ -122,7 +122,7 @@ int handle_retransmitted()
 #endif
            status = TRUE;
            (void) sendto(s, requests[i].out_pkt, requests[i].out_pktlen, 
-                         0, &sin, addrlen);
+                         0, (struct sockaddr *)&sin, addrlen);
            break;
        }
     }
@@ -143,7 +143,8 @@ void respond(status,text)
     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);
 }
@@ -161,7 +162,8 @@ void get_request(message)
        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. */
index de90c36fab1dc55ea1d175226d0600688cda35b8..1bbdb5e09f61d8a95de426286a8959bb4059f3b6 100644 (file)
 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))
index c9a10ded2f1f993fed03acb709116125a9f2acd0..ab181ad082c3ce84c837ea06584675596e967f66 100644 (file)
@@ -64,7 +64,6 @@ struct entry {
     char *address;
     char *phone;
     char *phone2;
-    char *email;
 };
 
 
@@ -159,7 +158,7 @@ struct entry *get_next_entry(in)
 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];
@@ -228,11 +227,6 @@ FILE *in;
     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);
 }
 
index 5edbbbdc2b8db7a3abcf3ef396f4060f4bf7824c..be5b7fe35aa074daae1d831588aa126638ef8cc8 100644 (file)
@@ -32,6 +32,11 @@ static char *rcsid_rafnu_c = "$Header$";
 
 #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
@@ -69,10 +74,6 @@ ReadAndFixNextUser(s, querc, querv)
     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 */
index 3d54eba8b98b2552badbf9bb4c2c91ecaf266e7c..9a72909cd2438a669505d0ef67da8940227806cf 100644 (file)
@@ -19,6 +19,7 @@ static char *rcsid_sms_scall_c = "$Header$";
 #include <sys/file.h>
 #include <fcntl.h>
 #include <string.h>
+#include <netinet/in.h>
 #include <arpa/inet.h>
 #include <krb.h>
 #include <errno.h>
index 1505719a2ac9975b50b519b599558cffb158308b..ca9993131894fe71be56f0997b3cc63bca7499c5 100644 (file)
@@ -16,6 +16,7 @@
 #include <krb.h>
 #include <com_err.h>
 #include <stdlib.h>
+#include <stdarg.h>
 
 typedef struct returned_tuples {
        struct returned_tuples *next;
@@ -188,6 +189,6 @@ void do_shutdown(client *cl);
 /* 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);
index af7e266f24b6a474ab560166762189e25a6ba218..75d9ccdbfa46b8f31a3688fe020b19b7a74f28e8 100644 (file)
@@ -70,10 +70,10 @@ void log_args(tag, version, argc, argv)
 }
        
 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;
        
index 1d817ab502e0baef5c0929277ffe7c5bd8e6de90..182e77a5c79ea3524941a69464338dd4282ee1c7 100644 (file)
@@ -129,7 +129,7 @@ auth_002(str)
        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;
index 3033d265b404bf1d311788000470e3beb9ad8d2b..0ab206442a2a9361e0e7a158f16022a0733f6e7e 100644 (file)
@@ -255,7 +255,7 @@ char *host_name;
        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);
index 1f15b6d3259d360375903e4e4e3d9d2929727304..12349401d6f623f88c1494c63c2127d281cac454 100644 (file)
@@ -176,7 +176,7 @@ ORADEFS= DEFINE=HESIOD DEFINE=ZEPHYR DEFINE=GDSS DEFINE=ATHENA
 #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::                                                                        @@\
index ce0a695c82c65dafa728402d5518c96582c3bd7c..7cc9dafca03204cfbe03388d900893d78e7f9c10 100644 (file)
@@ -17,7 +17,7 @@ OSDEFS= -DPOSIX
 #endif
 
 #ifdef sgi
-OSDEFS= -DPOSIX -DUSE_CRYPT_H -DSYSV
+OSDEFS= -DPOSIX -DSYSV
 #endif
 
 #if defined(SOLARIS)
@@ -209,10 +209,14 @@ MOTIFINC= /mit/motif/include
 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.
This page took 0.088238 seconds and 5 git commands to generate.