96881f1b73
- fix build, dunno if it works
81 lines
2.0 KiB
Plaintext
81 lines
2.0 KiB
Plaintext
$OpenBSD: patch-stel_makeio_c,v 1.1 2001/09/29 21:27:50 naddy Exp $
|
|
--- stel/makeio.c.orig Fri Apr 26 18:29:27 1996
|
|
+++ stel/makeio.c Sat Sep 29 22:55:22 2001
|
|
@@ -21,7 +21,8 @@ static char *rcsid = "@(#) $Id: makeio.c
|
|
#include <sys/time.h>
|
|
#include <netinet/in.h>
|
|
#include <pwd.h>
|
|
-#include "regex.h"
|
|
+#include <time.h>
|
|
+#include <regex.h>
|
|
|
|
#ifdef HAS_SYS_PARAM_H
|
|
#include <sys/param.h>
|
|
@@ -33,7 +34,7 @@ static char *rcsid = "@(#) $Id: makeio.c
|
|
#endif
|
|
#endif
|
|
|
|
-#include "skey.h"
|
|
+#include <skey.h>
|
|
#include "defs.h"
|
|
|
|
#define ESCAPE_CMD "escape"
|
|
@@ -74,7 +75,7 @@ long crc32val;
|
|
#define CONTROL(x) ((x) & 0x1f) /* CTRL(x) is not portable */
|
|
static int escape = CONTROL(']');
|
|
static long oldmask;
|
|
-static long start;
|
|
+static time_t start;
|
|
static char skeybuf[SKEYBUFSIZE];
|
|
static unsigned long userstrokes, traffic, xfertraffic;
|
|
|
|
@@ -364,7 +365,15 @@ int *len;
|
|
|
|
p = (char *)strtok(line +
|
|
strlen(LOG_CMD), " \t");
|
|
- strcpy(logfilename, p ? p : tmpnam(NULL));
|
|
+ if (p) {
|
|
+ strcpy(logfilename, p);
|
|
+ } else {
|
|
+ strncpy(logfilename,"/tmp/stel.XXXXXXXXXX",256);
|
|
+ if (mkstemp(logfilename) == -1) {
|
|
+ perror(logfilename);
|
|
+ break;
|
|
+ }
|
|
+ }
|
|
if ((logfh = open(logfilename,
|
|
O_WRONLY | O_CREAT, 0600)) == -1) {
|
|
perror(logfilename);
|
|
@@ -650,6 +659,9 @@ int automjr;
|
|
printf("\n");
|
|
|
|
if ((char *)getenv("SKEYPADFILE") != NULL) {
|
|
+/*
|
|
+ * We are not using mjr's des mode. Don't bother asking.
|
|
+ *
|
|
if (automjr) {
|
|
cprintf("(using mjr DES padding mode)\n");
|
|
cprintf("using skeypadfile %s\n",
|
|
@@ -666,17 +678,18 @@ int automjr;
|
|
if (buf[0] == 'y')
|
|
desmode = 1;
|
|
}
|
|
+*/
|
|
}
|
|
|
|
/* Crunch seed and password into starting key */
|
|
- if(desmode ? deskeycrunch(key, seed, passwd) :
|
|
- keycrunch(key,seed,passwd) != 0) {
|
|
+ /* OpenBSD does not have deskeycrunch */
|
|
+ if(keycrunch(key,seed,passwd) != 0) {
|
|
cprintf("key crunch failed\n");
|
|
return(NULL);
|
|
}
|
|
|
|
while(n-- != 0)
|
|
- fff(key);
|
|
+ f(key);
|
|
btoe(buf, key);
|
|
return(buf);
|
|
}
|