mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 16:35:02 +01:00
fix bnc#304205. This results in the following warning, when a profile already
exits but doesn't have a flags=(X) component. Use of uninitialized value in substitution (s///) at /usr/lib/perl5/vendor_perl/Immunix/SubDomain.pm line 4687 (#1) (W uninitialized) An undefined value was used as if it were already defined. It was interpreted as a "" or a 0, but maybe it was a mistake. To suppress this warning assign a defined value to your variables. To help you figure out what was undefined, perl tells you what operation you used the undefined value in. Note, however, that perl optimizes your program and the operation displayed in the warning may not necessarily appear literally in your program. For example, "that $foo" is usually optimized into "that " . $foo, and the warning will refer to the concatenation (.) operator, even though there is no . in your program.
This commit is contained in:
parent
6eb48919ee
commit
d870116ae5
1 changed files with 1 additions and 2 deletions
|
@ -4620,10 +4620,9 @@ sub getprofileflags {
|
|||
|
||||
if (open(PROFILE, "$filename")) {
|
||||
while (<PROFILE>) {
|
||||
if (m/^\s*\/\S+\s+(flags=\(.+\)\s+)*{\s*$/) {
|
||||
if (m/^\s*\/\S+\s+flags=\((.+)\)\s+{\s*$/) {
|
||||
$flags = $1;
|
||||
close(PROFILE);
|
||||
$flags =~ s/flags=\((.+)\)/$1/;
|
||||
return $flags;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue