Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Jul 2007 12:01:13 GMT
From:      Michael Scholz <mike@fth-devel.net>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/114494: [patch] port net/freenet6 putenv (-current) doesn't work
Message-ID:  <200707111201.l6BC1DNP066432@www.freebsd.org>
Resent-Message-ID: <200707111210.l6BCA6cc054687@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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@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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200707111201.l6BC1DNP066432>