ports/114494: [patch] port net/freenet6 putenv (-current) doesn't work
Michael Scholz
mike at fth-devel.net
Wed Jul 11 12:10:11 UTC 2007
>Number: 114494
>Category: ports
>Synopsis: [patch] port net/freenet6 putenv (-current) doesn't work
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Jul 11 12:10:04 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator: Michael Scholz
>Release: FreeBSD 7.0-CURRENT
>Organization:
>Environment:
FreeBSD pumpkin.fth-devel.net 7.0-CURRENT FreeBSD 7.0-CURRENT #1: Tue Jul 10 18:56:49 CEST 2007 mike at pumpkin.fth-devel.net:/usr/gnu/obj/usr/gnu/fbsd/src/sys/PUMPKIN i386
>Description:
Since changes to putenv in -current the net/freenet6 script freenet.sh doesn't get any longer environment variables set in C program tspc and so no tunnel device will be set.
>How-To-Repeat:
/usr/local/etc/rc.d/freenet6 start ; ifconfig shows unset tunnel devices.
>Fix:
Function putenv should be replaced by setenv.
diff --unified=5 /usr/gnu/fbsd/ports/net/freenet6/work/tspc2/platform/freebsd/tsp_local.c.\~1\~ /usr/gnu/fbsd/ports/net/freenet6/work/tspc2/platform/freebsd/tsp_local.c
--- /usr/gnu/fbsd/ports/net/freenet6/work/tspc2/platform/freebsd/tsp_local.c.~1~ 2004-03-30 23:27:35.000000000 +0200
+++ /usr/gnu/fbsd/ports/net/freenet6/work/tspc2/platform/freebsd/tsp_local.c 2007-07-11 13:40:26.000000000 +0200
@@ -74,21 +74,16 @@
/* freebsd specific to setup an env variable */
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(1, ELError, "SetEnv", "Not enough memory!");
return;
}
- snprintf(buf, size, "%s=%s", Variable, Value);
- putenv(buf);
- Display(2, ELNotice, "tspSetEnv", "%s", buf);
- free(buf);
+ Display(2, ELNotice, "tspSetEnv", "%s=%s", Variable, Value);
}
}
/* tspSetupTunnel() will callback here */
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list