lib/alloc/, lib/, src/, tests/: Organize the allocation APIs in a new subdirectory
Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
committed by
Serge Hallyn
parent
883bf71fc8
commit
3049bef9c3
+14
-2
@@ -29,8 +29,20 @@ libshadow_la_SOURCES = \
|
||||
age.c \
|
||||
agetpass.c \
|
||||
agetpass.h \
|
||||
alloc.c \
|
||||
alloc.h \
|
||||
alloc/calloc.c \
|
||||
alloc/calloc.h \
|
||||
alloc/malloc.c \
|
||||
alloc/malloc.h \
|
||||
alloc/realloc.c \
|
||||
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.c \
|
||||
atoi/a2i.h \
|
||||
atoi/getnum.c \
|
||||
|
||||
+2
-1
@@ -18,7 +18,8 @@
|
||||
#include <grp.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/malloc.h"
|
||||
#include "alloc/reallocf.h"
|
||||
#include "shadowlog.h"
|
||||
|
||||
#ident "$Id$"
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
|
||||
#ident "$Id$"
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/malloc.h"
|
||||
|
||||
#if WITH_LIBBSD == 0
|
||||
#include "freezero.h"
|
||||
|
||||
-66
@@ -1,66 +0,0 @@
|
||||
// SPDX-FileCopyrightText: 1990-1994, Julianne Frances Haugh
|
||||
// SPDX-FileCopyrightText: 1996-1998, Marek Michałkiewicz
|
||||
// SPDX-FileCopyrightText: 2003-2006, Tomasz Kłoczko
|
||||
// SPDX-FileCopyrightText: 2008 , Nicolas François
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
/* Replacements for malloc and strdup with error checking. Too trivial
|
||||
to be worth copyrighting :-). I did that because a lot of code used
|
||||
malloc and strdup without checking for NULL pointer, and I like some
|
||||
message better than a core dump... --marekm
|
||||
|
||||
Yeh, but. Remember that bailing out might leave the system in some
|
||||
bizarre state. You really want to put in error checking, then add
|
||||
some back-out failure recovery code. -- jfh */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "alloc.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "defines.h"
|
||||
#include "prototypes.h"
|
||||
#include "shadowlog.h"
|
||||
|
||||
|
||||
extern inline void *xmallocarray(size_t nmemb, size_t size);
|
||||
extern inline void *mallocarray(size_t nmemb, size_t size);
|
||||
extern inline void *reallocarrayf(void *p, size_t nmemb, size_t size);
|
||||
|
||||
|
||||
void *
|
||||
xcalloc(size_t nmemb, size_t size)
|
||||
{
|
||||
void *p;
|
||||
|
||||
p = calloc(nmemb, size);
|
||||
if (p == NULL)
|
||||
goto x;
|
||||
|
||||
return p;
|
||||
|
||||
x:
|
||||
fprintf(log_get_logfd(), _("%s: %s\n"),
|
||||
log_get_progname(), strerror(errno));
|
||||
exit(13);
|
||||
}
|
||||
|
||||
|
||||
void *
|
||||
xreallocarray(void *p, size_t nmemb, size_t size)
|
||||
{
|
||||
p = reallocarrayf(p, nmemb, size);
|
||||
if (p == NULL)
|
||||
goto x;
|
||||
|
||||
return p;
|
||||
|
||||
x:
|
||||
fprintf(log_get_logfd(), _("%s: %s\n"),
|
||||
log_get_progname(), strerror(errno));
|
||||
exit(13);
|
||||
}
|
||||
-82
@@ -1,82 +0,0 @@
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#ifndef SHADOW_INCLUDE_LIB_MALLOC_H_
|
||||
#define SHADOW_INCLUDE_LIB_MALLOC_H_
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "attr.h"
|
||||
|
||||
|
||||
#define CALLOC(n, type) ((type *) calloc(n, sizeof(type)))
|
||||
#define XCALLOC(n, type) ((type *) xcalloc(n, sizeof(type)))
|
||||
#define MALLOC(n, type) ((type *) mallocarray(n, sizeof(type)))
|
||||
#define XMALLOC(n, type) ((type *) xmallocarray(n, sizeof(type)))
|
||||
|
||||
#define REALLOC(ptr, n, type) \
|
||||
( \
|
||||
_Generic(ptr, type *: (type *) reallocarray(ptr, n, sizeof(type))) \
|
||||
)
|
||||
|
||||
#define REALLOCF(ptr, n, type) \
|
||||
( \
|
||||
_Generic(ptr, type *: (type *) reallocarrayf(ptr, n, sizeof(type))) \
|
||||
)
|
||||
|
||||
#define XREALLOC(ptr, n, type) \
|
||||
( \
|
||||
_Generic(ptr, type *: (type *) xreallocarray(ptr, n, sizeof(type))) \
|
||||
)
|
||||
|
||||
|
||||
ATTR_MALLOC(free)
|
||||
inline void *xmallocarray(size_t nmemb, size_t size);
|
||||
ATTR_MALLOC(free)
|
||||
inline void *mallocarray(size_t nmemb, size_t size);
|
||||
ATTR_MALLOC(free)
|
||||
inline void *reallocarrayf(void *p, size_t nmemb, size_t size);
|
||||
|
||||
ATTR_MALLOC(free)
|
||||
void *xcalloc(size_t nmemb, size_t size);
|
||||
ATTR_MALLOC(free)
|
||||
void *xreallocarray(void *p, size_t nmemb, size_t size);
|
||||
|
||||
|
||||
inline void *
|
||||
xmallocarray(size_t nmemb, size_t size)
|
||||
{
|
||||
return xreallocarray(NULL, nmemb, size);
|
||||
}
|
||||
|
||||
|
||||
inline void *
|
||||
mallocarray(size_t nmemb, size_t size)
|
||||
{
|
||||
return reallocarray(NULL, nmemb, size);
|
||||
}
|
||||
|
||||
|
||||
inline void *
|
||||
reallocarrayf(void *p, size_t nmemb, size_t size)
|
||||
{
|
||||
void *q;
|
||||
|
||||
q = reallocarray(p, nmemb, size);
|
||||
|
||||
/* realloc(p, 0) is equivalent to free(p); avoid double free. */
|
||||
if (q == NULL && nmemb != 0 && size != 0)
|
||||
free(p);
|
||||
return q;
|
||||
}
|
||||
|
||||
|
||||
#endif // include guard
|
||||
@@ -0,0 +1,11 @@
|
||||
// SPDX-FileCopyrightText: 1990-1994, Julianne Frances Haugh
|
||||
// SPDX-FileCopyrightText: 1996-1998, Marek Michałkiewicz
|
||||
// SPDX-FileCopyrightText: 2003-2006, Tomasz Kłoczko
|
||||
// SPDX-FileCopyrightText: 2008 , Nicolas François
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "alloc/calloc.h"
|
||||
@@ -0,0 +1,17 @@
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#ifndef SHADOW_INCLUDE_LIB_ALLOC_CALLOC_H_
|
||||
#define SHADOW_INCLUDE_LIB_ALLOC_CALLOC_H_
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
#define CALLOC(n, type) ((type *) calloc(n, sizeof(type)))
|
||||
|
||||
|
||||
#endif // include guard
|
||||
@@ -0,0 +1,16 @@
|
||||
// SPDX-FileCopyrightText: 1990-1994, Julianne Frances Haugh
|
||||
// SPDX-FileCopyrightText: 1996-1998, Marek Michałkiewicz
|
||||
// SPDX-FileCopyrightText: 2003-2006, Tomasz Kłoczko
|
||||
// SPDX-FileCopyrightText: 2008 , Nicolas François
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "alloc/malloc.h"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
extern inline void *mallocarray(size_t nmemb, size_t size);
|
||||
@@ -0,0 +1,30 @@
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#ifndef SHADOW_INCLUDE_LIB_ALLOC_MALLOC_H_
|
||||
#define SHADOW_INCLUDE_LIB_ALLOC_MALLOC_H_
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "attr.h"
|
||||
|
||||
|
||||
#define MALLOC(n, type) ((type *) mallocarray(n, sizeof(type)))
|
||||
|
||||
|
||||
ATTR_MALLOC(free)
|
||||
inline void *mallocarray(size_t nmemb, size_t size);
|
||||
|
||||
|
||||
inline void *
|
||||
mallocarray(size_t nmemb, size_t size)
|
||||
{
|
||||
return reallocarray(NULL, nmemb, size);
|
||||
}
|
||||
|
||||
|
||||
#endif // include guard
|
||||
@@ -0,0 +1,11 @@
|
||||
// SPDX-FileCopyrightText: 1990-1994, Julianne Frances Haugh
|
||||
// SPDX-FileCopyrightText: 1996-1998, Marek Michałkiewicz
|
||||
// SPDX-FileCopyrightText: 2003-2006, Tomasz Kłoczko
|
||||
// SPDX-FileCopyrightText: 2008 , Nicolas François
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "alloc/realloc.h"
|
||||
@@ -0,0 +1,20 @@
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#ifndef SHADOW_INCLUDE_LIB_ALLOC_REALLOC_H_
|
||||
#define SHADOW_INCLUDE_LIB_ALLOC_REALLOC_H_
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
#define REALLOC(ptr, n, type) \
|
||||
( \
|
||||
_Generic(ptr, type *: (type *) reallocarray(ptr, n, sizeof(type))) \
|
||||
)
|
||||
|
||||
|
||||
#endif // include guard
|
||||
@@ -0,0 +1,16 @@
|
||||
// SPDX-FileCopyrightText: 1990-1994, Julianne Frances Haugh
|
||||
// SPDX-FileCopyrightText: 1996-1998, Marek Michałkiewicz
|
||||
// SPDX-FileCopyrightText: 2003-2006, Tomasz Kłoczko
|
||||
// SPDX-FileCopyrightText: 2008 , Nicolas François
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "alloc/reallocf.h"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
extern inline void *reallocarrayf(void *p, size_t nmemb, size_t size);
|
||||
@@ -0,0 +1,41 @@
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#ifndef SHADOW_INCLUDE_LIB_ALLOC_REALLOCF_H_
|
||||
#define SHADOW_INCLUDE_LIB_ALLOC_REALLOCF_H_
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "attr.h"
|
||||
|
||||
|
||||
#define REALLOCF(ptr, n, type) \
|
||||
( \
|
||||
_Generic(ptr, type *: (type *) reallocarrayf(ptr, n, sizeof(type))) \
|
||||
)
|
||||
|
||||
|
||||
ATTR_MALLOC(free)
|
||||
inline void *reallocarrayf(void *p, size_t nmemb, size_t size);
|
||||
|
||||
|
||||
inline void *
|
||||
reallocarrayf(void *p, size_t nmemb, size_t size)
|
||||
{
|
||||
void *q;
|
||||
|
||||
q = reallocarray(p, nmemb, size);
|
||||
|
||||
/* realloc(p, 0) is equivalent to free(p); avoid double free. */
|
||||
if (q == NULL && nmemb != 0 && size != 0)
|
||||
free(p);
|
||||
return q;
|
||||
}
|
||||
|
||||
|
||||
#endif // include guard
|
||||
@@ -0,0 +1,36 @@
|
||||
// SPDX-FileCopyrightText: 1990-1994, Julianne Frances Haugh
|
||||
// SPDX-FileCopyrightText: 1996-1998, Marek Michałkiewicz
|
||||
// SPDX-FileCopyrightText: 2003-2006, Tomasz Kłoczko
|
||||
// SPDX-FileCopyrightText: 2008 , Nicolas François
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "alloc/x/xcalloc.h"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "defines.h"
|
||||
#include "shadowlog.h"
|
||||
|
||||
|
||||
void *
|
||||
xcalloc(size_t nmemb, size_t size)
|
||||
{
|
||||
void *p;
|
||||
|
||||
p = calloc(nmemb, size);
|
||||
if (p == NULL)
|
||||
goto x;
|
||||
|
||||
return p;
|
||||
|
||||
x:
|
||||
fprintf(log_get_logfd(), _("%s: %s\n"),
|
||||
log_get_progname(), strerror(errno));
|
||||
exit(13);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// SPDX-FileCopyrightText: 2023-2024, 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 <stddef.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "attr.h"
|
||||
|
||||
|
||||
#define XCALLOC(n, type) ((type *) xcalloc(n, sizeof(type)))
|
||||
|
||||
|
||||
ATTR_MALLOC(free)
|
||||
void *xcalloc(size_t nmemb, size_t size);
|
||||
|
||||
|
||||
#endif // include guard
|
||||
@@ -0,0 +1,16 @@
|
||||
// SPDX-FileCopyrightText: 1990-1994, Julianne Frances Haugh
|
||||
// SPDX-FileCopyrightText: 1996-1998, Marek Michałkiewicz
|
||||
// SPDX-FileCopyrightText: 2003-2006, Tomasz Kłoczko
|
||||
// SPDX-FileCopyrightText: 2008 , Nicolas François
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "alloc/x/xmalloc.h"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
extern inline void *xmallocarray(size_t nmemb, size_t size);
|
||||
@@ -0,0 +1,31 @@
|
||||
// SPDX-FileCopyrightText: 2023-2024, 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 <stddef.h>
|
||||
|
||||
#include "alloc/x/xrealloc.h"
|
||||
#include "attr.h"
|
||||
|
||||
|
||||
#define XMALLOC(n, type) ((type *) xmallocarray(n, sizeof(type)))
|
||||
|
||||
|
||||
ATTR_MALLOC(free)
|
||||
inline void *xmallocarray(size_t nmemb, size_t size);
|
||||
|
||||
|
||||
inline void *
|
||||
xmallocarray(size_t nmemb, size_t size)
|
||||
{
|
||||
return xreallocarray(NULL, nmemb, size);
|
||||
}
|
||||
|
||||
|
||||
#endif // include guard
|
||||
@@ -0,0 +1,35 @@
|
||||
// SPDX-FileCopyrightText: 1990-1994, Julianne Frances Haugh
|
||||
// SPDX-FileCopyrightText: 1996-1998, Marek Michałkiewicz
|
||||
// SPDX-FileCopyrightText: 2003-2006, Tomasz Kłoczko
|
||||
// SPDX-FileCopyrightText: 2008 , Nicolas François
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "alloc/x/xrealloc.h"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "alloc/reallocf.h"
|
||||
#include "defines.h"
|
||||
#include "shadowlog.h"
|
||||
|
||||
|
||||
void *
|
||||
xreallocarray(void *p, size_t nmemb, size_t size)
|
||||
{
|
||||
p = reallocarrayf(p, nmemb, size);
|
||||
if (p == NULL)
|
||||
goto x;
|
||||
|
||||
return p;
|
||||
|
||||
x:
|
||||
fprintf(log_get_logfd(), _("%s: %s\n"),
|
||||
log_get_progname(), strerror(errno));
|
||||
exit(13);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
#ifndef SHADOW_INCLUDE_LIB_MALLOC_H_
|
||||
#define SHADOW_INCLUDE_LIB_MALLOC_H_
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "attr.h"
|
||||
|
||||
|
||||
#define XREALLOC(ptr, n, type) \
|
||||
( \
|
||||
_Generic(ptr, type *: (type *) xreallocarray(ptr, n, sizeof(type))) \
|
||||
)
|
||||
|
||||
|
||||
ATTR_MALLOC(free)
|
||||
void *xreallocarray(void *p, size_t nmemb, size_t size);
|
||||
|
||||
|
||||
#endif // include guard
|
||||
+2
-1
@@ -22,7 +22,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <utime.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/malloc.h"
|
||||
#include "alloc/reallocf.h"
|
||||
#include "atoi/getnum.h"
|
||||
#include "commonio.h"
|
||||
#include "defines.h"
|
||||
|
||||
+2
-1
@@ -18,7 +18,8 @@
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/malloc.h"
|
||||
#include "alloc/x/xmalloc.h"
|
||||
#include "attr.h"
|
||||
#include "prototypes.h"
|
||||
#include "defines.h"
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/x/xmalloc.h"
|
||||
#include "alloc/x/xrealloc.h"
|
||||
#include "prototypes.h"
|
||||
#include "defines.h"
|
||||
#include "shadowlog.h"
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/calloc.h"
|
||||
#include "prototypes.h"
|
||||
#include "groupio.h"
|
||||
#include "getdef.h"
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/calloc.h"
|
||||
#include "prototypes.h"
|
||||
#include "pwio.h"
|
||||
#include "getdef.h"
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include <libeconf.h>
|
||||
#endif
|
||||
|
||||
#include "alloc.h"
|
||||
#include "atoi/str2i.h"
|
||||
#include "defines.h"
|
||||
#include "getdef.h"
|
||||
|
||||
+2
-1
@@ -15,7 +15,8 @@
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/calloc.h"
|
||||
#include "alloc/malloc.h"
|
||||
#include "prototypes.h"
|
||||
#include "defines.h"
|
||||
#include "commonio.h"
|
||||
|
||||
+2
-1
@@ -12,7 +12,8 @@
|
||||
|
||||
#ident "$Id$"
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/calloc.h"
|
||||
#include "alloc/malloc.h"
|
||||
#include "memzero.h"
|
||||
#include "prototypes.h"
|
||||
#include "defines.h"
|
||||
|
||||
+2
-1
@@ -17,7 +17,8 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/malloc.h"
|
||||
#include "alloc/realloc.h"
|
||||
#include "prototypes.h"
|
||||
#include "defines.h"
|
||||
|
||||
|
||||
+2
-1
@@ -13,7 +13,8 @@
|
||||
#include <stdio.h>
|
||||
#include <strings.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/calloc.h"
|
||||
#include "alloc/x/xmalloc.h"
|
||||
#include "atoi/str2i.h"
|
||||
#include "prototypes.h"
|
||||
#include "string/sprintf/stpeprintf.h"
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/x/xmalloc.h"
|
||||
#include "prototypes.h"
|
||||
#include "defines.h"
|
||||
#include "string/strdup/xstrdup.h"
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "attr.h"
|
||||
#include "memzero.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "getdef.h"
|
||||
#include "string/sprintf/xasprintf.h"
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <ctype.h>
|
||||
#include <stdatomic.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/malloc.h"
|
||||
#include "prototypes.h"
|
||||
#include "../libsubid/subid.h"
|
||||
#include "shadowlog_internal.h"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#include <security/pam_appl.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/calloc.h"
|
||||
#include "attr.h"
|
||||
#include "memzero.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
|
||||
#include "atoi/getnum.h"
|
||||
#include "defines.h"
|
||||
#include "alloc.h"
|
||||
#include "prototypes.h"
|
||||
/*@-exitarg@*/
|
||||
#include "exitcodes.h"
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/calloc.h"
|
||||
#include "defines.h"
|
||||
#include "memzero.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include <unistd.h>
|
||||
#include <lib/prototypes.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "run_part.h"
|
||||
#include "shadowlog_internal.h"
|
||||
|
||||
|
||||
+2
-1
@@ -16,7 +16,8 @@
|
||||
#include <grp.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/malloc.h"
|
||||
#include "alloc/reallocf.h"
|
||||
#include "atoi/getnum.h"
|
||||
#include "defines.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
+2
-1
@@ -14,7 +14,8 @@
|
||||
|
||||
#ident "$Id$"
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/calloc.h"
|
||||
#include "alloc/malloc.h"
|
||||
#include "prototypes.h"
|
||||
#include "defines.h"
|
||||
#include "commonio.h"
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
#include <shadow.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/calloc.h"
|
||||
#include "memzero.h"
|
||||
#include "shadowio.h"
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
#include <sys/wait.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/malloc.h"
|
||||
#include "exitcodes.h"
|
||||
#include "defines.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/x/xmalloc.h"
|
||||
#include "attr.h"
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/x/xmalloc.h"
|
||||
#include "sizeof.h"
|
||||
#include "string/strcpy/strncat.h"
|
||||
|
||||
|
||||
+3
-1
@@ -18,7 +18,9 @@
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/malloc.h"
|
||||
#include "alloc/realloc.h"
|
||||
#include "alloc/reallocf.h"
|
||||
#include "atoi/str2i.h"
|
||||
#include "string/sprintf/snprintf.h"
|
||||
|
||||
|
||||
+2
-1
@@ -22,7 +22,8 @@
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/x/xcalloc.h"
|
||||
#include "alloc/x/xmalloc.h"
|
||||
#include "sizeof.h"
|
||||
#include "string/strcpy/strncpy.h"
|
||||
#include "string/strcpy/strtcpy.h"
|
||||
|
||||
+2
-1
@@ -31,7 +31,8 @@
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/malloc.h"
|
||||
#include "alloc/x/xrealloc.h"
|
||||
#include "prototypes.h"
|
||||
#include "shadowlog.h"
|
||||
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "agetpass.h"
|
||||
#include "alloc.h"
|
||||
#include "alloc/x/xmalloc.h"
|
||||
#include "attr.h"
|
||||
#include "defines.h"
|
||||
#include "groupio.h"
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
#endif /* USE_PAM */
|
||||
#include <pwd.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/x/xmalloc.h"
|
||||
#include "defines.h"
|
||||
#include "prototypes.h"
|
||||
#include "groupio.h"
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@
|
||||
#endif /* USE_PAM */
|
||||
#endif /* ACCT_TOOLS_SETUID */
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/x/xmalloc.h"
|
||||
#include "atoi/getnum.h"
|
||||
#include "chkname.h"
|
||||
#include "defines.h"
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
#include <pwd.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/x/xmalloc.h"
|
||||
#include "defines.h"
|
||||
#include "prototypes.h"
|
||||
#include "shadowlog.h"
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/malloc.h"
|
||||
#include "defines.h"
|
||||
|
||||
/* local function prototypes */
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@
|
||||
#include <sys/ioctl.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/x/xmalloc.h"
|
||||
#include "attr.h"
|
||||
#include "chkname.h"
|
||||
#include "defines.h"
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@
|
||||
#include <assert.h>
|
||||
|
||||
#include "agetpass.h"
|
||||
#include "alloc.h"
|
||||
#include "alloc/x/xmalloc.h"
|
||||
#include "defines.h"
|
||||
#include "getdef.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/reallocf.h"
|
||||
#include "atoi/getnum.h"
|
||||
#include "atoi/str2i.h"
|
||||
#ifdef ACCT_TOOLS_SETUID
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#include <fcntl.h>
|
||||
#endif /* !USE_PAM */
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/x/xmalloc.h"
|
||||
#include "attr.h"
|
||||
#include "cast.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/x/xmalloc.h"
|
||||
#include "atoi/str2i.h"
|
||||
#include "atoi/getnum.h"
|
||||
#include "chkname.h"
|
||||
|
||||
+2
-1
@@ -32,7 +32,8 @@
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/malloc.h"
|
||||
#include "alloc/x/xmalloc.h"
|
||||
#include "atoi/a2i.h"
|
||||
#include "atoi/getnum.h"
|
||||
#include "atoi/str2i.h"
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include <unistd.h>
|
||||
#include <utime.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "defines.h"
|
||||
#include "getdef.h"
|
||||
#include "groupio.h"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <stdbool.h>
|
||||
#include <subid.h>
|
||||
#include <string.h>
|
||||
#include "alloc.h"
|
||||
#include "alloc/malloc.h"
|
||||
|
||||
enum subid_status shadow_subid_has_any_range(const char *owner, enum subid_type t, bool *result)
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <stdint.h> // Required by <cmocka.h>
|
||||
#include <cmocka.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "alloc/malloc.h"
|
||||
#include "chkname.h"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user