-# $OpenBSD: Makefile,v 1.2 1996/03/27 19:32:55 niklas Exp $
+# $OpenBSD: Makefile,v 1.3 1996/09/05 09:10:00 deraadt Exp $
# $NetBSD: Makefile,v 1.6 1996/02/28 21:03:49 thorpej Exp $
#
# Copyright (c) 1990 The Regents of the University of California.
PROG= telnet
-CFLAGS+=-DTERMCAP -DKLUDGELINEMODE -DUSE_TERMIO -Dunix
+CFLAGS+=-DTERMCAP -DKLUDGELINEMODE -DUSE_TERMIO -DSKEY -Dunix
CFLAGS+=-DENV_HACK
CFLAGS+=-I${.CURDIR}/../../lib
LDADD+= -ltermcap -ltelnet
-/* $OpenBSD: commands.c,v 1.5 1996/07/03 14:01:55 niklas Exp $ */
+/* $OpenBSD: commands.c,v 1.6 1996/09/05 09:10:02 deraadt Exp $ */
/* $NetBSD: commands.c,v 1.14 1996/03/24 22:03:48 jtk Exp $ */
/*
static char sccsid[] = "@(#)commands.c 8.4 (Berkeley) 5/30/95";
static char rcsid[] = "$NetBSD: commands.c,v 1.14 1996/03/24 22:03:48 jtk Exp $";
#else
-static char rcsid[] = "$OpenBSD: commands.c,v 1.5 1996/07/03 14:01:55 niklas Exp $";
+static char rcsid[] = "$OpenBSD: commands.c,v 1.6 1996/09/05 09:10:02 deraadt Exp $";
#endif
#endif /* not lint */
static int margc;
static char *margv[20];
+#if defined(SKEY)
+#include <sys/wait.h>
+#define PATH_SKEY "/usr/bin/skey"
+ int
+skey_calc(argc, argv)
+ int argc;
+ char **argv;
+{
+ int status;
+
+ if(argc != 3) {
+ printf("%s sequence challenge\n", argv[0]);
+ return;
+ }
+
+ switch(fork()) {
+ case 0:
+ execv(PATH_SKEY, argv);
+ exit (1);
+ case -1:
+ perror("fork");
+ break;
+ default:
+ (void) wait(&status);
+ if (WIFEXITED(status))
+ return (WEXITSTATUS(status));
+ return (0);
+ }
+}
+#endif
+
+
+
static void
makeargv()
{
#endif
{ "environ", envhelp, env_cmd, 0 },
{ "?", helphelp, help, 0 },
+#if defined(SKEY)
+ { "skey", NULL, skey_calc, 0 },
+#endif
0
};