2011-01-17 17:43:05 +01:00
|
|
|
From: Jeff Mahoney <jeffm@suse.com>
|
|
|
|
Subject: apparmor: Use _GNU_SOURCE when asprintf is used
|
|
|
|
|
|
|
|
There are a few places in the parser that use asprintf but don't actually
|
|
|
|
get the prototype from stdio.h. _GNU_SOURCE is needed for that.
|
|
|
|
|
|
|
|
It works as-is but rpmlint in the openSUSE Build Service complains about it.
|
|
|
|
|
|
|
|
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
|
|
|
|
---
|
|
|
|
parser/Makefile.am | 1 +
|
|
|
|
parser/parser_include.c | 2 ++
|
|
|
|
parser/parser_interface.c | 1 +
|
|
|
|
parser/parser_lex.l | 4 ++++
|
|
|
|
parser/parser_main.c | 1 +
|
|
|
|
parser/parser_variable.c | 1 +
|
|
|
|
6 files changed, 10 insertions(+)
|
|
|
|
|
|
|
|
--- a/parser/Makefile.am
|
|
|
|
+++ b/parser/Makefile.am
|
|
|
|
@@ -14,6 +14,7 @@ dist_man_MANS = apparmor.d.5 apparmor.7
|
|
|
|
BUILT_SOURCES = parser_lex.c parser_yacc.c af_names.h cap_names.h
|
|
|
|
AM_YFLAGS = -d
|
|
|
|
AM_CFLAGS = -DLOCALEDIR=\"$(localedir)\"
|
|
|
|
+AM_LFLAGS = -D_GNU_SOURCE
|
|
|
|
apparmor_parser_SOURCES = parser_yacc.y parser_lex.l parser_include.c \
|
|
|
|
parser_interface.c parser_main.c parser_misc.c \
|
|
|
|
parser_merge.c parser_symtab.c parser_regex.c \
|
|
|
|
--- a/parser/parser_include.c
|
|
|
|
+++ b/parser/parser_include.c
|
|
|
|
@@ -35,6 +35,8 @@
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
+#define _GNU_SOURCE /* for asprintf in stdio.h */
|
|
|
|
+
|
|
|
|
#include <assert.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
--- a/parser/parser_interface.c
|
|
|
|
+++ b/parser/parser_interface.c
|
2011-03-25 09:04:51 +01:00
|
|
|
@@ -15,6 +15,7 @@
|
2011-01-17 17:43:05 +01:00
|
|
|
* along with this program; if not, contact Novell, Inc.
|
|
|
|
*/
|
|
|
|
|
|
|
|
+#define _GNU_SOURCE /* for asprintf in stdio.h */
|
|
|
|
#include <assert.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
--- a/parser/parser_lex.l
|
|
|
|
+++ b/parser/parser_lex.l
|
|
|
|
@@ -20,6 +20,10 @@
|
|
|
|
/* Definitions section */
|
|
|
|
/* %option main */
|
|
|
|
|
|
|
|
+%{
|
|
|
|
+#define _GNU_SOURCE /* for asprintf in stdio.h */
|
|
|
|
+%}
|
|
|
|
+
|
|
|
|
/* eliminates need to link with libfl */
|
|
|
|
%option noyywrap
|
2011-03-25 09:04:51 +01:00
|
|
|
%option nounput
|
2011-01-17 17:43:05 +01:00
|
|
|
--- a/parser/parser_main.c
|
|
|
|
+++ b/parser/parser_main.c
|
2011-03-25 09:04:51 +01:00
|
|
|
@@ -19,6 +19,7 @@
|
|
|
|
* Ltd.
|
2011-01-17 17:43:05 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
+#define _GNU_SOURCE /* for asprintf in stdio.h */
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
--- a/parser/parser_variable.c
|
|
|
|
+++ b/parser/parser_variable.c
|
2011-03-25 09:04:51 +01:00
|
|
|
@@ -15,6 +15,7 @@
|
2011-01-17 17:43:05 +01:00
|
|
|
* along with this program; if not, contact Novell, Inc.
|
|
|
|
*/
|
|
|
|
|
|
|
|
+#define _GNU_SOURCE /* for asprintf in stdio.h */
|
2011-03-25 09:04:51 +01:00
|
|
|
#include <ctype.h>
|
|
|
|
#include <stdlib.h>
|
2011-01-17 17:43:05 +01:00
|
|
|
#include <stdio.h>
|