postfix-devel December 2010 archive
Main Archive Page > Month Archives  > postfix-devel archives
postfix-devel: Re: tiny bit for shared postfix libraries

Re: tiny bit for shared postfix libraries

From: Wietse Venema <wietse_at_nospam>
Date: Sun Dec 05 2010 - 18:04:31 GMT
To: Postfix developers <postfix-devel@postfix.org>

Michael Tokarev:
> 05.12.2010 19:46, Wietse Venema wrote:
> > Michael Tokarev:
> >> The patch below is something I carry locally
> >> since very long time, I forgot when I used it
> >> first. It were rejected when I first posted
> >> it to postfix-users, but without it building
> >> shared libpostfix is not possible due to
> >> wrongly placed variable. FWIW.
> >
> > That is a very brief problem description. Can you explain it?
>
> The problem is that when you build postfix using shared
> libpostfix (or components), only executables that actually
> define var_command_maxtime can be linked (built), for all
> others the link stage fails because pipe_command() uses
> that variable but it's not defined in, say, postmap or
> smtpd, so we end up with a missing symbol.
>
> Exactly the same situation is with the var_scache_service
> patch.

In other words the library wants var_command_maxtime even if
the program never calls pipe_command().

> For a real fix, another argument for pipe_command() sounds
> better. I can make a patch for that against current code
> if you prefer that.

Not to fast. I just checked and there are lots of variables referenced
by library modules.

For example, all service names are initialized and defined in
mail_params.c. Thus, var_scache_service should be handled in the
same way as the other service name parameters.

In the case of var_command_time, it makes sense to pass it
as a parameter, since it is used in a very specific place.

I'm in the process of cleaning up some code, and will do the
var_command_time and var_scache_service cleanup today.

        Wietse