]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/, src/, tests/: Move x*() definitions to non-x* header files
authorAlejandro Colomar <alx@kernel.org>
Wed, 1 Jan 2025 23:12:51 +0000 (00:12 +0100)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Mon, 27 Oct 2025 13:32:06 +0000 (14:32 +0100)
Now that all of these are one-liners, they don't need a separate header
file.  Compact stuff.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
50 files changed:
lib/Makefile.am
lib/alloc/calloc.h
lib/alloc/malloc.h
lib/alloc/realloc.h
lib/alloc/x/xcalloc.h [deleted file]
lib/alloc/x/xmalloc.c [deleted file]
lib/alloc/x/xmalloc.h [deleted file]
lib/alloc/x/xrealloc.c [deleted file]
lib/alloc/x/xrealloc.h [deleted file]
lib/copydir.c
lib/env.c
lib/getdef.c
lib/idmapping.c
lib/list.c
lib/mail.c
lib/obscure.c
lib/prefix_flag.c
lib/setupenv.c
lib/shadow/gshadow/sgetsgent.c
lib/string/sprintf/aprintf.h
lib/string/sprintf/xaprintf.c [deleted file]
lib/string/sprintf/xaprintf.h [deleted file]
lib/string/strdup/strdup.c [moved from lib/alloc/x/xcalloc.c with 80% similarity]
lib/string/strdup/strdup.h [moved from lib/string/strdup/xstrdup.h with 83% similarity]
lib/string/strdup/strndup.c [moved from lib/string/strdup/xstrndup.c with 78% similarity]
lib/string/strdup/strndup.h [moved from lib/string/strdup/xstrndup.h with 80% similarity]
lib/string/strdup/xstrdup.c [deleted file]
lib/string/strtok/astrsep2ls.h
lib/string/strtok/xastrsep2ls.c [deleted file]
lib/string/strtok/xastrsep2ls.h [deleted file]
lib/utmp.c
lib/xgetXXbyYY.c
src/chage.c
src/chfn.c
src/chsh.c
src/gpasswd.c
src/groupmems.c
src/groupmod.c
src/login.c
src/newgrp.c
src/newusers.c
src/passwd.c
src/su.c
src/sulogin.c
src/useradd.c
src/userdel.c
src/usermod.c
src/vipw.c
tests/unit/Makefile.am
tests/unit/test_xaprintf.c

index 45d9b1ec2d9d002438f0919f07006bc54d760b4c..b6420e3dcd93c07329764d3eac49298cbfca0c0d 100644 (file)
@@ -37,12 +37,6 @@ libshadow_la_SOURCES = \
        alloc/realloc.h \
        alloc/reallocf.c \
        alloc/reallocf.h \
-       alloc/x/xcalloc.c \
-       alloc/x/xcalloc.h \
-       alloc/x/xmalloc.c \
-       alloc/x/xmalloc.h \
-       alloc/x/xrealloc.c \
-       alloc/x/xrealloc.h \
        atoi/a2i/a2i.c \
        atoi/a2i/a2i.h \
        atoi/a2i/a2s.c \
@@ -223,8 +217,6 @@ libshadow_la_SOURCES = \
        string/sprintf/snprintf.h \
        string/sprintf/stpeprintf.c \
        string/sprintf/stpeprintf.h \
-       string/sprintf/xaprintf.c \
-       string/sprintf/xaprintf.h \
        string/strchr/strchrcnt.c \
        string/strchr/strchrcnt.h \
        string/strchr/strchrscnt.c \
@@ -249,12 +241,12 @@ libshadow_la_SOURCES = \
        string/strcpy/strncpy.h \
        string/strcpy/strtcpy.c \
        string/strcpy/strtcpy.h \
+       string/strdup/strdup.c \
+       string/strdup/strdup.h \
        string/strdup/strndupa.c \
        string/strdup/strndupa.h \
-       string/strdup/xstrdup.c \
-       string/strdup/xstrdup.h \
-       string/strdup/xstrndup.c \
-       string/strdup/xstrndup.h \
+       string/strdup/strndup.c \
+       string/strdup/strndup.h \
        string/strftime.c \
        string/strftime.h \
        string/strspn/stpspn.c \
@@ -275,8 +267,6 @@ libshadow_la_SOURCES = \
        string/strtok/strsep2arr.h \
        string/strtok/strsep2ls.c \
        string/strtok/strsep2ls.h \
-       string/strtok/xastrsep2ls.c \
-       string/strtok/xastrsep2ls.h \
        strtoday.c \
        sub.c \
        subordinateio.h \
index 01517204d6c30fedb44e2ffcf972204c5763942d..c6db93dc26b7eec74893509047aedb0748fb61f5 100644 (file)
@@ -1,4 +1,4 @@
-// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
+// SPDX-FileCopyrightText: 2023-2025, Alejandro Colomar <alx@kernel.org>
 // SPDX-License-Identifier: BSD-3-Clause
 
 
@@ -10,6 +10,8 @@
 
 #include <stdlib.h>
 
+#include "exit_if_null.h"
+
 
 #define CALLOC(n, type)                                                       \
 (                                                                             \
@@ -17,4 +19,7 @@
 )
 
 
+#define XCALLOC(n, type)  exit_if_null(CALLOC(n, type))
+
+
 #endif  // include guard
index 16f0b8cd6f3c712bd1bcfa56228050b0b7c05867..1c0c2366afe6df370dea71f1f9d506ba01ffc341 100644 (file)
@@ -1,4 +1,4 @@
-// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
+// SPDX-FileCopyrightText: 2023-2025, Alejandro Colomar <alx@kernel.org>
 // SPDX-License-Identifier: BSD-3-Clause
 
 
@@ -11,6 +11,7 @@
 #include <stdlib.h>
 
 #include "attr.h"
+#include "exit_if_null.h"
 
 
 #define MALLOC(n, type)                                                       \
@@ -19,6 +20,9 @@
 )
 
 
+#define XMALLOC(n, type)  exit_if_null(MALLOC(n, type))
+
+
 ATTR_ALLOC_SIZE(1, 2)
 ATTR_MALLOC(free)
 inline void *mallocarray(size_t nmemb, size_t size);
index 3e3d547e3f1f051b5544c82a95eaf293b6363098..10b68e0fe10173d53ab16e2cda47ae219587d9a2 100644 (file)
@@ -1,4 +1,4 @@
-// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
+// SPDX-FileCopyrightText: 2023-2025, Alejandro Colomar <alx@kernel.org>
 // SPDX-License-Identifier: BSD-3-Clause
 
 
@@ -10,6 +10,8 @@
 
 #include <stdlib.h>
 
+#include "exit_if_null.h"
+
 
 #define REALLOC(p, n, type)                                                   \
 (                                                                             \
@@ -17,4 +19,7 @@
 )
 
 
+#define XREALLOC(p, n, type)  exit_if_null(REALLOC(p, n, type))
+
+
 #endif  // include guard
diff --git a/lib/alloc/x/xcalloc.h b/lib/alloc/x/xcalloc.h
deleted file mode 100644 (file)
index 849d072..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// SPDX-FileCopyrightText: 2023-2025, Alejandro Colomar <alx@kernel.org>
-// SPDX-License-Identifier: BSD-3-Clause
-
-
-#ifndef SHADOW_INCLUDE_LIB_ALLOC_X_XCALLOC_H_
-#define SHADOW_INCLUDE_LIB_ALLOC_X_XCALLOC_H_
-
-
-#include "config.h"
-
-#include "alloc/calloc.h"
-#include "exit_if_null.h"
-
-
-#define XCALLOC(n, type)  exit_if_null(CALLOC(n, type))
-
-
-#endif  // include guard
diff --git a/lib/alloc/x/xmalloc.c b/lib/alloc/x/xmalloc.c
deleted file mode 100644 (file)
index ab03820..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
-// SPDX-License-Identifier: BSD-3-Clause
-
-
-#include "config.h"
-
-#include "alloc/x/xmalloc.h"
diff --git a/lib/alloc/x/xmalloc.h b/lib/alloc/x/xmalloc.h
deleted file mode 100644 (file)
index 5a1c13b..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// SPDX-FileCopyrightText: 2023-2025, Alejandro Colomar <alx@kernel.org>
-// SPDX-License-Identifier: BSD-3-Clause
-
-
-#ifndef SHADOW_INCLUDE_LIB_ALLOC_X_XMALLOC_H_
-#define SHADOW_INCLUDE_LIB_ALLOC_X_XMALLOC_H_
-
-
-#include "config.h"
-
-#include "alloc/malloc.h"
-#include "exit_if_null.h"
-
-
-#define XMALLOC(n, type)  exit_if_null(MALLOC(n, type))
-
-
-#endif  // include guard
diff --git a/lib/alloc/x/xrealloc.c b/lib/alloc/x/xrealloc.c
deleted file mode 100644 (file)
index d04ed24..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
-// SPDX-License-Identifier: BSD-3-Clause
-
-
-#include "config.h"
-
-#include "alloc/x/xrealloc.h"
diff --git a/lib/alloc/x/xrealloc.h b/lib/alloc/x/xrealloc.h
deleted file mode 100644 (file)
index c395a73..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// SPDX-FileCopyrightText: 2023-2025, Alejandro Colomar <alx@kernel.org>
-// SPDX-License-Identifier: BSD-3-Clause
-
-
-#ifndef SHADOW_INCLUDE_LIB_ALLOC_X_XREALLOC_H_
-#define SHADOW_INCLUDE_LIB_ALLOC_X_XREALLOC_H_
-
-
-#include "config.h"
-
-#include "alloc/realloc.h"
-#include "exit_if_null.h"
-
-
-#define XREALLOC(p, n, type)  exit_if_null(REALLOC(p, n, type))
-
-
-#endif  // include guard
index 736e230464d86971c7dffd9020c4bf63f9565451..018d3be75700077897c9e05c482e3c120f640137 100644 (file)
@@ -19,7 +19,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "alloc/x/xmalloc.h"
+#include "alloc/malloc.h"
 #include "attr.h"
 #include "fs/readlink/areadlink.h"
 #include "prototypes.h"
@@ -39,7 +39,6 @@
 #endif                         /* WITH_ATTR */
 #include "shadowlog.h"
 #include "string/sprintf/aprintf.h"
-#include "string/sprintf/xaprintf.h"
 #include "string/strcmp/streq.h"
 #include "string/strcmp/strprefix.h"
 
index 3cc5b61eec12b1adf4d41cb4ba5ef58fe006a828..91424087d995ce587d441cc8308cdf1404d7522f 100644 (file)
--- a/lib/env.c
+++ b/lib/env.c
 #include <stdlib.h>
 #include <string.h>
 
-#include "alloc/x/xmalloc.h"
-#include "alloc/x/xrealloc.h"
+#include "alloc/malloc.h"
+#include "alloc/realloc.h"
 #include "prototypes.h"
 #include "defines.h"
 #include "shadowlog.h"
+#include "string/sprintf/aprintf.h"
 #include "string/sprintf/snprintf.h"
-#include "string/sprintf/xaprintf.h"
+#include "string/sprintf/aprintf.h"
 #include "string/strcmp/strprefix.h"
-#include "string/strdup/xstrdup.h"
+#include "string/strdup/strdup.h"
 
 
 /*
index 5aad2b6addc5ad7f4269aca463149d72de236427..940b1c7b06194133a4a85fbf8255f5b162fe1326 100644 (file)
@@ -30,7 +30,7 @@
 #include "prototypes.h"
 #include "shadowlog_internal.h"
 #include "sizeof.h"
-#include "string/sprintf/xaprintf.h"
+#include "string/sprintf/aprintf.h"
 #include "string/strcmp/strcaseeq.h"
 #include "string/strcmp/streq.h"
 #include "string/strcmp/strprefix.h"
index e55de97fbfc586797d918dc72cbb36ead4bbbafc..6f32c45e947a91e19abb00c739c6330effaf80ad 100644 (file)
@@ -20,7 +20,7 @@
 #endif
 
 #include "alloc/calloc.h"
-#include "alloc/x/xmalloc.h"
+#include "alloc/malloc.h"
 #include "atoi/a2i/a2u.h"
 #include "idmapping.h"
 #include "prototypes.h"
index be8c2ef7799f1332d728e1e66e0b602c78ac053a..097d22a68dd67fd62f5af375aebcca4e7c5b88cc 100644 (file)
 
 #include <assert.h>
 
-#include "alloc/x/xmalloc.h"
+#include "alloc/malloc.h"
 #include "prototypes.h"
 #include "defines.h"
 #include "string/strchr/strchrcnt.h"
 #include "string/strcmp/streq.h"
-#include "string/strdup/xstrdup.h"
+#include "string/strdup/strdup.h"
 #include "string/strtok/strsep2ls.h"
 
 
index 519f385e6c03f71acc3dde3e02cd12c80962866d..aa670a83ef00e6fc2ff74f73c67e8db0c6107636 100644 (file)
@@ -16,7 +16,7 @@
 #include <string.h>
 
 #include "getdef.h"
-#include "string/sprintf/xaprintf.h"
+#include "string/sprintf/aprintf.h"
 
 #ident "$Id$"
 
index 0b5d574d63a3ef9a1fd87315875cb0f97e8c6047..adefa72ef2c2f2023789595a75445775e0168537 100644 (file)
@@ -21,9 +21,9 @@
 #include "getdef.h"
 #include "string/ctype/strtoascii/strtolower.h"
 #include "string/memset/memzero.h"
-#include "string/sprintf/xaprintf.h"
+#include "string/sprintf/aprintf.h"
 #include "string/strcmp/streq.h"
-#include "string/strdup/xstrdup.h"
+#include "string/strdup/strdup.h"
 
 
 #if WITH_LIBBSD == 0
index dd5972cc72d991b90b078d68d28ff184f1a19563..d452d4c3114873976c1b3c2055c1993abbe33bdc 100644 (file)
@@ -31,7 +31,7 @@
 #include "getdef.h"
 #include "shadow/gshadow/gshadow.h"
 #include "shadowlog.h"
-#include "string/sprintf/xaprintf.h"
+#include "string/sprintf/aprintf.h"
 #include "string/strcmp/streq.h"
 #include "string/strcmp/strprefix.h"
 
index f5bf2cfadbb2656c6331f72acb68209faa9b0606..1b9a417b1a92e955f46c8367a8da967aa282c528 100644 (file)
 #include <pwd.h>
 #include "getdef.h"
 #include "shadowlog.h"
-#include "string/sprintf/xaprintf.h"
+#include "string/sprintf/aprintf.h"
 #include "string/strcmp/streq.h"
 #include "string/strcmp/strprefix.h"
-#include "string/strdup/xstrdup.h"
+#include "string/strdup/strdup.h"
 #include "string/strspn/stpspn.h"
 #include "string/strtok/stpsep.h"
 
index c15bb58314d6a2cc6067ab27467e2f20d0855f27..38dce1c0ca50a1e1a4804acca64c1afc20c68e55 100644 (file)
@@ -16,9 +16,9 @@
 
 #include "shadow/gshadow/sgrp.h"
 #include "string/strcmp/streq.h"
+#include "string/strtok/astrsep2ls.h"
 #include "string/strtok/stpsep.h"
 #include "string/strtok/strsep2arr.h"
-#include "string/strtok/xastrsep2ls.h"
 
 
 #if defined(SHADOWGRP) && !__has_include(<gshadow.h>)
index a90742652cc35b17e707d8e33fb387363558ce7d..eaf64e941f830357e03b09c35d527e7fc8d367dc 100644 (file)
 #include <stdlib.h>
 
 #include "attr.h"
+#include "exit_if_null.h"
+
+
+// exit-on-error allocate print formatted
+#define xaprintf(...)  exit_if_null(aprintf(__VA_ARGS__))
 
 
 ATTR_MALLOC(free)
diff --git a/lib/string/sprintf/xaprintf.c b/lib/string/sprintf/xaprintf.c
deleted file mode 100644 (file)
index 87617e7..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-// SPDX-FileCopyrightText: 2023-2025, Alejandro Colomar <alx@kernel.org>
-// SPDX-License-Identifier: BSD-3-Clause
-
-
-#include "config.h"
-
-#include "string/sprintf/xaprintf.h"
diff --git a/lib/string/sprintf/xaprintf.h b/lib/string/sprintf/xaprintf.h
deleted file mode 100644 (file)
index 6b23385..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// SPDX-FileCopyrightText: 2023-2025, Alejandro Colomar <alx@kernel.org>
-// SPDX-License-Identifier: BSD-3-Clause
-
-
-#ifndef SHADOW_INCLUDE_LIB_STRING_SPRINTF_XASPRINTF_H_
-#define SHADOW_INCLUDE_LIB_STRING_SPRINTF_XASPRINTF_H_
-
-
-#include "config.h"
-
-#include "string/sprintf/aprintf.h"
-#include "exit_if_null.h"
-
-
-// exit-on-error allocate print formatted
-#define xaprintf(...)  exit_if_null(aprintf(__VA_ARGS__))
-
-
-#endif  // include guard
similarity index 80%
rename from lib/alloc/x/xcalloc.c
rename to lib/string/strdup/strdup.c
index 107f054908b769cbc7fdfab45b72582ab7f22e7c..f7169ae0b195ebf9398cd4ee24b9efde4e0e3a29 100644 (file)
@@ -4,4 +4,4 @@
 
 #include "config.h"
 
-#include "alloc/x/xcalloc.h"
+#include "string/strdup/strdup.h"
similarity index 83%
rename from lib/string/strdup/xstrdup.h
rename to lib/string/strdup/strdup.h
index 9ba3f8359f5ba9b72ec959449ebdac5d7f0bda36..8d13fc9edbf46310c50456a68a3ef89effa52e0b 100644 (file)
@@ -6,8 +6,8 @@
 // SPDX-License-Identifier: BSD-3-Clause
 
 
-#ifndef SHADOW_INCLUDE_LIB_STRING_STRDUP_XSTRDUP_H_
-#define SHADOW_INCLUDE_LIB_STRING_STRDUP_XSTRDUP_H_
+#ifndef SHADOW_INCLUDE_LIB_STRING_STRDUP_STRDUP_H_
+#define SHADOW_INCLUDE_LIB_STRING_STRDUP_STRDUP_H_
 
 
 #include "config.h"
similarity index 78%
rename from lib/string/strdup/xstrndup.c
rename to lib/string/strdup/strndup.c
index 075c1c82f0a555e7aa25130f540304044374da46..961f665ba8eb48c3800d90f585083e140c729c83 100644 (file)
@@ -4,4 +4,4 @@
 
 #include "config.h"
 
-#include "string/strdup/xstrndup.h"
+#include "string/strdup/strndup.h"
similarity index 80%
rename from lib/string/strdup/xstrndup.h
rename to lib/string/strdup/strndup.h
index 082ad3ff947f009d369b2128efb995be5790c37e..5971220a11e36ac22f1c764e171b850b318067d9 100644 (file)
@@ -2,8 +2,8 @@
 // SPDX-License-Identifier: BSD-3-Clause
 
 
-#ifndef SHADOW_INCLUDE_LIB_STRING_STRDUP_XSTRNDUP_H_
-#define SHADOW_INCLUDE_LIB_STRING_STRDUP_XSTRNDUP_H_
+#ifndef SHADOW_INCLUDE_LIB_STRING_STRDUP_STRNDUP_H_
+#define SHADOW_INCLUDE_LIB_STRING_STRDUP_STRNDUP_H_
 
 
 #include "config.h"
diff --git a/lib/string/strdup/xstrdup.c b/lib/string/strdup/xstrdup.c
deleted file mode 100644 (file)
index 3b83e18..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
-// SPDX-License-Identifier: BSD-3-Clause
-
-
-#include "config.h"
-
-#include "string/strdup/xstrdup.h"
index ccacecab011c9ac6bda4f8f7aaa841a1d2a69814..1a58e1c590bda556350534d24af3a51efb58607c 100644 (file)
@@ -1,4 +1,4 @@
-// SPDX-FileCopyrightText: 2024, Alejandro Colomar <alx@kernel.org>
+// SPDX-FileCopyrightText: 2024-2025, Alejandro Colomar <alx@kernel.org>
 // SPDX-License-Identifier: BSD-3-Clause
 
 
 
 #include "alloc/malloc.h"
 #include "attr.h"
+#include "exit_if_null.h"
 #include "string/strchr/strchrscnt.h"
 #include "string/strtok/strsep2ls.h"
 
 
+// xastrsep2ls - exit-on-error allocate string separate to list-of-strings
+#define xastrsep2ls(s, delim, np)  exit_if_null(astrsep2ls(s, delim, np))
+
+
 ATTR_ACCESS(read_write, 1) ATTR_ACCESS(write_only, 3)
 ATTR_STRING(1) ATTR_STRING(2)
 inline char **astrsep2ls(char *restrict s, const char *restrict delim,
     size_t *restrict np);
 
 
-// allocate string separate to list-of-strings
-// Like strsep2ls(), but allocate the list array.
+// astrsep2ls - allocate string separate to list-of-strings
 inline char **
 astrsep2ls(char *s, const char *restrict delim, size_t *restrict np)
 {
diff --git a/lib/string/strtok/xastrsep2ls.c b/lib/string/strtok/xastrsep2ls.c
deleted file mode 100644 (file)
index c3d43b9..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-// SPDX-FileCopyrightText: 2024-2025, Alejandro Colomar <alx@kernel.org>
-// SPDX-License-Identifier: BSD-3-Clause
-
-
-#include "config.h"
-
-#include "string/strtok/xastrsep2ls.h"
diff --git a/lib/string/strtok/xastrsep2ls.h b/lib/string/strtok/xastrsep2ls.h
deleted file mode 100644 (file)
index d9710db..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// SPDX-FileCopyrightText: 2024-2025, Alejandro Colomar <alx@kernel.org>
-// SPDX-License-Identifier: BSD-3-Clause
-
-
-#ifndef SHADOW_INCLUDE_LIB_STRING_STRTOK_XASTRSEP2LS_H_
-#define SHADOW_INCLUDE_LIB_STRING_STRTOK_XASTRSEP2LS_H_
-
-
-#include "config.h"
-
-#include "exit_if_null.h"
-#include "string/strtok/astrsep2ls.h"
-
-
-#define xastrsep2ls(s, delim, np)  exit_if_null(astrsep2ls(s, delim, np))
-
-
-#endif  // include guard
index 9c7466352d0e6244ad33254f6cf103cdd81a70b1..675d3c8ebf7eefacac0585bcf644d9513cfd790a 100644 (file)
@@ -26,8 +26,8 @@
 #include <string.h>
 #include <fcntl.h>
 
-#include "alloc/x/xcalloc.h"
-#include "alloc/x/xmalloc.h"
+#include "alloc/calloc.h"
+#include "alloc/malloc.h"
 #include "attr.h"
 #include "sizeof.h"
 #include "string/strchr/strnul.h"
@@ -36,8 +36,8 @@
 #include "string/strcmp/strprefix.h"
 #include "string/strcpy/strncpy.h"
 #include "string/strcpy/strtcpy.h"
-#include "string/strdup/xstrdup.h"
-#include "string/strdup/xstrndup.h"
+#include "string/strdup/strdup.h"
+#include "string/strdup/strndup.h"
 
 #ident "$Id$"
 
index 01976fe72631288ec1efad05f738d69569407903..1a4ca94bbc7a0d5c25cdbbecc38a42d44d276006 100644 (file)
@@ -32,7 +32,7 @@
 #include <errno.h>
 
 #include "alloc/malloc.h"
-#include "alloc/x/xrealloc.h"
+#include "alloc/realloc.h"
 #include "prototypes.h"
 #include "shadowlog.h"
 
index bf5d5ef8c7dc842bd751ebd65ba9e88b6571891e..693bad86ce6073c2054ac4bff5198817bc3789e4 100644 (file)
@@ -32,7 +32,7 @@
 #include "string/sprintf/snprintf.h"
 #include "string/strcmp/streq.h"
 #include "string/strcpy/strtcpy.h"
-#include "string/strdup/xstrdup.h"
+#include "string/strdup/strdup.h"
 #include "string/strftime.h"
 #include "time/day_to_str.h"
 /*@-exitarg@*/
index 53190bdb66f65dcb2c07e3bf0827ddadc00764a8..582b51e075ce3ee403dfb895887c1105437e2d87 100644 (file)
@@ -38,7 +38,7 @@
 #include "string/sprintf/stpeprintf.h"
 #include "string/strcmp/streq.h"
 #include "string/strcpy/strtcpy.h"
-#include "string/strdup/xstrdup.h"
+#include "string/strdup/strdup.h"
 
 struct option_flags {
        bool chroot;
index 0f03deed5313a50ab1e02aa322efa7cc210d49c7..e87a466d7acfe7c6ec2b4e7aae8af5d0fa83fe2c 100644 (file)
@@ -34,7 +34,7 @@
 #include "sssd.h"
 #include "string/strcmp/streq.h"
 #include "string/strcpy/strtcpy.h"
-#include "string/strdup/xstrdup.h"
+#include "string/strdup/strdup.h"
 
 
 #ifndef SHELLS_FILE
index 5b32fb7d68f1a91a270b7ac81475a475c6509ae2..4baa9a3aae03fd8e241a19e8a1ba4c194bff3b7e 100644 (file)
@@ -21,7 +21,7 @@
 #include <sys/types.h>
 
 #include "agetpass.h"
-#include "alloc/x/xmalloc.h"
+#include "alloc/malloc.h"
 #include "attr.h"
 #include "defines.h"
 /*@-exitarg@*/
@@ -39,7 +39,7 @@
 #include "string/sprintf/snprintf.h"
 #include "string/strcmp/streq.h"
 #include "string/strcpy/strtcpy.h"
-#include "string/strdup/xstrdup.h"
+#include "string/strdup/strdup.h"
 
 struct option_flags {
        bool chroot;
index 3890e023c89cea07b18ae06d16094712f00fbdc9..d8c2643ce60ad3fd42490c941949277b1bb3eb3f 100644 (file)
@@ -19,7 +19,7 @@
 #endif                         /* USE_PAM */
 #include <pwd.h>
 
-#include "alloc/x/xmalloc.h"
+#include "alloc/malloc.h"
 #include "defines.h"
 #include "groupio.h"
 #include "prototypes.h"
@@ -29,7 +29,7 @@
 #include "shadow/gshadow/sgrp.h"
 #include "shadowlog.h"
 #include "string/strcmp/streq.h"
-#include "string/strdup/xstrdup.h"
+#include "string/strdup/strdup.h"
 
 
 /* Exit Status Values */
index 7cdc88d9d48601c484882bda8e56fbccfa6d0216..0fb21ccf5e854d0bde73d48c6d965c7797698912 100644 (file)
@@ -27,7 +27,7 @@
 #endif                         /* USE_PAM */
 #endif                         /* ACCT_TOOLS_SETUID */
 
-#include "alloc/x/xmalloc.h"
+#include "alloc/malloc.h"
 #include "atoi/getnum.h"
 #include "chkname.h"
 #include "defines.h"
@@ -44,7 +44,7 @@
 #include "string/sprintf/stpeprintf.h"
 #include "string/strcmp/streq.h"
 #include "string/strcpy/stpecpy.h"
-#include "string/strdup/xstrdup.h"
+#include "string/strdup/strdup.h"
 
 
 /*
index f52dbeec715891493c776b7b90f3ea0f0879c0f0..8b531534635223f183b8b94922b4b2bd48276b78 100644 (file)
@@ -26,7 +26,7 @@
 #include <sys/ioctl.h>
 #include <assert.h>
 
-#include "alloc/x/xmalloc.h"
+#include "alloc/malloc.h"
 #include "attr.h"
 #include "chkname.h"
 #include "defines.h"
@@ -45,7 +45,7 @@
 #include "string/strcmp/strneq.h"
 #include "string/strcmp/strprefix.h"
 #include "string/strcpy/strtcpy.h"
-#include "string/strdup/xstrdup.h"
+#include "string/strdup/strdup.h"
 #include "string/strftime.h"
 
 
index 51b1dcc060d3afb1d300071b434aae5ab6407f1c..123f1b285057a3f6a8e8b8e7125fd2f3325659f9 100644 (file)
@@ -17,7 +17,8 @@
 #include <sys/types.h>
 
 #include "agetpass.h"
-#include "alloc/x/xmalloc.h"
+#include "alloc/malloc.h"
+#include "alloc/realloc.h"
 #include "chkname.h"
 #include "defines.h"
 /*@-exitarg@*/
@@ -34,7 +35,7 @@
 #include "string/sprintf/snprintf.h"
 #include "string/strcmp/streq.h"
 #include "string/strcmp/strprefix.h"
-#include "string/strdup/xstrdup.h"
+#include "string/strdup/strdup.h"
 
 #include <assert.h>
 
index d60c92f74316aabda5005c04e634c448cf9f7880..a7ab4a981e7eca6af280281c7c1442eb0e38269d 100644 (file)
@@ -57,7 +57,7 @@
 #include "sssd.h"
 #include "string/sprintf/snprintf.h"
 #include "string/strcmp/streq.h"
-#include "string/strdup/xstrdup.h"
+#include "string/strdup/strdup.h"
 #include "string/strtok/stpsep.h"
 #include "string/strtok/strsep2arr.h"
 
index d00a4022ebd0417efad35ddc3dbec8ae3b8e0526..a29f9640b2f8e5b9332fca35f81cdf0f6c12f029 100644 (file)
 #include "shadowlog.h"
 #include "sssd.h"
 #include "string/memset/memzero.h"
-#include "string/sprintf/xaprintf.h"
+#include "string/sprintf/aprintf.h"
 #include "string/strcmp/streq.h"
 #include "string/strcmp/strprefix.h"
 #include "string/strcpy/strtcpy.h"
-#include "string/strdup/xstrdup.h"
+#include "string/strdup/strdup.h"
 #include "time/day_to_str.h"
 
 
index ed4086b64e8a23d0e666962bd4b1cf14cc1e0ece..98ced92a01c9b875eca527099d98ff598baf7454 100644 (file)
--- a/src/su.c
+++ b/src/su.c
@@ -46,7 +46,7 @@
 #include <fcntl.h>
 #endif                         /* !USE_PAM */
 
-#include "alloc/x/xmalloc.h"
+#include "alloc/malloc.h"
 #include "attr.h"
 #include "cast.h"
 #include "defines.h"
 #include "pwauth.h"
 #include "prototypes.h"
 #include "shadowlog.h"
+#include "string/sprintf/aprintf.h"
 #include "string/sprintf/snprintf.h"
-#include "string/sprintf/xaprintf.h"
 #include "string/strcmp/streq.h"
 #include "string/strcmp/strprefix.h"
 #include "string/strcpy/strtcpy.h"
-#include "string/strdup/xstrdup.h"
+#include "string/strdup/strdup.h"
 
 
 /*
index b5a8c06782cf0b64024b837f0e7b01349fe4ef39..74d2ff37674e932cfe7eb6dd000e80bbc1752195 100644 (file)
@@ -29,7 +29,7 @@
 #include "shadowlog.h"
 #include "string/strcmp/streq.h"
 #include "string/strcmp/strprefix.h"
-#include "string/strdup/xstrdup.h"
+#include "string/strdup/strdup.h"
 
 
 /*
index 28338cf518b52d9f7e342686ff7e9df8d82b57ba..a4dd3638aabfb40b8d019e39fbdde11caa9d5d7d 100644 (file)
@@ -37,7 +37,7 @@
 #include <time.h>
 #include <unistd.h>
 
-#include "alloc/x/xmalloc.h"
+#include "alloc/malloc.h"
 #include "atoi/a2i/a2s.h"
 #include "atoi/getnum.h"
 #include "chkname.h"
 #include "string/memset/memzero.h"
 #include "string/sprintf/aprintf.h"
 #include "string/sprintf/snprintf.h"
-#include "string/sprintf/xaprintf.h"
 #include "string/strcmp/strcaseeq.h"
 #include "string/strcmp/streq.h"
 #include "string/strcmp/strprefix.h"
-#include "string/strdup/xstrdup.h"
+#include "string/strdup/strdup.h"
 #include "string/strtok/stpsep.h"
 
 
index 3754d1ffdb987704f6e0ea49c69e96f2906f03f7..ae8cb61a369b641b10226b8981afd7c19a6a8af8 100644 (file)
 #include "shadow/gshadow/sgrp.h"
 #include "shadowlog.h"
 #include "string/sprintf/aprintf.h"
-#include "string/sprintf/xaprintf.h"
 #include "string/strcmp/streq.h"
 #include "string/strcmp/strprefix.h"
-#include "string/strdup/xstrdup.h"
+#include "string/strdup/strdup.h"
 
 
 /*
index d0d68ca9a4d4b8a20950b54df9e47d656a02d7d2..414ff7b56d0317ce463c04be1b83d6d4615189e8 100644 (file)
@@ -34,7 +34,6 @@
 #include <time.h>
 
 #include "alloc/malloc.h"
-#include "alloc/x/xmalloc.h"
 #include "atoi/a2i/a2i.h"
 #include "atoi/a2i/a2s.h"
 #include "atoi/getnum.h"
 #include "shadowlog.h"
 #include "sssd.h"
 #include "string/memset/memzero.h"
-#include "string/sprintf/xaprintf.h"
+#include "string/sprintf/aprintf.h"
 #include "string/strcmp/streq.h"
 #include "string/strcmp/strprefix.h"
-#include "string/strdup/xstrdup.h"
+#include "string/strdup/strdup.h"
 #include "time/day_to_str.h"
 #include "typetraits.h"
 
index a888fddfdf6a81943ff814f27338af582fefc3a8..29fa55a87f8af1001e25fa24012b815645adec4c 100644 (file)
@@ -45,7 +45,6 @@
 #include "sssd.h"
 #include "string/sprintf/aprintf.h"
 #include "string/sprintf/snprintf.h"
-#include "string/sprintf/xaprintf.h"
 #include "string/strcmp/streq.h"
 
 
index 8de0a0e0b0464a8d8a28c576a4077a17d2ba96d3..e10c0ca38c7b242ebb50d0ac670fa82390a03a98 100644 (file)
@@ -133,7 +133,6 @@ test_xaprintf_SOURCES = \
     ../../lib/exit_if_null.c \
     ../../lib/shadowlog.c \
     ../../lib/string/sprintf/aprintf.c \
-    ../../lib/string/sprintf/xaprintf.c \
     ../../lib/string/strcmp/streq.c \
     test_xaprintf.c \
     $(NULL)
index d66fa67f872f78e5f9a7d23d3a0aebf6c3ba8e34..995a29e00e389fcbb22dfb519883f54540014cf2 100644 (file)
@@ -2,7 +2,7 @@
 // SPDX-License-Identifier: BSD-3-Clause
 
 
-#include "string/sprintf/xaprintf.h"
+#include "string/sprintf/aprintf.h"
 
 #include <setjmp.h>
 #include <stdarg.h>