0001-fix-pam-uclibc-pthreads-clash.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. When PAM is enabled, openssh makes its own static versions of pthreads
  2. functions. But when built with a uclibc toolchain, pthreads.h gets
  3. indirectly included. The clashing exported and static definitions of
  4. the pthreads functions then cause a compile error. This patch fixes
  5. the problem by changing the static pthread function names with macros
  6. when the static functions are defined.
  7. Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
  8. diff -urN openssh-6.1p1.orig/auth-pam.c openssh-6.1p1/auth-pam.c
  9. --- openssh-6.1p1.orig/auth-pam.c 2009-07-12 08:07:21.000000000 -0400
  10. +++ openssh-6.1p1/auth-pam.c 2012-09-15 19:49:47.677288199 -0400
  11. @@ -166,6 +166,7 @@
  12. sigdie("PAM: authentication thread exited uncleanly");
  13. }
  14. +#define pthread_exit pthread_exit_AVOID_UCLIBC_PTHREAD_CLASH
  15. /* ARGSUSED */
  16. static void
  17. pthread_exit(void *value)
  18. @@ -173,6 +174,7 @@
  19. _exit(0);
  20. }
  21. +#define pthread_create pthread_create_AVOID_UCLIBC_PTHREAD_CLASH
  22. /* ARGSUSED */
  23. static int
  24. pthread_create(sp_pthread_t *thread, const void *attr,
  25. @@ -200,6 +202,7 @@
  26. }
  27. }
  28. +#define pthread_cancel pthread_cancel_AVOID_UCLIBC_PTHREAD_CLASH
  29. static int
  30. pthread_cancel(sp_pthread_t thread)
  31. {
  32. @@ -207,6 +210,7 @@
  33. return (kill(thread, SIGTERM));
  34. }
  35. +#define pthread_join pthread_join_AVOID_UCLIBC_PTHREAD_CLASH
  36. /* ARGSUSED */
  37. static int
  38. pthread_join(sp_pthread_t thread, void **value)