Re: [PHP] access to the apache environment from the c-client builtinto PHP 4.0.x

2001-08-31 Thread Liam Hoekenga

On Thu, 30 Aug 2001, Rasmus Lerdorf wrote:

> Just do a putenv() from PHP?

We've tried doing that - that's how c-client normally wants to learn about
the krb4 ticket file (with the KRBTKFILE variable).

But... something is caching the KRBTKFILE value in appropriately, and it's
not getting reset each time php is accessed.  We're pretty sure the
problem lies with c-client (probably the krb4 kerberos patches - that it
expect to be called in a single-user kinda situation, such as from pine,
so it doesn't clean up after itself properly).  Rather than rely on
c-client seeing the KRBTKFILE variable, we're trying hard code the name of
the ticketfile into c-client.. which, on our webservers, will *always* be
/ticket/kerb.username (ie /ticket/kerb.liamr)  My post for 8/29 describe
the actualy problem in more detail.

We had gotten around this by running PHP as a CGI - to make it get a fresh
copy of the environment everytime.. but at this point in the game we
really need to run it as a server module.

So, we're trying to correct for this in the source code of the krb4
patches to c-client.. but we can't get the user name into it.

php_imap.c stores the value we want in imap->user, but we can't find it
again once php_imap.c calls c-client itself.  We'd expected it to be in
mb->user, but that variable is empty.. and that little piece of printenv
code we tried shows the c-client knows about the HTTP_ENV_VARS class of
variables, but not the HTTP_SERVER_VARS variables.

Liam

> On Fri, 31 Aug 2001, Liam Hoekenga wrote:
>
> > we're trying to get a krb4 c-client working with php built as an apache
> > server module (either dso or static).
> >
> > we've hit a wall in that, c-client itself seems to have access to the
> > environment in which apache was started, but not the apache environment.
> >
> > ie... we threw this into c-client:
> >
> > {
> > extern char **environ;
> >
> > inti;
> >
> > for ( i = 0; environ[ i ] != NULL; i++ ) {
> > fprintf( stderr, "%s\n", environ[ i ] );
> > }
> > }
> >
> > and the environment that c-client itself can see is:
> > [Fri Aug 31 00:22:19 2001] [info] Server built: Aug 30 2001 12:11:45
> > APACHE=/usr/local/httpsd/bin/httpsd
> > AWK=/usr/bin/awk
> > GREP=/usr/bin/grep
> > HOME=/
> > KRBTKFILE=/ticket/p1090525904
> > PIDFILE=/usr/local/httpsd/log/httpd.pid
> > PS=/usr/bin/ps
> > PWD=/
> > USER=nobody
> >
> > ie - the same stuff phpinfo() lists under HTTP_ENV_VARS.  We really need
> > access to the HTTP_SERVER_VARS (we're revising the krb4 imap patches for
> > c-client, *really* need access to REMOTE_USER from within c-client
> > itself).
> >
> > does anyone have suggestions?
> >
> > Liam
> >
> >
> >
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] access to the apache environment from the c-client builtinto PHP 4.0.x

2001-08-30 Thread Rasmus Lerdorf

Just do a putenv() from PHP?

On Fri, 31 Aug 2001, Liam Hoekenga wrote:

> we're trying to get a krb4 c-client working with php built as an apache
> server module (either dso or static).
>
> we've hit a wall in that, c-client itself seems to have access to the
> environment in which apache was started, but not the apache environment.
>
> ie... we threw this into c-client:
>
> {
> extern char **environ;
>
> inti;
>
> for ( i = 0; environ[ i ] != NULL; i++ ) {
> fprintf( stderr, "%s\n", environ[ i ] );
> }
> }
>
> and the environment that c-client itself can see is:
> [Fri Aug 31 00:22:19 2001] [info] Server built: Aug 30 2001 12:11:45
> APACHE=/usr/local/httpsd/bin/httpsd
> AWK=/usr/bin/awk
> GREP=/usr/bin/grep
> HOME=/
> KRBTKFILE=/ticket/p1090525904
> PIDFILE=/usr/local/httpsd/log/httpd.pid
> PS=/usr/bin/ps
> PWD=/
> USER=nobody
>
> ie - the same stuff phpinfo() lists under HTTP_ENV_VARS.  We really need
> access to the HTTP_SERVER_VARS (we're revising the krb4 imap patches for
> c-client, *really* need access to REMOTE_USER from within c-client
> itself).
>
> does anyone have suggestions?
>
> Liam
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]