Bug#571559: lighttpd: fastcgi bin-environment variable not set

2010-03-07 Thread Stefan Bühler
Hi,

this is not a bug in lighttpd; FCGI_Accept() overrides the process enviroment 
with the (Fast)CGI environment, so you have to get the value before calling 
FCGI_Accept().



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#571559: lighttpd: fastcgi bin-environment variable not set

2010-02-25 Thread Jeremy Lal
Package: lighttpd
Version: 1.4.26-1
Severity: normal

I want to get an environment variable MY_VAR in a small c program (attached),
and it used to work with a previous version of lighttpd. With this version it 
does not. Some variables are properly set, e.g. QUERY_STRING is ok.
I also attached the lighttpd config file.



-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 
'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-3-686 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages lighttpd depends on:
ii  libattr11:2.4.44-1   Extended attribute shared library
ii  libbz2-1.0  1.0.5-4  high-quality block-sorting file co
ii  libc6   2.10.2-5 Embedded GNU C Library: Shared lib
ii  libgamin0 [libfam0] 0.1.10-2+b1  Client library for the gamin file 
ii  libldap-2.4-2   2.4.17-2.1   OpenLDAP libraries
ii  libpcre37.8-3Perl 5 Compatible Regular Expressi
ii  libssl0.9.8 0.9.8k-8 SSL shared libraries
ii  libterm-readline-perl-p 1.0303-1 Perl implementation of Readline li
ii  lsb-base3.2-23   Linux Standard Base 3.2 init scrip
ii  mime-support3.48-1   MIME files 'mime.types'  'mailcap
ii  zlib1g  1:1.2.3.4.dfsg-3 compression library - runtime

Versions of packages lighttpd recommends:
ii  spawn-fcgi1.6.3-1A fastcgi process spawner

Versions of packages lighttpd suggests:
ii  apache2-utils 2.2.14-7   utility programs for webservers
ii  openssl   0.9.8k-8   Secure Socket Layer (SSL) binary a
pn  rrdtool   none (no description available)

-- no debconf information
/* gcc testbinenv.c -o testbinenv -lfcgi */
#include stdlib.h
#include string.h
#include fcgi_stdio.h

int main(int argc, char *argv[])
{
	while (FCGI_Accept() = 0) {
		printf(Content-type: text/html;charset=UTF-8\r\n\r\n);
		printf(one loop);
		char* fTemp = getenv(MY_VAR);
		if (fTemp == NULL || strlen(fTemp) == 0) {
			printf(no MY_VAR\r\n);
			continue;
		}
		printf(MY_VAR : %s\r\n, fTemp);
	} // FCGI_Accept()

	return 0;
}


server.modules   += ( mod_fastcgi )

$HTTP[remoteip] =~ 127.0.0.1 {
fastcgi.server+= ( testbinenv.fcgi =
((
bin-path = /home/toto/testbinenv,
socket = /var/run/lighttpd/testbinenv.socket,
max-procs = 1,
idle-timeout = 5,
check-local   = disable,
bin-environment = (
MY_VAR = test_my_var
),
bin-copy-environment = (
PATH, SHELL, USER
)
))
)
}