File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1199,17 +1199,6 @@ static int str2event(char *s, au_event_t *e)
11991199 return 0 ;
12001200}
12011201
1202- #ifndef HAVE_STRNDUPA
1203- #define strndupa (s , n ) \
1204- ({ \
1205- const char *__old = (s); \
1206- size_t __len = strnlen (__old, (n)); \
1207- char *__new = (char *) alloca(__len + 1); \
1208- __new[__len] = '\0'; \
1209- (char *) memcpy (__new, __old, __len); \
1210- })
1211- #endif
1212-
12131202/* Returns 0 on success and 1 on error */
12141203static int extract_timestamp (const char * b , au_event_t * e )
12151204{
Original file line number Diff line number Diff line change 2323#ifndef AUDIT_COMMON_HEADER
2424#define AUDIT_COMMON_HEADER
2525
26+ #include "config.h"
2627#include <limits.h> /* POSIX_HOST_NAME_MAX */
2728#ifdef HAVE_ATOMIC
2829#include <stdatomic.h>
4647// Used in auditd-event.c and audisp.c to size buffers for formatting
4748#define FORMAT_BUF_LEN (MAX_AUDIT_MESSAGE_LENGTH + _POSIX_HOST_NAME_MAX)
4849
50+ #ifndef HAVE_STRNDUPA
51+ #define strndupa (s , n ) \
52+ ({ \
53+ const char *__old = (s); \
54+ size_t __len = strnlen (__old, (n)); \
55+ char *__new = (char *) alloca(__len + 1); \
56+ __new[__len] = '\0'; \
57+ (char *) memcpy (__new, __old, __len); \
58+ })
59+ #endif
60+
4961AUDIT_HIDDEN_START
5062
5163char * audit_strsplit_r (char * s , char * * savedpp );
Original file line number Diff line number Diff line change @@ -162,17 +162,6 @@ static int compare_event_time(event *e1, event *e2)
162162 return 0 ;
163163}
164164
165- #ifndef HAVE_STRNDUPA
166- #define strndupa (s , n ) \
167- ({ \
168- const char *__old = (s); \
169- size_t __len = strnlen (__old, (n)); \
170- char *__new = (char *) alloca(__len + 1); \
171- __new[__len] = '\0'; \
172- (char *) memcpy (__new, __old, __len); \
173- })
174- #endif
175-
176165/*
177166 * This function will look at the line and pick out pieces of it.
178167 */
You can’t perform that action at this time.
0 commit comments