aboutsummaryrefslogtreecommitdiff
path: root/net/gateway6/files/patch-platform.freebsd.tsp_local.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/gateway6/files/patch-platform.freebsd.tsp_local.c')
-rw-r--r--net/gateway6/files/patch-platform.freebsd.tsp_local.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/net/gateway6/files/patch-platform.freebsd.tsp_local.c b/net/gateway6/files/patch-platform.freebsd.tsp_local.c
new file mode 100644
index 000000000000..5cb0b74b24c5
--- /dev/null
+++ b/net/gateway6/files/patch-platform.freebsd.tsp_local.c
@@ -0,0 +1,36 @@
+--- platform/freebsd/tsp_local.c.orig 2007-04-25 21:31:31.000000000 +0200
++++ platform/freebsd/tsp_local.c 2007-07-12 18:38:01.000000000 +0200
+@@ -53,11 +53,11 @@
+ #include "tsp_tun.h" /* freebsd's tun */
+
+
+-char *FileName = "gw6c.conf";
++char *FileName = "/usr/local/etc/gw6c.conf";
+ char *ScriptInterpretor = "/bin/sh";
+ char *ScriptExtension = "sh";
+ char *ScriptDir = NULL;
+-char *TspHomeDir = "/usr/local/etc/gw6";
++char *TspHomeDir = "/usr/local";
+ char DirSeparator = '/';
+
+ int RootUid = 0;
+@@ -77,17 +77,12 @@
+ void
+ tspSetEnv(char *Variable, char *Value, int Flag)
+ {
+- char *buf;
+ if(Value) {
+- int size=(strlen(Variable) + strlen(Value) + 2);
+- if((buf=malloc(size)) == NULL) {
++ if(setenv(Variable, Value, Flag) == -1) {
+ Display(LOG_LEVEL_3, ELError, "SetEnv", HEX_STR_NOT_ENOUGH_MEM);
+ return;
+ }
+- snprintf(buf, size, "%s=%s", Variable, Value);
+- putenv(buf);
+- Display(LOG_LEVEL_3, ELNotice, "tspSetEnv", "%s", buf);
+- free(buf);
++ Display(LOG_LEVEL_3, ELNotice, "tspSetEnv", "%s=%s", Variable, Value);
+ }
+ }
+