patches for easier mirroring, to eliminate a special copy, to make www.freebsd.org/security a full copy of security.freebsd.org and be eventually be the same. For now files are just sitting there. The symlinks are missing. Discussed on: www (repository location) Discussed with: simon (so)
43 lines
1,010 B
Diff
43 lines
1,010 B
Diff
Index: contrib/telnet/telnetd/sys_term.c
|
|
===================================================================
|
|
--- contrib/telnet/telnetd/sys_term.c (revision 188667)
|
|
+++ contrib/telnet/telnetd/sys_term.c (working copy)
|
|
@@ -1271,8 +1271,18 @@
|
|
|
|
char **cpp, **cpp2;
|
|
const char **p;
|
|
-
|
|
- for (cpp2 = cpp = environ; *cpp; cpp++) {
|
|
+ char ** new_environ;
|
|
+ size_t count;
|
|
+
|
|
+ /* Allocate space for scrubbed environment. */
|
|
+ for (count = 1, cpp = environ; *cpp; count++, cpp++)
|
|
+ continue;
|
|
+ if ((new_environ = malloc(count * sizeof(char *))) == NULL) {
|
|
+ environ = NULL;
|
|
+ return;
|
|
+ }
|
|
+
|
|
+ for (cpp2 = new_environ, cpp = environ; *cpp; cpp++) {
|
|
int reject_it = 0;
|
|
|
|
for(p = rej; *p; p++)
|
|
@@ -1286,10 +1296,15 @@
|
|
for(p = acc; *p; p++)
|
|
if(strncmp(*cpp, *p, strlen(*p)) == 0)
|
|
break;
|
|
- if(*p != NULL)
|
|
- *cpp2++ = *cpp;
|
|
+ if(*p != NULL) {
|
|
+ if ((*cpp2++ = strdup(*cpp)) == NULL) {
|
|
+ environ = new_environ;
|
|
+ return;
|
|
+ }
|
|
+ }
|
|
}
|
|
*cpp2 = NULL;
|
|
+ environ = new_environ;
|
|
}
|
|
|
|
/*
|