* configure.in: Fix typo in Apr 16 HP-UX change.
* state.c (envvarok): nuke all KRB5* environment variables, not just the
previously selected ones.
* telnetd.c (telnet -> doit): moved SIGTTOU handler before the first thing
which would cause the terminal driver to get upset.
* sys_term.c (line): Remove initialization silliness. The non-GNUC method was
Just Wrong, do it the other way always.
(Xline): Specify length, not contents.
* termio-tn.c (readstream_termio): new file, provides isolated version of
M_IOCTL handling for systems where termio and termios can't be compiled
together.
* termios-tn.c (readstream_termios): new file, provides isolated version of
M_IOCTL handling for systems where termio and termios can't be compiled
together.
* telnetd.c (readstream): use readstream_termios and readstream_termio to
handle getmsg with M_IOCTL.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7883
dc483132-0cff-0310-8789-
dd5450dbe970
+Wed May 1 21:14:45 1996 Ken Raeburn <raeburn@cygnus.com>
+
+ * configure.in: Fix typo in Apr 16 HP-UX change.
+
+ Thu Apr 18 16:17:55 1996 Mark Eichin <eichin@cygnus.com>
+
+ * state.c (envvarok): nuke all KRB5* environment variables, not
+ just the previously selected ones.
+
+ Fri Mar 29 01:21:29 1996 Marc Horowitz <marc@mit.edu>
+
+ * telnetd.c (telnet -> doit): moved SIGTTOU handler before the
+ first thing which would cause the terminal driver to get upset.
+
+ Mon Mar 25 01:05:50 1996 Ken Raeburn <raeburn@cygnus.com>
+
+ * sys_term.c (line): Remove initialization silliness. The
+ non-GNUC method was Just Wrong, do it the other way always.
+ (Xline): Specify length, not contents.
+
+ Wed Feb 28 22:27:46 1996 Mark Eichin <eichin@cygnus.com>
+
+ * termio-tn.c (readstream_termio): new file, provides isolated
+ version of M_IOCTL handling for systems where termio and termios
+ can't be compiled together.
+ * termios-tn.c (readstream_termios): new file, provides isolated
+ version of M_IOCTL handling for systems where termio and termios
+ can't be compiled together.
+ * telnetd.c (readstream): use readstream_termios and
+ readstream_termio to handle getmsg with M_IOCTL.
+
Thu Apr 18 16:33:42 1996 Sam Hartman <hartmans@mit.edu>
- * state.c (suboption): Don't accept authentication suboptions after authentication negotiation complete.
+ * state.c (suboption): Don't accept authentication suboptions
+ after authentication negotiation complete.
(envvarok): exclude KRB5_KTNAME and KRB5CCNAME
Tue Apr 16 12:23:02 1996 Sam Hartman <hartmans@mit.edu>
ARPA_TELNET= $(srcdir)/../arpa/telnet.h
SRCS= $(srcdir)/telnetd.c \
+ $(srcdir)/termio-tn.c \
+ $(srcdir)/termios-tn.c \
$(srcdir)/state.c \
$(srcdir)/termstat.c \
$(srcdir)/slc.c \
$(srcdir)/authenc.c \
$(GETTYSRC)
OBJS= telnetd.o \
+ termio-tn.o \
+ termios-tn.o \
state.o \
termstat.o \
slc.o \
dnl login.
dnl
case $krb5_cv_host in
-*-*-hpux-*)
+*-*-hpux*)
broken_streams=yes
;;
*-*-irix*)
# Irix doesn't have a working granpt, and more over
# you can't push anything onto a pty, so telnetd really
# Really wants to treat it as if it doesn't have streams
- broken_streams=yes
+ broken_streams=yes
;;
esac
if test -z "$broken_streams" ; then
if (his_state_is_wont(TELOPT_TTYPE)) /* Ignore if option disabled */
break;
-sb_auth_complete();
+ sb_auth_complete();
settimer(ttypesubopt);
if (SB_EOF() || SB_GET() != TELQUAL_IS) {
case TELOPT_XDISPLOC: {
if (SB_EOF() || SB_GET() != TELQUAL_IS)
return;
-sb_auth_complete();
+ sb_auth_complete();
settimer(xdisplocsubopt);
subpointer[SB_LEN()] = '\0';
(void)setenv("DISPLAY", (char *)subpointer, 1);
if (SB_EOF())
return;
-sb_auth_complete();
+ sb_auth_complete();
c = SB_GET();
if (c == TELQUAL_IS) {
if (subchar == TELOPT_OLD_ENVIRON)
case ENV_USERVAR:
*cp = '\0';
if (envvarok(varp)) {
- if (valp)
- (void)setenv(varp, valp, 1);
- else
- unsetenv(varp);
+ if (valp)
+ (void)setenv(varp, valp, 1);
+ else
+ unsetenv(varp);
}
cp = varp = (char *)subpointer;
valp = 0;
}
*cp = '\0';
if (envvarok(varp)) {
- if (valp)
- (void)setenv(varp, valp, 1);
- else
- unsetenv(varp);
+ if (valp)
+ (void)setenv(varp, valp, 1);
+ else
+ unsetenv(varp);
}
break;
} /* end of case TELOPT_NEW_ENVIRON */
*/
break;
case TELQUAL_IS:
- if (!auth_negotiated)
- auth_is(subpointer, SB_LEN());
+ if (!auth_negotiated)
+ auth_is(subpointer, SB_LEN());
break;
case TELQUAL_NAME:
- if (!auth_negotiated)
- auth_name(subpointer, SB_LEN());
+ if (!auth_negotiated)
+ auth_name(subpointer, SB_LEN());
break;
}
break;
}
static int envvarok(varp)
- char *varp;
+ char *varp;
{
- if (!strncmp(varp, "LD_", 3) || !strncmp(varp, "_RLD_", 5) ||
- !strncmp(varp, "ELF_LD_", 7) || !strncmp(varp, "AOUT_LD_", 8) ||
- !strcmp(varp, "LIBPATH") || !strcmp(varp, "IFS") ||
-!strcmp(varp, "KRB5_KTNAME")|| !strcmp(varp, "KRB5CCNAME")||
- strchr(varp, '='))
- {
- syslog(LOG_INFO, "Rejected the attempt to modify the environment variable \"%s\"", varp);
- return 0;
- }
- return 1;
+ if (!strchr(varp, '=') &&
+ strncmp(varp, "LD_", strlen("LD_")) && /* most systems */
+ strncmp(varp, "_RLD_", strlen("_RLD_")) && /* irix */
+ strncmp(varp, "KRB5", strlen("KRB5")) && /* v5 */
+ /* The above is a catch-all for now. Here are some of the
+ specific ones we must avoid passing, at least until we
+ can prove it can be done safely. Keep this list around
+ in case someone wants to remove the catch-all. */
+ strcmp(varp, "KRB5_CONFIG") && /* v5 */
+ strcmp(varp, "KRB5CCNAME") && /* v5 */
+ strcmp(varp, "KRB5_KTNAME") && /* v5 */
+ strcmp(varp, "KRBTKFILE") && /* v4 */
+ strcmp(varp, "KRB_CONF") && /* cns v4 */
+ strcmp(varp, "KRB_REALMS") && /* cns v4 */
+ strcmp(varp, "LIBPATH") && /* AIX */
+ strcmp(varp, "IFS")) {
+ return 1;
+ } else {
+ syslog(LOG_INFO, "Rejected the attempt to modify the environment variable \"%s\"", varp);
+ return 0;
+ }
+
}
*
* Returns the file descriptor of the opened pty.
*/
-#ifndef __GNUC__
-char *line = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
-#else
-static char Xline[] = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
+static char Xline[17];
char *line = Xline;
-#endif
+
#ifdef CRAY
char *myline = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
#endif /* CRAY */
#ifndef O_NOCTTY
#define O_NOCTTY 0
#endif
-
#endif /* !defined(CRAY) || !defined(NEWINIT) */
#endif
init_env();
+
+#ifdef SIGTTOU
+ /*
+ * Ignoring SIGTTOU keeps the kernel from blocking us.
+ * we tweak the tty with an ioctl()
+ * (in ttioct() in /sys/tty.c in a BSD kernel)
+ */
+ (void) signal(SIGTTOU, SIG_IGN);
+#endif
/*
* get terminal type.
*/
#ifdef SIGTSTP
(void) signal(SIGTSTP, SIG_IGN);
#endif
-#ifdef SIGTTOU
- /*
- * Ignoring SIGTTOU keeps the kernel from blocking us
- * in ttioct() in /sys/tty.c.
- */
- (void) signal(SIGTTOU, SIG_IGN);
-#endif
(void) signal(SIGCHLD, cleanup);
case M_IOCTL:
ip = (struct iocblk *) (ibuf+1);
-
- switch (ip->ioc_cmd) {
- case TCSETS:
- case TCSETSW:
- case TCSETSF:
- tsp = (struct termios *)
- (ibuf+1 + sizeof(struct iocblk));
- vstop = tsp->c_cc[VSTOP];
- vstart = tsp->c_cc[VSTART];
- ixon = tsp->c_iflag & IXON;
- break;
- case TCSETA:
- case TCSETAW:
- case TCSETAF:
- tp = (struct termio *) (ibuf+1 + sizeof(struct iocblk));
- vstop = tp->c_cc[VSTOP];
- vstart = tp->c_cc[VSTART];
- ixon = tp->c_iflag & IXON;
- break;
- default:
- errno = EAGAIN;
- return(-1);
+ if (readstream_termio(ip->ioc_cmd, ibuf,
+ &vstop, &vstart, &ixon)) {
+ if (readstream_termios(ip->ioc_cmd, ibuf,
+ &vstop, &vstart, &ixon)) {
+ errno = EAGAIN;
+ return(-1);
+ }
}
newflow = (ixon && (vstart == 021) && (vstop == 023)) ? 1 : 0;
--- /dev/null
+/* handle having mutually exclusive termio vs. termios */
+/* return 0 if handled */
+#ifdef STREAMSPTY
+#include <sys/types.h>
+#include <sys/stream.h>
+#include <sys/ioctl.h>
+#include <termio.h>
+
+int readstream_termio(cmd, ibuf, vstop, vstart, ixon)
+ int cmd;
+ char *ibuf;
+ char *vstop, *vstart;
+ int *ixon;
+{
+ struct termio *tp;
+ switch (cmd) {
+ case TCSETA:
+ case TCSETAW:
+ case TCSETAF:
+ tp = (struct termio *) (ibuf+1 + sizeof(struct iocblk));
+#if 0 /* VSTOP/VSTART only in termios!? */
+ *vstop = tp->c_cc[VSTOP];
+ *vstart = tp->c_cc[VSTART];
+#endif
+ *ixon = tp->c_iflag & IXON;
+ return 0;
+ }
+ return -1;
+}
+
+#endif /* STREAMSPTY */
--- /dev/null
+/* handle having mutually exclusive termio vs. termios */
+/* return 0 if handled */
+#ifdef STREAMSPTY
+#include <sys/types.h>
+#include <sys/stream.h>
+#include <sys/ioctl.h>
+#include <termios.h>
+
+int readstream_termios(cmd, ibuf, vstop, vstart, ixon)
+ int cmd;
+ char *ibuf;
+ char *vstop, *vstart;
+ int *ixon;
+{
+ struct termios *tsp;
+ switch (cmd) {
+ case TCSETS:
+ case TCSETSW:
+ case TCSETSF:
+ tsp = (struct termios *)
+ (ibuf+1 + sizeof(struct iocblk));
+ *vstop = tsp->c_cc[VSTOP];
+ *vstart = tsp->c_cc[VSTART];
+ *ixon = tsp->c_iflag & IXON;
+ return 0;
+ }
+ return -1;
+}
+
+#endif /* STREAMSPTY */