#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";
+static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 12/15/93";
#endif /* not lint */
#include <sys/types.h>
#include "externs.h"
#include "defines.h"
+/* These values need to be the same as defined in libtelnet/kerberos5.c */
+/* Either define them in both places, or put in some common header file. */
+#define OPTS_FORWARD_CREDS 0x00000002
+#define OPTS_FORWARDABLE_CREDS 0x00000001
+
+#if 0
+#define FORWARD
+#endif
+
/*
* Initialize variables.
*/
prompt,
#ifdef AUTHENTICATION
"[-8] [-E] [-K] [-L] [-S tos] [-X atype] [-a] [-c] [-d] [-e char]",
- "\n\t[-k realm] [-l user] [-n tracefile] ",
+ "\n\t[-k realm] [-l user] [-f/-F] [-n tracefile] ",
#else
"[-8] [-E] [-L] [-S tos] [-a] [-c] [-d] [-e char] [-l user]",
"\n\t[-n tracefile]",
extern int optind;
int ch;
char *user, *strrchr();
+#ifdef FORWARD
+ extern int forward_flags;
+#endif /* FORWARD */
tninit(); /* Clear out things */
#if defined(CRAY) && !defined(__STDC__)
rlogin = (strncmp(prompt, "rlog", 4) == 0) ? '~' : _POSIX_VDISABLE;
autologin = -1;
- while ((ch = getopt(argc, argv, "8EKLS:X:acde:k:l:n:rt:x")) != EOF) {
+ while ((ch = getopt(argc, argv, "8EKLS:X:acde:fFk:l:n:rt:x")) != EOF) {
switch(ch) {
case '8':
eight = 3; /* binary output and input */
case 'e':
set_escape_char(optarg);
break;
+ case 'f':
+#if defined(AUTHENTICATION) && defined(KRB5) && defined(FORWARD)
+ if (forward_flags & OPTS_FORWARD_CREDS) {
+ fprintf(stderr,
+ "%s: Only one of -f and -F allowed.\n",
+ prompt);
+ usage();
+ }
+ forward_flags |= OPTS_FORWARD_CREDS;
+#else
+ fprintf(stderr,
+ "%s: Warning: -f ignored, no Kerberos V5 support.\n",
+ prompt);
+#endif
+ break;
+ case 'F':
+#if defined(AUTHENTICATION) && defined(KRB5) && defined(FORWARD)
+ if (forward_flags & OPTS_FORWARD_CREDS) {
+ fprintf(stderr,
+ "%s: Only one of -f and -F allowed.\n",
+ prompt);
+ usage();
+ }
+ forward_flags |= OPTS_FORWARD_CREDS;
+ forward_flags |= OPTS_FORWARDABLE_CREDS;
+#else
+ fprintf(stderr,
+ "%s: Warning: -F ignored, no Kerberos V5 support.\n",
+ prompt);
+#endif
+ break;
case 'k':
#if defined(AUTHENTICATION) && defined(KRB4)
{