mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-31 14:25:52 +00:00
parser: Fix parser failing to handle errors when setting up work
The parser is not correctly handling some error conditions when dealing with work units. Failure to spawn work, access files, etc should be returned where appropriate, and be able to abort processing if abort_on_error is set. In addition some errors are leading to a direct exit without checking for abort_on_error. BugLink: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=921866 BugLink: http://bugs.launchpad.net/bugs/1815294 Signed-off-by: John Johansen <john.johansen@canonical.com> Acked-by: Eric Chiang <ericchiang@google.com>
This commit is contained in:
@@ -171,13 +171,23 @@ extern int preprocess_only;
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
#define PDEBUG(fmt, args...) fprintf(stderr, "parser: " fmt, ## args)
|
||||
#define PDEBUG(fmt, args...) \
|
||||
do { \
|
||||
int pdebug_error = errno; \
|
||||
fprintf(stderr, "parser: " fmt, ## args); \
|
||||
errno = pdebug_error; \
|
||||
} while (0)
|
||||
#else
|
||||
#define PDEBUG(fmt, args...) /* Do nothing */
|
||||
#endif
|
||||
#define NPDEBUG(fmt, args...) /* Do nothing */
|
||||
|
||||
#define PERROR(fmt, args...) fprintf(stderr, fmt, ## args)
|
||||
#define PERROR(fmt, args...) \
|
||||
do { \
|
||||
int perror_error = errno; \
|
||||
fprintf(stderr, fmt, ## args); \
|
||||
errno = perror_error; \
|
||||
} while (0)
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE (1)
|
||||
|
Reference in New Issue
Block a user