1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # T2 SDE: package/.../pam/strndupa.patch.musl
5 # Copyright (C) 2019 The T2 SDE Project
7 # More information can be found in the files COPYING and README.
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
15 # --- T2-COPYRIGHT-NOTE-END ---
17 --- Linux-PAM-1.3.0/modules/pam_exec/pam_exec.c.vanilla 2019-02-06 12:39:51.493312051 +0000
18 +++ Linux-PAM-1.3.0/modules/pam_exec/pam_exec.c 2019-02-06 12:42:27.113310277 +0000
20 #include <security/pam_ext.h>
21 #include <security/_pam_macros.h>
24 +char* strndupa(const char *s, size_t n) {
25 + const char *__old = (s);
26 + size_t __len = strnlen(__old, (n));
27 + char *__new = alloca(__len + 1);
28 + __new[__len] = '\0';
29 + memcpy(__new, __old, __len);
35 #define ENV_ITEM(n) { (n), #n }