We'll expand the contents in a following commit, so let's move the file
to a more generic name, have a dedicated header, and update includes.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Use the new header for xstrdup()
Signed-off-by: Alejandro Colomar <alx@kernel.org>
--- /dev/null
+#ifndef SHADOW_INCLUDE_LIB_MALLOC_H_
+#define SHADOW_INCLUDE_LIB_MALLOC_H_
+
+
+#include <stddef.h>
+
+/* xmalloc.c */
+extern /*@maynotreturn@*/ /*@only@*//*@out@*//*@notnull@*/void *xmalloc (size_t size)
+ /*@ensures MaxSet(result) == (size - 1); @*/;
+extern /*@maynotreturn@*/ /*@only@*//*@notnull@*/char *xstrdup (const char *);
+
+
+#endif // include guard
/* valid.c */
extern bool valid (const char *, const struct passwd *);
-/* xmalloc.c */
-extern /*@maynotreturn@*/ /*@only@*//*@out@*//*@notnull@*/void *xmalloc (size_t size)
- /*@ensures MaxSet(result) == (size - 1); @*/;
-extern /*@maynotreturn@*/ /*@only@*//*@notnull@*/char *xstrdup (const char *);
-
/* xgetpwnam.c */
extern /*@null@*/ /*@only@*/struct passwd *xgetpwnam (const char *);
/* xgetpwuid.c */
addgrps.c \
age.c \
agetpass.c \
+ alloc.c \
audit_help.c \
basename.c \
bit.c \
xgetgrnam.c \
xgetgrgid.c \
xgetspnam.c \
- xmalloc.c \
yesno.c
if WITH_BTRFS
#include <sys/time.h>
#include <fcntl.h>
#include <stdio.h>
+
+#include "alloc.h"
#include "prototypes.h"
#include "defines.h"
#ifdef WITH_SELINUX
#include <sys/types.h>
#include <stdio.h>
+
+#include "alloc.h"
#include "prototypes.h"
#include "defines.h"
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+
+#include "alloc.h"
#include "prototypes.h"
#include "defines.h"
#include "shadowlog.h"
#ident "$Id$"
#include <stdio.h>
-#include "prototypes.h"
+
+#include "alloc.h"
#include "defines.h"
#include "getdef.h"
+#include "prototypes.h"
/*
* motd -- output the /etc/motd file
*
#endif /* USE_PAM */
#endif /* ACCT_TOOLS_SETUID */
#include <pwd.h>
+
+#include "alloc.h"
#include "prototypes.h"
#include "defines.h"
#include "pwio.h"
#include <stdio.h>
#include <sys/types.h>
#include <getopt.h>
+
+#include "alloc.h"
#include "defines.h"
#include "getdef.h"
#include "nscd.h"
#include <pwd.h>
#include <stdio.h>
#include <sys/types.h>
+
+#include "alloc.h"
#include "defines.h"
#include "getdef.h"
#include "nscd.h"