b5a1419370
Accepted submit request 65172 from user licensedigger OBS-URL: https://build.opensuse.org/request/show/65172 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/apparmor?expand=0&rev=14
83 lines
2.2 KiB
Plaintext
83 lines
2.2 KiB
Plaintext
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
|
|
@@ -15,6 +15,7 @@
|
|
* 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
|
|
%option nounput
|
|
--- a/parser/parser_main.c
|
|
+++ b/parser/parser_main.c
|
|
@@ -19,6 +19,7 @@
|
|
* Ltd.
|
|
*/
|
|
|
|
+#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
|
|
@@ -15,6 +15,7 @@
|
|
* along with this program; if not, contact Novell, Inc.
|
|
*/
|
|
|
|
+#define _GNU_SOURCE /* for asprintf in stdio.h */
|
|
#include <ctype.h>
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|