From f65d2fe1b9473fa37f326a142b437e6a638084e1 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Wed, 26 Aug 2026 13:23:32 +0200 Subject: [PATCH 01/10] lib/memory/README: Add symlink to the string README Signed-off-by: Alejandro Colomar --- lib/memory/README | 1 + 1 file changed, 1 insertion(+) create mode 120000 lib/memory/README diff --git a/lib/memory/README b/lib/memory/README new file mode 120000 index 0000000000..c5871cc24e --- /dev/null +++ b/lib/memory/README @@ -0,0 +1 @@ +../string/README \ No newline at end of file From 81219686b3fb04f14a49cc52fc275c6f123f6c21 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Wed, 26 Aug 2026 14:02:44 +0200 Subject: [PATCH 02/10] lib/string/README: Reorganize the library in memory/ and string/ Future commits will do the actual move of functions. This change to the README serves as an overview of those changes. Signed-off-by: Alejandro Colomar --- lib/string/README | 126 +++++++++++++++++++++++----------------------- 1 file changed, 64 insertions(+), 62 deletions(-) diff --git a/lib/string/README b/lib/string/README index 70274d71de..2981e8072d 100644 --- a/lib/string/README +++ b/lib/string/README @@ -63,11 +63,63 @@ Don't use some libc functions without Really Good Reasons: Specific guidelines: ==================== + Under lib/memory/ we provide a set of functions to manipulate + bytes --mem*()-- and nonstrings --strn*()--. Under lib/string/ we provide a set of functions to manipulate - strings, separated in subdirectories by utility type. In this - section, we provide a broad overview. + strings. + All of these functions are separated in subdirectories + by utility type. + In this section, we provide a broad overview of all of them. -ctype/ - Character classification and conversion functions +memory/ - memory operations + memset/ - Memory setting + + memzero() + Synonym of explicit_bzero(3). + memzero_a() + Like memzero(), but takes an array. + + strncmp/ - Nonstring comparison + strneq() + Return true if a [[gnu::nonstring]] is equal to a string. + strneq_a() + Like strneq(), but takes an array. + + strnpfx() // Unimplemented + Return true if a [[gnu::nonstring]] starts with a prefix. + STRNPFX() // Unimplemented + Like strnpfx(), but takes an array. + + memdup/ - Memory duplication + + strndup_a() + Like strndup(3), but takes an array. + + memdup() // Unimplemented + Duplicate an object. Returns a pointer to the dup. + memdup_T() + Like memdup(), but with type-safety checks. + + memcpy/ - Memory copying + strncpy_a() + Like strncpy(3), but takes an array. + Use it *exclusively* for copying from a string into a utmp(5) + member. + + strncpytail() + Like strncpy(), but when truncating, the tail of the string is + kept instead of the beginning. This is useful for ut_id. + STRNCPYTAIL() + Like strncpytail, but takes an array. + + strncat_a() // To be removed + Do NOT use. I'll remove it soon. + + MEMCPY() + Like memcpy(3), but takes two arrays. + +string/ - string operations + ctype/ - Character classification and conversion functions isascii.h The functions defined in this file @@ -92,17 +144,12 @@ ctype/ - Character classification and conversion functions The functions defined in this file translate all characters in a string. -memset/ - Memory zeroing - - memzero() - Synonym of explicit_bzero(3). - memzero_a() - Like memzero(), but takes an array. + strzero/ - String zeroing strzero() Like memzero(), but takes a string. -strchr/ - Character search and counting + strchr/ - Character search and counting strchrcnt() Count the number of occurrences of a given character in a string. @@ -113,9 +160,8 @@ strchr/ - Character search and counting strnul(3) Return a pointer to the terminating null byte. -strstr/ - String search + strstr/ - String search - s/ stppfx() // Current name: strprefix() Return a pointer to the end of the prefix, or NULL if not found. @@ -124,9 +170,8 @@ strstr/ - String search Return a pointer to the beginning of the suffix, or NULL if not found. -strcmp/ - String comparison + strcmp/ - String comparison - s/ streq(3) Return true if the strings are equal. @@ -145,47 +190,8 @@ strcmp/ - String comparison strcasesfx() // Unimplemented Like strsfx(), but ignore upper-/lower-case. - n/ - strneq() - Return true if a [[gnu::nonstring]] is equal to a string. - strneq_a() - Like strneq(), but takes an array. + strcpy/ - String copying - strnpfx() // Unimplemented - Return true if a [[gnu::nonstring]] starts with a prefix. - STRNPFX() // Unimplemented - Like strnpfx(), but takes an array. - -strdup/ - Memory duplication - - s/ - strndup_a() - Like strndup(3), but takes an array. - - m/ - memdup() // Unimplemented - Duplicate an object. Returns a pointer to the dup. - memdup_T() - Like memdup(), but with type-safety checks. - -strcpy/ - String copying - - n/ - strncpy_a() - Like strncpy(3), but takes an array. - Use it *exclusively* for copying from a string into a utmp(5) - member. - - strncpytail() - Like strncpy(), but when truncating, the tail of the string is - kept instead of the beginning. This is useful for ut_id. - STRNCPYTAIL() - Like strncpytail, but takes an array. - - strncat_a() // To be removed - Do NOT use. I'll remove it soon. - - s/ strtcpy() Copy from a string into another string with truncation. This is what the Linux kernel calls strscpy(). @@ -204,11 +210,7 @@ strcpy/ - String copying Similar to strtcpy(), but takes a pointer to the end instead of a size. This makes it safer for chaining several calls. - m/ - MEMCPY() - Like memcpy(3), but takes two arrays. - -sprintf/ - Formatted string creation + sprintf/ - Formatted string creation aprintf(3) sprintf(3) variant that allocates. @@ -227,7 +229,7 @@ sprintf/ - Formatted string creation Similar to stprintf(), but takes a pointer to the end instead of a size. This makes it safer for chaining several calls. -strspn/ - String span searching + strspn/ - String span searching Naming conventions: - 'r': rear (search from the end). @@ -258,7 +260,7 @@ strspn/ - String span searching This is rarely useful. It was useful for implementing basename(). -strsep/ - String separation + strsep/ - String separation stpsep() Similar to strsep(3), but swap the input pointer with the return @@ -288,6 +290,6 @@ strsep/ - String separation Variant of strsep2ls() that allocates the array of strings. (But the strings themselves are not duplicated.) -strftime.h + strftime.h strftime_a() Like strftime(3), but takes an array. From 8cdf0ce71aae678d8c5045307ce33faa5a86366c Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Wed, 26 Aug 2026 14:03:23 +0200 Subject: [PATCH 03/10] lib/string/README: Remove strndup_a() Fixes: cb0d47bff1ed (2026-08-18; "lib/string/: strndupa(3): Remove unused macro") Signed-off-by: Alejandro Colomar --- lib/string/README | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/string/README b/lib/string/README index 2981e8072d..1c22f5e0e4 100644 --- a/lib/string/README +++ b/lib/string/README @@ -92,9 +92,6 @@ memory/ - memory operations memdup/ - Memory duplication - strndup_a() - Like strndup(3), but takes an array. - memdup() // Unimplemented Duplicate an object. Returns a pointer to the dup. memdup_T() From 0943230b4d4f6f9ed679b3956171836303eeaa2e Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Wed, 26 Aug 2026 14:04:06 +0200 Subject: [PATCH 04/10] lib/string/README: Rename MEMCPY() => memcpy_a() For consistency with the other _a() macros. Signed-off-by: Alejandro Colomar --- lib/string/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/string/README b/lib/string/README index 1c22f5e0e4..26b9f9ed69 100644 --- a/lib/string/README +++ b/lib/string/README @@ -112,7 +112,7 @@ memory/ - memory operations strncat_a() // To be removed Do NOT use. I'll remove it soon. - MEMCPY() + memcpy_a() Like memcpy(3), but takes two arrays. string/ - string operations From cb653ae17c536b8adedc2a22d9f656c9b15c3863 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Wed, 26 Aug 2026 14:06:10 +0200 Subject: [PATCH 05/10] lib/string/README: Document strncmp(3) and strncat(3) as being from Signed-off-by: Alejandro Colomar --- lib/string/README | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/lib/string/README b/lib/string/README index 26b9f9ed69..be06992628 100644 --- a/lib/string/README +++ b/lib/string/README @@ -19,6 +19,18 @@ General guidelines: Don't use some libc functions without Really Good Reasons: ========================================================== + + strncmp(3) + Use strneq_a(), or strpfx(), or else, + depending on what you want. + The return value of strncmp(3) is confusing, + and it is unclear the purpose of its use when you read it. + + strncat(3) + Use strndup(3) instead. + strncat(3) is legitimate for catenating a prefix of a string + after an existing string. + asprintf(3) Use aprintf(3) instead. @@ -36,20 +48,9 @@ Don't use some libc functions without Really Good Reasons: The return value of strcmp(3) is confusing. strcmp(3) would be legitimate for sorting strings. - strncmp(3) - Use strneq_a(), or strpfx(), or else, - depending on what you want. - The return value of strncmp(3) is confusing, - and it is unclear the purpose of its use when you read it. - strcasecmp(3) Use strcaseeq() instead. - strncat(3) - Use strndup(3) instead. - strncat(3) is legitimate for catenating a prefix of a string - after an existing string. - strlcpy(3) Use strtcpy() instead. strlcpy(3) is vulnerable to DoS. From 2312c3889cf0d3baf38f8d44f39430b7af5d8f93 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Wed, 26 Aug 2026 13:34:59 +0200 Subject: [PATCH 06/10] lib/, src/: Move memzero() to under lib/memory/ Signed-off-by: Alejandro Colomar --- lib/Makefile.am | 2 ++ lib/commonio.c | 2 +- lib/failure.c | 2 +- lib/limits.c | 2 +- lib/log.c | 2 +- lib/loginprompt.c | 2 +- lib/memory/memset/memzero.c | 12 +++++++++++ lib/memory/memset/memzero.h | 42 +++++++++++++++++++++++++++++++++++++ lib/string/memset/memzero.c | 5 +---- lib/string/memset/memzero.h | 27 ++---------------------- src/chage.c | 4 +--- src/faillog.c | 2 +- src/gpasswd.c | 2 +- src/groupadd.c | 2 +- src/lastlog.c | 2 +- src/passwd.c | 1 + src/useradd.c | 2 +- src/usermod.c | 2 +- 18 files changed, 72 insertions(+), 43 deletions(-) create mode 100644 lib/memory/memset/memzero.c create mode 100644 lib/memory/memset/memzero.h diff --git a/lib/Makefile.am b/lib/Makefile.am index d709345986..deae3116de 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -115,6 +115,8 @@ libshadow_la_SOURCES = \ lockpw.c \ loginprompt.c \ mail.c \ + memory/memset/memzero.c \ + memory/memset/memzero.h \ motd.c \ myname.c \ nss.c \ diff --git a/lib/commonio.c b/lib/commonio.c index da530ef222..3fec0f0a20 100644 --- a/lib/commonio.c +++ b/lib/commonio.c @@ -26,6 +26,7 @@ #include "defines.h" #include "fs/mkstemp/fmkomstemp.h" #include "io/fprintf.h" +#include "memory/memset/memzero.h" #include "nscd.h" #ifdef WITH_TCB #include @@ -33,7 +34,6 @@ #include "prototypes.h" #include "shadowlog.h" #include "sssd.h" -#include "string/memset/memzero.h" #include "string/sprintf/aprintf.h" #include "string/sprintf/stprintf.h" #include "string/strcmp/streq.h" diff --git a/lib/failure.c b/lib/failure.c index c8a4ea069b..e441276214 100644 --- a/lib/failure.c +++ b/lib/failure.c @@ -19,8 +19,8 @@ #include "faillog.h" #include "failure.h" #include "io/syslog.h" +#include "memory/memset/memzero.h" #include "prototypes.h" -#include "string/memset/memzero.h" #include "string/strftime.h" #include "string/strcpy/strtcpy.h" diff --git a/lib/limits.c b/lib/limits.c index 3fabe54d3a..cac194eb59 100644 --- a/lib/limits.c +++ b/lib/limits.c @@ -32,7 +32,7 @@ #include "atoi/a2i.h" #include "io/fgets/fgets.h" -#include "string/memset/memzero.h" +#include "memory/memset/memzero.h" #include "string/strcmp/streq.h" #include "string/strcmp/strprefix.h" #include "string/strspn/stpspn.h" diff --git a/lib/log.c b/lib/log.c index 37dbabfbca..c00139da3f 100644 --- a/lib/log.c +++ b/lib/log.c @@ -19,8 +19,8 @@ #include "attr.h" #include "defines.h" #include "io/syslog.h" +#include "memory/memset/memzero.h" #include "prototypes.h" -#include "string/memset/memzero.h" #include "string/strcpy/strncpy.h" #include "string/strcpy/strtcpy.h" diff --git a/lib/loginprompt.c b/lib/loginprompt.c index 9eeae3ddb0..a9d3b67c86 100644 --- a/lib/loginprompt.c +++ b/lib/loginprompt.c @@ -17,8 +17,8 @@ #include "defines.h" #include "getdef.h" #include "io/fgets/fgets.h" +#include "memory/memset/memzero.h" #include "prototypes.h" -#include "string/memset/memzero.h" #include "string/strcpy/strtcpy.h" #include "string/strspn/stpspn.h" #include "string/strtok/stpsep.h" diff --git a/lib/memory/memset/memzero.c b/lib/memory/memset/memzero.c new file mode 100644 index 0000000000..2a7dc02f69 --- /dev/null +++ b/lib/memory/memset/memzero.c @@ -0,0 +1,12 @@ +// SPDX-FileCopyrightText: 2023-2026, Alejandro Colomar +// SPDX-License-Identifier: BSD-3-Clause + + +#include "config.h" + +#include + +#include "memory/memset/memzero.h" + + +extern inline void *memzero(void *ptr, size_t size); diff --git a/lib/memory/memset/memzero.h b/lib/memory/memset/memzero.h new file mode 100644 index 0000000000..4e1c0f056e --- /dev/null +++ b/lib/memory/memset/memzero.h @@ -0,0 +1,42 @@ +// SPDX-FileCopyrightText: 2022-2023, Christian Göttsche +// SPDX-FileCopyrightText: 2023-2026, Alejandro Colomar +// SPDX-License-Identifier: BSD-3-Clause + + +#ifndef SHADOW_INCLUDE_LIB_MEMORY_MEMSET_MEMZERO_H_ +#define SHADOW_INCLUDE_LIB_MEMORY_MEMSET_MEMZERO_H_ + + +#include "config.h" + +#include +#include +#include + +#include "sizeof.h" + + +// memzero_a - memory zero (explicit) array +#define memzero_a(arr) memzero(arr, sizeof_a(arr)) + + +inline void *memzero(void *ptr, size_t size); + + +// memzero - memory zero (explicit) +inline void * +memzero(void *ptr, size_t size) +{ +#if defined(HAVE_MEMSET_EXPLICIT) + memset_explicit(ptr, 0, size); +#elif defined(HAVE_EXPLICIT_BZERO) + explicit_bzero(ptr, size); +#else + bzero(ptr, size); + __asm__ __volatile__ ("" : : "r"(ptr) : "memory"); +#endif + return ptr; +} + + +#endif // include guard diff --git a/lib/string/memset/memzero.c b/lib/string/memset/memzero.c index 2ceb5664c1..a0a404b6c9 100644 --- a/lib/string/memset/memzero.c +++ b/lib/string/memset/memzero.c @@ -1,13 +1,10 @@ -// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar +// SPDX-FileCopyrightText: 2023-2026, Alejandro Colomar // SPDX-License-Identifier: BSD-3-Clause #include "config.h" -#include - #include "string/memset/memzero.h" -extern inline void *memzero(void *ptr, size_t size); extern inline char *strzero(char *s); diff --git a/lib/string/memset/memzero.h b/lib/string/memset/memzero.h index ea7c267bf3..06134736ac 100644 --- a/lib/string/memset/memzero.h +++ b/lib/string/memset/memzero.h @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: 2022-2023, Christian Göttsche -// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar +// SPDX-FileCopyrightText: 2023-2026, Alejandro Colomar // SPDX-License-Identifier: BSD-3-Clause @@ -9,37 +9,14 @@ #include "config.h" -#include #include -#include -#include "sizeof.h" +#include "memory/memset/memzero.h" -// memzero_a - memory zero (explicit) array -#define memzero_a(arr) memzero(arr, sizeof_a(arr)) - - -inline void *memzero(void *ptr, size_t size); inline char *strzero(char *s); -// memzero - memory zero (explicit) -inline void * -memzero(void *ptr, size_t size) -{ -#if defined(HAVE_MEMSET_EXPLICIT) - memset_explicit(ptr, 0, size); -#elif defined(HAVE_EXPLICIT_BZERO) - explicit_bzero(ptr, size); -#else - bzero(ptr, size); - __asm__ __volatile__ ("" : : "r"(ptr) : "memory"); -#endif - return ptr; -} - - // strzero - string zero (explicit) inline char * strzero(char *s) diff --git a/src/chage.c b/src/chage.c index 1b3d5b3829..1a08d07a9e 100644 --- a/src/chage.c +++ b/src/chage.c @@ -9,8 +9,6 @@ #include "config.h" -#ident "$Id$" - #include #include #include @@ -25,11 +23,11 @@ #include "defines.h" #include "fields.h" #include "io/fprintf.h" +#include "memory/memset/memzero.h" #include "prototypes.h" #include "pwio.h" #include "shadowio.h" #include "shadowlog.h" -#include "string/memset/memzero.h" #include "string/sprintf/stprintf.h" #include "string/strcmp/streq.h" #include "string/strcpy/strtcpy.h" diff --git a/src/faillog.c b/src/faillog.c index e697223e51..f2b0a94081 100644 --- a/src/faillog.c +++ b/src/faillog.c @@ -24,9 +24,9 @@ #include "exitcodes.h" #include "faillog.h" #include "io/fprintf.h" +#include "memory/memset/memzero.h" #include "prototypes.h" #include "shadowlog.h" -#include "string/memset/memzero.h" #include "string/strftime.h" #undef NDEBUG diff --git a/src/gpasswd.c b/src/gpasswd.c index 3e68632a3f..eebdae4ed9 100644 --- a/src/gpasswd.c +++ b/src/gpasswd.c @@ -28,6 +28,7 @@ #include "exitcodes.h" #include "groupio.h" #include "io/fprintf.h" +#include "memory/memset/memzero.h" #include "nscd.h" #include "prototypes.h" #ifdef SHADOWGRP @@ -36,7 +37,6 @@ #include "shadow/gshadow/sgrp.h" #include "shadowlog.h" #include "sssd.h" -#include "string/memset/memzero.h" #include "string/sprintf/stprintf.h" #include "string/strcmp/streq.h" #include "string/strcpy/strtcpy.h" diff --git a/src/groupadd.c b/src/groupadd.c index 6e1dedfe31..003dcd1dcb 100644 --- a/src/groupadd.c +++ b/src/groupadd.c @@ -26,6 +26,7 @@ #include "groupio.h" #include "io/fprintf.h" #include "io/syslog.h" +#include "memory/memset/memzero.h" #include "nscd.h" #include "sssd.h" #include "prototypes.h" @@ -35,7 +36,6 @@ #endif #include "shadow/gshadow/sgrp.h" #include "shadowlog.h" -#include "string/memset/memzero.h" #include "string/strcmp/streq.h" #include "string/strtok/stpsep.h" diff --git a/src/lastlog.c b/src/lastlog.c index 474bcb5424..6a6843f624 100644 --- a/src/lastlog.c +++ b/src/lastlog.c @@ -29,10 +29,10 @@ #include "exitcodes.h" #include "getdef.h" #include "io/fprintf.h" +#include "memory/memset/memzero.h" #include "prototypes.h" #include "shadowlog.h" #include "sizeof.h" -#include "string/memset/memzero.h" #include "string/strftime.h" #undef NDEBUG diff --git a/src/passwd.c b/src/passwd.c index fb774705a5..be9836a83c 100644 --- a/src/passwd.c +++ b/src/passwd.c @@ -26,6 +26,7 @@ #include "defines.h" #include "getdef.h" #include "io/fprintf.h" +#include "memory/memset/memzero.h" #include "nscd.h" #include "prototypes.h" #include "pwauth.h" diff --git a/src/useradd.c b/src/useradd.c index 25b7f4f3c9..3de05b5d39 100644 --- a/src/useradd.c +++ b/src/useradd.c @@ -44,6 +44,7 @@ #include "io/fgets/fgets.h" #include "io/fprintf.h" #include "io/syslog.h" +#include "memory/memset/memzero.h" #include "nscd.h" #include "prototypes.h" #include "pwauth.h" @@ -65,7 +66,6 @@ #include "shadow/gshadow/sgrp.h" #include "shadowlog.h" #include "sssd.h" -#include "string/memset/memzero.h" #include "string/sprintf/aprintf.h" #include "string/sprintf/stprintf.h" #include "string/strcmp/strcaseeq.h" diff --git a/src/usermod.c b/src/usermod.c index bd9dc82c64..d7951d8c15 100644 --- a/src/usermod.c +++ b/src/usermod.c @@ -40,6 +40,7 @@ #include "groupio.h" #include "io/fprintf.h" #include "io/syslog.h" +#include "memory/memset/memzero.h" #include "nscd.h" #include "prototypes.h" #include "pwauth.h" @@ -61,7 +62,6 @@ #include "shadow/gshadow/sgrp.h" #include "shadowlog.h" #include "sssd.h" -#include "string/memset/memzero.h" #include "string/sprintf/aprintf.h" #include "string/strcmp/streq.h" #include "string/strcmp/strprefix.h" From 0ded15960a1cbefecf2f8b9e5551bcfeed62ea9d Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Wed, 26 Aug 2026 13:38:05 +0200 Subject: [PATCH 07/10] lib/, src/: Move strzero() to under lib/string/strzero/ Signed-off-by: Alejandro Colomar --- lib/Makefile.am | 4 ++-- lib/groupmem.c | 2 +- lib/obscure.c | 2 +- lib/pam_pass_non_interactive.c | 2 +- lib/pwauth.c | 1 - lib/pwmem.c | 2 +- lib/sgroupio.c | 2 +- lib/shadowmem.c | 2 +- lib/string/{memset/memzero.c => strzero/strzero.c} | 2 +- lib/string/{memset/memzero.h => strzero/strzero.h} | 4 ++-- src/login.c | 2 +- src/passwd.c | 2 +- 12 files changed, 13 insertions(+), 14 deletions(-) rename lib/string/{memset/memzero.c => strzero/strzero.c} (83%) rename lib/string/{memset/memzero.h => strzero/strzero.h} (80%) diff --git a/lib/Makefile.am b/lib/Makefile.am index deae3116de..262b0ee39f 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -199,8 +199,6 @@ libshadow_la_SOURCES = \ string/ctype/isascii.h \ string/ctype/toascii.c \ string/ctype/toascii.h \ - string/memset/memzero.c \ - string/memset/memzero.h \ string/sprintf/aprintf.c \ string/sprintf/aprintf.h \ string/sprintf/seprintf.c \ @@ -257,6 +255,8 @@ libshadow_la_SOURCES = \ string/strtok/strsep2arr.h \ string/strtok/strsep2ls.c \ string/strtok/strsep2ls.h \ + string/strzero/strzero.c \ + string/strzero/strzero.h \ strtoday.c \ sub.c \ subordinateio.h \ diff --git a/lib/groupmem.c b/lib/groupmem.c index 1ebe2f9ba0..8bbba32f34 100644 --- a/lib/groupmem.c +++ b/lib/groupmem.c @@ -17,7 +17,7 @@ #include "prototypes.h" #include "defines.h" #include "groupio.h" -#include "string/memset/memzero.h" +#include "string/strzero/strzero.h" /*@null@*/ /*@only@*/struct group *__gr_dup (const struct group *grent) diff --git a/lib/obscure.c b/lib/obscure.c index 93a04af926..858ef2f8bb 100644 --- a/lib/obscure.c +++ b/lib/obscure.c @@ -21,10 +21,10 @@ #include "defines.h" #include "getdef.h" #include "string/ctype/toascii.h" -#include "string/memset/memzero.h" #include "string/sprintf/aprintf.h" #include "string/strcmp/streq.h" #include "string/strdup/strdup.h" +#include "string/strzero/strzero.h" /* diff --git a/lib/pam_pass_non_interactive.c b/lib/pam_pass_non_interactive.c index 6a8dcd78cf..08c1e57f1d 100644 --- a/lib/pam_pass_non_interactive.c +++ b/lib/pam_pass_non_interactive.c @@ -18,7 +18,7 @@ #include "attr.h" #include "prototypes.h" #include "shadowlog.h" -#include "string/memset/memzero.h" +#include "string/strzero/strzero.h" #undef NDEBUG #include diff --git a/lib/pwauth.c b/lib/pwauth.c index d8f61e3ea0..69cfedafae 100644 --- a/lib/pwauth.c +++ b/lib/pwauth.c @@ -24,7 +24,6 @@ #include "prototypes.h" #include "pwauth.h" #include "getdef.h" -#include "string/memset/memzero.h" #include "string/sprintf/stprintf.h" #include "string/strcmp/streq.h" diff --git a/lib/pwmem.c b/lib/pwmem.c index b86be4b3a1..53d4fdbd6b 100644 --- a/lib/pwmem.c +++ b/lib/pwmem.c @@ -18,7 +18,7 @@ #include "defines.h" #include "prototypes.h" #include "pwio.h" -#include "string/memset/memzero.h" +#include "string/strzero/strzero.h" /*@null@*/ /*@only@*/struct passwd *__pw_dup (const struct passwd *pwent) diff --git a/lib/sgroupio.c b/lib/sgroupio.c index ad3adc3463..d8a9515d61 100644 --- a/lib/sgroupio.c +++ b/lib/sgroupio.c @@ -26,7 +26,7 @@ #include "shadow/gshadow/putsgent.h" #include "shadow/gshadow/sgetsgent.h" #include "shadow/gshadow/sgrp.h" -#include "string/memset/memzero.h" +#include "string/strzero/strzero.h" /*@null@*/ /*@only@*/struct sgrp *__sgr_dup (const struct sgrp *sgent) diff --git a/lib/shadowmem.c b/lib/shadowmem.c index 751a511b70..5d477c90a3 100644 --- a/lib/shadowmem.c +++ b/lib/shadowmem.c @@ -19,7 +19,7 @@ #include "alloc/calloc.h" #include "shadowio.h" -#include "string/memset/memzero.h" +#include "string/strzero/strzero.h" /*@null@*/ /*@only@*/struct spwd *__spw_dup (const struct spwd *spent) diff --git a/lib/string/memset/memzero.c b/lib/string/strzero/strzero.c similarity index 83% rename from lib/string/memset/memzero.c rename to lib/string/strzero/strzero.c index a0a404b6c9..8d97032ee2 100644 --- a/lib/string/memset/memzero.c +++ b/lib/string/strzero/strzero.c @@ -4,7 +4,7 @@ #include "config.h" -#include "string/memset/memzero.h" +#include "string/strzero/strzero.h" extern inline char *strzero(char *s); diff --git a/lib/string/memset/memzero.h b/lib/string/strzero/strzero.h similarity index 80% rename from lib/string/memset/memzero.h rename to lib/string/strzero/strzero.h index 06134736ac..fc41e003fe 100644 --- a/lib/string/memset/memzero.h +++ b/lib/string/strzero/strzero.h @@ -3,8 +3,8 @@ // SPDX-License-Identifier: BSD-3-Clause -#ifndef SHADOW_INCLUDE_LIB_STRING_MEMSET_MEMZERO_H_ -#define SHADOW_INCLUDE_LIB_STRING_MEMSET_MEMZERO_H_ +#ifndef SHADOW_INCLUDE_LIB_STRING_STRZERO_STRZERO_H_ +#define SHADOW_INCLUDE_LIB_STRING_STRZERO_STRZERO_H_ #include "config.h" diff --git a/src/login.c b/src/login.c index 951125c6f1..cc7dc35aac 100644 --- a/src/login.c +++ b/src/login.c @@ -40,7 +40,6 @@ #include "pwauth.h" #include "shadow/gshadow/endsgent.h" #include "shadowlog.h" -#include "string/memset/memzero.h" #include "string/sprintf/stprintf.h" #include "string/strcmp/streq.h" #include "string/strcmp/strneq.h" @@ -48,6 +47,7 @@ #include "string/strcpy/strtcpy.h" #include "string/strdup/strdup.h" #include "string/strftime.h" +#include "string/strzero/strzero.h" #include "sysconf.h" #ifdef USE_PAM diff --git a/src/passwd.c b/src/passwd.c index be9836a83c..9c5695b158 100644 --- a/src/passwd.c +++ b/src/passwd.c @@ -34,13 +34,13 @@ #include "shadowio.h" #include "shadowlog.h" #include "sssd.h" -#include "string/memset/memzero.h" #include "string/sprintf/aprintf.h" #include "string/sprintf/stprintf.h" #include "string/strcmp/streq.h" #include "string/strcmp/strprefix.h" #include "string/strcpy/strtcpy.h" #include "string/strdup/strdup.h" +#include "string/strzero/strzero.h" #include "time/day_to_str.h" From 886f51695d592bda073e10b6f529cf7064633fe1 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Wed, 26 Aug 2026 13:54:27 +0200 Subject: [PATCH 08/10] lib/: Move memdup() and strndup() under lib/memory/ Signed-off-by: Alejandro Colomar --- lib/Makefile.am | 8 ++++---- lib/memory/memdup/memdup.c | 7 +++++++ lib/{string/strdup => memory/memdup}/memdup.h | 6 +++--- lib/memory/memdup/strndup.c | 7 +++++++ lib/{string/strdup => memory/memdup}/strndup.h | 8 ++++---- lib/string/strdup/memdup.c | 7 ------- lib/string/strdup/strndup.c | 7 ------- lib/utmp.c | 4 ++-- 8 files changed, 27 insertions(+), 27 deletions(-) create mode 100644 lib/memory/memdup/memdup.c rename lib/{string/strdup => memory/memdup}/memdup.h (81%) create mode 100644 lib/memory/memdup/strndup.c rename lib/{string/strdup => memory/memdup}/strndup.h (66%) delete mode 100644 lib/string/strdup/memdup.c delete mode 100644 lib/string/strdup/strndup.c diff --git a/lib/Makefile.am b/lib/Makefile.am index 262b0ee39f..97c88d8d07 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -115,6 +115,10 @@ libshadow_la_SOURCES = \ lockpw.c \ loginprompt.c \ mail.c \ + memory/memdup/memdup.c \ + memory/memdup/memdup.h \ + memory/memdup/strndup.c \ + memory/memdup/strndup.h \ memory/memset/memzero.c \ memory/memset/memzero.h \ motd.c \ @@ -229,12 +233,8 @@ libshadow_la_SOURCES = \ string/strcpy/strncpy.h \ string/strcpy/strtcpy.c \ string/strcpy/strtcpy.h \ - string/strdup/memdup.c \ - string/strdup/memdup.h \ string/strdup/strdup.c \ string/strdup/strdup.h \ - string/strdup/strndup.c \ - string/strdup/strndup.h \ string/strftime.c \ string/strftime.h \ string/strspn/stpspn.c \ diff --git a/lib/memory/memdup/memdup.c b/lib/memory/memdup/memdup.c new file mode 100644 index 0000000000..86b75aaf28 --- /dev/null +++ b/lib/memory/memdup/memdup.c @@ -0,0 +1,7 @@ +// SPDX-FileCopyrightText: 2025-2026, Alejandro Colomar +// SPDX-License-Identifier: BSD-3-Clause + + +#include "config.h" + +#include "memory/memdup/memdup.h" diff --git a/lib/string/strdup/memdup.h b/lib/memory/memdup/memdup.h similarity index 81% rename from lib/string/strdup/memdup.h rename to lib/memory/memdup/memdup.h index cbae5158f8..90fcbe8a10 100644 --- a/lib/string/strdup/memdup.h +++ b/lib/memory/memdup/memdup.h @@ -1,9 +1,9 @@ -// SPDX-FileCopyrightText: 2025, Alejandro Colomar +// SPDX-FileCopyrightText: 2025-2026, Alejandro Colomar // SPDX-License-Identifier: BSD-3-Clause -#ifndef SHADOW_INCLUDE_LIB_STRING_STRDUP_MEMDUP_H_ -#define SHADOW_INCLUDE_LIB_STRING_STRDUP_MEMDUP_H_ +#ifndef SHADOW_INCLUDE_LIB_MEMORY_MEMDUP_MEMDUP_H_ +#define SHADOW_INCLUDE_LIB_MEMORY_MEMDUP_MEMDUP_H_ #include "config.h" diff --git a/lib/memory/memdup/strndup.c b/lib/memory/memdup/strndup.c new file mode 100644 index 0000000000..40908c22f3 --- /dev/null +++ b/lib/memory/memdup/strndup.c @@ -0,0 +1,7 @@ +// SPDX-FileCopyrightText: 2024-2026, Alejandro Colomar +// SPDX-License-Identifier: BSD-3-Clause + + +#include "config.h" + +#include "memory/memdup/strndup.h" diff --git a/lib/string/strdup/strndup.h b/lib/memory/memdup/strndup.h similarity index 66% rename from lib/string/strdup/strndup.h rename to lib/memory/memdup/strndup.h index 44c0dcfded..e7de47ff34 100644 --- a/lib/string/strdup/strndup.h +++ b/lib/memory/memdup/strndup.h @@ -1,14 +1,14 @@ -// SPDX-FileCopyrightText: 2024-2025, Alejandro Colomar +// SPDX-FileCopyrightText: 2024-2026, Alejandro Colomar // SPDX-License-Identifier: BSD-3-Clause -#ifndef SHADOW_INCLUDE_LIB_STRING_STRDUP_STRNDUP_H_ -#define SHADOW_INCLUDE_LIB_STRING_STRDUP_STRNDUP_H_ +#ifndef SHADOW_INCLUDE_LIB_MEMORY_MEMDUP_STRNDUP_H_ +#define SHADOW_INCLUDE_LIB_MEMORY_MEMDUP_STRNDUP_H_ #include "config.h" -#include +#include #include "sizeof.h" #include "exit_if_null.h" diff --git a/lib/string/strdup/memdup.c b/lib/string/strdup/memdup.c deleted file mode 100644 index c574e3cff9..0000000000 --- a/lib/string/strdup/memdup.c +++ /dev/null @@ -1,7 +0,0 @@ -// SPDX-FileCopyrightText: 2025, Alejandro Colomar -// SPDX-License-Identifier: BSD-3-Clause - - -#include "config.h" - -#include "string/strdup/memdup.h" diff --git a/lib/string/strdup/strndup.c b/lib/string/strdup/strndup.c deleted file mode 100644 index 961f665ba8..0000000000 --- a/lib/string/strdup/strndup.c +++ /dev/null @@ -1,7 +0,0 @@ -// SPDX-FileCopyrightText: 2024, Alejandro Colomar -// SPDX-License-Identifier: BSD-3-Clause - - -#include "config.h" - -#include "string/strdup/strndup.h" diff --git a/lib/utmp.c b/lib/utmp.c index 62002768e6..c523813501 100644 --- a/lib/utmp.c +++ b/lib/utmp.c @@ -30,15 +30,15 @@ #include "alloc/malloc.h" #include "attr.h" #include "io/syslog.h" +#include "memory/memdup/memdup.h" +#include "memory/memdup/strndup.h" #include "sizeof.h" #include "string/strchr/strnul.h" #include "string/strcmp/streq.h" #include "string/strcmp/strneq.h" #include "string/strcmp/strprefix.h" #include "string/strcpy/strncpy.h" -#include "string/strdup/memdup.h" #include "string/strdup/strdup.h" -#include "string/strdup/strndup.h" #undef NDEBUG #include From 5c627cb5a4c1cb040f36bae37ee2e93f4e0712b5 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Wed, 26 Aug 2026 14:09:33 +0200 Subject: [PATCH 09/10] lib/, src/: Move strneq() to under lib/memory/ Signed-off-by: Alejandro Colomar --- lib/Makefile.am | 4 ++-- lib/{string/strcmp => memory/strncmp}/strneq.c | 4 ++-- lib/{string/strcmp => memory/strncmp}/strneq.h | 7 ++++--- lib/user_busy.c | 2 +- lib/utmp.c | 2 +- src/login.c | 2 +- 6 files changed, 11 insertions(+), 10 deletions(-) rename lib/{string/strcmp => memory/strncmp}/strneq.c (62%) rename lib/{string/strcmp => memory/strncmp}/strneq.h (74%) diff --git a/lib/Makefile.am b/lib/Makefile.am index 97c88d8d07..086cd4c6be 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -121,6 +121,8 @@ libshadow_la_SOURCES = \ memory/memdup/strndup.h \ memory/memset/memzero.c \ memory/memset/memzero.h \ + memory/strncmp/strneq.c \ + memory/strncmp/strneq.h \ motd.c \ myname.c \ nss.c \ @@ -221,8 +223,6 @@ libshadow_la_SOURCES = \ string/strcmp/strcaseprefix.h \ string/strcmp/streq.c \ string/strcmp/streq.h \ - string/strcmp/strneq.c \ - string/strcmp/strneq.h \ string/strcmp/strprefix.c \ string/strcmp/strprefix.h \ string/strcpy/stpecpy.c \ diff --git a/lib/string/strcmp/strneq.c b/lib/memory/strncmp/strneq.c similarity index 62% rename from lib/string/strcmp/strneq.c rename to lib/memory/strncmp/strneq.c index 5791811a9b..fb154e1b6b 100644 --- a/lib/string/strcmp/strneq.c +++ b/lib/memory/strncmp/strneq.c @@ -1,10 +1,10 @@ -// SPDX-FileCopyrightText: 2025, Alejandro Colomar +// SPDX-FileCopyrightText: 2025-2026, Alejandro Colomar // SPDX-License-Identifier: BSD-3-Clause #include "config.h" -#include "string/strcmp/strneq.h" +#include "memory/strncmp/strneq.h" #include #include diff --git a/lib/string/strcmp/strneq.h b/lib/memory/strncmp/strneq.h similarity index 74% rename from lib/string/strcmp/strneq.h rename to lib/memory/strncmp/strneq.h index a8783fed8c..812ade3c8c 100644 --- a/lib/string/strcmp/strneq.h +++ b/lib/memory/strncmp/strneq.h @@ -1,13 +1,14 @@ -// SPDX-FileCopyrightText: 2025, Alejandro Colomar +// SPDX-FileCopyrightText: 2025-2026, Alejandro Colomar // SPDX-License-Identifier: BSD-3-Clause -#ifndef SHADOW_INCLUDE_LIB_STRING_STRCMP_STRNEQ_H_ -#define SHADOW_INCLUDE_LIB_STRING_STRCMP_STRNEQ_H_ +#ifndef SHADOW_INCLUDE_LIB_MEMORY_STRNCMP_STRNEQ_H_ +#define SHADOW_INCLUDE_LIB_MEMORY_STRNCMP_STRNEQ_H_ #include "config.h" +#include #include #include diff --git a/lib/user_busy.c b/lib/user_busy.c index 2f21ca0993..c347b157ce 100644 --- a/lib/user_busy.c +++ b/lib/user_busy.c @@ -21,6 +21,7 @@ #include "defines.h" #include "fs/readlink/readlinknul.h" #include "io/fgets/fgets.h" +#include "memory/strncmp/strneq.h" #include "prototypes.h" #ifdef ENABLE_SUBIDS #include "subordinateio.h" @@ -28,7 +29,6 @@ #include "shadowlog.h" #include "string/sprintf/stprintf.h" #include "string/strcmp/streq.h" -#include "string/strcmp/strneq.h" #include "string/strcmp/strprefix.h" #undef NDEBUG diff --git a/lib/utmp.c b/lib/utmp.c index c523813501..fa88e89761 100644 --- a/lib/utmp.c +++ b/lib/utmp.c @@ -32,10 +32,10 @@ #include "io/syslog.h" #include "memory/memdup/memdup.h" #include "memory/memdup/strndup.h" +#include "memory/strncmp/strneq.h" #include "sizeof.h" #include "string/strchr/strnul.h" #include "string/strcmp/streq.h" -#include "string/strcmp/strneq.h" #include "string/strcmp/strprefix.h" #include "string/strcpy/strncpy.h" #include "string/strdup/strdup.h" diff --git a/src/login.c b/src/login.c index cc7dc35aac..f805def0c9 100644 --- a/src/login.c +++ b/src/login.c @@ -36,13 +36,13 @@ #include "failure.h" #include "getdef.h" #include "io/fprintf.h" +#include "memory/strncmp/strneq.h" #include "prototypes.h" #include "pwauth.h" #include "shadow/gshadow/endsgent.h" #include "shadowlog.h" #include "string/sprintf/stprintf.h" #include "string/strcmp/streq.h" -#include "string/strcmp/strneq.h" #include "string/strcmp/strprefix.h" #include "string/strcpy/strtcpy.h" #include "string/strdup/strdup.h" From 459e7d946156cfff4819f09cf667759e5452cde0 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Wed, 26 Aug 2026 14:14:45 +0200 Subject: [PATCH 10/10] lib/: Move strncpy/cat() to under lib/memory/ Signed-off-by: Alejandro Colomar --- lib/Makefile.am | 8 ++++---- lib/log.c | 2 +- lib/memory/memcpy/strncat.c | 7 +++++++ lib/{string/strcpy => memory/memcpy}/strncat.h | 8 ++++---- lib/memory/memcpy/strncpy.c | 7 +++++++ lib/{string/strcpy => memory/memcpy}/strncpy.h | 8 ++++---- lib/string/strcpy/strncat.c | 7 ------- lib/string/strcpy/strncpy.c | 7 ------- lib/utmp.c | 2 +- 9 files changed, 28 insertions(+), 28 deletions(-) create mode 100644 lib/memory/memcpy/strncat.c rename lib/{string/strcpy => memory/memcpy}/strncat.h (53%) create mode 100644 lib/memory/memcpy/strncpy.c rename lib/{string/strcpy => memory/memcpy}/strncpy.h (51%) delete mode 100644 lib/string/strcpy/strncat.c delete mode 100644 lib/string/strcpy/strncpy.c diff --git a/lib/Makefile.am b/lib/Makefile.am index 086cd4c6be..7b53b8c9a1 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -115,6 +115,10 @@ libshadow_la_SOURCES = \ lockpw.c \ loginprompt.c \ mail.c \ + memory/memcpy/strncat.c \ + memory/memcpy/strncat.h \ + memory/memcpy/strncpy.c \ + memory/memcpy/strncpy.h \ memory/memdup/memdup.c \ memory/memdup/memdup.h \ memory/memdup/strndup.c \ @@ -227,10 +231,6 @@ libshadow_la_SOURCES = \ string/strcmp/strprefix.h \ string/strcpy/stpecpy.c \ string/strcpy/stpecpy.h \ - string/strcpy/strncat.c \ - string/strcpy/strncat.h \ - string/strcpy/strncpy.c \ - string/strcpy/strncpy.h \ string/strcpy/strtcpy.c \ string/strcpy/strtcpy.h \ string/strdup/strdup.c \ diff --git a/lib/log.c b/lib/log.c index c00139da3f..463710f6ec 100644 --- a/lib/log.c +++ b/lib/log.c @@ -19,9 +19,9 @@ #include "attr.h" #include "defines.h" #include "io/syslog.h" +#include "memory/memcpy/strncpy.h" #include "memory/memset/memzero.h" #include "prototypes.h" -#include "string/strcpy/strncpy.h" #include "string/strcpy/strtcpy.h" diff --git a/lib/memory/memcpy/strncat.c b/lib/memory/memcpy/strncat.c new file mode 100644 index 0000000000..925f2efc52 --- /dev/null +++ b/lib/memory/memcpy/strncat.c @@ -0,0 +1,7 @@ +// SPDX-FileCopyrightText: 2024-2026, Alejandro Colomar +// SPDX-License-Identifier: BSD-3-Clause + + +#include "config.h" + +#include "memory/memcpy/strncat.h" diff --git a/lib/string/strcpy/strncat.h b/lib/memory/memcpy/strncat.h similarity index 53% rename from lib/string/strcpy/strncat.h rename to lib/memory/memcpy/strncat.h index 754b6450c7..0ffd5b0af7 100644 --- a/lib/string/strcpy/strncat.h +++ b/lib/memory/memcpy/strncat.h @@ -1,14 +1,14 @@ -// SPDX-FileCopyrightText: 2024, Alejandro Colomar +// SPDX-FileCopyrightText: 2024-2026, Alejandro Colomar // SPDX-License-Identifier: BSD-3-Clause -#ifndef SHADOW_INCLUDE_LIB_STRING_STRCPY_STRNCAT_H_ -#define SHADOW_INCLUDE_LIB_STRING_STRCPY_STRNCAT_H_ +#ifndef SHADOW_INCLUDE_LIB_MEMORY_MEMCPY_STRNCAT_H_ +#define SHADOW_INCLUDE_LIB_MEMORY_MEMCPY_STRNCAT_H_ #include "config.h" -#include +#include #include "sizeof.h" diff --git a/lib/memory/memcpy/strncpy.c b/lib/memory/memcpy/strncpy.c new file mode 100644 index 0000000000..df85a02846 --- /dev/null +++ b/lib/memory/memcpy/strncpy.c @@ -0,0 +1,7 @@ +// SPDX-FileCopyrightText: 2024-2026, Alejandro Colomar +// SPDX-License-Identifier: BSD-3-Clause + + +#include "config.h" + +#include "memory/memcpy/strncpy.h" diff --git a/lib/string/strcpy/strncpy.h b/lib/memory/memcpy/strncpy.h similarity index 51% rename from lib/string/strcpy/strncpy.h rename to lib/memory/memcpy/strncpy.h index 518e9674d2..2474e917cc 100644 --- a/lib/string/strcpy/strncpy.h +++ b/lib/memory/memcpy/strncpy.h @@ -1,14 +1,14 @@ -// SPDX-FileCopyrightText: 2024, Alejandro Colomar +// SPDX-FileCopyrightText: 2024-2026, Alejandro Colomar // SPDX-License-Identifier: BSD-3-Clause -#ifndef SHADOW_INCLUDE_LIB_STRING_STRCPY_STRNCPY_H_ -#define SHADOW_INCLUDE_LIB_STRING_STRCPY_STRNCPY_H_ +#ifndef SHADOW_INCLUDE_LIB_MEMORY_MEMCPY_STRNCPY_H_ +#define SHADOW_INCLUDE_LIB_MEMORY_MEMCPY_STRNCPY_H_ #include "config.h" -#include +#include #include "sizeof.h" diff --git a/lib/string/strcpy/strncat.c b/lib/string/strcpy/strncat.c deleted file mode 100644 index acfdd676b1..0000000000 --- a/lib/string/strcpy/strncat.c +++ /dev/null @@ -1,7 +0,0 @@ -// SPDX-FileCopyrightText: 2024, Alejandro Colomar -// SPDX-License-Identifier: BSD-3-Clause - - -#include "config.h" - -#include "string/strcpy/strncat.h" diff --git a/lib/string/strcpy/strncpy.c b/lib/string/strcpy/strncpy.c deleted file mode 100644 index 492efdf7ca..0000000000 --- a/lib/string/strcpy/strncpy.c +++ /dev/null @@ -1,7 +0,0 @@ -// SPDX-FileCopyrightText: 2024, Alejandro Colomar -// SPDX-License-Identifier: BSD-3-Clause - - -#include "config.h" - -#include "string/strcpy/strncpy.h" diff --git a/lib/utmp.c b/lib/utmp.c index fa88e89761..8209994a7b 100644 --- a/lib/utmp.c +++ b/lib/utmp.c @@ -30,6 +30,7 @@ #include "alloc/malloc.h" #include "attr.h" #include "io/syslog.h" +#include "memory/memcpy/strncpy.h" #include "memory/memdup/memdup.h" #include "memory/memdup/strndup.h" #include "memory/strncmp/strneq.h" @@ -37,7 +38,6 @@ #include "string/strchr/strnul.h" #include "string/strcmp/streq.h" #include "string/strcmp/strprefix.h" -#include "string/strcpy/strncpy.h" #include "string/strdup/strdup.h" #undef NDEBUG