Hello community,
here is the log from the commit of package apparmor-parser for openSUSE:Factory
checked in at Thu Feb 4 09:10:12 CET 2010.
--------
--- apparmor-parser/apparmor-parser.changes 2009-12-24 22:42:18.000000000 +0100
+++ /mounts/work_src_done/STABLE/apparmor-parser/apparmor-parser.changes 2010-01-21 23:34:49.000000000 +0100
@@ -1,0 +2,6 @@
+Thu Jan 21 23:26:41 CET 2010 - jeffm@suse.de
+
+- Display correct line numbers while reporting errors (bnc#520013)
+- Fix handling of removing profiles with whitespace (bnc#510740)
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
New:
----
apparmor-parser-line-numbers
apparmor-parser-removal-whitespace-fix
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ apparmor-docs.spec ++++++
--- /var/tmp/diff_new_pack.Ew3oa6/_old 2010-02-04 09:09:32.000000000 +0100
+++ /var/tmp/diff_new_pack.Ew3oa6/_new 2010-02-04 09:09:32.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package apparmor-docs (Version 2.3.1)
#
-# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -32,7 +32,7 @@
%endif
Summary: AppArmor Documentation package
Version: 2.3.1
-Release: 13
+Release: 14
Group: Documentation/Other
Source0: apparmor-parser-%{version}-1349.tar.gz
License: GPLv2
++++++ apparmor-parser.spec ++++++
--- /var/tmp/diff_new_pack.Ew3oa6/_old 2010-02-04 09:09:32.000000000 +0100
+++ /var/tmp/diff_new_pack.Ew3oa6/_new 2010-02-04 09:09:32.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package apparmor-parser (Version 2.3.1)
#
-# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -32,13 +32,15 @@
%endif
Summary: AppArmor userlevel parser utility
Version: 2.3.1
-Release: 13
+Release: 14
Group: Productivity/Networking/Security
Source0: %{name}-%{version}-1349.tar.gz
Patch: apparmor-init.patch
Patch1: apparmor-parser_phonet.patch
Patch2: apparmor-parser-rc-exit-code-fix
Patch3: apparmor-startproc.patch
+Patch4: apparmor-parser-line-numbers
+Patch5: apparmor-parser-removal-whitespace-fix
License: GPLv2+
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Url: http://forge.novell.com/modules/xfmod/project/?apparmor
@@ -74,6 +76,8 @@
%patch1
%patch2 -p1
%patch3
+%patch4 -p1
+%patch5 -p1
%build
make clean
++++++ apparmor-parser-line-numbers ++++++
From: Jeff Mahoney
Subject: apparmor-parser: Display correct line numbers while reporting errors
References: bnc#520013
The line number reported as the location of the error only corresponds
to the preprocessed output. It doesn't indicate the file or the real
location, which would be helpful for users.
This patch adds the tracking necessary to handle it.
Signed-off-by: Jeff Mahoney
---
parser_include.c | 2 ++
parser_lex.l | 14 +++++++++++++-
parser_main.c | 12 +++++++++---
parser_yacc.y | 4 ++--
4 files changed, 26 insertions(+), 6 deletions(-)
--- a/parser_include.c
+++ b/parser_include.c
@@ -465,6 +465,7 @@ static int preprocess(FILE * f, char *na
fprintf(out, "\n#source %s\n", name);
} else {
fprintf(out, "\n#included %s\n", name);
+ fprintf(out, "#line %d %s\n", 0, name);
}
while ((c = fgetc(f)) != EOF) {
@@ -476,6 +477,7 @@ static int preprocess(FILE * f, char *na
err = process_include(inc, name, line, out, nest);
if (err)
retval = err;
+ fprintf(out, "#line %d %s\n", line, name);
chdir(cwd);
free(cwd);
free(inc);
--- a/parser_lex.l
+++ b/parser_lex.l
@@ -42,6 +42,7 @@
#define NPDEBUG(fmt, args...) /* Do nothing */
int current_lineno = 1;
+char current_filename[PATH_MAX];
%}
@@ -238,7 +239,18 @@ LT_EQUAL <=
}
#.*\n { /* Comment - ignore */
- current_lineno++;
+ char file[PATH_MAX];
+ int line;
+ int ret;
+
+ ret = sscanf(yytext, "#line %d %s\n",
+ &line, file);
+ if (ret == 2) {
+ strcpy(current_filename, file);
+ current_lineno = line;
+ } else {
+ current_lineno++;
+ }
PDEBUG("Line no++: %d\n", current_lineno);
}
--- a/parser_main.c
+++ b/parser_main.c
@@ -85,6 +85,7 @@ struct option long_options[] = {
{"help", 0, 0, 'h'},
{"replace", 0, 0, 'r'},
{"reload", 0, 0, 'r'}, /* undocumented reload option == replace */
+ {"dry-run", 0, 0, 'z'},
{"version", 0, 0, 'v'},
{"preprocess", 0, 0, 'p'},
{"complain", 0, 0, 'C'},
@@ -101,6 +102,7 @@ struct option long_options[] = {
};
static int debug = 0;
+static int dry_run = 0;
static void display_version(void)
{
@@ -161,7 +163,7 @@ static int process_args(int argc, char *
int count = 0;
option = OPTION_ADD;
- while ((c = getopt_long(argc, argv, "adf:hrRvpI:b:BCNSm:qn:", long_options, &o)) != -1)
+ while ((c = getopt_long(argc, argv, "adf:hrRvpI:b:BCNSm:qn:z", long_options, &o)) != -1)
{
switch (c) {
case 0:
@@ -176,6 +178,9 @@ static int process_args(int argc, char *
case 'd':
debug++;
break;
+ case 'z':
+ dry_run++;
+ break;
case 'h':
display_usage(progname);
exit(0);
@@ -337,7 +342,7 @@ int have_enough_privilege(void)
uid = getuid();
euid = geteuid();
- if (uid != 0 && euid != 0) {
+ if (uid != 0 && euid != 0 && !dry_run) {
PERROR(_("%s: Sorry. You need root privileges to run this program.\n\n"),
progname);
display_usage(progname);
@@ -533,7 +538,8 @@ int process_profile(int option, char *pr
die_if_any_regex();
}
- retval = load_policy(option);
+ if (!dry_run)
+ retval = load_policy(option);
out:
return retval;
--- a/parser_yacc.y
+++ b/parser_yacc.y
@@ -58,7 +58,7 @@
static struct flagval force_complain_flags = {0, 1, 0};
/* from lex_config, for nice error messages */
-/* extern char *current_file; */
+extern char current_filename[];
extern int current_lineno;
struct value_list {
@@ -1073,7 +1073,7 @@ void yyerror(char *msg, ...)
if (profilename) {
PERROR(_("AppArmor parser error in %s at line %d: %s\n"),
- profilename, current_lineno, buf);
+ current_filename, current_lineno, buf);
} else {
PERROR(_("AppArmor parser error, line %d: %s\n"),
current_lineno, buf);
++++++ apparmor-parser-removal-whitespace-fix ++++++
From: Jeff Mahoney
Subject: apparmor-parser: Fix handling of removing profiles with whitespace
References: bnc#510740
The loop that iterates over the profile list doesn't properly handle
whitespace in the profile name.
This patch properly handles it line-by-line instead of using whitespace
as a separator.
Signed-off-by: Jeff Mahoney
---
rc.apparmor.functions | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/rc.apparmor.functions
+++ b/rc.apparmor.functions
@@ -378,7 +378,7 @@ remove_profiles() {
#them so stor to tmp first
MODULE_PLIST=$(mktemp ${APPARMOR_TMPDIR}/tmp.XXXXXXXX)
sed -e "s/ (\(enforce\|complain\))$//" "$SFS_MOUNTPOINT/profiles" | sort >"$MODULE_PLIST"
- cat "$MODULE_PLIST" | while read profile ; do
+ cat "$MODULE_PLIST" | while IFS= read profile ; do
echo -n "$profile" > "$SFS_MOUNTPOINT/.remove"
rc=$?
if [ ${rc} -ne 0 ] ; then
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org