Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

openssh: add linux-pam support

Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
Acked-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Tested-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
  • Loading branch information...
commit 767ad5b4a738d5848d8c5042892fca85053370bc 1 parent 50bcee6
Danomi Manchego authored Peter Korsgaard committed
44 package/openssh/openssh-fix-pam-uclibc-pthreads-clash.patch
... ... @@ -0,0 +1,44 @@
  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 +
  8 +Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
  9 +
  10 +diff -urN openssh-6.1p1.orig/auth-pam.c openssh-6.1p1/auth-pam.c
  11 +--- openssh-6.1p1.orig/auth-pam.c 2009-07-12 08:07:21.000000000 -0400
  12 ++++ openssh-6.1p1/auth-pam.c 2012-09-15 19:49:47.677288199 -0400
  13 +@@ -166,6 +166,7 @@
  14 + sigdie("PAM: authentication thread exited uncleanly");
  15 + }
  16 +
  17 ++#define pthread_exit pthread_exit_AVOID_UCLIBC_PTHREAD_CLASH
  18 + /* ARGSUSED */
  19 + static void
  20 + pthread_exit(void *value)
  21 +@@ -173,6 +174,7 @@
  22 + _exit(0);
  23 + }
  24 +
  25 ++#define pthread_create pthread_create_AVOID_UCLIBC_PTHREAD_CLASH
  26 + /* ARGSUSED */
  27 + static int
  28 + pthread_create(sp_pthread_t *thread, const void *attr,
  29 +@@ -200,6 +202,7 @@
  30 + }
  31 + }
  32 +
  33 ++#define pthread_cancel pthread_cancel_AVOID_UCLIBC_PTHREAD_CLASH
  34 + static int
  35 + pthread_cancel(sp_pthread_t thread)
  36 + {
  37 +@@ -207,6 +210,7 @@
  38 + return (kill(thread, SIGTERM));
  39 + }
  40 +
  41 ++#define pthread_join pthread_join_AVOID_UCLIBC_PTHREAD_CLASH
  42 + /* ARGSUSED */
  43 + static int
  44 + pthread_join(sp_pthread_t thread, void **value)
5 package/openssh/openssh.mk
@@ -12,6 +12,11 @@ OPENSSH_CONF_OPT = --libexecdir=/usr/lib --disable-lastlog --disable-utmp \
12 12
13 13 OPENSSH_DEPENDENCIES = zlib openssl
14 14
  15 +ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
  16 +OPENSSH_DEPENDENCIES += linux-pam
  17 +OPENSSH_CONF_OPT += --with-pam
  18 +endif
  19 +
15 20 define OPENSSH_INSTALL_INITSCRIPT
16 21 $(INSTALL) -D -m 755 package/openssh/S50sshd $(TARGET_DIR)/etc/init.d/S50sshd
17 22 endef

0 comments on commit 767ad5b

Please sign in to comment.
Something went wrong with that request. Please try again.