On Wed, Jan 25, 2012 at 11:01:15AM +0400, Ilya Matveychikov wrote:
Attachment contains the patch.
Thanks.
While the patch is certainly correct, --enable-static-modules still fails
to build even with this change applied.
The straightforward command
$ ./autogen.sh && ./configure --enable-static-modules --disable-pie &&
make
fails with the following complaint:
make[3]: *** No rule to make target `../../libpam/libpam.la', needed by
`pam_access.la'. Stop.
In the usual way to build pam, i.e. not in --enable-static-modules mode,
libpam is actually required to link pam modules, so "libpam" is placed
before "modules" in the SUBDIRS list.
When STATIC_MODULES is enabled, however, "modules" target goes first,
due to that notorious static_modules structure.
While pam_access.la (and other pam modules) doesn't actually need
libpam.la in STATIC_MODULES mode, several modules (e.g. pam_mkhomedir,
pam_selinux, pam_tally2, pam_timestamp) also build executables which link
with libpam.la.
I wonder how do you deal with this dependency loop.
BTW, --enable-static-modules mode seems to be broken for a long time
already. For example, pam_rhosts_auth was removed in 0.99.10.0 (which
was released about four years ago) thus leaving static_modules with
the undefined reference to _pam_rhosts_auth_modstruct. Since that time,
some other changes broke STATIC_MODULES even more. There are quite a few
pam modules maintained as separate projects nowadays, and this
static_modules concept does not provide a convenient method to use them.
That is, I'm not quite sure --enable-static-modules worths fixing at all.
Check for the correctness.
With minor corrections, it is going to look this way:
Fix compile time errors in --enable-static-modules mode
* libpam/pam_static_modules.h (_pam_rhosts_auth_modstruct): Remove
obsolete declaration.
(static_modules): Remove undefined reference to
_pam_rhosts_auth_modstruct.
* modules/pam_pwhistory/opasswd.h: Rename {save,check}_old_password to
{save,check}_old_pass in order to avoid conflicts with pam_unix.
* modules/pam_pwhistory/opasswd.c: Likewise.
* modules/pam_pwhistory/pam_pwhistory.c: Likewise.
* modules/pam_tally2/pam_tally2.c: Rename _pam_tally_modstruct to
_pam_tally2_modstruct.
Do I need to
do the same things with other patches related to 'static-build' fixes?
Have you reviewed them?
The fix for typo is quite obvious. The change to pam_unix needs a
ChangeLog-style entry, too. I'll comment the change in separate email.
--
ldv