[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [patch] statically linking with mechglue-branch



On Fri, 28 Apr 2006 10:52:05 +0200
Gabor Gombas <gombasg@sztaki.hu> wrote:

> On Thu, Apr 27, 2006 at 05:33:40PM -0400, Michael B Allen wrote:
> 
> >   gssserver: Cannot open '/usr/heimdal/lib/gss/libmech_krb5.so': \
> >     /usr/heimdal/lib/gss/libmech_krb5.so: undefined symbol: \
> >     GSS_C_PEER_HAS_UPDATED_SPNEGO
> >   gssserver: Cannot open '/usr/heimdal/lib/gss/libmech_spnego.so': \
> >     /usr/heimdal/lib/gss/libmech_krb5.so.1: undefined symbol: \
> >     krb5_rd_cred2
> > 
> > The GSS_C_PEER_HAS_UPDATED_SPNEGO symbol is exported in libgssapi.so and
> > krb5_rd_cred2 is exported in libkrb5.so.
> 
> Then it smells like libmech_krb5.so is not linked against libgssapi.so
> and librkb5.so. Assuming you are on an ELF system, do an 'objdump -p' on
> libmech_krb5.so and verify that the Dynamic section contains 'NEEDED'
> entries for libgssapi.so.X and libkrb5.so.Y.

You're right, it's not. But these mech libraries are supposed
to be agnostic about what gss implementation they use and
GSS_C_PEER_HAS_UPDATED_SPNEGO is specific to Heimdal's libgssapi. So
technically a mech shouldn't reference an implementation specific
symbol. But since it's just an OID definition I think the solution would
be to simply define a static version of the same OID in the one source
file that uses it (inquire_context_by_oid.c). Easy.

As for the krb5_rd_cred2 symbol, the problem looks more
complicated. AFAICT libmech_krb5.so is linked with libkrb5.so.17. I
guess there's an issue with dlopen-ing libmech_spnego.so which is NOT
linked with libkrb5.so. But this is again a case where the mech library
is referencing something it shouldn't. Meaning, libmech_spnego must
be referencing something in libkrb5.so. But I can't actually find any
'krb5*' UNDefined symbols so it's not clear how dlopen is getting from
libmech_spnego.so to libmech_krb5.so in the first place.

BTW contrary to my earilier thoughts, I think this stuff does need to
be resolved (no pun intended :-) if these mechs are to work with other
mechglue implementations.

Mike

$ objdump -t /usr/heimdal/lib/gss/libmech_krb5.so | grep krb5_rd_cred2
00000000       F *UND*  00000082              krb5_rd_cred2

$ objdump -t /usr/heimdal/lib/libkrb5.so | grep krb5_rd_cred2
0002df14 g     F .text  00000082              krb5_rd_cred2

$ objdump -p /usr/heimdal/lib/gss/libmech_krb5.so

/usr/heimdal/lib/gss/libmech_krb5.so:     file format elf32-i386

Program Header:
    LOAD off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**12
         filesz 0x0000df8c memsz 0x0000df8c flags r-x
    LOAD off    0x0000e000 vaddr 0x0000e000 paddr 0x0000e000 align 2**12
         filesz 0x00000610 memsz 0x00000644 flags rw-
 DYNAMIC off    0x0000e014 vaddr 0x0000e014 paddr 0x0000e014 align 2**2
         filesz 0x00000118 memsz 0x00000118 flags rw-
   STACK off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**2
         filesz 0x00000000 memsz 0x00000000 flags rw-

Dynamic Section:
  NEEDED      libkrb5.so.17
  NEEDED      libgssapi.so.4
  NEEDED      libcrypto.so.4
  NEEDED      libasn1.so.5
  NEEDED      libroken.so.16
  NEEDED      libutil.so.1
  NEEDED      libresolv.so.2
  NEEDED      libc.so.6
  SONAME      libmech_krb5.so.1
  RPATH       /usr/heimdal/lib
  INIT        0x2a38
  FINI        0xd730
  HASH        0xb4
  STRTAB      0x118c
  SYMTAB      0x5bc
  STRSZ       0xe39
  SYMENT      0x10
  PLTGOT      0xe190
  PLTRELSZ    0x4c8
  PLTREL      0x11
  JMPREL      0x2570
  REL         0x21c8
  RELSZ       0x3a8
  RELENT      0x8
  VERDEF      0x2140
  VERDEFNUM   0x2
  VERNEED     0x2178
  VERNEEDNUM  0x2
  VERSYM      0x1fc6
  RELCOUNT    0x61

Version definitions:
1 0x01 0x0e953ba1 libmech_krb5.so.1
2 0x00 0x064bed60 GSSAPI_2.0

Version References:
  required from libc.so.6:
    0x09691f73 0x00 05 GLIBC_2.1.3
    0x0d696910 0x00 04 GLIBC_2.0
  required from libgssapi.so.4:
    0x064bed60 0x00 03 GSSAPI_2.0

$ objdump -p /usr/heimdal/lib/gss/libmech_spnego.so

/usr/heimdal/lib/gss/libmech_spnego.so:     file format elf32-i386

Program Header:
    LOAD off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**12
         filesz 0x00007114 memsz 0x00007114 flags r-x
    LOAD off    0x00007114 vaddr 0x00008114 paddr 0x00008114 align 2**12
         filesz 0x000003c8 memsz 0x000003cc flags rw-
 DYNAMIC off    0x00007128 vaddr 0x00008128 paddr 0x00008128 align 2**2
         filesz 0x00000108 memsz 0x00000108 flags rw-
   STACK off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**2
         filesz 0x00000000 memsz 0x00000000 flags rw-

Dynamic Section:
  NEEDED      libgssapi.so.4
  NEEDED      libasn1.so.5
  NEEDED      libroken.so.16
  NEEDED      libutil.so.1
  NEEDED      libresolv.so.2
  NEEDED      libc.so.6
  SONAME      libmech_spnego.so.1
  RPATH       /usr/heimdal/lib
  INIT        0x16b4
  FINI        0x7090
  HASH        0xb4
  STRTAB      0xa38
  SYMTAB      0x3d8
  STRSZ       0x6b0
  SYMENT      0x10
  PLTGOT      0x8244
  PLTRELSZ    0x298
  PLTREL      0x11
  JMPREL      0x141c
  REL         0x125c
  RELSZ       0x1c0
  RELENT      0x8
  VERDEF      0x11b4
  VERDEFNUM   0x2
  VERNEED     0x11ec
  VERNEEDNUM  0x2
  VERSYM      0x10e8
  RELCOUNT    0x33

Version definitions:
1 0x01 0x0e970f51 libmech_spnego.so.1
2 0x00 0x064bed60 GSSAPI_2.0

Version References:
  required from libc.so.6:
    0x09691f73 0x00 07 GLIBC_2.1.3
    0x0d696910 0x00 06 GLIBC_2.0
    0x0d696913 0x00 05 GLIBC_2.3
  required from libgssapi.so.4:
    0x064bed60 0x00 04 GSSAPI_2.0
    0x064bec60 0x00 03 GSSAPI_1.0