--- ./opielogin.c Wed Mar 10 21:09:53 1999 +++ ../opie-2.4/./opielogin.c Mon May 20 17:56:45 2002 @@ -164,13 +164,14 @@ static int rflag = 0; static int usererr = -1; +#if !HAVE_MOTD_IN_PROFILE static int stopmotd = 0; +#endif static char rusername[NMAX + 1]; static char name[NMAX + 1] = ""; static char minusnam[16] = "-"; static char *envinit[1]; /* now set by setenv calls */ static char term[64] = ""; /* important to initialise to a NULL string */ -static char host[HMAX + 1] = ""; static struct passwd nouser; static struct passwd thisuser; --- ./Makefile.in Sun Jul 16 12:44:08 2000 +++ ../opie-2.4/./Makefile.in Mon May 20 17:04:24 2002 @@ -127,6 +127,8 @@ LFLAGS=-Llibopie -Llibmissing -lopie $(LIBS) -lmissing -lopie LDEPS=libmissing/libmissing.a libopie/libopie.a +OPIEAUTH= + all: client server ifdefs: @@ -152,7 +154,7 @@ @-for i in otp-md4 otp-md5; do ln -s opiekey.1 $(LOCALMAN)/man1/$$i.1; done @if test ! -d $(LOCALMAN)/man1; then $(MKDIR) $(LOCALMAN)/man1; chmod 755 $(LOCALMAN)/man1; fi; cp opiekey.1 $(LOCALMAN)/man1/opiekey.1; $(CHOWN) $(OWNER) $(LOCALMAN)/man1/opiekey.1; chgrp $(GROUP) $(LOCALMAN)/man1/opiekey.1; chmod 644 $(LOCALMAN)/man1/opiekey.1 -server: libopie/libopie.a libmissing/libmissing.a opietest-passed opielogin opiesu opiepasswd opieinfo opieftpd opieserv +server: libopie/libopie.a libmissing/libmissing.a opietest-passed $(OPIEAUTH) opielogin opiesu opiepasswd opieinfo opieftpd opieserv server-install: server @echo "Installing OPIE server software..." @@ -303,6 +305,9 @@ opieftpd: opieftpd.o glob.o popen.o y.tab.o $(LDEPS) $(CC) $(CFLAGS) opieftpd.o glob.o popen.o y.tab.o $(LFLAGS) -o opieftpd + +opieauth: opieauth.o permsfile.o $(LDEPS) + $(CC) $(CFLAGS) opieauth.o $(LFLAGS) -o opieauth opielogin: opielogin.o permsfile.o $(LDEPS) $(CC) $(CFLAGS) opielogin.o permsfile.o $(LFLAGS) -o opielogin --- ./libopie/logwtmp.c Wed Mar 10 21:09:57 1999 +++ ../opie-2.4/./libopie/logwtmp.c Tue May 21 15:56:29 2002 @@ -144,8 +144,14 @@ ut.ut_type = DEAD_PROCESS; #endif /* HAVE_UT_TYPE && defined(USER_PROCESS) */ #if HAVE_UT_ID - if (id) + if (id) { +#ifdef __sgi + /* IRIX systems store "ttyqN" in ut_line, and "qN" in ut_id. */ + if (!strncmp(id, "tty", 3)) + id += 3; +#endif strncpy(ut.ut_id, id, sizeof(ut.ut_id)); + } #endif /* HAVE_UT_ID */ #if HAVE_UT_PID ut.ut_pid = getpid(); @@ -176,8 +182,14 @@ else utx.ut_type = DEAD_PROCESS; #endif /* USER_PROCESS */ - if (id) + if (id) { +#ifdef __sgi + /* IRIX systems store "ttyqN" in ut_line, and "qN" in ut_id. */ + if (!strncmp(id, "tty", 3)) + id += 3; +#endif strncpy(utx.ut_id, id, sizeof(utx.ut_id)); + } utx.ut_pid = getpid(); #if HAVE_UTX_SYSLEN utx.ut_syslen = strlen(utx.ut_host) + 1; --- ./libopie/readrec.c Fri Jan 19 06:11:09 2001 +++ ../opie-2.4/./libopie/readrec.c Mon May 20 18:14:12 2002 @@ -135,7 +135,6 @@ { char *c, principal[OPIE_PRINCIPAL_MAX]; - int i; if (c = strchr(opie->opie_principal, ':')) *c = 0; --- ./libopie/accessfile.c Wed Mar 10 21:09:57 1999 +++ ../opie-2.4/./libopie/accessfile.c Mon May 20 17:59:53 2002 @@ -57,8 +57,7 @@ */ long n; struct hostent *hp; - FILE *fp; - char buf[128], **lp; + char **lp; #ifdef DEBUG syslog(LOG_DEBUG, "accessfile: host=%s", host); --- ./libopie/login.c Fri Jan 19 06:11:09 2001 +++ ../opie-2.4/./libopie/login.c Mon May 20 18:07:41 2002 @@ -81,9 +81,9 @@ #error No ut_name field in struct utmp? (Please send in a bug report) #endif /* HAVE_UT_NAME */ -#if HAVE_UT_HOST +#if DOUTMPX || HAVE_UT_HOST strncpy(u.ut_host, host, sizeof(u.ut_host)); -#endif /* HAVE_UT_HOST */ +#endif /* DOUTMPX || HAVE_UT_HOST */ #if DOUTMPX && HAVE_UTX_SYSLEN u.ut_syslen = strlen(host) + 1; #endif /* DOUTMPX && HAVE_UT_SYSLEN */ --- ./libopie/verify.c Fri Jan 19 06:11:09 2001 +++ ../opie-2.4/./libopie/verify.c Mon May 20 17:59:00 2002 @@ -47,8 +47,6 @@ { RESPONSE_UNKNOWN, NULL } }; -static char *algids[] = { NULL, NULL, NULL, "sha1", "md4", "md5" }; - static int changed FUNCTION((opie), struct opie *opie) { struct opie opie2; @@ -70,7 +68,6 @@ int i, rval = -1; char *c; struct opie_otpkey key, fkey, lastkey; - struct opie nopie; if (!opie || !response) goto verret; --- ./libopie/generator.c Sun Jul 16 12:44:13 2000 +++ ../opie-2.4/./libopie/generator.c Mon May 20 18:13:55 2002 @@ -171,7 +171,6 @@ { char newseed[OPIE_SEED_MAX + 1]; struct opie_otpkey newkey; - char *c; char buf[OPIE_SEED_MAX + 48 + 1]; while (sequence-- != 0) --- ./libopie/writerec.c Fri Jan 19 06:11:09 2001 +++ ../opie-2.4/./libopie/writerec.c Mon May 20 18:14:54 2002 @@ -39,9 +39,9 @@ int __opiewriterec FUNCTION((opie), struct opie *opie) { - char buf[17], buf2[64]; + char buf2[64]; time_t now; - FILE *f, *f2 = NULL; + FILE *f; int i = 0; char *c; --- ./libmissing/env.c Wed Mar 10 21:09:56 1999 +++ ../opie-2.4/./libmissing/env.c Mon May 20 17:29:47 2002 @@ -109,7 +109,8 @@ if (!P) return (-1); - strncpy(P, environ, cnt * sizeof(char *)); + /* Use memcpy for data that may have NULL bytes, like pointers. */ + memcpy(P, environ, (cnt+1) * sizeof(char *)); environ = P; } --- ./opiesu.c Wed Mar 10 21:09:53 1999 +++ ../opie-2.4/./opiesu.c Mon May 20 17:57:45 2002 @@ -110,7 +110,7 @@ static int fulllogin; #if 0 static int fastlogin; -#else /* 0 */ +#elif INSECURE_OVERRIDE static int force = 0; #endif /* 0 */ --- ./opieftpd.c Sun Jul 16 12:44:09 2000 +++ ../opie-2.4/./opieftpd.c Mon May 20 18:16:03 2002 @@ -841,8 +841,8 @@ file_size = size; byte_count = 0; - if (size != (off_t) - 1) - sprintf(sizebuf, " (%ld bytes)", size); + if (size != (off_t) -1) + sprintf(sizebuf, " (%ld bytes)", (long)size); else strcpy(sizebuf, ""); if (pdata >= 0) { --- ./opiekey.c Wed Mar 10 21:09:53 1999 +++ ../opie-2.4/./opiekey.c Mon May 20 18:17:28 2002 @@ -139,7 +139,9 @@ char *slash; int hex = 0; int type = RESPONSE_STANDARD; +#if INSECURE_OVERRIDE int force; +#endif if (slash = strchr(argv[0], '/')) slash++; @@ -289,7 +291,6 @@ { char buf[OPIE_SEED_MAX + 48 + 1]; - char *c; for (; i <= keynum; i++) { if (count > 1)