0

.libs/pam_rhosts.o: In function pam_sm_authenticate: pam_rhosts.c:(.text+0x1e4): undefined reference to ruserok'

While compiling Linux-PAM-1.1.8 for arm64. I get this error.

ruserok is defined under a Macro check

    #ifdef __UCLIBC__
    ...
    ...
    ...
    int ruserok(const char *rhost, int superuser, const char *ruser,
                            const char *luser)
    {
      */ruserok defined here*/
    }
    ...
    ...
    #endif

But i am not building with Uclibc but with musl

What can i do now?

Sheik
  • 17
  • 7
  • 2
    I suspect showing some code and telling us how you build this might make it easier to answer – doctorlove Nov 27 '19 at 09:37
  • You have probably forgotten to link with the right libraries. That is what "undefined reference" usually means. – Thomas Padron-McCarthy Nov 27 '19 at 09:39
  • Does this answer your question? [undefined reference to ruserok error](https://stackoverflow.com/questions/15890007/undefined-reference-to-ruserok-error) – Thomas Padron-McCarthy Nov 27 '19 at 09:40
  • `What can i do now?` - provide your own definition of the symbol. Either patch the file or write your own. `even though ruserok is defined in pam_rhosts.c` - ruserok should be defined in the standard library, not in pam sources. It's a [standard function](https://linux.die.net/man/3/ruserok) – KamilCuk Nov 27 '19 at 10:07
  • @KamilCuk Is there any other way without disturbing the source like just linking Uclibc. – Sheik Nov 27 '19 at 13:19
  • It's because `Uclibc` _doesn't_ provide ruserok, that pam needed to implement it itself. It looks like `musl` doesn't provide it either, so you could just remove the ifndef. Or add something along `#if defined(__UCLIBC__) || defined(__SOME_MACRO_THAT_MUSL_PROVIDSE_PROBABLY __MUSL__)` – KamilCuk Nov 27 '19 at 13:22

0 Answers0