lib/attr.h, lib/, src/: Move attributes to new header file
Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
committed by
Serge Hallyn
parent
5abe0811b8
commit
44b8f7b3ef
@@ -28,6 +28,7 @@ libshadow_la_SOURCES = \
|
||||
agetpass.h \
|
||||
alloc.c \
|
||||
alloc.h \
|
||||
attr.h \
|
||||
audit_help.c \
|
||||
basename.c \
|
||||
bit.c \
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "attr.h"
|
||||
#include "defines.h"
|
||||
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "attr.h"
|
||||
#include "defines.h"
|
||||
|
||||
|
||||
|
||||
25
lib/attr.h
Normal file
25
lib/attr.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef SHADOW_INCLUDE_LIB_ATTR_H_
|
||||
#define SHADOW_INCLUDE_LIB_ATTR_H_
|
||||
|
||||
|
||||
#include "config.h"
|
||||
|
||||
|
||||
#if defined(__GNUC__)
|
||||
# define unused __attribute__((unused))
|
||||
# define NORETURN __attribute__((__noreturn__))
|
||||
# define format_attr(type, fmt, va) __attribute__((format(type, fmt, va)))
|
||||
#else
|
||||
# define unused
|
||||
# define NORETURN
|
||||
# define format_attr(type, fmt, va)
|
||||
#endif
|
||||
|
||||
#if (__GNUC__ >= 11) && !defined(__clang__)
|
||||
# define ATTR_MALLOC(deallocator) [[gnu::malloc(deallocator)]]
|
||||
#else
|
||||
# define ATTR_MALLOC(deallocator)
|
||||
#endif
|
||||
|
||||
|
||||
#endif // include guard
|
||||
@@ -21,6 +21,8 @@
|
||||
#include <libaudit.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "attr.h"
|
||||
#include "prototypes.h"
|
||||
#include "shadowlog.h"
|
||||
int audit_fd;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "attr.h"
|
||||
#include "defines.h"
|
||||
#include "groupio.h"
|
||||
#include "sgroupio.h"
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "attr.h"
|
||||
#include "defines.h"
|
||||
#include "pwio.h"
|
||||
#include "shadowio.h"
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "attr.h"
|
||||
#include "prototypes.h"
|
||||
#include "defines.h"
|
||||
#ifdef WITH_SELINUX
|
||||
|
||||
@@ -203,26 +203,9 @@
|
||||
#include <libaudit.h>
|
||||
#endif
|
||||
|
||||
/* To be used for verified unused parameters */
|
||||
#if defined(__GNUC__)
|
||||
# define unused __attribute__((unused))
|
||||
# define NORETURN __attribute__((__noreturn__))
|
||||
# define format_attr(type, index, check) __attribute__((format (type, index, check)))
|
||||
#else
|
||||
# define unused
|
||||
# define NORETURN
|
||||
# define format_attr(type, index, check)
|
||||
#endif
|
||||
|
||||
/* Maximum length of passwd entry */
|
||||
#define PASSWD_ENTRY_MAX_LENGTH 32768
|
||||
|
||||
#if (__GNUC__ >= 11) && !defined(__clang__)
|
||||
# define ATTR_MALLOC(deallocator) [[gnu::malloc(deallocator)]]
|
||||
#else
|
||||
# define ATTR_MALLOC(deallocator)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SECURE_GETENV
|
||||
# define shadow_getenv(name) secure_getenv(name)
|
||||
# else
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <ctype.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "attr.h"
|
||||
#include "getdate.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#ident "$Id$"
|
||||
|
||||
#include "attr.h"
|
||||
#include "defines.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <signal.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "attr.h"
|
||||
#include "memzero.h"
|
||||
#include "prototypes.h"
|
||||
#include "defines.h"
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "attr.h"
|
||||
#include "memzero.h"
|
||||
#include "prototypes.h"
|
||||
#include "defines.h"
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <security/pam_appl.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "attr.h"
|
||||
#include "prototypes.h"
|
||||
#include "shadowlog.h"
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <lastlog.h>
|
||||
#endif /* ENABLE_LASTLOG */
|
||||
|
||||
#include "attr.h"
|
||||
#include "defines.h"
|
||||
#include "commonio.h"
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <shadow.h>
|
||||
|
||||
#include "attr.h"
|
||||
#include "prototypes.h"
|
||||
#include "defines.h"
|
||||
#include "pwauth.h"
|
||||
|
||||
@@ -16,8 +16,12 @@
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include <selinux/selinux.h>
|
||||
|
||||
#include <semanage/semanage.h>
|
||||
|
||||
#include "attr.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
#include "shadowlog_internal.h"
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "attr.h"
|
||||
#include "defines.h"
|
||||
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "attr.h"
|
||||
#include "defines.h"
|
||||
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <getopt.h>
|
||||
|
||||
#include "attr.h"
|
||||
#include "defines.h"
|
||||
#include "prototypes.h"
|
||||
/*@-exitarg@*/
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include "agetpass.h"
|
||||
#include "alloc.h"
|
||||
#include "attr.h"
|
||||
#include "defines.h"
|
||||
#include "groupio.h"
|
||||
#include "memzero.h"
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <unistd.h>
|
||||
#include <getopt.h>
|
||||
|
||||
#include "attr.h"
|
||||
#include "nscd.h"
|
||||
#include "sssd.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
#include <unistd.h>
|
||||
#include <grp.h>
|
||||
#include <getopt.h>
|
||||
|
||||
#include "attr.h"
|
||||
#include "nscd.h"
|
||||
#include "sssd.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <assert.h>
|
||||
|
||||
#include "alloc.h"
|
||||
#include "attr.h"
|
||||
#include "defines.h"
|
||||
#include "faillog.h"
|
||||
#include "failure.h"
|
||||
|
||||
1
src/su.c
1
src/su.c
@@ -47,6 +47,7 @@
|
||||
#endif /* !USE_PAM */
|
||||
|
||||
#include "alloc.h"
|
||||
#include "attr.h"
|
||||
#include "prototypes.h"
|
||||
#include "defines.h"
|
||||
#include "pwauth.h"
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include "agetpass.h"
|
||||
#include "attr.h"
|
||||
#include "defines.h"
|
||||
#include "getdef.h"
|
||||
#include "memzero.h"
|
||||
|
||||
Reference in New Issue
Block a user