mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-31 06:16:03 +00:00
This (updated) patch to trunk adds support for Px and Ux (toggle bprm_secure on exec) in the parser, As requested, lowercase p and u corresponds to an unfiltered environmnet on exec, uppercase will filter the environment. It applies after the 'm' patch. As a side effect, I tried to reduce the use of hardcoded characters in the debugging statements -- there are still a few warnings that have hard coded letters in them; not sure I can fix them all. This version issues a warning for every unsafe ux and issues a single warning for the first 'R', 'W', 'X', 'L', and 'I' it encounters, except when the "-q" or "--quiet" flag , "--remove" profile flag, or "-N" report names flags are passed. Unfortunately, it made the logic somewhat more convoluted. Wordsmithing improvements welcome.
This commit is contained in:
@@ -105,8 +105,10 @@ struct var_string {
|
||||
#define COD_EXEC_CHAR 'x'
|
||||
#define COD_INHERIT_CHAR 'i'
|
||||
#define COD_LINK_CHAR 'l'
|
||||
#define COD_UNCONSTRAINED_CHAR 'u'
|
||||
#define COD_PROFILE_CHAR 'p'
|
||||
#define COD_UNCONSTRAINED_CHAR 'U'
|
||||
#define COD_UNSAFE_UNCONSTRAINED_CHAR 'u'
|
||||
#define COD_PROFILE_CHAR 'P'
|
||||
#define COD_UNSAFE_PROFILE_CHAR 'p'
|
||||
#define COD_MMAP_CHAR 'm'
|
||||
|
||||
#define OPTION_ADD 1
|
||||
@@ -121,9 +123,6 @@ struct var_string {
|
||||
#endif
|
||||
#define NPDEBUG(fmt, args...) /* Do nothing */
|
||||
|
||||
/* FIXME: PWARN needs to become a true function so we can i18n-ize calls
|
||||
* to it */
|
||||
#define PWARN(fmt, args...) fprintf(stderr, _("Warning (line %d): " fmt), current_lineno, ## args)
|
||||
#define PERROR(fmt, args...) fprintf(stderr, fmt, ## args)
|
||||
|
||||
#ifndef TRUE
|
||||
@@ -147,6 +146,7 @@ extern char *profilename;
|
||||
|
||||
/* from parser_main */
|
||||
extern int force_complain;
|
||||
extern void pwarn(char *fmt, ...) __attribute__((__format__(__printf__, 1, 2)));
|
||||
|
||||
extern int yyparse(void);
|
||||
extern void yyerror(char *msg, ...);
|
||||
|
Reference in New Issue
Block a user