+Thu Oct 19 01:28:23 1995 Mark W. Eichin <eichin@cygnus.com>
+
+ * state.c (envvarok): New function, checks environment variables
+ for exceptions that should not be passed to login.
+ (suboption): don't do anything to propagated environment variables
+ if they fail the exception test above.
+
Mon Oct 9 23:01:36 1995 Sam Hartman <hartmans@tertius.mit.edu>
* telnetd.c (getterminaltype): If ENCRYPTION defined, send do
# define env_ovalue OLD_ENV_VALUE
#endif /* ENV_HACK */
+/* envvarok(char*) */
+/* check that variable is safe to pass to login or shell */
+static int
+envvarok(varp)
+ char *varp;
+{
+ if (strncmp(varp, "LD_", strlen("LD_")) &&
+ strncmp(varp, "_RLD_", strlen("_RLD_")) &&
+ strcmp(varp, "LIBPATH") &&
+ strcmp(varp, "IFS")) {
+ return 1;
+ } else {
+ /* optionally syslog(LOG_INFO) here */
+ return 0;
+ }
+
+}
+
/*
* suboption()
*
case NEW_ENV_VAR:
case ENV_USERVAR:
*cp = '\0';
+ if (envvarok(varp)) {
if (valp)
(void)setenv(varp, valp, 1);
else
unsetenv(varp);
+ }
cp = varp = (char *)subpointer;
valp = 0;
break;
}
}
*cp = '\0';
+ if (envvarok(varp)) {
if (valp)
(void)setenv(varp, valp, 1);
else
unsetenv(varp);
+ }
break;
} /* end of case TELOPT_NEW_ENVIRON */
#if defined(AUTHENTICATION)