Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.4
apparmor.import4816
genprof-whitespace-in-profile-fix
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File genprof-whitespace-in-profile-fix of Package apparmor.import4816
From: Jeff Mahoney <jeffm@suse.com> Subject: apparmor-utils: setprofileflags() drops leading whitespace References: bnc#480795 setprofileflags() drops leading whitespace for subprofiles. writeheader() properly indents subprofiles 2 spaces per nesting level but when genprof sets the profile to enforce mode at completion, the whitespace is removed. This patch adds the whitespace globbing to the regexp and uses it to prefix the sub-profile with the correct spacing. Reported at: https://bugzilla.novell.com/show_bug.cgi?id=480795 Signed-off-by: Jeff Mahoney <jeffm@suse.com> --- utils/SubDomain.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/utils/SubDomain.pm +++ b/utils/SubDomain.pm @@ -1033,13 +1033,13 @@ sub setprofileflags ($$) { if (open(PROFILE, "$filename")) { if (open(NEWPROFILE, ">$filename.new")) { while (<PROFILE>) { - if (m/^\s*(("??\/.+?"??)|(profile\s+("??.+?"??)))\s+(flags=\(.+\)\s+)*\{\s*$/) { - my ($binary, $flags) = ($1, $5); + if (m/^(\s*)(("??\/.+?"??)|(profile\s+("??.+?"??)))\s+(flags=\(.+\)\s+)*\{\s*$/) { + my ($space, $binary, $flags) = ($1, $2, $6); if ($newflags) { - $_ = "$binary flags=($newflags) {\n"; + $_ = "$space$binary flags=($newflags) {\n"; } else { - $_ = "$binary {\n"; + $_ = "$space$binary {\n"; } } elsif (m/^(\s*\^\S+)\s+(flags=\(.+\)\s+)*\{\s*$/) { my ($hat, $flags) = ($1, $2);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor