# --- T2-COPYRIGHT-NOTE-BEGIN --- # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # T2 SDE: package/.../pam/strndupa.patch.musl # Copyright (C) 2019 The T2 SDE Project # # More information can be found in the files COPYING and README. # # This patch file is dual-licensed. It is available under the license the # patched project is licensed under, as long as it is an OpenSource license # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms # of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # --- T2-COPYRIGHT-NOTE-END --- --- Linux-PAM-1.3.0/modules/pam_exec/pam_exec.c.vanilla 2019-02-06 12:39:51.493312051 +0000 +++ Linux-PAM-1.3.0/modules/pam_exec/pam_exec.c 2019-02-06 12:42:27.113310277 +0000 @@ -60,6 +60,18 @@ #include #include +#ifndef __GLIBC__ +char* strndupa(const char *s, size_t n) { + const char *__old = (s); + size_t __len = strnlen(__old, (n)); + char *__new = alloca(__len + 1); + __new[__len] = '\0'; + memcpy(__new, __old, __len); + return __new; +} +#endif + + #define ENV_ITEM(n) { (n), #n } static struct { int item;