Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 578474 Details for
Bug 687234
sys-libs/pam-1.3.1-r1: Fails to build against sys-libs/musl due to undefined 'strdupa' (glibc-specific extension)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Adds a local implementation of 'strdupa' to linux-pam
pam-1.3.1-musl-add-add-strdupa.patch (text/plain), 2.33 KB, created by
Joshua Kinard
on 2019-06-02 23:15:00 UTC
(
hide
)
Description:
Adds a local implementation of 'strdupa' to linux-pam
Filename:
MIME Type:
Creator:
Joshua Kinard
Created:
2019-06-02 23:15:00 UTC
Size:
2.33 KB
patch
obsolete
>From 45d1ed58927593968faead7dbb295f3922f41a2f Mon Sep 17 00:00:00 2001 >From: Khem Raj <raj.khem@gmail.com> >Date: Sat, 8 Aug 2015 14:16:43 -0700 >Subject: [PATCH] Add support for defining missing funcitonality > >In order to support alternative libc on linux ( musl, bioninc ) etc we >need to check for glibc-only features and provide alternatives, in this >list strndupa is first one, when configure detects that its not included >in system C library then the altrnative implementation from missing.h is >used > >Signed-off-by: Khem Raj <raj.khem@gmail.com> >--- >Upstream-Status: Pending > > configure.ac | 3 +++ > libpam/include/missing.h | 12 ++++++++++++ > modules/pam_exec/pam_exec.c | 1 + > 3 files changed, 16 insertions(+) > create mode 100644 libpam/include/missing.h > >diff --git a/configure.ac b/configure.ac >index 9e1257f..cbed979 100644 >--- a/configure.ac >+++ b/configure.ac >@@ -599,6 +599,9 @@ dnl > AC_CHECK_DECL(__NR_keyctl, [have_key_syscalls=1],[have_key_syscalls=0],[#include <sys/syscall.h>]) > AC_CHECK_DECL(ENOKEY, [have_key_errors=1],[have_key_errors=0],[#include <errno.h>]) > >+# musl and bionic don't have strndupa >+AC_CHECK_DECLS_ONCE([strndupa]) >+ > HAVE_KEY_MANAGEMENT=0 > if test $have_key_syscalls$have_key_errors = 11 > then >diff --git a/libpam/include/missing.h b/libpam/include/missing.h >new file mode 100644 >index 0000000..3cf011c >--- /dev/null >+++ b/libpam/include/missing.h >@@ -0,0 +1,12 @@ >+#pragma once >+ >+#if !HAVE_DECL_STRNDUPA >+#define strndupa(s, n) \ >+ ({ \ >+ const char *__old = (s); \ >+ size_t __len = strnlen(__old, (n)); \ >+ char *__new = alloca(__len + 1); \ >+ __new[__len] = '\0'; \ >+ memcpy(__new, __old, __len); \ >+ }) >+#endif >diff --git a/modules/pam_exec/pam_exec.c b/modules/pam_exec/pam_exec.c >index 17ba6ca..3aa2694 100644 >--- a/modules/pam_exec/pam_exec.c >+++ b/modules/pam_exec/pam_exec.c >@@ -59,6 +59,7 @@ > #include <security/pam_modutil.h> > #include <security/pam_ext.h> > #include <security/_pam_macros.h> >+#include <missing.h> > > #define ENV_ITEM(n) { (n), #n } > static struct { >-- >2.1.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 687234
:
578474
|
578476
|
578478
|
578482
|
578484
|
578486
|
578502