[pubcookie-dev] Re: Problem With pbc_apacheconfig and mod_pubcookie?
Jeffrey T Eaton
jeaton at cmu.edu
Mon Jul 31 19:03:35 PDT 2006
On Jul 26, 2006, at 2:51 PM, Jon Miner wrote:
> Jeff, Steve and Jim (and everybody else, of course):
> One of our customers was attempting to compile mod_pubcookie on Mac OS
> 10.3 (Not that it matters, I get the same error on 10.4) with
> Apache 2.
> Per my K&R, this code should not function. pubcookie_module will be a
> pointer to garbage (or maybe NULL -- depending on the compiler), since
> the initialization from mod_pubcookie.c doesn't survive outside the
> it is contained in.
> By Mike's and my understanding, the declaration in mod_pubcookie.h
> should be:
> extern module pubcookie_module;
> to make the linker find the initialized variable in mod_pubcookie's
> object file (static or dynamic).
> But what I don't understand is how this works at all, on any platform.
> It seems to be detected by attempting to compile dynamically, and
> somehow it seems to work for statically compiled versions on Apache
> Comments? Anybody got ideas?
I agree that probably it shouldn't work, and I don't understand how
it does work, but clearly it does. Does it still work if you just
change the code to "extern module pubcookie_module"? If that still
works, then I can't think of any reason not to change it.
More information about the pubcookie-dev