From 934e00a1de4df4df69ea34f7cc7ff5e63973140d Mon Sep 17 00:00:00 2001 From: John Johansen Date: Thu, 29 May 2008 18:58:18 +0000 Subject: [PATCH] commit patch provided by arekm - remove bashism from initscript - fix segfault in apparmor_parser on x86-64 --- parser/parser_lex.l | 3 +-- parser/rc.apparmor.functions | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/parser/parser_lex.l b/parser/parser_lex.l index 0af21ed20..04ffae9b2 100644 --- a/parser/parser_lex.l +++ b/parser/parser_lex.l @@ -389,8 +389,7 @@ LT_EQUAL <= [^\n] { /* Something we didn't expect */ - yylval = (YYSTYPE) strdup(yytext); - yyerror(_("Found unexpected character: '%s'"), yylval); + yyerror(_("Found unexpected character: '%s'"), yytext); } %% diff --git a/parser/rc.apparmor.functions b/parser/rc.apparmor.functions index 7782bc19e..68d39f2af 100644 --- a/parser/rc.apparmor.functions +++ b/parser/rc.apparmor.functions @@ -374,8 +374,8 @@ remove_profiles() { retval=0 sed -e "s/ (\(enforce\|complain\))$//" "$SFS_MOUNTPOINT/profiles" | while read profile ; do - if [ ${profile:0:1} eq "/" ] ; then - $profile = "profile_$profile"; + if ( echo "${profile}" | grep -q "^/" ] ; then + profile="profile_$profile"; fi echo "\"$profile\" { }" | $PARSER -R >/dev/null rc=$?