+Sat Sep 21 03:47:46 1996 Sam Hartman <hartmans@mit.edu>
+
+ * telnet.c (telnet): Only support XDISPLOC if DISPLAY is supported, thanks to jik.
+
+ * commands.c (tn): Save away arguments before memory used by other
+ functions. Patch thanks to jik.
+ (env_init): Cannonify DISPLAY; patch thanks to jik.
+
+ * sys_bsd.c: Use POSIX_SIGNALS when available. This patch is
+ contribued by jik. It could be cleaned up a bit to be more
+ consistent with Kerberos style, but is functionally correct.
+
Tue Sep 10 14:09:49 1996 Tom Yu <tlyu@mit.edu>
* telnet.1: remove ".so man1/header.doc"
return(NULL);
}
+ int
+env_is_exported(var)
+ unsigned char *var;
+{
+ register struct env_lst *ep;
+
+ if ((ep = env_find(var)))
+ return ep->export;
+ return 0;
+}
+
#if defined(OLD_ENVIRON) && defined(ENV_HACK)
void
env_varval(what)
auth_encrypt_connect(connected);
#endif /* defined(AUTHENTICATION) || defined(ENCRYPTION) */
} while (connected == 0);
+ if (user)
+ user = strdup(user);
+ if (hostp)
+ hostp = strdup(hostp);
cmdrc(hostp, hostname);
+ if (hostp)
+ free(hostp);
if (autologin && user == NULL) {
struct passwd *pw;
else
user = NULL;
}
+ if (user)
+ user = strdup(user);
}
if (user) {
env_define((unsigned char *)"USER", (unsigned char *)user);
(void) call(status, "status", "notmuch", 0);
if (setjmp(peerdied) == 0)
telnet(user);
+ if (user)
+ free(user);
(void) NetClose(net);
ExitString("Connection closed by foreign host.\r\n",1);
/*NOTREACHED*/
*env_default P((int, int)),
*env_getvalue P((unsigned char *));
+extern int
+ env_is_exported P((unsigned char *));
+
extern int
get_status P((void)),
dosynch P((void));
#include <sys/select.h>
#endif
#include <signal.h>
+#ifdef POSIX_SIGNALS
+#include <unistd.h>
+#endif /* POSIX_SIGNALS */
#include <errno.h>
#include <arpa/telnet.h>
extern SIG_FUNC_RET ayt_status();
#endif
+#ifdef POSIX_SIGNALS
+static struct sigaction new_sa_rec, old_sa_rec;
+
+#ifdef SA_INTERRUPT
+#define SIGACTION_INTERRUPT SA_INTERRUPT
+#else
+#define SIGACTION_INTERRUPT 0
+#endif
+
+#ifdef SA_NOMASK
+#define SIGACTION_NOMASK SA_NOMASK
+#else
+#define SIGACTION_NOMASK 0
+#endif
+
+#define signal(sig, func) ((new_sa_rec.sa_handler = func), \
+ sigemptyset(&new_sa_rec.sa_mask), \
+ (new_sa_rec.sa_flags = SIGACTION_INTERRUPT | \
+ SIGACTION_NOMASK), \
+ sigaction(sig, &new_sa_rec, &old_sa_rec), \
+ old_sa_rec.sa_handler)
+
+#endif /* POSIX_SIGNALS */
+
int
tout, /* Output file descriptor */
tin, /* Input file descriptor */
#endif
case TELOPT_XDISPLOC: /* X Display location */
- if (env_getvalue((unsigned char *)"DISPLAY"))
+ if (env_getvalue((unsigned char *)"DISPLAY") &&
+ env_is_exported((unsigned char *)"DISPLAY"))
new_state_ok = 1;
break;
unsigned char temp[50], *dp;
int len;
- if ((dp = env_getvalue((unsigned char *)"DISPLAY")) == NULL) {
+ if (((dp = env_getvalue((unsigned char *)"DISPLAY")) == NULL) ||
+ (! env_is_exported((unsigned char *)"DISPLAY"))) {
/*
* Something happened, we no longer have a DISPLAY
* variable. So, turn off the option.
send_will(TELOPT_LINEMODE, 1);
send_will(TELOPT_NEW_ENVIRON, 1);
send_do(TELOPT_STATUS, 1);
- if (env_getvalue((unsigned char *)"DISPLAY"))
+ if (env_getvalue((unsigned char *)"DISPLAY") &&
+ env_is_exported((unsigned char *)"DISPLAY"))
send_will(TELOPT_XDISPLOC, 1);
if (eight)
tel_enter_binary(eight);
+Sat Sep 21 03:38:31 1996 Sam Hartman <hartmans@mit.edu>
+
+ * utility.c (ttloop): Continue on eintr.
+
Tue Sep 10 14:10:41 1996 Tom Yu <tlyu@mit.edu>
* telnetd.8: remove ".so man1/header.doc"
if (nfrontp-nbackp) {
netflush();
}
+read_again:
ncc = read(net, netibuf, sizeof netibuf);
if (ncc < 0) {
+ if (errno == EINTR)
+ goto read_again;
syslog(LOG_INFO, "ttloop: read: %m");
exit(1);
} else if (ncc == 0) {