# --- T2-COPYRIGHT-BEGIN --- # t2/package/*/pam/strndupa.patch.musl # Copyright (C) 2019 - 2026 The T2 SDE Project # SPDX-License-Identifier: GPL-2.0 or patched project license # --- T2-COPYRIGHT-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;